/* style.css — Wizards & Commoners · 2026 MLB Summer Rush
   Art direction: neumorphic broadcast console. Soft dual-shadow surfaces on a
   near-black (or near-white) field, hairline rings, and four accent glows
   (red / blue / gold / green) that carry every piece of state colour. */

/* The [hidden] attribute must always win over component display rules,
   regardless of specificity added later in this file. */
[hidden] { display: none !important; }

@font-face {
  font-family: 'SFSportsNight';
  src: url('/assets/fonts/SF-Sports-Night.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  /* Most title/name/number selectors get skin-specific font-family overrides
     from --f-cond / --f-scoreboard / --f-brand in factions.css (Array + Chakra
     Petch for Wizard, Satoshi + Space Mono for Commoner). This is the
     fallback for the handful of title-ish elements neither skin overrides
     individually (.g-count, .wc-winner, .pf-rank-v, etc.) — Chakra Petch
     reads cleanly in both skins rather than favouring one. */
  --f-title: 'Chakra Petch', 'Array', 'Satoshi', 'SFSportsNight', 'Arial Narrow', system-ui, sans-serif;
  --f-body: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Shared Galaxy decorative tokens (namespaced --wc-* so they don't collide) */
  --wc-ease: cubic-bezier(0.32, 0.72, 0, 1);
  --wc-r-outer: var(--r-tile);
  --wc-r-inner: calc(var(--r-tile) - 6px);

  --bg: #0d0f13;
  --bg-hi: #12151a;
  --surf: #161a20;
  --surf-2: #1b2028;
  --surf-in: #0d1015;
  --tx: #e9edf3;
  --mut: #9099a8;
  --fnt: #5e6673;
  --hair: #252a33;
  --hair-hi: #2f3540;

  --red: #ff3b47;
  --red-2: #ff6a72;
  --blue: #3d7dff;
  --blue-2: #79a4ff;
  --gold: #e7c56c;
  --green: #3ecf8e;

  --nm-out: 10px 10px 22px rgba(0,0,0,.62), -10px -10px 22px rgba(255,255,255,.028);
  --nm-out-sm: 5px 5px 12px rgba(0,0,0,.55), -5px -5px 12px rgba(255,255,255,.024);
  --nm-in: inset 7px 7px 16px rgba(0,0,0,.62), inset -7px -7px 16px rgba(255,255,255,.026);
  --nm-in-sm: inset 3px 3px 8px rgba(0,0,0,.58), inset -3px -3px 8px rgba(255,255,255,.022);
  --ring: 0 0 0 1px var(--hair);

  --glow-red: 0 0 0 1px color-mix(in srgb, var(--red) 42%, transparent), 0 0 26px -4px color-mix(in srgb, var(--red) 52%, transparent);
  --glow-blue: 0 0 0 1px color-mix(in srgb, var(--blue) 42%, transparent), 0 0 26px -4px color-mix(in srgb, var(--blue) 52%, transparent);
  --glow-gold: 0 0 0 1px color-mix(in srgb, var(--gold) 42%, transparent), 0 0 26px -4px color-mix(in srgb, var(--gold) 46%, transparent);
  --glow-green: 0 0 0 1px color-mix(in srgb, var(--green) 42%, transparent), 0 0 26px -4px color-mix(in srgb, var(--green) 46%, transparent);

  --r-card: 22px;
  --r-tile: 14px;
  --r-pill: 999px;

  /* Club-mark surface. The vendored marks are "cap on dark" artwork — ten of the
     thirty are drawn in pure #fff and nothing else — so this has to stay a dark
     surface. It used to be #fff, which rendered those ten clubs as blank
     circles. Each skin overrides all three; these are the neutral fallbacks.
     --logo-ink is the abbreviation shown when a mark fails to load, so it has to
     read on the plate rather than on the card.
     Verified by scripts/verify-logo-contrast.js. */
  --logo-surf: #14171c;
  --logo-ring: #6c7482;
  --logo-ink: #e8ebf2;

  /* Ticker geometry. Every scroll container that could run under the fixed
     ticker reserves --tick-clear so nothing ever renders beneath it. The extra
     term is breathing room between the footer and the top of the ticker pill. */
  --tick-h: 52px;
  --tick-gap: 16px;
  /* Wafer was removed — kept as a zeroed token so any legacy references still
     resolve harmlessly. Clearance is now just the ticker plus breathing room. */
  --wafer-h: 0px;
  /* Home-indicator / browser-chrome inset. Zero on desktop. On an iPhone the
     ticker is fixed 16px from the bottom of the *layout* viewport, which sits
     under the home indicator and under Safari's bottom bar — the pill and the
     last row of content both ended up partly covered. Folding the inset into
     both the offset and the clearance fixes it without touching desktop.
     Requires viewport-fit=cover on the viewport meta for env() to be non-zero. */
  --tick-safe: env(safe-area-inset-bottom, 0px);
  --tick-clear: calc(var(--tick-h) + var(--tick-gap) * 2 + 24px + var(--tick-safe));

  /* Focus ring. Remapped per skin in factions.css; the fallback keeps a visible
     ring on the bare root before any skin attribute is applied. */
  --focus-ring: var(--blue);
  --focus-offset: 2px;
}

/* Wafer was removed, so no phone-specific wafer height bump is needed. */

body {
  background-image:
    radial-gradient(1100px 620px at 12% -8%, var(--bg-hi), transparent 62%),
    radial-gradient(900px 560px at 92% 4%, color-mix(in srgb, var(--blue) 7%, transparent), transparent 60%);
  background-attachment: fixed;
  /* Column layout keeps the footer at the bottom on short screens instead of
     floating mid-page above the fixed ticker. */
  display: flex;
  flex-direction: column;
  /* Clears the fixed bottom ticker on every screen. */
  padding-bottom: var(--tick-clear);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.wrap { width: min(1240px, 100% - 2.5rem); margin-inline: auto; }

.ttl { font-family: var(--f-title); font-weight: 400; letter-spacing: .01em; }

/* Tabular figures everywhere: digits that change in place (scores, run totals,
   countdowns, clocks) must not reflow their neighbours when a narrow 1 rolls
   over to a wide 0. Applied universally so any numeric string gets it without
   needing the .num hook, matching the even column widths in the audit photo. */
body { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
/* The scoreboard display faces (VT323 / SF Sports Night / Super Retro) have no
   tabular variants; requesting tnum there just normalizes to their monospace
   advance, which is already the intended look. This guard documents that the
   universal rule above deliberately does not restyle display type. */
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

.eye {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--fnt);
  line-height: 1.2;
}
.eye.red { color: var(--red); }
.eye.blue { color: var(--blue); }
.eye.gold { color: var(--gold); }
.eye.green { color: var(--green); }
.eye.right { text-align: right; }

.nm { background: var(--surf); box-shadow: var(--nm-out), var(--ring); border-radius: var(--r-card); }
.nm-sm { background: var(--surf); box-shadow: var(--nm-out-sm), var(--ring); border-radius: var(--r-tile); }
.nm-in { background: var(--surf-in); box-shadow: var(--nm-in), var(--ring); border-radius: var(--r-card); }
.nm-in-sm { background: var(--surf-in); box-shadow: var(--nm-in-sm), var(--ring); border-radius: var(--r-tile); }

.glow-red { box-shadow: var(--nm-out), var(--glow-red); }
.glow-blue { box-shadow: var(--nm-out), var(--glow-blue); }
.glow-gold { box-shadow: var(--nm-out), var(--glow-gold); }
.glow-green { box-shadow: var(--nm-out), var(--glow-green); }
.glow-red-sm { box-shadow: var(--nm-out-sm), var(--glow-red); }
.glow-blue-sm { box-shadow: var(--nm-out-sm), var(--glow-blue); }
.glow-gold-sm { box-shadow: var(--nm-out-sm), var(--glow-gold); }
.glow-green-sm { box-shadow: var(--nm-out-sm), var(--glow-green); }

.grid-2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 1.1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.stretch > * { min-width: 0; }

.hide-mobile { display: inline-flex; }

/* Nothing here loops. `rise` runs once on panel entry and is the only keyframe
   animation in this file that is not driven by a discrete state change; the
   ambient `pulse`, `gradient-shift` and `blur-animation` loops that used to sit
   here are removed. They were autonomous, indefinite, and two of the three sat
   in the 0.15–0.35 Hz band that reads as a slow throb — motion with no state
   behind it, competing with the motion that does mean something. */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.rise > * { animation: rise .42s cubic-bezier(.22,.9,.3,1) backwards; }
.rise > *:nth-child(1) { animation-delay: .02s; }
.rise > *:nth-child(2) { animation-delay: .08s; }
.rise > *:nth-child(3) { animation-delay: .14s; }
.rise > *:nth-child(4) { animation-delay: .2s; }

/* ============================================================
   CONTROLS
   ============================================================ */
.pill {
  display: inline-flex; align-items: center; gap: .3rem;
  min-height: 22px; padding: .08rem .3rem;
  border-radius: var(--r-pill);
  background: transparent;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--gold) 25%, transparent),
    0 0 10px -2px color-mix(in srgb, var(--gold) 55%, transparent);
  color: var(--mut);
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  transition: color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.pill:hover { color: var(--tx); transform: translateY(-1px); }
.pill:active { box-shadow: var(--nm-in-sm), var(--ring); transform: none; }
.pill[aria-pressed='true'] { color: var(--skin-accent); box-shadow: var(--nm-in-sm), var(--skin-glow); }
.pill-icon { padding: .35rem; width: 32px; justify-content: center; }

.tabs-wrap, .filter-bar {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .3rem; border-radius: var(--r-pill);
}
.filter-bar { flex-wrap: wrap; }

.tab-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .12rem .35rem; border-radius: var(--r-pill);
  background: transparent;
  color: var(--fnt);
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  white-space: nowrap;
  transition: color .18s ease, box-shadow .18s ease, background .18s ease;
}
.tab-btn:hover {
  color: var(--tx);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--tx) 20%, transparent),
    0 0 10px -3px color-mix(in srgb, var(--tx) 35%, transparent);
}
.tab-btn.on {
  color: var(--tx);
  background: transparent;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--gold) 65%, transparent),
    0 0 14px -2px color-mix(in srgb, var(--gold) 70%, transparent);
}

.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 .32rem;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--red) 20%, transparent);
  color: var(--red);
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
}
.count-badge.zero { background: color-mix(in srgb, var(--fnt) 18%, transparent); color: var(--fnt); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  padding: 1.1rem 0 .85rem;
  display: flex; flex-direction: column; gap: .95rem;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hair);
}

/* Brand sits on its own centred, stacked masthead: mark on top, wordmark
   below. Keeps the top of the app quiet and vertical, then the tabs row and
   control bar cascade underneath. */
.head-brandbar {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .55rem; text-align: center;
}
.brand-mark {
  display: grid; place-items: center;
  width: 68px; height: 68px; flex: none; padding: 9px;
  border-radius: 18px;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 0; }
.brand-title { font-size: 38px; line-height: .95; color: var(--tx); }
/* Two explicit lines rather than one string relying on a wrap: the Wizard skin
   colours each line differently below, and that split must never depend on
   where the text happens to break at a given viewport width. */
.brand-title .bt-l1,
.brand-title .bt-l2 { display: block; }
.brand-eyebrow { font-size: 12px; letter-spacing: .3em; color: var(--mut); }

.head-row { display: flex; align-items: center; gap: 1rem; justify-content: space-between; }
.head-actions { display: flex; align-items: center; gap: .5rem; }

/* ============================================================
   RUSH COUNTDOWN
   Thin strip directly under the masthead. Unlike the header it does not
   stick — it scrolls away with the rest of the page.
   ============================================================ */
.rush-countdown {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .5rem 1rem;
  background: var(--surf-in);
  border-bottom: 1px solid var(--hair);
}
.rc-label {
  font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: var(--fnt);
}
.rc-time {
  font-family: 'SFSportsNight', var(--f-title); font-size: 16px; letter-spacing: .03em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.rush-countdown.rc-ended .rc-time { color: var(--mut); }

@media (max-width: 540px) {
  .rush-countdown { padding: .4rem .8rem; gap: .45rem; }
  .rc-label { font-size: 10px; letter-spacing: .14em; }
  .rc-time { font-size: 13px; }
}

/* ============================================================
   MAIN / CARDS
   ============================================================ */
main { flex: 1 0 auto; padding: 1.4rem 0 2rem; }
.screen { display: flex; flex-direction: column; gap: 1.1rem; }
.screen-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.screen-head .ttl { font-size: 26px; color: var(--tx); }

.card { padding: 1.15rem 1.25rem; display: flex; flex-direction: column; gap: .85rem; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.card-title { font-size: 17px; color: var(--tx); }
.card-note { font-size: 13px; color: var(--fnt); line-height: 1.5; margin-top: auto; padding-top: .35rem; }

.rowset { display: flex; flex-direction: column; gap: .5rem; }
.empty { padding: 1.1rem; text-align: center; color: var(--fnt); font-size: 12px; }

#banners:empty { display: none; }

.banner {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem 1rem; margin-bottom: 1rem;
  border-radius: var(--r-tile);
  background: var(--surf); box-shadow: var(--nm-out-sm), var(--ring);
  font-size: 12px; color: var(--mut);
}
.banner.warn { box-shadow: var(--nm-out-sm), var(--glow-gold); color: var(--gold); }
.banner.err { box-shadow: var(--nm-out-sm), var(--glow-red); color: var(--red); }

/* ------------------------------------------------------------
   Feature card — dark gradient body with a four-colour radial glow ring.
   Adapted from a Uiverse.io component by Cksunandh (.m2, MIT). The original
   ring is orange/blue/pink/purple; here the four radial stops are remapped to
   the palette accents (gold, blue, red, green) and the interior gradient uses
   --surf-2 → --surf-in so the card stays darker than the page field and the
   glow reads as a ring around the edge.
   ------------------------------------------------------------ */
/* No stacking context here on purpose: the negative-z pseudo-elements must
   paint behind this element's own background so the glow reads as a ring. */
.feature-card {
  position: relative;
  isolation: auto;
  border-radius: var(--r-card);
  padding: 1.4rem 1.5rem;
  display: flex; flex-direction: column; gap: .9rem;
  background: linear-gradient(135deg, var(--surf-2) 10%, var(--surf-in) 60%);
}
/* Home's sole hero (design-board P1: "~2.2x the vertical weight of any other
   block"). It no longer shares a row with another card, so it can take the
   extra breathing room its content (header, VS line, why-text, critical-games
   list) actually wants instead of being squeezed into a 1.25fr column. */
.hero-frame .feature-card { padding: 1.8rem 1.9rem 1.9rem; gap: 1.1rem; }
.feature-card::before,
.feature-card::after {
  --size: 2px;
  content: ''; position: absolute;
  top: calc(var(--size) / -2); left: calc(var(--size) / -2);
  width: calc(100% + var(--size)); height: calc(100% + var(--size));
  border-radius: calc(var(--r-card) + 2px);
  background:
    radial-gradient(circle at 0 0, var(--gold), transparent),
    radial-gradient(circle at 100% 0, var(--blue), transparent),
    radial-gradient(circle at 0 100%, var(--red), transparent),
    radial-gradient(circle at 100% 100%, var(--green), transparent);
}
.feature-card::after { z-index: -1; }
/* The soft outer halo is static. It reads as a bounded decorative channel around
   the card rather than a breathing light, and it is masked away from the card
   interior so it never sits under a numeral. */
.feature-card::before {
  --size: 10px;
  z-index: -2;
  filter: blur(18px);
  opacity: .85;
}


/* Header sits as a solid magenta slab-pill, anchored to the left edge of the
   card and shifted slightly upward so it visually notches into the card border.
   Hard offset shadow matches the sports-brand kineticism cue from the audit. */
.motd-head { display: flex; align-items: center; justify-content: flex-start; gap: .75rem; margin: -22px 0 14px; }
.motd-title {
  display: inline-block;
  font-family: var(--f-cond, var(--f-title));
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #0b0b0f;
  background: var(--motd-slab-bg, var(--wc-magenta, #ff2d9a));
  padding: 10px 20px 9px;
  border-radius: 999px;
  box-shadow:
    4px 4px 0 var(--motd-slab-shadow, #04050c),
    0 0 0 2px var(--motd-slab-edge, #04050c);
  white-space: nowrap;
}
.motd-head .eye {
  align-self: center;
}
/* Each side is one stacked column — name, seed, then the total beneath it —
   with the two columns facing each other across a centre seam. The seam is the
   tension line: the thing that says these two are being weighed against each
   other. Sides are never stacked vertically, at any width; the left-versus-right
   reading is the whole point of the card. */
.motd-line { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: .6rem; }
.motd-side { display: grid; gap: .15rem; min-width: 0; justify-items: start; text-align: left; }
.motd-side.right { justify-items: end; text-align: right; }
.motd-mgr { font-family: var(--f-title); font-size: 26px; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; line-height: 1.05; }
.motd-team { font-size: 12.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* The centre seam. Base is a quiet vertical hairline — Commoner keeps it that
   way; Wizard overrides it into the cyan/magenta diagonal slash. The VS chip
   rides on top of whichever the skin drew. */
.motd-slash { position: relative; align-self: stretch; display: grid; place-items: center; width: 38px; flex: none; }
.motd-slash::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, var(--hair-hi) 20%, var(--hair-hi) 80%, transparent);
}
.motd-slash span {
  position: relative; z-index: 1;
  font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--mut); background: var(--surf); padding: 3px 5px;
}
/* Scoreboard face applied at the base layer so both skins get the LED bitmap
   numerals. VT323 renders smaller per-em than a proportional face, so the
   sizes are bumped ~15% to hit the same optical weight. Both skins use it
   so the numeric identity of the app is skin-agnostic. */
/* Tabular figures so a total does not reflow as its digits change. The seam
   itself stays centred independently of digit count: the two sides are equal
   1fr tracks, so the centre column holds its position whether a score is one
   digit or three. */
.motd-runs {
  font-family: var(--f-scoreboard, var(--f-title)); font-size: 54px; line-height: .9;
  color: var(--tx); font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1;
  letter-spacing: .02em; margin-top: .2rem;
}
.motd-runs-label { font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--fnt); }
.motd-why { font-size: 13px; line-height: 1.55; color: var(--mut); }
.motd-meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.motd-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .6rem; border-radius: var(--r-pill);
  background: var(--surf-in); border: 1px solid var(--hair);
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mut);
}
.motd-chip.live { color: var(--red-2); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.motd-chip .team-logo { --logo-size: 22px; }

/* Matchup of the Day - critical games */
.motd-critical { display: flex; flex-direction: column; gap: .5rem; padding-top: .5rem; border-top: 1px solid var(--hair); }
.motd-critical-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.motd-critical-title { font-size: 12.5px; font-weight: 800; letter-spacing: .04em; color: var(--tx); }
.cg-list { display: flex; flex-direction: column; gap: .45rem; }
.cg-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem;
  padding: .5rem .65rem; border-radius: var(--r-tile);
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
}
.cg-row.live { box-shadow: var(--nm-in-sm), var(--glow-red); }
.cg-side { display: flex; align-items: center; gap: .35rem; min-width: 0; font-size: 13px; color: var(--mut); }
.cg-side.home { justify-content: flex-end; text-align: right; }
.cg-side .team-logo { --logo-size: 20px; }
.cg-abbr { font-weight: 700; letter-spacing: .04em; color: var(--tx); white-space: nowrap; }
.cg-score { font-family: var(--f-scoreboard, var(--f-title)); font-size: 22px; color: var(--tx); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.cg-mid { display: flex; flex-direction: column; align-items: center; gap: .25rem; flex: none; min-width: 0; }
.cg-tag {
  font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--fnt);
  white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis;
}
.cg-tag.featured { color: var(--gold); }
.cg-tag.both { color: var(--blue-2); }

/* Home lists */
.mover-row, .lead-row, .dt-row {
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; row-gap: .4rem;
  padding: .6rem .75rem;
  border-radius: var(--r-tile);
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
}
.mover-name, .lead-name, .dt-name {
  font-family: var(--f-title); font-size: 15px; color: var(--tx);
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mover-rank, .lead-rank {
  display: grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 9px;
  background: var(--surf); box-shadow: var(--nm-out-sm);
  font-size: 13px; font-weight: 800; color: var(--mut);
}
/* Compact arrow + digit, same convention as the Standings board's .st-delta.
   The spelled-out "+2 ranks · since Jul 28" sentence lives in the title
   tooltip instead of inline — spelling it out in the row itself was crowding
   out the manager name on narrow screens. */
.mover-delta {
  font-family: var(--f-title); font-size: 14px; font-weight: 800; flex: none; text-align: right;
}
.mover-delta.up { color: var(--green); }
.mover-delta.down { color: var(--red); }
.mover-delta.flat { color: var(--fnt); }
.mover-since { color: var(--fnt); font-size: 12px; font-weight: 700; }
.lead-runs, .dt-runs { font-family: var(--f-scoreboard, var(--f-title)); font-size: 22px; color: var(--tx); flex: none; font-variant-numeric: tabular-nums; letter-spacing: .02em; }

.week-list { display: flex; flex-direction: column; gap: .55rem; }
.week-row { display: grid; grid-template-columns: 150px 1fr 56px; align-items: center; gap: .8rem; }
.week-mgr { font-family: var(--f-title); font-size: 15px; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-track { height: 12px; border-radius: var(--r-pill); background: var(--surf-in); box-shadow: var(--nm-in-sm); overflow: hidden; }
.week-bar { height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--blue), var(--blue-2)); transition: width .5s cubic-bezier(.22,.9,.3,1); }
.week-row:first-child .week-bar { background: linear-gradient(90deg, var(--gold), var(--red-2)); }
.week-val { font-family: var(--f-title); font-size: 16px; color: var(--tx); text-align: right; }

/* ============================================================
   LIVE GAMES
   ============================================================ */
.games-list { display: flex; flex-direction: column; gap: .8rem; }

.g-card {
  padding: .65rem .85rem; display: flex; flex-direction: column; gap: .55rem;
  justify-content: center;
}
/* Club blocks anchor to the outer edges and the two scores flank the centre
   column, so scores line up vertically down the slate no matter how long the
   club names are — and the row spends its width instead of pooling it in the
   gutters. The bottom padding is the chevron's lane. */
.g-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(132px, 210px) auto minmax(0, 1fr);
  align-items: center; gap: .5rem 1.1rem;
  min-height: 58px; padding-bottom: 1.35rem;
  border-radius: var(--r-tile);
}
.g-row[role='button'] { cursor: pointer; }
.g-row[role='button']:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* Each side is [crest | text] with the crest on the outside. The crest never
   shrinks and the text column shrinks ahead of it, so a long owner list narrows
   and clamps instead of spilling sideways under the crest. */
.g-side { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.g-side.away { flex-direction: row; justify-content: flex-start; }
.g-side.home { flex-direction: row-reverse; justify-content: flex-start; }
/* Club logos sit on a plate of their own because the marks are transparent PNG-
   style artwork with no backdrop of their own, and the plate is what gives the
   transparent edge somewhere consistent to land. The surface is --logo-surf,
   which each skin sets: the marks are cap artwork drawn for dark backgrounds and
   a third of them are pure white, so the plate has to stay dark. The club colour
   is spent on the crest's ring rather than on a second shape behind the mark;
   mixing a little text colour in keeps a very dark club (SD, NYY) from
   disappearing into a dark card. */
.g-crest {
  --crest-size: 42px;
  display: grid; place-items: center; flex: none; overflow: hidden;
  width: var(--crest-size); height: var(--crest-size); border-radius: 50%;
  background: var(--logo-surf);
  /* Two rings, and the order matters. The inner band is the club colour at full
     strength — it used to be mixed 80/20 toward --tx to keep a navy club from
     vanishing into a dark card, which both muddied the official colour and still
     left MIN at 2.1:1. The outer hairline is --logo-ring, so the crest's
     boundary is carried by a token that is verified against the card for every
     skin instead of by thirty club colours that cannot all clear it. The club
     band is then free to be exactly the club's colour. */
  box-shadow:
    0 0 0 2px var(--club, var(--hair-hi)),
    0 0 0 3px var(--logo-ring),
    var(--nm-out-sm);
  font-size: 13px; font-weight: 800; letter-spacing: .02em;
  color: var(--logo-ink);
}
.g-crest > * { grid-area: 1 / 1; }
/* The mark gets a square box centred in the plate, sized as a share of the crest
   rather than as a percentage of it: a percentage height inside this grid cell
   resolves against an indefinite track, so a tall mark used to keep its intrinsic
   aspect and grow straight out through the circle. */
.g-crest .team-logo { --logo-size: calc(var(--crest-size) * .74); }
/* The abbreviation is a fallback only: it shares the crest's grid cell, so it
   must stay out of sight while the mark is there to cover it. */
.crest-abbr { visibility: hidden; }
.g-crest:not(:has(.team-logo)) .crest-abbr { visibility: visible; }
/* Every mark sits in a square box and is centred inside it, so the club's own
   proportions never move it off centre. --logo-size is the nominal box for the
   context; --logo-opt is the per-club optical correction app.js works out from
   the mark's viewBox aspect (1 for a square mark, up to 1.18 for the tallest). */
.team-logo {
  --logo-size: 20px; --logo-opt: 1;
  width: calc(var(--logo-size) * var(--logo-opt));
  height: calc(var(--logo-size) * var(--logo-opt));
  object-fit: contain; object-position: center center;
  flex: none; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
}
/* The plate the mark sits on everywhere outside a game crest. The padding is not
   spacing — the marks are transparent right up to their bounding box, so without
   it a wide mark touches the circle's edge and reads as clipped. The ring is a
   token rather than a black hairline because the plate and the card behind it
   differ by about 1.07:1: on a dark skin the boundary has to be drawn, it cannot
   be inferred from the fill. */
.team-logo.plate {
  background: var(--logo-surf); border-radius: 50%; padding: 2px;
  box-shadow: 0 0 0 1px var(--logo-ring);
  box-sizing: content-box;
}
.g-meta {
  flex: 0 1 auto; min-width: 0;
  display: flex; flex-direction: column; align-items: stretch; gap: .15rem;
}
.g-side.away .g-meta { text-align: left; }
.g-side.home .g-meta { text-align: right; }
.g-name { font-size: 13px; font-weight: 600; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Narrow screens swap the full club name for its abbreviation rather than
   dropping the text entirely — the row still has to say who is playing. */
.g-abbr { display: none; font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--tx); }
/* A manager count rather than a name list, so it's always short and single-line
   regardless of how many managers hold the club — the full names live in the
   expanded box score (.gc) instead. */
.g-owner {
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.g-owner.none { color: var(--fnt); }
.g-side.lose .g-name, .g-side.lose .g-owner { opacity: .5; }
.g-side.lose .g-crest { opacity: .55; }
.g-side.win .g-name { font-weight: 800; color: var(--tx); }
/* Both score cells reserve the same width and press toward the centre column, so
   a 1-run game and a 12-run game keep the same silhouette. */
.g-score-wrap { display: flex; align-items: center; min-width: 44px; }
.g-score-wrap.away { justify-content: flex-end; }
.g-score-wrap.home { justify-content: flex-start; }
.g-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-width: 0; width: 100%; }
.g-status-line { display: flex; align-items: center; justify-content: center; gap: .35rem; flex-wrap: wrap; }
.g-score { font-family: var(--f-title); font-size: 28px; color: var(--tx); letter-spacing: .02em; }
.g-score.lose { color: var(--fnt); }
.g-score.win { color: var(--tx); text-shadow: 0 0 12px color-mix(in srgb, var(--gold) 45%, transparent); }
/* SFSportsNight has no hyphen glyph (it does carry full A–Z/a–z otherwise) —
   any dash has to fall back to the body font or it renders as a missing-glyph
   box. */
.g-score-blank, .g-count .dash, .sp-score .dash { font-family: var(--f-body); color: var(--fnt); }
.g-score-blank { font-size: .78em; font-weight: 700; }
.g-count .dash { margin: 0 .1em; }
.g-time { font-size: 12px; color: var(--fnt); font-weight: 600; }

.status-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .55rem; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  background: var(--surf-in); box-shadow: var(--nm-in-sm); color: var(--fnt);
}
/* Status is carried by one hue plus a glyph plus text — never by colour alone —
   and the marks are static. The old live dot blinked at 0.71 Hz on every live
   row at once, which is a page full of competing attention grabs and lands in
   the band that reads as a strobe on a big slate. A filled square that does not
   move says "live" just as clearly, and the inning text says it in words. */
.status-pill::before {
  content: ''; flex: none;
  width: 6px; height: 6px;
  background: currentColor;
}
.status-pill.live { color: var(--red); box-shadow: var(--nm-in-sm), var(--glow-red); }
.status-pill.live::before { border-radius: 1px; }
.status-pill.final { color: var(--mut); }
/* Ring, not a fill: final games read as closed out at a glance without the eye
   having to resolve which grey it is. */
.status-pill.final::before {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
  border-radius: 50%;
}
.status-pill.sched { color: var(--blue); }
/* Open-topped chevron for "not started yet". */
.status-pill.sched::before {
  background: transparent;
  width: 5px; height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}

.g-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding-top: .55rem; border-top: 1px solid var(--hair); }
.g-situation { display: flex; align-items: center; justify-content: center; gap: .45rem; flex-wrap: wrap; max-width: 100%; }
.g-diamond {
  display: flex; align-items: center; gap: .55rem;
  padding: .3rem .6rem .3rem .45rem; border-radius: var(--r-pill);
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
}
.g-diamond svg { display: block; flex: none; }

/* ---- Bases: occupancy is shape + fill + stroke weight, not hue ----
   An occupied bag used to differ from an empty one only by being gold. That is
   colour as the sole carrier of information, and on a 30px diamond the gold and
   the hairline grey are close enough in value that it also failed as a plain
   value cue. Now an occupied bag is filled AND carries a heavier stroke AND is
   drawn slightly larger, so it survives greyscale, and the accessible name spells
   the occupancy out in words regardless. */
.g-diamond .base {
  fill: var(--surf-in);
  stroke: var(--hair-hi);
  stroke-width: 1.4;
}
.g-diamond .base.on {
  fill: var(--gold);
  stroke: var(--tx);
  stroke-width: 2;
}
.g-diamond .plate-mark { fill: var(--hair-hi); stroke: none; }

/* ---- Count: pip rows with a mandatory letter key ----
   B / S / O are always rendered. The pips are the fast read; the letter is what
   makes the row unambiguous without colour, and the row's accessible name spells
   out the full count. */
.g-count-grid {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 2px 5px;
  padding: .28rem .55rem;
  border-radius: var(--r-tile);
  background: var(--surf-in);
  box-shadow: var(--nm-in-sm);
}
.g-cnt-key {
  font: 800 8.5px/1 var(--f-body);
  letter-spacing: .1em;
  color: var(--mut);
  text-align: right;
}
.g-cnt-pips { display: inline-flex; align-items: center; gap: 3px; }
.g-pip {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--hair-hi);
}
/* Filled pips carry weight and a ring in addition to hue. */
.g-pip.on { background: currentColor; box-shadow: inset 0 0 0 1.5px currentColor; }
.g-cnt-row.balls  { color: var(--blue-2); }
.g-cnt-row.strikes { color: var(--gold); }
.g-cnt-row.outs   { color: var(--red-2); }
/* Outs pips are square so the three rows are distinguishable by shape alone. */
.g-cnt-row.outs .g-pip { border-radius: 1px; }

.g-outs { display: inline-flex; align-items: center; gap: .3rem; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--fnt); white-space: nowrap; }
.g-outs .out-dot { width: 6px; height: 6px; border-radius: 1px; box-shadow: inset 0 0 0 1.5px var(--hair-hi); }
.g-outs .out-dot.on { background: var(--red); box-shadow: inset 0 0 0 1.5px var(--tx); }
.g-count { font-family: var(--f-title); font-size: 14px; letter-spacing: .06em; color: var(--tx); }
.g-count .lbl { font-family: var(--f-body); font-size: 12px; font-weight: 800; letter-spacing: .18em; color: var(--fnt); margin-right: .3rem; }

/* Nerd-only detail line. Neutral colour: it is disclosure, not status. */
.g-linedetail {
  font-size: 12px; font-weight: 700; letter-spacing: .1em;
  color: var(--fnt);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.inn-arrow { font-size: 12px; line-height: 1; }
.inn-half { font-size: 12px; letter-spacing: .1em; }

/* ---- expandable box score ----
   Pinned to the row's bottom edge rather than stacked in the centre column: as a
   flow item it added a fourth line to live rows and left short rows lopsided. */
.g-chev {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  font-size: 13px; line-height: 1; color: var(--fnt);
  transition: transform .18s ease, color .18s ease;
}
.g-card.open .g-chev { transform: translateX(-50%) rotate(180deg); color: var(--blue); }
.g-detail {
  display: flex; flex-direction: column; gap: .65rem;
  padding-top: .65rem; border-top: 1px solid var(--hair);
}
.ls-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Natural width, not 100%: stretched across a 1200px card the nine inning cells
   drift a finger-width apart and stop reading as a line score. Overflow on narrow
   screens is what .ls-scroll is for. */
.ls-table { border-collapse: collapse; width: auto; font-variant-numeric: tabular-nums; }
.ls-table th, .ls-table td {
  padding: .3rem .45rem; text-align: center; min-width: 26px;
  font-size: 12px; color: var(--mut); font-weight: 600;
}
.ls-table thead th {
  font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--fnt);
  border-bottom: 1px solid var(--hair);
}
.ls-table tbody td { color: var(--tx); }
.ls-table tbody tr.win td { font-weight: 800; }
.ls-table .ls-team { text-align: left; white-space: nowrap; padding-right: .7rem; min-width: 68px; }
.ls-team-in {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: 13px; font-weight: 800; letter-spacing: .08em; color: var(--tx);
}
.ls-team-in .team-logo { --logo-size: 18px; }
/* Deliberately body-font: SFSportsNight is a chunky display face that turns
   single digits into near-solid blocks at box-score sizes. */
.ls-table .ls-tot { color: var(--tx); font-weight: 800; border-left: 1px solid var(--hair); }
.ls-table tbody .ls-tot.runs { font-size: 14px; color: var(--blue-2); }
.ls-table thead .ls-tot.runs { color: var(--blue-2); }
.ls-table .now { color: var(--red); }
.ls-table thead th.now { color: var(--red); }

.g-players { display: flex; flex-wrap: wrap; gap: .45rem .55rem; }
.gp {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .25rem .6rem; border-radius: var(--r-pill);
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
  font-size: 13px; font-weight: 600; color: var(--tx);
}
.gp-lbl { font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--fnt); }
.g-claims {
  display: flex; flex-wrap: wrap; gap: .3rem 1.2rem;
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
}
.gc { display: inline-flex; gap: .5rem; min-width: 0; }
.gc-abbr { color: var(--fnt); }
.g-claims .none { color: var(--fnt); }
.g-detail-foot { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--fnt); }

/* ---- draft-order impact ----
   Manager-facing state is gold everywhere in this app, and these chips are the
   most manager-facing thing on the slate, so they anchor to gold. A "flip" (the
   runs needed are plausibly still in the game) earns the ring glow; a "watch" is
   the same information at half the volume. */
.g-impact {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  padding-top: .5rem; border-top: 1px solid var(--hair);
}
.g-impact-lbl {
  font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: var(--fnt); flex: none;
}
.impact-chip {
  display: inline-flex; align-items: baseline; gap: .4rem; min-width: 0;
  padding: .22rem .6rem; border-radius: var(--r-pill);
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
  font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--mut); cursor: help;
}
.impact-chip .ic-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.impact-chip .ic-need { flex: none; font-variant-numeric: tabular-nums; color: var(--fnt); }
.impact-chip.flip { color: var(--gold); box-shadow: var(--nm-in-sm), var(--glow-gold); }
.impact-chip.flip .ic-need { color: var(--gold); }
.impact-chip.watch { color: var(--blue-2); }
.impact-chip.watch .ic-need { color: var(--blue); }
.impact-chip.more { color: var(--fnt); }
/* A row that can move the draft order gets a gold ring even before the chips
   are read — scanning the slate for gold is the whole point. Full inset
   perimeter (0 0 0 Npx), not a directional offset, so the highlight reads as
   a frame around the whole card rather than an accent on one edge. */
.g-card.has-impact { box-shadow: var(--nm-out-sm), inset 0 0 0 2px color-mix(in srgb, var(--gold) 60%, transparent); }

/* ---- close-game alert ---- */
.close-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .18rem .5rem; border-radius: var(--r-pill);
  background: var(--surf-in); box-shadow: var(--nm-in-sm), var(--glow-red);
  font-size: 12px; font-weight: 800; letter-spacing: .16em; color: var(--red);
}
.close-badge svg { fill: var(--red); display: block; flex: none; }
.g-card.close-game { box-shadow: var(--nm-out-sm), var(--glow-red); }
/* Both at once: red glow for the ballgame, gold ring for the draft order. */
.g-card.close-game.has-impact {
  box-shadow: var(--nm-out-sm), var(--glow-red), inset 0 0 0 2px color-mix(in srgb, var(--gold) 70%, transparent);
}

/* ============================================================
   SCORE-CHANGE TAKEOVER

   Replaces the old `score-flash`, which ramped a green glow up and back down
   over 1.8s on the whole card. Two problems with that: a full-card luminance
   swing is a flash, and once it finished there was nothing left to show that
   anything had happened — a user who looked away for two seconds had no way to
   find the run.

   The takeover is bounded and reversible instead. One row at a time, on a fixed
   timeline that always returns to rest, and it leaves a static marker behind:

     180ms  digit roll on the score that changed
     320ms  the row expands, neighbours drop to 60%
     520ms  settle on cubic-bezier(0.05, 0.7, 0.1, 1)
     5.2s   hold — Escape or a tap cancels it early
     320ms  restore

   The whole thing is one keyframe timeline rather than a chain of timers, so it
   cannot get wedged half-open if a poll lands mid-animation. Total 6360ms.
   Percentages below are the phase boundaries over that total.
   ============================================================ */
:root {
  --to-total: 6360ms;
  --to-settle: cubic-bezier(0.05, 0.7, 0.1, 1);
}

@keyframes wc-takeover {
  0%      { transform: none;          z-index: 3; }
  5.03%   { transform: scale(1.018);  z-index: 3; }
  13.2%   { transform: scale(1.008);  z-index: 3; }
  94.97%  { transform: scale(1.008);  z-index: 3; }
  100%    { transform: none;          z-index: 3; }
}
/* Neighbours recede rather than the subject shouting. Floor is 60%, which keeps
   them legible — they are dimmed, not hidden, and their scores stay readable. */
@keyframes wc-takeover-dim {
  0%      { opacity: 1; }
  5.03%   { opacity: .6; }
  94.97%  { opacity: .6; }
  100%    { opacity: 1; }
}
@keyframes wc-digit-roll {
  from { transform: translateY(-.5em); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.g-card.wc-took {
  position: relative;
  animation: wc-takeover var(--to-total) var(--to-settle) 1 both;
  box-shadow: var(--nm-out-sm), 0 0 0 1px var(--skin-accent, var(--gold));
}
.games-list.wc-taking .g-card:not(.wc-took) {
  animation: wc-takeover-dim var(--to-total) var(--to-settle) 1 both;
}
.g-card.wc-took .g-score.wc-rolled {
  display: inline-block;
  animation: wc-digit-roll 180ms var(--to-settle) 1 both;
}

/* ---- persistent change marker ----
   Survives the takeover. Static, sits in the row, and reads in words so it is
   not a colour cue. Cleared when the row is next opened or the score changes
   again, which is the point at which the user has seen it. */
.g-changed {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .16rem .45rem;
  border-radius: var(--r-pill);
  background: var(--surf-in);
  box-shadow: var(--nm-in-sm), inset 0 0 0 1px color-mix(in srgb, var(--gold) 55%, transparent);
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}
.g-changed::before {
  content: ''; flex: none;
  width: 0; height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-bottom: 5px solid currentColor;
}

/* Casual density hides the delta figure but keeps the marker itself: knowing
   that something changed is T1, knowing it was exactly +2 is T2. */
[data-density='casual'] .g-changed .g-changed__n { display: none; }

/* Reduced and Off both lose the timeline (base.css strips the animations). The
   accent keyline and the persistent marker are what carry the change, and both
   are static, so nothing is lost except the movement. */
[data-motion='reduced'] .g-card.wc-took,
[data-motion='off'] .g-card.wc-took {
  box-shadow: var(--nm-out-sm), 0 0 0 2px var(--skin-accent, var(--gold));
}

/* ---- due-up hitters ---- */
.g-dueup-chip {
  display: inline-flex; align-items: baseline; gap: .35rem;
  padding: .25rem .6rem; border-radius: var(--r-pill);
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
  font-size: 13px; font-weight: 800; letter-spacing: .06em; color: var(--tx);
}
.g-dueup-chip .lbl { font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--fnt); }
.g-dueup { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.du-hit {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .6rem .25rem .35rem; border-radius: var(--r-pill);
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
  font-size: 13px; font-weight: 600; color: var(--tx);
}
.du-hit .du-n {
  display: grid; place-items: center; width: 15px; height: 15px; border-radius: 50%;
  background: var(--surf-2); font-size: 12px; font-weight: 800; color: var(--fnt);
  font-variant-numeric: tabular-nums;
}

/* ---- detail tabs ---- */
.gd-tabs { display: flex; gap: .3rem; flex-wrap: wrap; }
.gd-tab {
  padding: .32rem .8rem; border: none; border-radius: var(--r-pill); cursor: pointer;
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
  font-family: inherit; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--fnt);
}
.gd-tab:hover { color: var(--mut); }
.gd-tab.on { color: var(--blue-2); box-shadow: var(--nm-in-sm), var(--glow-blue); }
.gd-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.gd-glossary-btn {
  margin-left: auto;
  width: 24px; height: 24px;
  border: none; border-radius: 50%; cursor: pointer;
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
  font: 800 12px/1 var(--f-title); color: var(--mut);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .2s var(--wc-ease), box-shadow .2s var(--wc-ease);
}
.gd-glossary-btn:hover { color: var(--skin-accent); box-shadow: var(--nm-in-sm), var(--skin-glow); }
.gd-glossary-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---- stat glossary modal ---- */
.glossary-lede { color: var(--mut); font-size: 13px; margin: 0 0 .8rem; }
.glossary-block + .glossary-block { margin-top: 1.1rem; }
.glossary-block h3 {
  font-family: var(--f-title); font-size: 13px; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--skin-accent); margin: 0 0 .5rem;
}
.glossary-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.glossary-table th, .glossary-table td {
  padding: .5rem .6rem; text-align: left; vertical-align: top;
  border-bottom: 1px solid color-mix(in srgb, var(--tx) 8%, transparent);
  font-size: 13px; line-height: 1.4;
}
.glossary-table tr:last-child th, .glossary-table tr:last-child td { border-bottom: none; }
.glossary-table th {
  width: 64px; font-family: var(--f-title); font-weight: 800;
  color: var(--tx); letter-spacing: .06em;
}
.glossary-table td { color: var(--fnt); }
.gd-pane { display: flex; flex-direction: column; gap: .65rem; }
.gd-sub { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.gd-sub-ttl {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--mut);
}
.gd-sub-ttl .team-logo { --logo-size: 18px; }
.gd-load { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--fnt); }
.gd-wp, .gd-plays { display: flex; flex-direction: column; gap: .4rem; }

/* ---- win probability sparkline ---- */
.wp-spark {
  width: 100%; height: 58px; display: block;
  border-radius: var(--r-tile); background: var(--surf-in); box-shadow: var(--nm-in-sm);
}
.wp-mid { stroke: var(--hair-hi); stroke-width: 1; stroke-dasharray: 3 3; }
.wp-area { fill: color-mix(in srgb, var(--blue) 18%, transparent); stroke: none; }
.wp-line { fill: none; stroke: var(--blue-2); stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.wp-dot { fill: var(--gold); }
.gd-wp-read { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--mut); }
.gd-wp-read strong { color: var(--tx); }
.gd-wp-read .num { color: var(--blue-2); }
.gd-wp-axis {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--fnt);
}
.gd-wp-axis .inn-arrow.up { color: var(--green); }
.gd-wp-axis .inn-arrow.down { color: var(--red); }
.gd-wp-even { color: var(--hair-hi); }

/* ---- scoring plays timeline ---- */
.sp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sp-row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: baseline; gap: .6rem;
  padding: .38rem 0; border-top: 1px solid var(--hair);
}
.sp-row:first-child { border-top: none; }
.sp-inn {
  display: inline-flex; align-items: baseline; gap: .2rem;
  font-size: 12px; font-weight: 800; color: var(--mut); font-variant-numeric: tabular-nums;
}
.sp-desc { font-size: 13px; line-height: 1.45; color: var(--tx); }
.sp-score {
  font-family: var(--f-title); font-size: 14px; letter-spacing: .04em; color: var(--blue-2);
  white-space: nowrap;
}

/* ---- batting / pitching tables ---- */
.gd-box-team { display: flex; flex-direction: column; gap: .4rem; }
.box-table .ls-team { min-width: 128px; }
.box-table tbody .ls-team { display: table-cell; }
.bx-name { font-size: 13px; font-weight: 600; color: var(--tx); }
.bx-pos { margin-left: .35rem; font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--fnt); }
.box-table tbody td { font-variant-numeric: tabular-nums; }

/* ---- sticky slate header ----
   Off by default: on a desktop viewport the whole filter bar is already in frame,
   and pinning it would only steal vertical space. */
.games-sticky { display: flex; flex-direction: column; gap: 1.1rem; }

/* ============================================================
   STANDINGS
   ============================================================ */
.board-controls { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.search-field { display: flex; align-items: center; gap: .5rem; padding: .5rem .85rem; flex: 1; min-width: 200px; max-width: 340px; color: var(--fnt); }
.search-field input { flex: 1; min-width: 0; background: none; border: none; outline: none; font-size: 13px; color: var(--tx); }
.search-field input::placeholder { color: var(--fnt); }
.filter-hint { color: var(--fnt); }

.st-well { padding: .6rem; display: flex; flex-direction: column; gap: .4rem; }
.st-head, .st-row { display: grid; grid-template-columns: 56px 1fr 320px 120px 56px; align-items: center; gap: .75rem; }
.st-head { padding: .5rem .9rem .3rem; }
.st-body { display: flex; flex-direction: column; gap: .4rem; }
.st-row {
  padding: .7rem .9rem;
  border-radius: var(--r-tile);
  background: var(--surf); box-shadow: var(--nm-out-sm);
  transition: box-shadow .18s ease, transform .18s ease;
}
.st-row:hover { transform: translateY(-1px); }
.st-row.rank-1 { box-shadow: var(--nm-out-sm), var(--glow-blue); }
.st-row.rank-last { box-shadow: var(--nm-out-sm), var(--glow-red); }
.st-row.dimmed { opacity: .3; }
.st-rank { font-family: var(--f-title); font-size: 19px; color: var(--mut); }
.st-row.rank-1 .st-rank { color: var(--blue); }
.st-row.rank-last .st-rank { color: var(--red); }
.st-mgr { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.st-name { font-family: var(--f-title); font-size: 17px; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-sub { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--fnt); }
.st-sub .tied { color: var(--gold); }
.st-clubs { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.st-total { font-family: var(--f-title); font-size: 24px; color: var(--tx); text-align: right; }
.st-delta { font-size: 12px; font-weight: 800; text-align: right; }
.st-delta.up { color: var(--green); }
.st-delta.down { color: var(--red); }
.st-delta.flat { color: var(--fnt); }
.st-delta-sub { display: block; color: var(--fnt); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.club-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .5rem; border-radius: 9px;
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
  font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--mut);
  cursor: pointer;
  transition: color .16s ease, box-shadow .16s ease;
}
.club-chip:hover { color: var(--tx); }
.club-chip.active { color: var(--tx); box-shadow: var(--nm-in-sm), var(--glow-blue); }
.club-chip .team-logo { --logo-size: 22px; }
.club-chip .cr { color: var(--tx); font-variant-numeric: tabular-nums; }
.club-chip.live .cr { color: var(--red); }

/* ============================================================
   WILD CARDS
   ============================================================ */
.wc-card { padding: 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .8rem; }
.wc-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.wc-title { font-size: 18px; color: var(--tx); }
.wc-winner { font-family: var(--f-title); font-size: 30px; color: var(--tx); line-height: 1.05; }
.wc-sub { font-size: 12px; color: var(--mut); line-height: 1.55; }
.wc-foot { font-size: 13px; color: var(--fnt); line-height: 1.55; margin-top: auto; padding-top: .5rem; border-top: 1px solid var(--hair); }

.wc-list { display: flex; flex-direction: column; gap: .45rem; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: none; align-items: flex-start; justify-content: center;
  padding: 1.5rem 1.25rem;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(6px);
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal { width: min(720px, 100%); padding: 1.3rem 1.4rem; display: flex; flex-direction: column; gap: 1rem; max-height: 100%; overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.modal-head .ttl { font-size: 21px; color: var(--tx); }
.modal-body { display: flex; flex-direction: column; gap: .9rem; font-size: 13px; line-height: 1.6; color: var(--mut); }
.modal-body h3 { font-family: var(--f-title); font-size: 15px; color: var(--tx); letter-spacing: .02em; }
.modal-body ul, .modal-body ol { padding-left: 1.1rem; display: flex; flex-direction: column; gap: .35rem; }
.modal-body strong { color: var(--tx); font-weight: 700; }
.modal-body .note { padding: .8rem 1rem; border-radius: var(--r-tile); background: var(--surf-in); box-shadow: var(--nm-in-sm); font-size: 12px; }

/* commissioner editor */
.form-row { display: flex; flex-direction: column; gap: .4rem; }
.form-row label { font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--fnt); }
.field {
  padding: .6rem .8rem; border-radius: var(--r-tile);
  background: var(--surf-in); box-shadow: var(--nm-in-sm), var(--ring);
  border: none; outline: none; font-size: 13px; color: var(--tx); width: 100%;
}
.field:focus { box-shadow: var(--nm-in-sm), var(--glow-blue); }
select.field { appearance: none; cursor: pointer; }
select.field option { background: var(--surf); color: var(--tx); }
.pick-row { display: grid; grid-template-columns: 130px repeat(3, 1fr); align-items: center; gap: .5rem; }
.pick-row .pr-name { font-family: var(--f-title); font-size: 15px; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-list { display: flex; flex-direction: column; gap: .5rem; max-height: 46vh; overflow-y: auto; padding-right: .3rem; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.form-msg { font-size: 12px; }
.form-msg.err { color: var(--red); }
.form-msg.ok { color: var(--green); }

/* ============================================================
   MANAGER PROFILE
   ============================================================ */
/* Manager names are buttons so the profile is reachable by keyboard and reads as
   an action to a screen reader. Everything below strips the control back to the
   text it replaced; the underline on hover/focus is the only affordance, because
   a button chrome here would compete with the club chips on the same row. */
button.st-name, button.lead-name {
  appearance: none; background: none; border: none; padding: 0;
  font: inherit; text-align: left; cursor: pointer;
}
button.st-name { font-family: var(--f-title); font-size: 17px; color: var(--tx); }
button.st-name:hover, button.lead-name:hover,
button.st-name:focus-visible, button.lead-name:focus-visible {
  color: var(--blue); text-decoration: underline; text-underline-offset: 3px;
}
a.st-name, a.lead-name {
  text-decoration: none;
}
a.st-name:hover, a.lead-name:hover,
a.st-name:focus-visible, a.lead-name:focus-visible {
  color: var(--blue); text-decoration: underline; text-underline-offset: 3px;
}

.pf-head { display: flex; align-items: center; justify-content: space-between; gap: .9rem; flex-wrap: wrap; }
.pf-id { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.pf-rank {
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none;
  min-width: 56px; padding: .4rem .5rem; border-radius: 14px;
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
}
.pf-rank-l { font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--fnt); }
.pf-rank-v { font-family: var(--f-title); font-size: 22px; color: var(--tx); line-height: 1.1; }
.pf-id > .pf-idtext { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.pf-tag { font-size: 13px; color: var(--mut); min-width: 0; overflow-wrap: anywhere; }
/* Spelled-out rank change. The board's one-glyph column cannot carry the date,
   so the profile is where "+2 ranks · since Jul 28" is stated in full. */
.pf-move { font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.pf-move.up { color: var(--green); }
.pf-move.down { color: var(--red); }
.pf-move.flat, .pf-move.none { color: var(--fnt); }
.pf-badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.pf-badge {
  padding: .3rem .6rem; border-radius: 999px;
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
  font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.pf-badge.wizard { color: var(--blue); }
.pf-badge.commoner { color: var(--red); }
.pf-badge.dt { color: var(--gold); }

.pf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; }
.pf-stat {
  display: flex; flex-direction: column; gap: .15rem;
  padding: .7rem .8rem; border-radius: var(--r-tile);
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
}
.pf-stat-l { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--fnt); }
.pf-stat-v { font-family: var(--f-title); font-size: 22px; color: var(--tx); }
.pf-stat-s { font-size: 13px; color: var(--fnt); }
.pf-empty { padding: .8rem 1rem; border-radius: var(--r-tile); background: var(--surf-in); box-shadow: var(--nm-in-sm); font-size: 12px; }

.pf-block { display: flex; flex-direction: column; gap: .5rem; }
.pf-clubs { display: flex; flex-direction: column; gap: .4rem; }
.pf-club {
  display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: .6rem;
  padding: .55rem .75rem; border-radius: var(--r-tile);
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
}
.pf-club.open { grid-template-columns: 1fr; color: var(--fnt); font-style: italic; }
.pf-club.live { box-shadow: var(--nm-in-sm), var(--glow-green); }
.pf-club-name { color: var(--tx); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-club-runs { font-family: var(--f-title); font-size: 18px; color: var(--tx); }
.pf-club-games { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--fnt); }
/* Today's contribution per club — answers "what moved me", not just "where am I". */
.pf-club-today { font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--fnt); white-space: nowrap; }
.pf-club-today.on { color: var(--green); }

/* Wild card outlook. Status word + the arithmetic behind it, never a percentage —
   see the note above outlookHtml() in app.js. */
.pf-odds { display: flex; flex-direction: column; gap: .4rem; }
.pf-odds-row {
  display: grid; grid-template-columns: 1fr auto; gap: .1rem .8rem; align-items: baseline;
  padding: .55rem .75rem; border-radius: var(--r-tile);
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
}
.pf-odds-l { font-size: 12.5px; font-weight: 700; color: var(--tx); }
.pf-odds-v { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.pf-odds-s { grid-column: 1 / -1; font-size: 13px; color: var(--fnt); }
.pf-odds-row.in .pf-odds-v { color: var(--gold); }
.pf-odds-row.near .pf-odds-v { color: var(--green); }
.pf-odds-row.live .pf-odds-v { color: var(--blue); }
.pf-odds-row.far .pf-odds-v { color: var(--fnt); }
.pf-note { font-size: 13px; color: var(--fnt); font-style: italic; }

/* Path to the top: the Monte Carlo simulation's odds. Unlike the wild card
   outlook above, this *is* a percentage — one earned by bootstrap-resampling
   real per-game run totals thousands of times, not a guess. See pathToTopHtml()
   and simulatePathToTop() in functions/api/_shared.js for the model itself. */
.pf-path-headline {
  display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap;
  padding: .8rem .9rem; border-radius: var(--r-tile);
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
}
.pf-path-big { font-family: var(--f-title); font-size: 34px; line-height: 1; color: var(--gold); flex: none; }
.pf-path-label { font-size: 13px; color: var(--tx); }
.pf-path-range {
  display: grid; grid-template-columns: 1fr auto; gap: .1rem .8rem; align-items: baseline;
  padding: .55rem .75rem; border-radius: var(--r-tile);
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
}
.pf-path-range-l { font-size: 12.5px; font-weight: 700; color: var(--tx); }
.pf-path-range-v { font-family: var(--f-title); font-size: 16px; color: var(--tx); }
.pf-path-range-s { grid-column: 1 / -1; font-size: 13px; color: var(--fnt); }
.pf-path-rivals { display: flex; flex-direction: column; gap: .35rem; }
.pf-path-rivals-l { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--fnt); }
.pf-path-list { display: flex; flex-direction: column; gap: .3rem; }
.pf-path-row {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .45rem .75rem; border-radius: var(--r-tile);
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
}
.pf-path-rival { font-size: 12.5px; font-weight: 700; color: var(--tx); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-path-pct { font-family: var(--f-title); font-size: 15px; flex: none; }
.pf-path-row.near .pf-path-pct { color: var(--green); }
.pf-path-row.live .pf-path-pct { color: var(--blue); }
.pf-path-row.far .pf-path-pct { color: var(--fnt); }
.pf-path-more { font-size: 12px; color: var(--fnt); font-style: italic; }

.pf-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .4rem; }
.pf-facts dt { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--fnt); }
.pf-facts dd { font-size: 13px; color: var(--tx); }
.pf-bio { overflow-wrap: anywhere; }
.pf-bio.muted { color: var(--fnt); font-style: italic; }

/* profile editor inside the commissioner panel */
.pf-editor > summary {
  cursor: pointer; padding: .55rem .8rem; border-radius: var(--r-tile);
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
  font-family: var(--f-title); font-size: 14px; color: var(--tx);
}
.pf-editor-body { display: flex; flex-direction: column; gap: .7rem; padding-top: .7rem; }
.pf-editor-note { font-size: 12px; }
.pf-edit-list { display: flex; flex-direction: column; gap: .7rem; max-height: 40vh; overflow-y: auto; padding-right: .3rem; }
.pf-edit-row { display: grid; grid-template-columns: 130px 1fr 1fr 90px; align-items: center; gap: .5rem; }
.pf-edit-row .pr-name { font-family: var(--f-title); font-size: 15px; color: var(--tx); }
.pf-edit-row .pf-bio-input { grid-column: 2 / -1; resize: vertical; font-family: inherit; line-height: 1.5; }

.route-stack { display: flex; flex-direction: column; gap: 1rem; }
.route-card { padding: 1rem 1.1rem 1.15rem; }
.route-status { display: flex; flex-wrap: wrap; gap: .35rem .45rem; margin: 0 0 .8rem; }
.route-note {
  padding: .8rem .95rem;
  border-radius: var(--r-tile);
  background: var(--surf-in);
  box-shadow: var(--nm-in-sm);
  font-size: 12px; line-height: 1.65; color: var(--mut);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .6rem;
}
.dashboard-actions { display: flex; justify-content: flex-end; }
.dashboard-boost {
  padding: .95rem 1rem 1rem;
  border-radius: var(--r-card);
  display: flex; flex-direction: column; gap: .75rem;
}
.boost-meter {
  position: relative;
  height: 14px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surf-in) 88%, transparent);
  box-shadow: var(--nm-in-sm);
  overflow: hidden;
}
.boost-meter-bar {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--gold), var(--red-2));
  border-radius: inherit;
}
.boost-meta { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fnt); }
.field-wrap { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fnt); }

@media (max-width: 720px) {
  .pf-edit-row { grid-template-columns: 1fr 1fr; }
  .pf-edit-row .pr-name { grid-column: 1 / -1; }
  .pf-edit-row .pf-bio-input { grid-column: 1 / -1; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  flex: none;
  margin-top: 1.6rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--hair);
  background: var(--bg);
}
.site-footer .inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem .9rem; flex-wrap: wrap;
  font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--fnt);
}
.footer-right { display: inline-flex; align-items: center; gap: .7rem; flex-wrap: wrap; }

/* ============================================================
   BOTTOM TICKER
   Fixed to the viewport bottom at z-index 90. Page content clears it via the
   body's --tick-clear padding; while a modal is open the ticker is hidden
   outright rather than floating over the dialog's backdrop.
   ============================================================ */
.bottom-ticker {
  position: fixed; z-index: 90;
  left: var(--tick-gap); right: var(--tick-gap);
  bottom: calc(var(--tick-gap) + var(--tick-safe));
  height: var(--tick-h);
  display: flex; align-items: center; gap: .9rem;
  padding: 0 .9rem 0 .55rem;
  border-radius: var(--r-pill);
  background: var(--surf);
  box-shadow: var(--nm-out), var(--ring);
  overflow: hidden;
}
.bt-label {
  flex: none; padding: .45rem .95rem; border-radius: var(--r-pill);
  background: var(--surf-in); box-shadow: var(--nm-in-sm);
  font-size: 12px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--red);
}
.bt-viewport { position: relative; flex: 1; height: 100%; overflow: hidden; display: flex; align-items: center; }
/* Gapless marquee: the track carries two identical .bt-sequence copies and is
   translated by exactly one copy's width, so the second copy fills the space
   the first vacates. The animation duration is set inline by app.js from the
   measured sequence width to hold a constant px/s reading speed. */
.bt-track { display: flex; align-items: center; height: 100%; white-space: nowrap; will-change: transform; }
.bt-sequence { display: flex; align-items: center; flex: none; height: 100%; }
.bt-seg { display: inline-flex; align-items: center; gap: .55rem; }
.bt-rank { font-family: 'SFSportsNight', var(--f-title); font-size: 13px; font-weight: 800; letter-spacing: .14em; color: var(--fnt); }
.bt-name { font-family: 'SFSportsNight', var(--f-title); font-size: 16px; text-transform: uppercase; color: var(--tx); }
.bt-mgr { font-family: 'SFSportsNight', var(--f-title); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.bt-runs { font-family: 'SFSportsNight', var(--f-title); font-size: 18px; color: var(--blue-2); }
.bt-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--hair-hi); margin: 0 .55rem; display: inline-block; vertical-align: middle; }
.bt-tag { font-size: 12px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--fnt); }
.bt-seg .team-logo { --logo-size: 24px; }

body:has(.modal-overlay.open) .bottom-ticker { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1120px) {
  .st-head, .st-row { grid-template-columns: 48px 1fr 240px 96px 48px; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .wrap { width: min(1240px, 100% - 1.75rem); }
  /* The centre column is the same width on every card so the scores stay in a
     vertical line down the slate; it just gets tighter as the viewport does, and
     the width it gives up goes to the club names. */
  .g-row { grid-template-columns: minmax(0, 1fr) auto minmax(112px, 172px) auto minmax(0, 1fr); gap: .45rem .75rem; }
  .g-crest { --crest-size: 38px; }
  .g-name { font-size: 12px; }
  .head-row { flex-wrap: wrap; justify-content: center; }
  .tabs-wrap { width: 100%; justify-content: center; flex-wrap: wrap; }
  .grid-3 { grid-template-columns: 1fr; }
  .st-head { display: none; }
  .st-row { grid-template-columns: 44px 1fr 72px; grid-template-areas: 'rank mgr total' 'clubs clubs clubs'; row-gap: .55rem; }
  .st-rank { grid-area: rank; }
  .st-mgr { grid-area: mgr; }
  .st-clubs { grid-area: clubs; }
  .st-total { grid-area: total; }
  .st-delta { display: none; }
}

@media (max-width: 700px) {
  .screen-head .ttl { font-size: 22px; }
  .g-row { grid-template-columns: minmax(0, 1fr) auto minmax(104px, 150px) auto minmax(0, 1fr); gap: .4rem .6rem; }
  .g-crest { --crest-size: 36px; font-size: 12px; }
  .g-score { font-size: 22px; }
  .g-score-wrap { min-width: 34px; }
  .g-name { font-size: 13px; }
  .g-card { padding: .6rem .7rem; }
  .g-side { gap: .5rem; }
  .ls-table th, .ls-table td { padding: .28rem .35rem; min-width: 22px; font-size: 13px; }
  /* Pins the date line and the filters to the top of the viewport once scrolled
     that far, so a 15-game slate can be scrolled without losing them. The
     masthead itself scrolls away rather than staying put, so this is the
     topmost sticky element once it engages — no header height to offset by. */
  .games-sticky {
    position: sticky; top: 0; z-index: 40;
    gap: .6rem; padding: .7rem 0 .55rem;
    /* Opaque enough that game rows never ghost through, with blur where supported. */
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border-bottom: 1px solid var(--hair);
  }
  .box-table .ls-team { min-width: 104px; }
  .week-row { grid-template-columns: 100px 1fr 44px; }
  .pick-row { grid-template-columns: 1fr 1fr; }
  .pick-row .pr-name { grid-column: 1 / -1; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .hide-mobile { display: none; }
}

@media (max-width: 540px) {
  :root { --tick-gap: 10px; }
  .wrap { width: min(1240px, 100% - 1.25rem); }
  .brand-title { font-size: 24px; }
  .brand-eyebrow { font-size: 12px; letter-spacing: .2em; }
  .brand-mark { width: 44px; height: 44px; padding: 5px; border-radius: 14px; }
  .head-brandbar { gap: .6rem; }
  .site-header { padding: .7rem 0 .55rem; gap: .6rem; }
  /* Keep the controls on one row so the taller masthead doesn't eat the fold. */
  .head-row { flex-wrap: nowrap; }
  /* Wrap the four tabs onto a second line when they don't fit on one row.
     The glow-only button treatment keeps each row compact enough that two
     stacked lines still sit above the fold. */
  .tabs-wrap {
    width: 100%; flex: 1 1 100%; min-width: 0;
    flex-wrap: wrap;
    row-gap: .3rem;
    justify-content: flex-start;
  }
  .tab-btn { padding: .1rem .32rem; letter-spacing: .08em; font-size: 12px; }
  .tab-btn .count-badge { margin-left: 4px; padding: 0 5px; font-size: 12px; }
  .head-actions { flex: 0 0 auto; gap: .35rem; }
  /* Compact skin toggle on phones — abbreviation swap lives in factions.css so it
     wins the cascade over the default full-label rule declared there. */
  .g-row { grid-template-columns: minmax(0, 1fr) auto minmax(88px, 104px) auto minmax(0, 1fr); gap: .3rem .45rem; padding-bottom: 1.15rem; }
  .g-side { gap: .4rem; }
  /* Both rings thin out together at this width, but the outer one stays: it is
     what makes the crest's edge visible, and dropping it would leave a dark
     plate floating on a dark card. */
  .g-crest {
    --crest-size: 30px;
    box-shadow: 0 0 0 1.5px var(--club, var(--hair-hi)), 0 0 0 2.5px var(--logo-ring);
  }
  .g-score { font-size: 20px; }
  .g-score-wrap { min-width: 24px; }
  .g-center { flex-direction: column; gap: .3rem; }
  /* The filled dots already carry the out count; the word is what pushes the
     situation chip wider than the centre track. */
  .g-outs .out-lbl { display: none; }
  /* Full club names don't fit at this width; the abbreviation does. */
  .g-name { display: none; }
  .g-abbr { display: block; }
  /* Two lines, not one: at this width a single line clips "JOE · JAKE" down to
     "JOE ·", which reads as a bug rather than as a claim list. */
  .g-owner { font-size: 12px; letter-spacing: .06em; line-height: 1.35; }
  .g-situation { gap: .4rem; }
  .g-diamond { padding: .25rem .45rem .25rem .35rem; gap: .35rem; }
  /* Inning, outs and the diamond are the load-bearing live details at this
     width; the ball-strike count is what gets dropped to make them fit. */
  .g-count { display: none; }
  /* Type and the seam narrow; the left-versus-right layout does not collapse.
     Stacking the two sides would turn a matchup into a list. */
  .motd-line { gap: .4rem; }
  .motd-slash { width: 26px; }
  .motd-mgr { font-size: 21px; }
  .motd-runs { font-size: 40px; }
  .cg-row { grid-template-columns: 1fr auto 1fr; gap: .35rem; padding: .45rem .5rem; }
  .cg-side { font-size: 12px; }
  .cg-tag { max-width: 70px; }
  .bt-label { display: none; }
  .bottom-ticker { padding: 0 .8rem; }
  .modal { padding: 1rem 1rem; }
  .route-card { padding: .95rem .9rem 1rem; }
  /* The chips carry their own "passes"/"vs" wording, so the section label is the
     first thing to go when width runs out. */
  .g-impact-lbl { display: none; }
  .impact-chip { font-size: 12px; letter-spacing: .06em; padding: .2rem .5rem; }
  .impact-chip .ic-label { max-width: 130px; }
  .sp-row { grid-template-columns: 28px minmax(0, 1fr) auto; gap: .45rem; }
  .sp-desc { font-size: 13px; }
  .du-hit { font-size: 12px; padding: .2rem .5rem .2rem .3rem; }
  .gd-tab { padding: .3rem .6rem; letter-spacing: .1em; }
}

/* ============================================================
   DENSITY

   Density gates disclosure, never availability. Casual shows the tier that
   protects the read (standing, gap, score); Manager adds the explanatory tier;
   Nerd adds the detail tier. Nothing is removed from the DOM and nothing becomes
   unreachable — everything hidden at a lower density is still inside a panel the
   user can open, and disclosure is capped at two levels deep.
   ============================================================ */

/* T2 — explanatory. Present from Manager up. */
[data-density='casual'] .t2 { display: none !important; }
/* T3 — detail. Present at Nerd only. */
[data-density='casual'] .t3,
[data-density='manager'] .t3 { display: none !important; }

/* Nerd tightens the vertical rhythm so the extra tier fits without pushing the
   slate past a screen. It never shrinks a target below 44px. */
[data-density='nerd'] .games-list { gap: .55rem; }
[data-density='nerd'] .g-card { padding: .5rem .7rem; }

@media (prefers-reduced-motion: reduce) {
  .week-bar { transition: none; }
}

/* ============================================================
   SEGMENTED SKIN TOGGLE

   A two-half pill with a sliding thumb. The visible <label> is decorative —
   the accessibility contract lives on the checkbox behind it (role=switch,
   aria-label). Clicking anywhere on the pill flips the checkbox because the
   label is bound via for=.

   Both option words are always rendered so users can read the current AND
   the target skin at a glance; the thumb slides to indicate which is active.
   ============================================================ */
.skin-seg {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

/* The real input drives state; only its focus ring is visible. Everything else
   is hidden off-screen without display:none so it stays keyboard-focusable. */
.skin-seg__input {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  margin: 0; padding: 0;
  opacity: 0; cursor: pointer;
  z-index: 2;
}

.skin-seg__pill {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  height: 32px;
  min-width: 168px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surf-in, #0f1113);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, .45),
    inset 0 0 0 1px color-mix(in srgb, var(--hair, #2a2f36) 70%, transparent);
  cursor: pointer;
  user-select: none;
  font-family: inherit;
}

/* The sliding thumb — one half of the pill, animated between two positions. */
.skin-seg__thumb {
  position: absolute;
  top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: var(--surf-2, #262a2e);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .08) inset,
    0 2px 6px rgba(0, 0, 0, .35);
  transition: transform .22s cubic-bezier(.4, .0, .2, 1),
              background-color .22s ease;
  z-index: 0;
}

/* Checked = Wizard (thumb on the LEFT half where "Wizard" reads).
   Unchecked = Commoner (thumb on the RIGHT half). */
.skin-seg__input:not(:checked) ~ .skin-seg__pill .skin-seg__thumb {
  transform: translateX(100%);
}

.skin-seg__opt {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  z-index: 1;
  padding: 0 .9rem;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mut, #6d7480);
  transition: color .22s ease;
  white-space: nowrap;
}

/* Highlight the side the thumb is currently under. */
.skin-seg__input:checked ~ .skin-seg__pill .skin-seg__opt--wiz,
.skin-seg__input:not(:checked) ~ .skin-seg__pill .skin-seg__opt--com {
  color: var(--tx, #f2f4f8);
}

/* Focus ring — visible only for keyboard users. */
.skin-seg__input:focus-visible ~ .skin-seg__pill {
  outline: 2px solid var(--skin-accent, #22d3ee);
  outline-offset: 2px;
}

/* ============================================================
   MOBILE HEADER LAYOUT — clean center-axis, no left-hugging cluster.

   The old rules let the tab pill hug the left edge and stack in a 2×2 grid,
   which read as a "stacked bar on the left." We now force:
     • The whole head-row to center on both axes
     • Tabs on their own line, spanning the full container width, centered
     • Skin toggle centered below (or beside) the tabs, never off to one side
     • No wrapping into a lopsided grid: the tabs are a single evenly-spaced row
   ============================================================ */

/* Everything from tablet down: center the header, don't space-between it.
   space-between at narrow widths is what pushes clusters against the edges. */
@media (max-width: 900px) {
  .head-row {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
  }
  .tabs-wrap {
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;   /* one clean row, not a 2×2 grid */
  }
  .head-actions {
    justify-content: center;
    width: auto;
  }
}

/* Phones: keep everything on the center axis, shrink type so a single tab row fits. */
@media (max-width: 540px) {
  .head-row { gap: .6rem; }

  .tabs-wrap {
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;       /* override the 540px rule above that let tabs wrap */
    row-gap: 0;
    gap: .25rem;
    padding: .25rem;
  }

  .tab-btn {
    flex: 1 1 auto;          /* each tab takes equal share of the row */
    padding: .35rem .3rem;
    font-size: 12px;
    letter-spacing: .08em;
    text-align: center;
    justify-content: center;
    min-width: 0;
  }
  .tab-btn .count-badge {
    margin-left: 4px;
    padding: 0 5px;
    font-size: 12px;
  }

  /* Segmented pill on phones — smaller, still centered, still readable. */
  .skin-seg__pill {
    height: 30px;
    min-width: 150px;
    padding: 2.5px;
  }
  .skin-seg__opt {
    font-size: 12px;
    padding: 0 .7rem;
    letter-spacing: .1em;
  }
}

/* Very narrow phones (≤360px): shave one more step so nothing clips. */
@media (max-width: 360px) {
  .tab-btn { font-size: 12px; padding: .32rem .2rem; letter-spacing: .06em; }
  .skin-seg__pill { min-width: 138px; }
  .skin-seg__opt { padding: 0 .55rem; font-size: 12px; }
}
