/* SURVIVOR — the look. See docs/DESIGN.md for every decision below and why.
   Floodlights: a night game under stadium lights. Available = lit. Spent = burned out.
   Hand-written; no framework, no build step (SPEC §2, A13). */

/* ---- Fonts: Archivo, self-hosted, three subsets (ranges from the Google css2 response) --- */
@font-face {
  font-family: "Archivo"; font-style: normal; font-display: swap;
  font-weight: 400 900; font-stretch: 62% 125%;
  src: url("../fonts/archivo-2.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-display: swap;
  font-weight: 400 900; font-stretch: 62% 125%;
  src: url("../fonts/archivo-1.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-display: swap;
  font-weight: 400 900; font-stretch: 62% 125%;
  src: url("../fonts/archivo-0.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0,
    U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* ---- Tokens -------------------------------------------------------------------------------- */
:root {
  --ink-900: #06070b;
  --ink-850: #0a0d14;
  --ink-800: #10141e;
  --ink-700: #171d2b;
  --ink-600: #212939;
  --hairline: #2b3447;

  --lamp: #ffb020;
  --lamp-hot: #ff7a1a;
  --lamp-dim: #8a6520;
  --cool: #4c7cf3;
  /* Signed scoring (SPEC §1, 2026-10-09): a loss is a negative number and must look like one.
     Cold coral, not vermilion: it is a debt, not an alarm. Never the only carrier — the U+2212
     minus and the spoken label carry it too. */
  --loss: #ff5c7a;

  --text-hi: #f3f6fb;
  --text-mid: #9da9c0;
  --text-lo: #6f7c95;

  --font-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --font-ui: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;

  --t-mega: clamp(3.5rem, 15vw, 7.5rem);
  --t-wk: clamp(5.5rem, 26vw, 11rem);
  --t-score: clamp(1.75rem, 6vw, 2.75rem);
  --t-h1: clamp(1.6rem, 5vw, 2.5rem);
  --t-h2: 1.25rem;
  --t-abbr: 1.0625rem;
  --t-body: 0.9375rem;
  --t-meta: 0.8125rem;
  --t-micro: 0.6875rem;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 72px;
  --gutter: 16px;
  --maxw: 1180px;
  --radius-tile: 10px;
  --radius-panel: 4px;
  --tap: 44px;
  --dock-h: 64px;

  --ease-out: cubic-bezier(.17, .84, .44, 1);
  color-scheme: dark;
}

/* ---- Base ---------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--ink-900);
  /* Two stadium lamps above the field, and the faintest yard lines. The whole metaphor in one
     background: light falling on a dark ground. */
  background-image:
    radial-gradient(60rem 28rem at 12% -8rem, rgba(255, 176, 32, .10), transparent 70%),
    radial-gradient(60rem 28rem at 88% -8rem, rgba(255, 176, 32, .07), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(255,255,255,.018) calc(10% - 1px) 10%);
  background-attachment: fixed, fixed, scroll;
  color: var(--text-hi);
  font: 400 var(--t-body)/1.55 var(--font-ui);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: var(--lamp); text-underline-offset: 3px; }
a:hover { color: #ffc65c; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--lamp);
  color: var(--ink-900); padding: 8px 12px; border-radius: var(--radius-panel); }
.skip:focus { left: 8px; }

.page {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--sp-5) var(--gutter) var(--sp-7);
}

/* ---- Numbers: every signed number on every screen ---------------------------------------- */
.num, .pts, .mega {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-stretch: 118%;
  white-space: nowrap;
}
.pts { font-weight: 900; font-size: var(--t-score); line-height: .92; letter-spacing: -.02em; }
.mega { display: block; font-weight: 900; font-size: var(--t-mega); line-height: .86; letter-spacing: -.035em; }
.num--pos, .pts--pos, .mega--pos { color: var(--lamp); }
.num--neg, .pts--neg, .mega--neg { color: var(--loss); }
.num--zero, .pts--zero, .mega--zero { color: var(--text-mid); }
.num--none, .pts--none, .mega--none { color: var(--text-lo); }
.mega--pos { text-shadow: 0 0 42px rgba(255, 176, 32, .35); }
.mega--neg { text-shadow: 0 0 42px rgba(255, 92, 122, .25); }
.is-ticking { color: var(--lamp-hot) !important; }

/* ---- Header -------------------------------------------------------------------------------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  /* Opaque on purpose: backdrop-filter here would make the header the containing block for
     the position:fixed phone dock inside it, and pin the dock to the top of the screen. */
  background: rgba(6, 7, 11, .96);
  border-bottom: 1px solid var(--hairline);
}
.bar__in {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
  height: 56px; display: flex; align-items: center; gap: var(--sp-4);
}
.mark { text-decoration: none; color: var(--text-hi); display: flex; align-items: center; min-height: var(--tap); }
.mark__word {
  font-family: var(--font-display); font-weight: 900; font-stretch: 125%;
  font-size: 1.25rem; letter-spacing: -.01em; text-transform: uppercase;
  background: linear-gradient(180deg, #fff 30%, #ffd27a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lockchip {
  margin-left: auto;
  display: flex; align-items: baseline; gap: 6px;
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--ink-850);
  font-size: var(--t-meta); color: var(--text-mid); white-space: nowrap;
}
.lockchip__wk { color: var(--text-hi); font-weight: 700; }
.lockchip--open { border-color: rgba(255, 176, 32, .35); }
.lockchip--open .lockchip__t time { color: var(--lamp); font-weight: 700; font-variant-numeric: tabular-nums; }
.lockchip--locked .lockchip__t { color: var(--cool); }

/* Tabs: a bottom dock on a phone (that's where a thumb is), inline in the header on desktop. */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--dock-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(10, 13, 20, .94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--hairline);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: var(--tap); color: var(--text-lo); text-decoration: none;
  font-size: var(--t-micro); font-weight: 600; letter-spacing: .02em;
  position: relative;
}
.tabs a span { max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--text-hi); }
.tabs a[aria-current="page"]::before {
  content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px;
  background: var(--lamp); box-shadow: 0 0 14px 1px rgba(255,176,32,.6);
}
.ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico__fill { fill: currentColor; }
.tabs a[aria-current="page"] .ico { stroke: var(--lamp); }
.tabs a[aria-current="page"] .ico__fill { fill: var(--lamp); }

@media (min-width: 820px) {
  body { padding-bottom: 0; }
  .tabs {
    position: static; height: auto; padding: 0; background: none; border: 0;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    display: flex; gap: 2px;
  }
  .tabs a { flex-direction: row; gap: 8px; padding: 0 12px; font-size: var(--t-meta); height: 56px; }
  .tabs a[aria-current="page"]::before { top: auto; bottom: -1px; left: 12px; right: 12px; }
  .tabs .ico { width: 18px; height: 18px; }
  .lockchip { margin-left: auto; }
}

.foot {
  max-width: var(--maxw); margin: 0 auto; padding: var(--sp-5) var(--gutter) var(--sp-6);
  border-top: 1px solid var(--hairline); color: var(--text-lo); font-size: var(--t-meta);
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5);
}

/* ---- Hero ---------------------------------------------------------------------------------- */
.hero {
  display: grid; gap: var(--sp-4) var(--sp-6);
  grid-template-columns: auto 1fr;
  align-items: end;
  padding: var(--sp-3) 0 var(--sp-6);
}
.hero__wk { display: flex; flex-direction: column; line-height: 1; }
.hero__wklabel { font-size: var(--t-meta); color: var(--text-mid); font-weight: 600; margin-bottom: -.2em; }
.hero__wknum {
  font-family: var(--font-display); font-weight: 900; font-stretch: 125%;
  font-size: var(--t-wk); line-height: .78; letter-spacing: -.05em;
  /* background-clip:text paints only inside the box, and the negative tracking makes the box
     narrower than the glyph — the right edge of the 6 was clipped on a phone. Pad the box out
     to the glyph, and take the space back so the layout doesn't move. */
  padding-right: .1em; margin-right: -.1em;
  font-variant-numeric: tabular-nums;
  color: var(--text-hi);
  /* The number under the lights: lit from above, falling off into the dark. */
  background: linear-gradient(180deg, #fff 0%, #ffe2a6 45%, #b7832a 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 30px rgba(255, 176, 32, .22));
}
.hero__body { padding-bottom: .6rem; min-width: 0; }
.hero__title {
  font-family: var(--font-display); font-weight: 800; font-stretch: 112%;
  font-size: var(--t-h1); line-height: 1.05; letter-spacing: -.015em;
  text-wrap: balance;
}
.hero__sub { margin-top: var(--sp-2); color: var(--text-mid); max-width: 60ch; }
.hero__sub time { color: var(--text-hi); }

/* The depleting hand: 32 filaments. Each spent team is a dead bulb. */
.hand {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--sp-2) var(--sp-4);
  padding: var(--sp-4); border: 1px solid var(--hairline); border-radius: var(--radius-panel);
  background: linear-gradient(180deg, var(--ink-800), var(--ink-850));
}
.hand__count { display: flex; align-items: baseline; gap: 10px; }
.hand__count strong {
  font-family: var(--font-display); font-weight: 900; font-stretch: 118%;
  font-size: var(--t-score); line-height: 1; color: var(--lamp); font-variant-numeric: tabular-nums;
}
.hand__count span { color: var(--text-mid); font-size: var(--t-meta); }
.hand__meter { display: grid; grid-template-columns: repeat(32, 1fr); gap: 3px; height: 26px; }
.hand__meter i {
  display: block; border-radius: 2px;
  background: linear-gradient(180deg, #ffd27a, var(--lamp) 60%, #c47d0e);
  box-shadow: 0 0 8px rgba(255, 176, 32, .45);
}
.hand__meter i.is-spent { background: var(--ink-600); box-shadow: none; }
.hand__note { grid-column: 1 / -1; color: var(--text-lo); font-size: var(--t-meta); }
@media (max-width: 520px) {
  .hand { grid-template-columns: 1fr; }
  .hand__meter { height: 20px; gap: 2px; }
}

/* ---- Notices ------------------------------------------------------------------------------- */
.notice {
  margin: 0 0 var(--sp-4); padding: 12px 14px; border-radius: var(--radius-panel);
  border: 1px solid var(--hairline); border-left-width: 3px; background: var(--ink-800);
  font-size: var(--t-body);
}
.notice--ok { border-left-color: var(--lamp); }
.notice--err { border-left-color: var(--loss); }
.notice--cool { border-left-color: var(--cool); color: var(--text-mid); }

/* ---- The grid: the signature screen -------------------------------------------------------- */
.grid { display: grid; gap: var(--sp-6); }
@media (min-width: 900px) { .grid { grid-template-columns: 1fr 1fr; column-gap: var(--sp-6); } }
.legend { grid-column: 1 / -1; display: flex; gap: var(--sp-4); color: var(--text-lo); font-size: var(--t-micro); }
.legend__i { display: inline-flex; align-items: center; gap: 6px; }
.legend__i::before { content: ""; width: 14px; height: 3px; border-radius: 2px; }
.legend__i--live::before { background: var(--lamp); box-shadow: 0 0 6px var(--lamp); }
.legend__i--spent::before { background: var(--ink-600); }
.legend__i--bye::before { background: var(--hairline); outline: 1px solid var(--cool); outline-offset: 1px; height: 1px; }

.conf__name {
  font-family: var(--font-display); font-weight: 900; font-stretch: 125%;
  font-size: var(--t-h2); letter-spacing: .01em; margin-bottom: var(--sp-3);
}
.div { border: 0; margin: 0 0 var(--sp-4); padding: 0; min-width: 0; }
.div__name {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 0; margin-bottom: var(--sp-2);
  font-size: var(--t-micro); font-weight: 600; letter-spacing: .04em; color: var(--text-lo);
}
.div__name::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

.tile {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  min-height: 132px; padding: 12px 4px 12px;
  border-radius: var(--radius-tile);
  background: var(--ink-800);
  border: 1px solid var(--hairline);
  text-align: center; cursor: pointer; user-select: none;
  transition: transform 90ms ease, background-color 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
/* THE LAMP: the filament along the bottom edge, in the team's own colour. */
.tile::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  border-radius: 2px; background: var(--team);
  box-shadow: 0 0 12px 0 var(--team);
}
.tile::before {
  /* the team's light pooling on the ground under the lamp */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(80% 60% at 50% 110%, color-mix(in srgb, var(--team) 26%, transparent), transparent 70%);
  opacity: .55;
}
.tile__radio { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tile__crest { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 6px; }
.tile__crest img { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.tile__abbr {
  font-family: var(--font-display); font-weight: 800; font-stretch: 118%;
  font-size: var(--t-abbr); line-height: 1; letter-spacing: .01em;
}
.tile__meta { margin-top: 5px; font-size: var(--t-micro); font-weight: 600; color: var(--text-mid); line-height: 1.2; }
.tile__kick { font-size: var(--t-micro); color: var(--text-lo); line-height: 1.2; margin-top: 2px; }
.tile__meta--cool { color: var(--cool); }

.tile--available:hover, .tile--selected:hover { background: var(--ink-700); }
.tile--available:hover::after { box-shadow: 0 0 20px 2px var(--team); }
.tile--available:active, .tile--selected:active { transform: scale(.97); }
.tile:has(.tile__radio:focus-visible) { outline: 2px solid var(--lamp); outline-offset: 2px; }

/* Chosen — by the server (selected) or by the radio right now (:checked). */
.tile--selected, .tile:has(.tile__radio:checked) {
  background: var(--ink-700);
  border-color: var(--team);
  box-shadow: 0 0 0 1px var(--team), 0 10px 36px -12px var(--team);
}
.tile--selected::after, .tile:has(.tile__radio:checked)::after { height: 3px; box-shadow: 0 0 22px 3px var(--team); }
.tile:has(.tile__radio:checked)::before { opacity: 1; }
.tile__flag {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--lamp); color: var(--ink-900);
  font-size: var(--t-micro); font-weight: 800;
}
.grid:has(.tile__radio:checked) .tile--selected:not(:has(.tile__radio:checked)) .tile__flag { background: var(--ink-600); color: var(--text-mid); }
.grid:has(.tile__radio:checked) .tile--selected:not(:has(.tile__radio:checked)) { border-color: var(--hairline); box-shadow: none; background: var(--ink-800); }

/* Spent: burned out. A dead bulb, not merely faint — no filament, cold, recessed. */
.tile--spent, .tile--bye, .tile--idle, .tile--unknown, .tile--locked { cursor: default; }
.tile--spent {
  background: var(--ink-850);
  border-color: rgba(43, 52, 71, .45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02), inset 0 -14px 24px -16px rgba(0,0,0,.9);
}
.tile--spent::after, .tile--spent::before { display: none; }
.tile--spent .tile__crest img { filter: grayscale(1) brightness(.42); opacity: .5; }
.tile--spent .tile__abbr { color: var(--text-lo); }
.tile__stamp {
  position: absolute; top: 8px; right: 8px;
  font-family: var(--font-display); font-weight: 900; font-stretch: 125%; font-size: .75rem;
  color: var(--text-lo); border: 1px solid var(--hairline); border-radius: 3px; padding: 1px 4px;
  transform: rotate(-6deg);
}
/* Bye: this week only, and it comes back. A hairline filament and a cool label. */
.tile--bye { background: var(--ink-850); }
.tile--bye::before { display: none; }
.tile--bye::after { height: 1px; background: var(--hairline); box-shadow: none; }
.tile--bye .tile__crest img { filter: grayscale(1) brightness(.6); opacity: .35; }
.tile--bye .tile__abbr { color: var(--text-mid); }
.tile--idle, .tile--unknown { background: var(--ink-850); }
.tile--idle::after, .tile--idle::before, .tile--unknown::before { display: none; }
.tile--unknown::after { height: 1px; background: var(--hairline); box-shadow: none; }
.tile--idle .tile__crest img, .tile--unknown .tile__crest img { filter: grayscale(1); opacity: .28; }
.tile--locked .tile__crest img { opacity: .8; }
.tile--locked::after { box-shadow: none; }

@media (max-width: 380px) {
  .tiles { gap: 6px; }
  .tile { min-height: 118px; padding: 10px 2px; }
  .tile__crest, .tile__crest img { width: 44px; height: 44px; }
}

/* The commit bar: sticks above the dock, names the action. */
.commit {
  grid-column: 1 / -1;
  position: sticky; bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 10px); z-index: 15;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 10px 10px 10px 16px;
  border-radius: 14px; border: 1px solid var(--hairline);
  background: rgba(16, 20, 30, .9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px -12px rgba(0,0,0,.8);
}
@media (min-width: 820px) { .commit { bottom: 16px; } }
.commit__now { font-size: var(--t-meta); color: var(--text-mid); }
.commit__now strong { color: var(--text-hi); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 0 20px; border-radius: 10px;
  border: 1px solid var(--hairline); background: var(--ink-700); color: var(--text-hi);
  font: 800 var(--t-body)/1 var(--font-display); font-stretch: 112%;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 90ms ease, box-shadow 200ms ease;
}
.btn:active { transform: scale(.97); }
.btn--lamp {
  background: linear-gradient(180deg, #ffc348, var(--lamp) 55%, #e8920c);
  border-color: #ffcf6e; color: #1a1204;
  box-shadow: 0 0 0 1px rgba(255,176,32,.25), 0 8px 26px -8px rgba(255,176,32,.7);
}
.btn--lamp:hover { color: #1a1204; box-shadow: 0 0 0 1px rgba(255,176,32,.4), 0 10px 32px -6px rgba(255,176,32,.9); }
.btn.is-bloom { animation: bloom 220ms ease-out; }
@keyframes bloom { 50% { box-shadow: 0 0 0 4px rgba(255,176,32,.35), 0 0 40px 4px rgba(255,176,32,.8); } }

/* ---- Week strip ---------------------------------------------------------------------------- */
.weekstrip {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)) var(--sp-5); padding: 2px var(--gutter);
}
.weekstrip::-webkit-scrollbar { display: none; }
.weekstrip__w {
  flex: 0 0 auto; display: grid; place-items: center; min-width: var(--tap); height: var(--tap);
  border-radius: 10px; border: 1px solid var(--hairline); background: var(--ink-850);
  color: var(--text-lo); text-decoration: none; font-weight: 800; font-variant-numeric: tabular-nums;
  font-family: var(--font-display); font-stretch: 118%;
}
.weekstrip__w--locked { color: var(--text-mid); background: var(--ink-800); }
.weekstrip__w--open { color: var(--lamp); border-color: rgba(255,176,32,.4); }
.weekstrip__w[aria-current="page"] { background: var(--lamp); border-color: var(--lamp); color: var(--ink-900); }

/* ---- The board: tickets, face down then face up ------------------------------------------- */
.board { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .board { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .board { grid-template-columns: 1fr 1fr 1fr; } }
.ticket {
  position: relative; overflow: hidden;
  border-radius: var(--radius-tile); border: 1px solid var(--hairline); background: var(--ink-800);
  padding: 12px 14px 14px;
}
.ticket--up::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--team, var(--lamp)); box-shadow: 0 0 18px 1px var(--team, var(--lamp));
}
.ticket--up::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 90% at 0% 100%, color-mix(in srgb, var(--team, var(--lamp)) 22%, transparent), transparent 70%);
}
.ticket--self { border-color: rgba(255,176,32,.45); }
.ticket__who { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ticket__name { font-weight: 700; }
.ticket__you {
  font-size: var(--t-micro); font-weight: 700; color: var(--lamp);
  border: 1px solid rgba(255,176,32,.4); border-radius: 999px; padding: 0 6px; margin-left: 4px; vertical-align: 2px;
}
.ticket__rank { color: var(--text-lo); font-size: var(--t-meta); font-variant-numeric: tabular-nums; }
.ticket__face { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.ticket__face .crest img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,.6)); display: block; }
.ticket__team { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ticket__abbr { font-family: var(--font-display); font-weight: 900; font-stretch: 118%; font-size: 1.5rem; line-height: 1; }
.ticket__opp { color: var(--text-mid); font-size: var(--t-meta); display: flex; flex-wrap: wrap; gap: 0 8px; }
.ticket__score { color: var(--text-hi); font-variant-numeric: tabular-nums; font-weight: 700; }
.ticket__status { color: var(--text-lo); }
.ticket__pts { text-align: right; }
.ticket__pending { color: var(--text-lo); font-size: 1.5rem; font-weight: 800; }
.ticket__live { color: var(--lamp-hot); font-weight: 800; font-size: var(--t-meta); }
.ticket__live::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--lamp-hot); box-shadow: 0 0 10px var(--lamp-hot); vertical-align: 1px; }
.ticket__auto { position: relative; margin-top: 10px; font-size: var(--t-meta); color: var(--text-mid); }
.ticket__face--none p { color: var(--text-lo); font-size: var(--t-meta); }
.chip { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: var(--t-micro); font-weight: 800; margin-right: 6px; vertical-align: 1px; }
.chip--auto { background: rgba(255,176,32,.14); color: var(--lamp); border: 1px solid rgba(255,176,32,.4); }

/* The back of a ticket: a cool hatch, the card face down. */
.ticket--down { background:
  repeating-linear-gradient(45deg, rgba(76,124,243,.10) 0 1px, transparent 1px 9px), var(--ink-800); }
.ticket__back { min-height: 64px; display: flex; align-items: center; }
.ticket__state { font-size: var(--t-meta); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.ticket__state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.ticket__state--in { color: var(--text-hi); }
.ticket__state--in::before { background: var(--cool); box-shadow: 0 0 10px var(--cool); }
.ticket__state--out { color: var(--text-lo); }
.ticket__state--out::before { border: 1px solid var(--text-lo); }

/* THE REVEAL. Played once per newly-locked week (JS adds .is-revealing and remembers it).
   Without JS or with reduced motion, the board simply renders face up — complete either way. */
.board.is-revealing .ticket--up {
  animation: flip 620ms var(--ease-out) both;
  animation-delay: calc(var(--i) * 90ms + 250ms);
  transform-origin: 50% 0;
}
.board.is-revealing .ticket--up::after { animation: flood 500ms ease-out both; animation-delay: calc(var(--i) * 90ms + 650ms); transform-origin: left; }
.board.is-revealing .ticket--up .crest { animation: crestIn 520ms var(--ease-out) both; animation-delay: calc(var(--i) * 90ms + 520ms); }
@keyframes flip {
  0% { transform: perspective(900px) rotateX(-92deg); opacity: 0; background:
    repeating-linear-gradient(45deg, rgba(76,124,243,.18) 0 1px, transparent 1px 9px), var(--ink-800); }
  60% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@keyframes flood { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes crestIn { from { transform: scale(.82); opacity: 0; filter: brightness(2.2); } to { transform: none; opacity: 1; filter: none; } }
.reveal-banner {
  margin-bottom: var(--sp-4); padding: 10px 14px; border-radius: var(--radius-panel);
  border: 1px solid rgba(255,176,32,.5); color: var(--lamp); font-weight: 800;
  background: linear-gradient(90deg, rgba(255,176,32,.16), transparent);
}

/* ---- Ladder -------------------------------------------------------------------------------- */
.lead { display: flex; flex-direction: column; gap: 4px; }
.lead__k { color: var(--text-mid); font-size: var(--t-meta); font-weight: 600; }
.lead__name { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: var(--t-h1); line-height: 1.05; }
.hero--ladder, .hero--me { grid-template-columns: 1fr; }
.lead--empty .hero__sub { max-width: 62ch; }

.ladder { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.rung {
  position: relative;
  display: grid; align-items: center;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  grid-template-areas: "rank who total" "move spark total";
  gap: 6px 12px;
  padding: 14px 4px 14px 0;
  border-bottom: 1px solid var(--hairline);
}
@media (min-width: 720px) {
  .rung { grid-template-columns: 3rem minmax(0, 1fr) 220px 8rem; grid-template-areas: "rank who spark total" "move who spark total"; padding: 14px 8px 14px 0; row-gap: 0; }
}
.rung__rank { grid-area: rank; font-family: var(--font-display); font-weight: 900; font-stretch: 118%; font-size: var(--t-h2); text-align: right; font-variant-numeric: tabular-nums; color: var(--text-mid); }
.rung__move { grid-area: move; font-size: var(--t-micro); font-weight: 700; justify-self: end; align-self: start; }
.move { display: inline-flex; align-items: center; gap: 1px; font-variant-numeric: tabular-nums; }
.move .ico { width: 14px; height: 14px; stroke-width: 2.6; }
.move--up { color: var(--lamp); }
.move--down { color: var(--text-lo); }
.move--new { color: var(--cool); }
.rung__who { grid-area: who; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rung__name { font-weight: 700; font-size: 1.0625rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rung__hand { color: var(--text-lo); font-size: var(--t-micro); font-weight: 600; letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rung__left { margin-left: 8px; color: var(--text-mid); }
.rung__spark { grid-area: spark; line-height: 0; }
.rung__spark .spark { width: 100%; max-width: 143px; height: auto; }
@media (min-width: 720px) { .rung__spark .spark { max-width: 220px; } }
.rung__total { grid-area: total; text-align: right; }
.rung--me { background: linear-gradient(90deg, rgba(255,176,32,.08), transparent 60%); }
.rung--me::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 2px; background: var(--lamp); box-shadow: 0 0 10px var(--lamp); }
.rung--lead .rung__rank { color: var(--lamp); }
.rung--lead .rec { font-size: clamp(2.2rem, 8vw, 3.5rem); }

.spark { display: block; max-width: 100%; height: auto; overflow: visible; }
.spark__zero { stroke: var(--hairline); stroke-width: 1; }
.spark__slot { stroke: var(--ink-600); stroke-width: 1; }
.spark__tie { fill: var(--text-lo); }
.spark__bar--pos { fill: var(--lamp); }
.spark__bar--neg { fill: var(--loss); }

.ladder__key { margin-top: var(--sp-4); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; color: var(--text-lo); font-size: var(--t-micro); }
.key { display: inline-block; width: 6px; height: 12px; border-radius: 1px; margin-right: 4px; vertical-align: -2px; }
.key--pos { background: var(--lamp); }
.key--neg { background: var(--loss); }
.key--tie { width: 5px; height: 5px; border-radius: 50%; background: var(--text-lo); vertical-align: 1px; }

/* Rank movement: after a newly-scored week, rows slide once from where they were. */
.ladder.is-moving .rung { animation: rise 460ms ease-out both; animation-delay: calc(var(--i) * 40ms); }
@keyframes rise { from { transform: translateY(calc(var(--move) * 100%)); } to { transform: none; } }

/* ---- Me ------------------------------------------------------------------------------------ */
.sect { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: var(--t-h2); margin: var(--sp-6) 0 var(--sp-3); display: flex; align-items: baseline; gap: 12px; }
.sect__aside { font-family: var(--font-ui); font-weight: 600; font-stretch: 100%; font-size: var(--t-meta); color: var(--text-mid); }
.weeks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.wrow { display: grid; grid-template-columns: 2.4rem 40px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.wrow__n { font-family: var(--font-display); font-weight: 900; font-stretch: 118%; color: var(--text-lo); text-align: right; font-variant-numeric: tabular-nums; }
.wrow__crest img { width: 36px; height: 36px; object-fit: contain; display: block; }
.wrow__team { font-size: var(--t-meta); color: var(--text-mid); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.wrow__team strong { color: var(--text-hi); font-family: var(--font-display); font-stretch: 118%; font-size: 1rem; }
.wrow__team--future, .wrow__team--none { color: var(--text-lo); }
.wrow__score { color: var(--text-hi); font-variant-numeric: tabular-nums; }
.wrow__pts .pts { font-size: 1.5rem; }
.wrow--done { box-shadow: inset 3px 0 0 var(--team); }

.minis { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0,1fr)); gap: 6px; }
@media (max-width: 560px) { .minis { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.mini { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 10px; border-radius: 8px; background: var(--ink-800); border: 1px solid var(--hairline); }
.mini::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--team); box-shadow: 0 0 8px var(--team); border-radius: 2px; }
.mini img { width: 32px; height: 32px; object-fit: contain; }
.mini__abbr { font-family: var(--font-display); font-weight: 800; font-stretch: 118%; font-size: .8125rem; }
.mini--spent { background: var(--ink-850); }
.mini--spent::after { display: none; }
.mini--spent img { filter: grayscale(1) brightness(.42); opacity: .5; }
.mini--spent .mini__abbr { color: var(--text-lo); }
.mini__wk { position: absolute; top: 3px; right: 4px; font-size: .625rem; font-weight: 800; color: var(--text-lo); }

/* ---- Empty states and the gate ------------------------------------------------------------- */
.empty { padding: var(--sp-6) var(--sp-4); border: 1px dashed var(--hairline); border-radius: var(--radius-panel); color: var(--text-mid); }
.empty h1, .empty h2 { color: var(--text-hi); font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: var(--t-h2); margin-bottom: 6px; }
.empty p + p { margin-top: var(--sp-4); }
.empty--page { margin-top: var(--sp-7); max-width: 56ch; }
.empty__code { font-family: var(--font-display); font-weight: 900; font-stretch: 125%; font-size: 4rem; line-height: 1; color: var(--ink-600); }

.is-signin { padding-bottom: 0; }
.gate { min-height: 86vh; display: flex; flex-direction: column; justify-content: center; max-width: 34rem; margin: 0 auto; }
.gate__lights { display: flex; gap: 10px; margin-bottom: var(--sp-5); }
.gate__lights i { width: 26px; height: 8px; border-radius: 2px; background: var(--lamp); box-shadow: 0 0 18px 2px rgba(255,176,32,.7); }
.gate__word {
  font-family: var(--font-display); font-weight: 900; font-stretch: 125%; text-transform: uppercase;
  /* 12vw, not 16vw: at 125% stretch "SURVIVOR" overflowed a 390px phone and read "SURVIVO". */
  font-size: clamp(2.5rem, 12vw, 6rem); line-height: .85; letter-spacing: -.035em;
  padding-right: .08em; /* same background-clip edge as the week numeral */
  background: linear-gradient(180deg, #fff 0%, #ffe2a6 50%, #b7832a 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 8px 40px rgba(255,176,32,.25));
}
.gate__tag { margin-top: var(--sp-3); font-size: 1.125rem; color: var(--text-hi); font-weight: 600; }
.gate .notice { margin-top: var(--sp-5); }
.gate__how { margin-top: var(--sp-6); padding: var(--sp-5); border: 1px solid var(--hairline); border-radius: var(--radius-panel); background: var(--ink-800); color: var(--text-mid); }
.gate__how h2 { color: var(--text-hi); font-size: 1.0625rem; margin-bottom: 8px; }
.gate__how p + p { margin-top: 10px; }

/* ---- Standings: record first, margin breaks ties (John, 2026-10-09) ------------------- */
.rec {
  display: block; font-family: var(--font-display); font-weight: 900; font-stretch: 118%;
  font-size: var(--t-score); line-height: .92; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: var(--text-hi); white-space: nowrap;
}
.rung--lead .rec { color: var(--lamp); }
.rung__margin { display: block; margin-top: 3px; font-size: var(--t-meta); color: var(--text-mid); white-space: nowrap; }
.rung__margin .pts { font-size: 1rem; letter-spacing: 0; }
.mega--rec { color: var(--lamp); text-shadow: 0 0 42px rgba(255, 176, 32, .35); }
.lead__line { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.lead__margin .pts { font-size: var(--t-score); }

/* ---- Real-time scoring ---------------------------------------------------------------- */
/* LIVE is always spelled out beside a provisional number: never colour or motion alone. */
.livetag {
  display: inline-flex; align-items: center; gap: 6px; vertical-align: 1px;
  font-size: var(--t-micro); font-weight: 800; letter-spacing: .04em; color: var(--lamp-hot);
}
.livetag::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lamp-hot);
  box-shadow: 0 0 10px var(--lamp-hot); animation: livepulse 1.6s ease-in-out infinite;
}
.livetag--under { display: flex; justify-content: flex-end; margin-top: 4px; }
@keyframes livepulse { 50% { opacity: .35; } }
.ticket__pts .pts:has(+ .livetag) { opacity: .92; }
.rung__live { display: block; margin-top: 2px; font-size: var(--t-meta); color: var(--text-mid); white-space: nowrap; }
.rung__live .num { font-weight: 800; font-family: var(--font-display); font-stretch: 118%; }
.notice--live { border-left-color: var(--lamp-hot); color: var(--text-mid); }
.is-changed { animation: changed 1.4s ease-out; border-radius: 3px; }
@keyframes changed { 0% { background: rgba(255,122,26,.35); } 100% { background: transparent; } }

/* ---- Motion: the reduced path is the complete experience --------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
