/* =====================================================================
   Stintwise — design system
   Dark-first and immersive: soft glowing panels on a deep page, a floating dock for the menu,
   big grotesque headlines, pill controls. Each club's colour lights its own pages.
   Tokens → base → shell → page furniture → components → data viz → pages
   ===================================================================== */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --page: #f3f3f6;
  --surface: #ffffff;
  --surface-2: #f0f0f4;
  --surface-3: #e3e3ea;
  --raised: #ffffff;                       /* things that float above the page: search, popovers */
  --glass: rgba(255, 255, 255, 0.74);      /* floating bars (dock, top bar, tabs), over a blur */
  --sidebar: var(--glass);
  --text-primary: #0b0b10;
  --text-secondary: #44444f;
  --text-muted: #6c6c7a;
  --grid: #e9e9ef;
  --axis: #c6c6d1;
  --border: rgba(11, 11, 16, 0.08);
  --border-strong: rgba(11, 11, 16, 0.16);
  --shadow-sm: 0 1px 2px rgba(11, 11, 16, 0.06);
  --shadow: 0 1px 2px rgba(11, 11, 16, 0.04), 0 16px 40px -20px rgba(11, 11, 16, 0.16);
  --shadow-lg: 0 32px 80px -20px rgba(11, 11, 16, 0.32);
  --brand: #ff5a1f;
  --brand-2: #ff2e7e;                      /* the brand gradient's second stop */
  --brand-text: #d43f0a;                   /* the brand colour, dark enough for small text */
  --brand-ink: #ffffff;
  --brand-soft: rgba(255, 90, 31, 0.1);
  --glow-a: rgba(255, 90, 31, 0.13);       /* the page's ambient light */
  --glow-b: rgba(124, 92, 255, 0.11);
  --accent: #2563eb;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --context: #c8c8d2;
  --court-line: #b7b7c3;
  --court-fill: #f5f5f8;
  --seq: #2a78d6;
  --pos: #2a78d6;
  --neg: #e34948;
  --mid: #ececf1;
  --good-text: #1c5cab;
  --bad-text: #b3302f;
  --good-bg: #e3eefb;
  --bad-bg: #fbe5e4;
  --hl: rgba(42, 120, 214, 0.09);
  --live: #0ca30c;
  --team: var(--brand);
  --team-ink: #ffffff;

  --font: Geist, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", Geist, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r-sm: 12px;
  --r-md: 16px;
  --r: 22px;
  --r-lg: 28px;
  --pill: 999px;
  --sidebar-w: 236px;
  --dock-w: 84px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #08080a;
    --surface: #121215;
    --surface-2: #1b1b20;
    --surface-3: #27272e;
    --raised: #1b1b20;
    --glass: rgba(20, 20, 24, 0.72);
    --text-primary: #f6f6f8;
    --text-secondary: #b8b8c4;
    --text-muted: #8b8b99;
    --grid: #232329;
    --axis: #3b3b46;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --shadow-sm: none;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 16px 40px -20px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 32px 80px -20px rgba(0, 0, 0, 0.9);
    --brand-text: #ff8552;
    --brand-soft: rgba(255, 90, 31, 0.14);
    --glow-a: rgba(255, 90, 31, 0.16);
    --glow-b: rgba(124, 92, 255, 0.14);
    --accent: #7aa7ff;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --context: #47474f;
    --court-line: #4b4b55;
    --court-fill: #17171b;
    --seq: #3987e5;
    --pos: #3987e5;
    --neg: #e66767;
    --mid: #36363d;
    --good-text: #86b6ef;
    --bad-text: #f19a99;
    --good-bg: #17304f;
    --bad-bg: #4a1f1f;
    --hl: rgba(57, 135, 229, 0.14);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #08080a;
  --surface: #121215;
  --surface-2: #1b1b20;
  --surface-3: #27272e;
  --raised: #1b1b20;
  --glass: rgba(20, 20, 24, 0.72);
  --text-primary: #f6f6f8;
  --text-secondary: #b8b8c4;
  --text-muted: #8b8b99;
  --grid: #232329;
  --axis: #3b3b46;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow-sm: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 16px 40px -20px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 32px 80px -20px rgba(0, 0, 0, 0.9);
  --brand-text: #ff8552;
  --brand-soft: rgba(255, 90, 31, 0.14);
  --glow-a: rgba(255, 90, 31, 0.16);
  --glow-b: rgba(124, 92, 255, 0.14);
  --accent: #7aa7ff;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --context: #47474f;
  --court-line: #4b4b55;
  --court-fill: #17171b;
  --seq: #3987e5;
  --pos: #3987e5;
  --neg: #e66767;
  --mid: #36363d;
  --good-text: #86b6ef;
  --bad-text: #f19a99;
  --good-bg: #17304f;
  --bad-bg: #4a1f1f;
  --hl: rgba(57, 135, 229, 0.14);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
/* Ambient light behind every page: two soft glows that stay put while the content scrolls. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60vw 50vh at 12% -8%, var(--glow-a), transparent 70%), radial-gradient(50vw 50vh at 96% 4%, var(--glow-b), transparent 70%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); }
h1 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.04; letter-spacing: -0.025em; margin: 0; font-weight: 800; }
h2 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 11px; margin: 0 0 8px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; }
/* Small uppercase captions share the monospaced face. */
h3, kbd, th, .eyebrow, .nav-group, .tile .label, .fx-when, .banner .stat span, .hero-stat > span, .rr-label, .rr-kind,
.bk-label, .bk-col h4, .pal-kind, .cat-picker .group-label, .standings li.cut span, .units li.sep, .scoreboard .final { font-family: var(--font-mono); }
img[src=""], img:not([src]) { display: none; }  /* no picture for this team or player */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--text-muted); }
.num, td, .tile .value { font-variant-numeric: tabular-nums; }
kbd { font: 500 11px/1 var(--font-mono); color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); padding: 4px 6px; border-radius: 7px; }
::selection { background: color-mix(in oklab, var(--brand) 30%, transparent); }
.ico { flex: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
  padding: 18px 14px; background: var(--sidebar); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text-primary); padding: 4px 8px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-text { font-size: 11px; line-height: 1.15; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.brand-text b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.03em; color: var(--text-primary); }
nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-muted); padding: 14px 10px 6px; }
nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-sm); white-space: nowrap;
  color: var(--text-secondary); font-weight: 500; transition: background 0.15s, color 0.15s;
}
nav a:hover { background: var(--surface-2); color: var(--text-primary); text-decoration: none; }
nav a.active { background: var(--brand-soft); color: var(--text-primary); font-weight: 600; }
nav a.active .ico { color: var(--brand); filter: drop-shadow(0 0 8px color-mix(in oklab, var(--brand) 70%, transparent)); }
.sidebar-foot { margin-top: auto; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 28px; background: var(--glass);
  -webkit-backdrop-filter: saturate(1.6) blur(20px); backdrop-filter: saturate(1.6) blur(20px); border-bottom: 1px solid var(--border);
}
.search-btn {
  display: flex; align-items: center; gap: 10px; min-width: 300px; height: 36px; padding: 0 8px 0 14px;
  color: var(--text-muted); background: var(--surface-2); border: 1px solid transparent; border-radius: var(--pill); cursor: pointer;
  font: inherit;
}
.search-btn:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-secondary); }
.search-btn span { flex: 1; text-align: left; }
.controls { display: flex; gap: 8px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.menu-btn { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); z-index: 39; }

/* Desktop: the menu is a floating dock of icons that opens to show its labels on hover or keyboard
   focus, and the top bar floats too, so the page gets the whole width. While the dock is open the
   top bar slides clear of it, so search stays reachable; after a click it closes (.closing, main.js)
   until the pointer leaves. */
@media (min-width: 901px) {
  .shell { display: block; }
  .main-col { margin-left: var(--dock-w); min-height: 100vh; }
  .sidebar {
    position: fixed; z-index: 30; top: 12px; left: 12px; bottom: 12px; height: auto; width: 60px; padding: 12px 8px; gap: 8px;
    background: color-mix(in oklab, var(--surface) 88%, transparent); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow);
    -webkit-backdrop-filter: saturate(1.6) blur(24px); backdrop-filter: saturate(1.6) blur(24px);
    overflow: hidden auto; scrollbar-width: none; transition: width 0.24s var(--ease) 0.08s, box-shadow 0.24s;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar:not(.closing):is(:hover, :focus-within) { width: var(--sidebar-w); box-shadow: var(--shadow-lg); }
  .sidebar .brand { padding: 4px 6px 8px; }
  .sidebar .brand-text, .sidebar nav a span, .sidebar .status-pill > span:not(.dot) { opacity: 0; transition: opacity 0.15s; }
  .sidebar:not(.closing):is(:hover, :focus-within) :is(.brand-text, nav a span, .status-pill > span:not(.dot)) { opacity: 1; transition-delay: 0.12s; }
  .sidebar .nav-group { height: 1px; padding: 0; margin: 8px 10px; background: var(--border); font-size: 0; }
  .sidebar .status-pill { background: none; padding: 8px 17px; white-space: nowrap; }
  .topbar { top: 12px; margin: 12px 24px 0 4px; padding: 8px 10px 8px 12px; border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); transition: margin-left 0.24s var(--ease) 0.08s; }
  .sidebar:not(.closing):is(:hover, :focus-within) ~ .main-col .topbar { margin-left: calc(var(--sidebar-w) - var(--dock-w) + 28px); }
}

select, input[type="search"], input[type="number"], button, .btn {
  font: inherit; color: var(--text-primary);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 6px 12px; height: 36px;
}
select { padding-right: 28px; appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: right 13px center, right 8px center; background-size: 5px 5px; background-repeat: no-repeat; }
select option:disabled { color: var(--text-muted); }
[hidden] { display: none !important; }  /* author display rules (e.g. button: inline-flex) must not override the hidden attribute */
button, .btn { cursor: pointer; font-weight: 550; transition: background 0.15s, border-color 0.15s, transform 0.15s, filter 0.15s; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; box-shadow: 0 8px 24px -10px var(--brand); }
.btn.primary:hover { background: linear-gradient(135deg, var(--brand), var(--brand-2)); filter: brightness(1.08); transform: translateY(-1px); }
.icon-btn { width: 36px; padding: 0; justify-content: center; color: var(--text-secondary); border-radius: var(--pill); }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.status-pill { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 550; color: var(--text-secondary); padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); line-height: 1.35; }
.status-pill .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 color-mix(in oklab, var(--live) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- page furniture ---------- */
main { width: 100%; max-width: 1400px; margin: 0 auto; padding: 28px 36px 96px; }
.page { animation: rise 0.45s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-text); background: var(--brand-soft); padding: 5px 11px; border-radius: var(--pill); margin-bottom: 12px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; margin: 10px 0 30px; }
.page-head h1 { font-size: clamp(34px, 4.8vw, 64px); letter-spacing: -0.03em; line-height: 0.98; }
.page-head .lede { color: var(--text-secondary); margin: 12px 0 0; max-width: 720px; font-size: 16px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 34px 0 14px; }
.section-title h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.section-title .note { margin: 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 22px 24px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .note { margin: 3px 0 0; max-width: 70ch; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.note { color: var(--text-muted); font-size: 12.5px; margin: 0; line-height: 1.5; }
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--shadow); overflow: hidden; }
.tile .label { color: var(--text-muted); font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.07em; }
.tile .value { font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -0.025em; margin-top: 4px; line-height: 1.05; }
.tile .sub { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.rank-badge { display: inline-block; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: var(--pill); background: var(--surface-2); color: var(--text-secondary); }
.rank-badge.top { background: var(--good-bg); color: var(--good-text); }
.rank-badge.bottom { background: var(--bad-bg); color: var(--bad-text); }

/* hero (team & player pages): club colour band */
.hero {
  position: relative; display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
  padding: 32px 34px; margin-bottom: 20px; border-radius: var(--r-lg); overflow: hidden;
  background:
    radial-gradient(90% 150% at 0% 0%, color-mix(in oklab, var(--team) 40%, transparent) 0%, transparent 60%),
    radial-gradient(70% 120% at 100% 100%, color-mix(in oklab, var(--team) 16%, transparent) 0%, transparent 60%),
    var(--surface);
  border: 1px solid color-mix(in oklab, var(--team) 26%, var(--border)); box-shadow: var(--shadow), 0 30px 80px -40px var(--team);
}
.hero .avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--surface-2); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--team), 0 0 40px -4px var(--team); }
.hero .crest { width: 108px; height: 108px; object-fit: contain; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.28)); }
.hero h1 { font-size: clamp(32px, 4.6vw, 60px); letter-spacing: -0.03em; line-height: 0.98; }
.hero .meta { color: var(--text-secondary); margin-top: 8px; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }
.hero .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.team-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px; border-radius: var(--pill); background: var(--team); color: var(--team-ink); font-weight: 650; font-size: 12.5px; }
.team-chip img { width: 20px; height: 20px; object-fit: contain; background: rgba(255, 255, 255, 0.9); border-radius: 50%; padding: 2px; }
.team-chip:hover { text-decoration: none; filter: brightness(1.05); }

.banner {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 44px 44px 38px; margin-bottom: 20px;
  background: radial-gradient(70% 150% at 100% 0%, color-mix(in oklab, var(--brand) 34%, transparent), transparent 62%),
              radial-gradient(60% 130% at 0% 100%, color-mix(in oklab, #7c5cff 24%, transparent), transparent 60%),
              var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.banner h1 { font-size: clamp(38px, 5.8vw, 80px); letter-spacing: -0.03em; line-height: 0.95; }
.banner .lede { color: var(--text-secondary); margin: 18px 0 0; max-width: 640px; font-size: 16px; }
.banner .stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.banner .stat { padding: 12px 18px 12px 16px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--border); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.banner .stat b { display: block; font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; }
.banner .stat span { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 500; }

/* tabs (section navigation inside a page) */
.tabs { position: sticky; top: 78px; z-index: 10; display: flex; gap: 2px; padding: 5px; margin: 0 0 20px; overflow-x: auto; width: fit-content; max-width: 100%;
  background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(20px); backdrop-filter: saturate(1.6) blur(20px); border-radius: var(--pill); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.tabs button { border: 0; height: 34px; padding: 0 16px; border-radius: var(--pill); background: none; color: var(--text-secondary); white-space: nowrap; }
.tabs button.on { background: var(--text-primary); color: var(--page); font-weight: 600; }
.tab-panel[hidden] { display: none; }

/* chips & segmented controls */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--pill); background: var(--surface); font-size: 12.5px; font-weight: 550; color: var(--text-secondary); height: auto; }
.chip.good { background: var(--good-bg); color: var(--good-text); border-color: transparent; }
.chip.bad { background: var(--bad-bg); color: var(--bad-text); border-color: transparent; }
.chip .swatch { width: 10px; height: 10px; border-radius: 50%; }
.chip button { border: 0; padding: 0 2px; height: auto; background: none; color: var(--text-muted); }
button.chip:hover { border-color: var(--border-strong); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--pill); padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; height: 28px; padding: 0 13px; border-radius: var(--pill); color: var(--text-secondary); font-size: 13px; }
.seg button.on { background: var(--text-primary); color: var(--page); font-weight: 600; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filters label { color: var(--text-secondary); font-size: 12.5px; display: flex; gap: 6px; align-items: center; font-weight: 550; }
.filters input[type="search"] { min-width: 230px; }
.filters .grow { flex: 1; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; max-height: 660px; border-radius: var(--r-sm); }
.table-wrap.short { max-height: none; }
.table-wrap.scrolls-x { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
th, td { padding: 10px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--grid); }
th.left, td.left { text-align: left; }
th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--text-muted); font-weight: 500; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer; user-select: none; border-bottom: 0; padding-top: 9px; padding-bottom: 9px; }
th:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
th:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
th:hover { color: var(--text-primary); }
th[title] { text-decoration: underline dotted var(--axis); text-underline-offset: 4px; }
th.sorted { color: var(--text-primary); }
th.sorted::after { content: "↓"; margin-left: 3px; }
th.sorted.asc::after { content: "↑"; }
td.sticky, th.sticky { position: sticky; left: 0; z-index: 1; background: var(--surface); }
th.sticky { z-index: 3; background: var(--surface-2); }
tbody tr { transition: background 0.12s; }
tbody tr:hover, tbody tr.hl { background: var(--hl); }
tbody tr:hover td:first-child, tbody tr.hl td:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
tbody tr:hover td:last-child, tbody tr.hl td:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
/* Heat-tinted cells (league ranks, percentiles, odds) read as chips with a gap between them. */
td[style*="background"] { border: 2px solid transparent; border-radius: 10px; background-clip: padding-box; padding: 8px 10px; }
tbody tr:hover td.sticky, tbody tr.hl td.sticky { background: color-mix(in oklab, var(--surface) 90%, var(--accent)); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.dim { opacity: 0.45; }
td.good { color: var(--good-text); font-weight: 650; }
td.bad { color: var(--bad-text); font-weight: 650; }
.cell-bar { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; width: 100%; }
.cell-bar i { display: block; height: 6px; border-radius: 3px; background: linear-gradient(90deg, color-mix(in oklab, var(--seq) 55%, transparent), var(--seq)); min-width: 2px; }
.pname { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; color: var(--text-primary); }
.pname:hover { color: var(--accent); }
.pname img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--surface-2); }
.pname-ph { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); flex: none; }
.team-logo { width: 20px; height: 20px; object-fit: contain; vertical-align: -5px; margin-right: 6px; }
.form span { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 2px; border-radius: 5px; font-weight: 750; font-size: 10px; }
.form .W { background: var(--good-bg); color: var(--good-text); }
.form .L { background: var(--bad-bg); color: var(--bad-text); }
.more { display: flex; margin: 12px auto 0; }
.pct-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); }
.pct-legend i { width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, color-mix(in oklab, var(--neg) 70%, transparent), transparent 50%, color-mix(in oklab, var(--pos) 70%, transparent)); border: 1px solid var(--border); }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.list li:last-child { border-bottom: 0; }
.list .rank { width: 18px; color: var(--text-muted); font-size: 12px; font-weight: 650; text-align: center; font-variant-numeric: tabular-nums; }
.list .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.list .who small { color: var(--text-muted); margin-left: 5px; font-weight: 500; }
.list .val { font-family: var(--font-display); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.list img.av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--surface-2); }
.list li:first-child .val { color: inherit; }

/* ---------- games ---------- */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.game { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; background: var(--surface); }
.game .row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.game .row .t { flex: 1; font-weight: 600; }
.game .row .s { font-family: var(--font-display); font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.game .row.lose { color: var(--text-muted); }
.game .row.lose .s { font-weight: 600; }
a.game { color: inherit; display: block; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
a.game:hover { text-decoration: none; border-color: color-mix(in oklab, var(--brand) 50%, var(--border)); transform: translateY(-3px); box-shadow: var(--shadow), 0 18px 40px -24px var(--brand); }

/* ---------- skills ---------- */
.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 10px 32px; }
.skill { display: grid; grid-template-columns: 148px 1fr 34px; align-items: center; gap: 10px; padding: 6px 0; }
.skill .lbl { font-size: 13px; color: var(--text-secondary); }
.skill .track { height: 8px; border-radius: 4px; background: var(--surface-2); position: relative; overflow: hidden; }
.skill .track i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; transition: width 0.6s var(--ease); }
.skill .track::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--axis); }
.skill .p { text-align: right; font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; }
.skill.na .p, .skill.na .lbl { color: var(--text-muted); }
.skill.plain .track::after { display: none; }

/* ---------- needs ---------- */
.needs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 14px; }
.need { border: 1px solid var(--border); border-left: 3px solid var(--neg); border-radius: var(--r-md); padding: 12px 14px; background: var(--surface-2); }
.need .t { font-weight: 700; }
.need .w { color: var(--text-secondary); font-size: 12.5px; margin-top: 2px; }
.need .r { margin-top: 8px; font-size: 12px; color: var(--bad-text); font-weight: 650; }
.need-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.need-meta { margin-top: 4px; font-size: 11.5px; color: var(--text-muted); }
.need-trend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 8px; font-size: 11.5px; }
.need-resolved { margin: -4px 0 14px; color: var(--good-text); }

/* ---------- charts ---------- */
.chart { width: 100%; min-height: 360px; }
.chart.tall { min-height: 500px; }
.chart.court { aspect-ratio: 15 / 11.3; min-height: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-secondary); margin-top: 8px; align-items: center; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend .ramp { display: inline-block; width: 120px; height: 8px; border-radius: 4px; vertical-align: -1px; margin: 0 6px; background: linear-gradient(90deg, var(--neg), var(--mid), var(--pos)); }
.spark { vertical-align: middle; }
.dbar { display: inline-block; position: relative; width: 70px; height: 8px; border-radius: 4px; background: var(--surface-2); vertical-align: middle; }
.dbar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--axis); }
.dbar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.dbar.wide { width: 140px; }
.range { display: inline-block; position: relative; width: 110px; height: 10px; vertical-align: middle; }
.range .line { position: absolute; top: 4px; height: 2px; background: var(--axis); border-radius: 1px; }
.range .dot { position: absolute; top: 1px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--seq); }
.range .now { position: absolute; top: 0; width: 2px; height: 10px; background: var(--text-muted); }
.pbar { display: inline-flex; width: 120px; height: 8px; border-radius: 4px; overflow: hidden; gap: 1px; vertical-align: middle; }
.pbar i { display: block; height: 100%; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }

/* ---------- states ---------- */
.loading { padding: 8px 0; }
.skel { display: grid; gap: 14px; }
.skel .bar, .skel .block { border-radius: var(--r-md); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
.skel .bar { height: 14px; }
.skel .block { height: 180px; }
.skel .row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.skel .row .block { height: 92px; }
.skel p { color: var(--text-muted); font-size: 12.5px; margin: 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { color: var(--text-muted); padding: 32px 0; text-align: center; }
.error { color: var(--bad-text); padding: 20px 0; }
.callout { border: 1px solid color-mix(in oklab, var(--brand) 28%, transparent); background: var(--brand-soft); padding: 12px 16px; border-radius: var(--r-md); color: var(--text-secondary); font-size: 13px; margin-bottom: 20px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text-primary); color: var(--page); padding: 11px 20px; border-radius: var(--pill); font-weight: 550; box-shadow: var(--shadow-lg); z-index: 60; }

/* summaries ("What the numbers say") */
.summary { margin-bottom: 18px; background: linear-gradient(180deg, color-mix(in oklab, var(--team) 5%, var(--surface)), var(--surface) 70%); }
.summary ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.summary li { position: relative; padding-left: 22px; color: var(--text-primary); line-height: 1.55; font-size: 15px; max-width: 95ch; }
.summary li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--axis); }
.summary li.good::before { box-shadow: 0 0 10px var(--pos); }
.summary li.bad::before { box-shadow: 0 0 10px var(--neg); }
.summary li.good::before { background: var(--pos); }
.summary li.bad::before { background: var(--neg); }

/* glossary */
.glossary dt { font-weight: 700; margin-top: 16px; font-family: var(--font-display); font-size: 15px; }
.glossary dd { margin: 4px 0 0; color: var(--text-secondary); max-width: 760px; }

/* ---------- landing page ---------- */
/* It belongs to no competition, so the competition, season and phase pickers are hidden there. */
.on-home .controls > .select, .on-home .copy-ai { display: none; }
.home-banner h1 { font-size: clamp(32px, 4.6vw, 64px); max-width: 17em; }
.comp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.comp-card { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 210px; padding: 24px 26px; overflow: hidden; color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow);
  background: radial-gradient(90% 120% at 100% 0%, color-mix(in oklab, var(--brand) 22%, transparent), transparent 62%), var(--surface);
  transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s; }
a.comp-card:hover { text-decoration: none; transform: translateY(-4px); border-color: color-mix(in oklab, var(--brand) 55%, var(--border)); box-shadow: var(--shadow), 0 24px 50px -28px var(--brand); }
.comp-card h2 { font-size: clamp(26px, 2.6vw, 36px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; margin-top: 6px; }
.comp-card p { margin: 0; color: var(--text-secondary); }
.comp-state { display: inline-flex; align-items: center; gap: 8px; font: 500 11px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-text); }
.comp-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: var(--text-secondary); font-size: 13px; }
.comp-facts b { font-family: var(--font-display); font-size: 18px; color: var(--text-primary); margin-right: 3px; }
.comp-card .story-cta { padding-top: 14px; }
.comp-card.soon { background: var(--surface); box-shadow: none; border-style: dashed; }
.comp-card.soon h2, .comp-card.soon .comp-state { color: var(--text-muted); }
.home-note { max-width: 90ch; margin-top: 8px; }

/* ---------- command palette ---------- */
.palette { position: fixed; inset: 0; z-index: 70; background: rgba(8, 8, 10, 0.5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: grid; place-items: start center; padding-top: 12vh; }
.palette[hidden] { display: none; }
.pal-box { width: min(640px, calc(100vw - 32px)); background: var(--raised); border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: var(--shadow-lg); overflow: hidden; animation: rise 0.2s var(--ease); }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.pal-input input { flex: 1; border: 0; background: none; height: 32px; font-size: 16px; padding: 0; outline: none; }
.pal-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text-primary); }
.pal-item:hover { text-decoration: none; }
.pal-item.on, .pal-item:hover { background: var(--surface-2); }
.pal-item img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--surface-2); }
.pal-ico { width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface-2); color: var(--brand); }
.pal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pal-main small { color: var(--text-muted); }
.pal-kind { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 650; }
.pal-empty { padding: 24px; text-align: center; color: var(--text-muted); }
.pal-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }

/* ---------- game page ---------- */
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 26px; margin-bottom: 18px; box-shadow: var(--shadow); }
.scoreboard .mid { text-align: center; }
.scoreboard .final { font-weight: 750; margin-top: 4px; letter-spacing: 0.08em; text-transform: uppercase; font-size: 11.5px; color: var(--text-secondary); }
.game-side { display: flex; align-items: center; gap: 14px; color: var(--text-primary); font-size: 17px; font-weight: 650; font-family: var(--font-display); }
.game-side:hover { text-decoration: none; }
.game-side:last-child { flex-direction: row-reverse; text-align: right; }
.game-side .crest { width: 56px; height: 56px; object-fit: contain; }
.game-side b { font-size: 60px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin-left: auto; font-variant-numeric: tabular-nums; }
.game-side:last-child b { margin-left: 0; margin-right: auto; }
.game-side.lose { color: var(--text-muted); }
.game-side.lose b { font-weight: 650; }
.mix { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; margin: 6px 0 10px; }
.mix i { display: block; height: 100%; }

/* ---------- match preview ---------- */
.pv-hero { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; margin-bottom: 18px; padding: 26px 28px; }
.pv-team { display: flex; gap: 14px; align-items: center; color: var(--text-primary); font-size: 17px; font-family: var(--font-display); font-weight: 700; }
.pv-team:hover { text-decoration: none; }
.pv-team.a { flex-direction: row-reverse; text-align: right; }
.pv-team img { width: 70px; height: 70px; object-fit: contain; }
.pv-team .note { font-family: var(--font); font-weight: 500; }
.pv-score { text-align: center; min-width: 240px; }
.pv-pts { font-family: var(--font-display); font-size: 60px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.02; }
.pv-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 3px; margin: 12px 0 6px; }
.pv-bar i { display: block; height: 100%; }
.battle { padding: 12px 0; border-bottom: 1px solid var(--grid); }
.battle:last-child { border-bottom: 0; }
.bt-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.bt-row { display: grid; grid-template-columns: 1fr 140px 1fr; gap: 10px; align-items: center; margin: 6px 0 4px; font-size: 13px; }
.bt-row > :last-child { text-align: right; }
.pv-player { display: flex; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--grid); color: var(--text-primary); border-radius: var(--r-sm); }
.pv-player:last-child { border-bottom: 0; }
.pv-player:hover { text-decoration: none; background: var(--hl); }
.pv-player img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--surface-2); flex: none; }
table.tape td { text-align: right; }

/* ---------- insights ---------- */
.cat-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-picker button { height: 30px; border-radius: var(--pill); font-size: 12.5px; padding: 0 12px; }
.cat-picker button.on { background: var(--text-primary); color: var(--surface); border-color: transparent; }
.cat-picker .group-label { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; align-self: center; margin: 0 4px 0 12px; font-weight: 700; }
.cat-picker .group-label:first-child { margin-left: 0; }
.insight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.insight-grid > .card.wide { grid-column: 1 / -1; }

/* ---------- round review ---------- */
.rr-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.rr-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.rr-tile b { font-family: var(--font-display); font-size: 24px; letter-spacing: -0.02em; }
.rr-tile.good { background: var(--good-bg); } .rr-tile.bad { background: var(--bad-bg); } .rr-tile.muted b { color: var(--text-secondary); }
.rr-tile .rank { margin-top: 4px; font-size: 11.5px; font-weight: 650; color: var(--text-secondary); }
.rr-tile .rel-chip { margin-top: 6px; font-size: 11px; }
.rr-label { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.rr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.rr-score { font-family: var(--font-display); font-size: 20px; color: var(--text-primary); text-decoration: none; }
.rr-score span { border-bottom: 3px solid var(--team); }
.rr-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 8px; }
.rr-list li { line-height: 1.5; }
.rr-kind { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-right: 4px; }
.rr-side { border-left: 3px solid var(--team); padding-left: 12px; }
.rr-analysis { margin-top: 2px; }
.rr-rows { display: flex; flex-direction: column; margin-top: 16px; border-top: 1px solid var(--border); }
.rr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main go" "line go"; gap: 2px 12px; padding: 12px 6px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; border-radius: var(--r-sm); }
.rr-row:hover { background: var(--surface-2); }
.rr-row-main { grid-area: main; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.rr-row-main .rr-score { font-size: 17px; }
.rr-row-line { grid-area: line; font-size: 13.5px; color: var(--text-secondary); }
.rr-row-style { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-muted); }
.rr-row-style b.pos { color: var(--good-text); } .rr-row-style b.neg { color: var(--bad-text); }
.rr-row-go { grid-area: go; align-self: center; font-size: 22px; color: var(--text-muted); }
.rr-pending-card { margin-bottom: 18px; padding: 14px 20px; }
.rr-pending-card summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.rr-pending-card[open] summary { margin-bottom: 10px; }
.rr-analysis > p { margin: 0 0 6px; line-height: 1.55; }
.rr-side h4 { margin: 0 0 2px; font-size: 13px; }

/* ---------- brackets ---------- */
.bracket { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; margin-top: 10px; align-items: start; }
.bk-col h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.bk-game, .bk-series, .bk-odds { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; background: var(--surface-2); margin-bottom: 10px; display: grid; gap: 4px; }
.bk-odds { gap: 2px; }
.bk-label { font-size: 11px; font-weight: 650; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.bk-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--text-secondary); }
.bk-line.won { color: var(--text-primary); font-weight: 650; }
.bk-team { display: inline-flex; align-items: center; gap: 6px; border-left: 3px solid var(--team); padding-left: 6px; }
.bk-team i { font-style: normal; font-size: 11px; color: var(--text-muted); min-width: 1.2em; }
.bk-score { font-variant-numeric: tabular-nums; font-weight: 700; }
.bk-call { font-size: 12.5px; margin-top: 2px; }
.bk-games { font-size: 11.5px; }
.bk-factors { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; }

/* ---------- season replay ---------- */
.rp-key { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 18px; font-size: 13px; color: var(--text-secondary); }
.rp-key li { display: flex; gap: 10px; align-items: baseline; line-height: 1.45; }
.rp-sw { flex: 0 0 26px; display: inline-block; transform: translateY(-3px); border-radius: 2px; }
.rp-toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-secondary); margin-right: 8px; cursor: pointer; }

/* ---------- plain-language explanations ---------- */
details.how { margin: 2px 0 0; }
details.how summary { cursor: pointer; font-size: 12px; color: var(--accent, var(--series-1)); list-style: none; display: inline-flex; gap: 4px; align-items: center; }
details.how summary::-webkit-details-marker { display: none; }
details.how summary::before { content: "ⓘ"; }
details.how[open] summary { margin-bottom: 4px; }
details.how .note { max-width: 80ch; }

/* ---------- exports ---------- */
.tbl-box { min-width: 0; }
.tbl-tools { display: flex; justify-content: flex-end; margin: 0 0 4px; }
.tbl-csv { height: 24px; padding: 0 8px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); background: transparent; border: 1px solid transparent; border-radius: 6px; gap: 4px; }
.tbl-csv:hover { color: var(--text-primary); border-color: var(--border); background: var(--surface-2); }

/* Link to one section (deeplink.js): a small button after each card title, shown on hover
   (always on touch screens); the linked section scrolls clear of the sticky bars and flashes. */
.deep-link { height: 22px; width: 22px; padding: 0; margin-left: 6px; vertical-align: middle; justify-content: center;
  color: var(--text-muted); background: transparent; border: 1px solid transparent; border-radius: 6px; opacity: 0; transition: opacity .15s; }
.card:hover .deep-link, h3.sub:hover .deep-link, [data-link]:hover .deep-link, .deep-link:focus-visible { opacity: 1; }
.deep-link:hover { color: var(--text-primary); border-color: var(--border); background: var(--surface-2); }
@media (hover: none) { .deep-link { opacity: .6; } }
.card, h3.sub, [data-link] { scroll-margin-top: 120px; }
.deep-target { animation: deep-flash 2.4s ease-out; }
@keyframes deep-flash { 0%, 30% { box-shadow: 0 0 0 3px var(--seq); } 100% { box-shadow: var(--shadow); } }
h3.sub.deep-target { animation: none; color: var(--text-primary); }
[data-link]:not(.card).deep-target { animation: none; }
[data-link]:not(.card).deep-target :is(h2, .link-title) { animation: deep-text 2.4s ease-out; }
@keyframes deep-text { 0%, 30% { color: var(--seq); } }
.scoreboard[data-link].deep-target { animation: deep-flash 2.4s ease-out; }
.scoreboard[data-link].deep-target .link-title { animation: none; }
.copy-ai { height: 34px; gap: 6px; font-size: 13px; }
@media (max-width: 1100px) { .copy-ai span { display: none; } .copy-ai { width: 34px; padding: 0; justify-content: center; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .g-3, .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; z-index: 40; width: 264px; background: var(--surface); transform: translateX(-100%); transition: transform 0.25s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .search-btn { min-width: 0; flex: 1; }
  .search-btn kbd { display: none; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .controls { margin-left: 0; width: 100%; }
  .controls .select { flex: 1; }
  .controls select { width: 100%; }
  .tabs { top: 104px; }
}
@media (max-width: 720px) {
  main { padding: 18px 16px 96px; }
  .g-2, .g-3, .g-4, .insight-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .hero { padding: 22px 20px; }
  .hero .actions { margin-left: 0; }
  .skill { grid-template-columns: 124px 1fr 30px; }
  .filters input[type="search"] { min-width: 0; flex: 1; }
  .scoreboard, .pv-hero { grid-template-columns: 1fr; text-align: center; }
  .game-side, .game-side:last-child, .pv-team, .pv-team.a { flex-direction: row; text-align: left; }
  .game-side b, .game-side:last-child b { margin-left: auto; margin-right: 0; font-size: 32px; }
  .bt-row { grid-template-columns: 1fr; }
  .bt-row > :last-child { text-align: left; }
  .skel .row { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- overview ---------- */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 2s infinite; }
.stat-team { display: inline-flex; align-items: center; color: var(--text-primary); }
.stat-team:hover { text-decoration: none; }
.stat-team .team-logo { width: 26px; height: 26px; }
.fixtures { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.fixture { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; color: var(--text-primary); box-shadow: var(--shadow-sm); transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s; }
.fixture:hover { text-decoration: none; transform: translateY(-3px); border-color: color-mix(in oklab, var(--brand) 50%, var(--border)); box-shadow: var(--shadow), 0 18px 40px -24px var(--brand); }
.fx-when { font-size: 10.5px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.fx-team { display: flex; align-items: center; gap: 8px; padding: 3px 0; color: var(--text-secondary); }
.fx-team img { width: 22px; height: 22px; object-fit: contain; }
.fx-team span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.fx-team b { font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.fx-team.fav { color: var(--text-primary); }
.fx-team.fav b { color: var(--text-primary); }
.fx-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; gap: 3px; margin-top: 10px; }
.fx-bar i { display: block; height: 100%; }
.leaders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.leader-top { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 4px; border-radius: var(--r-md); color: var(--text-primary);
  background: linear-gradient(120deg, color-mix(in oklab, var(--team) 16%, var(--surface)), var(--surface)); border: 1px solid var(--border); }
.leader-top:hover { text-decoration: none; border-color: var(--border-strong); }
.leader-top img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--surface-2); box-shadow: 0 0 0 2px var(--team); }
.leader-top div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.leader-top b { font-family: var(--font-display); font-size: 16px; }
.leader-top small { color: var(--text-muted); font-weight: 600; }
.leader-val { font-family: var(--font-display); font-size: 32px; font-weight: 800; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.leader-val small { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; margin-left: 4px; letter-spacing: 0.04em; color: var(--text-muted); }
.standings li { position: relative; padding-left: 8px; }
.standings li::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--team); }
.standings li.cut { padding: 2px 0; border-bottom: 0; }
.standings li.cut::before { display: none; }
.standings li.cut span { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); display: flex; align-items: center; gap: 8px; width: 100%; }
.standings li.cut span::after { content: ""; flex: 1; border-top: 1px dashed var(--axis); }
.form.mini span { width: 14px; height: 14px; font-size: 8.5px; border-radius: 4px; }
.story { position: relative; }
.story.link { color: inherit; display: flex; flex-direction: column; gap: 6px; transition: transform 0.15s, box-shadow 0.15s; }
.story.link:hover { text-decoration: none; transform: translateY(-3px); border-color: color-mix(in oklab, var(--brand) 50%, var(--border)); box-shadow: var(--shadow), 0 18px 40px -24px var(--brand); }
.story-ico { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; margin-bottom: 10px; box-shadow: 0 10px 24px -10px var(--brand); }
.story-cta { margin-top: auto; padding-top: 8px; color: var(--accent); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 720px) { .leaders { grid-template-columns: 1fr; } }
.fixture.result .fx-team b { font-size: 17px; }

/* ---------- team & player heroes ---------- */
.hero-main { flex: 1; min-width: 240px; }
.pill-strong { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--text-primary); background: var(--surface); border: 1px solid var(--border); padding: 1px 10px; border-radius: var(--pill); }
.hero-stats { flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; margin-top: 6px; border-top: 1px solid var(--border); padding-top: 18px; }
.hero-stat { display: flex; flex-direction: column; gap: 3px; padding: 0 18px; border-left: 1px solid var(--border); }
.hero-stat:first-child { border-left: 0; padding-left: 0; }
.hero-stat > span { font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }
.hero-stat b { font-family: var(--font-display); font-size: clamp(24px, 2.3vw, 34px); white-space: nowrap; font-weight: 800; letter-spacing: -0.025em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.hero-stat small { font-size: 12px; color: var(--text-muted); }
.hero-stat .rank-badge { align-self: flex-start; }
.hero .eyebrow { color: color-mix(in oklab, var(--team) 60%, var(--text-primary)); background: color-mix(in oklab, var(--team) 14%, transparent); }
@media (max-width: 720px) { .hero-stat { padding: 8px 12px 8px 0; border-left: 0; } }
/* percentile badge: hue by percentile (red low → neutral → blue high) */
.pct-badge { display: inline-flex; align-items: baseline; margin-left: 8px; padding: 2px 7px; border-radius: var(--pill); font-family: var(--font); font-size: 11.5px; font-weight: 700; letter-spacing: 0; vertical-align: middle;
  color: #fff; background: color-mix(in oklab, var(--pos) calc(var(--p) * 1%), var(--neg)); }
.pct-badge small { font-size: 8.5px; margin-left: 1px; }
.player-hero .avatar { width: 128px; height: 128px; }
/* two-club header (game scoreboard, match preview) */
.duel { position: relative; overflow: hidden;
  background: radial-gradient(60% 160% at 0% 50%, color-mix(in oklab, var(--home) 30%, transparent), transparent 62%),
              radial-gradient(60% 160% at 100% 50%, color-mix(in oklab, var(--away) 30%, transparent), transparent 62%), var(--surface); }
.duel::before, .duel::after { content: ""; position: absolute; top: 18%; bottom: 18%; width: 4px; border-radius: 2px; }
.duel::before { left: 0; background: var(--home); }
.duel::after { right: 0; background: var(--away); }
.section-title { flex-wrap: wrap; row-gap: 2px; }
@media (max-width: 720px) { .section-title .note { flex-basis: 100%; } .banner { padding: 26px 22px; } .banner .stats { gap: 8px; } .banner .stat { padding: 10px 14px; } .banner .stat b { font-size: 22px; } }
/* matchup edges */
.pv-player { align-items: flex-start; position: relative; }
.pv-player.xf { background: linear-gradient(90deg, color-mix(in oklab, var(--team) 10%, var(--surface)), var(--surface)); border: 1px solid color-mix(in oklab, var(--team) 30%, transparent); }
.pv-player.risk img { filter: grayscale(0.4); }
.reasons { margin: 6px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--text-secondary); }
.reasons li { margin: 2px 0; }
.edge-score { margin-left: auto; font-family: var(--font-display); font-weight: 800; color: var(--good-text); font-variant-numeric: tabular-nums; }

/* ---------- coaching: lineups, scouting, rotations ---------- */
.unit { display: inline-flex; flex-wrap: wrap; gap: 2px 6px; align-items: center; min-width: 340px; max-width: 460px; white-space: normal; }
@media (max-width: 720px) { .unit { min-width: 200px; } }
.unit a { color: var(--text-primary); text-decoration: none; font-weight: 500; }
.unit a:hover { color: var(--accent); }
.unit i { color: var(--text-muted); font-style: normal; }
h3.sub { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 18px 0 6px; }
.traits { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.traits li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 56px; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--r-sm); background: var(--surface-2, color-mix(in oklab, var(--text-primary) 4%, transparent)); }
.traits .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.traits li.good .dot { background: var(--pos); }
.traits li.bad .dot { background: var(--neg); }
.traits .t { font-weight: 500; }
.traits .v { font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.traits .r { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.traits .r small { color: var(--text-muted); font-weight: 400; }
.empty.small { padding: 14px; font-size: 13px; }
.sources { display: grid; gap: 14px; }
.src .lbl { font-weight: 600; margin-bottom: 6px; }
.src .bars > div { display: grid; grid-template-columns: 62px minmax(0, 1fr) 44px 44px; gap: 8px; align-items: center; font-size: 13px; margin: 3px 0; }
.src .k { color: var(--text-muted); }
.src .track { height: 8px; border-radius: 4px; background: color-mix(in oklab, var(--text-primary) 7%, transparent); overflow: hidden; }
.src .track i { display: block; height: 100%; border-radius: 4px; }
.src i.for { background: var(--series-1); }
.src i.ag { background: var(--text-muted); }
.src b { text-align: right; font-variant-numeric: tabular-nums; }
.src .rk { text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.src .rk.good { color: var(--pos); font-weight: 600; }
.src .rk.bad { color: var(--neg); font-weight: 600; }
.units { list-style: none; margin: 0; padding: 0; }
.units li { display: grid; grid-template-columns: minmax(0, 1fr) auto 56px; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--grid); }
.units li:last-child { border-bottom: 0; }
.units li.sep { display: block; border: 0; padding: 14px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.units .m { color: var(--text-muted); font-size: 13px; }
.units b { text-align: right; font-variant-numeric: tabular-nums; }
b.good { color: var(--good-text, var(--pos)); }
b.bad { color: var(--bad-text, var(--neg)); }
.traits .t small { display: block; font-weight: 400; font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.plan { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.plan li b { display: block; font-weight: 600; }
.plan li .note { font-size: 12.5px; }
.plan.guard { list-style: none; padding-left: 0; }
.plan.guard li { padding-left: 14px; position: relative; color: var(--text-secondary); }
.plan.guard li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--neg); }
.leader-card h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.leader-card .see-all { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--accent); white-space: nowrap; }
.reasons li.watch { color: var(--bad-text); }
.reasons li.upside { color: var(--good-text); }
.runs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.runs li { padding: 10px 12px 10px 14px; border-radius: var(--r-sm); background: var(--surface-2); border-left: 4px solid var(--team); }
.run-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.run-head b { font-family: var(--font-display); font-size: 16px; }
.run-five { display: flex; gap: 8px; align-items: baseline; font-size: 13px; margin-top: 2px; }
.run-five .note { min-width: 34px; font-weight: 600; }
.run-five.muted .unit a { color: var(--text-secondary); font-weight: 400; }
.wpa-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wpa-list li { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 7px 10px; border-left: 3px solid var(--team); background: var(--surface-2); border-radius: var(--r-sm); }
.wpa-list b { font-variant-numeric: tabular-nums; }
.fit-filters { margin: 14px 0 10px; }
.fit-note { margin: 0 0 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); }

/* ---------- season review ---------- */
.review-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: flex-end; }
.review-head .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.review-findings ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.5; }
.review-section { margin-top: 26px; }
.section-title { font-size: 22px; margin: 0 0 12px; }
.rv-standings, .rv-series, .rv-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rv-standings li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; padding: 5px 10px; border-left: 3px solid var(--team); background: var(--surface-2); border-radius: 6px; }
.rv-series li { padding: 4px 0; }
.rv-standings li.rv-group { display: block; padding: 8px 0 0; border: 0; background: none; font: 500 11px/1 var(--font-mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); }
.rv-series b { color: var(--text-primary); }
.rv-people li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
ol.rv-people { list-style: decimal; padding-left: 20px; }
ol.rv-people li { display: list-item; }
.rv-champ { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-md); border-left: 4px solid var(--team); background: color-mix(in oklab, var(--team) 12%, var(--surface)); font-size: 16px; }
.rv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.rv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.rv-card { border-top: 3px solid var(--team, var(--border)); }
.rv-card-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.rv-card .note { margin: 4px 0; }
.rv-trends { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.print-only { display: none; }
@media print {
  .sidebar, .topbar, .no-print, .tbl-tools, .modebar-container, #status, .skel { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
  .review-section { break-before: auto; }
  .print-only { display: block; }
  .table-wrap.short { max-height: none !important; overflow: visible !important; }
}
.levers { margin: 14px 0 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* Skill-percentile tables: compact two-line headers so more columns fit. */
.skill-seg-wrap { margin: -4px 0 10px; display: flex; justify-content: flex-end; }
.skill-seg-wrap .seg { flex-wrap: wrap; }
td.skill-col { min-width: 64px; text-align: center; }
table:has(td.skill-col) th { white-space: normal; max-width: 92px; line-height: 1.15; vertical-align: bottom; }

/* ---------- awards ---------- */
.aw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.aw-list > li:not(.aw-parts-row) { display: grid; grid-template-columns: auto 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px;
  border-left: 3px solid var(--team); background: var(--surface-2); border-radius: var(--r-sm); }
ul.aw-list > li { grid-template-columns: 44px minmax(0, 1fr) auto !important; }
.aw-rank { font-family: var(--font-display); font-weight: 800; font-size: 18px; width: 22px; text-align: center; color: var(--text-muted); }
.aw-list img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--surface); }
.aw-who { display: flex; flex-direction: column; min-width: 0; }
.aw-who .note { font-size: 12px; }
.aw-score { font-variant-numeric: tabular-nums; font-weight: 700; }
.aw-parts-row { margin: -2px 0 8px 42px; }
.aw-parts { display: flex; flex-wrap: wrap; gap: 6px; }
.aw-parts .chip { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.aw-official { margin: 0 0 10px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; }

/* Site footer: the non-affiliation notice on every page */
.site-foot { padding: 18px 32px 28px; border-top: 1px solid var(--border); margin-top: 24px; }
.site-foot p { max-width: 980px; font-size: 12px; line-height: 1.55; color: var(--text-muted); }
.site-foot a { white-space: nowrap; }
@media (max-width: 720px) { .site-foot { padding: 16px 16px 24px; } }
@media print { .site-foot { border: 0; padding: 8px 0 0; } }
.about { max-width: 820px; }
.about h2 { margin: 26px 0 8px; font-size: 18px; }
.about p, .about li { line-height: 1.6; color: var(--text-secondary); }
.about ul { padding-left: 20px; }

/* Playoff race: which games matter */
.race-list { margin: 6px 0 4px; padding-left: 20px; display: grid; gap: 10px; }
.race-list li > a { margin-right: 8px; }
.race-stakes { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.race-stakes b, .rr-row-style b[style] { border-bottom: 2px solid var(--team); }

/* My team */
.nav-myteam { margin-bottom: 4px; }
.myteam-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; }
.myteam { border-left: 4px solid var(--team); margin-bottom: 18px; }
.myteam h2 a { display: inline-flex; align-items: center; gap: 8px; color: inherit; }

/* Inline glossary */
.gl { border-bottom: 1px dotted var(--text-muted); cursor: help; }
.gl:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 2px; }
th.gl-th { cursor: help; }
.gl-pop { position: absolute; z-index: 60; display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--r-md); background: var(--raised);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.gl-pop b { color: var(--text-primary); font-size: 13.5px; }
.gl-pop a { font-size: 12.5px; justify-self: start; }

/* ---------- phones ---------- */
/* The bottom bar (tabbar) holds the main places and the menu within thumb reach; the top bar
   scrolls away with the page so the content gets the screen, and the tabs stick to the top. */
.tabbar { display: none; }
.top-brand { display: none; }
.team-name .tn-short { display: none; }
@media (max-width: 720px) {
  .topbar { position: static; }
  .menu-btn { display: none; }
  .top-brand { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none; color: var(--text-primary); margin-left: -4px; }
  .tabs { top: 0; margin-left: -6px; margin-right: -6px; }
  .card, h3.sub, [data-link] { scroll-margin-top: 64px; }
  main { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .site-foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 30;
    padding: 4px; background: var(--glass); border-radius: var(--r); box-shadow: var(--shadow-lg);
    -webkit-backdrop-filter: saturate(1.6) blur(20px); backdrop-filter: saturate(1.6) blur(20px); border: 1px solid var(--border); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 54px; padding: 0;
    border: 0; background: none; border-radius: var(--r-sm); color: var(--text-muted); font-size: 11px; font-weight: 600; text-decoration: none; }
  .tabbar a.active { color: var(--brand); }
  .tabbar a:active, .tabbar button:active { background: var(--surface-2); }

  /* Team and player headers: crest and name side by side, the key numbers in three columns. */
  .hero { gap: 12px 14px; }
  .hero .crest { width: 56px; height: 56px; }
  .hero .avatar { width: 76px; height: 76px; }
  .hero-main { min-width: 0; flex: 1 1 0; }
  .hero h1 { font-size: 24px; line-height: 1.15; }
  .hero .actions { width: 100%; }
  .hero .actions .btn { flex: 1 1 auto; justify-content: center; }
  .hero .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 10px; }
  .hero-stat { padding: 6px 8px 6px 0; }
  .hero-stat b { font-size: 20px; }
  .hero-stat > span { letter-spacing: 0.04em; }

  /* Overview: next games and latest results swipe sideways instead of a 10-card column each. */
  .fixtures.fx-scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin: 0 -16px; padding: 2px 16px 10px; scroll-padding: 0 16px; scrollbar-width: none; }
  .fixtures.fx-scroll::-webkit-scrollbar { display: none; }
  .fixtures.fx-scroll > * { flex: 0 0 min(78%, 300px); scroll-snap-align: start; }

  /* Tables: the first column (player, team, lineup) stays in view while the numbers scroll, and
     wraps instead of pushing every number off screen. */
  .table-wrap td:first-child, .table-wrap th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
  .table-wrap th:first-child { z-index: 3; background: var(--surface-2); }
  .table-wrap td.left:first-child { white-space: normal; min-width: 104px; max-width: 168px; }
  .table-wrap td:first-child .pname { align-items: center; }
  .table-wrap td:first-child::after { content: ""; position: absolute; top: 0; right: -6px; bottom: 0; width: 6px; pointer-events: none;
    background: linear-gradient(to right, color-mix(in oklab, var(--text-primary) 8%, transparent), transparent); }
  th, td { padding: 9px 8px; }
  .table-wrap { max-height: none; }  /* no scroll box inside the page scroll: it swallows swipes */
  /* Dropdowns shrink to the screen (long team names at 16px would widen the page), and nothing
     inside the page may widen it: that zooms the whole layout out and pushes the bottom bar off. */
  .filters label { min-width: 0; max-width: 100%; flex-wrap: wrap; }
  select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
  .filters label select { flex: 1 1 140px; }
  main { overflow-x: clip; }

  /* Rows of option chips scroll sideways instead of stacking (Players presets, archetypes). */
  .chips.scroll-row { display: flex; flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .chips.scroll-row::-webkit-scrollbar { display: none; }
  .chips.scroll-row > * { flex: none; }

  /* Teams in tables: logo and code (full names wrap to three or four lines). */
  .team-name .tn-long { display: none; }
  .team-name .tn-short { display: inline; font-weight: 650; }
  .copy-ai { display: none; }  /* Markdown download: a desk task; the season and phase get the room */

  /* Player header: photo beside the name, everything else full width below (chips no longer
     squeeze into a narrow column next to the photo). */
  .player-hero { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; align-items: center; }
  .player-hero .hero-main { display: contents; }
  .player-hero .avatar { width: 64px; height: 64px; grid-row: 1 / span 2; }
  .player-hero .eyebrow, .player-hero h1 { grid-column: 2; }
  .player-hero .meta, .player-hero .chips, .player-hero .actions, .player-hero .hero-stats { grid-column: 1 / -1; }
  .player-hero .chips { margin-top: 6px !important; }
  .player-hero .actions { margin-top: 6px; }
  .player-hero .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }  /* values carry percentile badges */

  /* Toggles stay on one line and scroll sideways if they must. */
  .seg { flex-wrap: nowrap !important; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: none; padding: 0 12px; }
  .card-head .right { margin-left: 0; max-width: 100%; }

  /* Home / away pickers: the two teams stacked with the swap button beside them, actions below. */
  .filters:has(> #swap) { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; }
  .filters:has(> #swap) > label { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; grid-column: 1; }
  .filters:has(> #swap) > #swap { grid-column: 2; grid-row: 1 / span 2; align-self: center; height: 44px; width: 44px; justify-content: center; }
  .filters:has(> #swap) > .grow { display: none; }
  .filters:has(> #swap) > .btn, .filters:has(> #swap) > button:not(#swap) { grid-column: 1 / -1; justify-content: center; }

  /* Tiles that hold a name (Fantasy captains) and award breakdowns. */
  .rr-tile b { font-size: 20px; line-height: 1.15; }
  .aw-parts-row { margin-left: 0; }
  .aw-list > li:not(.aw-parts-row) { grid-template-columns: auto 40px minmax(0, 1fr) auto; gap: 8px; }

  /* Small labels stay readable. */
  .form span { font-size: 11px; width: 19px; height: 19px; }
  .form.mini span { width: 17px; height: 17px; font-size: 11px; }
  .cat-picker .group-label { font-size: 11px; }
  .pct-badge small { font-size: 10px; }
  .standings li.cut span { font-size: 11px; }
}
/* Tabs that run off the edge fade out there, so it's clear they scroll. */
.tabs.scrolls-x { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }

/* Touch screens: fingers need bigger targets than a mouse, and iOS zooms into any input under 16px. */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px; }
  .seg button { height: 36px; padding: 0 14px; }
  .tabs button { height: 38px; }
  .chip { min-height: 34px; padding: 6px 12px; }
  .tbl-csv { height: 32px; padding: 0 10px; }
  .deep-link { width: 32px; height: 32px; margin-left: 2px; opacity: .55; }
  .modebar-container { display: none !important; }
  .see-all, .section-title a.note { display: inline-flex; align-items: center; min-height: 32px; }
  .team-chip { min-height: 30px; }
}

/* ---------- no pictures: a club is its code on its colour, a player his initials ---------- */
.badge { display: inline-grid; place-items: center; flex: none; box-sizing: border-box; background: var(--team, var(--surface-2)); color: var(--team-ink, var(--text-primary));
  font-family: var(--font-display); font-weight: 800; font-size: 10px; line-height: 1; letter-spacing: 0.02em; border-radius: 5px; text-decoration: none; }
.badge.initials { border-radius: 50%; background: var(--surface-2); color: var(--text-muted); font-weight: 700; letter-spacing: 0; }
.team-logo.badge { width: auto; min-width: 32px; height: 18px; padding: 0 4px; vertical-align: -4px; }
.stat-team .team-logo.badge { min-width: 52px; height: 28px; font-size: 16px; margin-right: 0; color: var(--team-ink); -webkit-text-fill-color: var(--team-ink); }
.hero .crest.badge { border-radius: 22%; font-size: 30px; filter: none; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28); border: 3px solid var(--team-ink); }
.game-side .crest.badge { font-size: 16px; border-radius: 22%; }
.pv-team .badge { width: 70px; height: 70px; font-size: 20px; border-radius: 22%; }
.fx-team .badge { flex: none; width: 36px; height: 20px; overflow: visible; }   /* not stretched like the name next to it */
.hero .avatar.badge { font-size: 38px; color: var(--text-primary); }
.pname .badge { width: 28px; height: 28px; font-size: 10.5px; }
.leader-top .badge { width: 52px; height: 52px; font-size: 16px; box-shadow: 0 0 0 2px var(--team); background: var(--surface); }
.pv-player .badge { width: 50px; height: 50px; font-size: 15px; }
.aw-list .badge { width: 44px; height: 44px; font-size: 13px; background: var(--surface); }
@media (max-width: 720px) { .hero .crest.badge { font-size: 16px; border-width: 2px; } .hero .avatar.badge { font-size: 22px; } }

/* ---------- who is missing (injuries and absences) ---------- */
.bad-text { color: var(--bad-text); }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plain-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.status-out { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 4px;
  background: var(--bad-bg); color: var(--bad-text); vertical-align: 1px; margin-left: 6px; }
.status-out.doubtful { background: var(--surface-2); color: var(--text-secondary); }

/* numbers within their own margin of error */
.hero-stat.faded b, .hero-stat.faded small { opacity: 0.5; }
.hero-foot { grid-column: 1 / -1; margin-top: 4px; }
.units li.faded > :not(.sep) { opacity: 0.5; }
.good-text { color: var(--good-text); }
.rr-score .rr-team { display: inline-flex; align-items: center; gap: 6px; border-bottom: 3px solid var(--team); }
.rr-score .rr-team .team-logo { width: 22px; height: 22px; margin: 0; border: 0; }
.rr-score .rr-team .team-logo.badge { width: auto; height: 18px; border-bottom: 0; }
.bar-mini { flex: 1; max-width: 120px; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin: 0 10px; }
.bar-mini i { display: block; height: 100%; background: var(--series-1); }
details.more { margin-top: 12px; }
details.more > summary { cursor: pointer; color: var(--accent, var(--good-text)); font-size: 13px; }
.tab-note { margin: 4px 0 14px; }
.unit a.out { text-decoration: line-through; opacity: 0.55; }
.rv-parts { margin: 0 0 18px; }
.missing-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; }
.miss-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.miss-item .status-out { margin-left: 0; }
.hero-stat small .sub-num { font-size: inherit; font-family: inherit; font-weight: 700; letter-spacing: 0; }
.net-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: center; }
@media (max-width: 900px) { .net-layout { grid-template-columns: 1fr; } }
.race-swings { display: grid; gap: 4px; margin-top: 6px; }
.swing { display: grid; grid-template-columns: minmax(110px, 160px) minmax(80px, 1fr) 96px; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.swing-label b { border-bottom: 2px solid var(--team); color: var(--text-primary); }
.swing-track { position: relative; height: 8px; background: var(--surface-2); border-radius: 4px; }
.swing-track i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.swing-num { text-align: right; white-space: nowrap; }
@media (max-width: 720px) { .swing { grid-template-columns: 1fr 72px; } .swing-track { grid-column: 1 / -1; grid-row: 2; } }
