/* Lakewood Wednesday Doubles — design system
   Concept: "Inside the Glow" (Astra brief, docs/CREATIVE-BRIEF-astra.md). Outside it is thirty below;
   inside the bubble the light settles. Plum architecture, lilac illumination, Riverside's blue for
   links, and a single cold edge of ice used sparingly. Mobile-first at 380px; dark only. */

:root {
  --bg: #100d19;
  --bg-2: #14101f;
  --surface: #181321;
  --surface-2: #211a2e;
  --surface-3: #2d233d;
  --line: rgba(197, 180, 220, 0.12);
  --line-strong: rgba(197, 180, 220, 0.26);
  --divider: #453750;

  --text: #f4f0fa;
  --text-2: #c9c1d5;
  --muted: #a79baf;
  --faint: #6e627a;

  --accent: #b69ae8;      /* signature lilac — selection, identity, primary action */
  --accent-2: #9d7fd6;
  --accent-ink: #100d19;
  --sky: #7ec8ff;         /* Riverside's blue — links and navigation, the family resemblance */
  --ice: #c5f4f1;         /* one cold edge: current-court tick, a short luminous rule */
  --up: #9dd9bb;
  --down: #e6a09f;
  --gold: #e6c57a;
  --sub: #ff9d4d;          /* sub-played weeks: one warm colour, nowhere else */
  --sub-bg: rgba(255, 157, 77, 0.18);
  --silver: #cbd5e1;
  --bronze: #d9a06a;

  --font-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 30px;

  --pad: 16px;
  --gap: 12px;
  --nav-h: 64px;

  --shadow-hero: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 150ms;
  --normal: 320ms;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overflow-x: clip;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + var(--safe-b));
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
}
a { color: inherit; text-decoration: none; touch-action: manipulation; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
input { font: inherit; }
svg { display: block; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- shell ---------- */
.shell { max-width: 1120px; margin: 0 auto; padding: 0 var(--pad); }
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: var(--safe-t);
  isolation: isolate;
}
.topbar__in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand__mark { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); position: relative; flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); overflow: hidden; }
.brand__mark::before { content: ''; position: absolute; left: 4px; right: 4px; top: 7px; height: 24px; border-radius: 12px 12px 0 0; border: 3px solid var(--accent); border-bottom: 0; }
.brand__mark::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--ice); }
.brand__name { font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -0.01em; line-height: 1; white-space: nowrap; }
.brand__sub { font-size: 10.5px; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; margin-top: 3px; white-space: nowrap; }
.topnav { display: none; gap: 4px; }
.topnav a { padding: 8px 14px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: 14px; transition: background var(--fast), color var(--fast); }
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a[aria-current='page'] { background: var(--surface-3); color: var(--accent); }
.weekchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.weekchip b { color: var(--accent); font-weight: 700; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
  background: color-mix(in srgb, var(--bg-2) 96%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  isolation: isolate;
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 44px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.tabbar a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current='page'] { color: var(--accent); }
/* Phones (incl. Pro Max landscape ~956px) keep the tab bar. Desktop chrome from 1024px. */
@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .topnav { display: flex; }
  .topbar__in { min-height: 66px; }
  .brand__name { font-size: 19px; }
  :root { --pad: 28px; --gap: 16px; }
}

.page { padding: 18px 0 40px; }
@media (prefers-reduced-motion: no-preference) {
  .page { animation: rise var(--normal) var(--ease); }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- type ---------- */
.kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.kicker--accent { color: var(--accent); }
.h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 8vw, 46px); letter-spacing: -0.03em; line-height: 0.98; margin: 6px 0 8px; }
.h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.h3 { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; margin: 0; }
.lede { color: var(--text-2); font-size: 15px; max-width: 46ch; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.micro { font-size: 11.5px; }
.section { margin-top: 30px; }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section__head .h2 { margin-top: 4px; }
.link { color: var(--sky); font-weight: 600; font-size: 13px; white-space: nowrap; }
.link:hover { text-decoration: underline; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.card--pad-0 { padding: 0; overflow: hidden; }
.card--flat { background: var(--bg-2); }
.card--accent { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--accent) 4%, transparent)); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.card__head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* Hero — light held under a canopy: broad faint arcs from beyond the card's edges,
   a lilac wash behind the rank, one short ice rule at the top edge. */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl);
  background: linear-gradient(165deg, #2a2040 0%, #1d1630 48%, #150f22 100%);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-hero);
  padding: 22px 20px 20px;
}
.hero::before {
  content: '';
  position: absolute; left: -30%; right: -30%; top: -140%; height: 260%;
  background:
    radial-gradient(ellipse at 50% 100%, transparent 58%, rgba(255, 255, 255, 0.05) 58.3%, rgba(255, 255, 255, 0.05) 59.4%, transparent 59.7%),
    radial-gradient(ellipse at 50% 100%, transparent 68%, rgba(255, 255, 255, 0.045) 68.3%, rgba(255, 255, 255, 0.045) 69.2%, transparent 69.5%),
    radial-gradient(ellipse at 50% 100%, transparent 79%, rgba(255, 255, 255, 0.04) 79.3%, rgba(255, 255, 255, 0.04) 80%, transparent 80.3%),
    radial-gradient(ellipse at 50% 100%, transparent 91%, rgba(255, 255, 255, 0.035) 91.3%, rgba(255, 255, 255, 0.035) 91.9%, transparent 92.2%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute; width: 420px; height: 420px; right: -160px; top: -200px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 26%, transparent), color-mix(in srgb, var(--accent) 0%, transparent) 62%);
  pointer-events: none;
}
.hero__ice { position: absolute; top: 0; left: 24px; width: 64px; height: 2px; border-radius: 0 0 2px 2px; background: var(--ice); box-shadow: 0 0 12px color-mix(in srgb, var(--ice) 70%, transparent); z-index: 1; }
.hero > * { position: relative; }
.hero__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hero__name { font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 9vw, 52px); letter-spacing: -0.03em; line-height: 0.95; margin: 6px 0 0; word-break: break-word; }
.hero__rank { text-align: right; flex: none; }
.hero__rank .display { font-size: clamp(44px, 14vw, 76px); color: var(--accent); font-weight: 800; letter-spacing: -0.05em; }
.hero__rank .display sup { font-size: 0.42em; vertical-align: top; margin-top: 0.4em; display: inline-block; color: var(--accent-2); }
.hero__stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.hero__chart { margin-top: 16px; }
@media (min-width: 640px) {
  .hero { padding: 28px 28px 24px; }
  .hero__stats { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- stats ---------- */
.stat { min-width: 0; }
.stat__label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stat__value { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -0.02em; line-height: 1.05; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat__value--accent { color: var(--accent); }
.stat__value--sm { font-size: 20px; }
.stat__sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.statgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.statgrid .card { padding: 14px; }
@media (min-width: 640px) { .statgrid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.2; white-space: nowrap; background: var(--surface-3); color: var(--text-2); font-variant-numeric: tabular-nums; }
.chip--up { background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); }
.chip--down { background: color-mix(in srgb, var(--down) 14%, transparent); color: var(--down); }
.chip--flat { background: var(--surface-3); color: var(--muted); }
.chip--new { background: color-mix(in srgb, var(--sky) 16%, transparent); color: var(--sky); }
.chip--accent { background: var(--accent); color: var(--accent-ink); }
.chip--ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); font-weight: 600; }
.chip--gold { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.chip--sky { background: color-mix(in srgb, var(--sky) 14%, transparent); color: var(--sky); }
.chip--sm { font-size: 11px; padding: 2px 7px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); transition: transform var(--fast), background var(--fast), border-color var(--fast); }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.98); }
.btn--accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn--accent:hover { background: color-mix(in srgb, var(--accent) 85%, white); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 7px 12px; font-size: 13px; }
.btn--block { width: 100%; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- search ---------- */
.search { position: relative; }
.search__input {
  width: 100%; padding: 15px 44px 15px 46px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--text);
  font-size: 16px; outline: none; transition: border-color var(--fast), box-shadow var(--fast);
}
.search__input::placeholder { color: var(--faint); }
.search__input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.search__icon { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2.2; stroke-linecap: round; }
.search__clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.search__clear:hover { background: var(--surface-3); color: var(--text); }
.search__results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8); }
.search__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.search__row:last-child { border-bottom: 0; }
.search__row:hover, .search__row[aria-selected='true'] { background: var(--surface-3); }
.search__row b { font-weight: 600; }

/* ---------- list rows (standings) ---------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px;
  padding: 11px 12px; border-bottom: 1px solid var(--line);
  transition: background var(--fast);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row--me { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%); box-shadow: inset 3px 0 0 var(--accent); }
.row__rank { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.03em; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.row__rank--1 { color: var(--gold); }
.row__rank--2 { color: var(--silver); }
.row__rank--3 { color: var(--bronze); }
.row__main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row__name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.row__meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.row__right { display: flex; align-items: center; gap: 12px; }
.row__spark { display: none; }
.row__pts { text-align: right; }
.row__pts b { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.row__pts span { display: block; font-size: 10.5px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
@media (min-width: 640px) {
  .row { grid-template-columns: 48px 1fr auto; padding: 12px 16px; }
  .row__spark { display: block; }
}

/* ---------- full table (desktop standings) ---------- */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.tablewrap::-webkit-scrollbar { height: 8px; }
.tablewrap::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.tablewrap::-webkit-scrollbar-track { background: transparent; }
.tablecard { position: relative; }
.tablecard::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 64px; pointer-events: none; opacity: 0; transition: opacity var(--fast); background: linear-gradient(90deg, rgba(19, 28, 50, 0), var(--surface) 85%); }
.tablecard[data-scroll='more']::after { opacity: 1; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { background: var(--surface-2); color: var(--muted); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; padding: 10px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line-strong); }
.table th:first-child, .table th.left, .table td.left { text-align: left; }
.table th button { color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.table th[aria-sort='descending'] button::after { content: ' ▾'; color: var(--accent); }
.table th[aria-sort='ascending'] button::after { content: ' ▴'; color: var(--accent); }
.table th[aria-sort='descending'], .table th[aria-sort='ascending'] { color: var(--text); }
.table td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th.wk, .table td.wk { padding-left: 6px; padding-right: 6px; min-width: 36px; }
.table tr:hover td { background: var(--surface-2); }
.table tr.is-me td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.table td.dim { color: var(--faint); }
.table td.dim2 { color: var(--muted); }
.table td.dropped { color: var(--faint); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--down) 50%, transparent); }
.table td.strong { font-weight: 800; color: var(--accent); font-size: 15px; font-family: var(--font-display); }
.table td.name { font-weight: 600; text-align: left; width: 150px; min-width: 150px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.table th.sticky--2 { width: 150px; min-width: 150px; }
.table td.name a:hover { color: var(--accent); }
.table td.rank { color: var(--muted); font-family: var(--font-display); font-weight: 800; font-size: 16px; width: 46px; min-width: 46px; }
.table td.rank--top { color: var(--accent); }
.table .sticky { position: sticky; z-index: 2; background: var(--surface); }
.table th.sticky { background: var(--surface-2); z-index: 3; }
.table .sticky--1 { left: 0; }
.table .sticky--2 { left: 46px; }
.table .sticky--3 { left: 196px; box-shadow: 10px 0 14px -10px rgba(0, 0, 0, 0.75); }
.table tr:hover td.sticky { background: var(--surface-2); }
.table tr.is-me td.sticky { background: color-mix(in srgb, var(--surface) 90%, var(--accent)); }
.only-desktop-inline { display: none; }
@media (min-width: 1024px) {
  .only-desktop-inline { display: inline; }
  .card--wide { --wide: min(calc(100vw - 2 * var(--pad) - 20px), 1440px); width: var(--wide); margin-left: calc(50% - var(--wide) / 2); }
}

/* ---------- headline cards ---------- */
.headlines { display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; padding: 2px 0 10px; margin: 0 calc(var(--pad) * -1); padding-left: var(--pad); padding-right: var(--pad); scrollbar-width: none; }
.headlines::-webkit-scrollbar { display: none; }
.headline { scroll-snap-align: start; display: flex; flex-direction: column; justify-content: space-between; min-height: 150px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; transition: border-color var(--fast), transform var(--fast); }
.headline:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.headline--lead { background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--accent) 3%, transparent) 60%), var(--surface); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.headline__label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.headline__label svg { width: 14px; height: 14px; stroke: var(--accent); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.headline__big { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; line-height: 1.05; margin-top: 10px; }
.headline__stat { font-family: var(--font-display); font-weight: 800; font-size: 34px; letter-spacing: -0.04em; line-height: 1; color: var(--accent); margin-top: 6px; font-variant-numeric: tabular-nums; }
.headline__sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
@media (min-width: 640px) {
  .headlines { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(2, 1fr); overflow: visible; margin: 0; padding: 0; }
}
@media (min-width: 900px) {
  .headlines { grid-template-columns: 1.35fr 1fr 1fr 1fr; }
}

/* ---------- night strip ---------- */
.night { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
@media (max-width: 520px) { .night { grid-template-columns: 1fr; } }
.night__facts { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-2); font-size: 13.5px; }
.night__facts b { color: var(--text); font-weight: 700; }

/* ---------- grids ---------- */
.grid-2 { display: grid; gap: var(--gap); }
.grid-3 { display: grid; gap: var(--gap); }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.split { display: grid; gap: var(--gap); }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }

/* ---------- pair / rival rows ---------- */
.pair { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.pair:last-child { border-bottom: 0; }
.pair__names { font-weight: 600; font-size: 14.5px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; min-width: 0; }
.pair__names .amp { color: var(--faint); font-weight: 400; }
.pair__meta { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.pair__pct { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -0.03em; text-align: right; font-variant-numeric: tabular-nums; }
.pair__pct small { display: block; font-family: var(--font-body); font-weight: 600; font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width var(--normal) var(--ease); }
.bar--split { display: flex; background: var(--down); }
.bar--split > i { border-radius: 999px 0 0 999px; background: var(--up); }

.rival { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rival:last-child { border-bottom: 0; }
.rival__a { text-align: right; font-weight: 600; }
.rival__b { font-weight: 600; }
.rival__score { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rival__score small { display: block; font-family: var(--font-body); font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.rival .lose { color: var(--muted); }

/* ---------- matrix ---------- */
.matrix { border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.matrix th { font-weight: 600; color: var(--muted); padding: 2px 4px; white-space: nowrap; }
.matrix thead th { writing-mode: vertical-rl; transform: rotate(180deg); height: 68px; font-size: 11px; text-align: left; }
.matrix tbody th { text-align: right; padding-right: 8px; }
.matrix td { width: 38px; height: 34px; text-align: center; border-radius: 7px; font-weight: 700; background: var(--surface-2); color: var(--faint); font-variant-numeric: tabular-nums; }
.matrix td.c0 { color: var(--faint); }
.matrix td.c1 { background: color-mix(in srgb, var(--down) 22%, transparent); color: var(--down); }
.matrix td.c2 { background: var(--surface-3); color: var(--text-2); }
.matrix td.c3 { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); }
.matrix td.c4 { background: var(--accent); color: var(--accent-ink); }
.matrix td.self { background: transparent; }

/* ---------- courts (week detail) ---------- */
.court { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.court__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.court__title { font-family: var(--font-display); font-weight: 800; font-size: 16px; }
.court table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.court td, .court th { padding: 8px 10px; text-align: right; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--line); white-space: nowrap; }
.court th { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.court td.left, .court th.left { text-align: left; }
.court tr:last-child td { border-bottom: 0; }
.court td.pts { font-weight: 800; color: var(--accent); }
.court td.pos { color: var(--muted); width: 30px; }
.court__sets { padding: 10px 14px; border-top: 1px solid var(--line); background: var(--bg-2); font-size: 12.5px; color: var(--text-2); display: grid; gap: 5px; }
.court__sets b { color: var(--text); font-weight: 600; }
.court__sets .score { font-family: var(--font-display); font-weight: 800; color: var(--accent); margin: 0 6px; font-variant-numeric: tabular-nums; }
.court__note { padding: 8px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- history timeline ---------- */
.timeline { position: relative; display: grid; gap: 14px; }
.week { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; transition: border-color var(--fast), transform var(--fast); }
.week:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.week--latest { background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 14%, transparent), color-mix(in srgb, var(--accent) 2%, transparent) 55%), var(--surface); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.week__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.week__title { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -0.03em; display: inline-block; }
.week__title:hover { color: var(--accent); }
.week__facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
@media (min-width: 640px) { .week__facts { grid-template-columns: repeat(4, 1fr); } }
.week__story { margin-top: 12px; color: var(--text-2); font-size: 14px; display: grid; gap: 4px; }
.winners { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* ---------- misc ---------- */
.empty { padding: 22px 16px; text-align: center; color: var(--muted); font-size: 13.5px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.meter { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.meter i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--surface-3); }
.meter i.on { background: var(--accent); }
.banner { background: color-mix(in srgb, var(--sky) 12%, transparent); border: 1px solid color-mix(in srgb, var(--sky) 35%, transparent); color: var(--sky); border-radius: var(--r-md); padding: 10px 14px; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.banner--warn { background: color-mix(in srgb, var(--gold) 12%, transparent); border-color: color-mix(in srgb, var(--gold) 40%, transparent); color: var(--gold); }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px); transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 10px 16px; border-radius: 999px; z-index: 60; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6); animation: rise var(--fast) var(--ease); }
@media (min-width: 1024px) { .toast { bottom: 24px; } }
.footer { margin-top: 48px; padding: 20px 0 10px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }
.footer a { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 13px; background: var(--surface-3); color: var(--text); flex: none; }
.avatar--accent { background: var(--accent); color: var(--accent-ink); }
.plist { display: grid; gap: 8px; }
.plist a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--line); }
.plist a:hover { border-color: var(--line-strong); }
details.disclose { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
details.disclose > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary::after { content: '+'; font-family: var(--font-display); font-size: 20px; color: var(--muted); }
details.disclose[open] > summary::after { content: '–'; }
details.disclose > .disclose__body { padding: 0 16px 16px; }
.skeleton { display: grid; gap: 12px; }
.skeleton i { display: block; height: 80px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* responsive helpers */
.only-desktop { display: none; }
@media (min-width: 1024px) { .only-desktop { display: block; } .only-mobile { display: none; } }

/* charts */
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font-body); }
.race-label { font-weight: 700; font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .page { opacity: 1; transform: none; }
  .topbar, .tabbar { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media print {
  body { background: #fff; color: #000; padding: 0; }
  .topbar, .tabbar, .footer, .btn { display: none !important; }
  .card, .hero, .week, .court { border-color: #ccc; background: #fff; color: #000; box-shadow: none; }
}

/* ---------- term toggle ---------- */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); gap: 2px; }
.seg button { padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); min-height: 32px; }
.seg button[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); }

/* ---------- court board (lineup) ---------- */
.board { display: grid; gap: 12px; }
@media (min-width: 640px) { .board { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .board { grid-template-columns: repeat(3, 1fr); } }
.ct { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 14px 12px; overflow: hidden; }
.ct--me { border-color: color-mix(in srgb, var(--ice) 55%, transparent); box-shadow: inset 3px 0 0 var(--ice); }
.ct--1 { background: linear-gradient(150deg, color-mix(in srgb, var(--gold) 10%, var(--surface)), var(--surface) 60%); }
.ct__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ct__num { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.ct__num small { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.ct__slots { display: grid; gap: 4px; }
.ct__slot { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; min-height: 38px; }
.ct__slot:hover { background: var(--surface-2); }
.ct__slot.is-me { background: color-mix(in srgb, var(--ice) 8%, var(--surface-2)); }
.ct__seed { font-family: var(--font-display); font-weight: 800; font-size: 13px; color: var(--muted); text-align: center; }
.ct__name { font-weight: 600; font-size: 14.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct__name small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.ct__right { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.ct__rot { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.ct__rot b { color: var(--text-2); font-weight: 600; }

/* SUB capsule — a roster annotation, not a warning */
.sub { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--text-2); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.4; vertical-align: 2px; margin-left: 6px; }

/* movement words */
.mv { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.mv--up { color: var(--up); }
.mv--down { color: var(--down); }
.mv--hold { color: var(--muted); font-weight: 600; }
.mv--king { color: var(--gold); }

/* King of Court 1 — a gold I inside a narrow arch */
.king { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--gold) 7%, transparent); }
.king__arch { width: 28px; height: 34px; border: 2px solid var(--gold); border-bottom: 0; border-radius: 14px 14px 0 0; display: grid; place-items: end center; font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--gold); padding-bottom: 2px; box-shadow: 0 2px 0 0 var(--gold); flex: none; }
.king__text { font-size: 12.5px; color: var(--text-2); line-height: 1.3; }
.king__text b { display: block; color: var(--gold); font-size: 13.5px; }

/* six illuminated stops — the ladder rail */
.rail { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; align-items: end; height: 46px; }
.rail i { display: block; border-radius: 4px 4px 2px 2px; background: var(--surface-3); position: relative; }
.rail i span { position: absolute; left: 0; right: 0; bottom: -16px; font-size: 10px; text-align: center; color: var(--faint); font-weight: 600; }
.rail i.on { background: var(--accent); }
.rail i.now { background: var(--ice); box-shadow: 0 0 10px color-mix(in srgb, var(--ice) 60%, transparent); }
.rail i.now span { color: var(--ice); }

/* ---------- sub directory ---------- */
.dir { display: grid; gap: 8px; }
@media (min-width: 720px) { .dir { grid-template-columns: repeat(2, 1fr); } }
.person { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.person__name { font-weight: 600; font-size: 14.5px; }
.person__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.person__acts { display: flex; gap: 6px; }
.person__acts .btn { padding: 7px 10px; min-height: 36px; }

/* ---------- scorer ---------- */
.scorer .ct { padding-bottom: 14px; }
.sets { display: grid; gap: 6px; margin-top: 8px; }
.setrow { display: grid; grid-template-columns: 1fr 44px 12px 44px 1fr; align-items: center; gap: 6px; font-size: 12.5px; }
.setrow .l { text-align: right; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setrow .r { color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setrow input { width: 44px; height: 40px; text-align: center; font: 700 16px var(--font-display); color: var(--text); background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 10px; font-variant-numeric: tabular-nums; }
.setrow input:focus { outline: 2px solid var(--sky); outline-offset: 1px; }
.setrow input.bad { border-color: var(--down); }
.select { width: 100%; min-height: 36px; padding: 6px 8px; font: 500 13px var(--font-body); color: var(--text); background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 10px; }
textarea.out { width: 100%; min-height: 160px; font: 12px ui-monospace, Menlo, monospace; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; }
.sample { background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); border-radius: var(--r-md); padding: 8px 14px; font-size: 12.5px; font-weight: 600; margin-bottom: 14px; }

/* ---------- polish: floodlit atmosphere (2026-09-23) ----------
   Additive layer: layout and the tokens above are unchanged; this adds light, depth and motion.
   --glow follows the accent, so tenant palettes carry through. */
:root {
  --glow: var(--accent);
  --glow-2: var(--accent-2);
  --edge: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --lift: 0 18px 40px -22px rgba(0, 0, 0, 0.85);
  scrollbar-color: var(--surface-3) var(--bg);
}
::selection { background: color-mix(in srgb, var(--glow) 32%, transparent); color: var(--text); }
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 55% at 50% -14%, color-mix(in srgb, var(--glow) 10%, transparent), transparent 62%),
    radial-gradient(60% 45% at -5% 0%, color-mix(in srgb, var(--glow-2) 8%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 45%);
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent 5%, color-mix(in srgb, var(--glow) 50%, transparent) 50%, transparent 95%);
}
.topnav a[aria-current='page'] { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--glow) 28%, transparent); }
.tabbar a { position: relative; transition: color var(--fast); }
.tabbar a[aria-current='page']::before {
  content: ''; position: absolute; top: -1px; left: 50%; width: 28px; height: 3px; transform: translateX(-50%);
  border-radius: 0 0 3px 3px; background: var(--glow);
  box-shadow: 0 0 14px color-mix(in srgb, var(--glow) 70%, transparent);
}
.tabbar a[aria-current='page'] svg { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--glow) 45%, transparent)); }

.card, .court, .week, .headline, .award, details.disclose { box-shadow: var(--edge); }
.hero { box-shadow: var(--shadow-hero), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
@media (hover: hover) {
  .headline:hover, .week:hover, .award:hover, .plist a:hover {
    box-shadow: var(--edge), var(--lift);
    border-color: color-mix(in srgb, var(--glow) 30%, var(--line-strong));
  }
  .btn:hover { transform: translateY(-1px); }
}
.btn { transition: transform var(--fast), background var(--fast), border-color var(--fast), box-shadow var(--fast); }
.btn:active { transform: scale(0.98); }
.btn--ball, .btn--accent {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 60%);
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--glow) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.hero__rank .display { text-shadow: 0 0 36px color-mix(in srgb, var(--glow) 40%, transparent); }
.stat__value--ball, .stat__value--accent, .headline__stat, .award__value { text-shadow: 0 0 22px color-mix(in srgb, currentColor 30%, transparent); }
.row__rank--1 { text-shadow: 0 0 16px color-mix(in srgb, var(--gold) 50%, transparent); }
.chip--up, .chip--down, .chip--new, .chip--gold, .chip--sky { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent); }
.footer { border-top-color: transparent; background: linear-gradient(90deg, transparent, var(--line-strong), transparent) top / 100% 1px no-repeat; }

@media (prefers-reduced-motion: no-preference) {
  .page > * { animation: rise var(--normal) var(--ease) backwards; }
  .page > :nth-child(2) { animation-delay: 40ms; }
  .page > :nth-child(3) { animation-delay: 80ms; }
  .page > :nth-child(4) { animation-delay: 120ms; }
  .page > :nth-child(n + 5) { animation-delay: 160ms; }
}
@media print { body::before { display: none; } }

/* ---------- sub tracker ---------- */
.table td.wk--sub { background: var(--sub-bg); color: var(--sub); font-weight: 700; box-shadow: inset 0 -2px 0 var(--sub); }
.table td.wk--capped { box-shadow: inset 0 0 0 2px var(--sub); }
.subgrid td.wk--sub small { display: block; font-size: 10px; font-weight: 500; color: var(--text-2); line-height: 1.1; }
.subgrid td, .subgrid th { text-align: center; }
.subgrid td.left, .subgrid th.left { text-align: left; }
.legend i.swatch--sub { background: var(--sub-bg); box-shadow: inset 0 -2px 0 var(--sub); }
.legend i.swatch--capped { box-shadow: inset 0 0 0 2px var(--sub); }
.legend i.swatch--self { background: var(--surface-3); }
.subtag { color: var(--sub); background: var(--sub-bg); border-radius: 999px; padding: 0 7px; font-weight: 600; }
/* sparklines keep their drawn size in table cells and standings rows (100% width stretched rows once two weeks existed) */
.table td .chart, .row__spark .chart { width: auto; max-width: 100%; height: auto; }
