/* Previously D3 — /sports/statistics/ (Stats Hub), Gate 2 (2026-10-16).
   Page-level opt-in. The hub's --st-* vars all derive from the desert
   palette vars, so the palette remap converts the hub's var-driven
   surfaces at once; wave2-stats.css hardcodes cream hexes under ID
   selectors for the leaderboard tables, countered here with matching
   ID-anchored rules. No JS or data changes — presentation only. */
html[data-theme="d3"] {
  color-scheme: dark;
  --desert-bg: #000000;
  --desert-ink: #A5ACAF;
  --desert-ink-rgb: 165,172,175;
  --desert-ink-dim: #959DA2;
  --desert-ink-faint: #8C9399;
  --desert-card: #101010;
  --desert-pressed: #1B1B1B;
  --desert-rule: rgba(165,172,175,.14);
  --desert-accent: #FFFFFF;
  --desert-accent-deep: #6E7478;
  --desert-accent-soft: rgba(255,255,255,.12);
  --desert-glass: rgba(0,0,0,.92);
  --desert-shadow-rgb: 0,0,0;
}
html[data-theme="d3"] body { background: #000000; color: #A5ACAF; }
html[data-theme="d3"] .st-hub { background: #000000; color: #A5ACAF; }
html[data-theme="d3"] .st-hero h1 { color: #A5ACAF; }
html[data-theme="d3"] .st-panel {
  background: #101010; border-color: #2C2C2C; border-radius: 2px;
  box-shadow: 0 22px 55px rgba(0,0,0,.45);
}
html[data-theme="d3"] .st-sticky {
  background: rgba(0,0,0,.92); border-top-color: #2C2C2C; border-bottom-color: #2C2C2C;
}
html[data-theme="d3"] .st-sport, html[data-theme="d3"] .st-view,
html[data-theme="d3"] .st-cat, html[data-theme="d3"] .st-college-sopt { color: #959DA2; }
html[data-theme="d3"] .st-sport:hover, html[data-theme="d3"] .st-view:hover,
html[data-theme="d3"] .st-cat:hover, html[data-theme="d3"] .st-college-sopt:hover { color: #A5ACAF; }
html[data-theme="d3"] .st-sport.is-active, html[data-theme="d3"] .st-view.is-active,
html[data-theme="d3"] .st-cat.is-active, html[data-theme="d3"] .st-college-sopt.is-active {
  color: #FFFFFF; border-bottom-color: #FFFFFF;
}
html[data-theme="d3"] .st-table-wrap { border-radius: 2px; }
/* wave2 ID rules, countered at matching strength */
html[data-theme="d3"] #view-players .st-table-wrap,
html[data-theme="d3"] #view-teams .st-table-wrap,
html[data-theme="d3"] #view-top25 .st-table-wrap {
  background: #101010; border-color: #2C2C2C; border-radius: 2px;
  box-shadow: 0 22px 55px rgba(0,0,0,.45);
}
html[data-theme="d3"] #view-players .st-table thead th,
html[data-theme="d3"] #view-teams .st-table thead th,
html[data-theme="d3"] #view-top25 .st-table thead th {
  background: #060606; color: #8C9399; border-bottom: 2px solid #FFFFFF;
}
html[data-theme="d3"] #view-players .st-table tbody td,
html[data-theme="d3"] #view-teams .st-table tbody td,
html[data-theme="d3"] #view-top25 .st-table tbody td {
  background: transparent; color: #A5ACAF; border-bottom-color: #2C2C2C;
}
html[data-theme="d3"] #view-players .st-table tbody tr:hover td,
html[data-theme="d3"] #view-teams .st-table tbody tr:hover td { background: #1B1B1B; }
html[data-theme="d3"] #view-players tr.st-top3 td,
html[data-theme="d3"] #view-teams tr.st-top3 td { background: #1B1B1B; }
html[data-theme="d3"] #view-players .st-table .st-pl,
html[data-theme="d3"] #view-teams .st-table .st-pl { background: #1B1B1B; color: #A5ACAF; }
html[data-theme="d3"] #view-players .st-table thead .st-pl,
html[data-theme="d3"] #view-teams .st-table thead .st-pl { background: #060606; color: #8C9399; }
html[data-theme="d3"] .st-search { background: #060606; border-color: #2C2C2C; border-radius: 2px; }
html[data-theme="d3"] .st-search input { background: transparent; color: #A5ACAF; }
html[data-theme="d3"] .st-select {
  background-color: #060606; color: #A5ACAF; border-color: #2C2C2C; border-radius: 2px;
}
html[data-theme="d3"] .st-hub button { border-radius: 2px; }
html[data-theme="d3"] .st-note { color: #8C9399; }
/* Identity cell: in the players view the name/sub are colored by a
   sibling stats stylesheet with dark ink — force the cell's ink to
   inherit, then re-dim the sub-line. */
html[data-theme="d3"] .st-table td.st-pl .st-id,
html[data-theme="d3"] .st-table td.st-pl .st-id * { color: inherit; }
html[data-theme="d3"] .st-table td.st-pl .st-id .st-sub { color: #8C9399; }
html[data-theme="d3"] .st-table td.st-pl .st-name { color: #A5ACAF; }
html[data-theme="d3"] .st-table td.st-pl .st-sub { color: #8C9399; }
html[data-theme="d3"] #view-players .st-name, html[data-theme="d3"] #view-teams .st-name,
html[data-theme="d3"] #view-top25 .st-name { color: #A5ACAF; }
html[data-theme="d3"] #view-players .st-sub, html[data-theme="d3"] #view-teams .st-sub,
html[data-theme="d3"] #view-top25 .st-sub { color: #8C9399; }

/* ================= RAIDERS PHASE 2 (2026-10-16) =================
   Scope toggle (This season / All-time) pinned to the role map so no var
   chain can re-light it: active = white fill / black text (21:1);
   inactive = surface-1 fill, tertiary silver text, line border.
   Masthead brand stripe takes the white header-spec treatment. */
html[data-theme="d3"] .st-scope-btn{
  background:#101010; color:#8C9399; border-color:#2C2C2C;
}
html[data-theme="d3"] .st-scope-btn:hover{ color:#A5ACAF; }
html[data-theme="d3"] .st-scope-btn.is-active{
  background:#FFFFFF; border-color:#FFFFFF; color:#000000;
}
html[data-theme="d3"] .b-masthead{ border-top-color:#FFFFFF; }

/* RAIDERS P2 residual: bible chrome (bottom nav) on stats/compare */
:root{--bible-bg:#000000;--bible-card:#101010;--bible-ink:#A5ACAF;--bible-ink-soft:#959DA2;--bible-ink-dim:#8C9399;--bible-red:#FFFFFF;--bible-red-deep:#6E7478;--bible-rule:#2C2C2C;--bible-cream:#A5ACAF;--bible-cream-dim:rgba(165,172,175,.82);--bible-peach:#D7DBDD;--bible-champagne:#D7DBDD;--bible-fdf:#101010;--bible-win:#FFFFFF}

/* RAIDERS P2 residual 2: bible chrome flip at body.b-scope specificity */
body.b-scope{--bible-bg:#000000;--bible-card:#101010;--bible-ink:#A5ACAF;--bible-ink-soft:#959DA2;--bible-ink-dim:#8C9399;--bible-red:#FFFFFF;--bible-red-deep:#6E7478;--bible-rule:#2C2C2C;--bible-cream:#A5ACAF;--bible-cream-dim:rgba(165,172,175,.82);--bible-peach:#D7DBDD;--bible-champagne:#D7DBDD;--bible-fdf:#101010;--bible-win:#FFFFFF}
/* RAIDERS P2 residual 3: bottom-nav desert ground flips on stats/compare */
:root{--desert-bg:#000000;--desert-card:#101010;--desert-ink:#A5ACAF;--desert-ink-dim:#959DA2;--desert-ink-faint:#8C9399;--desert-rule:#2C2C2C}
/* RAIDERS P2 residual 4: bottom nav flips at the component (stats/compare) */
.pv-bottom-nav{--desert-bg:#101010;--desert-ink:#A5ACAF;--desert-ink-dim:#959DA2;--desert-accent:#FFFFFF;--desert-rule:#2C2C2C;background:#101010}

/* ================================================================
   STATSLEG 2026-10-17 — legibility repair layer (James's order).
   ROOT CAUSE of the hub's surviving light scheme: theme-desert.css
   declares the retired desert palette ON body (specificity 0,0,1).
   Custom properties declared on body override values inherited
   from html for body AND every descendant — so this file's D3
   remap on html[data-theme="d3"] never reached var()-driven
   surfaces inside the page. They fell through to desert: white
   leaderboard panel, brown-on-black labels, cream chips.
   The re-pin below declares the house palette at BODY level
   (0,1,2 beats 0,0,1), which repairs every var()-driven surface
   in the hub in one move.
   ================================================================ */
html[data-theme="d3"] body {
  --desert-bg: #000000;
  --desert-card: #101010;
  --desert-pressed: #1B1B1B;
  --desert-ink: #FFFFFF;
  --desert-ink-dim: #A5ACAF;
  --desert-ink-faint: #959DA2;
  --desert-accent: #E10600;
  --desert-accent-deep: #E10600;
  --desert-accent-soft: rgba(225, 6, 0, .12);
  --desert-line: #2C2C2C;
  --desert-rule: #2C2C2C;
  --desert-glass: rgba(0, 0, 0, .82);
  --desert-glass-strong: rgba(0, 0, 0, .92);
  --desert-ink-rgb: 255, 255, 255;
  /* The hub's own token set, pinned at the same body level.
     stats.css defines these on :where(.st-hub) — but the compare
     modals are appended to <body>, OUTSIDE .st-hub, where every
     var(--st-*) fell back to desert defaults (white selects,
     brown labels). Pinning them on body covers the whole
     document, modals included. */
  --st-bg: #000000;
  --st-card: #101010;
  --st-pressed: #1B1B1B;
  --st-text: #FFFFFF;
  --st-muted: #A5ACAF;
  --st-faint: #959DA2;
  --st-line: #2C2C2C;
  --st-line-soft: #1B1B1B;
  --st-accent: #E10600;
  --st-accent-deep: #E10600;
  --st-accent-soft: rgba(225, 6, 0, .12);
  --st-gold: #E10600;
  --st-serif: 'Previously Display', Georgia, 'Times New Roman', serif;
  --st-sans: 'Inter', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --st-glass: rgba(0, 0, 0, .82);
}

/* Serif token: --st-serif pointed at Fraunces via --bible-serif.
   The house display face is 'Previously Display' (Marathon),
   weight 400 only. */
html[data-theme="d3"] .st-hub {
  --st-serif: 'Previously Display', Georgia, 'Times New Roman', serif;
  /* stats.css set --st-gold to the amber --color-warn (top-3 inset
     bar). The house accent is signal red; amber is retired. */
  --st-gold: #E10600;
}

/* Thick white bar under the header (James shot 3): stats.css
   carried a 14px solid #FFFFFF bottom border on #b-nav-root (a
   stale "Bible red line" recolored white). The one universal
   header carries its own separators — no extra bar. */
#b-nav-root { border-bottom: none; }

/* Slim silver meta line — replaces the removed .st-hero masthead
   block (James 2026-10-17: no second title zone; the counts /
   updated line survives only as a small meta line in content).
   #stUpdated is written by stats.js (league · players · date). */
.st-meta-line {
  max-width: var(--st-max, 1560px);
  margin: 0 auto;
  padding: 18px 24px 0;
  font-family: var(--st-sans);
  font-size: 13px;
  letter-spacing: .02em;
  color: #A5ACAF;
}
.st-meta-line:empty { display: none; }

/* THIS SEASON / ALL-TIME scope toggle: the active segment was a
   solid white block (deliberate in the old Raiders phase; James
   overrode it 2026-10-17). House treatment: dark fill, white
   text, red underline inset. */
.st-scope-btn.is-active {
  background: #1B1B1B; color: #FFFFFF;
  box-shadow: inset 0 -2px 0 #E10600;
}

/* Display titles that wave2-stats.css set in Playfair — pinned
   here too (hub scope) so the hub is serif-free even if the
   shared file changes again. */
html[data-theme="d3"] .st-hist-feat h3,
html[data-theme="d3"] .st-t25-pollhead h3,
html[data-theme="d3"] .st-fiba-title {
  font-family: 'Previously Display', Georgia, 'Times New Roman', serif;
  font-weight: 400; font-style: normal;
}

/* Season bar: the select itself carried a hard 1px var(--st-line)
   border + var text (invisible brown pre-fix). Keep the field
   quiet: dark surface, silver text, red focus. */
.sts-sel {
  background: #101010; color: #FFFFFF; border-color: #2C2C2C;
}
.sts-sel:focus { outline: none; border-color: #E10600; }

/* ================================================================
   STATSLEG 2026-10-17 — part 2: specificity-corrected residuals.
   ================================================================ */
/* Scope toggle: the original pin in this file used
   html[data-theme="d3"] (0,3,1) — the part-1 override at (0,2,0)
   lost. Restated at full specificity. */
html[data-theme="d3"] .st-scope-btn.is-active {
  background: #1B1B1B; color: #FFFFFF;
  box-shadow: inset 0 -2px 0 #E10600;
}
/* Top-3 rank numerals: gold via --st-gold became red-on-red-wash
   (3.6:1). Podium ranks go white (17.9:1 on the wash). */
html[data-theme="d3"] .st-mrow.st-top3 .st-mrank { color: #FFFFFF; }

/* ================================================================
   PHASE A 2026-10-17 — percentile cells + as-of slot (Stats Hub
   boards). Scoped under the hub theme; append-only.
   ================================================================ */
html[data-theme="d3"] .st-num .st-v { display: block; }
html[data-theme="d3"] .st-pctrow {
  display: flex; align-items: center; gap: 5px;
  height: 10px; margin-top: 3px;
}
html[data-theme="d3"] .st-pctbar {
  display: block; width: 44px; height: 3px; background: #2C2C2C;
  overflow: hidden;
}
html[data-theme="d3"] .st-pctbar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #6E7478, #A5ACAF);
}
html[data-theme="d3"] .st-pctbar.hot i { background: #E10600; }
html[data-theme="d3"] .st-pctn {
  font-size: 10px; line-height: 1; color: #A5ACAF;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
/* As-of slot: fixed height so the stamp can never push the board. */
html[data-theme="d3"] .st-hub .st-note { min-height: 36px; }
html[data-theme="d3"] .st-chip-delay {
  display: inline-block; border: 1px solid #E10600; color: #E10600;
  padding: 0 6px; font-size: 11px; letter-spacing: .04em; white-space: nowrap;
}
/* Mobile rows: the percentile slot is always rendered (fixed height),
   so a row with a percentile never sits taller than one without. */
html[data-theme="d3"] .st-mpctslot { display: block; height: 12px; margin-top: 2px; }
html[data-theme="d3"] .st-mpctslot .st-pctrow { margin-top: 0; justify-content: flex-end; }
html[data-theme="d3"] .st-mpctslot .st-pctbar { width: 38px; }
