/* =============================================================================
   sportperspective — foundation stylesheet
   -----------------------------------------------------------------------------
   Contract: token names (§2.1) and component class names (§2.4) are shared
   with every page. Page CSS (css/pages/<page>.css) may only use tokens.

   Contents
     1. Fonts (fallback metrics)
     2. Tokens — static, dark, light, system preference, league scopes
     3. Reset / base
     4. Typography
     5. Layout (.wrap, .section, .page-head, grids)
     6. Header, nav, mobile sheet, footer, wordmark
     7. Controls (.btn, .icon-btn, .seg → .league-toggle / .tabs)
     8. Data components (.team-badge, .tag, .move, .bar, .score-chip,
        .ticker, .leader-list, .data-table)
     9. Cards (.card, .article-card)
    10. States (.skeleton, .empty-state, .error-state, .notice)
    11. Prose (article body)
    12. Motion (all gated behind prefers-reduced-motion: no-preference)
    13. Utilities
    14. Print
   ============================================================================= */


/* 1. Fonts ------------------------------------------------------------------
   Archivo / Source Serif 4 come from Google Fonts (see head boilerplate in
   styleguide.html). These local fallbacks are metric-tuned to reduce layout
   shift while the webfonts load (display=swap). */
@font-face {
  font-family: "Archivo Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica"), local("Liberation Sans"), local("Roboto");
  size-adjust: 101%;
  ascent-override: 87%;
  descent-override: 21%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Source Serif Fallback";
  src: local("Georgia"), local("Charter"), local("Liberation Serif"), local("Times New Roman");
  size-adjust: 98%;
  ascent-override: 92%;
  descent-override: 30%;
}


/* 2. Tokens -------------------------------------------------------------- */
:root {
  /* type */
  --font-sans: "Archivo", "Archivo Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: "Archivo", "Roboto Condensed", "Arial Narrow", "Archivo Fallback", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Source Serif 4", "Source Serif Fallback", Georgia, Charter, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* radius */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;

  /* spacing: 4 / 8 / 12 / 16 / 24 / 32 / 48 / 72 / 112 */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;
  --s-9: 112px;

  /* layout */
  --wrap: 1200px;
  --gutter: 24px;
  --measure: 68ch;
  --header-h: 60px;

  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-pop: cubic-bezier(.3, 1.5, .5, 1);
  --t-fast: 140ms;
  --t: 260ms;
  --t-slow: 600ms;

  /* z layers */
  --z-sticky: 2;
  --z-header: 50;
}
@media (max-width: 599px) {
  :root { --gutter: 16px; --header-h: 56px; }
}

/* Light ("paper") — the default when nothing else applies. */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #F5F3EE;
  --surface: #FFFFFF;
  --surface-2: #EDEAE3;
  --line: #DDD8CE;
  --line-strong: #C4BDB0;
  --text: #12161C;
  --muted: #5E6875;
  --faint: #8A929C;
  --accent: #D93A17;
  --accent-ink: #FFFFFF;
  --nhl: #0B7FC2;
  --nfl: #11834A;
  --up: #11834A;
  --down: #C62F2F;

  /* derived (not part of the §2.1 contract, safe to use) */
  --league: var(--accent);
  --focus: var(--accent);
  --shadow-card: 0 1px 1px rgb(18 22 28 / .03), 0 2px 10px -2px rgb(18 22 28 / .06);
  --shadow-pop: 0 12px 32px -12px rgb(18 22 28 / .22);
  --header-bg: rgb(245 243 238 / .84);
  --badge-ring: rgb(18 22 28 / .08);
  --scrim: rgb(18 22 28 / .28);
  --ink-mix: 76%;
}

/* Dark ("arena") — explicit choice … */
:root[data-theme="dark"],
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A0D12;
  --surface: #11161D;
  --surface-2: #18202A;
  --line: #232D3A;
  --line-strong: #34414F;
  --text: #EEF2F6;
  --muted: #8C99A8;
  --faint: #5B6877;
  --accent: #FF5A36;
  --accent-ink: #0A0D12;
  --nhl: #5CC8FF;
  --nfl: #4FD08A;
  --up: #4FD08A;
  --down: #FF6B6B;

  --league: var(--accent);
  --focus: var(--accent);
  --shadow-card: none;
  --shadow-pop: 0 16px 40px -12px rgb(0 0 0 / .6);
  --header-bg: rgb(10 13 18 / .78);
  --badge-ring: rgb(238 242 246 / .12);
  --scrim: rgb(0 0 0 / .5);
  --ink-mix: 100%;
}

/* … and system preference when no explicit choice was made. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0A0D12;
    --surface: #11161D;
    --surface-2: #18202A;
    --line: #232D3A;
    --line-strong: #34414F;
    --text: #EEF2F6;
    --muted: #8C99A8;
    --faint: #5B6877;
    --accent: #FF5A36;
    --accent-ink: #0A0D12;
    --nhl: #5CC8FF;
    --nfl: #4FD08A;
    --up: #4FD08A;
    --down: #FF6B6B;

    --league: var(--accent);
    --focus: var(--accent);
    --shadow-card: none;
    --shadow-pop: 0 16px 40px -12px rgb(0 0 0 / .6);
    --header-bg: rgb(10 13 18 / .78);
    --badge-ring: rgb(238 242 246 / .12);
    --scrim: rgb(0 0 0 / .5);
    --ink-mix: 100%;
  }
}

/* A nested [data-theme] block (e.g. a side-by-side preview) paints itself. */
:root [data-theme] {
  background: var(--bg);
  color: var(--text);
}

/* League scopes: league-coloured details use var(--league). */
[data-league="nhl"] { --league: var(--nhl); }
[data-league="nfl"] { --league: var(--nfl); }

/* Text-safe variants of the signal colours. In light theme the spec hues
   (e.g. --nhl #0B7FC2, --up #11834A) sit just under 4.5:1 on paper, so text
   uses these slightly deepened inks; in dark they equal the base colour.
   Use --league / --up / --down for fills, bars and dots; *-ink for text. */
:root, [data-theme], [data-league] {
  --league-ink: color-mix(in srgb, var(--league) var(--ink-mix), var(--text));
  --accent-text: color-mix(in srgb, var(--accent) var(--ink-mix), var(--text));
  --up-ink: color-mix(in srgb, var(--up) var(--ink-mix), var(--text));
  --down-ink: color-mix(in srgb, var(--down) var(--ink-mix), var(--text));
}


/* 3. Reset / base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--s-4));
  hanging-punctuation: first last;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  font-stretch: 100%;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
body > main { flex: 1 0 auto; }

:where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ol, ul) { margin: 0; }
:where(ol[class], ul[class]) { list-style: none; padding: 0; }
img, svg, video, canvas { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
table { border-collapse: collapse; }
abbr[title] { text-decoration: none; cursor: help; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-6) 0; }
[hidden] { display: none !important; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: .22em;
  transition: text-decoration-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
a:hover { text-decoration-color: var(--accent); }

::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--text); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

main:focus-visible { outline: none; }

/* Scrollbars stay quiet. */
* { scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }


/* 4. Typography ----------------------------------------------------------- */
h1, .h1, .display {
  font-family: var(--font-sans);
  font-stretch: 118%;
  font-weight: 800;
  font-size: clamp(2.5rem, 6.5vw, 5.5rem);
  line-height: .98;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* A quieter h1 for inner pages (Stats, Articles, About …). */
.page-title {
  font-stretch: 118%;
  font-weight: 800;
  font-size: clamp(2.125rem, 1.4rem + 3.2vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2, .h2 {
  font-stretch: 110%;
  font-weight: 750;
  font-size: clamp(1.375rem, 1.05rem + 1.2vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h3, .h3 {
  font-stretch: 106%;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

h4, .h4 {
  font-stretch: 104%;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
}

.kicker,
.label {
  display: block;
  font-family: var(--font-sans);
  font-stretch: 100%;
  font-weight: 650;
  font-size: .72rem;
  line-height: 1.3;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.label { display: inline; }
.kicker--accent { color: var(--accent-text); }
.kicker--league { color: var(--league-ink); }

/* Numerals: stats, scores, ranks. */
.num {
  font-family: var(--font-num);
  font-stretch: 78%;
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0;
}
.num--rank {
  font-stretch: 78%;
  font-weight: 800;
  line-height: .9;
  letter-spacing: -0.01em;
}
.num--xl { font-size: clamp(3rem, 2rem + 4vw, 5.5rem); }
.num--lg { font-size: 2.25rem; }

.dek,
.lede {
  font-size: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
  line-height: 1.45;
  color: var(--muted);
  max-width: 60ch;
  text-wrap: pretty;
}

.small, small { font-size: .875rem; }
.meta {
  font-size: .8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.muted { color: var(--muted); }
.up { color: var(--up-ink); }
.down { color: var(--down-ink); }

p { text-wrap: pretty; }

code, kbd, samp, pre { font-family: var(--font-mono); font-size: .875em; }


/* 5. Layout --------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: calc(var(--measure) + 2 * var(--gutter)); }

.section { padding-block: var(--s-8); }
.section + .section { padding-top: 0; }
.section--tight { padding-block: var(--s-7); }
@media (max-width: 599px) {
  .section { padding-block: var(--s-7); }
}

/* Section head: hairline rule on top, kicker over h2, optional link right. */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-2) var(--s-5);
  flex-wrap: wrap;
  padding-top: var(--s-4);
  margin-bottom: var(--s-6);
  border-top: 1px solid var(--line-strong);
}
.section-head > :first-child { min-width: 0; }
.section-head .kicker { margin-bottom: var(--s-2); }
.section-head__meta {
  font-size: .8125rem;
  color: var(--muted);
  margin-top: var(--s-2);
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-size: .875rem;
  font-weight: 600;
  font-stretch: 104%;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  padding-block: var(--s-1);
}
.section-link::after {
  content: "→";
  font-family: var(--font-sans);
  transition: transform var(--t-fast) var(--ease);
}
.section-link:hover { color: var(--text); }

/* Page header block for inner pages. */
.page-head {
  padding-top: var(--s-8);
  padding-bottom: var(--s-6);
}
.page-head .kicker { margin-bottom: var(--s-3); }
.page-head .dek { margin-top: var(--s-4); }
@media (max-width: 599px) {
  .page-head { padding-top: var(--s-7); }
}

/* Grids & stacks */
.grid {
  display: grid;
  gap: var(--gap, var(--s-5));
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 280px)), 1fr));
}
.grid-2, .grid-3 {
  display: grid;
  gap: var(--gap, var(--s-5));
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 760px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap, var(--s-6)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.stack > * + * { margin-top: var(--space, var(--s-4)); }
.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gap, var(--s-3));
}

.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }


/* 6. Header / nav / footer ---------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--s-4);
  top: var(--s-2);
  z-index: calc(var(--z-header) + 1);
  padding: var(--s-2) var(--s-4);
  background: var(--text);
  color: var(--bg);
  border-radius: var(--r-sm);
  font-weight: 650;
  text-decoration: none;
}
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-header,
[data-site-header] {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  min-height: var(--header-h);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  view-transition-name: site-header;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header, [data-site-header] { background: var(--bg); }
}

.site-header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--s-5);
}

/* Wordmark --------------------------------------------------------------- */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-stretch: 112%;
  font-size: 1.1875rem;
  line-height: 1;
  letter-spacing: -0.015em;
  white-space: nowrap;
  border-radius: var(--r-sm);
}
.wordmark__mark {
  width: 1.45em;
  height: 1.45em;
  color: var(--accent);
}
.wordmark__text { display: inline-flex; }
.wordmark__a { font-weight: 400; }
.wordmark__b { font-weight: 800; }
.wordmark:hover { text-decoration: none; }

/* Primary nav ------------------------------------------------------------ */
.site-nav { margin-left: auto; }
.site-nav__list {
  display: flex;
  align-items: center;
  gap: var(--s-5);
}
.site-nav a {
  position: relative;
  display: inline-block;
  padding: var(--s-2) 0;
  font-size: .9375rem;
  font-weight: 600;
  font-stretch: 104%;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
}
.site-nav a:hover { color: var(--text); }
.site-nav a:hover::after { transform: scaleX(1); }
.site-nav a[aria-current] { color: var(--text); }
.site-nav a[aria-current]::after {
  transform: scaleX(1);
  background: var(--accent);
  height: 2px;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}
.site-nav + .site-header__actions { margin-left: calc(var(--s-2) * -1); }

.site-header .menu-button { display: none; }
.site-header__scrim { display: none; }

/* Theme toggle: shows the icon of the theme you would switch TO. */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle[data-current="dark"] .icon-sun { display: block; }
.theme-toggle[data-current="dark"] .icon-moon { display: none; }

/* Mobile: menu button + sheet under 760px */
@media (max-width: 759px) {
  .site-header__inner { gap: var(--s-3); }
  .site-header__actions { margin-left: auto; margin-right: -8px; }
  .site-nav + .site-header__actions { margin-left: auto; }
  .site-header .menu-button { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line-strong);
    box-shadow: var(--shadow-pop);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility 0s linear var(--t);
    z-index: 1;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }
  .site-nav[data-open] {
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), visibility 0s;
  }
  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-width: calc(var(--wrap) + 2 * var(--gutter));
    margin-inline: auto;
    padding: var(--s-2) var(--gutter) var(--s-5);
  }
  .site-nav__list li + li { border-top: 1px solid var(--line); }
  .site-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    font-size: 1.375rem;
    font-weight: 750;
    font-stretch: 112%;
    letter-spacing: -0.01em;
    color: var(--text);
  }
  .site-nav a::after { display: none; }
  .site-nav a::before {
    content: "";
    order: 2;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
  }
  .site-nav a[aria-current]::before { background: var(--accent); }

  .site-header__scrim {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    background: var(--scrim);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t) var(--ease), visibility 0s linear var(--t);
  }
  .site-header[data-menu-open] .site-header__scrim {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--t) var(--ease), visibility 0s;
  }
}

/* Footer ---------------------------------------------------------------- */
.site-footer,
[data-site-footer] {
  margin-top: var(--s-8);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .875rem;
  flex-shrink: 0;
}
.site-footer__horizon {
  display: block;
  width: 100%;
  height: 56px;
  color: var(--line);
}
.site-footer__inner {
  display: grid;
  gap: var(--s-6) var(--s-7);
  grid-template-columns: 1fr;
  padding-block: var(--s-6) var(--s-7);
}
@media (min-width: 760px) {
  .site-footer__inner {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    grid-template-areas: "brand nav" "legal legal";
  }
  .site-footer__brand { grid-area: brand; }
  .site-footer__nav { grid-area: nav; justify-self: end; }
  .site-footer__legal { grid-area: legal; }
}
.site-footer__tagline {
  margin-top: var(--s-3);
  color: var(--muted);
  font-stretch: 104%;
  max-width: 34ch;
}
.site-footer__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
}
.site-footer__nav a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  padding-block: var(--s-1);
  display: inline-block;
}
.site-footer__nav a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.site-footer__legal {
  display: grid;
  gap: var(--s-2);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  font-size: .8125rem;
  line-height: 1.55;
  max-width: 100%;
}
.site-footer__legal p { max-width: 92ch; }
.site-footer__copy {
  margin-top: var(--s-2);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}


/* 7. Controls ------------------------------------------------------------ */
/* Buttons: square-cornered, heavy condensed caps, and a hard offset shadow
   that "presses in" on click. The arrow gets its own cell on the right. */
.btn {
  --btn-bg: var(--text);
  --btn-fg: var(--bg);
  --btn-border: var(--text);
  --btn-shadow: var(--accent);
  --btn-lift: 3px;
  position: relative;
  display: inline-flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  min-height: 44px;
  padding: 0;
  border: 2px solid var(--btn-border);
  border-radius: 2px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow: var(--btn-lift) var(--btn-lift) 0 var(--btn-shadow);
  font-size: .875rem;
  font-weight: 800;
  font-stretch: 82%;
  letter-spacing: .07em;
  text-transform: uppercase;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
/* Text sits in padding on the button itself unless the arrow cell is present. */
.btn { padding-inline: var(--s-5); align-items: center; }
.btn:has(> .arrow) { padding-right: 0; }
.btn:hover {
  text-decoration: none;
  transform: translate(-1px, -1px);
  box-shadow: calc(var(--btn-lift) + 1px) calc(var(--btn-lift) + 1px) 0 var(--btn-shadow);
}
.btn:active {
  transform: translate(var(--btn-lift), var(--btn-lift));
  box-shadow: 0 0 0 var(--btn-shadow);
}
.btn .arrow {
  display: inline-grid;
  place-items: center;
  align-self: stretch;
  min-width: 40px;
  margin-left: var(--s-4);
  border-left: 2px solid currentColor;
  font-size: 1.05em;
  font-weight: 700;
  letter-spacing: 0;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn:hover .arrow { background: var(--btn-shadow); color: var(--btn-fg); }
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-border: var(--text);
  --btn-shadow: color-mix(in srgb, var(--text) 22%, transparent);
}
.btn--ghost:hover { --btn-bg: color-mix(in srgb, var(--league, var(--accent)) 10%, transparent); }
.btn--sm {
  --btn-lift: 2px;
  min-height: 32px;
  padding-inline: var(--s-3);
  border-width: 1.5px;
  font-size: .75rem;
}
.btn--sm .arrow { min-width: 30px; margin-left: var(--s-3); border-left-width: 1.5px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; box-shadow: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }

/* Menu icon morphs into a cross when expanded. */
.menu-button .menu-icon line {
  transform-origin: 12px 12px;
  transition: transform var(--t) var(--ease), opacity var(--t-fast) var(--ease);
}
.menu-button[aria-expanded="true"] .menu-icon .l1 { transform: translateY(5px) rotate(45deg); }
.menu-button[aria-expanded="true"] .menu-icon .l2 { opacity: 0; }
.menu-button[aria-expanded="true"] .menu-icon .l3 { transform: translateY(-5px) rotate(-45deg); }

/* Segmented control — shared by .league-toggle and .tabs.
   JS sets --pill-x / --pill-w on .seg from the active button. */
.seg {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: calc(var(--r-sm) + 3px);
  background: var(--surface);
  max-width: 100%;
  isolation: isolate;
}
.seg__pill {
  position: absolute;
  z-index: -1;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: var(--pill-w, 0px);
  transform: translateX(var(--pill-x, 0px));
  border-radius: var(--r-sm);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong), inset 0 -2px 0 var(--league);
  opacity: 0;
}
.seg[data-ready] .seg__pill { opacity: 1; }
.seg__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 650;
  font-stretch: 104%;
  letter-spacing: .04em;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease);
}
.seg__btn:hover { color: var(--text); }
.seg__btn[aria-checked="true"],
.seg__btn[aria-selected="true"] { color: var(--text); }
.seg__btn:focus-visible { outline-offset: 1px; border-radius: var(--r-sm); }
/* Before JS positions the pill, mark the active option directly. */
.seg:not([data-ready]) .seg__btn[aria-checked="true"],
.seg:not([data-ready]) .seg__btn[aria-selected="true"] {
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

/* League toggle: uppercase league names with a league-colour dot. */
.league-toggle .seg__btn { text-transform: uppercase; letter-spacing: .1em; min-width: 76px; }
.league-toggle .seg__btn::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--league);
  opacity: .45;
  transition: opacity var(--t-fast) var(--ease);
}
.league-toggle .seg__btn[aria-checked="true"]::before { opacity: 1; }

/* Tabs: may scroll horizontally on narrow screens. */
.tabs {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs .seg__pill { box-shadow: inset 0 0 0 1px var(--line-strong); }

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-4);
}


/* 8. Data components ------------------------------------------------------ */

/* Team badge: monogram on team colour, 2px alt-colour bottom edge.
   JS sets --team, --team-alt, --team-ink inline. */
.team-badge {
  --team: var(--surface-2);
  --team-alt: var(--line-strong);
  --team-ink: var(--text);
  --h: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  height: var(--h);
  min-width: calc(var(--h) * 1.3);
  padding: 0 calc(var(--h) * .2) 2px;
  border-radius: var(--r-sm);
  background: var(--team);
  color: var(--team-ink);
  box-shadow: inset 0 -2px 0 var(--team-alt), inset 0 0 0 1px var(--badge-ring);
  font-family: var(--font-num);
  font-stretch: 78%;
  font-weight: 800;
  font-size: calc(var(--h) * .39);
  line-height: 1;
  letter-spacing: .02em;
  font-variant-numeric: lining-nums;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
  vertical-align: middle;
}
.team-badge--sm { --h: 28px; border-radius: 5px; font-size: 11.5px; min-width: 36px; padding-inline: 5px; }
.team-badge--md { --h: 36px; }
.team-badge--lg { --h: 56px; border-radius: var(--r); font-size: 21px; min-width: 72px; padding-bottom: 3px; box-shadow: inset 0 -3px 0 var(--team-alt), inset 0 0 0 1px var(--badge-ring); }
.team-badge--unknown {
  --team: var(--surface-2);
  --team-alt: var(--line-strong);
  --team-ink: var(--muted);
}

/* Team cell: badge + name, used in tables and lists. */
.team-cell {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  min-width: 0;
}
.team-cell__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* teamCell() prints the full name, and the nickname under 600px. */
.team-cell__nick { display: none; }
@media (max-width: 599px) {
  .team-cell__full { display: none; }
  .team-cell__nick { display: inline; }
}

/* Tag: small league pill with a dot. */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px 0 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-size: .6875rem;
  font-weight: 650;
  font-stretch: 100%;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
.tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--league);
}
.tag--sample {
  border-style: dashed;
  border-color: var(--line-strong);
  color: var(--muted);
}
.tag--sample::before { display: none; }

/* Rank movement: the chip itself is shaped like an arrow (a pentagon pointing
   up or down) with the number of places inside. Text is the number only. */
.move {
  --move-bg: transparent;
  --move-fg: var(--faint);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  background: var(--move-bg);
  color: var(--move-fg);
  font-family: var(--font-num);
  font-stretch: 78%;
  font-weight: 800;
  font-size: .8125rem;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1;
  white-space: nowrap;
}
.move--up {
  --move-bg: var(--up);
  --move-fg: var(--bg);
  padding-top: 7px;
  clip-path: polygon(50% 0, 100% 34%, 100% 100%, 0 100%, 0 34%);
}
.move--down {
  --move-bg: var(--down);
  --move-fg: var(--bg);
  padding-bottom: 7px;
  clip-path: polygon(0 0, 100% 0, 100% 66%, 50% 100%, 0 66%);
}
/* Big jumps (3+ places) get a notch cut in, like a double chevron. */
.move--up[data-big] { clip-path: polygon(50% 0, 100% 34%, 100% 100%, 50% 76%, 0 100%, 0 34%); padding-top: 4px; padding-bottom: 6px; }
.move--down[data-big] { clip-path: polygon(0 0, 50% 24%, 100% 0, 100% 66%, 50% 100%, 0 66%); padding-top: 6px; padding-bottom: 4px; }
.move--same::before {
  content: "";
  width: 12px;
  height: 3px;
  background: currentColor;
}
.move--new {
  height: 20px;
  border: 1.5px dashed var(--muted);
  color: var(--muted);
  letter-spacing: .08em;
  font-size: .625rem;
  font-weight: 700;
}
.move--none { visibility: hidden; }

/* Bar: 4px track with fill <i> scaled by --v (0–1), set on .bar or <i>. */
.bar {
  --v: 0;
  display: block;
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  width: calc(clamp(0, var(--v), 1) * 100%);
  border-radius: inherit;
  background: var(--league);
  transform-origin: left center;
}
.bar--accent > i { background: var(--accent); }
.bar--thin { height: 2px; }
.bar--muted > i { background: var(--line-strong); }

/* Rating: number + bar, used in ranking rows. */
.rating {
  display: grid;
  grid-template-columns: auto minmax(48px, 1fr);
  align-items: center;
  gap: var(--s-3);
}
.rating__value { font-size: 1.0625rem; }

/* Score chip ---------------------------------------------------------------- */
.score-chip {
  position: relative;
  display: grid;
  gap: 5px;
  width: 172px;
  flex: none;
  padding: 9px 12px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.score-chip__status {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 16px;
  font-size: .6875rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.score-chip__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}
.score-chip__row .team-badge--sm { --h: 22px; min-width: 30px; font-size: 10px; padding-inline: 4px; border-radius: 4px; }
.score-chip__abbr {
  font-weight: 600;
  font-stretch: 100%;
  font-size: .875rem;
  letter-spacing: .02em;
}
.score-chip__score {
  font-family: var(--font-num);
  font-stretch: 78%;
  font-weight: 700;
  font-size: 1.1875rem;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  min-width: 2ch;
  text-align: right;
}
.score-chip__record {
  font-size: .75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.score-chip[data-state="final"] .score-chip__row.is-winner,
.score-chip[data-state="live"] .score-chip__row { color: var(--text); }
.score-chip__row.is-winner .score-chip__abbr { font-weight: 750; }
.score-chip__row.is-winner .score-chip__score { font-weight: 800; }
.score-chip[data-state="pre"] .score-chip__row { color: var(--text); }
.score-chip[data-state="live"] .score-chip__status { color: var(--text); }
a.score-chip { color: inherit; text-decoration: none; transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
a.score-chip:hover { border-color: color-mix(in srgb, var(--league, var(--accent)) 60%, var(--line)); }
a.score-chip:hover .score-chip__abbr { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a.score-chip:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }

.live-dot {
  position: relative;
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
}

.chip-row {
  position: relative;
  display: flex;
  gap: var(--s-3);
  overflow-x: auto;
  padding-bottom: var(--s-1);
}

/* Ticker: auto-scrolling strip of score chips (built by ticker()). */
.ticker {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  overflow: hidden;
}
.ticker__viewport {
  position: relative;
  overflow-x: auto;
  scrollbar-width: none;
}
.ticker__viewport::-webkit-scrollbar { display: none; }
.ticker__track {
  display: flex;
  width: max-content;
}
.ticker__group {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-3) var(--s-3) 0;
}
.ticker__group:first-child { padding-left: var(--gutter); }
.ticker__clone { display: none; }
.ticker__label {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1;
  display: none;
}
.ticker .score-chip { box-shadow: none; }
/* Edge fades so chips don't hard-clip under the page edge. */
.ticker::before,
.ticker::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--gutter);
  z-index: 1;
  pointer-events: none;
}
.ticker::before { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.ticker::after { right: 0; background: linear-gradient(to left, var(--bg), transparent); }

/* Leader list --------------------------------------------------------------- */
.leader-list { min-width: 0; }
.leader-list__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line-strong);
  font-size: 1rem;
  font-stretch: 106%;
  font-weight: 700;
}
.leader-list__title .kicker { display: inline; }
.leader-list__items { list-style: none; margin: 0; padding: 0; }
.leader-list__item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  grid-template-areas:
    "rank who value"
    "rank bar bar";
  column-gap: var(--s-3);
  row-gap: 7px;
  align-items: center;
  padding: 11px 0 12px;
  border-bottom: 1px solid var(--line);
}
.leader-list__rank {
  grid-area: rank;
  align-self: start;
  padding-top: 2px;
  font-family: var(--font-num);
  font-stretch: 78%;
  font-weight: 800;
  font-size: 1.125rem;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--muted);
}
.leader-list__item:first-child .leader-list__rank { color: var(--text); }
.leader-list__who {
  grid-area: who;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-width: 0;
}
.leader-list__who .team-badge--sm { --h: 24px; min-width: 32px; font-size: 10.5px; border-radius: 4px; }
.leader-list__text { display: grid; min-width: 0; }
.leader-list__name {
  font-weight: 600;
  font-size: .9375rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leader-list__meta {
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .02em;
  line-height: 1.3;
}
.leader-list__value {
  grid-area: value;
  font-family: var(--font-num);
  font-stretch: 78%;
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  text-align: right;
}
.leader-list__item .bar { grid-area: bar; height: 3px; }

/* Data table ---------------------------------------------------------------- */
/* Tables scroll sideways only (never vertically — overflow-x alone would turn
   overflow-y into a stray inner scrollbar), and only when they are wider than
   their column. JS tables: .table-scroll--box (frame) > .table-scroll__inner
   (scroller); Markdown tables: a plain .table-scroll that scrolls itself. */
.table-scroll {
  --table-bg: var(--bg);
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text) 28%, transparent) transparent;
}
.table-scroll--box { overflow: visible; }
.table-scroll__inner {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text) 28%, transparent) transparent;
}
.table-scroll[data-overflow] > .table-scroll__inner { padding-bottom: 6px; }
.table-scroll__inner:focus-visible { outline: 2px solid var(--league, var(--accent)); outline-offset: 2px; }
.table-scroll::-webkit-scrollbar,
.table-scroll__inner::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-thumb,
.table-scroll__inner::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 28%, transparent); border-radius: 8px; }
.table-scroll::-webkit-scrollbar-track,
.table-scroll__inner::-webkit-scrollbar-track { background: color-mix(in srgb, var(--text) 6%, transparent); border-radius: 8px; }
/* "More columns this way" fade on the right edge while there is more to scroll. */
.table-scroll--box::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 14px;
  width: 28px;
  pointer-events: none;
  background: linear-gradient(to left, var(--table-bg), transparent);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease);
  z-index: calc(var(--z-sticky) + 1);
}
.table-scroll--box[data-more]::after { opacity: 1; }
.card > .table-scroll,
.card .table-scroll { --table-bg: var(--surface); }
.card > .table-scroll { border-radius: calc(var(--r) - 1px); }

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .9375rem;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}
.data-table caption {
  text-align: left;
  padding-bottom: var(--s-3);
}
.data-table th,
.data-table td {
  padding: 0 var(--s-3);
  height: 44px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  background: var(--table-bg);
}
.data-table thead th {
  height: 36px;
  border-bottom-color: var(--line-strong);
  font-size: .6875rem;
  font-weight: 650;
  font-stretch: 100%;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: bottom;
  padding-bottom: 9px;
}
.data-table th:first-child,
.data-table td:first-child { padding-left: 0; }
.data-table th:last-child,
.data-table td:last-child { padding-right: 0; }
.card .data-table th:first-child,
.card .data-table td:first-child { padding-left: var(--s-4); }
.card .data-table th:last-child,
.card .data-table td:last-child { padding-right: var(--s-4); }

.data-table .num,
.data-table th.num { text-align: right; }
.data-table td.num {
  font-family: var(--font-num);
  font-stretch: 78%;
  font-weight: 600;
  font-size: 1rem;
}
.data-table td.num.is-key { font-weight: 800; }
.data-table td.muted { color: var(--muted); }
.data-table tbody th { font-weight: inherit; }
.data-table .col-rank {
  width: 1%;
  color: var(--muted);
  font-family: var(--font-num);
  font-stretch: 78%;
  font-weight: 700;
}

.data-table tbody tr { transition: background-color var(--t-fast) var(--ease); }
.data-table tbody tr:hover > * { background: var(--surface-2); }
.data-table tbody tr:last-child > * { border-bottom: 0; }

/* Sticky first column, with an edge shadow once scrolled. */
.data-table th:first-child,
.data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: var(--z-sticky);
}
.data-table th:first-child::after,
.data-table td:first-child::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: -1px;
  right: -12px;
  width: 12px;
  pointer-events: none;
  background: linear-gradient(to right, color-mix(in srgb, var(--text) 9%, transparent), transparent);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease);
}
.table-scroll[data-scrolled] .data-table th:first-child::after,
.table-scroll[data-scrolled] .data-table td:first-child::after { opacity: 1; }

/* Sortable headers. */
.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: -8px 0;
  padding: 8px 0;
  line-height: inherit;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
  border-radius: 3px;
}
.th-sort:hover { color: var(--text); }
th.num .th-sort { flex-direction: row-reverse; }
.th-sort__ind {
  width: 7px;
  height: 9px;
  flex: none;
  background: currentColor;
  opacity: .28;
  clip-path: polygon(50% 0, 100% 38%, 0 38%, 0 62%, 100% 62%, 50% 100%);
}
th[aria-sort] { color: var(--text); }
th[aria-sort] .th-sort__ind { opacity: 1; }
th[aria-sort="ascending"] .th-sort__ind { clip-path: polygon(50% 20%, 100% 75%, 0 75%); }
th[aria-sort="descending"] .th-sort__ind { clip-path: polygon(0 25%, 100% 25%, 50% 80%); }

/* Playoff cut line: dashed league-colour rule under the row. */
.data-table tr.is-cut > * {
  border-bottom: 2px dashed var(--league);
}
.data-table tr.is-cut > :first-child { position: sticky; }

/* Dense variant for compact embeds. */
.data-table--dense th, .data-table--dense td { height: 36px; }


/* 9. Cards --------------------------------------------------------------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-card);
  padding: var(--s-5);
}
.card--flush { padding: 0; }
.card--tight { padding: var(--s-4); }
@media (max-width: 599px) {
  .card { padding: var(--s-4); }
  .card--flush { padding: 0; }
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

/* Interactive cards lift and (via attachTilt) tilt toward the pointer. */
.card--interactive,
.article-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  transition: border-color var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.card--interactive:hover,
.card--interactive:focus-within,
.article-card:hover,
.article-card:focus-within {
  border-color: var(--line-strong);
}

/* Article card --------------------------------------------------------------- */
.article-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.article-card__cover {
  position: relative;
  aspect-ratio: 2 / 1;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--league);
  overflow: hidden;
}
.article-card__cover svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.article-card__cover-label {
  position: absolute;
  left: var(--s-4);
  top: var(--s-3);
  font-family: var(--font-num);
  font-stretch: 78%;
  font-weight: 800;
  font-size: 2.25rem;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--league-ink);
}
.article-card:not([data-league]) .article-card__cover { color: var(--muted); }
.article-card__cover .vp { fill: var(--accent); }
.article-card:not([data-league]) .article-card__cover-label { color: var(--text); }
.article-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  flex: 1;
  padding: var(--s-5);
}
@media (max-width: 599px) {
  .article-card__body { padding: var(--s-4); }
}
.article-card__tags { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.article-card__title {
  font-stretch: 112%;
  font-weight: 780;
  font-size: clamp(1.25rem, 1.1rem + .5vw, 1.5rem);
  line-height: 1.08;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.article-card__title a {
  text-decoration: none;
}
.article-card__title a::after {
  /* Stretched link: the whole card is clickable, the title is the name. */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--r);
}
.article-card__title a:focus-visible { outline: none; }
.article-card__title a:focus-visible::after {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.article-card__dek {
  color: var(--muted);
  font-size: .9375rem;
  line-height: 1.5;
}
.article-card__meta {
  margin-top: auto;
  padding-top: var(--s-2);
  font-size: .8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.article-card__meta .sep { margin-inline: .45em; color: var(--faint); }


/* 10. States -------------------------------------------------------------- */
.skeleton {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 6%, transparent), transparent);
}
.skeleton--line { height: .9em; border-radius: 3px; }
.skeleton--text { height: 12px; border-radius: 3px; }
.skeleton--badge { width: 28px; height: 28px; border-radius: 5px; flex: none; }
.skeleton--circle { border-radius: 50%; }
.skeleton-group { display: block; }
.skeleton-group[aria-busy="true"] { cursor: progress; }

/* Skeleton shapes mirror the real components (see skeleton() in components.js). */
.skeleton-table__head { height: 36px; display: flex; align-items: flex-end; padding-bottom: 10px; border-bottom: 1px solid var(--line-strong); gap: var(--s-5); }
.skeleton-table__row { height: 44px; display: flex; align-items: center; gap: var(--s-3); border-bottom: 1px solid var(--line); }
.skeleton-chips { display: flex; gap: var(--s-3); overflow: hidden; }
.skeleton-chip { width: 172px; height: 84px; flex: none; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); display: grid; gap: 8px; padding: 10px 12px; align-content: start; }
.skeleton-leaders__title { height: 36px; border-bottom: 1px solid var(--line-strong); display: flex; align-items: flex-start; }
.skeleton-leaders__row { height: 66px; display: flex; align-items: center; gap: var(--s-3); border-bottom: 1px solid var(--line); }
.skeleton-rows__row { min-height: 64px; display: flex; align-items: center; gap: var(--s-3); border-bottom: 1px solid var(--line); padding-block: var(--s-3); }
.skeleton-card { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.skeleton-card__cover { aspect-ratio: 2 / 1; border-radius: 0; }
.skeleton-card__body { padding: var(--s-5); display: grid; gap: var(--s-3); }

/* Empty / error states: icon-less, typographic. */
.empty-state,
.error-state {
  display: grid;
  justify-items: start;
  gap: var(--s-3);
  padding: var(--s-6) var(--s-5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
  text-align: left;
}
.empty-state__text,
.error-state__text {
  font-size: 1.0625rem;
  font-stretch: 104%;
  line-height: 1.45;
  max-width: 52ch;
}
.empty-state .btn,
.error-state .btn { margin-top: var(--s-2); }
.error-state { border-style: solid; border-color: var(--line); border-left: 3px solid var(--down); background: var(--surface); }
.error-state__kicker { color: var(--down-ink); }

/* Small inline notice (e.g. "Showing cached data from 4:12 PM"). */
.notice {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-left: 2px solid var(--line-strong);
  color: var(--muted);
  font-size: .8125rem;
}
.notice--warn { border-left-color: var(--accent); }

/* Banner, e.g. "Sample — delete me" or "Style guide — sample values". */
.banner {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px dashed var(--accent);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: .875rem;
  font-weight: 600;
}
.banner::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  background: var(--accent);
  border-radius: 1px;
  transform: rotate(45deg);
}


/* 11. Prose (article body) -------------------------------------------------- */
.prose {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.7;
  font-optical-sizing: auto;
  max-width: var(--measure);
  color: var(--text);
}
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3, .prose h4 {
  font-family: var(--font-sans);
  margin-top: 2em;
  margin-bottom: -.35em;
}
.prose h2 { font-size: 1.625rem; }
.prose h3 { font-size: 1.25rem; }
.prose a { text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; }
.prose a:hover { color: var(--accent-text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--muted); }
.prose blockquote {
  padding-left: 1.1em;
  border-left: 2px solid var(--league);
  color: var(--muted);
  font-style: italic;
}
.prose hr { margin-block: 2.2em; }
.prose img { border-radius: var(--r-sm); }
.prose code { padding: .1em .3em; border-radius: 4px; background: var(--surface-2); }
.prose pre {
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow-x: auto;
  line-height: 1.5;
}
.prose pre code { padding: 0; background: none; }
.prose table {
  font-family: var(--font-sans);
  font-size: .9375rem;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.prose th, .prose td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { font-size: .6875rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); border-bottom-color: var(--line-strong); }


/* 12. Motion ---------------------------------------------------------------
   Every animation/transition of movement lives inside this block, so under
   prefers-reduced-motion: reduce nothing moves and everything is visible.
   The hidden "before reveal" states only apply once motion.js has set
   html.motion-ready, so content is never hidden without JS. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* 2. Scroll reveal: fade + rise 16px; stagger is applied by motion.js. */
  .motion-ready [data-reveal]:not(.is-revealed) {
    opacity: 0;
    transform: translateY(16px);
  }
  .motion-ready [data-reveal].is-revealed {
    animation: sp-rise var(--t-slow) var(--ease) backwards;
  }

  /* 4. Bars grow from 0 to --v. */
  .motion-ready .bar:not(.is-revealed) > i { transform: scaleX(0); }
  .motion-ready .bar.is-revealed > i {
    transition: transform 700ms var(--ease);
  }

  /* 7. Rank movement chips pop in after their row. */
  .motion-ready .move:not(.is-revealed):not(.move--none) {
    opacity: 0;
    transform: scale(.6);
  }
  .motion-ready .move.is-revealed {
    animation: sp-pop 420ms var(--ease-pop) backwards;
  }

  /* 6. Segmented control pill slides. */
  .seg[data-ready] .seg__pill {
    transition: transform var(--t) var(--ease), width var(--t) var(--ease), opacity var(--t-fast) linear;
  }

  /* 8. Card hover: lift 2px, tilt toward pointer (vars set by attachTilt). */
  .card--interactive:hover,
  .article-card:hover {
    transform: perspective(900px) translateY(-2px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  }

  /* 8b. Nav underline draws left → right. */
  .site-nav a::after { transition: transform var(--t) var(--ease), background-color var(--t-fast) var(--ease); }

  .section-link:hover::after,
  .btn:hover .arrow { transform: translateX(3px); }

  /* 5. Ticker: seamless loop (track = 2 identical groups, slide by -50%). */
  .ticker[data-animate] .ticker__viewport { overflow: hidden; }
  .ticker[data-animate] .ticker__clone { display: flex; }
  .ticker[data-animate] .ticker__track {
    animation: sp-ticker var(--ticker-duration, 60s) linear infinite;
  }
  .ticker[data-animate]:hover .ticker__track,
  .ticker[data-animate]:focus-within .ticker__track,
  .ticker[data-paused] .ticker__track { animation-play-state: paused; }
  .ticker[data-animate] .ticker__group:first-child { padding-left: var(--s-3); }

  /* Live dot pulse. */
  .live-dot::after { animation: sp-pulse 1.8s var(--ease) infinite; }

  /* 10. Skeleton shimmer. */
  .skeleton::after { animation: sp-shimmer 1.4s ease-in-out infinite; }

  /* 9. Page transitions: cross-fade, header persists. */
  @view-transition { navigation: auto; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: 220ms; animation-timing-function: var(--ease); }
  ::view-transition-group(site-header) { animation: none; }
  ::view-transition-old(site-header) { display: none; }
  ::view-transition-new(site-header) { animation: none; }
}

@keyframes sp-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes sp-pop {
  from { opacity: 0; transform: scale(.6); }
  to { opacity: 1; transform: none; }
}
@keyframes sp-ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes sp-pulse {
  0% { transform: scale(1); opacity: .55; }
  70%, 100% { transform: scale(2.6); opacity: 0; }
}
@keyframes sp-shimmer {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
  }
  .ticker__track { animation: none !important; transform: none !important; }
}


/* 13. Utilities --------------------------------------------------------------- */
.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.mt-7 { margin-top: var(--s-7); }


/* 14. Print -------------------------------------------------------------------- */
@media print {
  :root, [data-theme] {
    --bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --line: #ccc; --line-strong: #999;
    --text: #000; --muted: #444; --faint: #777; --accent: #000; --accent-ink: #fff;
    --nhl: #000; --nfl: #000; --up: #000; --down: #000; --league: #000;
    --shadow-card: none; --header-bg: #fff;
    color-scheme: light;
  }
  body { font-size: 11pt; }
  .site-header, [data-site-header] { position: static; backdrop-filter: none; border-bottom: 1px solid #000; }
  .site-nav, .site-header__actions, .skip-link, .site-footer__nav, .site-footer__horizon,
  .ticker, .league-toggle, .tabs, .btn, .skeleton, .skeleton-group { display: none !important; }
  [data-reveal], .move, .bar > i { opacity: 1 !important; transform: none !important; animation: none !important; }
  .card, .article-card { box-shadow: none; break-inside: avoid; }
  .table-scroll { overflow: visible; }
  .data-table th:first-child, .data-table td:first-child { position: static; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; color: #444; word-break: break-all; }
  .section { padding-block: 16pt; }
}


/* =============================================================================
   15. Logos & headshots (team logos and player photos from ESPN's image CDN).
   Logos replace the monogram; if an image fails, JS drops --logo and the
   monogram on team colour shows instead.
   ============================================================================= */
.team-badge { position: relative; }
.team-badge--xl { --h: 96px; border-radius: var(--r-lg); font-size: 34px; min-width: 112px; }
.team-badge--logo {
  background: transparent;
  box-shadow: none;
  min-width: var(--h);
  width: var(--h);
  padding: 0;
}
.team-badge--logo .team-badge__code { display: none; }
.team-badge__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* lift dark logos (black/navy marks) off the dark arena background */
  filter: drop-shadow(0 0 .5px var(--logo-edge, transparent)) drop-shadow(0 1px 1px rgb(0 0 0 / .08));
}
.team-badge--sm.team-badge--logo,
.score-chip__row .team-badge--sm.team-badge--logo,
.leader-list__who .team-badge--sm.team-badge--logo { min-width: var(--h); width: var(--h); padding: 0; }
.team-badge--lg.team-badge--logo { box-shadow: none; }
:root[data-theme="dark"] { --logo-edge: rgb(255 255 255 / .55); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --logo-edge: rgb(255 255 255 / .55); }
}

/* Player headshot: round, team-colour wash behind the cut-out photo. */
.player-photo {
  --team: var(--line-strong);
  --d: 32px;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--team) 55%, transparent), transparent 70%),
    color-mix(in srgb, var(--team) 16%, var(--surface-2));
  box-shadow: inset 0 0 0 1px var(--badge-ring);
  overflow: hidden;
  vertical-align: middle;
}
.player-photo--md { --d: 48px; }
.player-photo--lg { --d: 96px; overflow: visible; }
.player-photo__initials {
  font-family: var(--font-num);
  font-stretch: 78%;
  font-weight: 800;
  font-size: calc(var(--d) * .36);
  color: var(--muted);
}
.player-photo--img .player-photo__initials { display: none; }
.player-photo__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
  border-radius: 50%;
}
.player-photo--lg .player-photo__img { transform: scale(1.02); }
.player-photo > .team-badge {
  position: absolute;
  right: -4px;
  bottom: -2px;
  --h: 30px;
  background-color: var(--surface);
  border-radius: 50%;
  padding: 3px;
  box-shadow: 0 0 0 2px var(--surface);
}
.player-photo > .team-badge:not(.team-badge--logo) { border-radius: 6px; }

/* Leader list with photos: the small team logo sits before the meta text. */
.leader-list--photos .leader-list__meta { display: inline-flex; align-items: center; gap: 6px; }
.leader-list--photos .leader-list__meta .team-badge--sm { --h: 16px; min-width: 16px; font-size: 8px; padding: 0 3px; border-radius: 3px; }
.leader-list--photos .leader-list__meta .team-badge--logo { width: 16px; padding: 0; }

/* Featured leader (the #1 in a category). */
.leader-feature {
  --team: var(--league);
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-4);
  margin-top: var(--s-4);
  padding: var(--s-4);
  border-radius: var(--r);
  background:
    linear-gradient(110deg, color-mix(in srgb, var(--team) 22%, transparent), transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.leader-feature::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--team);
}
.leader-feature__text { display: grid; gap: 2px; min-width: 0; }
.leader-feature__rank {
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--league-ink);
}
.leader-feature__name {
  font-weight: 750;
  font-size: 1.125rem;
  font-stretch: 96%;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leader-feature__meta { font-size: .8125rem; color: var(--muted); }
.leader-feature__value {
  font-family: var(--font-num);
  font-stretch: 78%;
  font-weight: 800;
  font-size: 2.25rem;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}
@media (max-width: 380px) {
  .leader-feature { grid-template-columns: auto minmax(0, 1fr); }
  .leader-feature__value { grid-column: 2; font-size: 1.75rem; }
}


/* =============================================================================
   16. Links to team and player pages; playoff tags.
   ============================================================================= */
a.team-cell { color: inherit; text-decoration: none; }
a.team-cell:hover .team-cell__name,
a.team-cell:focus-visible .team-cell__name { text-decoration: underline; text-decoration-color: var(--league, var(--accent)); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a.leader-list__who { color: inherit; text-decoration: none; border-radius: 6px; }
a.leader-list__who:hover .leader-list__name,
a.leader-list__who:focus-visible .leader-list__name { text-decoration: underline; text-decoration-color: var(--league, var(--accent)); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a.leader-feature__name { color: inherit; text-decoration: none; }
/* The whole featured card is clickable through its name link. */
.leader-feature--link a.leader-feature__name::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.leader-feature--link:hover { border-color: color-mix(in srgb, var(--team) 60%, var(--line)); }
.leader-feature--link:hover a.leader-feature__name { text-decoration: underline; text-underline-offset: 3px; }
.link-quiet { color: inherit; text-decoration: none; }
.link-quiet:hover, .link-quiet:focus-visible { text-decoration: underline; text-decoration-color: var(--league, var(--accent)); text-decoration-thickness: 2px; text-underline-offset: 3px; }
/* Stretched link: the card/row containing .link-stretch becomes one big target. */
.has-stretch { position: relative; }
.link-stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }

.po-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 22px;
  height: 18px;
  padding: 0 5px;
  margin-left: 2px;
  border-radius: 4px;
  font-family: var(--font-num);
  font-stretch: 78%;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .02em;
  line-height: 1;
  color: var(--league-ink, var(--text));
  background: color-mix(in srgb, var(--league, var(--accent)) 22%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--league, var(--accent)) 55%, transparent);
}
.po-tag--wc { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--league, var(--accent)) 50%, transparent); }
