:root {
  --bg: #0b0e14;
  --bg-2: #0e1220;
  --panel: #131822;
  --panel-2: #1a2130;
  --border: #262e3f;
  --text: #eef1f7;
  --muted: #8b95a8;
  --home: #4f8cff;
  --away: #ff8a4f;
  --green: #35c98f;
  --gold: #ffcc4d;
  --red: #ff6b6b;
  --radius: 14px;
  --team-color: #6b7690;
}

* { box-sizing: border-box; }

#nav-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  opacity: 0;
  background: linear-gradient(90deg, var(--gold), var(--away));
  z-index: 9999;
  pointer-events: none;
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 15% -10%, rgba(79, 140, 255, 0.10), transparent),
    radial-gradient(1200px 500px at 90% 0%, rgba(255, 138, 79, 0.08), transparent),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(19, 24, 34, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-mark { font-size: 1.4rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small { font-size: 0.68rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }

/* Brand on the left, everything else as one right-aligned group, so the
   header reads as a single control strip rather than stacked bands. */
.nav-group { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
.section-nav { display: flex; gap: 4px; flex-wrap: wrap; min-width: 0; }
.page-link-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.section-tab {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.15s, background 0.15s;
}
.section-tab:hover { color: var(--text); background: var(--panel-2); }
.section-tab:active { transform: scale(0.97); }
/* The active section is marked by a weight/colour change and an underline
   rather than a filled pill. The old filled pills made every tab read as a
   button of equal importance, which is exactly what made a second row of
   them (the leagues) so confusing to scan. */
.section-tab.active {
  color: var(--text);
  background: var(--panel-2);
  box-shadow: inset 0 -2px 0 var(--gold);
}

/* Sport scope picker. Deliberately styled UNLIKE the section tabs - it is a
   filter that says what you are looking at, not another place to go. */
.scope-picker { position: relative; flex: none; }
.scope-picker > summary {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  font-size: 0.9rem; font-weight: 700; color: var(--bg);
  background: linear-gradient(135deg, #ffcc4d, #ff8a4f);
  list-style: none; white-space: nowrap;
}
.scope-picker > summary::-webkit-details-marker { display: none; }
.scope-picker > summary::after { content: "▾"; font-size: 0.72rem; opacity: 0.75; }
.scope-picker[open] > summary::after { content: "▴"; }
.scope-picker > summary:active { transform: scale(0.97); }
.scope-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  min-width: 190px; padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 14px 30px rgba(0,0,0,0.45);
}
.scope-menu a {
  padding: 8px 12px; border-radius: 8px; text-decoration: none;
  color: var(--muted); font-size: 0.88rem; font-weight: 600; white-space: nowrap;
}
.scope-menu a:hover { color: var(--text); background: var(--panel-2); }
.scope-menu a.scope-on { color: var(--text); background: var(--panel-2); }
.scope-divider {
  margin: 5px 10px 3px; padding-top: 6px; border-top: 1px solid var(--border);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}

/* In-page navigation buttons. These used to borrow .section-tab, which meant
   the site's top-level nav and a mid-page "go look at this" link shared one
   class and one look - part of why the header read as several competing sets
   of the same thing. They keep the old pill treatment; the header no longer
   does. */
.page-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px;
  color: var(--muted); text-decoration: none;
  font-size: 0.9rem; font-weight: 700;
  border: 1px solid var(--border);
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.page-link:hover { color: var(--text); border-color: #3a4560; }
.page-link:active { transform: scale(0.96); }

/* Help is an aside, not a seventh section. */
.nav-help {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); text-decoration: none; font-weight: 800; font-size: 0.85rem;
  border: 1px solid var(--border); transition: color 0.15s, border-color 0.15s;
}
.nav-help:hover { color: var(--text); border-color: #3a4560; }
.nav-help.active { color: var(--gold); border-color: var(--gold); }

/* On a narrow viewport the section tabs scroll sideways instead of wrapping
   into a multi-row block inside the STICKY header - wrapping used to eat
   ~345px of an 812px mobile viewport before any content was visible. The
   scope picker sits OUTSIDE that scroller on purpose: an overflow-x
   container clips absolutely-positioned children, which would have cut off
   its dropdown. */
@media (max-width: 640px) {
  .nav-group { width: 100%; margin-left: 0; }
  .section-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Fade the trailing edge so a half-visible tab reads as "there's more,
       scroll" instead of as text that got chopped off by the help button. */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
  }
  /* Scrollbar would sit on top of the tabs in this height. */
  .section-nav::-webkit-scrollbar { display: none; }
  .section-nav { scrollbar-width: none; }
  .section-tab { flex-shrink: 0; }
  .topbar-row { gap: 10px; }
}

.content { max-width: 1160px; margin: 0 auto; padding: 28px 24px 60px; }

.page-head h1 { margin: 0 0 4px; font-size: 1.7rem; letter-spacing: -0.02em; }
.meta { color: var(--muted); font-size: 0.85rem; margin: 2px 0; line-height: 1.5; }

.empty-state {
  padding: 48px 24px;
  text-align: center;
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 20px;
}

/* Hero "top pick" callout */
.hero-pick {
  display: block;
  margin: 20px 0 28px;
  padding: 2px;
  border-radius: 18px;
  text-decoration: none;
  background: linear-gradient(135deg, var(--team-color), transparent 60%);
  transition: transform 0.15s;
}
.hero-pick:active { transform: scale(0.985); transition-duration: 0.05s; }
.hero-pick-tag {
  padding: 10px 22px 0;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
}
.hero-pick-body {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px 20px;
  background: var(--panel);
  border-radius: 16px;
  color: var(--text);
}
.hero-pick-logo { width: 64px; height: 64px; object-fit: contain; flex-shrink: 0; }
.hero-pick-team { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.hero-pick-text { color: var(--muted); font-size: 0.92rem; margin-top: 3px; }
.hero-pick-pct {
  margin-left: auto;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--team-color);
  flex-shrink: 0;
}
.hero-pick-pct span { display: block; font-size: 0.65rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.game-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.game-card:hover { border-color: #3a4560; transform: translateY(-3px); box-shadow: 0 12px 24px rgba(0,0,0,0.35); }
.game-card:active { transform: translateY(-1px) scale(0.98); transition-duration: 0.05s; }
.game-card.live { border-color: var(--red); }

.game-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 6px; flex-wrap: wrap; }

.status { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.status.in { color: var(--red); font-weight: 800; }

.badge {
  font-size: 0.68rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}
.badge.cold { background: #3a3320; color: var(--gold); }
.badge.value { background: #123a2e; color: var(--green); }
.badge.neutral { background: var(--panel-2); color: var(--muted); }

.rank-badge { font-size: 0.85rem; font-weight: 800; color: var(--gold); }

.matchup-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 10px;
  margin-bottom: 14px;
}

.team { text-align: center; }
.team img { width: 40px; height: 40px; object-fit: contain; margin-bottom: 6px; }
.team-name { font-weight: 700; font-size: 0.95rem; }
.team-record { color: var(--muted); font-size: 0.78rem; }
.team-score { font-size: 1.35rem; font-weight: 800; margin-top: 3px; }
.probable { font-size: 0.7rem; color: var(--muted); margin-top: 6px; line-height: 1.3; }
.team.picked .team-name { color: var(--team-color); }
.team.picked .team-name::after { content: " ✓"; }
.vs { color: var(--muted); font-size: 0.78rem; margin-top: 14px; text-transform: uppercase; letter-spacing: 0.04em; }

.prob-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--panel-2);
  margin-bottom: 8px;
  gap: 2px;
}
.prob-fill { border-radius: 999px; }

.prob-labels { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.78rem; color: var(--muted); margin-bottom: 12px; }
.prob-labels strong { color: var(--text); font-size: 0.95rem; }
.model-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; }
.tier-tag { display: inline-block; margin-top: 3px; font-size: 0.62rem; font-weight: 800; color: var(--text); text-transform: none; letter-spacing: 0; }

.card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  flex-wrap: wrap;
  gap: 4px;
}

.back-link { color: var(--muted); text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.back-link:active { opacity: 0.6; }
.back-link:hover { color: var(--text); }

.detail-head { margin: 18px 0 16px; }
.detail-head h1 { margin-bottom: 4px; font-size: 1.5rem; letter-spacing: -0.02em; }

.summary-banner {
  background: linear-gradient(135deg, color-mix(in srgb, var(--team-color) 22%, var(--panel)), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.summary-caveat { margin-top: 8px; font-size: 0.82rem; font-weight: 500; color: var(--gold); }

.recap-banner {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px 22px;
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }

.team-panel, .vs-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 3px solid var(--team-color);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
}
.vs-panel { border-top-color: var(--border); }
.team-panel img { width: 58px; height: 58px; object-fit: contain; margin-bottom: 8px; }
.team-panel h2 { font-size: 1.1rem; margin: 4px 0; letter-spacing: -0.01em; }
.winpct { font-size: 2.1rem; font-weight: 800; margin: 14px 0 0; color: var(--team-color); }
.winpct span { display: block; font-size: 0.7rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }

.power-gauge { margin: 18px 0 6px; position: relative; }
.gauge-svg { width: 100%; max-width: 150px; }
.gauge-track { fill: none; stroke: var(--panel-2); stroke-width: 10; stroke-linecap: round; }
.gauge-fill { fill: none; stroke: var(--team-color); stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray 0.3s; }
.gauge-value { margin-top: -30px; font-size: 1.3rem; font-weight: 800; }
.gauge-value span { font-size: 0.7rem; font-weight: 600; color: var(--muted); }
.gauge-label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-top: 2px; }

.vs-panel { display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.vs-big { font-size: 1.5rem; font-weight: 800; color: var(--muted); letter-spacing: 0.05em; }
.edge-callout { background: #123a2e; color: var(--green); border-radius: 10px; padding: 12px; font-size: 0.85rem; line-height: 1.4; }
.spread-callout strong { font-size: 1.15rem; display: block; margin-top: 4px; }

.rating-history { margin-top: 24px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.rating-history h3 { margin: 0 0 4px; font-size: 1rem; }
/* The season-long rating chart on the team page reuses .sparkline below
   but isn't inside a .sparkline-row flex container, so that rule's
   "flex: 1" never applies - with no other width constraint, the SVG
   rendered at its raw 700px viewBox width regardless of screen size,
   pushing the whole page into horizontal scroll on mobile (confirmed
   live: 747px page width on a 375px viewport). Scoped to just this
   chart so the small flex-row sparklines below are unaffected. */
.rating-history svg.sparkline { width: 100%; display: block; }
.sparkline-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.sparkline-label { width: 50px; font-size: 0.82rem; font-weight: 700; }
.sparkline { flex: 1; height: 40px; background: var(--panel-2); border-radius: 8px; }

.footer { text-align: center; color: var(--muted); font-size: 0.75rem; padding: 36px 20px; max-width: 640px; margin: 0 auto; line-height: 1.6; }

/* Weather + fantasy outlook chips */
.context-row { display: flex; flex-wrap: wrap; gap: 10px; margin: -10px 0 20px; }
.weather-chip, .outlook-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
}
.outlook-chip { border-color: #4a3a1c; color: var(--gold); background: #241d0f; flex: 1 1 320px; border-radius: 12px; }
.weather-temp { font-weight: 800; }

code { background: var(--panel-2); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }

.props-table { margin-top: 12px; }
.props-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.7fr;
  gap: 10px;
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.props-row:last-child { border-bottom: none; }
.props-player { font-weight: 700; }
.props-market { color: var(--muted); text-transform: capitalize; }
.props-side { font-weight: 600; }
.props-price { text-align: right; font-weight: 700; }
@media (max-width: 600px) { .props-row { grid-template-columns: 1fr 1fr; } }

.outright-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.outright-row:last-child { border-bottom: none; }

.leaderboard-table td, .leaderboard-table th { white-space: nowrap; }
.leaderboard-table td:nth-child(2) { white-space: normal; font-weight: 600; }

.recommend-box {
  background: #123a2e;
  border: 1px solid #1d5a44;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 14px 0 20px;
}
.recommend-title { font-weight: 800; color: var(--green); margin-bottom: 10px; }
.recommend-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  grid-template-areas: "rank player market" ". detail detail";
  gap: 4px 10px;
  padding: 8px 0;
  border-bottom: 1px solid #1d5a44;
  font-size: 0.85rem;
}
.recommend-row:last-of-type { border-bottom: none; }
.recommend-rank { grid-area: rank; color: var(--green); font-weight: 800; }
.recommend-player { grid-area: player; font-weight: 700; }
.recommend-market { grid-area: market; color: var(--muted); font-size: 0.78rem; text-align: right; }
.recommend-detail { grid-area: detail; color: var(--muted); }
.recommend-detail strong { color: var(--green); }
@media (max-width: 500px) {
  .recommend-row { grid-template-columns: 20px 1fr; grid-template-areas: "rank player" ". market" ". detail"; }
  .recommend-market { text-align: left; }
}

/* Compare table (our model vs ESPN vs Vegas) */
.compare-table { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 12px; text-align: left; }
.compare-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 3px 0; }
.compare-row strong { color: var(--text); }

/* Players-to-know panel on game detail */
.players-section { margin-top: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.players-section h3 { margin: 0 0 4px; font-size: 1rem; }
.players-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 14px; }
@media (max-width: 700px) { .players-grid { grid-template-columns: 1fr; } }
.players-col-head { font-weight: 800; font-size: 0.95rem; color: var(--team-color); border-bottom: 2px solid var(--team-color); padding-bottom: 6px; margin-bottom: 8px; }
.leader-list { list-style: none; margin: 0; padding: 0; }
.leader-list li { display: flex; justify-content: space-between; gap: 8px; font-size: 0.82rem; padding: 5px 0; border-bottom: 1px solid var(--border); }
.leader-cat { color: var(--muted); flex: 1; }
.leader-player { font-weight: 600; flex: 1; text-align: right; }
.leader-val { font-weight: 700; width: 50px; text-align: right; }
.mini-injuries { margin-top: 12px; }
.mini-injury { font-size: 0.8rem; padding: 4px 0; display: flex; justify-content: space-between; gap: 8px; }
.mini-injury .injury-status { color: var(--red); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; }

/* Fantasy hub */
.fantasy-section { margin-top: 28px; }
.fantasy-section h2 { font-size: 1.15rem; margin-bottom: 4px; }

.injury-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
  max-height: 480px;
  overflow-y: auto;
  padding: 4px 4px 12px;
  mask-image: linear-gradient(to bottom, black calc(100% - 24px), transparent);
}
.injury-grid::-webkit-scrollbar { width: 8px; }
.injury-grid::-webkit-scrollbar-thumb { background: var(--panel-2); border-radius: 999px; }
.injury-grid::-webkit-scrollbar-track { background: transparent; }
.injury-card { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--red); border-radius: 10px; padding: 14px; }
.injury-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.injury-team { font-size: 0.72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.injury-status { font-size: 0.68rem; font-weight: 800; color: var(--red); text-transform: uppercase; background: #3a1c1c; padding: 2px 8px; border-radius: 999px; }
.injury-name { font-weight: 700; font-size: 0.95rem; }
.injury-note { font-size: 0.76rem; color: var(--muted); margin-top: 4px; line-height: 1.3; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-card h3 { margin: 0 0 10px; font-size: 0.9rem; color: var(--gold); }
.stat-list { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.stat-list li { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; flex-wrap: wrap; }
.stat-list li:last-child { border-bottom: none; }
.stat-list li::before { counter-increment: rank; content: counter(rank); color: var(--muted); font-weight: 700; font-size: 0.75rem; width: 14px; }
.stat-player { font-weight: 700; flex: 1; }
.stat-team { color: var(--muted); font-size: 0.75rem; }
.stat-value { font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Player-comparison form (compare.html) - first real <select>/<form> use
   in this app, styled to match the existing dark panel/pill aesthetic
   rather than default browser chrome. */
.compare-form { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.compare-form-col { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 220px; }
.compare-form-col label { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.compare-form select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; font-family: inherit;
}
.compare-form-vs { color: var(--muted); font-weight: 800; padding-bottom: 10px; }
.compare-submit {
  background: linear-gradient(135deg, #ffcc4d, #ff8a4f); color: var(--bg); border: none;
  border-radius: 10px; padding: 11px 22px; font-weight: 800; font-size: 0.9rem; cursor: pointer;
}
.compare-submit:active { transform: scale(0.97); }
.compare-results { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 20px; }
.compare-col h3 { margin: 0 0 8px; font-size: 1rem; }
@media (max-width: 600px) {
  .compare-results { grid-template-columns: 1fr; }
  /* Below ~480px only one 220px min-width column fits per row, so "vs"
     ends up trailing awkwardly next to Player 1 instead of reading as
     sitting between the two - centering it as its own full-width row
     reads correctly once the columns are stacked. */
  .compare-form-vs { width: 100%; text-align: center; padding: 0; }
}

.pace-tag { font-size: 0.68rem; font-weight: 700; color: var(--muted); background: var(--panel-2); padding: 2px 8px; border-radius: 999px; }
.pace-tag.pace-good { color: var(--green); background: #123a2e; }
.pace-tag.pace-bad { color: var(--muted); background: var(--panel-2); }

/* Per-prop "why this number" disclosure (game_detail). The five real
   signals behind an MLB home-run pace were already being computed and then
   collapsed into one adjusted number with no way to see which one moved
   it. Kept behind a <details> so the scannable list stays scannable -
   same progressive-disclosure pattern as .nerd-details on the Accuracy
   page, rather than a second competing style. */
.prop-detail { width: 100%; margin-top: 6px; }
.prop-detail summary {
  cursor: pointer; font-size: 0.72rem; font-weight: 700; color: var(--muted);
  list-style: none; padding: 2px 0;
}
.prop-detail summary::-webkit-details-marker { display: none; }
.prop-detail summary::before { content: "▸ "; }
.prop-detail[open] summary::before { content: "▾ "; }
.prop-detail summary:hover { color: var(--text); }
.prop-detail-body {
  background: var(--panel-2); border-radius: 10px; padding: 10px 12px; margin-top: 6px;
}
.prop-detail-head {
  font-size: 0.7rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 5px;
}
.factor-up { color: var(--green); }
.factor-down { color: var(--away); }

.power-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.power-row { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; }
.power-rank { width: 20px; color: var(--muted); font-weight: 700; font-size: 0.85rem; }
.power-row img { width: 26px; height: 26px; object-fit: contain; }
.power-name { font-weight: 700; font-size: 0.9rem; min-width: 160px; }
.power-record { min-width: 70px; }
.power-bar-track { flex: 1; height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.power-bar-fill { height: 100%; background: var(--team-color); border-radius: 999px; }
.power-num { width: 30px; text-align: right; font-weight: 800; }
@media (max-width: 600px) { .power-name { min-width: 100px; } .power-record { display: none; } }

.scorecard-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 14px; }
.scorecard { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.scorecard.highlight { border-color: var(--gold); background: linear-gradient(135deg, #241d0f, var(--panel)); }
.scorecard-label { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 8px; }
.scorecard-num { font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: 6px; }

.calibration-wrap { overflow-x: auto; margin-top: 14px; }
.calibration-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.calibration-table th, .calibration-table td { padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.calibration-table th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 800; }
.calibration-table tr:last-child td { border-bottom: none; }

/* Calibration bar: filled portion is the ACTUAL win rate for that predicted
   range; the dashed marker sits at the predicted midpoint - a bar that
   fills right up to (or past) the marker means the model's confidence
   level actually means what it claims. */
.calibration-bar-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.calibration-bar-label { flex: 0 0 90px; font-size: 0.8rem; color: var(--muted); text-align: right; }
.calibration-bar-track { flex: 1; position: relative; height: 18px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; overflow: visible; }
.calibration-bar-fill { position: absolute; inset: 0; width: 0%; background: linear-gradient(90deg, var(--home), var(--gold)); border-radius: 3px; transition: width 0.3s ease; }
.calibration-bar-marker { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: 0.85; }
.calibration-bar-marker::after { content: attr(data-label); position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 0.65rem; color: var(--muted); white-space: nowrap; }
.calibration-bar-n { flex: 0 0 70px; font-size: 0.72rem; color: var(--muted); }

/* Accuracy page: honest headline stat */
.honesty-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  background: linear-gradient(135deg, #1a2130, var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 18px 0 8px;
}
.honesty-num { font-size: 3.4rem; font-weight: 800; line-height: 1; color: var(--gold); flex-shrink: 0; }
.honesty-num span { font-size: 0.5em; }
.honesty-text { font-size: 1.02rem; line-height: 1.4; }
@media (max-width: 560px) { .honesty-hero { flex-direction: column; align-items: flex-start; gap: 10px; } }

/* Progressive disclosure for the technical/statistical detail - a real,
   persistent, keyboard-accessible toggle (not a hover tooltip), per UX
   research on disclosure patterns for technical content. */
.nerd-details { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.nerd-details summary {
  cursor: pointer;
  padding: 12px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.nerd-details summary:hover { color: var(--text); }
.nerd-details summary::-webkit-details-marker { display: none; }
.nerd-details summary::before { content: "▸"; font-size: 0.7rem; transition: transform 0.15s; }
.nerd-details[open] summary::before { transform: rotate(90deg); }
.nerd-details[open] summary { border-bottom: 1px solid var(--border); }
.nerd-body { padding: 16px 18px 18px; }

/* Recent-form strip: one small tile per game, oldest left. Deliberately a
   wrapping flex row rather than a chart - the exact per-game numbers are
   the point, and a 10-point sparkline would hide them to look prettier. */
.form-inline { font-weight: 600; }
/* Grid, not wrapping flex: with flex-wrap the final row's tiles grow to
   fill the leftover space, so a 10-game strip that wraps 9+1 rendered the
   last game three times the width of the others. A grid keeps every tile
   on the same column track whether or not the row is full. */
.form-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 4px; margin: 6px 0 2px;
}
.form-game {
  min-width: 0; text-align: center;
  padding: 4px 3px; border-radius: 4px;
  background: var(--card-alt, rgba(127,127,127,0.08));
  border: 1px solid var(--border);
}
.form-game.form-hit { border-color: var(--green); }
.form-game.form-miss { opacity: 0.6; }
.form-value { display: block; font-size: 0.8rem; font-weight: 700; line-height: 1.2; }
.form-game.form-hit .form-value { color: var(--green); }
.form-opp {
  display: block; font-size: 0.6rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- Player page ---- */
.player-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 4px 0 22px; }
.player-shot {
  width: 96px; height: 70px; object-fit: cover; object-position: top center;
  border-radius: 8px; background: rgba(127,127,127,0.08); flex: none;
}
.player-id { min-width: 0; }
.player-id h1 { margin: 0 0 4px; font-size: 1.7rem; letter-spacing: -0.02em; }
.player-id .meta { margin: 0 0 2px; }

.season-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px;
}
.season-stat {
  padding: 10px 8px; text-align: center;
  border: 1px solid var(--border); border-radius: 8px;
}
.season-value { display: block; font-size: 1.15rem; font-weight: 700; }
.season-label { display: block; font-size: 0.68rem; color: var(--muted); margin-top: 2px; }

/* A game log is genuinely wide (a pitcher's line is 15+ columns), so it
   scrolls inside its own container rather than pushing the page sideways. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.gamelog { width: 100%; border-collapse: collapse; font-size: 0.8rem; white-space: nowrap; }
table.gamelog th, table.gamelog td { padding: 6px 9px; text-align: right; }
table.gamelog th {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border);
}
table.gamelog tbody tr { border-bottom: 1px solid var(--border); }
table.gamelog tbody tr:last-child { border-bottom: none; }
table.gamelog .gamelog-date,
table.gamelog .gamelog-opp,
table.gamelog .gamelog-res { text-align: left; }
table.gamelog .gamelog-res .meta { font-size: 0.68rem; margin-left: 4px; }

/* ---- Player search / browse ---- */
.player-search { display: flex; gap: 8px; margin: 18px 0 4px; flex-wrap: wrap; }
.player-search input {
  flex: 1 1 260px; min-width: 0;
  padding: 11px 14px; font-size: 0.95rem;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px;
}
.player-search input:focus { outline: none; border-color: var(--gold); }
.player-search button {
  padding: 11px 22px; font-size: 0.9rem; font-weight: 700; cursor: pointer;
  color: var(--bg); background: linear-gradient(135deg, #ffcc4d, #ff8a4f);
  border: none; border-radius: 10px;
}
.player-search button:active { transform: scale(0.97); }

.player-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px;
}
.player-card {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 9px 12px; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  transition: border-color 0.15s, transform 0.15s;
}
.player-card:hover { border-color: #3a4560; transform: translateY(-2px); }
.player-card:active { transform: translateY(0) scale(0.98); transition-duration: 0.05s; }
.player-card img {
  width: 48px; height: 35px; flex: none; border-radius: 6px;
  object-fit: cover; object-position: top center; background: rgba(127,127,127,0.08);
}
.player-card-id { min-width: 0; }
.player-card-name {
  display: block; font-weight: 700; font-size: 0.92rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-card-injury {
  display: inline-block; margin-top: 2px; padding: 1px 7px;
  font-size: 0.62rem; font-weight: 700; border-radius: 999px;
  background: #3a2020; color: var(--red);
}

.team-pick-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px;
}
.team-pick {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 6px; text-decoration: none; color: var(--muted);
  font-size: 0.82rem; font-weight: 700;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  transition: border-color 0.15s, color 0.15s;
}
.team-pick img { width: 26px; height: 26px; object-fit: contain; flex: none; }
.team-pick:hover { color: var(--text); border-color: #3a4560; }
.team-pick-on { color: var(--text); border-color: var(--gold); }

/* ---- Head-to-head compare ---- */
.vs-head { display: flex; align-items: center; gap: 14px; margin: 18px 0 22px; flex-wrap: wrap; }
.vs-player {
  flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 14px 10px; text-align: center; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  transition: border-color 0.15s;
}
.vs-player:hover { border-color: #3a4560; }
.vs-player img {
  width: 72px; height: 52px; border-radius: 8px;
  object-fit: cover; object-position: top center; background: rgba(127,127,127,0.08);
}
.vs-name { font-weight: 800; font-size: 1.02rem; }
.vs-mark {
  flex: none; color: var(--muted); font-weight: 800; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}

.vs-table { display: flex; flex-direction: column; }
.vs-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.vs-row:last-child { border-bottom: none; }
.vs-val { font-size: 0.98rem; font-weight: 700; color: var(--muted); }
.vs-row .vs-val:first-child { text-align: right; }
.vs-row .vs-val:last-child { text-align: left; }
/* The winning side is the only thing that gets full contrast, so a column
   of numbers reads as a result rather than as a wall of equal-weight text. */
.vs-win { color: var(--green); }
.vs-label {
  min-width: 92px; text-align: center; font-size: 0.72rem; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.vs-label .meta { text-transform: none; letter-spacing: 0; font-size: 0.62rem; }

/* ---- Home Run Watch (MLB dashboard) ---- */
.hr-section { border-color: var(--gold); }
.hr-board { display: flex; flex-direction: column; margin-top: 12px; }
.hr-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto auto auto;
  align-items: center; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.hr-row:last-child { border-bottom: none; }
.hr-rank { font-size: 0.8rem; font-weight: 800; color: var(--gold); text-align: center; }
.hr-who { min-width: 0; }
.hr-player { display: block; font-weight: 700; font-size: 0.95rem; }
.hr-player a { color: var(--text); text-decoration: none; }
.hr-player a:hover { text-decoration: underline; }
.hr-nums { text-align: right; }
.hr-nums .meta { display: block; font-size: 0.62rem; }
/* Ours is the ranked number, so it carries the emphasis; the book's price
   sits beside it as context rather than as a competing claim. */
.hr-pct { font-size: 1.05rem; font-weight: 800; color: var(--gold); }
.hr-book { font-size: 1.05rem; font-weight: 700; color: var(--muted); }
.hr-why > summary {
  cursor: pointer; list-style: none; white-space: nowrap;
  font-size: 0.7rem; font-weight: 700; color: var(--muted);
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
}
.hr-why > summary::-webkit-details-marker { display: none; }
.hr-why > summary:hover { color: var(--text); }
.hr-why[open] > summary { color: var(--text); }
.hr-why .prop-detail-body { padding-top: 8px; }
/* Open, the panel needs the whole row. The <details> is the grid child, so
   the span has to go HERE - putting grid-column on the inner body did
   nothing and left the panel crammed into the narrow last column, which
   squeezed the player name into a two-character-wide sliver. Opening moves
   the whole disclosure onto its own full-width line beneath the row. */
.hr-why[open] { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .hr-row { grid-template-columns: 22px minmax(0, 1fr) auto auto; row-gap: 6px; }
  .hr-why { grid-column: 2 / -1; }
  .hr-why > summary { display: inline-block; }
}
