:root {
  --outfield: #0B2E1A;
  --outfield-deep: #071F12;
  --led: #F5C542;
  --led-dim: #c99220;
  --chalk: #F4F1E8;
  --navy: #0E1A2E;
  --navy-panel: #13233D;
  --foul: #D62828;
  --muted: #9BB0A0;
  --line: rgba(245, 197, 66, 0.22);
  --radius: 10px;
  --font-display: "Bebas Neue", Impact, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--chalk);
  background: var(--outfield-deep);
  line-height: 1.45;
}
.night-wash {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 70% -10%, rgba(245,197,66,0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 10% 100%, rgba(214,40,40,0.08), transparent 50%),
    linear-gradient(180deg, #0B2E1A 0%, #071F12 55%, #050E08 100%);
}
.on-air, .booth, .site-foot { position: relative; z-index: 1; }

.on-air {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.55rem 1rem;
  background: rgba(14, 26, 46, 0.94);
  border-bottom: 2px solid var(--foul);
  backdrop-filter: blur(8px);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--chalk); text-decoration: none;
}
.brand-text {
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  font-size: 1.45rem;
}
.on-air-mid { display: flex; gap: 0.4rem; flex-wrap: wrap; flex: 1; }
.pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.22rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(11,46,26,0.45);
}
.pill.amber { color: var(--led); border-color: rgba(245,197,66,0.45); }
.pill.live { color: #ff6b6b; border-color: rgba(214,40,40,0.55); display: inline-flex; align-items: center; gap: 0.35rem; }
.pill.live i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--foul);
  box-shadow: 0 0 8px var(--foul);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }
.clock { font-family: var(--font-mono); font-size: 0.78rem; color: var(--led); }

.booth { max-width: 1180px; margin: 0 auto; padding: 1rem 1rem 3rem; }

.hero-band {
  display: grid; gap: 1rem;
  grid-template-columns: 1fr;
  margin-bottom: 1.1rem;
}
@media (min-width: 860px) {
  .hero-band { grid-template-columns: 1.1fr 0.9fr; align-items: stretch; }
}
.hero-copy {
  background: linear-gradient(145deg, var(--navy-panel), var(--navy));
  border: 1px solid var(--line);
  border-left: 4px solid var(--led);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}
.kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--led);
  margin: 0 0 0.4rem;
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  letter-spacing: 0.03em;
  line-height: 0.95;
  margin: 0 0 0.65rem;
  color: var(--chalk);
}
.lede { margin: 0; color: var(--muted); max-width: 42rem; }
.hero-still {
  margin: 0; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}
.hero-still img { display: block; width: 100%; height: 100%; object-fit: cover; min-height: 200px; }

.split {
  display: grid; gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 960px) {
  .split { grid-template-columns: minmax(300px, 0.95fr) minmax(340px, 1.15fr); align-items: start; }
}

.panel {
  background: rgba(19, 35, 61, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 1rem;
  margin-bottom: 0.85rem;
}
.panel.wide { margin-bottom: 1rem; }
.panel-h {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  font-size: 1.25rem;
  margin-bottom: 0.7rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.panel-h.row { justify-content: space-between; }
.live {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--led);
  border: 1px solid rgba(245,197,66,0.4);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
}

.ctrl { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.82rem; color: var(--muted); }
.ctrl.grow { flex: 1; min-width: 140px; }
.team-select-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
input, select, button {
  font: inherit;
}
input, select {
  background: var(--outfield-deep);
  color: var(--chalk);
  border: 1px solid rgba(155,176,160,0.35);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
}
input:focus, select:focus { outline: 2px solid rgba(245,197,66,0.55); outline-offset: 1px; }

.digits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}
.digit-card {
  background: #050d08;
  border: 1px solid rgba(245,197,66,0.28);
  border-radius: 8px;
  padding: 0.55rem 0.4rem;
  text-align: center;
  box-shadow: inset 0 0 24px rgba(245,197,66,0.08);
}
.digit-card.tragic { border-color: rgba(214,40,40,0.45); box-shadow: inset 0 0 24px rgba(214,40,40,0.1); }
.d-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.d-val {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 2.8rem);
  color: var(--led);
  text-shadow: 0 0 12px rgba(245,197,66,0.55);
  line-height: 1;
}
.digit-card.tragic .d-val { color: #ff7a7a; text-shadow: 0 0 12px rgba(214,40,40,0.45); }
.d-val.sm { font-size: clamp(1.15rem, 4vw, 1.55rem); letter-spacing: 0.04em; }
.status-line { margin: 0 0 0.65rem; color: var(--muted); font-size: 0.92rem; }
.split-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem;
  border-top: 1px solid var(--line); padding-top: 0.55rem;
}
.m-label { display: block; font-size: 0.68rem; color: var(--muted); font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.m-val { font-weight: 600; color: var(--chalk); }

.hint { margin: 0 0 0.6rem; font-size: 0.86rem; color: var(--muted); }
.scenario-list { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.65rem; }
.scen-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.5rem;
  background: rgba(7,31,18,0.65);
  border-radius: 6px;
  border: 1px solid rgba(155,176,160,0.18);
}
.scen-meta { font-size: 0.86rem; }
.scen-meta small { display: block; color: var(--muted); font-family: var(--font-mono); font-size: 0.7rem; }
.seg { display: inline-flex; border: 1px solid rgba(155,176,160,0.3); border-radius: 6px; overflow: hidden; }
.seg button {
  background: transparent; color: var(--muted); border: 0;
  padding: 0.3rem 0.55rem; cursor: pointer; font-family: var(--font-mono); font-size: 0.75rem;
}
.seg button.active.w { background: rgba(245,197,66,0.22); color: var(--led); }
.seg button.active.l { background: rgba(214,40,40,0.25); color: #ff9a9a; }
.seg button.active.u { background: rgba(155,176,160,0.2); color: var(--chalk); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.btn {
  background: var(--navy);
  color: var(--chalk);
  border: 1px solid rgba(155,176,160,0.35);
  border-radius: 6px;
  padding: 0.42rem 0.7rem;
  cursor: pointer;
  font-size: 0.86rem;
}
.btn:hover { border-color: var(--led); color: var(--led); }
.btn.primary { background: var(--led); color: #1a1200; border-color: var(--led); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.05); color: #1a1200; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 0.28rem 0.55rem; font-size: 0.78rem; }

.board-list { list-style: none; margin: 0.7rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.board-list li {
  display: flex; justify-content: space-between; gap: 0.5rem; align-items: center;
  padding: 0.4rem 0.5rem; background: rgba(7,31,18,0.5); border-radius: 6px;
  font-size: 0.86rem;
}
.board-list button.linkish {
  background: none; border: 0; color: var(--led); cursor: pointer; font: inherit; padding: 0;
}

.canvas-wrap {
  background: #020805;
  border-radius: 8px;
  border: 1px solid rgba(245,197,66,0.2);
  overflow: hidden;
  aspect-ratio: 16 / 10;
}
#stage { display: block; width: 100%; height: 100%; }
.stage-cap { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--muted); }
.stage-ctrls { display: flex; gap: 0.35rem; }

.tabs { display: flex; gap: 0.35rem; margin-bottom: 0.55rem; }
.tab {
  background: transparent; border: 1px solid rgba(155,176,160,0.3);
  color: var(--muted); border-radius: 999px; padding: 0.28rem 0.75rem; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em;
}
.tab.active { background: rgba(245,197,66,0.15); color: var(--led); border-color: rgba(245,197,66,0.45); }
.table-scroll { overflow-x: auto; }
.stand-table {
  width: 100%; border-collapse: collapse; font-size: 0.86rem;
}
.stand-table th, .stand-table td {
  text-align: left; padding: 0.38rem 0.4rem;
  border-bottom: 1px solid rgba(155,176,160,0.15);
}
.stand-table th {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
}
.stand-table tr.focus td { background: rgba(245,197,66,0.08); }
.stand-table .clinched { color: var(--led); }
.stand-table .elim { color: #887; }

.editorial h2 {
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  font-size: 1.55rem;
  margin: 0 0 0.55rem;
}
.editorial p { color: var(--muted); }
.editorial details { margin: 0.45rem 0; }
.editorial summary { cursor: pointer; color: var(--chalk); font-weight: 600; }
.editorial code {
  font-family: var(--font-mono); font-size: 0.84em;
  background: rgba(0,0,0,0.35); padding: 0.05rem 0.3rem; border-radius: 4px;
}

.cheat-grid {
  display: grid; gap: 0.55rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.cheat-card {
  background: rgba(7,31,18,0.55);
  border: 1px solid rgba(155,176,160,0.2);
  border-radius: 8px;
  padding: 0.65rem 0.7rem;
}
.cheat-card h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  font-size: 1.15rem;
  color: var(--led);
}
.cheat-card ul { margin: 0; padding-left: 1.05rem; color: var(--muted); font-size: 0.86rem; }

.assumptions { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.assumptions li { margin-bottom: 0.35rem; }
.cite { font-size: 0.82rem; color: var(--muted); }
.cite a { color: var(--led); }

.nested-notes summary { cursor: pointer; color: var(--muted); font-size: 0.84rem; }
.sys-notes {
  margin: 0.4rem 0 0;
  max-height: 120px; overflow: auto;
  font-family: var(--font-mono); font-size: 0.68rem;
  color: var(--muted); white-space: pre-wrap;
  background: rgba(0,0,0,0.35); padding: 0.45rem; border-radius: 6px;
}

.site-foot {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.25rem 1rem 2rem;
  max-width: 1180px; margin: 0 auto;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.88rem;
}
.site-foot a { color: var(--led); }

@media (max-width: 640px) {
  .digits { grid-template-columns: 1fr 1fr 1fr; }
  .split-metrics { grid-template-columns: 1fr 1fr 1fr; }
  .on-air-right { width: 100%; }
}
