/* style.css — shared styling for all three surfaces.
   Prefixes: tv- (public board), host- (private console), ui- (shared chrome).
   TV sizing is in viewport units so the board scales to any TV without media
   queries; the host console uses rem/px because tap-target size is absolute. */

/* ==========================================================================
   Fonts — self-hosted OFL woff2, PRD §6.5.
   The files are not in the repo yet. local() first, then the file; if neither
   resolves the stack below falls through to a condensed system face and the
   game still looks right. Drop Anton-Regular.woff2 / Oswald-Regular.woff2 into
   fonts/ and they take effect with no code change.
   ========================================================================== */

@font-face {
  font-family: 'Anton';
  font-display: swap;
  src: local('Anton'), url('fonts/Anton-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Oswald';
  font-display: swap;
  src: local('Oswald'), url('fonts/Oswald-Regular.woff2') format('woff2');
}

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
  --navy-1: #0b1e4b;
  --navy-2: #1a3a8f;
  --navy-deep: #0a1738;
  --panel-1: #122a63;
  --panel-2: #0c1d45;
  --tile-1: #2b57c4;
  --tile-2: #16337e;
  --tile-open-1: #3865d6;
  --tile-open-2: #1c3d8f;
  --gold: #f5c542;
  --gold-dark: #c99b1d;
  --red: #e5484d;
  --red-deep: #7a0d10;
  --green: #3fb950;
  --ink: #10214b;
  --muted: #9fb3e8;
  --line: #22407e;

  --font-display: 'Anton', Impact, Haettenschweiler, 'Arial Narrow Bold', 'Franklin Gothic Medium', sans-serif;
  --font-chrome: 'Oswald', 'Arial Narrow', 'Helvetica Neue Condensed', system-ui, sans-serif;
  --font-ui: -apple-system, system-ui, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ==========================================================================
   ui- : shared chrome (buttons, modal, debug panel, error banner)
   ========================================================================== */

.ui-button {
  font-family: var(--font-chrome);
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1rem 1.1rem;
  min-height: 3.4rem;
  border: 2px solid var(--line);
  border-radius: 0.9rem;
  background: linear-gradient(var(--panel-1), var(--panel-2));
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.ui-button:active { transform: scale(0.97); }
.ui-button:disabled { opacity: 0.35; cursor: not-allowed; }
.ui-button:disabled:active { transform: none; }

.ui-button.is-gold {
  background: linear-gradient(var(--gold), var(--gold-dark));
  border-color: var(--gold-dark);
  color: var(--ink);
}
.ui-button.is-red {
  background: linear-gradient(#f0575c, #b8272c);
  border-color: #8d1e22;
  color: #fff;
}
.ui-button.is-green {
  background: linear-gradient(#4cc45f, #2b8438);
  border-color: #216a2c;
  color: #fff;
}
.ui-button.is-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}
.ui-button.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.3);
}
.ui-button.is-huge {
  font-size: 1.5rem;
  min-height: 5rem;
}

/* --- modal (help / rules, resume prompt) --- */
.ui-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(4, 10, 28, 0.86);
}
.ui-modal.is-open { display: flex; }
.ui-modal-card {
  background: var(--navy-deep);
  border: 3px solid var(--gold);
  border-radius: 1.2rem;
  width: min(60rem, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ui-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(var(--panel-1), var(--panel-2));
}
.ui-modal-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--gold);
}
.ui-modal-body {
  padding: 1.2rem 1.4rem 2rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  color: #dfe7fb;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.55;
}
.ui-modal-foot {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
}

.ui-help-intro {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 1.4rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}
.ui-help-section { margin-bottom: 1.6rem; }
.ui-help-section h3 {
  font-family: var(--font-chrome);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1.15rem;
  color: var(--gold);
  margin-bottom: 0.6rem;
}
.ui-help-section p { margin-bottom: 0.5rem; }
.ui-help-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.6rem 0 0.9rem;
  font-size: 0.95rem;
}
.ui-help-table th {
  text-align: left;
  font-family: var(--font-chrome);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.5rem 0.7rem;
  border-bottom: 2px solid var(--line);
}
.ui-help-table td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.ui-help-table tr td:first-child { color: var(--gold); width: 38%; }

/* --- error / warning banner --- */
.ui-banner {
  display: none;
  padding: 0.9rem 1.1rem;
  border-radius: 0.8rem;
  margin-bottom: 0.9rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.5;
}
.ui-banner.is-open { display: block; }
.ui-banner.is-error { background: #4a1114; border: 1px solid var(--red); color: #ffd7d8; }
.ui-banner.is-warn { background: #3d3410; border: 1px solid var(--gold-dark); color: #ffeeb8; }
.ui-banner ul { margin: 0.4rem 0 0 1.1rem; }

/* --- debug panel --- */
.ui-debug-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  height: 42vh;
  display: none;
  flex-direction: column;
  background: rgba(3, 8, 20, 0.96);
  border-top: 2px solid var(--gold-dark);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.ui-debug-panel.is-open { display: flex; }
.ui-debug-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
  color: var(--gold);
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ui-debug-bar .ui-debug-action { margin-left: auto; }
.ui-debug-bar .ui-debug-action + .ui-debug-action { margin-left: 0.4rem; }
.ui-debug-action {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: #16244c;
  color: #cfdaf5;
  cursor: pointer;
}
.ui-debug-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.4rem 0.7rem 1rem;
}
.ui-debug-line {
  font-size: 0.68rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: #b9c6e8;
}
.ui-debug-info { color: #b9c6e8; }
.ui-debug-warn { color: #ffd479; }
.ui-debug-error { color: #ff8f93; }

.ui-hidden { display: none !important; }

/* ==========================================================================
   tv- : the public board
   ========================================================================== */

body.tv-body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-display);
  background: radial-gradient(ellipse at 50% 40%, var(--navy-2) 0%, var(--navy-1) 70%);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: none;
}
html.tv-html { height: 100%; }
body.tv-body * { user-select: none; -webkit-user-select: none; }

.tv-rays {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 260vmax;
  height: 260vmax;
  margin: -130vmax 0 0 -130vmax;
  z-index: 0;
  pointer-events: none;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.05) 0deg 7deg, transparent 7deg 22deg);
  animation: tv-spin 120s linear infinite;
}
@keyframes tv-spin { to { transform: rotate(360deg); } }

.tv-vignette {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

.tv-stage {
  position: relative;
  z-index: 2;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3vh 2vw;
  gap: 2.5vh;
}
.tv-stage.is-shaking { animation: tv-shake 0.15s linear 2; }
@keyframes tv-shake {
  25% { transform: translate(0.6vw, -0.3vh); }
  50% { transform: translate(-0.5vw, 0.4vh); }
  75% { transform: translate(0.4vw, 0.2vh); }
}

/* --- screens: exactly one is visible at a time --- */
.tv-screen { display: none; flex-direction: column; align-items: center; gap: 2.5vh; width: 100%; flex: 1; justify-content: center; }
.tv-screen.is-active { display: flex; }

/* --- splash (arms audio; Safari needs a gesture per window) --- */
.tv-splash {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3vh;
  background: radial-gradient(ellipse at 50% 40%, var(--navy-2) 0%, var(--navy-1) 70%);
  cursor: pointer;
}
.tv-splash.is-hidden { display: none; }
.tv-splash-title { font-size: 7vw; color: var(--gold); text-align: center; }
.tv-splash-cta {
  font-size: 3.4vw;
  padding: 1.5vh 5vw;
  border: 0.4vw solid var(--gold);
  border-radius: 2vw;
  animation: tv-pulse 1.4s ease-in-out infinite;
}
@keyframes tv-pulse { 50% { transform: scale(1.06); } }
.tv-splash-hint {
  font-family: var(--font-ui);
  text-transform: none;
  font-size: 1.4vw;
  color: var(--muted);
  max-width: 50vw;
  text-align: center;
}

/* --- title / idle screen --- */
.tv-title { font-size: 9vw; color: var(--gold); text-align: center; line-height: 1; text-shadow: 0 1vh 0 rgba(0, 0, 0, 0.4); }
.tv-subtitle { font-size: 2.4vw; color: var(--muted); }

/* --- question --- */
.tv-question {
  background: linear-gradient(var(--panel-1), var(--panel-2));
  border: 0.35vw solid var(--gold);
  border-radius: 1.2vw;
  padding: 1.2vh 3vw;
  font-size: 2.6vw;
  text-align: center;
  max-width: 90vw;
  box-shadow: 0 0.8vh 2vh rgba(0, 0, 0, 0.5);
}
.tv-respondents {
  font-family: var(--font-chrome);
  font-size: 1.5vw;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* --- mid row: team | board | team --- */
.tv-mid {
  display: flex;
  align-items: center;
  gap: 1.6vw;
  width: 100%;
  justify-content: center;
  flex: 1;
}

.tv-team {
  width: 15vw;
  padding: 2vh 1vw;
  text-align: center;
  background: linear-gradient(var(--panel-1), var(--panel-2));
  border: 0.3vw solid var(--tile-1);
  border-radius: 1.2vw;
  transition: border-color 0.3s, opacity 0.3s;
}
.tv-team.is-active { border-color: var(--gold); animation: tv-glow 1.2s ease-in-out infinite; }
@keyframes tv-glow {
  0%, 100% { box-shadow: 0 0 1.5vw rgba(245, 197, 66, 0.35); }
  50% { box-shadow: 0 0 3vw rgba(245, 197, 66, 0.75); }
}
.tv-team.is-locked-out { opacity: 0.45; border-color: var(--red); animation: none; }
.tv-team-name { font-size: 1.5vw; color: var(--muted); margin-bottom: 1vh; word-break: break-word; }
.tv-team.is-active .tv-team-name { color: var(--gold); }
.tv-team-score { font-size: 4.5vw; line-height: 1; text-shadow: 0 0.4vh 0 rgba(0, 0, 0, 0.4); }
.tv-strikes { display: flex; justify-content: center; gap: 0.6vw; margin-top: 1.5vh; }
.tv-strike-slot {
  width: 2.6vw;
  height: 2.6vw;
  border: 0.22vw solid var(--tile-1);
  border-radius: 0.5vw;
  font-size: 2vw;
  line-height: 2.2vw;
  color: transparent;
}
.tv-strike-slot.is-hit {
  color: var(--red);
  border-color: var(--red);
  text-shadow: 0 0 0.8vw rgba(229, 72, 77, 0.7);
}

/* --- board --- */
.tv-board {
  background: linear-gradient(#e8bd45, #a87f16);
  padding: 0.9vw;
  border-radius: 1.6vw;
  box-shadow: 0 1.5vh 4vh rgba(0, 0, 0, 0.55);
}
.tv-tiles {
  background: var(--navy-deep);
  border-radius: 1vw;
  padding: 0.9vw;
  display: grid;
  grid-template-columns: repeat(2, 24vw);
  /* Column flow gives the show layout (1-4 left, 5-8 right). The row count
     depends on how many answers the question has, so tv.js sets the exact
     value; this default keeps a 5-6 answer board intact if it ever does not. */
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  gap: 0.7vw;
}
/* ≤4 answers: single column, show-style (PRD §6.5) */
.tv-tiles.is-single-column { grid-template-columns: 34vw; }

.tv-tile { perspective: 60vw; height: 10.5vh; }
.tv-tile-flip {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.3, 0.9, 0.4, 1);
}
.tv-tile.is-flipped .tv-tile-flip { transform: rotateX(180deg); }
.tv-tile-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 0.7vw;
  display: flex;
  align-items: center;
}
.tv-tile-front {
  background: linear-gradient(var(--tile-1), var(--tile-2));
  box-shadow: inset 0 0.4vh 0 rgba(255, 255, 255, 0.25), inset 0 -0.6vh 1vh rgba(0, 0, 0, 0.35);
  justify-content: center;
}
.tv-tile-num {
  width: 4.2vw;
  height: 6.5vh;
  background: #0d255a;
  border: 0.25vw solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6vw;
  text-shadow: 0 0.3vh 0 rgba(0, 0, 0, 0.5);
}
.tv-tile-back {
  transform: rotateX(180deg);
  background: linear-gradient(var(--tile-open-1), var(--tile-open-2));
  box-shadow: inset 0 0.4vh 0 rgba(255, 255, 255, 0.3);
  justify-content: space-between;
  padding: 0 1vw;
  font-size: 2.1vw;
  gap: 0.8vw;
  text-shadow: 0 0.3vh 0 rgba(0, 0, 0, 0.45);
}
.tv-tile-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-tile-points {
  background: linear-gradient(var(--gold), var(--gold-dark));
  color: var(--ink);
  border-radius: 0.5vw;
  padding: 0.5vh 0.9vw;
  font-size: 2.3vw;
  text-shadow: none;
  flex: none;
}
/* A tile revealed at the end of the round pays nobody. */
.tv-tile.is-unclaimed .tv-tile-back { filter: saturate(0.35) brightness(0.8); }

/* --- timer --- */
.tv-timer {
  min-width: 9vw;
  text-align: center;
  padding: 0.8vh 2vw;
  background: linear-gradient(var(--panel-1), var(--panel-2));
  border: 0.3vw solid var(--tile-1);
  border-radius: 3vw;
  font-size: 3vw;
}
.tv-timer.is-hot { border-color: var(--red); color: var(--red); animation: tv-hotpulse 1s infinite; }
.tv-timer.is-paused { border-color: var(--gold); color: var(--gold); animation: none; }
.tv-timer.is-hidden { visibility: hidden; }
@keyframes tv-hotpulse { 50% { transform: scale(1.12); } }

/* --- overlays --- */
.tv-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2vh;
  background: rgba(4, 10, 28, 0.75);
}
.tv-overlay.is-open { display: flex; }
/* The klaxon and "say what again" fire in ANY phase, including while the
   round-summary card is up. All overlays share a z-index, so without this the
   summary — later in the DOM — would paint over them and the klaxon would be
   invisible at exactly the moment the host is calling someone out. */
.tv-overlay.tv-overlay-instant { z-index: 44; }

.tv-big-x {
  font-size: 28vh;
  line-height: 1;
  color: var(--red);
  -webkit-text-stroke: 0.5vh #fff;
  text-shadow: 0 0 6vh rgba(229, 72, 77, 0.8);
  animation: tv-slam 0.25s cubic-bezier(0.2, 2, 0.4, 1);
}
@keyframes tv-slam { from { transform: scale(3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.tv-x-row { display: flex; gap: 2vw; }
.tv-x-row .tv-big-x { font-size: 20vh; }
.tv-x-row .tv-big-x.is-pending { visibility: hidden; }

.tv-banner {
  font-size: 6vh;
  background: var(--red);
  padding: 1vh 4vw;
  border-radius: 1.5vh;
  box-shadow: 0 1vh 3vh rgba(0, 0, 0, 0.6);
  animation: tv-slam 0.3s cubic-bezier(0.2, 2, 0.4, 1);
  text-align: center;
}

.tv-overlay.tv-klaxon { background: none; }
.tv-klaxon-strobe {
  position: absolute;
  inset: 0;
  background: var(--red);
  animation: tv-strobe 0.4s linear infinite;
}
@keyframes tv-strobe { 0%, 100% { opacity: 0.6; } 50% { opacity: 0.25; } }
.tv-klaxon-word {
  position: relative;
  font-size: 22vh;
  -webkit-text-stroke: 0.6vh var(--red-deep);
  animation: tv-hotpulse 0.4s infinite;
}

.tv-quote-card {
  background: var(--navy-deep);
  border: 0.4vw solid var(--gold);
  border-radius: 1.5vw;
  padding: 5vh 5vw;
  text-align: center;
  animation: tv-slam 0.3s cubic-bezier(0.2, 2, 0.4, 1);
}
.tv-quote-1 { font-size: 9vh; color: var(--gold); }
.tv-quote-2 { font-size: 3.2vh; margin-top: 1.5vh; color: #cfdaf5; }
.tv-quote-3 {
  display: inline-block;
  margin-top: 2.5vh;
  background: var(--red);
  font-size: 3.5vh;
  padding: 0.8vh 2vw;
  border-radius: 1vh;
}

/* --- round summary --- */
.tv-summary-card {
  background: var(--navy-deep);
  border: 0.4vw solid var(--gold);
  border-radius: 1.5vw;
  padding: 4vh 4vw;
  min-width: 50vw;
  animation: tv-rise 0.35s ease-out;
}
@keyframes tv-rise { from { transform: translateY(40vh); opacity: 0; } }
.tv-summary-card h2 { text-align: center; font-size: 5vh; color: var(--gold); margin-bottom: 2.5vh; }
.tv-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2vw;
  font-size: 4vh;
  padding: 1.2vh 0;
  border-top: 1px solid var(--line);
}
.tv-summary-label { font-family: var(--font-chrome); font-size: 2vh; color: var(--muted); letter-spacing: 0.08em; }
.tv-drink-tag {
  background: var(--red);
  font-size: 2.4vh;
  padding: 0.4vh 1.2vw;
  border-radius: 0.8vh;
  margin-left: 1.2vw;
}

/* --- tiebreak --- */
/* This screen stacks a heading, the question, a full board AND two pick cards,
   so its tiles run shorter than the round board — at full height the closing
   note fell off the bottom of a 16:9 TV. */
.tv-screen-tiebreak { gap: 1.4vh; }
.tv-tiebreak-title { font-size: 4.2vw; color: var(--gold); line-height: 1; }
.tv-tiebreak-board .tv-tile { height: 8vh; }
.tv-tiebreak-board .tv-tile-num { height: 5vh; font-size: 2.2vw; }
.tv-tiebreak-board .tv-tile-back { font-size: 1.8vw; }
.tv-tiebreak-board .tv-tile-points { font-size: 1.9vw; }
.tv-tiebreak-picks { display: flex; gap: 3vw; justify-content: center; width: 100%; }
.tv-tiebreak-pick {
  flex: 1;
  max-width: 34vw;
  background: linear-gradient(var(--panel-1), var(--panel-2));
  border: 0.3vw solid var(--tile-1);
  border-radius: 1.2vw;
  padding: 1.6vh 2vw;
  text-align: center;
}
.tv-tiebreak-pick.is-winner { border-color: var(--gold); box-shadow: 0 0 3vw rgba(245, 197, 66, 0.6); }
.tv-tiebreak-pick.is-whiff { border-color: var(--red); }
.tv-tiebreak-team { font-size: 1.6vw; color: var(--muted); margin-bottom: 0.6vh; }
.tv-tiebreak-answer { font-size: 2.6vw; }
.tv-tiebreak-rank { font-family: var(--font-chrome); font-size: 1.4vw; color: var(--gold); margin-top: 0.6vh; }

/* --- fast money --- */
.tv-fm-head { display: flex; align-items: center; gap: 3vw; }
.tv-fm-title { font-size: 5vw; color: var(--gold); }
.tv-fm-target {
  font-size: 2.2vw;
  border: 0.3vw solid var(--gold);
  border-radius: 1vw;
  padding: 0.8vh 2vw;
}
.tv-fm-timer { font-size: 12vw; line-height: 1; }
.tv-fm-timer.is-hot { color: var(--red); animation: tv-hotpulse 1s infinite; }

.tv-fm-slots { display: flex; flex-direction: column; gap: 1.2vh; width: 76vw; }
.tv-fm-slot {
  display: flex;
  align-items: center;
  gap: 1.5vw;
  background: linear-gradient(var(--panel-1), var(--panel-2));
  border: 0.25vw solid var(--line);
  border-radius: 1vw;
  padding: 1.4vh 1.5vw;
  min-height: 9vh;
  transition: border-color 0.3s;
}
.tv-fm-slot.is-current { border-color: var(--gold); }
.tv-fm-slot.is-revealed { border-color: var(--tile-1); }
.tv-fm-slot-num {
  flex: none;
  width: 3.6vw;
  height: 3.6vw;
  border-radius: 50%;
  background: #0d255a;
  border: 0.2vw solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2vw;
}
.tv-fm-slot-question { flex: 1; font-size: 1.9vw; text-align: left; color: var(--muted); }
.tv-fm-slot.is-revealed .tv-fm-slot-question { color: #fff; }
.tv-fm-slot-answer { font-size: 2.2vw; text-align: right; min-width: 18vw; }
.tv-fm-slot-answer.is-nomatch { color: var(--red); }
.tv-fm-slot-points {
  flex: none;
  min-width: 6vw;
  text-align: center;
  background: linear-gradient(var(--gold), var(--gold-dark));
  color: var(--ink);
  border-radius: 0.5vw;
  padding: 0.5vh 0.9vw;
  font-size: 2.2vw;
}
.tv-fm-slot-points.is-hidden { visibility: hidden; }

.tv-fm-total-row { display: flex; align-items: baseline; gap: 1.5vw; font-size: 3vw; }
.tv-fm-total { font-size: 7vw; color: var(--gold); line-height: 1; }
.tv-fm-total.is-hit { color: var(--green); }

/* Clearing the target is the good outcome — it must not read as an alarm. */
.tv-fm-result {
  font-size: 5vh;
  padding: 1vh 4vw;
  border-radius: 1.5vh;
  text-align: center;
  box-shadow: 0 1vh 3vh rgba(0, 0, 0, 0.6);
  animation: tv-slam 0.3s cubic-bezier(0.2, 2, 0.4, 1);
}
.tv-fm-result.is-hit { background: linear-gradient(#4cc45f, #2b8438); }
.tv-fm-result.is-miss { background: var(--red); }

/* --- game over --- */
.tv-winner { font-size: 8vw; color: var(--gold); text-align: center; line-height: 1.05; }
.tv-final-scores { display: flex; gap: 4vw; }
.tv-final-team { text-align: center; }
.tv-final-name { font-size: 2.2vw; color: var(--muted); }
.tv-final-score { font-size: 6vw; }
.tv-confetti { position: fixed; inset: 0; z-index: 45; pointer-events: none; }

/* --- cameo pop-up --- */
.tv-cameo {
  position: fixed;
  right: 3vw;
  bottom: -70vh;
  z-index: 50;
  transition: bottom 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  pointer-events: none;
}
.tv-cameo.is-open { bottom: -4vh; }
.tv-cameo-figure {
  display: block;
  height: 40vh;
  filter: drop-shadow(0.3vh 0 0 #fff) drop-shadow(-0.3vh 0 0 #fff)
          drop-shadow(0 0.3vh 0 #fff) drop-shadow(0 -0.3vh 0 #fff)
          drop-shadow(0 1.5vh 2vh rgba(0, 0, 0, 0.6));
  animation: tv-wobble 0.6s ease-in-out infinite alternate;
  transform-origin: 50% 100%;
}
/* Emoji stand-in until the real cutouts land in characters/ */
.tv-cameo-figure.is-placeholder { font-size: 34vh; line-height: 1; height: auto; }
@keyframes tv-wobble { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.tv-cameo-bubble {
  position: absolute;
  top: -2vh;
  right: 70%;
  white-space: nowrap;
  background: #fff;
  color: var(--ink);
  font-size: 4.5vh;
  padding: 1.5vh 2vw;
  border-radius: 2vh;
}
.tv-cameo-bubble::after {
  content: "";
  position: absolute;
  right: -1.8vw;
  bottom: 1vh;
  border: 1.2vh solid transparent;
  border-left-color: #fff;
}

/* --- connection warning (host window gone) --- */
.tv-link-warning {
  position: fixed;
  left: 1vw;
  top: 1vh;
  z-index: 55;
  display: none;
  font-family: var(--font-ui);
  text-transform: none;
  font-size: 1.2vw;
  background: rgba(74, 17, 20, 0.9);
  border: 1px solid var(--red);
  color: #ffd7d8;
  padding: 0.6vh 1vw;
  border-radius: 0.6vw;
}
.tv-link-warning.is-open { display: block; }

/* ==========================================================================
   host- : the private console. Function over flair, no decorative animation.
   Everything visible without scrolling on a 13" iPad.
   ========================================================================== */

body.host-body {
  font-family: var(--font-ui);
  background: var(--navy-1);
  color: #fff;
  min-height: 100vh;
  padding: 0.9rem;
  -webkit-text-size-adjust: 100%;
}

.host-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}
.host-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  margin-right: auto;
}
.host-phase-pill {
  font-family: var(--font-chrome);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}
.host-link-pill {
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.host-link-pill.is-linked { border-color: var(--green); color: var(--green); }
.host-link-pill.is-broken { border-color: var(--red); color: var(--red); }

.host-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}
@media (max-width: 55rem) {
  .host-grid { grid-template-columns: minmax(0, 1fr); }
}

.host-card {
  background: linear-gradient(var(--panel-1), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.9rem;
  margin-bottom: 0.9rem;
}
.host-card h2 {
  font-family: var(--font-chrome);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.host-question {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.35rem;
}
.host-question-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.8rem; }

/* --- answer reveal buttons: gold = still hidden, dimmed = already revealed --- */
.host-answers { display: flex; flex-direction: column; gap: 0.5rem; }
.host-answer {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.85rem 0.9rem;
  min-height: 3.4rem;
  border: 2px solid var(--gold-dark);
  border-radius: 0.8rem;
  background: linear-gradient(var(--gold), var(--gold-dark));
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.host-answer:active { transform: scale(0.985); }
.host-answer.is-revealed {
  background: #16244c;
  border-color: var(--line);
  color: var(--muted);
  text-decoration: line-through;
}
.host-answer-rank {
  flex: none;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.host-answer.is-revealed .host-answer-rank { background: rgba(255, 255, 255, 0.08); }
.host-answer-text { flex: 1; }
.host-answer-points { flex: none; font-size: 1.15rem; }
.host-answer-by {
  flex: none;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

/* --- team blocks --- */
.host-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.host-team {
  border: 2px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.7rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.15);
}
.host-team.is-active { border-color: var(--gold); }
.host-team.is-locked-out { border-color: var(--red); opacity: 0.7; }
.host-team-name {
  font-family: var(--font-chrome);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.host-team.is-active .host-team-name { color: var(--gold); }
.host-team-score { font-family: var(--font-display); font-size: 2.4rem; line-height: 1; }
.host-score-nudge { display: flex; gap: 0.4rem; justify-content: center; margin-top: 0.5rem; }
.host-score-nudge .ui-button { flex: 1; min-height: 2.6rem; padding: 0.4rem; font-size: 1rem; }
.host-team-strikes {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  margin: 0.5rem 0;
}
.host-strike-dot {
  width: 1.4rem;
  height: 1.4rem;
  border: 2px solid var(--line);
  border-radius: 0.35rem;
  font-size: 0.9rem;
  line-height: 1.1rem;
  color: transparent;
}
.host-strike-dot.is-hit { color: var(--red); border-color: var(--red); }
.host-lockout-note {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--red);
  margin-top: 0.3rem;
  min-height: 1rem;
}

/* --- timer block --- */
.host-timer-row { display: flex; align-items: center; gap: 0.7rem; }
.host-timer-display {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  min-width: 4rem;
  text-align: center;
}
.host-timer-display.is-hot { color: var(--red); }
.host-timer-display.is-paused { color: var(--gold); }
.host-timer-row .ui-button { flex: 1; }

/* --- soundboard: the klaxon is unmistakably huge --- */
.host-soundboard { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0.7rem; }
.host-klaxon { min-height: 6rem; font-size: 1.6rem; }

.host-flow { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.host-flow .is-wide { grid-column: 1 / -1; }

.host-field { margin-bottom: 0.8rem; }
.host-field label {
  display: block;
  font-family: var(--font-chrome);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.host-field input {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 1.15rem;
  padding: 0.8rem 0.9rem;
  border: 2px solid var(--line);
  border-radius: 0.7rem;
  background: var(--navy-deep);
  color: #fff;
}
.host-field input:focus { outline: none; border-color: var(--gold); }

.host-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }

/* --- fast money matching --- */
.host-fm-slot {
  border: 2px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.7rem;
  margin-bottom: 0.6rem;
}
.host-fm-slot.is-current { border-color: var(--gold); }
.host-fm-slot-question { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.host-fm-options { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.host-fm-option {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  padding: 0.6rem 0.8rem;
  min-height: 2.9rem;
  border: 2px solid var(--line);
  border-radius: 0.6rem;
  background: #16244c;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.host-fm-option.is-picked { border-color: var(--gold); background: linear-gradient(var(--gold), var(--gold-dark)); color: var(--ink); }
.host-fm-option.is-nomatch.is-picked { border-color: var(--red); background: linear-gradient(#f0575c, #b8272c); color: #fff; }

.host-hint { font-size: 0.85rem; color: var(--muted); line-height: 1.5; margin-top: 0.5rem; }
.host-hint strong { color: var(--gold); }

/* --- launcher (index.html) --- */
body.launcher-body {
  font-family: var(--font-ui);
  background: radial-gradient(ellipse at 50% 0%, var(--navy-2) 0%, var(--navy-1) 70%);
  color: #fff;
  min-height: 100vh;
  padding: 2rem 1.2rem 4rem;
}
.launcher-wrap { max-width: 46rem; margin: 0 auto; }
.launcher-title {
  font-family: var(--font-display);
  font-size: 2.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold);
  text-align: center;
}
.launcher-sub { text-align: center; color: var(--muted); margin: 0.4rem 0 2rem; }
.launcher-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin-bottom: 1.6rem; }
@media (max-width: 34rem) { .launcher-actions { grid-template-columns: 1fr; } }
.launcher-steps { counter-reset: step; }
.launcher-steps li { margin-bottom: 0.7rem; line-height: 1.6; color: #dfe7fb; }
.launcher-steps li strong { color: var(--gold); }
