/* ── Reset / base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand — Triple Crown Forecast: deep navy + crown gold on a near-white ground */
  --navy: #0f1d33;
  --navy-line: #24344d;
  --gold: #e0a63c;              /* gold on dark grounds (the brand bar) */
  --accent: #9a6a17;            /* gold darkened to read on white (links, active nav, carets) */
  --accent-light: #f3e3c3;      /* warm tint — the tracked (is-focus) row */
  --accent-lighter: #fbf3e1;    /* fainter warm tint — the leading row, sorted column bg */
  --text: #17233a;
  --text-muted: #5b6678;
  --border: #d7dce4;
  --border-light: #e8ebf0;
  --bg: #fff;
  --bg-muted: #f5f7fa;
  --shadow: 0 1px 4px rgba(15, 29, 51, 0.10);

  --font-display: "Archivo", system-ui, -apple-system, sans-serif;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg-muted);
  color: var(--text);
  font-size: 14px;
}

a { color: var(--accent); }

/* ── Archived-run band (only when ?run=<id> is in the URL) ────────────── */
.archive-band {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 7px 24px;
  background: #3c3120;
  color: #e9dcc3;
  font-size: 0.8rem;
  line-height: 1.4;
}
.archive-band.is-error { background: #5a3320; }
.archive-band-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.68rem;
  color: var(--gold);
}
.archive-band code { font-family: ui-monospace, Menlo, monospace; font-size: 0.75rem; }
.archive-band-nav { display: flex; gap: 14px; }
.archive-band a { color: #f2e2bf; text-decoration: underline; }
.archive-band a:hover { color: #fff; }
.archive-band-exit { margin-left: auto; white-space: nowrap; font-weight: 600; }

/* ── Brand bar (slim, every page) ─────────────────────────────────────── */
.appbar {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 24px;
  background: var(--navy);
  border-bottom: 1px solid var(--navy-line);
}
.appbar-brand { display: flex; align-items: center; gap: 9px; }
.appbar-mark { width: 20px; height: 20px; fill: var(--gold); display: block; flex: none; }
.appbar-wm {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e9edf4;
  white-space: nowrap;
}
.appbar-wm b { color: var(--gold); font-weight: 600; }

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
  background: var(--bg);
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}
header h1 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; color: var(--navy); }
header p.tagline { color: var(--text-muted); font-size: 0.85rem; margin-top: 3px; }
header p.stats-asof { color: #8a94a4; font-size: 0.72rem; margin-top: 8px; font-style: italic; font-weight: 400; }
header p.stats-asof:empty { display: none; }

/* ── Site nav (links between pages) ────────────────────────────────────── */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}

.site-nav a, .site-nav span.disabled {
  padding: 10px 18px;
  border-bottom: 3px solid transparent;
  font-size: 0.9rem;
  color: #555;
  text-decoration: none;
  margin-bottom: -1px;
  display: inline-block;
}
.site-nav a:hover { color: #111; }
.site-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.site-nav span.disabled {
  color: #bbb;
  cursor: not-allowed;
}

/* ── Sub-page breadcrumb (category detail -> overview) ─────────────────── */
.subpage-crumb {
  background: #fafafa;
  padding: 8px 16px 0;
  font-size: 0.85rem;
}
.subpage-crumb a { text-decoration: none; }
.subpage-crumb a:hover { text-decoration: underline; }

/* ── Category tabs (in-page, e.g. milestone categories) ────────────────── */
#category-tabs {
  display: flex;
  background: #fafafa;
  border-bottom: 1px solid var(--border-light);
  padding: 0 16px;
}

.tab-cat {
  padding: 10px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  font-size: 0.88rem;
  color: #555;
  margin-bottom: -1px;
}
.tab-cat:hover { color: #111; }
.tab-cat.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ── Main content wrapper ──────────────────────────────────────────────── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

/* ── Landing page cards (index) ────────────────────────────────────────── */
.landing-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
}

.landing-card {
  background: var(--bg);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 18px 20px;
  min-width: 220px;
  flex: 1 1 220px;
  text-decoration: none;
  color: inherit;
  display: block;
}
.landing-card:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14); }
.landing-card h2 { font-size: 1.05rem; margin-bottom: 6px; color: var(--accent); }
.landing-card p { color: var(--text-muted); font-size: 0.85rem; line-height: 1.4; }

.landing-card.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.landing-card.disabled:hover { box-shadow: var(--shadow); }
.landing-card.disabled h2 { color: #888; }

/* ── About page (prose) ───────────────────────────────────────────────── */
main.about { max-width: 720px; }
.about-lede { font-size: 0.95rem; line-height: 1.6; color: var(--text); }
.about-section { margin-top: 28px; }
.about-section h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 10px;
}
.about-section h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 18px 0 4px;
}
.about-section p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.about-section a { text-decoration: underline; }

/* ── Past-runs list (runs.html) ───────────────────────────────────────── */
.runs-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.runs-table th {
  text-align: left; font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
  padding: 6px 10px; border-bottom: 1px solid var(--border);
}
.runs-table th.num, .runs-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.runs-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-light); }
.runs-table tr:hover td { background: var(--bg-muted); }
.runs-table code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem; color: var(--text-muted);
}
.runs-shape { color: var(--text-muted); font-size: 0.78rem; }
.runs-open a { text-decoration: none; font-weight: 600; white-space: nowrap; }

/* ── League-leader grid ────────────────────────────────────────────────── */
.category-section {
  background: var(--bg);
  border-radius: 6px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

/* The whole header is the entry point to the stat's deep dive. */
.category-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 16px;
  background: #f2f5fa;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: #333;
}
.category-header:hover { background: #e9eef6; }
.category-header:hover .category-header-name { text-decoration: underline; }
.category-header-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
}
.category-header-arrow { color: var(--accent); font-weight: 700; }
.category-header-hint { font-size: 0.72rem; color: var(--text-muted); }
@media (max-width: 560px) { .category-header-hint { display: none; } }

.league-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 6px 22px;
}
/* On the league-leader overview the grid sits in a padding-less card. */
.category-section .league-grid { padding: 8px 15px 12px; }

.league-box {
  background: var(--bg);
  min-width: 0;
}

.league-box-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

/* Box footer: the "+N more" toggle and the deep-dive link share a row. */
.league-box-foot {
  display: flex;
  align-items: baseline;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.league-box-more {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.league-box-more:hover { text-decoration: underline; }
.league-box-foot .box-toggle { margin-top: 0; }

.league-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.league-table th {
  text-align: left;
  color: #8a94a4;
  font-weight: 600;
  font-size: 11px;
  padding: 3px 4px;
  border-bottom: 1px solid var(--border-light);
}
.league-table th.num { text-align: right; }

.league-table td {
  padding: 4px 4px;
  border-bottom: 1px solid var(--border-light);
}
.league-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* These tables are always sorted by Lead % (descending) — they aren't
   interactively sortable, so a shaded column + a static caret stands in for a
   sort indicator. Declared before the row-highlight rules so a highlighted
   row's last cell still takes the full row colour. */
.league-table th.sortcol,
.league-table td.sortcol { background: #eef1f6; }
.league-table th.sortcol { color: var(--text); white-space: nowrap; }
.league-table .sort-caret { margin-left: 3px; font-size: 9px; color: var(--accent); }

.league-table tr:last-child td { border-bottom: none; }
.league-table tr.is-leader td { font-weight: 600; background: var(--accent-lighter); }
/* Highlights one tracked player's row (Triple Crown page) — a stronger gold
   tint than .is-leader, plus a stripe, so it stays legible when a row is both. */
.league-table tr.is-focus td { background: var(--accent-light); }
.league-table tr.is-focus td:first-child { font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }

.league-table tr.row-extra { display: none; }
.league-box.expanded .league-table tr.row-extra { display: table-row; }

.box-toggle {
  display: block;
  margin-top: 8px;
  border: none;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 0.8rem;
  cursor: pointer;
}
.box-toggle:hover { text-decoration: underline; }

.global-controls {
  padding: 0 0 14px;
  font-size: 0.85rem;
}
.global-controls a { text-decoration: none; }
.global-controls a:hover { text-decoration: underline; }

.league-empty {
  color: #999;
  font-style: italic;
  font-size: 0.85rem;
  padding: 8px 4px;
}

/* ── Table wrapper (milestones page) ───────────────────────────────────── */
/* The milestones table lives in a .panel; its <main> is just a landmark and
   shouldn't add the centred max-width the other pages' <main> uses. */
main.bare { max-width: none; margin: 0; padding: 0; }

#table-wrap { margin-top: 8px; overflow-x: auto; }

/* ── DataTables overrides ───────────────────────────────────────────────── */
#main-table_wrapper .dt-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 8px;
}
#main-table_wrapper .dataTables_length,
#main-table_wrapper .dataTables_filter {
  font-size: 0.85rem;
}
#main-table_wrapper .dt-top .dataTables_filter { margin-left: auto; }

.league-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
}
.league-toggle button {
  border: none;
  border-left: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 4px 12px;
  cursor: pointer;
}
.league-toggle button:first-child { border-left: none; }
.league-toggle button:hover:not(.active) { background: var(--bg-muted); }
.league-toggle button.active { background: var(--navy); color: #fff; font-weight: 600; }

/* ── Race chart (category deep-dive) ───────────────────────────────────── */
.deepdive-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 0;
}

/* Shared card wrapper + header for every section on the category page
   (race chart, leader histogram, player table) and the TC-page histograms. */
.panel {
  background: var(--bg);
  margin: 12px 16px 0;
  padding: 12px 15px 14px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.panel-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; letter-spacing: -0.005em; color: var(--navy); }
.panel-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 2px;
  max-width: 800px;
}
.panel[hidden] { display: none; }
/* Inside a padded <main> (Triple Crown page) the horizontal margin would
   double up and misalign the panels with the hero card. */
main:not(.bare) .panel { margin-left: 0; margin-right: 0; }

.race-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 6px; }
.race-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: default;
}
.race-key:hover { color: var(--text); }
.race-swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }

.race-chart-wrap {
  position: relative;
  --race-band: #ffffff;
  --race-band-alt: #faf5ea;
}
.race-chart-wrap svg { display: block; }
.race-axis text { fill: #898781; font-size: 10px; font-variant-numeric: tabular-nums; }
.race-grid line { stroke: #e1e0d9; stroke-width: 1; shape-rendering: crispEdges; }
.race-vgrid line { stroke: #e3ded2; stroke-width: 1; shape-rendering: crispEdges; }
.race-season-edge { stroke: #c3c2b7; stroke-width: 1; shape-rendering: crispEdges; }
.race-asb { fill: rgba(60, 60, 60, 0.12); }
.race-asb-label { fill: #9a988f; font-size: 9px; letter-spacing: 0.03em; }
.race-baseline { stroke: #c3c2b7; stroke-width: 1; shape-rendering: crispEdges; }
.race-line { fill: none; stroke-width: 2; stroke-linejoin: miter; stroke-linecap: round; }
.race-line, .race-dot, .race-end-label { transition: opacity 0.12s ease, stroke-width 0.12s ease; }

/* Legend hover: spotlight one line, fade the rest. */
.race-lines.is-focused .race-line,
.race-lines.is-focused .race-dot,
.race-lines.is-focused .race-end-label { opacity: 0.1; }
.race-lines.is-focused .is-hot { opacity: 1; }
.race-lines.is-focused .race-line.is-hot { stroke-width: 3; }
.race-end-label { font-size: 10px; font-weight: 600; }
.race-crosshair { stroke: #898781; stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.race-hit { fill: transparent; pointer-events: all; cursor: crosshair; }
.race-empty {
  color: #999;
  font-style: italic;
  font-size: 0.85rem;
  padding: 6px 2px;
}

.race-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  padding: 7px 9px;
  font-size: 0.78rem;
  white-space: nowrap;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.08s;
}
.race-tooltip.show { opacity: 1; }
.race-tooltip .tt-date { font-weight: 600; margin-bottom: 4px; }
.race-tooltip table { border-collapse: collapse; }
.race-tooltip td { padding: 1px 0; }
.race-tooltip td.tt-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-left: 10px;
}
.race-tooltip td.tt-h { color: var(--text-muted); font-weight: 600; font-size: 0.72rem; }
.race-tooltip .tt-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
}

@media (max-width: 560px) {
  .deepdive-toolbar { padding-left: 8px; padding-right: 8px; }
  .panel { margin-left: 8px; margin-right: 8px; }
}

/* ── Histograms (histogram.js — player outcomes + leading-total, reusable).
   Modeled on the histograms at playoff-odds.netlify.app. ──────────────── */
.hist-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 2px; }
.hist-key {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--text-muted);
}
.hist-swatch { width: 11px; height: 11px; border-radius: 2px; flex: none; }

.hist-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2px 20px;
}
.hist-block { min-width: 0; }
.hist-cat-label {                         /* matches .league-box-title */
  font-size: 0.8rem; font-weight: 700; color: var(--text);
  margin: 10px 0 0;
}
.hist-svg { display: block; width: 100%; height: auto; overflow: visible; }

.hist-axis { stroke: #c3c2b7; stroke-width: 1; shape-rendering: crispEdges; }
.hist-axis-t text, .hist-ax {
  fill: #898781; font-size: 11px; font-variant-numeric: tabular-nums;
}
.hist-cols rect { shape-rendering: crispEdges; }
.hist-grid { stroke: #e4e8ef; stroke-width: 1; shape-rendering: crispEdges; }

.hist-slot { cursor: default; }
.hist-slot-bg { fill: transparent; }
.hist-slot:hover .hist-slot-bg { fill: rgba(255, 214, 92, 0.32); }
.hist-slot-hit { fill: transparent; }
.hist-slot-v {
  visibility: hidden;
  font-size: 11px; font-weight: 700; fill: #1b2a4a;
  font-variant-numeric: tabular-nums;
}
.hist-slot:hover .hist-slot-v { visibility: visible; }

.hist-tooltip {
  position: fixed;
  background: #1b2a4a;
  color: #fff;
  padding: 10px 13px;
  border-radius: 5px;
  font-size: 0.78rem;
  line-height: 1.6;
  max-width: 320px;
  pointer-events: none;
  z-index: 200;
  display: none;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.22);
}
.hist-tooltip strong { color: #f0c069; font-weight: 700; }
.hist-tooltip ul { margin: 3px 0 0; padding-left: 16px; }
.hist-tooltip li { margin-top: 1px; }
.hist-tt-sub { margin-top: 5px; color: #9db0c8; }
.hist-tt-list { margin-top: 2px; display: grid; gap: 1px; }
.hist-tt-list > div { white-space: nowrap; }
.hist-tt-sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.hist-tt-dim { color: #9db0c8; }

/* DataTables core sets no font-size, so cells would inherit body's 14px.
   Match the League-Leader tables (13px) and tighten padding to fit the
   milestones table's many columns. */
table.dataTable { font-size: 13px; }

table.dataTable tbody td {
  padding: 5px 6px;
  border-right: 1px solid #edf0f4;
}
table.dataTable tbody tr td:last-child { border-right: none; }

table.dataTable tbody td.group-last {
  border-right: 2px solid #c4d0de;
}

table.dataTable tbody td.sorting_1 {
  background-color: var(--accent-lighter);
}

table.dataTable tbody tr:hover td {
  background-color: #fbf6ec !important;
}

table.dataTable td.num, table.dataTable th.num { text-align: right; }
table.dataTable td.num { font-variant-numeric: tabular-nums; }

/* Keep player names on one line; the wrapper (#table-wrap) scrolls if needed,
   rather than letting a wrapped name double a row's height. */
table.dataTable tbody td:first-child { white-space: nowrap; }

/* ── Grouped column headers (milestones table) ───────────────────────────
   High-contrast dark header so group bands and dividers read clearly,
   independent of the light body rows below. */
table.dataTable thead th {
  background: #1b2a4a;
  color: #c8d8ee;
  padding: 6px 6px;
  border-bottom: 1px solid #253a60;
  border-right: 1px solid #253a60;
}
table.dataTable thead tr th:last-child { border-right: none; }

table.dataTable thead tr.group-row th {
  text-align: center;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #7090b8;
  border-bottom: 1px solid #263c60;
}

table.dataTable thead tr.group-row th.th-player {
  text-align: left;
  text-transform: none;
  font-size: inherit;
  font-weight: 700;
  color: #fff;
  vertical-align: middle;
}

table.dataTable thead th.group-last {
  border-right: 2px solid #3a5580;
}

table.dataTable thead th.sorting:hover,
table.dataTable thead th.sorting_asc:hover,
table.dataTable thead th.sorting_desc:hover {
  background-color: #253d6e;
}

table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
  background-color: #b5822a;
  color: #ffffff;
}

table.dataTable thead tr.group-row th.th-player.sorting_asc,
table.dataTable thead tr.group-row th.th-player.sorting_desc {
  background-color: #b5822a;
  color: #ffffff;
}

/* ── Triple Crown Watch ─────────────────────────────────────────────────
   A dark hero band: player photo, the headline Triple Crown chance, and
   three category columns (current value, gap to the next AL hitter, and a
   ring showing how often the player leads the AL in that stat). */
:root {
  --tc-dark: #1b2a4a;
  --tc-line: #2b3e63;
  --tc-dim: #8ea6c9;
  --tc-text: #c8d8ee;
  --tc-ring-fill: #e0a63c;
  --tc-ring-track: #2b3e63;
}

/* League switcher above the hero (AL / NL). */
.tc-switch { margin-top: 16px; }

.tc-hero {
  display: grid;
  grid-template-columns: 150px 220px 1fr;
  margin-top: 12px;
  background: var(--tc-dark);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* object-position is per-player: JS sets --tc-photo-pos / --tc-photo-pos-mobile
   from the photo map (see triple_crown.js). */
.tc-photo {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  object-position: var(--tc-photo-pos, center 15%);
  background: linear-gradient(160deg, #34496f, #1b2a4a 75%);
  display: block;
}

.tc-hero-mid {
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--tc-line);
}
.tc-hero-name { color: var(--tc-dim); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.tc-hero-pct { font-family: var(--font-display); color: #fff; font-size: 3.6rem; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tc-hero-label { color: var(--tc-text); font-size: 0.88rem; margin-top: 6px; }
.tc-hero-sub { color: #7f97ba; font-size: 0.72rem; margin-top: 10px; }

.tc-cats { display: grid; grid-template-columns: repeat(3, 1fr); }
.tc-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 11px;
  padding: 24px 14px;
  border-right: 1px solid var(--tc-line);
}
.tc-col:last-child { border-right: none; }
.tc-col-name { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--tc-dim); }
.tc-col-cur { font-family: var(--font-display); font-size: 2.3rem; font-weight: 700; color: #fff; line-height: 1; font-variant-numeric: tabular-nums; }
.tc-col-gap { font-size: 0.88rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tc-col-gap.pos { color: #5fd58f; }
.tc-col-gap.neg { color: #ff9d78; }
.tc-col-gap.tie { color: var(--tc-text); }
.tc-col-gap .who { display: block; margin-top: 3px; font-size: 0.76rem; font-weight: 400; color: var(--tc-dim); }

.tc-ring {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  background: conic-gradient(var(--tc-ring-fill) calc(var(--pct) * 1%), var(--tc-ring-track) 0);
}
.tc-ring::before {
  content: '';
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--tc-dark);
}
.tc-ring-v { position: relative; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.tc-ring-l { position: relative; margin-top: 2px; font-size: 0.5rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--tc-dim); }

.page-credit {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 32px;
  color: #999;
  font-size: 0.75rem;
}
.page-credit a { color: #888; text-decoration: underline; }

@media (max-width: 640px) {
  .tc-hero { grid-template-columns: 1fr; }
  .tc-photo { min-height: 0; height: 240px; object-position: var(--tc-photo-pos-mobile, var(--tc-photo-pos, top center)); }
  .tc-hero-mid { border-right: none; border-bottom: 1px solid var(--tc-line); align-items: center; text-align: center; padding: 20px; }
  .tc-cats { grid-template-columns: 1fr; }
  .tc-col { border-right: none; border-bottom: 1px solid var(--tc-line); }
  .tc-col:last-child { border-bottom: none; }

  /* Tighten the 4-column table so it fits a phone; scroll within the box if not. */
  .league-box { overflow-x: auto; padding: 12px 12px 16px; }
  .league-table { font-size: 12px; }
  .league-table th, .league-table td { padding: 3px 3px; }
}

/* ── 40-40 Watch ─────────────────────────────────────────────────────────
   Reuses the Triple Crown hero (.tc-hero / .tc-col / .tc-ring and the
   --tc-* tokens); adds a two-component hero variant and a compact
   contender bar for everyone below the top player. */
.ff-section { margin-top: 30px; }
.ff-section:first-child { margin-top: 16px; }
.ff-section-title {
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 700;
  letter-spacing: -0.01em; color: var(--navy);
}
.ff-section-lead {
  margin-top: 6px; color: #4a5568; font-size: 0.9rem; line-height: 1.5; max-width: 62ch;
}
.ff-section-lead strong { color: var(--navy); font-variant-numeric: tabular-nums; }

/* hero: a wider photo panel (the 40-40 shot is full-figure, not a portrait
   crop) and two component columns instead of three, kept centred rather than
   stretched across the wide third grid track */
.ff-hero { grid-template-columns: 220px 220px minmax(0, 1fr); }
.ff-cats { grid-template-columns: repeat(2, minmax(0, 280px)); justify-content: center; }
/* the ring label is a no-width flex child; let it wrap under the ring
   instead of overflowing ("to reach 40" is wider than "to lead AL") */
.ff-cats .tc-ring-l {
  min-width: 0; white-space: normal; max-width: 74px;
  text-align: center; line-height: 1.2;
}

.ff-bars { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.ff-bar {
  display: grid; grid-template-columns: 200px 1fr;
  background: var(--tc-dark); border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow);
}
.ff-bar-lead {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 16px 18px; border-right: 1px solid var(--tc-line);
}
.ff-bar-rank { color: var(--tc-dim); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em; }
.ff-bar-rank::before { content: '#'; }
.ff-bar-name { color: #fff; font-weight: 700; font-size: 0.98rem; }
.ff-bar-pct {
  margin-top: 4px; font-family: var(--font-display); color: var(--gold);
  font-size: 1.7rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.ff-bar-pct-l {
  color: var(--tc-dim); font-size: 0.58rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.ff-bar-comps { display: grid; grid-template-columns: repeat(2, 1fr); }
.ff-bar-comp {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px; border-right: 1px solid var(--tc-line);
}
.ff-bar-comp:last-child { border-right: none; }
.ff-bar-comp-name {
  color: var(--tc-dim); font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.ff-bar-comp-val {
  color: #fff; font-family: var(--font-display); font-weight: 700;
  font-size: 1.15rem; font-variant-numeric: tabular-nums;
}
.ff-bar-arrow { color: var(--tc-dim); font-weight: 400; }
.ff-bar-comp-chance {
  display: flex; align-items: center; gap: 8px; margin-top: 2px;
  color: var(--tc-text); font-size: 0.76rem; font-weight: 600;
}

/* a compact donut, same conic-gradient idea as the hero .tc-ring but small
   enough to sit inline with a line of text */
.ff-ring {
  width: 34px; height: 34px; border-radius: 50%; flex: none; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--tc-ring-fill) calc(var(--pct) * 1%), var(--tc-ring-track) 0);
}
.ff-ring::before {
  content: ''; position: absolute; width: 24px; height: 24px;
  border-radius: 50%; background: var(--tc-dark);
}
.ff-ring-v {
  position: relative; font-size: 0.5rem; font-weight: 700; color: #fff;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .ff-hero { grid-template-columns: 1fr; }   /* beats the non-media .ff-hero rule */
  .ff-cats { grid-template-columns: 1fr; }
  .ff-bar { grid-template-columns: 1fr; }
  .ff-bar-lead { border-right: none; border-bottom: 1px solid var(--tc-line); }
  .ff-bar-comps { grid-template-columns: 1fr; }
  .ff-bar-comp { border-right: none; border-bottom: 1px solid var(--tc-line); }
  .ff-bar-comp:last-child { border-bottom: none; }
}
