:root {
  color-scheme: dark;
  --surface: #181818;
  --surface-raised: #222220;
  --text: #f5f3ee;
  --muted: #b3b1ab;
  --line: #3b3b37;
  --accent: #C74634;
  --transition-ms: 600ms;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--text); }
h1, h2, h3, p, dl, dd { margin: 0; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.display-shell { position: relative; min-height: 100dvh; overflow: hidden; isolation: isolate; }
/* Two presentation planes. The information plane is above the live plane. */
.display-pane { min-height: 100dvh; transition: opacity var(--transition-ms) ease, transform var(--transition-ms) cubic-bezier(.22,.68,.2,1); }
.live-pane { padding: 0 clamp(22px, 2.8vw, 70px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100dvh; }
.info-pane { position: absolute; inset: 0; z-index: 1; opacity: 0; transform: translateX(4%); pointer-events: none; background: var(--surface); }
.info-pane iframe { display: block; width: 100%; height: 100%; min-height: 100dvh; border: 0; }
.show-info .info-pane { opacity: 1; transform: translateX(0); pointer-events: auto; }
.show-info .live-pane { opacity: 0; transform: translateX(-4%); pointer-events: none; }
.display-header { min-height: 78px; height: 9dvh; max-height: 108px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 18px; min-width: 0; font-size: clamp(16px, 1.3vw, 28px); letter-spacing: -.025em; }
.brand img { width: clamp(36px, 3vw, 58px); height: auto; flex-shrink: 0; }
.brand b { font-weight: 750; }
.broadcast-label { display: flex; align-items: center; gap: 12px; font-size: clamp(12px, 1vw, 22px); color: var(--muted); }
.signal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.signal-dot.is-online { background: var(--accent); }
.display-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); gap: clamp(26px, 3.4vw, 84px); padding: clamp(22px, 3dvh, 42px) 0 14px; min-height: 0; }
.feed, .leaderboard { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: clamp(16px, 2.2dvh, 30px); }
.section-heading h1, .section-heading h2 { font-size: clamp(20px, 1.8vw, 40px); letter-spacing: -.045em; font-weight: 600; }
.section-heading > span { color: var(--muted); font-size: clamp(11px, .85vw, 20px); white-space: nowrap; }
.feed-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, .44fr); gap: clamp(16px, 1.6vw, 38px); min-height: 0; flex: 1; }
.game-screen { position: relative; min-width: 0; min-height: 0; background: #101117; overflow: hidden; border-radius: 4px; }
.game-screen canvas { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.game-screen.switching { animation: player-switch 450ms ease; }
.feed-message { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 24px; background: rgb(16 17 23 / .74); }
.feed-message[hidden] { display: none; }
.feed-message > span { font-size: clamp(10px, .75vw, 16px); letter-spacing: .1em; color: var(--accent); }
.feed-message strong { margin-top: 18px; font-size: clamp(26px, 2.5vw, 60px); letter-spacing: -.04em; font-weight: 500; }
.feed-message p { margin-top: 16px; color: #d4d1cb; line-height: 1.55; font-size: clamp(12px, 1vw, 22px); }
.pilot-rail { display: flex; flex-direction: column; gap: clamp(12px, 1.6dvh, 22px); padding-top: 6px; min-width: 0; }
.label, .pilot-stats dt { display: block; color: var(--muted); font-size: clamp(11px, .9vw, 20px); }
.pilot-name h2 { font-size: clamp(22px, 2.1vw, 48px); font-weight: 550; letter-spacing: -.04em; overflow-wrap: anywhere; margin: 10px 0 12px; line-height: 1.05; }
.mission { font-size: clamp(11px, .85vw, 20px); color: var(--accent); }
.pilot-stats { display: grid; gap: clamp(10px, 1.6dvh, 22px); }
.pilot-stats dd { margin-top: 6px; font-size: clamp(22px, 1.9vw, 42px); font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.pilot-stats .score-stat dd { color: var(--text); font-size: clamp(26px, 2.4vw, 55px); }
.pilot-stats .health-stat { display: flex; align-items: center; gap: 10px; min-height: 24px; }
.health-track { height: clamp(9px, 1.1dvh, 14px); flex: 1; min-width: 0; background: #30332f; border: 1px solid #484b44; border-radius: 20px; overflow: hidden; }
.health-track > span { display: block; width: 0; height: 100%; background: #83c499; transition: width 250ms ease, background-color 250ms ease; }
.health-track[data-tone="low"] > span { background: #ffb431; }
.health-track[data-tone="critical"] > span { background: var(--accent); }
.health-value { color: var(--text); font-size: clamp(12px, .95vw, 22px); min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }
.health-value:empty { display: none; }
.pilot-stats .lives-stat { display: flex; align-items: center; flex-wrap: wrap; gap: clamp(4px, .35vw, 8px); min-height: 26px; }
.life-heart { width: clamp(18px, 1.55vw, 34px); height: clamp(18px, 1.55vw, 34px); color: #605652; fill: transparent; stroke: currentColor; stroke-width: 1.5; flex: 0 0 auto; }
.life-heart.is-filled { color: var(--accent); fill: currentColor; }
.lives-stat[data-empty="true"] .life-heart { opacity: .5; }
.extra-lives { color: var(--muted); font-size: clamp(12px, .95vw, 22px); letter-spacing: 0; }
.pilot-events { margin-top: clamp(12px, 1.8dvh, 24px); }
.pilot-events h3 { font-size: clamp(10px, .75vw, 17px); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.event-list { display: grid; gap: clamp(4px, .5dvh, 7px); }
.event-list > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: clamp(23px, 2.5dvh, 34px); padding: 3px clamp(7px, .65vw, 14px); border: 1px solid #3b3b3c; border-radius: 24px; background: #202021; }
.event-list dt { display: flex; align-items: center; gap: clamp(6px, .5vw, 11px); color: #d2cec8; font-size: clamp(10px, .8vw, 18px); }
.event-list dd { font-size: clamp(11px, .9vw, 20px); font-weight: 600; font-variant-numeric: tabular-nums; }
.event-dot { flex: 0 0 auto; width: clamp(6px, .5vw, 11px); height: clamp(6px, .5vw, 11px); border-radius: 50%; background: var(--accent); }
.event-hits .event-dot { background: #ffb431; }
.event-powerups .event-dot { background: #21cde7; }
.event-lives .event-dot { background: var(--accent); }
.event-boss .event-dot { background: #aa66ff; }
.next-pilot { margin-top: auto; padding: 16px 0 4px; border-top: 1px solid var(--line); }
.next-pilot strong { display: block; margin-top: 8px; font-size: clamp(13px, 1.1vw, 24px); font-weight: 500; overflow-wrap: anywhere; }
#rotationTime { display: block; color: var(--muted); margin-top: 7px; font-size: clamp(11px, .8vw, 18px); font-variant-numeric: tabular-nums; }
.board-content { flex: 1; display: flex; flex-direction: column; gap: clamp(12px, 2dvh, 26px); min-height: 0; }
.leader-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(18px, 2vw, 44px); align-items: center; padding: clamp(18px, 2vw, 46px); background: var(--surface-raised); border-top: 3px solid var(--accent); border-radius: 0 0 4px 4px; }
.leader-rank { font-size: clamp(42px, 5vw, 112px); line-height: 1; font-weight: 400; letter-spacing: -.07em; color: var(--accent); }
.leader-name { display: block; font-size: clamp(23px, 2.5vw, 54px); font-weight: 500; letter-spacing: -.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leader-score { display: block; margin-top: 12px; font-size: clamp(28px, 3vw, 70px); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.leader-meta { margin-top: 6px; color: var(--muted); font-size: clamp(11px, .9vw, 20px); }
.score-list { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0; margin: 0; list-style: none; }
.score-row { display: grid; grid-template-columns: 2.4ch minmax(0, 1fr) auto; align-items: center; gap: 16px; flex: 1; min-height: 36px; border-bottom: 1px solid var(--line); }
.score-row:last-child { border-bottom: 0; }
.row-rank { color: var(--muted); font-variant-numeric: tabular-nums; font-size: clamp(15px, 1.3vw, 30px); }
.row-name { font-size: clamp(16px, 1.45vw, 34px); font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-level { display: block; color: var(--muted); font-size: clamp(10px, .75vw, 17px); margin-top: 4px; }
.row-score { font-size: clamp(18px, 1.6vw, 38px); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.board-message { display: flex; flex: 1; flex-direction: column; justify-content: center; align-items: flex-start; padding: 28px; background: var(--surface-raised); border-top: 3px solid var(--accent); }
.board-message strong { font-size: clamp(26px, 2.8vw, 64px); font-weight: 500; letter-spacing: -.04em; }
.board-message p { max-width: 30ch; margin-top: 18px; color: var(--muted); line-height: 1.6; }
.board-status { color: var(--muted); font-size: clamp(10px, .75vw, 16px); padding-top: 14px; }
.display-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; height: 6dvh; color: var(--muted); font-size: clamp(11px, .85vw, 20px); }
.display-footer > :first-child { color: var(--text); letter-spacing: .045em; }
.noscript-message { position: fixed; inset: auto 0 0; padding: 20px; background: var(--surface); }
@keyframes player-switch { from { opacity: .25; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }
@media (max-width: 767px) {
  .live-pane { height: auto; padding: 0 20px; }
  .display-header { min-height: 74px; height: auto; }
  .brand { font-size: 14px; gap: 10px; }
  .brand b { display: block; }
  .broadcast-label { max-width: 110px; font-size: 10px; line-height: 1.5; }
  .display-grid { grid-template-columns: 1fr; gap: 34px; }
  .feed-body { grid-template-columns: minmax(0, 1fr) 115px; gap: 14px; }
  .game-screen { aspect-ratio: 3 / 4; }
  .pilot-rail { gap: 16px; }
  .pilot-name h2 { font-size: 20px; }
  .pilot-stats { gap: 12px; }
  .pilot-stats dd, .pilot-stats .score-stat dd { font-size: 24px; }
  .event-list > div { min-height: 25px; }
  .next-pilot { padding-top: 10px; }
  .score-row { min-height: 65px; }
  .board-message { min-height: 240px; }
  .display-footer { padding: 22px 0; font-size: 10px; }
  .display-footer > :last-child { max-width: 140px; text-align: right; }
  .info-pane { position: fixed; height: 100dvh; }
}
@media (min-width: 768px) and (max-height: 800px) {
  .display-header { min-height: 58px; }
  .display-grid { padding-top: 15px; }
  .section-heading { padding-bottom: 12px; }
  .pilot-rail { gap: 10px; padding-top: 0; }
  .pilot-name h2 { margin: 6px 0; font-size: clamp(20px, 2vw, 30px); }
  .pilot-stats { gap: 8px; }
  .pilot-stats dd { margin-top: 4px; font-size: 24px; }
  .pilot-stats .score-stat dd { font-size: 28px; }
  .pilot-stats .lives-stat { min-height: 20px; }
  .pilot-events h3 { margin-bottom: 6px; }
  .event-list { gap: 4px; }
  .event-list > div { min-height: 21px; padding-top: 2px; padding-bottom: 2px; }
  .next-pilot { padding-top: 10px; }
  .next-pilot strong { margin-top: 6px; }
  #rotationTime { margin-top: 4px; }
  .leader-card { padding: 14px 22px; }
  .leader-rank { font-size: 55px; }
  .leader-score { margin-top: 6px; font-size: 32px; }
  .row-level { display: none; }
  .score-row { min-height: 31px; }
}
@media (prefers-reduced-motion: reduce) {
  .display-pane { transition: none; transform: none !important; }
  .game-screen.switching { animation: none; }
  .health-track > span { transition: none; }
}
