/* ============================================================
   Value Bets Today — trading-desk dark theme
   ============================================================ */

:root {
  --edge-hot:   #10B981;
  --edge-warm:  #F59E0B;
  --edge-cool:  #F43F5E;
  --edge-model: #22D3EE;
  --grid-line:  rgba(16, 185, 129, 0.45);
}

html, body { background: #09090b; }

/* Subtle trading-grid background pattern */
#grid-bg {
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse 100% 70% at 50% 30%, black 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 100% 70% at 50% 30%, black 40%, transparent 90%);
}

/* Monospace defaults for ALL numbers */
.num, table tbody td, .hero-odd, .hero-edge, #date-display, #quota-text {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

/* ============================================================ */
/* Hero cards                                                   */
/* ============================================================ */

.hero-card {
  position: relative;
  border-radius: 0.75rem;
  padding: 1px;
  background: linear-gradient(135deg, rgba(16,185,129,0.5), rgba(34,211,238,0.2) 40%, rgba(244,63,94,0.0) 80%);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.hero-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px -10px rgba(16,185,129,0.35);
}
.hero-card.is-warm {
  background: linear-gradient(135deg, rgba(245,158,11,0.45), rgba(34,211,238,0.15) 40%, transparent 80%);
}
.hero-card.is-cool {
  background: linear-gradient(135deg, rgba(244,63,94,0.45), rgba(244,63,94,0.1) 40%, transparent 80%);
}
.hero-card .inner {
  border-radius: 0.7rem;
  background: linear-gradient(180deg, rgba(20,20,23,0.95), rgba(9,9,11,0.95));
  padding: 1rem 1.1rem 1.1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-edge {
  font-size: 2.25rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero-edge.hot  { color: var(--edge-hot); text-shadow: 0 0 18px rgba(16,185,129,0.35); }
.hero-edge.warm { color: var(--edge-warm); }
.hero-edge.cool { color: var(--edge-cool); }

.hero-skel {
  height: 170px;
  border-radius: 0.75rem;
  background: linear-gradient(110deg, #18181b 0%, #27272a 30%, #18181b 60%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  0%   { background-position: -100% 0; }
  100% { background-position: 100% 0; }
}

/* Animated odd value changes */
.odd-flash-up {
  animation: flash-up 300ms ease;
}
.odd-flash-down {
  animation: flash-down 300ms ease;
}
@keyframes flash-up {
  0%   { background: rgba(16,185,129,0.35); }
  100% { background: transparent; }
}
@keyframes flash-down {
  0%   { background: rgba(244,63,94,0.35); }
  100% { background: transparent; }
}

/* ============================================================ */
/* Sortable table                                               */
/* ============================================================ */

.th {
  user-select: none;
  transition: color 0.15s ease;
  white-space: nowrap;
}
.th:hover { color: #e4e4e7; }
.th.sort-asc::after  { content: ' ▲'; color: var(--edge-hot); }
.th.sort-desc::after { content: ' ▼'; color: var(--edge-hot); }

.trading-grid {
  background-image:
    linear-gradient(to right, rgba(16,185,129,0.04) 1px, transparent 1px);
  background-size: 8.33% 100%;
}

tr.fixture-row {
  cursor: pointer;
  transition: background 0.15s ease;
}
tr.fixture-row:hover {
  background: rgba(63,63,70,0.25);
}
tr.fixture-row.is-expanded {
  background: rgba(16,185,129,0.05);
}
tr.fixture-row td {
  padding: 0.65rem 0.75rem;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
}
.pill.w { background: rgba(16,185,129,0.2); color: var(--edge-hot); }
.pill.d { background: rgba(161,161,170,0.2); color: #d4d4d8; }
.pill.l { background: rgba(244,63,94,0.2); color: var(--edge-cool); }

.edge-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 0.3rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.78rem;
}
.edge-badge.hot  { background: rgba(16,185,129,0.15); color: var(--edge-hot); border: 1px solid rgba(16,185,129,0.4); }
.edge-badge.warm { background: rgba(245,158,11,0.13); color: var(--edge-warm); border: 1px solid rgba(245,158,11,0.35); }
.edge-badge.cool { background: rgba(244,63,94,0.13); color: var(--edge-cool); border: 1px solid rgba(244,63,94,0.35); }
.edge-badge.neutral { background: rgba(161,161,170,0.1); color: #a1a1aa; border: 1px solid rgba(161,161,170,0.25); }

/* Expanded panel */
tr.expansion td {
  padding: 0 !important;
  background: rgba(9,9,11,0.65) !important;
}
.expansion-inner {
  padding: 1.25rem 1.5rem;
  border-top: 1px dashed rgba(63,63,70,0.6);
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .expansion-inner { grid-template-columns: 1.4fr 1fr; }
}

.book-grid {
  display: grid;
  grid-template-columns: auto repeat(3, 1fr);
  gap: 1px;
  background: rgba(63,63,70,0.5);
  border: 1px solid rgba(63,63,70,0.5);
  border-radius: 0.4rem;
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}
.book-cell {
  background: #18181b;
  padding: 0.45rem 0.6rem;
  text-align: center;
}
.book-cell.head {
  background: #0c0c0e;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.65rem;
  font-weight: 600;
}
.book-cell.row-head {
  background: #0c0c0e;
  text-align: left;
  font-weight: 600;
  color: #d4d4d8;
}
.book-cell.cheapest {
  color: var(--edge-hot);
  font-weight: 700;
  background: rgba(16,185,129,0.08);
}

.advice-card {
  background: rgba(34,211,238,0.05);
  border: 1px solid rgba(34,211,238,0.3);
  border-radius: 0.4rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.8rem;
  color: #a5f3fc;
}
.advice-card strong { color: var(--edge-model); font-weight: 600; }

.compare-bar {
  display: grid;
  grid-template-columns: 70px 1fr 1fr 1fr;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  gap: 0.5rem;
  padding: 0.15rem 0;
}
.compare-bar .lbl { color: #71717a; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.65rem; }
.compare-bar .bar { height: 6px; border-radius: 3px; background: rgba(63,63,70,0.6); overflow: hidden; position: relative; }
.compare-bar .bar > span { display: block; height: 100%; }
.compare-bar .pct { text-align: right; color: #d4d4d8; }

/* Loading skeleton rows */
.skel-row td {
  background: linear-gradient(110deg, #0e0e10 0%, #1a1a1d 30%, #0e0e10 60%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  color: transparent !important;
}

/* Refresh spinner pulse */
.is-refreshing #refresh-icon {
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.is-refreshing #refresh-btn {
  background: rgba(16,185,129,0.25);
}

/* Status dot */
#status-dot.is-busy  { background: var(--edge-warm); animation: pulse-dot 1.2s ease-in-out infinite; }
#status-dot.is-ready { background: var(--edge-hot); }
#status-dot.is-error { background: var(--edge-cool); }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* Injury banner */
.injury-banner {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 0.4rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: #fde68a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Model pick chip on hero */
.model-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.45rem;
  border-radius: 0.3rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(34,211,238,0.12);
  color: var(--edge-model);
  border: 1px solid rgba(34,211,238,0.35);
}

/* Best book tag */
.book-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(63,63,70,0.5);
  color: #d4d4d8;
  border: 1px solid rgba(82,82,91,0.5);
}

/* Team logo helper */
.team-logo {
  width: 22px; height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}
.team-logo-lg { width: 36px; height: 36px; }

/* Mini explainer box */
.why-box {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(9,9,11,0.7);
  border: 1px dashed rgba(63,63,70,0.7);
  border-radius: 0.4rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.7rem;
  color: #a1a1aa;
  line-height: 1.6;
  margin-top: 0.6rem;
}
.why-box .k { color: #71717a; }
.why-box .v { color: #e4e4e7; }
.why-box .v.hot { color: var(--edge-hot); }

/* ============================================================ */
/* Explainer section · Model vs Market                          */
/* ============================================================ */

.explainer-hero {
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(34,211,238,0.08), transparent 60%),
    radial-gradient(ellipse 80% 50% at 80% 100%, rgba(16,185,129,0.08), transparent 60%),
    linear-gradient(180deg, rgba(20,20,23,0.6), rgba(9,9,11,0.6));
}

.text-edge-model { color: var(--edge-model); }
.text-edge-hot   { color: var(--edge-hot); }

.explainer-table th { vertical-align: top; }
.explainer-table tr:hover td { background: rgba(63,63,70,0.15); }
.explainer-table code {
  background: rgba(245,158,11,0.1);
  padding: 0.05rem 0.3rem;
  border-radius: 0.2rem;
  font-size: 0.8em;
}

/* Simulator inputs */
.sim-input { display: flex; flex-direction: column; gap: 0.35rem; }
.sim-input label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a1a1aa;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sim-input .sim-val {
  color: var(--edge-warm);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: none;
  letter-spacing: 0;
  tabular-nums: 1;
  font-variant-numeric: tabular-nums;
}
.sim-input.model .sim-val { color: var(--edge-model); }

.sim-input input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, rgba(245,158,11,0.5), rgba(245,158,11,0.2));
  outline: none;
  cursor: pointer;
}
.sim-input.model input[type="range"] {
  background: linear-gradient(to right, rgba(34,211,238,0.5), rgba(34,211,238,0.2));
}
.sim-input input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fbbf24;
  border: 2px solid #18181b;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(245,158,11,0.5);
  transition: transform 0.15s ease;
}
.sim-input.model input[type="range"]::-webkit-slider-thumb {
  background: #22d3ee;
  box-shadow: 0 0 8px rgba(34,211,238,0.5);
}
.sim-input input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
.sim-input input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fbbf24;
  border: 2px solid #18181b;
  cursor: pointer;
}
.sim-input.model input[type="range"]::-moz-range-thumb { background: #22d3ee; }

/* Simulator bars (live comparison) */
.sim-bar-row {
  display: grid;
  grid-template-columns: 60px 1fr 70px;
  gap: 0.6rem;
  align-items: center;
}
.sim-bar-row .sim-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a1a1aa;
  font-weight: 600;
}
.sim-bar-row.is-best .sim-label { color: var(--edge-hot); }
.sim-bar-row .sim-bar-stack {
  position: relative;
  height: 30px;
  background: rgba(63,63,70,0.25);
  border-radius: 0.3rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sim-bar-row .sim-bar-market,
.sim-bar-row .sim-bar-model {
  height: 50%;
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(9,9,11,0.85);
  font-weight: 700;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  overflow: hidden;
}
.sim-bar-row .sim-bar-market {
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
}
.sim-bar-row .sim-bar-model {
  background: linear-gradient(90deg, #22D3EE, #67E8F9);
}
.sim-bar-row .sim-edge-cell {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.sim-bar-row .sim-edge-cell.hot  { color: var(--edge-hot); }
.sim-bar-row .sim-edge-cell.warm { color: var(--edge-warm); }
.sim-bar-row .sim-edge-cell.cool { color: var(--edge-cool); }
.sim-bar-row .sim-edge-cell.neutral { color: #71717a; }

/* Best-outcome edge readout */
#sim-best-edge.hot  { color: var(--edge-hot); text-shadow: 0 0 18px rgba(16,185,129,0.35); }
#sim-best-edge.warm { color: var(--edge-warm); }
#sim-best-edge.cool { color: var(--edge-cool); }
#sim-best-edge.neutral { color: #a1a1aa; }

/* Caveat cards */
.caveat-card {
  background: rgba(20,20,23,0.6);
  border: 1px solid rgba(63,63,70,0.5);
  border-radius: 0.6rem;
  padding: 1rem 1.1rem;
  transition: border-color 0.2s ease;
}
.caveat-card:hover { border-color: rgba(82,82,91,0.8); }
.caveat-icon {
  font-size: 1.25rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.caveat-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e4e4e7;
  margin-bottom: 0.4rem;
}
.caveat-body {
  font-size: 0.75rem;
  color: #a1a1aa;
  line-height: 1.55;
}
