/**
 * TODD MITCHELL GAMEDAY — the design system.
 *
 * Broadcast, not dashboard. The reference is a stadium at night: deep ground,
 * hot light, hard edges, and objects that sit ON the screen rather than in it.
 *
 * The depth is built from four things, used consistently and never decoratively:
 *
 *   1. A ground plane — a dark gradient field with a slow light sweep across it,
 *      so panels have something to cast onto.
 *   2. Two shadows on every raised object: a tight contact shadow that says how
 *      close it is to the surface, and a wide ambient one that says how big it
 *      is. One shadow reads as a sticker; two read as an object.
 *   3. A lit top edge and a dark bottom edge (inset box-shadows). This is what
 *      actually makes a rectangle look bevelled — not a border.
 *   4. Movement on the Z axis when you press something. Buttons drop toward the
 *      surface and their contact shadow collapses.
 *
 * Everything obeys `prefers-reduced-motion`, and every animation is decoration
 * over a layout that is already correct without it.
 *
 * The audience is on a phone in a loud room with the game already on a TV, so
 * targets are big and nothing needs reading twice. The producer is on a laptop
 * in the dark with forty seconds, so their surfaces are denser but obey the same
 * rule: the thing you need is the biggest thing on the screen.
 *
 * One stylesheet, no build step, no framework.
 */

/* ------------------------------------------------------------------ tokens */

:root {
  /* Ink */
  --ink: #f4f6f9;
  --ink-dim: #a3adb9;
  --ink-faint: #6f7987;

  /* Ground. Three planes: the field, the panel, the raised panel. */
  --bg: #06070a;
  --bg-2: #0a0c11;
  --panel: #101319;
  --panel-2: #171b23;
  --panel-3: #1e232c;
  --line: rgba(255, 255, 255, 0.07);
  --line-bright: rgba(255, 255, 255, 0.14);

  /* Light */
  --live: #ff2d3f;
  --live-deep: #b3121e;
  --go: #25d366;
  --go-deep: #0d7a38;
  --warn: #ffb02e;
  --stop: #ff5347;
  --gold: #ffc94a;
  --accent: #ffb703;
  --accent-2: #ff6b35;
  --cool: #4d8dff;

  --home: #c8102e;
  --away: #d50a0a;

  /* Form */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --pad: 18px;

  /* Depth. `--lift-N` is the whole vocabulary; nothing invents its own shadow. */
  --lift-1:
    0 1px 2px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.35);
  --lift-2:
    0 2px 4px rgba(0, 0, 0, 0.6),
    0 10px 26px rgba(0, 0, 0, 0.45);
  --lift-3:
    0 4px 8px rgba(0, 0, 0, 0.65),
    0 22px 54px rgba(0, 0, 0, 0.55);
  --lift-4:
    0 8px 16px rgba(0, 0, 0, 0.7),
    0 40px 90px rgba(0, 0, 0, 0.6);

  /* The bevel: lit top edge, dark bottom edge. */
  --bevel:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  --bevel-strong:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.16),
    inset 0 -2px 0 rgba(0, 0, 0, 0.6);

  --sans: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(180deg, var(--bg-2), var(--bg) 46%);
}

/**
 * The gantry lights, on their own fixed layer.
 *
 * These used to be `background-attachment: fixed` on the body. That is one of
 * the reliable ways to make a long page stutter on a phone — every scroll frame
 * repaints the whole gradient — and this page is read on a phone, scrolling,
 * during a game. A fixed pseudo-element is composited once and never repainted.
 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    /* the hot spot, high and left, like a gantry light */
    radial-gradient(1100px 620px at 12% -8%, rgba(255, 183, 3, 0.10), transparent 62%),
    radial-gradient(900px 560px at 92% 4%, rgba(255, 45, 63, 0.09), transparent 60%),
    radial-gradient(1000px 700px at 50% 108%, rgba(77, 141, 255, 0.07), transparent 62%);
}

/**
 * Film grain. Without it, large dark gradients band badly on cheap panels —
 * which is most phones in a stadium. An SVG turbulence tile costs nothing and
 * fixes it.
 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > * { position: relative; z-index: 1; }

a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.025em; }

/* -------------------------------------------------------------- the band */

/**
 * The demo band. Red, at the top of every screen, and it does not scroll away.
 * The one failure this system exists to prevent is somebody making a decision
 * off numbers that were made up.
 */
.demo-band {
  position: sticky;
  top: 0;
  z-index: 95;
  padding: 8px 16px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background:
    repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.22) 0 14px, transparent 14px 28px),
    linear-gradient(180deg, #d61121, #8a0a15);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), 0 10px 30px rgba(214, 17, 33, 0.28);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.demo-band span {
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  opacity: 0.92;
}

/* --------------------------------------------------------------- top bar */

.top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 20px;
  position: sticky;
  top: 0;
  z-index: 90;
  background: linear-gradient(180deg, rgba(16, 19, 25, 0.94), rgba(10, 12, 17, 0.86));
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 14px 34px rgba(0, 0, 0, 0.5);
}
.demo-band + .top { top: 35px; }

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand .mark { filter: drop-shadow(0 3px 6px rgba(255, 183, 3, 0.4)); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand b {
  font-size: 15.5px;
  font-weight: 900;
  letter-spacing: -0.035em;
  white-space: nowrap;
  background: linear-gradient(96deg, #fff 18%, var(--gold) 62%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand i {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
  text-transform: uppercase;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.brand i .vz { opacity: 0.85; }

.nav { display: flex; gap: 3px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  padding: 8px 13px;
  border-radius: var(--r-sm);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.nav a[aria-current='page'] {
  color: #150e00;
  background: linear-gradient(180deg, var(--gold), var(--accent));
  box-shadow: var(--lift-1), var(--bevel-strong);
}

.whoami {
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--ink-faint);
  padding-left: 14px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}
.whoami b { color: var(--ink-dim); font-weight: 800; }

/* ---------------------------------------------------------------- layout */

.wrap { max-width: 1380px; margin: 0 auto; padding: 22px 20px 60px; }
.wrap.narrow { max-width: 880px; }

.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/**
 * The audience stage: the player wide, the room beside it. On a phone these
 * stack and the room goes UNDER the player — a chat column 150px wide is a chat
 * nobody can read, which is the whole product.
 */
.stage-row { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }

/* ----------------------------------------------------------------- cards */

/**
 * The raised panel. Glass over the ground plane, a lit top edge, two shadows.
 * The `::before` is a hairline gradient border — brighter where the light is,
 * which is what stops a row of cards reading as flat rectangles.
 */
.card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    linear-gradient(180deg, var(--panel), var(--bg-2));
  border-radius: var(--r-lg);
  padding: var(--pad);
  /* No backdrop-filter here on purpose: the panel gradient is opaque, so a blur
     behind it costs a GPU layer per card and shows nothing. It is kept only
     where there is real translucency — the top bar and the sponsor bug. */
  box-shadow: var(--lift-2), var(--bevel);
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.03) 42%, rgba(0, 0, 0, 0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
.card.flush { padding: 0; overflow: hidden; }
.card.sunk {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.16));
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.card h2, .section-title {
  font-size: 10.5px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h2 .glyph { color: var(--accent); opacity: 0.9; }

.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ---------------------------------------------------------------- badges */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink-dim);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
  box-shadow: var(--lift-1), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.pill.green { color: #86f0ab; background: linear-gradient(180deg, rgba(37, 211, 102, 0.3), rgba(13, 122, 56, 0.16)); }
.pill.amber { color: #ffd58a; background: linear-gradient(180deg, rgba(255, 176, 46, 0.3), rgba(160, 100, 10, 0.16)); }
.pill.red { color: #ffa8a0; background: linear-gradient(180deg, rgba(255, 83, 71, 0.3), rgba(150, 30, 22, 0.16)); }
.pill.gold { color: #1a1200; background: linear-gradient(180deg, var(--gold), var(--accent)); text-shadow: none; }
.pill.grey { opacity: 0.62; }

/** The LIVE lamp. A real light: a lit core, a hot halo, and a slow pulse. */
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: #fff;
  background: linear-gradient(180deg, var(--live), var(--live-deep));
  box-shadow:
    var(--lift-2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 26px rgba(255, 45, 63, 0.5);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.live-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px #fff, 0 0 20px rgba(255, 255, 255, 0.7);
  animation: pulse 1.7s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.78); } }

/* --------------------------------------------------------------- buttons */

/**
 * Buttons are objects. They sit above the surface, and pressing one moves it
 * toward the surface: it drops 2px and its contact shadow collapses. That pair
 * of changes is the whole illusion, and it is worth more than any hover colour.
 */
button, .btn {
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--ink);
  border: 0;
  border-radius: var(--r);
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, var(--panel-3), var(--panel-2));
  box-shadow: var(--lift-2), var(--bevel-strong);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease), filter 0.12s var(--ease);
}
button:hover:not(:disabled), .btn:hover { filter: brightness(1.16); transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(2px); box-shadow: var(--lift-1), var(--bevel); filter: brightness(0.96); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

button.go {
  color: #04220f;
  background: linear-gradient(180deg, #3ce87b, var(--go-deep));
  box-shadow: var(--lift-2), var(--bevel-strong), 0 0 22px rgba(37, 211, 102, 0.3);
}
button.danger {
  color: #fff;
  background: linear-gradient(180deg, #ff6b60, #a81a12);
  box-shadow: var(--lift-2), var(--bevel-strong), 0 0 22px rgba(255, 83, 71, 0.3);
}
button.big { padding: 18px 22px; font-size: 16px; border-radius: var(--r-lg); }
button.wide { width: 100%; }
button.small { padding: 8px 12px; font-size: 11.5px; border-radius: var(--r-sm); }
button.ghost { background: rgba(255, 255, 255, 0.05); box-shadow: var(--lift-1), inset 0 1px 0 rgba(255, 255, 255, 0.08); }

/**
 * Last, so it beats every variant above it.
 *
 * This matters more here than it looks. ACTIVATE is the highest-consequence
 * control in the product, and a disabled one that still renders as hot green —
 * because `.go` came later in the file and won the cascade — is a producer
 * reaching for a button that will not fire, at the one moment they have no time
 * to work out why. A dead control has to look dead: flat, unlit, no shadow.
 */
button:disabled, button:disabled:hover {
  opacity: 0.32;
  cursor: not-allowed;
  transform: none;
  filter: none;
  color: var(--ink-faint);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* ------------------------------------------------------------ vote buttons */

.vote-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/**
 * A vote button carries its own result. The `.fill` is a lit bar behind the
 * label that grows to the share — so the button IS the bar chart, rather than
 * sitting above one. It animates on a long easing because a number that snaps
 * looks like a bug and a number that eases looks like a broadcast graphic.
 */
.vote {
  position: relative;
  overflow: hidden;
  min-height: 66px;
  padding: 18px 16px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-align: left;
  justify-content: flex-start;
  isolation: isolate;
}
.vote .fill {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: 0;
  background: linear-gradient(90deg, rgba(255, 183, 3, 0.42), rgba(255, 107, 53, 0.2));
  box-shadow: inset -1px 0 0 rgba(255, 201, 74, 0.75);
  transition: width 0.75s var(--ease);
}
.vote .lbl { position: relative; }
.vote .pct {
  position: relative;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.vote[aria-pressed='true'] {
  box-shadow: var(--lift-2), var(--bevel-strong), 0 0 0 2px var(--accent) inset, 0 0 24px rgba(255, 183, 3, 0.28);
}
.vote[aria-pressed='true']::after {
  content: '✓';
  position: absolute;
  top: 7px;
  right: 9px;
  font-size: 11px;
  color: var(--accent);
}

/* ------------------------------------------------------------ scoreboard */

/**
 * The scoreboard is the one object on the page allowed real perspective. It is
 * a broadcast bug: a heavy slab, lit from above, with the crests standing
 * slightly proud of it.
 */
.scoreboard {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 40%),
    linear-gradient(180deg, #171b23, #0b0d12);
  box-shadow: var(--lift-3), var(--bevel-strong);
}
/* A cool rake of light across the slab. */
.scoreboard::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(104deg, transparent 34%, rgba(255, 255, 255, 0.055) 48%, transparent 60%);
}

.team { display: flex; align-items: center; gap: 14px; min-width: 0; }
.team.away { flex-direction: row-reverse; text-align: right; }
.team .crest {
  flex: none;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.75));
  transform: translateZ(0);
}
.team .who { min-width: 0; }
.team .name {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team .pts {
  font-size: 46px;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.55), 0 10px 26px rgba(0, 0, 0, 0.6);
}
.team.leading .pts { color: #fff; }
.team:not(.leading) .pts { color: var(--ink-dim); }

.period {
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: var(--r);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.65), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}
.period b {
  display: block;
  font-size: 15px;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(255, 201, 74, 0.45);
}

.provenance {
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--ink-faint);
  text-align: center;
}

/* ---------------------------------------------------------------- player */

.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 120% at 50% 0%, #14181f, #040507 72%);
  box-shadow: var(--lift-4), var(--bevel), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }

/** The honest empty state. A designed screen, not a fallback. */
.no-stream { padding: 30px; text-align: center; max-width: 480px; }
.no-stream .icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: radial-gradient(circle at 50% 30%, rgba(255, 183, 3, 0.22), rgba(255, 183, 3, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 32px rgba(255, 183, 3, 0.2);
}
.no-stream h3 { font-size: 18px; margin-bottom: 9px; letter-spacing: 0.01em; }
.no-stream p { color: var(--ink-dim); font-size: 13.5px; margin: 0; }

.stage .overlay { position: absolute; left: 14px; top: 14px; display: flex; gap: 8px; align-items: center; }

/** The sponsor bug. Glass, lit gold edge, standing off the video. */
.stage .sponsor-bug {
  position: absolute;
  right: 14px;
  bottom: 14px;
  max-width: 62%;
  padding: 11px 15px;
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(20, 23, 30, 0.9), rgba(8, 9, 12, 0.88));
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: var(--lift-3), inset 0 1px 0 rgba(255, 201, 74, 0.4), 0 0 0 1px rgba(255, 201, 74, 0.22);
  animation: bug-in 0.5s var(--ease) both;
}
@keyframes bug-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
.stage .sponsor-bug .k { font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); font-weight: 800; }
.stage .sponsor-bug .v { font-size: 14.5px; font-weight: 800; letter-spacing: -0.01em; }

/* ------------------------------------------------------------------ chat */

/**
 * The room scrolls inside itself, always. Without an upper bound the message
 * list grows to fit every message, which on a phone pushes Penalty Court and
 * the MVP board off the bottom of the page — the interactive layer, which is
 * the entire product, disappears under the chat.
 */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 380px; max-height: min(72vh, 620px); }
/* min-height:0 is what actually lets a flex child scroll rather than stretch. */
.chat-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 2px; display: flex; flex-direction: column; gap: 8px; }

.msg { font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; animation: msg-in 0.28s var(--ease) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg .h { font-weight: 800; color: var(--cool); margin-right: 6px; }

/** A Super Chat is a paid object, so it looks like one: raised, lit, coloured. */
.msg.super {
  padding: 11px 13px;
  border-radius: var(--r);
  color: #fff;
  background: linear-gradient(180deg, var(--tier, #1d6fe0), color-mix(in srgb, var(--tier, #1d6fe0) 62%, #000));
  box-shadow: var(--lift-2), var(--bevel-strong), 0 0 26px color-mix(in srgb, var(--tier, #1d6fe0) 40%, transparent);
}
.msg.super .h { color: rgba(255, 255, 255, 0.9); display: block; margin: 0 0 4px; }
.msg.super .amt { float: right; font-family: var(--mono); font-weight: 900; font-size: 12.5px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }

/* Paid pins hold the top of the room, but never more than half of it. */
.pinned {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 1 auto;
  max-height: 50%;
  overflow-y: auto;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.composer { display: flex; gap: 9px; margin-top: 12px; }

input[type='text'], input[type='number'], input[type='email'], textarea, select {
  font: inherit;
  color: var(--ink);
  width: 100%;
  padding: 12px 13px;
  border: 0;
  border-radius: var(--r);
  background: rgba(0, 0, 0, 0.42);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6), inset 0 0 0 1px var(--line-bright);
  transition: box-shadow 0.16s var(--ease);
}
input:focus, textarea:focus, select:focus {
  outline: 0;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6), inset 0 0 0 1.5px var(--accent), 0 0 20px rgba(255, 183, 3, 0.18);
}
input::placeholder { color: var(--ink-faint); }
label.field { display: block; }
label.field span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 800;
  margin-bottom: 6px;
}
input[type='range'] {
  width: 100%;
  height: 30px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}
input[type='range']::-webkit-slider-runnable-track {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--stop), var(--warn), var(--go));
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.7);
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -9px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #b9c0cb);
  box-shadow: var(--lift-2), inset 0 -2px 0 rgba(0, 0, 0, 0.25);
  cursor: grab;
}
input[type='range']::-moz-range-track { height: 9px; border-radius: 999px; background: linear-gradient(90deg, var(--stop), var(--warn), var(--go)); }
input[type='range']::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: #fff; box-shadow: var(--lift-2); }

/* --------------------------------------------------------------- tables */

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 800;
  padding: 11px 14px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--line);
}
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr { transition: background 0.14s var(--ease); }
tbody tr:hover { background: rgba(255, 255, 255, 0.028); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* ------------------------------------------------------- the sponsor board */

/**
 * A slot is a physical channel on a rack: a numbered cap with an LED in it, a
 * name, and one control. The LED is the state — you should be able to read the
 * whole board from across the room without a single word.
 */
.slot-row {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 15px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 0.16s var(--ease);
}
.slot-row:last-child { border-bottom: none; }
.slot-row:hover { background: rgba(255, 255, 255, 0.025); }

.slot-n {
  position: relative;
  display: grid;
  place-items: center;
  height: 42px;
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-faint);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.32));
  box-shadow: var(--bevel), inset 0 0 0 1px var(--line);
}
.slot-n::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #333a44;
}
.slot-row.green .slot-n { color: #86f0ab; }
.slot-row.green .slot-n::after { background: var(--go); box-shadow: 0 0 9px var(--go); }
.slot-row.amber .slot-n { color: #ffd58a; }
.slot-row.amber .slot-n::after { background: var(--warn); box-shadow: 0 0 9px var(--warn); }
.slot-row.red .slot-n { color: #ffa8a0; }
.slot-row.red .slot-n::after { background: var(--stop); box-shadow: 0 0 9px var(--stop); }

.slot-name { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: 0.05em; font-size: 13.5px; }
.slot-name .glyph { color: var(--ink-faint); flex: none; }
.slot-why { font-size: 12px; color: var(--ink-faint); margin-top: 3px; }

/* Whatever is on air pulses, gently, so the eye finds it. */
.slot-row.onair { background: linear-gradient(90deg, rgba(255, 45, 63, 0.14), transparent 62%); box-shadow: inset 3px 0 0 var(--live); }

/* ------------------------------------------------------------------ stats */

.stat { padding: 16px 18px; }
.stat .k { font-size: 9.5px; letter-spacing: 0.17em; text-transform: uppercase; color: var(--ink-faint); font-weight: 800; }
.stat .v {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  background: linear-gradient(180deg, #fff, #9aa5b3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat .v.sm { font-size: 21px; }
.stat .v :is(.live-dot, .pill) { -webkit-text-fill-color: initial; color: initial; }
.stat .v.unmeasured {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  background: none;
  -webkit-text-fill-color: var(--warn);
  color: var(--warn);
}
.stat .n { font-size: 11.5px; color: var(--ink-faint); margin-top: 5px; line-height: 1.4; }

/* --------------------------------------------------------------- rundown */

.run-row {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 13px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  transition: background 0.16s var(--ease);
}
.run-row:last-child { border-bottom: none; }
.run-row .t { font-family: var(--mono); color: var(--ink-faint); font-size: 12px; }
.run-row.done { opacity: 0.4; }
.run-row.skipped { opacity: 0.4; text-decoration: line-through; }
.run-row.live {
  background: linear-gradient(90deg, rgba(255, 45, 63, 0.16), transparent 70%);
  box-shadow: inset 3px 0 0 var(--live);
  opacity: 1;
}
.run-row.live .t { color: var(--live); font-weight: 800; }
.run-row.risk .t { color: var(--warn); }

/* ------------------------------------------------------------- the notes */

/**
 * The unmeasured block. Amber, bordered, never collapsed by default: this is
 * the most valuable part of a sponsor report, not its fine print.
 */
.note {
  border-left: 3px solid var(--warn);
  background: linear-gradient(90deg, rgba(255, 176, 46, 0.1), rgba(255, 176, 46, 0.02));
  padding: 12px 15px;
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 13px;
  color: var(--ink-dim);
  box-shadow: var(--lift-1);
}
.note b { color: var(--ink); }
.note.stop { border-left-color: var(--stop); background: linear-gradient(90deg, rgba(255, 83, 71, 0.11), rgba(255, 83, 71, 0.02)); }
.note.go { border-left-color: var(--go); background: linear-gradient(90deg, rgba(37, 211, 102, 0.1), rgba(37, 211, 102, 0.02)); }

.error { color: #ffa8a0; font-size: 13px; }

/* --------------------------------------------------------------- fan id */

/**
 * The Fan ID is a physical card: foil edge, holographic sheen, and it tilts
 * toward the pointer. `--mx`/`--my` are written by fan.js on pointer move.
 */
.fanid {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255, 201, 74, 0.2), transparent 58%),
    linear-gradient(150deg, #221803, #0c0e13 52%, #10131a);
  box-shadow: var(--lift-4), inset 0 1px 0 rgba(255, 201, 74, 0.4), 0 0 0 1px rgba(255, 201, 74, 0.24);
  transform: perspective(900px) rotateX(calc(var(--my, 0) * -5deg)) rotateY(calc(var(--mx, 0) * 7deg));
  transform-style: preserve-3d;
  transition: transform 0.35s var(--ease);
}
/* The sheen tracks the pointer across the foil. */
.fanid::after {
  content: '';
  position: absolute;
  inset: -40%;
  pointer-events: none;
  background: linear-gradient(102deg, transparent 38%, rgba(255, 255, 255, 0.14) 48%, transparent 58%);
  transform: translateX(calc(var(--mx, 0) * 26%));
  transition: transform 0.35s var(--ease);
}
.fanid > * { position: relative; z-index: 1; }

.fanid .lvl {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.9;
  background: linear-gradient(180deg, #fff2cc, var(--accent) 70%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 12px rgba(255, 183, 3, 0.35));
}
.fanid .handle { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; }

.meter {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8);
}
.meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--accent-2));
  box-shadow: 0 0 14px rgba(255, 183, 3, 0.6);
  transition: width 0.9s var(--ease);
}

.badges { display: flex; flex-wrap: wrap; gap: 8px; }

/* ----------------------------------------------------------------- shop */

.product { display: flex; flex-direction: column; gap: 12px; transition: transform 0.22s var(--ease); }
.product:hover { transform: translateY(-4px); }
.product .art {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--r);
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 22px;
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.06em;
  font-size: 15px;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  background: linear-gradient(150deg, var(--art-a, #202632), var(--art-b, #0c0f14));
  box-shadow: var(--lift-2), var(--bevel), inset 0 0 60px rgba(0, 0, 0, 0.5);
}
/* A ghosted chevron stack behind the product name — the GameDay mark as texture. */
.product .art::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0 3px, transparent 3px 26px);
}
.product .price { font-family: var(--mono); font-weight: 800; font-size: 15px; color: var(--gold); }

/* -------------------------------------------------------------- mobile */

@media (max-width: 1080px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .wrap { padding: 14px 13px 48px; }
  .cols-2, .cols-3, .cols-4, .stage-row { grid-template-columns: minmax(0, 1fr); }
  .team .pts { font-size: 34px; }
  .team { gap: 10px; }
  .nav a { padding: 7px 9px; font-size: 10.5px; }
  .whoami { display: none; }
  .top { flex-wrap: wrap; gap: 10px 12px; padding: 11px 14px; }
  .brand b { font-size: 14px; }
  .brand i { display: none; }
  .chat { min-height: 300px; }
  .run-row { grid-template-columns: 62px 1fr; }
  .run-row > :last-child { grid-column: 1 / -1; }
  .stat .v { font-size: 25px; }
  /* A card that tilts under a thumb is a card that fights the scroll. */
  .fanid { transform: none; }
  .fanid::after { transform: none; }
}

/* The audience page is a phone page first. Everything on it is thumb-sized. */
@media (max-width: 620px) {
  .vote { min-height: 72px; font-size: 15px; }
  button.big { padding: 17px; }
  .scoreboard { padding: 16px 14px; gap: 8px; }
  .period { padding: 6px 9px; }
}

/* --------------------------------------------------------------- motion */

/**
 * Every animation here is decoration over a layout that is already correct.
 * Turning them all off has to leave the product entirely usable, so it does.
 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .fanid, .fanid::after { transform: none !important; }
}

/* Scrollbars, because a default light scrollbar on this ground is a scar. */
* { scrollbar-color: rgba(255, 255, 255, 0.18) transparent; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); }
