/* ==========================================================================
   Backboard — "Street Zine" design system
   --------------------------------------------------------------------------
   A photocopied street zine: black ground, torn white paper sheets with ink
   text, tape, red and yellow scraps, Anton headlines with a red torn
   highlight, typewriter tables, and the Limelight nav across the top.
   Ported from the style lab (design/backboard-demos/street-zine) into the
   live app; see web/DESIGN-BRIEF.md for the rules.

   Contract notes
   * Torn edges are SVG filters (#tear-a/b/c/edge) defined once in
     index.html and applied only to pseudo-elements, so text, numbers and
     focus rings are never displaced.
   * Colors are tokens. A paper sheet (.card and friends) re-declares the
     text/line/surface tokens, so every component, chart and inline
     var(--…) reads ink-on-paper inside a sheet and chalk-on-black outside.
   * Legacy token names (--text-primary, --accent, --positive, …) are kept as
     aliases because page modules reference a few of them inline.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* ---- Zine palette -------------------------------------------------------- */
  --ground: #141414;
  --ground-2: #0e0e0e;
  --paper: #f3f1ea;         /* the white you see at a torn edge */
  --paper-2: #e4e1d8;
  --sheet: #fbfaf6;         /* the face of a content sheet */
  --ink: #101010;
  --red: #ee3a1f;
  --red-ink: #c4241a;       /* red that reads as text on paper (5.6:1) */
  --yellow: #f3e32a;

  /* ---- Fonts --------------------------------------------------------------- */
  --f-head: "Anton", Impact, "Arial Narrow", sans-serif;
  --f-body: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --f-type: "Courier Prime", "Courier New", monospace;
  --f-pen: "Reenie Beanie", "Segoe Print", cursive;
  --f-rans: "Abril Fatface", Georgia, serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --glow: var(--red);
  --tap: 44px;
  --head-h: 92px;           /* room for the fixed nav */

  --fiber: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .32 0 0 0 0 .28 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --halftone:
    radial-gradient(circle, var(--dot, rgba(16, 16, 16, 0.22)) 0 1.5px, transparent 1.9px) 0 0 / 7px 7px,
    radial-gradient(circle, var(--dot, rgba(16, 16, 16, 0.22)) 0 1.5px, transparent 1.9px) 3.5px 3.5px / 7px 7px;

  /* ---- Semantic tokens: on the black ground -------------------------------- */
  --fg: #ecebe5;
  --fg-2: #c9c7bf;
  --fg-3: #a5a49d;
  --line: rgba(236, 235, 229, 0.22);
  --line-strong: #ecebe5;
  --surface: #1c1c1c;
  --surface-2: #262626;
  --field-bg: #0e0e0e;
  --field-line: #ecebe5;
  --pos: #5fd68f;
  --neg: #ff6a4d;
  --chart-grid: rgba(236, 235, 229, 0.14);
  --chart-axis: rgba(236, 235, 229, 0.4);
  --chart-base: #a5a49d;
  --chart-accent: #ee3a1f;
  --chart-surface: #141414;

  /* ---- Legacy aliases (page modules reference a few inline) --------------- */
  --text-primary: var(--fg);
  --text-secondary: var(--fg-2);
  --text-muted: var(--fg-3);
  --border: var(--line);
  --accent: var(--red);
  --positive: var(--pos);
  --negative: var(--neg);
  --warning: var(--yellow);

  font-family: var(--f-body);
}

/* Halftone resolves --dot where it is declared, so every element that sets
   its own dot color re-declares the recipe. */
.result-team,
.card.team-hero,
.torn-photo-image {
  --halftone:
    radial-gradient(circle, var(--dot, rgba(16, 16, 16, 0.22)) 0 1.5px, transparent 1.9px) 0 0 / 7px 7px,
    radial-gradient(circle, var(--dot, rgba(16, 16, 16, 0.22)) 0 1.5px, transparent 1.9px) 3.5px 3.5px / 7px 7px;
}

/* A paper sheet: ink text, ink lines, paper surfaces. Every token a component
   reads is re-declared here, so the same component works on either ground. */
.card,
.paper {
  --fg: var(--ink);
  --fg-2: #3b3934;
  --fg-3: #5d5a52;
  --line: rgba(16, 16, 16, 0.24);
  --line-strong: var(--ink);
  --surface: #f0ede4;
  --surface-2: #e6e2d6;
  --field-bg: #fffdf8;
  --field-line: var(--ink);
  --pos: #11795a;
  --neg: #c4241a;
  --chart-grid: rgba(16, 16, 16, 0.12);
  --chart-axis: rgba(16, 16, 16, 0.45);
  --chart-base: #6e6a60;
  --chart-accent: #e2361b;
  --chart-surface: var(--sheet);
  --text-primary: var(--fg);
  --text-secondary: var(--fg-2);
  --text-muted: var(--fg-3);
  --border: var(--line);
  --positive: var(--pos);
  --negative: var(--neg);
  --warning: #8a6a00;
  color: var(--fg);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head-h) + 12px);
  scrollbar-color: var(--red) var(--ground);
  background: var(--ground);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--fg);
  font: 400 1rem/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  caret-color: var(--red);
}

h1, h2, h3, h4, p, figure { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--f-type); font-size: 0.92em; }
::selection { background: var(--red); color: var(--ink); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.card :focus-visible, .paper :focus-visible { outline-color: var(--ink); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.num,
.stat-value,
.compare-values,
.prob-bar-labels,
.data-table { font-variant-numeric: tabular-nums lining-nums; }

.tear-defs { position: absolute; width: 0; height: 0; }

/* --------------------------------------------------------------------------
   Shell: brand + Limelight nav (fixed), page head, content, footer
   -------------------------------------------------------------------------- */

.zhead {
  position: fixed;
  z-index: 60;
  top: 12px;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0 clamp(12px, 3vw, 40px);
  pointer-events: none;
}

.zhead > * { pointer-events: auto; }

.zbrand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.8rem 0.3rem 0.5rem;
  background: var(--ground-2);
  border: 2px solid var(--paper);
  color: var(--paper);
  text-decoration: none;
  font: 400 1.35rem/1 var(--f-head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.zbrand svg { width: 28px; height: 28px; }

.zstatus {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  padding: 0.35rem 0.7rem;
  background: var(--ground-2);
  border: 2px solid var(--paper);
  font: 700 0.72rem/1.2 var(--f-type);
  text-transform: uppercase;
  color: var(--paper);
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--fg-3);
}

.status-dot.ok { background: #5fd68f; box-shadow: 0 0 0 3px rgba(95, 214, 143, 0.2); }
.status-dot.error { background: var(--red); box-shadow: 0 0 0 3px rgba(238, 58, 31, 0.25); }

.zn {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 64px;
  padding: 0 6px;
  background: var(--ground-2);
  border: 2px solid var(--paper);
  clip-path: polygon(0 4%, 2% 0, 98% 3%, 100% 0, 100% 96%, 98% 100%, 2% 97%, 0 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.zi {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  min-width: 58px;
  padding: 0 9px;
  background: none;
  border: 0;
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
}

.zi svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.45;
  transition: opacity 0.1s ease-in-out;
}

.zi span {
  font: 800 0.6rem/1 var(--f-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.45;
  transition: opacity 0.1s ease-in-out;
}

.zi:hover svg, .zi:hover span,
.zi[aria-current="page"] svg, .zi[aria-current="page"] span,
.zi[aria-expanded="true"] svg, .zi[aria-expanded="true"] span { opacity: 1; }
.zi[aria-current="page"] { color: var(--glow); }
.zi:focus-visible { outline-offset: -4px; }

.zlime {
  position: absolute;
  top: 0;
  z-index: 1;
  left: -999px;
  width: 44px;
  height: 5px;
  border-radius: 99px;
  background: var(--glow);
}

.zlime.ready { transition: left 0.4s ease-in-out; }

.zlime::after {
  content: "";
  position: absolute;
  left: -30%;
  top: 5px;
  width: 160%;
  height: 56px;
  clip-path: polygon(5% 100%, 25% 0, 75% 0, 95% 100%);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--glow) 38%, transparent), transparent);
  pointer-events: none;
}

/* "More": the pages that do not fit on the bar, on a torn paper slip. */
.zmore-wrap { position: relative; height: 100%; }

.zmenu {
  position: fixed;
  z-index: 70;
  top: calc(12px + 64px + 10px);
  min-width: 230px;
  padding: 0.6rem;
  list-style: none;
  margin: 0;
  background: var(--sheet);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.6);
  clip-path: polygon(0 1%, 4% 0, 96% 1.5%, 100% 0, 100% 99%, 96% 100%, 4% 98.5%, 0 100%);
}

.zmenu[hidden] { display: none; }

.zmenu a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--tap);
  padding: 0.3rem 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font: 700 0.86rem var(--f-type);
  text-transform: uppercase;
}

.zmenu a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.zmenu a:hover { background: var(--yellow); }
.zmenu a[aria-current="page"] { background: var(--red); }

/* Page head: kicker, the big title with one torn red word, the lede. */
.app-main { position: relative; z-index: 1; min-height: 100vh; overflow-x: clip; }

.phead {
  position: relative;
  max-width: 1320px;
  margin: 0 auto;
  padding: calc(var(--head-h) + clamp(2.6rem, 6vw, 4.6rem)) clamp(16px, 4vw, 52px) clamp(2.4rem, 5vw, 3.6rem);
}

.phead[hidden] { display: none; }

.phead .kicker-line {
  margin-bottom: 0.9rem;
  font: 700 0.95rem var(--f-type);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--yellow);
}

.phead h1,
.h2 {
  font: 400 clamp(3rem, 8vw, 7rem)/0.9 var(--f-head);
  text-transform: uppercase;
  letter-spacing: 0.005em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.hl {
  position: relative;
  isolation: isolate;
  display: inline-block;
  padding: 0 0.14em;
  color: var(--paper);
}

.hl::before {
  content: "";
  position: absolute;
  inset: 0.04em -0.06em -0.02em;
  z-index: -1;
  background-color: var(--red);
  background-image: var(--fiber);
  background-blend-mode: multiply;
  filter: url(#tear-b);
}

.phead .lede {
  margin-top: 1.1rem;
  max-width: 52ch;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  font-weight: 600;
}

.app-content {
  position: relative;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 52px) 5rem;
}

.app-content > * + * { margin-top: 2.4rem; }
.app-content > :empty { margin-top: 0; }

.zfoot {
  position: relative;
  z-index: 3;
  padding: 2.2rem 0 3.5rem;
  color: var(--fg-3);
  font-size: 0.9rem;
  border-top: 1px dashed var(--line);
}

.zfoot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 52px);
}

/* --------------------------------------------------------------------------
   Torn paper
   -------------------------------------------------------------------------- */

/* Sheet: a white fibrous rim under a paper face, both with rough edges. */
.card,
.scrap {
  position: relative;
  isolation: isolate;
  padding: 1.9rem 2rem 2.1rem;
  --face: var(--sheet);
}

.card::before,
.card::after,
.scrap::before,
.scrap::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.card::before,
.scrap::before {
  inset: -6px;
  z-index: -2;
  background-color: var(--paper);
  background-image: var(--fiber);
  filter: url(#tear-a);
}

.card::after,
.scrap::after {
  inset: var(--rim, 5px);
  z-index: -1;
  background-color: var(--face);
  background-image: var(--fiber);
  background-blend-mode: multiply;
  filter: url(#tear-b);
}

.card:nth-of-type(3n + 2)::before { filter: url(#tear-c); }
.card:nth-of-type(3n + 2)::after { filter: url(#tear-a); }
.card:nth-of-type(3n)::before { filter: url(#tear-b); }
.card:nth-of-type(3n)::after { filter: url(#tear-c); }

.tape {
  position: absolute;
  z-index: 4;
  width: 116px;
  height: 32px;
  background: rgba(243, 241, 234, 0.62);
  background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0 2px, transparent 2px 7px);
  transform: rotate(var(--tr, -4deg));
  clip-path: polygon(1% 0, 99% 0, 100% 14%, 97% 28%, 100% 42%, 97% 56%, 100% 70%, 97% 84%, 99% 100%, 1% 100%, 0 84%, 3% 70%, 0 56%, 3% 42%, 0 28%, 3% 14%);
  pointer-events: none;
}

.tape.y { background-color: rgba(243, 227, 42, 0.86); }

/* --------------------------------------------------------------------------
   Sheet headers, section titles, text
   -------------------------------------------------------------------------- */

.card-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.3rem;
  padding-bottom: 0.9rem;
  border-bottom: 3px solid var(--line-strong);
}

.card-header h2 {
  font: 400 clamp(1.9rem, 3.4vw, 2.7rem)/0.95 var(--f-head);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.card-subtitle {
  margin-top: 0.45rem;
  max-width: 78ch;
  font-size: 0.95rem;
  color: var(--fg-2);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
  font: 400 1.35rem/1.05 var(--f-head);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.section-title::after {
  content: "";
  flex: 1;
  min-width: 1.5rem;
  border-top: 2px dashed var(--line);
}

.text-muted { color: var(--fg-2); }
.mt-1 { margin-top: 0.7rem; }
.mt-2 { margin-top: 1.3rem; }

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.3rem 1.8rem;
}

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}

.plain-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.95rem;
  color: var(--fg-2);
}

.plain-list li + li { margin-top: 0.35rem; }
.model-insight { font-size: 0.98rem; line-height: 1.6; }

.feature-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

/* The handwritten word in a headline. Never numbers. */
.scrawl {
  display: inline-block;
  margin: 0 0.15em;
  font: 400 0.8em/1 var(--f-pen);
  text-transform: lowercase;
  color: var(--red-ink);
  transform: rotate(-4deg) translateY(-0.06em);
}

.hl-mark {
  background: linear-gradient(transparent 12%, var(--yellow) 12% 88%, transparent 88%);
  padding: 0 0.12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.hl-team {
  background: var(--team-color, var(--ink));
  color: var(--team-ink, var(--paper));
  padding: 0 0.14em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.tabloid-headline {
  font: 400 clamp(2.4rem, 6vw, 4.8rem)/0.92 var(--f-head);
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.deck {
  margin-top: 0.9rem;
  max-width: 62ch;
  font-size: 1.1rem;
  line-height: 1.45;
  font-weight: 600;
}

.deck strong { font-weight: 800; font-variant-numeric: tabular-nums; }

.kicker {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  background: var(--ink);
  color: var(--paper);
  font: 700 0.85rem var(--f-type);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clipping-masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.9rem;
  padding-bottom: 0.7rem;
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--ink);
}

.clipping-meta {
  font: 700 0.82rem var(--f-type);
  text-transform: uppercase;
  color: var(--fg-2);
}

/* Rubber stamp: only for a state the data said. */
.stamp {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border: 5px solid currentColor;
  color: var(--red-ink);
  background: rgba(255, 255, 255, 0.25);
  font: 400 clamp(1.3rem, 2.6vw, 1.9rem)/1 var(--f-head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  mix-blend-mode: multiply;
}

.stamp--tilt {
  --stamp-tilt: -5deg;
  transform: rotate(var(--stamp-tilt));
  animation: stamp-thunk 0.34s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.stamp--ink { color: var(--ink); }

@keyframes stamp-thunk {
  0% { transform: rotate(var(--stamp-tilt, -5deg)) scale(1.7); opacity: 0; }
  70% { transform: rotate(var(--stamp-tilt, -5deg)) scale(0.95); opacity: 1; }
  100% { transform: rotate(var(--stamp-tilt, -5deg)) scale(1); }
}

/* --------------------------------------------------------------------------
   Clippings: headline scraps (yellow), with tape
   -------------------------------------------------------------------------- */

.card.clipping { --face: var(--yellow); padding: 2.2rem 2rem 2.2rem; }
.card.clipping .clipping-meta { color: rgba(16, 16, 16, 0.78); }
.card.clipping .stamp { mix-blend-mode: multiply; }
.card.clipping .link-btn { color: var(--ink); }

.front-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 1.2rem 2.2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .front-page-grid { grid-template-columns: minmax(0, 1fr); }
}

.front-page-lead { min-width: 0; }
.front-page-tag { margin: 0.1rem 0 1.2rem 0.3rem; }
.front-page .tabloid-headline { font-size: clamp(2.8rem, 7vw, 5.6rem); }
.front-page .deck code { background: rgba(16, 16, 16, 0.1); padding: 0 0.3em; }
.front-page--alert { --face: var(--red); }

.front-page-teasers { display: grid; gap: 0.9rem; }

.teaser {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: var(--tap);
  padding: 0.75rem 0.95rem 0.85rem;
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid var(--ink);
  color: var(--ink);
}

.teaser[data-team-link] { cursor: pointer; }
.teaser[data-team-link]:hover { background: var(--sheet); }
.teaser-kicker { font: 700 0.82rem var(--f-type); text-transform: uppercase; color: var(--red-ink); }
.teaser-team { font: 400 1.5rem/1.05 var(--f-head); text-transform: uppercase; }
.teaser-stat { font-size: 0.95rem; }
.teaser-stat strong { font-weight: 800; font-variant-numeric: tabular-nums; }
.clipping-fineprint { margin-top: 0.9rem; font-size: 0.88rem; color: rgba(16, 16, 16, 0.78); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 0.35rem; }

.field label {
  font: 800 0.78rem var(--f-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.select,
.input {
  width: 100%;
  min-height: 50px;
  padding: 0.45rem 0.9rem;
  background: var(--field-bg);
  color: var(--fg);
  border: 2px solid var(--field-line);
  border-radius: 0;
  font: 700 1rem var(--f-body);
  appearance: none;
}

.select { padding-right: 2.4rem; cursor: pointer; }
.select:hover, .input:hover { border-color: var(--red); }
.select:focus, .input:focus { outline: none; border-color: var(--red); box-shadow: 4px 4px 0 var(--yellow); }
.select:focus-visible, .input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.card .select:focus-visible, .card .input:focus-visible { outline-color: var(--ink); }
.select option { background: var(--field-bg); color: var(--fg); }
textarea.input { min-height: 0; resize: vertical; font: 400 0.9rem/1.45 var(--f-type); }
input[type="date"].input::-webkit-calendar-picker-indicator { cursor: pointer; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--red); }
.range { width: 100%; min-height: var(--tap); accent-color: var(--red); }

.select-wrap { position: relative; }

.select-wrap::after {
  content: "";
  position: absolute;
  right: 0.9rem;
  top: 50%;
  width: 13px;
  height: 8px;
  margin-top: -4px;
  background: var(--fg);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
}

.compact-field { min-width: 150px; }
.compact-field .select, .compact-field .input { min-height: 44px; padding-top: 0.35rem; padding-bottom: 0.35rem; }

/* --------------------------------------------------------------------------
   Buttons, chips, tabs
   -------------------------------------------------------------------------- */

.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0.7rem 1.5rem 0.65rem;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  font: 400 1.3rem/1 var(--f-head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 0.2s var(--ease);
}

.btn::before {
  content: "";
  position: absolute;
  inset: -4px;
  z-index: -2;
  background-color: var(--paper);
  background-image: var(--fiber);
  filter: url(#tear-a);
}

.btn::after {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: -1;
  background: var(--red);
  filter: url(#tear-b);
}

.card .btn::before { background-color: var(--ink); background-image: none; }
.btn:hover { transform: translateY(-3px) rotate(-1deg); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn:disabled, .btn:disabled:hover { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }

/* Secondary buttons and tabs: torn paper labels. */
.btn.btn-secondary {
  min-height: 44px;
  padding: 0.35rem 1rem;
  font: 700 0.86rem var(--f-type);
  letter-spacing: 0.02em;
  background: rgba(243, 241, 234, 0.92);
  color: var(--ink);
  clip-path: polygon(0 8%, 3% 0, 97% 6%, 100% 0, 100% 92%, 97% 100%, 3% 94%, 0 100%);
}

.card .btn.btn-secondary { background: var(--surface-2); }
.btn.btn-secondary::before, .btn.btn-secondary::after { content: none; }
.btn.btn-secondary:hover { background: var(--yellow); transform: none; }

.tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.4rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--line-strong);
}

/* A tab is a torn label; the selected one is red (the btn without -secondary). */
.tab-strip .btn,
.tab-strip .btn.btn-secondary {
  min-height: 44px;
  padding: 0.35rem 1rem;
  font: 700 0.86rem var(--f-type);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  clip-path: polygon(0 8%, 3% 0, 97% 6%, 100% 0, 100% 92%, 97% 100%, 3% 94%, 0 100%);
  transform: rotate(var(--r, 0deg));
}

.tab-strip .btn { background: var(--red); color: var(--ink); }
.tab-strip .btn::before, .tab-strip .btn::after { content: none; }
.tab-strip .btn:nth-child(2n) { --r: 0.8deg; }
.tab-strip .btn:nth-child(3n) { --r: -0.7deg; }
.tab-strip .btn.btn-secondary { background: var(--surface-2); }
.tab-strip .btn.btn-secondary:hover { background: var(--yellow); }

.link-btn {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.2rem 0;
  background: none;
  border: 0;
  color: var(--fg);
  cursor: pointer;
  font: 800 0.86rem var(--f-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--red);
  text-underline-offset: 0.3em;
}

.link-btn:hover { color: var(--red); }
.card .link-btn:hover { color: var(--red-ink); }

.icon-btn {
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0.3rem;
  background: transparent;
  border: 2px solid transparent;
  color: var(--fg-2);
  cursor: pointer;
}

.icon-btn:hover { border-color: var(--fg); color: var(--fg); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; }

.predict-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.2rem;
  margin-top: 1.4rem;
}

.swap-btn {
  min-height: var(--tap);
  padding: 0.3rem 1rem;
  background: transparent;
  border: 2px solid currentColor;
  color: var(--fg);
  cursor: pointer;
  font: 800 0.78rem var(--f-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.swap-btn:hover { border-color: var(--red); color: var(--red-ink); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 34px;
  padding: 0.25rem 0.8rem;
  background: var(--surface-2);
  color: var(--fg);
  border: 0;
  font: 700 0.82rem var(--f-type);
  text-transform: uppercase;
  clip-path: polygon(0 8%, 3% 0, 97% 6%, 100% 0, 100% 92%, 97% 100%, 3% 94%, 0 100%);
}

.chip strong { font-weight: 700; }
.chip-btn { cursor: pointer; min-height: var(--tap); }
.chip-btn:hover { background: var(--yellow); color: var(--ink); }
.quick-picks .chip, .app-content > .card .chip { background: var(--surface-2); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.45rem;
  border: 2px solid var(--fg);
  color: var(--fg);
  font: 700 0.72rem var(--f-type);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.positive { background: var(--ink); border-color: var(--ink); color: var(--yellow); }
.badge.accent { background: var(--red); border-color: var(--red); color: var(--ink); }

.team-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem 0.06rem;
  background: var(--team-color, var(--surface-2));
  color: var(--team-ink, var(--fg));
  font: 400 1rem/1.15 var(--f-head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

/* Segmented toggles (views, season type): a row of torn labels. */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; }

.seg {
  min-height: 40px;
  padding: 0.3rem 0.85rem;
  background: var(--surface-2);
  border: 0;
  color: var(--fg);
  cursor: pointer;
  font: 700 0.8rem var(--f-type);
  text-transform: uppercase;
  clip-path: polygon(0 10%, 4% 0, 96% 7%, 100% 0, 100% 90%, 96% 100%, 4% 93%, 0 100%);
}

.seg:hover { background: var(--yellow); color: var(--ink); }
.seg.is-on { background: var(--ink); color: var(--paper); }
.seg:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

details.collapsible summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--tap);
  cursor: pointer;
  list-style: none;
  font: 800 0.95rem var(--f-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

details.collapsible summary::-webkit-details-marker { display: none; }

details.collapsible summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: var(--red);
  color: var(--ink);
  font: 400 1.2rem/1 var(--f-head);
}

details.collapsible[open] summary::before { content: "\2013"; }
details.collapsible summary:hover { color: var(--red-ink); }
details.collapsible[open] summary { margin-bottom: 0.9rem; }

/* --------------------------------------------------------------------------
   States: loading, empty, errors, notes, callouts
   -------------------------------------------------------------------------- */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid rgba(16, 16, 16, 0.25);
  border-top-color: var(--ink);
  animation: spin 0.7s linear infinite;
}

.spinner-dark { border-color: var(--line); border-top-color: var(--red); }

@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.empty-state {
  padding: 2.4rem 1rem;
  text-align: center;
  border: 2px dashed var(--line);
  font: 700 0.92rem var(--f-type);
  text-transform: uppercase;
  color: var(--fg-2);
}

.error-banner {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 1rem 1.2rem;
  color: var(--ink);
  font: 700 0.92rem/1.5 var(--f-type);
  text-transform: uppercase;
}

.error-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--red);
  background-image: var(--fiber);
  background-blend-mode: multiply;
  filter: url(#tear-b);
}

.info-banner {
  position: relative;
  isolation: isolate;
  display: flex;
  gap: 0.8rem;
  padding: 1.3rem 1.4rem 1.2rem;
  color: var(--ink);
}

.info-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--yellow);
  background-image: var(--fiber);
  background-blend-mode: multiply;
  filter: url(#tear-c);
}

.scouting-note { flex-direction: column; gap: 0.3rem; }

.note-label {
  font: 400 1.35rem/1 var(--f-head);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.info-banner .model-insight { font: 700 0.95rem/1.55 var(--f-type); text-transform: uppercase; }

.callout {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem 1.1rem;
  margin: 1rem 0 1.3rem;
  padding: 1rem 1.2rem;
  color: var(--ink);
}

.callout::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--yellow);
  background-image: var(--fiber);
  background-blend-mode: multiply;
  filter: url(#tear-a);
}

.callout--swing::before { background-color: var(--red); }
.callout-title { font: 400 2rem/1 var(--f-pen); text-transform: uppercase; }
.callout-body { font-size: 0.98rem; line-height: 1.45; }
.callout-body strong { font-weight: 800; font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .callout { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   Numbers: stat tiles
   -------------------------------------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.stat-grid.stat-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .stat-grid.stat-grid--3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 360px) {
  .stat-grid { grid-template-columns: minmax(0, 1fr); }
}

.stat-grid > .error-banner,
.stat-grid > .info-banner { grid-column: 1 / -1; }

.stat-tile {
  min-width: 0;
  padding: 0.85rem 1rem 1rem;
  border: 2px solid var(--line-strong);
  background: var(--surface);
}

.stat-tile .stat-label {
  font: 700 0.76rem/1.25 var(--f-type);
  text-transform: uppercase;
  color: var(--fg-2);
}

.stat-tile .stat-value {
  margin-top: 0.35rem;
  font: 400 2.1rem/1 var(--f-head);
  overflow-wrap: anywhere;
}

.stat-tile .stat-note { margin-top: 0.35rem; font-size: 0.8rem; color: var(--fg-3); }
.stat-tile .text-muted { color: var(--fg-2); }

/* --------------------------------------------------------------------------
   Tables: typewriter on paper
   -------------------------------------------------------------------------- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font: 700 0.9rem/1.3 var(--f-type);
  text-transform: uppercase;
}

.data-table thead th {
  padding: 0.4rem 0.5rem;
  text-align: left;
  border-bottom: 3px solid var(--line-strong);
  font-size: 0.76rem;
  white-space: nowrap;
  color: var(--fg);
}

.data-table tbody td,
.data-table tbody th {
  padding: 0.5rem 0.5rem;
  border-top: 1px dashed var(--line);
  vertical-align: middle;
  text-align: left;
  font-weight: 700;
}

.data-table .num,
.data-table thead th.num { text-align: right; }
.data-table td.rank { width: 2.6rem; color: var(--fg-2); }
.data-table td.team { font-weight: 700; }
.data-table .odds-cell { display: flex; align-items: center; justify-content: flex-end; gap: 0.55rem; }
.data-table .odds-cell > span { min-width: 2.6rem; text-align: right; }
.data-table tbody tr.standings-row,
.data-table tbody tr[data-team-link] { cursor: pointer; }
.data-table tbody tr.standings-row:hover,
.data-table tbody tr[data-team-link]:hover { background: var(--yellow); }
.data-table tbody tr:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.data-table tbody tr.standings-row.is-open { background: var(--surface-2); }
.data-table tbody tr.standings-row.is-open td.team { box-shadow: inset 4px 0 0 var(--red); padding-left: 0.8rem; }
.data-table tbody tr.standings-detail-row > td { padding: 0.9rem 0.6rem 1.2rem; background: var(--surface); }
.data-table tbody tr.is-below-cutoff > td,
.data-table tbody tr.is-below-cutoff > th { border-top: 3px solid var(--red); }

.row-toggle {
  display: inline;
  padding: 0.15rem 0;
  margin: 0;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-transform: inherit;
}

.row-toggle:hover { text-decoration: underline; text-underline-offset: 3px; }

.h2h-trend-table td { vertical-align: middle; }
.h2h-trend-bars { display: flex; flex-direction: column; gap: 3px; min-width: 110px; }
.h2h-trend-bar { height: 7px; min-width: 3px; }

.table-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  font: 700 0.76rem var(--f-type);
  text-transform: uppercase;
  color: var(--fg-2);
}

.cutoff-key { display: inline-block; width: 28px; border-top: 3px solid var(--red); }
.table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 480px) {
  .data-table { font-size: 0.82rem; }
  .data-table thead th, .data-table tbody td, .data-table tbody th { padding-left: 0.35rem; padding-right: 0.35rem; }
}

/* --------------------------------------------------------------------------
   Comparison bars and the probability strip
   -------------------------------------------------------------------------- */

.compare-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.compare-legend .team-chip { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-legend-label { font: 700 0.78rem var(--f-type); text-transform: uppercase; color: var(--fg-3); }
.compare-row { margin-bottom: 1rem; }
.compare-row:last-child { margin-bottom: 0; }

.compare-row-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.3rem;
  font: 700 0.84rem var(--f-type);
  text-transform: uppercase;
}

.compare-row-head .metric-name { color: var(--fg-2); }

.compare-values {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.3rem;
  font: 400 1.25rem/1 var(--f-head);
}

.compare-track {
  position: relative;
  display: flex;
  height: 14px;
  background: var(--surface-2);
}

.compare-track .compare-fill { height: 100%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.compare-fill.home { background: var(--home-color, var(--red)); }
.compare-fill.away { background: var(--away-color, var(--fg-3)); margin-left: auto; }
.compare-fill.home + .compare-fill.away { border-left: 2px solid var(--sheet); }
.compare-row--out { margin-top: 1.1rem; padding-top: 0.8rem; border-top: 2px dashed var(--line); }
.seed-row .metric-name[data-team-link]:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.watch-tile:hover { border-color: var(--red); }

.prob-bar {
  position: relative;
  display: flex;
  height: 28px;
  background: var(--surface-2);
  border: 3px solid var(--ink);
}

.prob-bar-segment { height: 100%; transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.prob-bar-segment + .prob-bar-segment { margin-left: 4px; }
.prob-bar-mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 0; pointer-events: none; }

.prob-bar-mid::before,
.prob-bar-mid::after {
  content: "";
  position: absolute;
  left: -7px;
  width: 14px;
  height: 9px;
  background: var(--ink);
}

.prob-bar-mid::before { top: -9px; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.prob-bar-mid::after { bottom: -9px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }

.prob-bar-labels {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.7rem;
  font: 700 0.95rem var(--f-type);
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Matchup result: two torn team scraps and a VS splat
   -------------------------------------------------------------------------- */

.matchup-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 1rem;
}

@media (max-width: 720px) {
  .matchup-form-grid { grid-template-columns: minmax(0, 1fr); }
  .swap-btn { justify-self: center; }
}

.advanced-toggle { margin-top: 0.8rem; }

.advanced-panel {
  display: none;
  gap: 1rem;
  margin-top: 0.8rem;
  padding-top: 1rem;
  border-top: 2px dashed var(--line);
}

.advanced-panel.open { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

@media (max-width: 640px) {
  .advanced-panel.open { grid-template-columns: minmax(0, 1fr); }
}

.matchup-headline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  margin-bottom: 0.3rem;
}

.matchup-stamp { flex-shrink: 0; margin-right: 0.4rem; }

.result-scoreboard {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0 minmax(0, 1fr);
  gap: 0;
  margin: 1.6rem 0 2rem;
}

.result-team {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 1.6rem 2.4rem 1.6rem 1.4rem;
  text-align: center;
  color: var(--team-ink, var(--paper));
  --dot: var(--team-dots, #000);
  --fg: var(--team-ink, var(--paper));
}

.result-team::before {
  content: "";
  position: absolute;
  inset: 0 -4px;
  z-index: -1;
  background: var(--halftone), var(--team-color, var(--surface-2));
  background-blend-mode: normal;
  filter: url(#tear-a);
}

.result-team:last-child { padding: 1.6rem 1.4rem 1.6rem 2.4rem; }
.result-team:last-child::before { filter: url(#tear-c); }
.result-team .team-side-label { font: 700 0.86rem var(--f-type); letter-spacing: 0.08em; text-transform: uppercase; }
.result-team .team-name { margin-top: 0.3rem; font: 400 clamp(1.7rem, 1rem + 1.8vw, 2.8rem)/0.95 var(--f-head); text-transform: uppercase; overflow-wrap: anywhere; }
.result-team .team-abbrev { margin-top: 0.25rem; font: 700 0.95rem var(--f-type); letter-spacing: 0.1em; }

.win-stamp {
  position: relative;
  margin-top: 1.1rem;
  padding: 0.55rem 1.05rem 0.45rem;
  background: var(--sheet);
  color: var(--ink);
}

.win-stamp::before {
  content: "";
  position: absolute;
  inset: -9px -10px;
  border: 5px solid var(--team-ink, var(--ink));
  transform: rotate(-3deg);
  pointer-events: none;
  --stamp-tilt: -3deg;
  animation: stamp-thunk 0.34s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.result-team .win-prob { margin: 0; font: 400 clamp(2.2rem, 1.4rem + 1.6vw, 3rem)/1 var(--f-head); color: var(--ink); font-variant-numeric: tabular-nums; }
.result-team.is-favorite .win-prob { font-size: clamp(3.4rem, 1.9rem + 4vw, 6rem); }
.result-team .win-prob-label { margin-top: 0.25rem; font: 700 0.76rem var(--f-type); text-transform: uppercase; color: #3b3934; }
.result-team .favorite-badge { margin-top: 1.05rem; }
.result-team .badge.positive { background: var(--ink); border-color: var(--ink); color: var(--yellow); font-size: 0.82rem; }
.result-team .link-btn, .result-team .link-btn:hover,
.card.clipping .result-team .link-btn, .card.clipping .result-team .link-btn:hover { margin-top: auto; padding-top: 0.9rem; color: var(--team-ink, var(--paper)); text-decoration-color: currentColor; }
.result-team :focus-visible { outline-color: var(--team-ink, var(--yellow)); outline-offset: 2px; }

.vs-divider { position: relative; z-index: 3; display: block; width: 0; }

.vs-divider span {
  position: absolute;
  left: 0;
  top: 50%;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  transform: translate(-50%, -50%) rotate(-6deg);
  background: var(--yellow);
  color: var(--ink);
  font: 400 1.9rem/1 var(--f-head);
  clip-path: polygon(50% 0%, 58.2% 13.9%, 71.7% 5%, 73.1% 21.1%, 89.1% 18.8%, 83.3% 33.9%, 98.7% 38.9%, 87% 50%, 98.7% 61.1%, 83.3% 66.1%, 89.1% 81.2%, 73.1% 78.9%, 71.7% 95%, 58.2% 86.1%, 50% 100%, 41.8% 86.1%, 28.3% 95%, 26.9% 78.9%, 10.9% 81.2%, 16.7% 66.1%, 1.3% 61.1%, 13% 50%, 1.3% 38.9%, 16.7% 33.9%, 10.9% 18.8%, 26.9% 21.1%, 28.3% 5%, 41.8% 13.9%);
}

@media (max-width: 720px) {
  .result-scoreboard { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 0 auto; }
  .result-team, .result-team:last-child { padding: 1.4rem 1rem 2.6rem; }
  .result-team:last-child { padding-top: 2.6rem; }
  .vs-divider { width: auto; height: 0; }
  .vs-divider span { left: 50%; top: 0; width: 70px; height: 70px; font-size: 1.5rem; }
}

/* --------------------------------------------------------------------------
   Team hero: a torn team-color scrap
   -------------------------------------------------------------------------- */

.card.team-hero {
  --face: var(--team-color, var(--surface-2));
  --dot: color-mix(in srgb, var(--team-dots, #000) 26%, transparent);
  --fg: var(--team-ink, var(--paper));
  --fg-2: var(--team-ink, var(--paper));
  color: var(--team-ink, var(--paper));
  padding: 2rem 2.2rem 2.2rem 2.6rem;
}

.card.team-hero::after {
  background-color: var(--face);
  background-image: var(--halftone);
  background-blend-mode: normal;
}

/* A clashing stripe in the team's second color along the left edge. */
.card.team-hero > .team-hero-body::before,
.card.team-hero > .player-hero-grid::before {
  content: "";
  position: absolute;
  left: -1.4rem;
  top: -0.6rem;
  bottom: -0.6rem;
  width: 10px;
  background: var(--team-alt, var(--red));
}

.card.team-hero > .team-hero-body,
.card.team-hero > .player-hero-grid { position: relative; }
.card.team-hero :focus-visible { outline-color: var(--team-ink, var(--yellow)); }

.team-hero-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.2rem 1.6rem;
}

.team-hero-id { min-width: 0; }
.team-hero-city { font: 700 0.95rem var(--f-type); letter-spacing: 0.08em; text-transform: uppercase; }
.team-hero-name { margin-top: 0.25rem; font: 400 clamp(2.6rem, 6vw, 5.2rem)/0.92 var(--f-head); text-transform: uppercase; text-shadow: 0.04em 0.04em 0 var(--team-alt, transparent); overflow-wrap: anywhere; }
.team-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.9rem 1.1rem; }
.team-hero .team-streak { color: var(--team-ink, var(--paper)); mix-blend-mode: normal; background: none; }

.team-hero .badge.team-abbrev-stamp {
  padding: 0.2rem 0.6rem 0.1rem;
  border: 4px solid var(--team-ink, var(--paper));
  color: var(--team-ink, var(--paper));
  font: 400 1.4rem/1.1 var(--f-head);
  letter-spacing: 0.1em;
}

/* --------------------------------------------------------------------------
   Home: the cover (torn-letter masthead over the montage) and the toolbox
   -------------------------------------------------------------------------- */

#app-hero[hidden] { display: none; }

.cover {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--head-h) + 2rem) 0 5.5rem;
  overflow: hidden;
  isolation: isolate;
}

.cover-bg { position: absolute; inset: 0; z-index: -1; background: #0a0a0a; }

.cover-bg img,
.cover-bg video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.25) contrast(1.12) brightness(0.82);
  transition: opacity 0.4s ease;
}

.cover-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 10, 10, 0.86), rgba(10, 10, 10, 0.6) 55%, rgba(10, 10, 10, 0.3)),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0 1px, transparent 1px 3px);
}

/* Torn paper strip into the next section. */
.cover::after {
  content: "";
  position: absolute;
  z-index: 5;
  left: -3%;
  right: -3%;
  bottom: -20px;
  height: 40px;
  background-color: var(--paper);
  background-image: var(--fiber);
  filter: url(#tear-edge);
  pointer-events: none;
}

.cover .wrap,
.home-band .wrap {
  position: relative;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 52px);
}

.mastcol { container-type: inline-size; min-width: 0; }
.mast { display: flex; flex-direction: column; gap: 0.06em; margin: 0; font-size: clamp(4rem, min(19cqw, 22svh), 15rem); font-weight: 400; }
.mast .row { display: flex; flex-wrap: nowrap; gap: 0.05em; }

.tile {
  position: relative;
  isolation: isolate;
  display: inline-block;
  padding: 0.03em 0.1em 0;
  font-family: var(--f-head);
  font-size: var(--s, 1em);
  line-height: 0.95;
  color: var(--ink);
  transform: translateY(var(--y, 0)) rotate(var(--r, 0deg));
}

.tile.f2 { font-family: var(--f-rans); }

.tile::before {
  content: "";
  position: absolute;
  inset: -0.025em;
  z-index: -2;
  background-color: var(--paper);
  background-image: var(--fiber);
  filter: url(#tear-a);
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0.02em;
  z-index: -1;
  background-color: var(--face, var(--paper-2));
  filter: url(#tear-b);
}

.tile.k { --face: #0c0c0c; color: var(--paper); }
.tile.r { --face: var(--red); color: var(--ink); }
.tile.w { --face: var(--paper-2); }

.say { margin-top: clamp(1rem, 3vh, 2rem); font: 400 clamp(2.4rem, 5.4vw, 5rem)/0.95 var(--f-head); text-transform: uppercase; }
.say em { font-style: normal; color: var(--red); }
.cover .sub { margin-top: 1rem; max-width: 36ch; font-size: clamp(1.05rem, 1.5vw, 1.3rem); font-weight: 600; }
.go { display: flex; flex-wrap: wrap; align-items: center; gap: 1.6rem; margin-top: 1.8rem; }

.go .link {
  color: var(--fg);
  font: 800 0.95rem var(--f-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration-thickness: 3px;
  text-underline-offset: 0.3em;
}

.cover-proof { margin-top: 1.6rem; font: 700 0.86rem var(--f-type); text-transform: uppercase; color: var(--fg-2); }
.cover-proof b { font: 400 1.6rem/1 var(--f-head); color: var(--yellow); margin-right: 0.3rem; }

.bgpp {
  position: absolute;
  z-index: 6;
  left: clamp(16px, 4vw, 52px);
  bottom: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--tap);
  padding: 0 1rem 0 0.8rem;
  background: var(--ground-2);
  color: var(--fg);
  border: 2px solid var(--fg);
  cursor: pointer;
  font: 800 0.76rem var(--f-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bgpp:hover { border-color: var(--yellow); color: var(--yellow); }
.bgpp svg { width: 14px; height: 14px; fill: currentColor; }
.bgpp .ic-play, .bgpp .t-play { display: none; }
.bgpp[data-state="paused"] .ic-play, .bgpp[data-state="paused"] .t-play { display: inline; }
.bgpp[data-state="paused"] .ic-pause, .bgpp[data-state="paused"] .t-pause { display: none; }

/* Full-bleed home bands (white / dark), torn into each other. */
.home-band {
  position: relative;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-block: clamp(4.5rem, 9vw, 7.5rem);
}

.app-content > .home-band { margin-top: 0; }
.app-content > .home-band:first-child { margin-top: -2.4rem; }

.home-band.white {
  background: var(--paper);
  color: var(--ink);
  --fg: var(--ink);
  --fg-2: #3b3934;
  --fg-3: #5d5a52;
  --line: rgba(16, 16, 16, 0.24);
  --line-strong: var(--ink);
  --surface: #ebe8de;
  --surface-2: #e0dcd0;
}

.home-band + .home-band::before {
  content: "";
  position: absolute;
  z-index: 5;
  left: -3%;
  right: -3%;
  top: -20px;
  height: 40px;
  background-color: var(--paper);
  background-image: var(--fiber);
  filter: url(#tear-edge);
  pointer-events: none;
}

.home-band .lede { margin-top: 1.1rem; max-width: 46ch; font-size: clamp(1.05rem, 1.5vw, 1.25rem); font-weight: 600; }

.toolbox {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.4rem, 3vw, 2.6rem);
  margin-top: 3.2rem;
}

@media (max-width: 1000px) { .toolbox { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .toolbox { grid-template-columns: minmax(0, 1fr); } }

.tool {
  --pad: 1.6rem 1.6rem 1.8rem;
  --face: #fbfaf6;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 250px;
  padding: var(--pad);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transform: rotate(var(--r, 0deg));
  transition: transform 0.25s var(--ease);
}

.tool:hover, .tool:focus-visible { transform: translateY(-6px) rotate(calc(var(--r, 0deg) * -1)); }
.tool:focus-visible { outline: 3px solid var(--ink); outline-offset: 6px; }
.tool.y { --face: var(--yellow); }
.tool.r2 { --face: var(--red); }
.tool .kick { font: 700 0.82rem var(--f-type); letter-spacing: 0.06em; text-transform: uppercase; }
.tool .big { font: 400 clamp(3.2rem, 5.4vw, 5rem)/0.86 var(--f-head); font-variant-numeric: tabular-nums; }
.tool .big small { font-size: 0.4em; }
.tool h3 { font: 400 clamp(1.6rem, 2.4vw, 2.2rem)/1 var(--f-head); text-transform: uppercase; }
.tool p { font: 700 0.86rem/1.4 var(--f-type); text-transform: uppercase; }
.tool .more { margin-top: auto; font: 800 0.82rem var(--f-body); letter-spacing: 0.1em; text-transform: uppercase; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.3em; }

.closer .h2 { font-size: clamp(3.4rem, 10vw, 9.6rem); }

/* Dashboard quick links (kept for any page that still renders them). */
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; }
@media (max-width: 900px) { .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .quick-grid { grid-template-columns: minmax(0, 1fr); } }

.quick-card {
  position: relative;
  min-height: 8rem;
  padding: 1.2rem 1.1rem;
  background: var(--surface);
  border: 2px solid var(--ink);
  cursor: pointer;
}

.quick-card:hover { background: var(--yellow); }
.quick-card h3 { font: 400 1.6rem/1.02 var(--f-head); text-transform: uppercase; }
.quick-card p { margin-top: 0.45rem; font-size: 0.95rem; color: var(--fg-2); }

/* --------------------------------------------------------------------------
   Coming soon, raw tools, assistant chat
   -------------------------------------------------------------------------- */

.coming-soon { padding: 2rem 1rem; text-align: center; }
.coming-soon-sign { max-width: 560px; margin: 0 auto; }
.coming-soon-stamp { margin-bottom: 1rem; }
.coming-soon h2 { margin-bottom: 0.6rem; font: 400 clamp(2rem, 1.4rem + 2vw, 3rem)/1 var(--f-head); text-transform: uppercase; }
.coming-soon-note { font: 700 0.86rem var(--f-type); text-transform: uppercase; }
.coming-soon ul { display: inline-block; margin: 0.5rem auto 0; padding-left: 1.1rem; text-align: left; }

pre.output-pane {
  max-height: 360px;
  overflow: auto;
  padding: 0.85rem;
  background: var(--ink);
  color: var(--paper);
  font: 400 0.82rem/1.45 var(--f-type);
  white-space: pre-wrap;
  word-break: break-word;
}

.assistant-card { display: flex; flex-direction: column; }

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 220px;
  max-height: 56vh;
  overflow-y: auto;
  margin-top: 0.5rem;
  padding: 0.3rem 0.2rem;
}

.chat-bubble {
  max-width: min(640px, 88%);
  padding: 0.8rem 1rem;
  border: 2px solid var(--ink);
  background: var(--surface);
}

.chat-bubble p { margin: 0; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.chat-bubble--user { align-self: flex-end; background: var(--red); transform: rotate(0.6deg); }
.chat-bubble--assistant { align-self: flex-start; }
.chat-bubble--pending { display: flex; align-items: center; gap: 0.5rem; font: 700 0.86rem var(--f-type); text-transform: uppercase; }
.chat-bubble-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.55rem; }
.chat-envelope { margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px dashed var(--line); font-size: 0.86rem; color: var(--fg-2); }
.chat-envelope-row { margin: 0.3rem 0; }
.chat-envelope-row strong { color: var(--fg); }
.chat-envelope ul { margin: 0.2rem 0 0.4rem 1.1rem; padding: 0; }
.chat-examples { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; padding-top: 0.9rem; border-top: 2px dashed var(--line); }
.chat-composer { display: flex; align-items: flex-end; gap: 0.8rem; margin-top: 1rem; }
.chat-input { flex: 1; min-height: 50px; resize: vertical; }

@media (max-width: 640px) {
  .chat-composer { flex-direction: column; align-items: stretch; }
  .chat-bubble { max-width: 100%; }
}

/* --------------------------------------------------------------------------
   Players: search, the torn headshot hero, season tables, charts
   -------------------------------------------------------------------------- */

.player-search { display: flex; gap: 0.9rem; align-items: center; max-width: 680px; }
.player-search .input { flex: 1; }
.player-results:not(:empty) { margin-top: 1rem; }

.player-result-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.player-result {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 0.75rem;
  align-items: center;
  width: 100%;
  min-height: var(--tap);
  padding: 0.45rem 0.6rem;
  background: var(--surface);
  border: 2px solid transparent;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
}

.player-result:hover { border-color: var(--ink); background: var(--yellow); }
.player-result .player-thumb { grid-row: span 2; }
.player-result-name { font-weight: 800; overflow-wrap: anywhere; }
.player-result-meta { font: 700 0.74rem var(--f-type); text-transform: uppercase; color: var(--fg-3); }
.player-result:hover .player-result-meta { color: var(--ink); }

.player-thumb {
  position: relative;
  display: grid;
  place-items: end center;
  width: 52px;
  height: 40px;
  overflow: hidden;
  background: var(--paper-2);
}

.player-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.player-thumb .torn-photo-initials { align-self: center; font-size: 1.1rem; color: var(--ink); text-shadow: none; }

.quick-picks { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1rem; }

.card.player-hero { padding: 2rem 2.2rem 2.3rem 2.8rem; }

.player-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: 1.4rem 2.4rem;
  align-items: end;
}

.player-hero-id { min-width: 0; }

.player-bio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem 1.4rem;
  margin: 1.1rem 0 1.3rem;
}

.player-bio div { min-width: 0; }
.player-bio dt { font: 700 0.74rem var(--f-type); text-transform: uppercase; opacity: 0.85; }
.player-bio dd { margin: 0.1rem 0 0; font: 400 1.35rem/1.05 var(--f-head); overflow-wrap: anywhere; }

.player-tag-stamp {
  position: absolute;
  top: -0.6rem;
  right: 0;
  margin: 0;
  color: var(--team-ink, var(--paper));
  mix-blend-mode: normal;
  background: none;
  --stamp-tilt: 5deg;
}

@media (max-width: 900px) {
  .player-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .player-hero-grid .torn-photo { max-width: 360px; }
  .player-bio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-tag-stamp { position: static; justify-self: start; }
}

/* Torn headshot: a jagged paper sheet, the photo torn a few % inside it,
   and a strip of tape across the top edge. */
.torn-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 1040 / 820;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.55));
}

.torn-photo-paper { position: absolute; inset: 0; background-color: #f3efe4; background-image: var(--fiber); }

.torn-photo-image {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  overflow: hidden;
  --dot: color-mix(in srgb, var(--photo-alt, #000) 34%, transparent);
  background:
    radial-gradient(circle at 50% 38%, transparent 0 34%, rgba(0, 0, 0, 0.28) 100%),
    var(--halftone),
    var(--photo-team, var(--surface-2));
}

.torn-photo-image img { display: block; width: 94%; height: auto; margin-bottom: 4.5%; }

.torn-photo-initials {
  align-self: center;
  font: 400 clamp(3rem, 7vw, 5.5rem)/1 var(--f-head);
  color: var(--paper);
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
}

.torn-photo-tape {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 34%;
  height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(243, 239, 228, 0.66);
  background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0 2px, transparent 2px 7px);
  clip-path: polygon(1% 0, 99% 0, 100% 16%, 97% 32%, 100% 50%, 97% 68%, 100% 84%, 99% 100%, 1% 100%, 0 84%, 3% 68%, 0 50%, 3% 32%, 0 16%);
  pointer-events: none;
}

.stat-toolbar {
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.8rem 1.4rem;
  margin-bottom: 1rem;
}

.stat-toolbar > .text-muted { max-width: 60ch; margin: 0; font-size: 0.86rem; }

.stats-table { font-size: 0.86rem; white-space: nowrap; }
.stats-table thead th, .stats-table tbody td, .stats-table tbody th { padding: 0.42rem 0.45rem; }
.sticky-col { position: sticky; left: 0; z-index: 1; background: var(--sheet); }
.stats-table .link-btn { min-height: 0; padding: 0; font-size: 0.86rem; }
.stats-table .stint-row td, .stats-table .stint-row th { color: var(--fg-3); }
.stint-indent { padding-left: 0.9rem; }
.stats-table .total-row th, .stats-table .total-row td { background: var(--surface); }
.stats-table .career-row th, .stats-table .career-row td { border-top: 3px solid var(--ink); background: var(--yellow); color: var(--ink); }
.compact-table { font-size: 0.84rem; }
.compact-table td, .compact-table th { padding: 0.4rem 0.45rem; }
.compact-table .link-btn { min-height: 0; font-size: 0.8rem; }
.result-w, .result-l { display: inline-block; width: 1.4em; text-align: center; }
.result-w { color: var(--pos); }
.result-l { color: var(--neg); }
.log-summary { margin: 0 0 0.8rem; color: var(--fg-2); }
.log-summary strong { color: var(--fg); }
.range-text { color: var(--fg-2); font-variant-numeric: tabular-nums; }
.chart-intro { max-width: 80ch; margin: -0.2rem 0 0.7rem; font-size: 0.9rem; }

.milestone-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; }

.milestone-grid > div {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.7rem;
  border: 2px solid var(--ink);
  background: var(--surface);
}

.milestone-value { font: 400 1.7rem/1 var(--f-head); }
.milestone-label { font: 700 0.72rem var(--f-type); text-transform: uppercase; color: var(--fg-2); }

@media (max-width: 480px) {
  .milestone-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-search { flex-direction: column; align-items: stretch; }
}

/* Percentile bars: one series, the player's team color, ink outline. */
.pctl-list { display: grid; gap: 0.38rem; }

.pctl-row {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) 2.4rem;
  align-items: center;
  gap: 0.7rem;
  min-height: 26px;
}

.pctl-row:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.pctl-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 0.76rem var(--f-type); text-transform: uppercase; color: var(--fg-2); }
.pctl-track { position: relative; height: 14px; background: var(--surface-2); }
.pctl-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; box-shadow: inset 0 0 0 1.5px var(--ink); }
.pctl-row.is-hot .pctl-fill { filter: brightness(1.2); }
.pctl-mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.pctl-value { text-align: right; font: 400 1.15rem/1 var(--f-head); font-variant-numeric: tabular-nums; }

/* SVG charts + the shared tooltip. Colors are tokens (see charts.js). */
.chart-wrap { width: 100%; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-axis-label { fill: var(--fg-3); font: 700 12px var(--f-type); }
.chart-label { fill: var(--fg); font: 700 12px var(--f-type); }
.c-grid { stroke: var(--chart-grid); }
.c-axis { stroke: var(--chart-axis); }
.c-base { fill: var(--chart-base); }
.c-base-line { stroke: var(--chart-base); }
.c-accent { fill: var(--chart-accent); }
.c-accent-line { stroke: var(--chart-accent); }
.c-pos { fill: var(--pos); }
.c-neg { fill: var(--neg); }
.c-ring { stroke: var(--chart-surface); }
.chart [data-tip] { outline: none; }
.chart path.chart-mark.is-hot, .chart-hit.is-hot .chart-mark { filter: brightness(1.15); }
.chart path.chart-mark:focus-visible, .chart-hit:focus-visible .chart-mark { stroke: var(--ink); stroke-width: 3; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin-bottom: 0.4rem;
  font: 700 0.76rem var(--f-type);
  text-transform: uppercase;
  color: var(--fg-2);
}

.chart-legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.legend-line { display: inline-block; width: 16px; height: 2px; }
.legend-band { display: inline-block; width: 18px; height: 6px; background: var(--surface-2); }

.chart-tooltip {
  position: fixed;
  z-index: 80;
  max-width: 280px;
  padding: 0.5rem 0.7rem;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--paper);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.6);
  font: 700 0.8rem var(--f-type);
  text-transform: uppercase;
  pointer-events: none;
}

.chart-tooltip-title { margin-bottom: 0.25rem; color: var(--yellow); font-size: 0.74rem; }
.chart-tooltip-row { display: flex; align-items: center; gap: 0.4rem; }
.chart-tooltip-row strong { color: var(--paper); font-variant-numeric: tabular-nums; }
.chart-tooltip-key { display: inline-block; width: 12px; height: 3px; }

/* --------------------------------------------------------------------------
   Sandbox: builder, ledger, results
   -------------------------------------------------------------------------- */

.sandbox-mode { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.9rem 1.4rem; }
.sandbox-mode > .text-muted { flex: 1 1 320px; margin: 0; font-size: 0.9rem; }

.sandbox-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: 2.4rem;
  align-items: start;
}

.sandbox-ledger { position: sticky; top: calc(var(--head-h) + 1rem); }

@media (max-width: 1100px) {
  .sandbox-grid { grid-template-columns: minmax(0, 1fr); }
  .sandbox-ledger { position: static; }
}

.trade-teams { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.8rem 1rem; }
.trade-teams .compact-field { flex: 1 1 200px; }
.trade-hint { margin: 0.8rem 0; font-size: 0.88rem; }
.trade-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.trade-board--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 760px) {
  .trade-board, .trade-board--3 { grid-template-columns: minmax(0, 1fr); }
}

.trade-side { min-width: 0; border: 2px solid var(--ink); background: var(--surface); }

.trade-side-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  border-bottom: 2px solid var(--ink);
  font: 700 0.8rem var(--f-type);
  text-transform: uppercase;
}

.trade-roster { max-height: 340px; overflow-y: auto; margin: 0; padding: 0.3rem 0; list-style: none; }
.trade-roster li { padding: 0 0.5rem; }
.trade-roster li.is-picked { background: var(--yellow); }

.trade-roster label {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 0.5rem;
  align-items: center;
  min-height: var(--tap);
  padding: 0.25rem 0;
  cursor: pointer;
}

.trade-roster input { grid-row: span 2; }
.trade-name { font-weight: 800; font-size: 0.92rem; overflow-wrap: anywhere; }
.trade-meta { font: 700 0.72rem var(--f-type); text-transform: uppercase; color: var(--fg-3); }
.trade-roster li.is-picked .trade-meta { color: var(--ink); }
.mini-select { width: auto; min-height: 34px; margin: 0 0 0.4rem 1.6rem; padding: 0.2rem 2rem 0.2rem 0.5rem; font-size: 0.84rem; }
.deal-roster { max-height: 300px; border: 2px solid var(--ink); background: var(--surface); }

.sign-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 0.9rem;
  margin-top: 1rem;
  padding: 0.9rem;
  border: 2px solid var(--ink);
  background: var(--surface);
}

.move-list { display: grid; gap: 0.4rem; margin: 0 0 0.6rem; padding: 0; list-style: none; counter-reset: move; }

.move-list li {
  counter-increment: move;
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.2rem 0.35rem 0.5rem;
  border: 2px solid var(--ink);
  background: var(--surface);
  font-size: 0.9rem;
}

.move-list li::before { content: counter(move); font: 400 1.2rem/1 var(--f-head); color: var(--red-ink); }
.move-list .icon-btn { min-width: 36px; min-height: 36px; }

.impact-list { display: grid; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.impact-list details { border: 2px solid var(--ink); background: var(--surface); }

.impact-list summary,
.impact-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  min-height: var(--tap);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  list-style: none;
}

.impact-row { cursor: default; border: 2px solid var(--ink); background: var(--surface); }
.impact-list summary::-webkit-details-marker { display: none; }
.impact-list summary:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.impact-figure { font: 400 1.6rem/1 var(--f-head); font-variant-numeric: tabular-nums; }
.impact-figure.is-up, .delta.is-up { color: var(--pos); }
.impact-figure.is-down, .delta.is-down { color: var(--neg); }
.impact-label { font: 700 0.74rem var(--f-type); text-transform: uppercase; color: var(--fg-2); }
.impact-range, .impact-note, .sim-note { font-size: 0.82rem; }
.impact-range { margin: 0 0.6rem 0.4rem; }
.roster-delta { margin: 0 0 0.4rem; }
.roster-delta .badge { padding: 0.02rem 0.35rem; font-size: 0.62rem; }
.roster-delta tr.status-departed td { color: var(--fg-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.roster-delta tr.status-departed td.num { text-decoration: none; }
.roster-note { font-size: 0.72rem; text-transform: none; }

.sim-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; margin: 1rem 0 0.9rem; }
.sim-note { margin-top: 0.6rem; }
.delta { margin-left: 0.25rem; font: 700 0.78rem var(--f-type); }
.sandbox-headline .stamp { margin-top: 0.9rem; }
.verdict { margin: 0.3rem 0; font-weight: 600; }
.data-table tr.is-changed td { background: var(--yellow); }
.data-table tr.is-changed td.team { box-shadow: inset 5px 0 0 var(--red); }
.standings-mini { font-size: 0.86rem; }

/* Dumbbell rows: unchanged league (gray) vs your scenario (red). */
.dumbbell-list { display: grid; gap: 0.35rem; }

.dumbbell-row {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) 8.5rem;
  align-items: center;
  gap: 0.8rem;
  min-height: 34px;
}

.dumbbell-row:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.dumbbell-label { font: 400 1.1rem/1 var(--f-head); letter-spacing: 0.04em; }
.dumbbell-track { position: relative; height: 24px; border-bottom: 1px solid var(--chart-grid); }
.dumbbell-band { position: absolute; height: 4px; border-radius: 2px; }
.dumbbell-band.is-base { top: 6px; background: color-mix(in srgb, var(--chart-base) 40%, transparent); }
.dumbbell-band.is-scenario { top: 14px; background: color-mix(in srgb, var(--chart-accent) 40%, transparent); }
.dumbbell-link { position: absolute; top: 11px; height: 2px; background: var(--fg-3); }

.dumbbell-dot {
  position: absolute;
  top: 6px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  border: 2px solid var(--chart-surface);
}

.dumbbell-dot.is-base { background: var(--chart-base); }
.dumbbell-dot.is-scenario { background: var(--chart-accent); }
.dumbbell-value { text-align: right; font: 700 0.84rem var(--f-type); color: var(--fg-2); font-variant-numeric: tabular-nums; }
.dumbbell-value strong { color: var(--fg); }

.dumbbell-axis {
  display: flex;
  justify-content: space-between;
  margin: 0.1rem 9.3rem 0 4.2rem;
  font: 700 0.74rem var(--f-type);
  color: var(--fg-3);
}

@media (max-width: 560px) {
  .dumbbell-row { grid-template-columns: 2.8rem minmax(0, 1fr); }
  .dumbbell-value { grid-column: 2; text-align: left; }
  .dumbbell-axis { margin: 0 0 0 3.6rem; }
}

.champion-banner {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 1rem;
  padding: 1.2rem 1.4rem;
  color: var(--team-ink, var(--paper));
}

.champion-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--team-color, var(--surface-2));
  filter: url(#tear-a);
}

.champion-kicker { font: 700 0.86rem var(--f-type); letter-spacing: 0.08em; text-transform: uppercase; }
.champion-name { font: 400 clamp(1.8rem, 1.2rem + 1.8vw, 2.8rem)/1 var(--f-head); text-transform: uppercase; }
.champion-score { font-weight: 700; }

.story-standings { display: grid; gap: 0.1rem; margin: 0; padding: 0; list-style: none; font: 700 0.86rem var(--f-type); text-transform: uppercase; }

.story-standings li {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) auto;
  gap: 0.4rem;
  padding: 0.22rem 0.3rem;
  border-top: 1px dashed var(--line);
}

.story-standings li.is-below-cutoff { border-top: 3px solid var(--red); }
.story-standings .seed { color: var(--fg-3); }
.bracket-list { display: grid; gap: 0.3rem; margin: 0.8rem 0 0; padding: 0; list-style: none; font-size: 0.9rem; }
.bracket-list li { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 0.6rem; }
.bracket-round { font: 700 0.74rem var(--f-type); text-transform: uppercase; color: var(--fg-3); }

@media (max-width: 480px) {
  .bracket-list li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sim-controls { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

.fade-in { animation: fadeIn 0.3s ease both; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Small screens: the nav bar keeps every page reachable
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .zstatus { display: none; }
}

@media (max-width: 900px) {
  .zhead { grid-template-columns: 1fr; justify-items: center; top: 8px; }
  .zbrand { display: none; }
  .zi { min-width: 48px; padding: 0 6px; }
  .zi span { font-size: 0.54rem; letter-spacing: 0.04em; }
  .card, .scrap { padding: 1.5rem 1.15rem 1.7rem; }
  .card.team-hero, .card.player-hero { padding: 1.6rem 1.2rem 1.8rem 1.8rem; }
}

@media (max-width: 600px) {
  :root { --head-h: 80px; }
  .zn { height: 56px; padding: 0 2px; }
  .zi { min-width: 0; padding: 0 7px; }
  .zi svg { width: 22px; height: 22px; }
  .zi span { display: none; }
  .zmenu { top: calc(8px + 56px + 8px); }
  .bgpp { bottom: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .spinner { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
  .skeleton { animation: none !important; }
  .zlime.ready { transition: none; }
}

@media (forced-colors: active) {
  .card::before, .card::after, .scrap::before, .scrap::after,
  .btn::before, .btn::after, .tile::before, .tile::after,
  .hl::before, .cover::after, .home-band + .home-band::before, .torn-photo-tape { display: none; }
  .card, .btn { border: 2px solid CanvasText; }
  .torn-photo-paper, .torn-photo-image, .player-thumb { clip-path: none !important; }
}

/* ==========================================================================
   Shell additions: header tools, the grouped More slip, search, toasts,
   back-to-top, skip link
   ========================================================================== */

.zright {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.zright .zstatus { justify-self: auto; }
.ztools { display: flex; align-items: center; gap: 0.5rem; }

.ztool {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0 0.7rem;
  background: var(--ground-2);
  border: 2px solid var(--paper);
  color: var(--paper);
  cursor: pointer;
  font: 700 0.72rem/1 var(--f-type);
  text-transform: uppercase;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.2s var(--ease);
}

.ztool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ztool:hover { color: var(--yellow); border-color: var(--yellow); transform: translateY(-2px); }
.ztool kbd { margin-left: 0.15rem; }
#ztheme { padding: 0 0.55rem; }

kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0.05rem 0.35rem;
  border: 1.5px solid currentColor;
  border-bottom-width: 3px;
  font: 700 0.7rem/1.3 var(--f-type);
  text-align: center;
  text-transform: none;
  opacity: 0.8;
}

.skip-link {
  position: fixed;
  z-index: 100;
  left: 12px;
  top: -60px;
  padding: 0.6rem 1rem;
  background: var(--yellow);
  color: var(--ink);
  font: 800 0.9rem var(--f-body);
  text-decoration: none;
}

.skip-link:focus { top: 12px; }
.app-main:focus { outline: none; }

/* The More slip: grouped pages, each with what it is for. */
.zmenu {
  width: min(560px, calc(100vw - 16px));
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 0.9rem;
  transform-origin: top right;
}

.zmenu.is-open { animation: slip-in 0.28s var(--ease) both; }

@keyframes slip-in {
  from { opacity: 0; transform: translateY(-8px) rotate(1.2deg) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.zmenu-search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: var(--tap);
  margin-bottom: 0.7rem;
  padding: 0.3rem 0.7rem;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  cursor: pointer;
  font: 700 0.84rem var(--f-type);
  text-transform: uppercase;
  text-align: left;
}

.zmenu-search span { flex: 1; }
.zmenu-search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.zmenu-search:hover { background: var(--red); color: var(--ink); }

.zmenu-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem 1rem; }
.zmenu-group h3 { margin: 0.3rem 0 0.2rem; padding-bottom: 0.2rem; border-bottom: 2px solid var(--ink); font: 400 1.05rem/1 var(--f-head); letter-spacing: 0.06em; text-transform: uppercase; }
.zmenu-group ul { margin: 0; padding: 0; list-style: none; }
.zmenu a { align-items: flex-start; padding: 0.45rem 0.5rem; text-transform: none; }
.zmenu a svg { flex-shrink: 0; margin-top: 2px; }
.zmenu a b { display: block; font: 700 0.84rem var(--f-type); text-transform: uppercase; }
.zmenu a small { display: block; margin-top: 0.1rem; font: 400 0.76rem/1.3 var(--f-body); color: #3b3934; }

@media (max-width: 560px) {
  .zmenu-groups { grid-template-columns: minmax(0, 1fr); }
}

/* Search: a sheet dropped over a dimmed page. */
.has-overlay { overflow: hidden; }
.search-overlay { position: fixed; inset: 0; z-index: 90; display: grid; justify-items: center; align-items: start; padding: 12vh 12px 12px; }
.search-overlay[hidden] { display: none; }
.search-scrim { position: absolute; inset: 0; background: rgba(8, 8, 8, 0.72); backdrop-filter: blur(3px) grayscale(0.5); opacity: 0; transition: opacity 0.2s ease; }
.search-overlay.is-open .search-scrim { opacity: 1; }

.search-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  background: var(--sheet);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 10px 12px 0 var(--red), 0 30px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(-14px) rotate(-1deg) scale(0.98);
  opacity: 0;
  transition: transform 0.28s var(--ease), opacity 0.2s ease;
}

.search-overlay.is-open .search-panel { transform: none; opacity: 1; }

.search-field { display: flex; align-items: center; gap: 0.7rem; padding: 0.8rem 1rem; border-bottom: 3px solid var(--ink); }
.search-field svg { width: 24px; height: 24px; flex-shrink: 0; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.search-input { flex: 1; min-width: 0; padding: 0.3rem 0; background: none; border: 0; color: var(--ink); font: 400 1.6rem/1.1 var(--f-head); text-transform: uppercase; letter-spacing: 0.02em; }
.search-input::placeholder { color: #8b877d; }
.search-input:focus { outline: none; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-list { flex: 1; overflow-y: auto; margin: 0; padding: 0.4rem; list-style: none; }

.search-item {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 0.8rem;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}

.search-item.is-active { background: var(--yellow); box-shadow: inset 5px 0 0 var(--red); }
.search-kind { grid-row: span 2; display: inline-flex; align-items: center; gap: 0.35rem; font: 700 0.7rem var(--f-type); letter-spacing: 0.06em; text-transform: uppercase; color: #5d5a52; }
.search-swatch { display: inline-block; width: 10px; height: 10px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3); }
.search-label { font: 400 1.15rem/1.15 var(--f-head); text-transform: uppercase; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.search-meta { font-size: 0.82rem; color: #3b3934; }
.search-empty { padding: 1.2rem 0.8rem; font: 700 0.84rem var(--f-type); text-transform: uppercase; color: #5d5a52; }
.search-hint { margin: 0; padding: 0.55rem 1rem; border-top: 2px dashed rgba(16, 16, 16, 0.25); font: 700 0.72rem var(--f-type); text-transform: uppercase; color: #5d5a52; }
.search-hint kbd { margin: 0 0.1rem; }

/* Toasts: torn yellow notes. */
.toast-shelf { position: fixed; z-index: 95; right: 16px; bottom: 16px; display: grid; gap: 0.5rem; justify-items: end; pointer-events: none; }

.toast {
  position: relative;
  isolation: isolate;
  max-width: 340px;
  padding: 0.75rem 1.1rem;
  color: var(--ink);
  font: 700 0.86rem var(--f-type);
  text-transform: uppercase;
  transform: translateY(16px) rotate(2deg);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.25s ease;
}

.toast::before { content: ""; position: absolute; inset: 0; z-index: -1; background-color: var(--yellow); background-image: var(--fiber); background-blend-mode: multiply; filter: url(#tear-c) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45)); }
.toast--warn::before { background-color: var(--red); }
.toast.is-in { transform: rotate(-1deg); opacity: 1; }

.to-top {
  position: fixed;
  z-index: 50;
  right: 18px;
  bottom: 18px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: var(--red);
  color: var(--ink);
  border: 0;
  cursor: pointer;
  clip-path: polygon(8% 0, 100% 6%, 94% 100%, 0 92%);
  transition: transform 0.2s var(--ease);
}

.to-top[hidden] { display: none; }
.to-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.to-top:hover { transform: translateY(-4px) rotate(-4deg); }

.zfoot-keys a { color: inherit; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }

@media (max-width: 1100px) {
  .ztool-label, .ztool kbd { display: none; }
}

/* Phones: search becomes one round-cornered button in the bottom corner (the
   theme switch moves into the More slip); back-to-top sits above it. */
@media (max-width: 900px) {
  .zright { position: fixed; z-index: 55; right: 12px; bottom: 14px; }
  .ztool { width: 50px; height: 50px; justify-content: center; padding: 0; background: var(--red); color: var(--ink); border-color: var(--ink); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55); }
  .ztool svg { width: 22px; height: 22px; stroke-width: 2.4; }
  #ztheme { display: none; }
  .to-top { bottom: 74px; right: 13px; }
}

.zmenu-theme { display: none; }
@media (max-width: 900px) { .zmenu-theme { display: flex; } }

/* ==========================================================================
   Motion: sheets drop onto the page, the crumpled-paper reveal, page turns
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(34px) rotate(var(--reveal-tilt, -0.8deg)) scale(0.985);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.45s ease var(--reveal-delay, 0ms),
    transform 0.7s cubic-bezier(0.2, 1.25, 0.35, 1) var(--reveal-delay, 0ms);
}

.crumple-pending { visibility: hidden; }
.is-crumpling { position: relative; will-change: transform, clip-path; }

.crumple-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.crumple-shade { mix-blend-mode: multiply; }
.crumple-light { mix-blend-mode: screen; }
.crumple-creases { fill: none; stroke: rgba(30, 24, 14, 0.28); stroke-width: 0.25; vector-effect: non-scaling-stroke; }

/* Page turns (View Transitions): the old page slides out under the new sheet. */
.zhead { view-transition-name: zine-nav; }

::view-transition-old(root) { animation: page-out 0.24s cubic-bezier(0.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: page-in 0.42s cubic-bezier(0.16, 1, 0.3, 1) both; }
html[data-nav="back"]::view-transition-old(root) { animation-name: page-out-back; }
html[data-nav="back"]::view-transition-new(root) { animation-name: page-in-back; }

@keyframes page-out { to { opacity: 0; transform: translateX(-3%) rotate(-0.6deg); } }
@keyframes page-in { from { opacity: 0; transform: translateX(4%) rotate(0.8deg); } }
@keyframes page-out-back { to { opacity: 0; transform: translateX(3%) rotate(0.6deg); } }
@keyframes page-in-back { from { opacity: 0; transform: translateX(-4%) rotate(-0.8deg); } }

/* Every interactive sheet lifts a little under the pointer. */
.lift { transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.lift:hover { transform: translateY(-4px) rotate(-0.4deg); }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-in { opacity: 1; transform: none; transition: none; }
  .crumple-pending { visibility: visible; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .lift:hover { transform: none; }
}

/* ==========================================================================
   Tables: wide stat tables keep their first column while scrolling sideways
   ========================================================================== */

.table-scroll { position: relative; }

/* Only where the table can scroll sideways (phones, narrow windows). */
@media (max-width: 900px) {
  .table-scroll .data-table.sticky-first > thead > tr > :first-child,
  .table-scroll .data-table.sticky-first > tbody > tr > :first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #ebe8df;
    box-shadow: 2px 0 0 var(--line);
  }

  .table-scroll .data-table.sticky-first > tbody > tr:hover > :first-child { background: var(--yellow); }
}

.card-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

.csv-btn svg, .share-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ==========================================================================
   The day edition (light theme): newsprint ground, ink frame text. The nav
   bar and the home cover stay black: they are the masthead.
   ========================================================================== */

:root[data-theme="light"] {
  color-scheme: light;
  --ground: #e9e5da;
  --ground-2: #0e0e0e;
  --sheet: #fffefa;
  --fg: #101010;
  --fg-2: #34322d;
  --fg-3: #57544c;
  --line: rgba(16, 16, 16, 0.22);
  --line-strong: #101010;
  --surface: #f2efe6;
  --surface-2: #e2ded1;
  --field-bg: #fffdf8;
  --field-line: #101010;
  --pos: #11795a;
  --neg: #c4241a;
  --chart-grid: rgba(16, 16, 16, 0.12);
  --chart-axis: rgba(16, 16, 16, 0.45);
  --chart-base: #6e6a60;
  --chart-accent: #e2361b;
  --chart-surface: #e9e5da;
  --text-primary: var(--fg);
  --text-secondary: var(--fg-2);
  --text-muted: var(--fg-3);
  --border: var(--line);
  --positive: var(--pos);
  --negative: var(--neg);
  scrollbar-color: var(--red) var(--ground);
}

:root[data-theme="light"] .card::before,
:root[data-theme="light"] .scrap::before { filter: url(#tear-a) drop-shadow(0 7px 10px rgba(50, 38, 18, 0.22)); }
:root[data-theme="light"] .card:nth-of-type(3n + 2)::before { filter: url(#tear-c) drop-shadow(0 7px 10px rgba(50, 38, 18, 0.22)); }
:root[data-theme="light"] .card:nth-of-type(3n)::before { filter: url(#tear-b) drop-shadow(0 7px 10px rgba(50, 38, 18, 0.22)); }
:root[data-theme="light"] .phead .kicker-line { color: var(--red-ink); }
:root[data-theme="light"] .zfoot { color: var(--fg-2); }
:root[data-theme="light"] .zbrand,
:root[data-theme="light"] .zstatus,
:root[data-theme="light"] .ztool { border-color: var(--ink); }
:root[data-theme="light"] .empty-state { background: rgba(255, 255, 255, 0.4); }
:root[data-theme="light"] .cover { --fg: #ecebe5; --fg-2: #c9c7bf; color: #ecebe5; }
:root[data-theme="light"] .cover .go .link { color: #ecebe5; }
:root[data-theme="light"] .spinner-dark { border-color: rgba(16, 16, 16, 0.2); border-top-color: var(--red); }
:root[data-theme="light"] .home-band:not(.white) { background: #d9d4c6; }

/* ==========================================================================
   Print: ink on white, no chrome, sheets as plain boxes
   ========================================================================== */

@media print {
  :root, :root[data-theme="light"] {
    --ground: #fff;
    --fg: #000;
    --fg-2: #222;
    --fg-3: #444;
    --line: #999;
    --line-strong: #000;
    --surface: #fff;
    --surface-2: #eee;
    --chart-surface: #fff;
  }
  html, body { background: #fff !important; color: #000; }
  .zhead, .zmenu, .to-top, .ztools, .zright, .skip-link, .search-overlay, .toast-shelf,
  .bgpp, .cover-bg, .btn, .csv-btn, .share-btn, .tab-strip, .quick-picks, .chart-tooltip,
  .live-dot, .zfoot-keys, form { display: none !important; }
  .phead { padding-top: 0; }
  .phead h1 { font-size: 2.6rem; }
  .phead .kicker-line { color: #000; }
  .select, .input { background: #fff !important; color: #000 !important; border-color: #000 !important; }
  .select-wrap::after { background: #000; }
  .hl { color: #000; }
  .hl::before { display: none; }
  .card, .scrap { break-inside: avoid; border: 1.5px solid #000; padding: 1rem 1.2rem; margin-top: 1rem !important; }
  .card::before, .card::after, .scrap::before, .scrap::after,
  .cover::after, .home-band + .home-band::before { display: none !important; }
  .reveal, .crumple-pending { opacity: 1 !important; transform: none !important; visibility: visible !important; }
  .app-content { padding-bottom: 0; }
  .table-scroll { overflow: visible; }
  a { text-decoration: none; }
  .zfoot { border-top: 1px solid #000; padding-top: 0.6rem; }
}

/* ==========================================================================
   Character select: a fighting-game roster screen in the zine's ink. The
   arena takes the hovered player's team colors (--sel, --sel-alt).
   ========================================================================== */

@property --sel { syntax: "<color>"; inherits: true; initial-value: #ee3a1f; }
@property --sel-alt { syntax: "<color>"; inherits: true; initial-value: #f3e32a; }
@property --sel2 { syntax: "<color>"; inherits: true; initial-value: #f3e32a; }

.cs-arena {
  --sel: #ee3a1f;
  --sel-alt: #f3e32a;
  --sel2: #f3e32a;
  --fg: #ecebe5;
  --fg-2: #c9c7bf;
  --fg-3: #a5a49d;
  position: relative;
  isolation: isolate;
  margin-inline: calc(50% - 50vw);
  margin-top: -1.2rem;
  padding: clamp(1.4rem, 3vw, 2.4rem) clamp(16px, 4vw, 52px) 2rem;
  overflow: hidden;
  color: var(--fg);
  background: #0b0b0b;
  transition: --sel 0.45s ease, --sel-alt 0.45s ease, --sel2 0.45s ease;
}

.cs-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 70% at 18% 45%, color-mix(in srgb, var(--sel) 46%, transparent), transparent 70%),
    radial-gradient(50% 60% at 88% 60%, color-mix(in srgb, var(--sel-alt) 16%, transparent), transparent 70%),
    repeating-linear-gradient(112deg, color-mix(in srgb, var(--sel) 22%, transparent) 0 2px, transparent 2px 26px),
    radial-gradient(circle, rgba(255, 255, 255, 0.06) 0 1.2px, transparent 1.6px) 0 0 / 8px 8px;
  animation: cs-drift 18s linear infinite;
}

.cs-arena[data-mode="2p"].is-p2 .cs-bg {
  background:
    radial-gradient(55% 70% at 15% 45%, color-mix(in srgb, var(--sel) 40%, transparent), transparent 70%),
    radial-gradient(55% 70% at 85% 45%, color-mix(in srgb, var(--sel2) 40%, transparent), transparent 70%),
    repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 26px);
}

.cs-arena::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px), radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.7));
}

@keyframes cs-drift { to { background-position: 0 0, 0 0, 260px 0, 0 0; } }

.cs-flash { position: absolute; inset: 0; z-index: 30; pointer-events: none; background: #fff; opacity: 0; }
.cs-flash.is-on { animation: cs-flash 0.5s ease-out; }
@keyframes cs-flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }

.cs-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.1rem; }
.cs-kicker { margin-bottom: 0.4rem; font: 700 0.86rem var(--f-type); letter-spacing: 0.08em; text-transform: uppercase; color: var(--yellow); }
.cs-title { font: 400 clamp(2.6rem, 6.4vw, 5.6rem)/0.88 var(--f-head); text-transform: uppercase; letter-spacing: 0.01em; text-shadow: 0.05em 0.05em 0 rgba(0, 0, 0, 0.6); }
.cs-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.cs-search { width: min(320px, 100%); min-height: 46px; background: rgba(0, 0, 0, 0.55); color: var(--fg); border-color: var(--fg); }
.cs-season { min-height: 46px; background: rgba(0, 0, 0, 0.55); color: var(--fg); border-color: var(--fg); }
.cs-controls .select-wrap::after { background: var(--fg); }
.cs-random svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

.cs-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.2rem;
  padding: 0.2rem 0 0.6rem;
}

@media (max-width: 860px) {
  .cs-teams { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
}

/* Full-screen layouts without the page head start under the fixed nav. */
.app-main.is-headless .app-content { padding-top: var(--head-h); }
.app-main.is-headless .cs-arena,
.app-main.is-headless .vs-arena { margin-top: 0; }
.app-main.is-headless .cs-arena { padding-top: clamp(1.6rem, 3vw, 2.6rem); }

.cs-team {
  flex-shrink: 0;
  min-width: 46px;
  min-height: 34px;
  padding: 0.2rem 0.5rem;
  background: var(--chip, #2b2b2b);
  color: var(--chip-ink, var(--fg));
  border: 0;
  box-shadow: inset 0 -4px 0 var(--chip-alt, transparent);
  cursor: pointer;
  font: 400 0.95rem/1 var(--f-head);
  letter-spacing: 0.06em;
  clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
  opacity: 0.72;
  transition: opacity 0.15s ease, transform 0.2s var(--ease);
}

.cs-team:first-child { --chip: var(--paper); --chip-ink: var(--ink); }
.cs-team:hover { opacity: 1; transform: translateY(-2px); }
.cs-team.is-on { opacity: 1; transform: translateY(-3px); outline: 3px solid var(--yellow); outline-offset: -3px; }

.cs-stage {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  gap: clamp(1rem, 2.4vw, 2.2rem);
  align-items: start;
}

.cs-arena[data-mode="2p"] .cs-stage { grid-template-columns: minmax(240px, 330px) minmax(0, 1fr) minmax(240px, 330px); }

.cs-grid-wrap { position: relative; min-width: 0; }

.cs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  gap: 8px;
}

.cs-tile {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  aspect-ratio: 4 / 5;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  cursor: pointer;
  color: var(--tile-ink, #fff);
  background:
    radial-gradient(circle, rgba(0, 0, 0, 0.22) 0 1.2px, transparent 1.6px) 0 0 / 6px 6px,
    linear-gradient(160deg, var(--tile, #333) 55%, color-mix(in srgb, var(--tile, #333) 60%, #000));
  clip-path: polygon(7% 0, 100% 0, 93% 100%, 0 100%);
  transition: filter 0.18s ease, transform 0.18s var(--ease);
}

.cs-grid:hover .cs-tile:not(:hover):not(:focus-visible) { filter: saturate(0.55) brightness(0.7); }
.cs-tile:hover, .cs-tile:focus-visible { transform: translateY(-3px) scale(1.04); z-index: 2; outline: none; }
.cs-tile .player-thumb { grid-row: 1 / span 2; grid-column: 1; width: 100%; height: 100%; background: none; clip-path: none !important; }
.cs-tile .player-thumb img { object-fit: cover; object-position: center 10%; transform: scale(1.12) translateY(6%); transition: transform 0.3s var(--ease); }
.cs-tile:hover .player-thumb img { transform: scale(1.2) translateY(4%); }
.cs-tile .torn-photo-initials { font-size: 2rem; color: var(--tile-ink, #fff); }

.cs-tile-ovr {
  position: absolute;
  z-index: 2;
  top: 4px;
  left: 12%;
  font: 400 1.15rem/1 var(--f-head);
  color: var(--yellow);
  text-shadow: 2px 2px 0 #000;
}

.cs-tile-team { position: absolute; z-index: 2; top: 6px; right: 12%; font: 700 0.62rem var(--f-type); letter-spacing: 0.06em; opacity: 0.85; }

.cs-tile-name {
  position: relative;
  z-index: 2;
  grid-row: 2;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  padding: 0.2rem 0.5rem 0.3rem 0.7rem;
  background: rgba(8, 8, 8, 0.88);
  color: #f3f1ea;
  font: 400 0.92rem/1 var(--f-head);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-tile-name small { font: 700 0.55rem/1.2 var(--f-type); opacity: 0.75; overflow: hidden; text-overflow: ellipsis; }
.cs-tile.is-skeleton { background: #1c1c1c; cursor: default; }
.cs-tile.is-skeleton .skeleton { width: 100%; height: 100%; --surface: #1c1c1c; --surface-2: #2a2a2a; }

.cs-grid.is-in .cs-tile { animation: cs-tile-in 0.42s cubic-bezier(0.2, 1.3, 0.4, 1) both; animation-delay: calc(var(--i, 0) * 16ms); }
@keyframes cs-tile-in { from { opacity: 0; transform: translateY(18px) scale(0.82) rotate(-3deg); } }

.cs-tile.is-locked-p1 { box-shadow: inset 0 0 0 4px var(--red); }
.cs-tile.is-locked-p2 { box-shadow: inset 0 0 0 4px var(--yellow); }
.cs-tile.is-picked { animation: cs-pick 0.6s ease-out both; }
@keyframes cs-pick { 0% { filter: brightness(3); transform: scale(1.12); } 100% { filter: none; transform: scale(1.04); } }

.cs-cursor {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  pointer-events: none;
  border: 4px solid var(--red);
  box-shadow: 0 0 0 2px #000, 0 0 22px color-mix(in srgb, var(--red) 70%, transparent);
  clip-path: polygon(7% 0, 100% 0, 93% 100%, 0 100%);
  transition: transform 0.14s cubic-bezier(0.3, 1.4, 0.5, 1), width 0.14s ease, height 0.14s ease;
  animation: cs-pulse 1.1s ease-in-out infinite;
}

.cs-cursor.no-anim { transition: none; }
.cs-cursor[hidden] { display: none; }
.cs-cursor span { position: absolute; bottom: 3px; right: 9%; padding: 0.1rem 0.35rem; background: var(--red); color: #000; font: 400 0.82rem/1 var(--f-head); }
.cs-cursor--p2 { border-color: var(--yellow); box-shadow: 0 0 0 2px #000, 0 0 22px color-mix(in srgb, var(--yellow) 70%, transparent); }
.cs-cursor--p2 span { background: var(--yellow); }
@keyframes cs-pulse { 50% { filter: brightness(1.35); } }

.cs-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-top: 0.9rem; font: 700 0.78rem var(--f-type); text-transform: uppercase; color: var(--fg-2); }
.cs-foot .link-btn { color: var(--fg); }
.cs-empty { padding: 2rem 0; font: 700 0.9rem var(--f-type); text-transform: uppercase; color: var(--fg-2); }
.cs-alltime { margin-top: 1rem; }
.cs-alltime:empty { display: none; }
.cs-alltime-title { margin-bottom: 0.5rem; font: 400 1.2rem/1 var(--f-head); text-transform: uppercase; color: var(--yellow); }
.cs-alltime .player-result { background: rgba(255, 255, 255, 0.08); color: var(--fg); }
.cs-alltime .player-result:hover { color: var(--ink); }
.cs-help { margin-top: 1.4rem; font: 700 0.74rem var(--f-type); text-transform: uppercase; color: var(--fg-3); }
.cs-help kbd { margin: 0 0.1rem; }

/* The preview: the hovered (or locked) player, big. */
.cs-preview { position: sticky; top: calc(var(--head-h) + 0.6rem); min-height: 420px; }
.cs-preview:empty::before { content: "P2: choose"; display: grid; place-items: center; height: 420px; border: 3px dashed rgba(255, 255, 255, 0.25); font: 400 2rem var(--f-head); text-transform: uppercase; color: var(--fg-3); }
.cs-portrait { position: relative; max-width: 360px; }
.cs-portrait .torn-photo { filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.7)); }
.cs-slot { position: absolute; z-index: 3; left: -6px; bottom: 10px; padding: 0.15rem 0.5rem; background: var(--red); color: #000; font: 400 1.4rem/1 var(--f-head); transform: rotate(-4deg); }
.cs-preview--p2 .cs-slot { background: var(--yellow); left: auto; right: -6px; transform: rotate(4deg); }
.cs-info { position: relative; margin-top: 0.9rem; }
.cs-meta { font: 700 0.84rem var(--f-type); letter-spacing: 0.06em; text-transform: uppercase; color: var(--yellow); }

.cs-name {
  display: flex;
  flex-direction: column;
  margin: 0.25rem 0 0.7rem;
  font: 400 clamp(2.4rem, 4.4vw, 3.8rem)/0.86 var(--f-head);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: #f3f1ea;
  text-shadow: 0.06em 0.06em 0 var(--team, var(--red));
  overflow-wrap: anywhere;
}

.cs-name small { font-size: 0.42em; letter-spacing: 0.04em; text-shadow: none; color: var(--fg-2); }

.cs-ovr {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem 0.3rem;
  background: #000;
  border: 3px solid var(--yellow);
  transform: rotate(3deg);
}

.cs-ovr b { font: 400 2.4rem/0.9 var(--f-head); color: var(--yellow); }
.cs-ovr span { font: 700 0.58rem/1.15 var(--f-type); text-transform: uppercase; color: var(--fg-2); }
.cs-preview--p2 .cs-info { text-align: right; }
.cs-preview--p2 .cs-name { align-items: flex-end; }
.cs-preview--p2 .cs-ovr { right: auto; left: 0; transform: rotate(-3deg); }

.cs-bars { display: grid; gap: 0.32rem; margin: 0 0 0.8rem; padding: 0; list-style: none; }
.cs-bars li { display: grid; grid-template-columns: 7.6rem minmax(0, 1fr) 2rem; align-items: center; gap: 0.55rem; }
.cs-bar-label { font: 700 0.7rem var(--f-type); text-transform: uppercase; color: var(--fg-2); }
.cs-bar { position: relative; height: 12px; background: rgba(255, 255, 255, 0.1); clip-path: polygon(0 0, 100% 0, 98.5% 100%, 0 100%); }
.cs-bar-fill { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: linear-gradient(90deg, var(--team, var(--red)), color-mix(in srgb, var(--team, var(--red)) 55%, #fff)); box-shadow: inset -3px 0 0 var(--yellow); }
.cs-bars b { font: 400 1.15rem/1 var(--f-head); text-align: right; }
.cs-line { font: 700 0.8rem var(--f-type); text-transform: uppercase; color: var(--fg-2); }
.cs-line b { font: 400 1.1rem var(--f-head); color: var(--fg); }
.cs-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.cs-preview--p2 .cs-tags { justify-content: flex-end; }
.cs-tag { padding: 0.15rem 0.5rem; border: 2px solid var(--fg); font: 700 0.68rem var(--f-type); text-transform: uppercase; }
.cs-locked { position: absolute; z-index: 4; right: -4%; top: 6%; margin: 0; color: var(--yellow); background: rgba(0, 0, 0, 0.72); mix-blend-mode: normal; font-size: 1.7rem; --stamp-tilt: 8deg; }
.cs-preview--p2 .cs-locked { right: auto; left: -4%; --stamp-tilt: -8deg; }

.cs-preview.is-new .cs-portrait { animation: cs-fighter-in 0.38s cubic-bezier(0.2, 1.1, 0.3, 1) both; }
.cs-preview--p2.is-new .cs-portrait { animation-name: cs-fighter-in-right; }
.cs-preview.is-new .cs-name { animation: cs-slam 0.34s cubic-bezier(0.2, 1.6, 0.4, 1) 0.05s both; }
.cs-preview.is-new .cs-ovr { animation: stamp-thunk 0.34s cubic-bezier(0.2, 1.4, 0.4, 1) 0.12s both; --stamp-tilt: 3deg; }
.cs-preview.is-new .cs-bar-fill { animation: cs-bar 0.6s var(--ease) both; animation-delay: calc(0.1s + var(--d, 0ms)); }
.cs-preview.is-locked .cs-portrait .torn-photo { filter: drop-shadow(0 0 22px color-mix(in srgb, var(--team, var(--red)) 80%, #fff)) drop-shadow(0 18px 24px rgba(0, 0, 0, 0.7)); }
@keyframes cs-fighter-in { from { opacity: 0; transform: translateX(-34px) skewX(8deg); } }
@keyframes cs-fighter-in-right { from { opacity: 0; transform: translateX(34px) skewX(-8deg); } }
@keyframes cs-slam { from { opacity: 0; transform: scale(1.5) rotate(-2deg); } }
@keyframes cs-bar { from { width: 0; } }

@media (max-width: 1100px) {
  .cs-arena[data-mode="2p"] .cs-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cs-arena[data-mode="2p"] .cs-grid-wrap { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 860px) {
  .cs-stage { grid-template-columns: minmax(0, 1fr); }
  .cs-preview { position: relative; top: 0; min-height: 0; display: grid; grid-template-columns: minmax(120px, 38%) minmax(0, 1fr); gap: 0.9rem; align-items: end; }
  .cs-preview:empty::before { height: 140px; font-size: 1.4rem; }
  .cs-info { margin-top: 0; }
  .cs-ovr { position: static; display: inline-flex; margin-bottom: 0.6rem; }
  .cs-name { font-size: clamp(1.9rem, 7vw, 2.8rem); }
  .cs-bars li { grid-template-columns: 6.2rem minmax(0, 1fr) 1.8rem; }
  .cs-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
  .cs-tile-name { font-size: 0.8rem; }
  .cs-locked { font-size: 1.2rem; }
}

@media (max-width: 520px) {
  .cs-preview { grid-template-columns: minmax(0, 1fr); }
  .cs-portrait { max-width: 220px; }
  .cs-arena[data-mode="2p"] .cs-stage { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .cs-bg { animation: none; }
  .cs-cursor { animation: none; transition: none; }
}

/* Players: the strip above a profile. */
.player-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.2rem; }
.player-switch .player-search { flex: 1 1 320px; }
.player-switch .input { min-height: 44px; }

/* ==========================================================================
   VS screen (Compare)
   ========================================================================== */

.vs-arena {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0 minmax(0, 1fr);
  margin-inline: calc(50% - 50vw);
  margin-top: -1.2rem;
  min-height: 460px;
  overflow: hidden;
  background: #0b0b0b;
}

.vs-arena::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(104deg, var(--left) 0 calc(50% - 3px), #0b0b0b calc(50% - 3px) calc(50% + 3px), var(--right) calc(50% + 3px)),
    #0b0b0b;
}

.vs-arena::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle, rgba(0, 0, 0, 0.28) 0 1.4px, transparent 1.8px) 0 0 / 7px 7px,
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px),
    radial-gradient(110% 100% at 50% 50%, transparent 50%, rgba(0, 0, 0, 0.65));
  pointer-events: none;
}

.vs-side {
  position: relative;
  display: grid;
  grid-template-columns: minmax(160px, 300px) minmax(0, 1fr);
  align-items: end;
  gap: 1.2rem;
  padding: 2.4rem clamp(16px, 4vw, 52px) 2rem;
  color: var(--team-ink, #fff);
  animation: vs-left-in 0.6s cubic-bezier(0.2, 1, 0.3, 1) both;
}

.vs-side--left { padding-right: 84px; }
.vs-side--right { grid-template-columns: minmax(0, 1fr) minmax(160px, 300px); padding-left: 84px; text-align: right; animation-name: vs-right-in; }
.vs-side--right .torn-photo { order: 2; }
.vs-side--right .vs-id { order: 1; }
@keyframes vs-left-in { from { opacity: 0; transform: translateX(-60px); } }
@keyframes vs-right-in { from { opacity: 0; transform: translateX(60px); } }

.vs-slot { position: absolute; top: 1rem; left: clamp(16px, 4vw, 52px); padding: 0.1rem 0.5rem; background: #000; color: var(--red); font: 400 1.5rem/1 var(--f-head); }
.vs-side--right .vs-slot { left: auto; right: clamp(16px, 4vw, 52px); color: var(--yellow); }
.vs-meta { font: 700 0.84rem var(--f-type); text-transform: uppercase; letter-spacing: 0.06em; }
.vs-name { margin: 0.3rem 0 0.8rem; font: 400 clamp(2.2rem, 4.6vw, 4.4rem)/0.88 var(--f-head); text-transform: uppercase; text-shadow: 0.05em 0.05em 0 rgba(0, 0, 0, 0.45); overflow-wrap: anywhere; }
.vs-name a { color: inherit; text-decoration: none; }
.vs-name a:hover { text-decoration: underline; text-decoration-thickness: 4px; }
.vs-season { max-width: 180px; }
.vs-side--right .vs-season { margin-left: auto; }
.vs-season label { color: inherit; opacity: 0.85; }
.vs-season .select { background: rgba(0, 0, 0, 0.45); color: #fff; border-color: currentColor; min-height: 40px; }
.vs-season .select-wrap::after { background: #fff; }
.vs-ovr { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.9rem; padding: 0.3rem 0.7rem; background: #000; border: 3px solid var(--yellow); color: var(--fg); transform: rotate(-2deg); }
.vs-ovr b { font: 400 2.6rem/0.9 var(--f-head); color: var(--yellow); }
.vs-ovr span { font: 700 0.6rem/1.15 var(--f-type); text-transform: uppercase; color: #c9c7bf; text-align: left; }

.vs-splat { position: relative; z-index: 4; width: 0; }

.vs-splat span {
  position: absolute;
  left: 0;
  top: 50%;
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  transform: translate(-50%, -50%) rotate(-8deg);
  background: var(--yellow);
  color: var(--ink);
  font: 400 4rem/1 var(--f-head);
  clip-path: polygon(50% 0%, 58.2% 13.9%, 71.7% 5%, 73.1% 21.1%, 89.1% 18.8%, 83.3% 33.9%, 98.7% 38.9%, 87% 50%, 98.7% 61.1%, 83.3% 66.1%, 89.1% 81.2%, 73.1% 78.9%, 71.7% 95%, 58.2% 86.1%, 50% 100%, 41.8% 86.1%, 28.3% 95%, 26.9% 78.9%, 10.9% 81.2%, 16.7% 66.1%, 1.3% 61.1%, 13% 50%, 1.3% 38.9%, 16.7% 33.9%, 10.9% 18.8%, 26.9% 21.1%, 28.3% 5%, 41.8% 13.9%);
  filter: drop-shadow(0 8px 0 #000);
}

.vs-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem !important; }

.tot { display: grid; gap: 0.45rem; }
.tot-head, .tot-row { display: grid; grid-template-columns: minmax(0, 1fr) 9rem minmax(0, 1fr); align-items: center; gap: 0.8rem; }
.tot-head { padding-bottom: 0.5rem; border-bottom: 3px solid var(--line-strong); font: 400 1.1rem/1 var(--f-head); text-transform: uppercase; }
.tot-head span:nth-child(2) { text-align: center; font: 700 0.74rem var(--f-type); color: var(--fg-2); }
.tot-head span:last-child { text-align: right; }
.tot-side { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); align-items: center; gap: 0.6rem; }
.tot-right { grid-template-columns: minmax(0, 1fr) 2.6rem; }
.tot-side b { font: 400 1.6rem/1 var(--f-head); }
.tot-right b { text-align: right; }
.tot-bar { position: relative; height: 16px; background: var(--surface-2); }
.tot-bar span { position: absolute; top: 0; bottom: 0; box-shadow: inset 0 0 0 1.5px var(--ink); }
.tot-left .tot-bar span { right: 0; }
.tot-right .tot-bar span { left: 0; }
.tot-label { text-align: center; font: 700 0.8rem var(--f-type); text-transform: uppercase; }
.tot-row.lead-left .tot-left b, .tot-row.lead-right .tot-right b { color: var(--red-ink); }
.tot-row.lead-left .tot-label::before { content: "◂ "; color: var(--red-ink); }
.tot-row.lead-right .tot-label::after { content: " ▸"; color: var(--red-ink); }

.vs-table td.is-best { background: color-mix(in srgb, var(--yellow) 55%, transparent); font-weight: 700; }

.twin-list { display: grid; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }

.twin {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: var(--tap);
  padding: 0.35rem 0.6rem;
  background: var(--surface);
  border: 2px solid var(--ink);
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s var(--ease), background 0.15s ease;
}

.twin:hover { background: var(--yellow); transform: translateX(4px); }
.twin-sim { font: 400 1.5rem/1 var(--f-head); color: var(--red-ink); }
.twin-name { font-weight: 800; }
.twin-name small { display: block; font: 700 0.72rem var(--f-type); text-transform: uppercase; color: var(--fg-3); }
.twin-go { font: 400 1rem var(--f-head); }

@media (max-width: 860px) {
  .vs-arena { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 0 auto; }
  .vs-arena::before { background: linear-gradient(176deg, var(--left) 0 calc(50% - 3px), #0b0b0b calc(50% - 3px) calc(50% + 3px), var(--right) calc(50% + 3px)); }
  .vs-side, .vs-side--right { grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); text-align: left; padding: 2.2rem 16px 1.6rem; }
  .vs-side--right .torn-photo { order: 0; }
  .vs-side--right .vs-id { order: 1; }
  .vs-side--right .vs-season { margin-left: 0; }
  .vs-side--right .vs-slot { right: auto; left: 16px; }
  .vs-splat { width: auto; height: 0; }
  .vs-splat span { left: 50%; top: 0; width: 96px; height: 96px; font-size: 2.6rem; }
  .tot-head, .tot-row { grid-template-columns: minmax(0, 1fr) 5.6rem minmax(0, 1fr); gap: 0.4rem; }
  .tot-side { grid-template-columns: 2rem minmax(0, 1fr); }
  .tot-right { grid-template-columns: minmax(0, 1fr) 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .vs-side { animation: none; }
}

/* ==========================================================================
   Tonight: the slate bar and game cards
   ========================================================================== */

.slate-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.8rem 1.4rem; align-items: center; }
.slate-nav { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }

.slate-step {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  cursor: pointer;
  font: 400 1.7rem/1 var(--f-head);
  clip-path: polygon(10% 0, 100% 6%, 90% 100%, 0 94%);
  transition: background 0.15s ease, transform 0.2s var(--ease);
}

.slate-step:hover:not(:disabled) { background: var(--red); transform: scale(1.08) rotate(-3deg); }
.slate-step:disabled { opacity: 0.3; cursor: default; }
.slate-date { font: 400 clamp(2rem, 5vw, 3.6rem)/1 var(--f-head); text-transform: uppercase; overflow-wrap: anywhere; }
.slate-weekday { font-family: var(--f-pen); text-transform: lowercase; color: var(--red-ink); font-size: 0.9em; margin-right: 0.15em; }
.slate-year { font-size: 0.45em; color: var(--fg-3); vertical-align: middle; }
.slate-tools { display: flex; align-items: center; gap: 0.5rem; }
.slate-picker { width: auto; min-height: 44px; }
@media (max-width: 640px) {
  .slate-bar { grid-template-columns: minmax(0, 1fr); }
  .slate-nav { justify-content: space-between; }
  .slate-date { font-size: clamp(1.7rem, 8.5vw, 2.4rem); text-align: center; }
  .slate-step { width: 44px; height: 44px; font-size: 1.4rem; }
  .slate-tools { justify-content: space-between; }
}
.slate-summary { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.slate-summary:empty { display: none; }
.slate-chip { display: inline-flex; align-items: baseline; gap: 0.35rem; padding: 0.25rem 0.7rem; background: var(--surface-2); font: 700 0.8rem var(--f-type); text-transform: uppercase; clip-path: polygon(0 8%, 3% 0, 97% 6%, 100% 0, 100% 92%, 97% 100%, 3% 94%, 0 100%); }
.slate-chip b { font: 400 1.25rem/1 var(--f-head); }
.slate-chip.is-hot { background: var(--red); }

.live-note { display: flex; align-items: center; gap: 0.55rem; font: 700 0.8rem var(--f-type); text-transform: uppercase; color: var(--fg-2); }
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(238, 58, 31, 0.6); animation: live-pulse 1.4s ease-out infinite; }
.live-dot.is-off { background: var(--fg-3); animation: none; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 9px rgba(238, 58, 31, 0); } 100% { box-shadow: 0 0 0 0 rgba(238, 58, 31, 0); } }

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 1.6rem 1.4rem; }

.game-card {
  --fg: var(--ink);
  --fg-2: #3b3934;
  --fg-3: #5d5a52;
  --line: rgba(16, 16, 16, 0.24);
  --surface: #f0ede4;
  --surface-2: #e6e2d6;
  --pos: #11795a;
  --neg: #c4241a;
  --chart-grid: rgba(16, 16, 16, 0.12);
  --chart-axis: rgba(16, 16, 16, 0.45);
  --chart-base: #6e6a60;
  --chart-accent: #e2361b;
  --chart-surface: var(--sheet);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.1rem 1.1rem 1rem;
  color: var(--ink);
  background-color: var(--sheet);
  background-image: var(--fiber);
  background-blend-mode: multiply;
  clip-path: polygon(0 1.2%, 3% 0, 30% 0.8%, 62% 0, 97% 1%, 100% 0, 99.4% 40%, 100% 98.5%, 96% 100%, 64% 99.2%, 30% 100%, 2% 99%, 0 100%, 0.6% 60%);
  transform: rotate(var(--tilt, 0deg));
}

.game-card:nth-child(3n + 1) { --tilt: -0.5deg; }
.game-card:nth-child(3n + 2) { --tilt: 0.4deg; }
.game-card.lift:hover { transform: translateY(-4px) rotate(0deg); }
.game-card.is-loading { background: none; clip-path: none; }
.game-card.is-favorite { box-shadow: inset 0 0 0 4px var(--yellow); }
.game-card.is-live { box-shadow: inset 0 0 0 4px var(--red); }
.game-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; font: 700 0.76rem var(--f-type); text-transform: uppercase; color: var(--fg-2); }
.game-status { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ink); }
.game-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 0.4rem; }

.game-team {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.6rem 0.7rem 0.55rem;
  background:
    radial-gradient(circle, rgba(0, 0, 0, 0.16) 0 1.3px, transparent 1.7px) 0 0 / 7px 7px,
    var(--slab);
  color: var(--slab-ink);
  text-decoration: none;
  clip-path: polygon(0 3%, 4% 0, 100% 2%, 98% 100%, 3% 97%);
  transition: transform 0.2s var(--ease);
}

.game-team--home { clip-path: polygon(2% 2%, 96% 0, 100% 4%, 100% 97%, 0 100%); }
.game-team:hover { transform: translateY(-2px) rotate(-1deg); }
.game-team-side { font: 700 0.62rem var(--f-type); text-transform: uppercase; opacity: 0.85; }
.game-team-abbr { font: 400 2.3rem/0.95 var(--f-head); letter-spacing: 0.02em; }
.game-team-name { font: 700 0.72rem/1.2 var(--f-body); text-transform: uppercase; opacity: 0.9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-team-prob { margin-top: 0.4rem; font: 400 1.8rem/1 var(--f-head); }
.game-team-prob small { font-size: 0.55em; }
.game-at { align-self: center; font: 400 1.3rem var(--f-pen); color: var(--fg-3); }

.game-bar { display: flex; gap: 3px; height: 10px; }
.game-bar-fill { height: 100%; transition: width 0.6s var(--ease); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
.game-pick { font-size: 0.92rem; }
.game-line { font-size: 0.9rem; }
.game-line b, .game-pick b { font-weight: 800; }

.game-final { display: flex; align-items: baseline; justify-content: center; gap: 0.8rem; padding: 0.3rem 0; border-block: 2px dashed var(--line); font: 700 0.9rem var(--f-type); text-transform: uppercase; color: var(--fg-3); }
.game-final b { font: 400 2.2rem/1 var(--f-head); color: var(--fg-3); }
.game-final .is-winner, .game-final .is-winner b { color: var(--ink); }
.game-final-dash { font: 400 1.6rem var(--f-head); }
.game-stamp { align-self: flex-start; font-size: 1.15rem; padding: 0.25rem 0.6rem; border-width: 4px; }
.game-card .stamp--tilt { --stamp-tilt: -4deg; }
.game-live { padding: 0.5rem 0.6rem; background: var(--surface); }
.game-live-score { display: flex; justify-content: space-between; align-items: baseline; font: 700 0.8rem var(--f-type); text-transform: uppercase; }
.game-live-score b { font: 400 1.9rem/1 var(--f-head); }
.game-live-prob { margin: 0.2rem 0; font-size: 0.86rem; }
.game-live-chart { margin-top: 0.2rem; }
.game-injuries { margin: 0; padding: 0.4rem 0 0; border-top: 1px dashed var(--line); list-style: none; font-size: 0.8rem; color: var(--fg-2); }
.game-injuries li + li { margin-top: 0.15rem; }
.game-injuries b { font: 700 0.74rem var(--f-type); color: var(--ink); }
.game-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1rem; margin-top: auto; }
.game-actions .link-btn { color: var(--ink); }
.tn-method summary { color: var(--ink); }

/* ==========================================================================
   Report card, standings, leaders, gallery
   ========================================================================== */

.report-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.8rem 1.6rem; }
.report-head .text-muted { flex: 1 1 360px; max-width: 80ch; font-size: 0.92rem; }
.receipt-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 2rem; align-items: center; }
.receipt .tabloid-headline { font-size: clamp(2.2rem, 5.4vw, 4.4rem); }

.grade-stamp {
  display: grid;
  place-items: center;
  width: 170px;
  height: 170px;
  border: 7px solid var(--red-ink);
  border-radius: 50%;
  color: var(--red-ink);
  text-align: center;
  transform: rotate(-9deg);
  mix-blend-mode: multiply;
}

.grade-letter { font: 400 5.6rem/0.9 var(--f-head); }
.grade-note { max-width: 120px; margin-top: -1.2rem; font: 700 0.62rem/1.2 var(--f-type); text-transform: uppercase; }
.tier-list { display: grid; gap: 0.75rem; }
.tier-row { display: grid; grid-template-columns: 8rem minmax(0, 1fr) 4.4rem; align-items: center; gap: 0.7rem; }
.tier-name { font: 400 1.15rem/1 var(--f-head); text-transform: uppercase; }
.tier-name small { display: block; margin-top: 0.15rem; font: 700 0.66rem var(--f-type); color: var(--fg-3); }
.tier-track { position: relative; height: 18px; background: var(--surface-2); }
.tier-fill { position: absolute; inset: 0 auto 0 0; background: var(--chart-accent); border-radius: 0 4px 4px 0; }
.tier-expected { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; background: var(--ink); }
.tier-value { text-align: right; font: 400 1.4rem/1 var(--f-head); }
.tier-value small { display: block; font: 700 0.66rem var(--f-type); color: var(--fg-3); }
.tier-key { display: inline-block; width: 3px; height: 14px; background: var(--ink); }
.month-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 0.5rem; margin-top: 1rem; }
.month-cell { display: flex; flex-direction: column; padding: 0.45rem 0.6rem; border: 2px solid var(--ink); background: var(--surface); }
.month-name { font: 700 0.7rem var(--f-type); text-transform: uppercase; color: var(--fg-2); }
.month-cell b { font: 400 1.6rem/1 var(--f-head); }
.month-cell small { font: 700 0.68rem var(--f-type); color: var(--fg-3); }
.chart--square { max-width: 420px; margin: 0 auto; }
.chart .is-faint { opacity: 0.35; }
.chart-label.is-strong { font-weight: 700; fill: var(--fg); }

@media (max-width: 640px) {
  .receipt-grid { grid-template-columns: minmax(0, 1fr); }
  .grade-stamp { width: 130px; height: 130px; }
  .grade-letter { font-size: 4.2rem; }
  .tier-row { grid-template-columns: 6rem minmax(0, 1fr) 3.6rem; }
}

.standings-grid { grid-template-columns: minmax(0, 1fr); }
.standings-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.8rem 1.4rem; }
.standings-bar .card-tools { margin-left: auto; }
.standings-note { margin-top: 0.8rem; font-size: 0.86rem; }
.standings-team { display: flex; align-items: center; gap: 0.55rem; min-width: 13rem; }
.standings-team .rank { width: 1.4rem; color: var(--fg-3); text-align: right; }
.team-dot { display: inline-grid; place-items: center; min-width: 2.6rem; padding: 0.1rem 0.3rem; font: 400 0.86rem/1.2 var(--f-head); letter-spacing: 0.04em; }
.standings-name { flex: 1; font-family: var(--f-body); font-weight: 800; text-transform: none; }
.star-btn { width: 30px; height: 30px; padding: 0; background: none; border: 0; color: var(--fg-3); cursor: pointer; font-size: 1.05rem; line-height: 1; opacity: 0.45; transition: transform 0.2s var(--ease), opacity 0.15s ease, color 0.15s ease; }
tr:hover .star-btn, .star-btn:focus-visible { opacity: 1; }
.star-btn:hover { transform: scale(1.3) rotate(-12deg); color: var(--red-ink); }
.star-btn.is-on { opacity: 1; color: var(--red-ink); }
.data-table tbody tr.is-favorite > * { background: color-mix(in srgb, var(--yellow) 35%, transparent); }
.data-table tbody tr.is-favorite > :first-child { box-shadow: inset 5px 0 0 var(--red); }
.data-table tbody tr.is-below-playin > td, .data-table tbody tr.is-below-playin > th { border-top: 3px dashed var(--red); }
.cutoff-key.is-playin { border-top-style: dashed; }
.streak-cell { font-weight: 700; }
.data-table .is-up { color: var(--pos); }
.data-table .is-down { color: var(--neg); }
.sos-cell { display: grid; grid-template-columns: minmax(80px, 1fr) 3.6rem; align-items: center; gap: 0.5rem; min-width: 150px; }
.sos-track { height: 10px; background: var(--surface-2); }
.sos-fill { display: block; height: 100%; background: var(--chart-accent); border-radius: 0 3px 3px 0; }
.sos-cell b { text-align: right; }

.leaders-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.6rem; }
.leader-group { display: flex; flex-direction: column; gap: 0.35rem; }
.leader-group-label { font: 800 0.72rem var(--f-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-2); }
.leader-season { margin-left: auto; }

.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 1rem; margin: 0.6rem 0 1.4rem; }

.podium-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding-bottom: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  transition: transform 0.25s var(--ease);
}

.podium-step:hover { transform: translateY(-6px) rotate(-1deg); }
.podium-step .torn-photo { width: 78%; }
.podium-1 .torn-photo { width: 100%; }
.podium-2 { padding-top: 2.2rem; }
.podium-3 { padding-top: 3.6rem; }
.podium-rank { position: absolute; top: 0; left: 6%; z-index: 4; display: grid; place-items: center; width: 46px; height: 46px; background: var(--red); color: var(--ink); font: 400 1.7rem/1 var(--f-head); clip-path: polygon(10% 0, 100% 6%, 90% 100%, 0 94%); }
.podium-2 .podium-rank { top: 2.2rem; background: var(--ink); color: var(--paper); }
.podium-3 .podium-rank { top: 3.6rem; background: var(--surface-2); }
.podium-name { margin-top: 0.4rem; font: 400 clamp(1.1rem, 2vw, 1.6rem)/1 var(--f-head); text-transform: uppercase; }
.podium-value { font: 400 clamp(2rem, 4vw, 3.2rem)/1 var(--f-head); color: var(--red-ink); }
.podium-meta { font: 700 0.72rem var(--f-type); text-transform: uppercase; color: var(--fg-3); }

.leader-list { display: grid; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }

.leader-row {
  display: grid;
  grid-template-columns: 2rem minmax(10rem, 15rem) minmax(0, 1fr) 4.4rem;
  align-items: center;
  gap: 0.7rem;
  min-height: 40px;
  padding: 0.2rem 0.4rem;
  color: var(--fg);
  text-decoration: none;
  border-top: 1px dashed var(--line);
}

.leader-row:hover { background: var(--yellow); }
.leader-rank { font: 400 1.1rem var(--f-head); color: var(--fg-3); text-align: right; }
.leader-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-name small { font: 700 0.7rem var(--f-type); color: var(--fg-3); }
.leader-track { height: 14px; background: var(--surface-2); }
.leader-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; box-shadow: inset 0 0 0 1.5px var(--ink); }
.leader-value { text-align: right; font: 400 1.35rem/1 var(--f-head); font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .podium { gap: 0.4rem; }
  .podium-rank { width: 34px; height: 34px; font-size: 1.2rem; }
  .leader-row { grid-template-columns: 1.6rem minmax(0, 1fr) 3.6rem; }
  .leader-track { display: none; }
}

.scenario-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1.2rem; }
.scenario-grid > .empty-state { grid-column: 1 / -1; }

.scenario-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.1rem 1.1rem 1rem;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.scenario-card.lift:hover { box-shadow: 9px 10px 0 var(--red); }
.scenario-stripe { display: flex; height: 8px; margin: -1.1rem -1.1rem 0.5rem; }
.scenario-stripe span { flex: 1; }
.scenario-tag { font: 700 0.7rem var(--f-type); letter-spacing: 0.08em; text-transform: uppercase; color: var(--red-ink); }
.scenario-title { font: 400 1.6rem/1 var(--f-head); text-transform: uppercase; overflow-wrap: anywhere; }
.scenario-blurb { font-size: 0.9rem; color: var(--fg-2); }
.scenario-moves { font: 700 0.72rem var(--f-type); text-transform: uppercase; color: var(--fg-3); }
.scenario-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: auto; padding-top: 0.5rem; }
.scenario-actions .btn { min-height: 44px; font-size: 1.05rem; padding: 0.5rem 1.1rem; }

/* ==========================================================================
   Home: tonight's slate and your team; Teams schedule; Current Season
   injuries; Assistant extras
   ========================================================================== */

.slate-band { padding-block: clamp(3rem, 6vw, 4.5rem) clamp(3.5rem, 7vw, 5.5rem); }
.slate-band-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.slate-band .h2 { font-size: clamp(2.6rem, 6vw, 5rem); }
.slate-when { font: 700 0.9rem var(--f-type); color: var(--fg-2); vertical-align: middle; }
.home-slate { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 0.8rem; }

.slate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0.2rem 0.6rem;
  padding: 0.7rem 0.9rem 0.6rem;
  background-color: var(--sheet);
  background-image: var(--fiber);
  background-blend-mode: multiply;
  color: var(--ink);
  text-decoration: none;
  clip-path: polygon(0 3%, 3% 0, 97% 4%, 100% 0, 100% 96%, 97% 100%, 3% 95%, 0 100%);
}

.slate-row:nth-child(2n) { transform: rotate(0.5deg); }
.slate-team { display: flex; align-items: center; gap: 0.45rem; }
.slate-team:last-of-type { justify-content: flex-end; }
.slate-team b { font: 400 1.5rem/1 var(--f-head); color: #5d5a52; }
.slate-team.is-winner b { color: var(--ink); }
.slate-at { font: 700 0.7rem var(--f-type); text-transform: uppercase; color: #5d5a52; }
.slate-note { grid-column: 1 / -1; font: 700 0.7rem var(--f-type); text-transform: uppercase; color: #3b3934; }
.slate-more { display: grid; place-items: center; font: 400 1.4rem var(--f-head); text-transform: uppercase; }

.your-team-hint { margin: -0.6rem 0 1.2rem; font-size: 0.9rem; color: var(--fg-2); }
.your-team-hint a { color: inherit; text-decoration-color: var(--red); text-decoration-thickness: 2px; }

.your-team {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 1.4rem;
  margin-bottom: 1.2rem;
  padding: 0.9rem 1.2rem 0.9rem 1.6rem;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.16) 0 1.3px, transparent 1.7px) 0 0 / 7px 7px, var(--team);
  color: var(--team-ink);
  text-decoration: none;
  box-shadow: inset 8px 0 0 var(--team-alt);
  clip-path: polygon(0 4%, 2% 0, 99% 3%, 100% 96%, 98% 100%, 1% 97%);
}

.your-team-kick { font: 700 0.72rem var(--f-type); letter-spacing: 0.08em; text-transform: uppercase; }
.your-team-name { font: 400 clamp(1.6rem, 3vw, 2.4rem)/1 var(--f-head); text-transform: uppercase; }
.your-team-fact { font: 700 0.8rem var(--f-type); text-transform: uppercase; }
.your-team-fact b { font: 400 1.3rem var(--f-head); }

.fav-btn[aria-pressed="true"] { background: var(--yellow); }
.mini-prob { display: inline-block; width: 64px; height: 8px; background: var(--surface-2); }
.mini-prob span { display: block; height: 100%; background: var(--chart-accent); border-radius: 0 3px 3px 0; }
.schedule-scroll { max-height: 520px; overflow-y: auto; }
.schedule-table tr.is-upcoming th, .schedule-table tr.is-upcoming td { color: var(--fg-2); }
.schedule-table tr.is-next th, .schedule-table tr.is-next td { background: color-mix(in srgb, var(--yellow) 45%, transparent); color: var(--fg); }
.schedule-table thead th { position: sticky; top: 0; z-index: 3; background: #ebe8df; }

.injury-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0.9rem 1.2rem; }
.injury-team .team-dot { display: inline-block; margin-bottom: 0.35rem; padding: 0.15rem 0.5rem; text-decoration: none; font-size: 0.95rem; }
.injury-team ul { margin: 0; padding: 0; list-style: none; font-size: 0.86rem; }
.injury-team li { padding: 0.2rem 0; border-top: 1px dashed var(--line); }
.injury-team li b { display: block; }
.injury-team li span { font: 700 0.7rem var(--f-type); text-transform: uppercase; color: var(--fg-3); }
.injury-team li.is-out span { color: var(--red-ink); }

.chat-team { color: inherit; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 2px; }
.chat-mini { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; margin: 0.6rem 0 0.2rem; }
.chat-mini-label { font: 700 0.76rem var(--f-type); text-transform: uppercase; }
.chat-mini-bar { display: flex; gap: 3px; height: 12px; }
.chat-mini-bar span { height: 100%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
.chat-links { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin-top: 0.4rem !important; }
.chat-followups { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; padding-top: 0.6rem; border-top: 1px dashed var(--line); }

/* ==========================================================================
   Game context, forecasts, market, awards, lottery, rivalry, recap, pick'em
   ========================================================================== */

/* Tonight: who is missing and how tired, the market line, players to watch */
.ctx { display: grid; gap: 0.35rem; padding: 0.5rem 0 0.1rem; border-top: 1px dashed var(--line); font-size: 0.82rem; }
.ctx-side { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.ctx-side > b { font: 700 0.74rem var(--f-type); margin-right: 0.15rem; }
.ctx-flag { padding: 0.05rem 0.4rem; background: var(--surface-2); font: 700 0.68rem var(--f-type); text-transform: uppercase; }
.ctx-out {
  min-height: 30px;
  padding: 0.1rem 0.5rem;
  background: var(--ink);
  border: 0;
  color: var(--paper);
  font: 600 0.78rem var(--f-body);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s var(--ease);
}
.ctx-out small { color: var(--yellow); font-weight: 800; }
.ctx-out:hover { transform: translateY(-1px) rotate(-1deg); }
.ctx-out.is-back { background: var(--surface-2); color: var(--fg-3); text-decoration: line-through; }
.ctx-out.is-back small { color: var(--fg-3); }
.ctx-out:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.ctx-minor, .ctx-none { color: var(--fg-3); font-size: 0.76rem; }
.ctx-none { margin: 0; }
.ctx-prob { margin: 0.1rem 0 0; }
.ctx-prob b { font-weight: 800; }
.ctx-warn { padding: 0 0.3rem; border: 1px solid var(--fg-3); font: 700 0.62rem var(--f-type); text-transform: uppercase; color: var(--fg-3); }
.game-market { margin: 0; font-size: 0.84rem; color: var(--fg-2); }
.game-market b { color: var(--fg); }
.game-market .badge { margin-left: 0.3rem; font-size: 0.66rem; }
.game-watch { font-size: 0.82rem; }
.game-watch summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; font: 700 0.72rem var(--f-type); text-transform: uppercase; }
.game-watch ul { margin: 0.2rem 0 0; padding: 0; list-style: none; }
.game-watch li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.1rem 0.6rem; padding: 0.15rem 0; border-top: 1px dashed var(--line); }
.game-watch a { color: var(--fg); font-weight: 700; text-decoration-color: var(--red); }

/* Players: next-game forecast */
.fc-head { margin-bottom: 0.8rem; }
.fc-title { margin: 0.35rem 0 0; font: 400 clamp(1.4rem, 3vw, 2rem)/1.05 var(--f-head); text-transform: uppercase; }
.fc-list { display: grid; gap: 0.7rem; }
.fc-row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 6.5rem; grid-template-areas: "label track value" ". meta meta"; align-items: center; gap: 0.15rem 0.8rem; }
.fc-label { grid-area: label; font: 700 0.78rem var(--f-type); text-transform: uppercase; }
.fc-track { grid-area: track; position: relative; height: 26px; background: var(--surface); }
.fc-range { position: absolute; top: 5px; bottom: 5px; background: color-mix(in srgb, var(--chart-accent) 30%, transparent); }
.fc-mid { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--chart-accent); }
.fc-dot { position: absolute; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--fg-2); opacity: 0.6; }
.fc-value { grid-area: value; text-align: right; font-variant-numeric: tabular-nums; }
.fc-value b { font: 400 1.5rem/1 var(--f-head); }
.fc-value small { display: block; color: var(--fg-3); font-size: 0.74rem; }
.fc-meta { grid-area: meta; color: var(--fg-3); font-size: 0.76rem; }
.c-band { fill: var(--chart-accent); opacity: 0.16; }

/* Model vs Market */
.mk-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.8rem; }
.mk-tally { display: flex; align-items: center; justify-content: center; gap: 1.2rem; margin: 0.6rem 0 1rem; }
.mk-side { display: grid; justify-items: center; gap: 0.2rem; }
.mk-big { font: 400 clamp(3rem, 9vw, 5.6rem)/0.9 var(--f-head); }
.mk-vs { font: 400 1.6rem var(--f-head); color: var(--red-ink); transform: rotate(-6deg); }
.mk-grades td.is-better { font-weight: 800; background: color-mix(in srgb, var(--yellow) 45%, transparent); }
.mk-table tr.is-hot > * { background: color-mix(in srgb, var(--yellow) 30%, transparent); }
.mk-gap-cell { min-width: 150px; }
.mk-gap-cell small { margin-left: 0.4rem; font-weight: 700; }
.mk-gap { position: relative; display: inline-block; width: 110px; height: 12px; vertical-align: middle; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.mk-gap::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--fg); }
.mk-gap-fill { position: absolute; top: 0; bottom: 0; }

/* Draft lottery */
.lt-stage { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.lt-machine { position: relative; display: grid; justify-items: center; }
.lt-drum {
  position: relative;
  width: min(280px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.1) 45%, rgba(0, 0, 0, 0.12) 75%), var(--surface);
  box-shadow: inset 0 0 0 6px var(--ink), inset 0 -18px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.lt-ball {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.85), transparent 45%), var(--c);
  color: var(--ink);
  font: 400 0.95rem var(--f-head);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.25), 0 2px 3px rgba(0, 0, 0, 0.25);
  transition: left 0.55s var(--ease), top 0.55s var(--ease), opacity 0.4s ease 0.3s;
}
.lt-machine.is-spinning .lt-ball { animation: lt-tumble 0.55s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -71ms); }
.lt-ball.is-drawn { animation: none !important; left: calc(50% - 17px); top: calc(100% - 30px); opacity: 0; }
.lt-chute { width: 46px; height: 26px; margin-top: -6px; background: var(--ink); clip-path: polygon(0 0, 100% 0, 80% 100%, 20% 100%); }
.lt-tray { display: flex; justify-content: center; gap: 0.35rem; min-height: 40px; margin-top: 0.4rem; }
.lt-ball.is-tray { position: relative; left: auto; top: auto; animation: lt-drop 0.5s var(--ease); }
@keyframes lt-drop { from { transform: translateY(-40px) scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lt-tumble {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(calc((var(--i) - 7) * 4px), -70px) rotate(140deg); }
  66% { transform: translate(calc((7 - var(--i)) * 5px), -120px) rotate(260deg); }
  100% { transform: translate(calc((var(--i) - 7) * 2px), -20px) rotate(360deg); }
}
.lt-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.lt-slot {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.3rem 0.6rem 0.3rem 0;
  background: var(--surface);
  font-size: 0.88rem;
}
.lt-pick { display: grid; place-items: center; align-self: stretch; background: var(--ink); color: var(--paper); font: 400 1.2rem var(--f-head); }
.lt-team { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-move { font: 700 0.74rem var(--f-type); color: var(--fg-3); white-space: nowrap; }
.lt-slot.is-hidden .lt-team { color: var(--fg-3); }
.lt-slot.is-revealed { background: var(--team); color: var(--team-ink); animation: lt-flip 0.45s var(--ease); }
.lt-slot.is-revealed .lt-move { color: inherit; }
.lt-slot.is-revealed:nth-child(-n + 4) .lt-pick { background: var(--red); color: var(--ink); }
@keyframes lt-flip { from { transform: rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.lt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-top: 1rem; }
.lt-heat { background: color-mix(in srgb, var(--chart-accent) calc(var(--a) * 100%), transparent); min-width: 2.1rem; }
.lt-odds th, .lt-odds td { padding-inline: 0.35rem; }
.lt-swatch { display: inline-block; width: 10px; height: 10px; margin-right: 0.45rem; vertical-align: baseline; }

/* Head-to-head */
.h2h-hero { overflow: hidden; }
.h2h-sides { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 0.6rem; }
.h2h-side { display: grid; justify-items: center; gap: 0.1rem; padding: 0.8rem 0.6rem; text-decoration: none; text-align: center;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.16) 0 1.3px, transparent 1.7px) 0 0 / 7px 7px, var(--a); color: var(--a-ink); }
.h2h-side--b { background: radial-gradient(circle, rgba(0, 0, 0, 0.16) 0 1.3px, transparent 1.7px) 0 0 / 7px 7px, var(--b); color: var(--b-ink); }
.h2h-abbr { font: 700 0.8rem var(--f-type); letter-spacing: 0.1em; }
.h2h-wins { font: 400 clamp(3.4rem, 10vw, 6rem)/0.9 var(--f-head); }
.h2h-side > span:last-child { font-weight: 700; font-size: 0.9rem; }
.h2h-vs { align-self: center; font: 400 2rem var(--f-head); color: var(--red-ink); transform: rotate(-8deg); }
.h2h-split { display: flex; height: 14px; margin: 0.8rem 0; gap: 3px; }
.h2h-facts { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin: 0; padding: 0; list-style: none; font-size: 0.9rem; }
.h2h-facts b { font-weight: 800; }
.h2h-seasons { display: flex; align-items: flex-end; gap: 4px; min-height: 150px; overflow-x: auto; padding-bottom: 0.3rem; }
.h2h-season { display: grid; justify-items: center; gap: 0.2rem; min-width: 26px; font-size: 0.66rem; }
.h2h-season-bar { position: relative; display: block; width: 18px; height: 100px; background: var(--b, var(--surface-2)); }
.h2h-season-bar i { position: absolute; left: 0; right: 0; bottom: 0; }
.h2h-season-label { font: 700 0.62rem var(--f-type); color: var(--fg-3); }
.h2h-model b { font: 400 2.6rem/1 var(--f-head); }
.h2h-big { margin: 0.5rem 0 0; }
.h2h-big .kicker { margin-right: 0.4rem; }

/* Season recap */
.recap-cover { --team: var(--red); --team-ink: var(--ink); }
.recap-champion { display: grid; margin: 0.6rem 0; padding: 0.9rem 1.1rem; background: radial-gradient(circle, rgba(0, 0, 0, 0.16) 0 1.3px, transparent 1.7px) 0 0 / 7px 7px, var(--team);
  color: var(--team-ink); font: 400 clamp(2.4rem, 7vw, 5rem)/0.92 var(--f-head); text-transform: uppercase; clip-path: polygon(0 4%, 2% 0, 98% 3%, 100% 0, 100% 96%, 98% 100%, 2% 97%, 0 100%); }
.recap-champion span { font: 700 0.8rem var(--f-type); letter-spacing: 0.12em; }
.recap-best { display: flex; flex-wrap: wrap; gap: 0.4rem 2rem; }
.recap-best p { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.recap-list { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.recap-game, .recap-surprise, .recap-swing { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.7rem; padding: 0.35rem 0; border-top: 1px dashed var(--line); font-size: 0.88rem; }
.recap-date { font: 700 0.72rem var(--f-type); color: var(--fg-3); }
.recap-teams b { font: 400 1.1rem var(--f-head); color: var(--fg-3); }
.recap-teams b.is-winner { color: var(--fg); }
.recap-odds { margin-left: auto; font-size: 0.8rem; color: var(--fg-2); }
.recap-surprise-text { flex: 1 1 12rem; }
.recap-surprise-bar { flex: 0 0 90px; height: 8px; background: var(--surface); }
.recap-surprise-bar i { display: block; height: 100%; }
.recap-surprise-bar .is-pos { background: var(--pos); }
.recap-surprise-bar .is-neg { background: var(--neg); }
.recap-surprise-diff { min-width: 3.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.recap-swing > span:not(.team-dot) { flex: 1 1 12rem; }
.delta-up { color: var(--pos); }
.delta-down { color: var(--neg); }
.recap-grade b { font: 400 2.2rem/1 var(--f-head); }

/* Pick'em */
.pk-tally { display: flex; flex-wrap: wrap; gap: 0.8rem 2.4rem; margin: 0.8rem 0; }
.pk-tally > div { display: grid; gap: 0.1rem; }
.pk-tally b { font: 400 clamp(2.6rem, 7vw, 4rem)/0.9 var(--f-head); }
.pk-tally small { color: var(--fg-3); font-size: 0.78rem; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 1rem; }
.pk-card { position: relative; padding: 0.7rem; background: var(--sheet); color: var(--ink); clip-path: polygon(0 2%, 3% 0, 97% 2%, 100% 0, 100% 98%, 97% 100%, 3% 98%, 0 100%); }
.pk-sides { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 0.4rem; }
.pk-at { align-self: center; font: 700 0.8rem var(--f-type); color: #5d5a52; }
.pk-team {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 0.1rem;
  min-height: 96px;
  padding: 0.55rem 0.6rem;
  background: #e6e2d6;
  border: 0;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s ease, box-shadow 0.2s ease;
}
.pk-team:hover:not(:disabled) { transform: translateY(-2px) rotate(-0.6deg); background: var(--yellow); }
.pk-team:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.pk-team.is-picked { background: radial-gradient(circle, rgba(0, 0, 0, 0.16) 0 1.3px, transparent 1.7px) 0 0 / 7px 7px, var(--team); color: var(--team-ink); box-shadow: inset 0 0 0 4px var(--ink); animation: pk-pop 0.35s var(--ease); }
.pk-team:disabled { cursor: default; opacity: 0.7; }
.pk-team:disabled.is-picked, .pk-team.is-winner { opacity: 1; }
.pk-team.is-winner::after { content: "W"; position: absolute; right: 0.5rem; bottom: 0.4rem; padding: 0 0.3rem; background: var(--ink); color: var(--yellow); font: 400 0.9rem/1.3 var(--f-head); }
.pk-abbr { font: 400 1.7rem/1 var(--f-head); }
.pk-name { font-weight: 700; font-size: 0.82rem; line-height: 1.2; }
.pk-model { font: 700 0.68rem var(--f-type); text-transform: uppercase; opacity: 0.85; }
.pk-score-num { position: absolute; right: 0.5rem; top: 0.4rem; font: 400 1.6rem var(--f-head); }
.pk-verdict { display: table; margin: 0.5rem 0 0 auto; }
.pk-locked { margin: 0.4rem 0 0; font: 700 0.7rem var(--f-type); text-transform: uppercase; color: #5d5a52; }
@keyframes pk-pop { 0% { transform: scale(0.94); } 60% { transform: scale(1.04) rotate(-1deg); } 100% { transform: none; } }

@media (max-width: 760px) {
  .lt-stage { grid-template-columns: 1fr; }
  .fc-row { grid-template-columns: 5rem minmax(0, 1fr) 5.2rem; }
  .h2h-wins { font-size: 3rem; }
  .mk-gap { width: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  .lt-machine.is-spinning .lt-ball, .lt-slot.is-revealed, .pk-team.is-picked { animation: none; }
}
.leader-list--awards .leader-name { white-space: normal; overflow: visible; }
.leader-list--awards .leader-name small { white-space: nowrap; }

/* Character select: team-colored spotlights and the team's letters, huge,
   behind the preview. */
.cs-lights { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.cs-lights i {
  position: absolute;
  top: -20%;
  width: 46%;
  height: 150%;
  background: conic-gradient(from 180deg at 50% 0%, transparent 0deg 166deg, color-mix(in srgb, var(--sel) 55%, transparent) 172deg 188deg, transparent 194deg);
  filter: blur(6px);
  mix-blend-mode: screen;
  opacity: 0.6;
  transform-origin: 50% 0%;
  animation: cs-sweep 7s ease-in-out infinite alternate;
  transition: background 0.4s ease;
}
.cs-lights i:first-child { left: -8%; }
.cs-lights i:last-child {
  right: -8%;
  background: conic-gradient(from 180deg at 50% 0%, transparent 0deg 166deg, color-mix(in srgb, var(--sel-alt) 45%, transparent) 172deg 188deg, transparent 194deg);
  animation-delay: -3.5s;
  animation-direction: alternate-reverse;
}
@keyframes cs-sweep { from { transform: rotate(-16deg); } to { transform: rotate(14deg); } }
.cs-bigname {
  position: absolute;
  right: clamp(8px, 3vw, 52px);
  top: 0.2rem;
  z-index: -1;
  pointer-events: none;
  font: 400 clamp(6rem, 17vw, 15rem)/0.8 var(--f-head);
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 2px color-mix(in srgb, var(--sel) 70%, white 10%);
  opacity: 0.32;
  text-transform: uppercase;
  white-space: nowrap;
}
.cs-bigname.is-new { animation: cs-bigname 0.55s var(--ease); }
@keyframes cs-bigname { from { transform: translateX(60px) skewX(-12deg); opacity: 0; } to { transform: none; opacity: 0.32; } }
.cs-sound[aria-pressed="true"] { background: var(--yellow); color: var(--ink); }
.cs-arena[data-mode="2p"] .cs-bigname { display: none; }
@media (prefers-reduced-motion: reduce) { .cs-lights i, .cs-bigname.is-new { animation: none; } }

/* Dialogs (alerts, embed) and the offline bar */
.sheet-dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; background: transparent; color: inherit; }
.sheet-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.sheet-dialog > .card { margin: 0; }
.check-row { display: flex; align-items: center; gap: 0.6rem; min-height: var(--tap); font-weight: 600; }
.check-row input { width: 20px; height: 20px; accent-color: var(--red); }
.check-group { margin: 0.6rem 0; padding: 0.4rem 0.8rem; border: 1px dashed var(--line); }
.check-group legend { padding: 0 0.3rem; font: 700 0.74rem var(--f-type); text-transform: uppercase; }
.embed-preview { display: grid; place-items: center; margin: 0.8rem 0; padding: 0.6rem; background: #141414; }
.embed-preview.is-light { background: #e9e5da; }
.embed-code { width: 100%; font: 0.8rem/1.4 var(--f-type); resize: vertical; }
.offline-bar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 60;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 0.45rem 0.9rem;
  background: var(--yellow);
  color: var(--ink);
  font: 700 0.78rem var(--f-type);
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.zmenu-alerts { margin-top: -0.3rem; }
.game-actions > span { display: inline-flex; gap: 1rem; }
