/* =====================================================================
   Bible Family Feud — Design tokens
   Palette: a premium broadcast stage after the house lights drop —
   deep void, aurora-lit velvet glass, brass-gold marquee light.
   Type: Anton (marquee display) + Nunito (warm, legible body).
===================================================================== */
:root {
  --void: #08040f;
  --curtain-navy: #170b2e;
  --curtain-navy-deep: #0d0620;
  --velvet: #2b1450;
  --velvet-light: #4a2585;
  --aurora-violet: #8b5cf6;
  --irradiance-teal: #2dd4bf;
  --spotlight-gold: #f4b942;
  --spotlight-gold-soft: #ffd77a;
  --marquee-red: #e6485d;
  --cream: #fbf3df;
  --emerald: #2fa876;
  --sky: #4ea8de;
  --ink: #170b2e;

  --glass-bg: linear-gradient(145deg, rgba(74, 37, 133, 0.5), rgba(20, 9, 41, 0.62));
  --glass-bg-strong: linear-gradient(145deg, rgba(74, 37, 133, 0.68), rgba(13, 6, 32, 0.78));
  --glass-border: 1px solid rgba(255, 255, 255, 0.11);
  --glass-blur: blur(20px) saturate(165%);
  --shadow-ambient: 0 30px 70px -24px rgba(0, 0, 0, 0.7);
  --shadow-ambient-sm: 0 14px 34px -14px rgba(0, 0, 0, 0.6);
  --shadow-inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.14);

  --shadow-deep: 0 20px 60px rgba(0, 0, 0, 0.55);
  --radius-lg: 24px;
  --radius-md: 16px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: "Anton", sans-serif;
  --font-body: "Nunito", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--void);
  font-family: var(--font-body);
  color: var(--cream);
}

body {
  position: relative;
  background:
    radial-gradient(ellipse 70% 50% at 18% -6%, rgba(139, 92, 246, 0.16), transparent 62%),
    radial-gradient(ellipse 60% 45% at 84% 6%, rgba(45, 212, 191, 0.10), transparent 60%),
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(244, 185, 66, 0.11), transparent 60%),
    radial-gradient(ellipse 120% 80% at 50% 112%, rgba(74, 37, 133, 0.4), transparent 62%),
    linear-gradient(180deg, var(--curtain-navy) 0%, var(--void) 100%);
  background-size: 180% 180%, 180% 180%, 100% 100%, 100% 100%, 100% 100%;
  animation: auroraDrift 26s ease-in-out infinite alternate;
  overflow-x: hidden;
}

@keyframes auroraDrift {
  0% { background-position: 0% 0%, 100% 0%, 50% 0%, 50% 100%, 0 0; }
  100% { background-position: 12% 10%, 88% 14%, 50% 4%, 50% 100%, 0 0; }
}

/* filmic grain — subtle tactile texture over the whole app */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  body { animation: none; }
}

button, input { font-family: inherit; }
button:focus-visible, input:focus-visible, .board-tile:focus-visible {
  outline: 3px solid var(--spotlight-gold-soft);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- stage */
.stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 48px;
}

.curtain {
  position: fixed;
  top: 0; bottom: 0;
  width: min(9vw, 90px);
  z-index: 0;
  background:
    repeating-linear-gradient(90deg,
      rgba(0,0,0,0.28) 0px, rgba(0,0,0,0.28) 10px,
      rgba(255,255,255,0.03) 10px, rgba(255,255,255,0.03) 20px),
    linear-gradient(180deg, #4a1650, #2a0d3a 60%, #170b2e);
  box-shadow: inset 0 0 60px rgba(0,0,0,0.6);
  pointer-events: none;
}
.curtain--left { left: 0; border-radius: 0 40px 40px 0; }
.curtain--right { right: 0; border-radius: 40px 0 0 40px; transform: scaleX(-1); }
@media (max-width: 900px) { .curtain { display: none; } }

/* ---------------------------------------------------------------- screens */
.screen {
  position: relative;
  z-index: 1;
  display: none;
  width: 100%;
  max-width: 960px;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  animation: fadeUp 0.6s var(--ease-out) both;
}
.screen.is-active { display: flex; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------------------------------------------------------------- marquee */
.marquee-frame {
  position: relative;
  width: 100%;
  text-align: center;
  padding: 40px 24px 32px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(244, 185, 66, 0.4);
  box-shadow: var(--shadow-ambient), var(--shadow-inset-top), inset 0 0 50px rgba(244, 185, 66, 0.07);
  overflow: hidden;
}
.marquee-frame::before {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.35), transparent 55%),
    radial-gradient(circle at 82% 30%, rgba(45, 212, 191, 0.22), transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(244, 185, 66, 0.25), transparent 55%);
  animation: auroraSweep 9s var(--ease-out) infinite alternate;
  filter: blur(2px);
}
@keyframes auroraSweep {
  0% { transform: translate(-4%, -2%) rotate(0deg) scale(1); }
  100% { transform: translate(4%, 3%) rotate(6deg) scale(1.08); }
}

.bulbs {
  position: absolute;
  inset: 8px;
  border-radius: calc(var(--radius-lg) - 6px);
  pointer-events: none;
}
.bulbs::before, .bulbs::after {
  content: "";
  position: absolute;
  left: 6px; right: 6px;
  height: 0;
  border-top: 3px dotted var(--spotlight-gold-soft);
  opacity: 0.9;
  animation: chase 1.4s linear infinite;
}
.bulbs::before { top: 6px; }
.bulbs::after { bottom: 6px; }
@keyframes chase {
  0% { border-top-color: var(--spotlight-gold-soft); }
  50% { border-top-color: var(--marquee-red); }
  100% { border-top-color: var(--spotlight-gold-soft); }
}

.show-title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 2px;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  margin: 6px 0 4px;
  background: linear-gradient(180deg, #fff3d6 0%, var(--spotlight-gold) 55%, #c8860f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(244, 185, 66, 0.5)) drop-shadow(0 4px 0 rgba(0,0,0,0.35));
}
.show-subtitle {
  margin: 0;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--cream);
  opacity: 0.85;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.device-hint {
  width: 100%;
  max-width: 560px;
  text-align: center;
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(78, 168, 222, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(78, 168, 222, 0.4);
  color: var(--sky);
  font-size: 0.82rem;
  font-weight: 700;
}

.host-view-box {
  width: 100%;
  max-width: 560px;
  text-align: center;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(244, 185, 66, 0.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px dashed var(--spotlight-gold);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.host-view-copy { margin: 0; font-size: 0.85rem; opacity: 0.9; }
.host-view-fallback { margin: 0; font-size: 0.72rem; opacity: 0.6; }
.host-view-fallback code {
  background: rgba(0,0,0,0.3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
}

/* ---------------------------------------------------------------- title screen */
.team-form {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.team-input { display: flex; flex-direction: column; gap: 6px; min-width: 200px; flex: 1 1 220px; }
.team-input label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  opacity: 0.75;
}
.team-input--a label { color: var(--spotlight-gold-soft); }
.team-input--b label { color: var(--sky); }
.team-input input {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.25);
  color: var(--cream);
  font-weight: 700;
  font-size: 1.05rem;
}
.team-input--a input:focus { border-color: var(--spotlight-gold); }
.team-input--b input:focus { border-color: var(--sky); }
.vs-badge {
  font-family: var(--font-display);
  color: var(--marquee-red);
  font-size: 1.4rem;
  padding-bottom: 12px;
}

.hint { opacity: 0.6; font-size: 0.85rem; text-align: center; }

/* ---------------------------------------------------------------- rules screen */
.rules-list {
  width: 100%;
  max-width: 640px;
  margin: 0;
  padding-left: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rules-list li {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--cream);
}
.rules-list li strong { color: var(--spotlight-gold-soft); }
.rules-list li::marker {
  font-family: var(--font-display);
  color: var(--spotlight-gold);
}

/* ---------------------------------------------------------------- setup form */
.setup-form {
  width: 100%;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}
.setup-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
  flex: 1 1 220px;
}
.setup-field label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  opacity: 0.75;
  color: var(--spotlight-gold-soft);
}
.setup-field select {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.25);
  color: var(--cream);
  font-weight: 700;
  font-size: 1rem;
}
.setup-field select:focus { border-color: var(--spotlight-gold); }

/* ---------------------------------------------------------------- practice banner */
.practice-banner {
  width: 100%;
  text-align: center;
  background: linear-gradient(145deg, rgba(58, 122, 92, 0.55), rgba(20, 50, 38, 0.65));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(47, 168, 118, 0.55);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: var(--shadow-ambient-sm), var(--shadow-inset-top);
}

/* ---------------------------------------------------------------- get-ready announcement */
.screen--announce { justify-content: center; align-items: center; height: 100%; }
.announce-card {
  width: 100%;
  max-width: 640px;
  text-align: center;
  padding: 48px 32px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 3px solid var(--spotlight-gold);
  box-shadow: var(--shadow-ambient), var(--shadow-inset-top);
}
.announce-card--steal {
  border-color: var(--marquee-red);
  background: linear-gradient(145deg, rgba(110, 32, 56, 0.6), rgba(58, 15, 30, 0.72));
}
.announce-card::before {
  content: "";
  position: absolute;
  inset: -50%;
  z-index: -1;
  background: radial-gradient(circle at 50% 30%, rgba(244, 185, 66, 0.3), transparent 60%);
  animation: auroraSweep 7s var(--ease-out) infinite alternate;
  filter: blur(4px);
}
.announce-card--steal::before {
  background: radial-gradient(circle at 50% 30%, rgba(230, 72, 93, 0.4), transparent 60%);
}
.announce-context {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--spotlight-gold-soft);
}
.announce-card--steal .announce-context { color: #ff9db0; }
.announce-team {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 1px;
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  margin: 0;
  color: var(--spotlight-gold);
  text-shadow: 0 0 18px rgba(244, 185, 66, 0.45);
}
.announce-card--steal .announce-team { color: #ff6b7d; text-shadow: 0 0 18px rgba(230, 72, 93, 0.5); }
.announce-sub {
  margin: 6px 0 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.8;
}
.announce-count {
  font-family: var(--font-display);
  font-size: clamp(4rem, 14vw, 7rem);
  color: var(--cream);
  animation: countBeat 1s ease;
}
.announce-count.is-go { color: var(--emerald); animation: countBeat 0.5s ease; }
@keyframes countBeat {
  0% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------------------------------------------------------------- buttons */
.btn {
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 26px;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), opacity 0.2s ease, filter 0.2s ease;
}
.btn::after {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s var(--ease-out);
  pointer-events: none;
}
.btn:hover::after { left: 130%; }
.btn:hover { transform: translateY(-3px); filter: brightness(1.06); }
.btn:active { transform: translateY(-1px) scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: none; }
.btn:disabled::after { display: none; }

.btn--big { padding: 16px 40px; font-size: 1.1rem; }

.btn--gold {
  background: linear-gradient(180deg, var(--spotlight-gold-soft), var(--spotlight-gold));
  color: #2a1400;
  box-shadow: 0 10px 28px rgba(244, 185, 66, 0.4), inset 0 1px 0 rgba(255,255,255,0.5);
}
.btn--gold:hover { box-shadow: 0 14px 34px rgba(244, 185, 66, 0.5), inset 0 1px 0 rgba(255,255,255,0.5); }
.btn--red {
  background: linear-gradient(180deg, #ff6b7d, var(--marquee-red));
  color: #fff;
  box-shadow: 0 10px 24px rgba(230, 72, 93, 0.4), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn--ghost {
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--cream);
  border: 1px solid rgba(255,255,255,0.18);
}
.btn--outline-a, .btn--outline-b {
  background: rgba(255,255,255,0.03);
  color: var(--cream);
  border: 2px solid var(--spotlight-gold-soft);
}
.btn--outline-b { border-color: var(--sky); }
.btn--tiny {
  background: transparent;
  color: var(--cream);
  opacity: 0.6;
  padding: 6px 14px;
  font-size: 0.8rem;
  border: 1px solid rgba(255,255,255,0.15);
}
.btn--tiny:hover { opacity: 1; }

.icon-btn {
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--cream);
  border-radius: 10px;
  width: 42px; height: 42px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), background 0.25s ease;
}
.icon-btn:hover { transform: translateY(-2px); background: rgba(255,255,255,0.12); }

/* ---------------------------------------------------------------- game header */
.screen--game { gap: 14px; position: relative; }
.game-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-icons { display: flex; gap: 8px; }
.round-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(244, 185, 66, 0.5);
  border-radius: 999px;
  padding: 8px 20px;
  font-family: var(--font-display);
  letter-spacing: 1px;
  color: var(--spotlight-gold);
  box-shadow: var(--shadow-ambient-sm);
}
.round-progress { opacity: 0.7; font-size: 0.85rem; color: var(--cream); font-family: var(--font-body); font-weight: 700; }

.question-banner {
  width: 100%;
  text-align: center;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(244, 185, 66, 0.5);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  box-shadow: var(--shadow-ambient), var(--shadow-inset-top);
}
.question-banner p {
  margin: 0;
  font-weight: 800;
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  color: var(--cream);
}

/* ---------------------------------------------------------------- board */
.board-wrap { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 16px; }

.board {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .board { grid-template-columns: 1fr; }
}

.board-tile {
  display: block;
  position: relative;
  width: 100%;
  perspective: 800px;
  height: 68px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.board-tile .tile-inner {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.55s cubic-bezier(.2,.9,.3,1.2);
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}
.board-tile.is-revealed .tile-inner {
  transform: rotateX(180deg);
  -webkit-transform: rotateX(180deg);
}

.tile-face {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  padding: 0 18px;
  box-sizing: border-box;
}
.tile-front {
  background: linear-gradient(160deg, rgba(74,37,133,0.55), rgba(13,6,32,0.72));
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  border: 2px solid var(--spotlight-gold);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 10px 20px -8px rgba(0,0,0,0.5);
}
.tile-front .tile-number {
  font-family: var(--font-display);
  color: var(--spotlight-gold);
  font-size: 1.4rem;
  width: 34px;
}
.tile-front .tile-placeholder {
  flex: 1;
  height: 10px;
  border-radius: 6px;
  background: repeating-linear-gradient(90deg, rgba(244,185,66,0.25) 0 8px, transparent 8px 16px);
}

.tile-back {
  background: linear-gradient(160deg, #ffe6a8, var(--spotlight-gold-soft) 45%, var(--spotlight-gold));
  color: var(--ink);
  transform: rotateX(180deg);
  -webkit-transform: rotateX(180deg);
  justify-content: space-between;
  border: 2px solid #c98d1f;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 10px 20px -8px rgba(0,0,0,0.4);
}
.tile-back .tile-text {
  font-weight: 800;
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.tile-back .tile-points {
  font-family: var(--font-display);
  font-size: 1.3rem;
  background: var(--ink);
  color: var(--spotlight-gold-soft);
  border-radius: 8px;
  padding: 2px 12px;
  min-width: 44px;
  text-align: center;
}

.board-tile:hover:not(.is-revealed) .tile-front {
  box-shadow: 0 0 0 3px var(--spotlight-gold-soft), inset 0 1px 0 rgba(255,255,255,0.18);
  transform: translateY(-2px);
}

/* strikes */
.strikes-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.strikes-label {
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.75;
}
.strikes {
  display: flex;
  gap: 14px;
}
.strike {
  width: 46px; height: 46px;
  border-radius: 10px;
  border: 2px solid rgba(230,72,93,0.4);
  background: rgba(230,72,93,0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  transition: transform 0.3s var(--ease-out);
}
.strike.is-active {
  background: var(--marquee-red);
  border-color: #ff8a97;
  animation: strikePop 0.4s ease;
}
.strike.is-active::before, .strike.is-active::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 60%; height: 4px;
  background: #fff;
  border-radius: 2px;
}
.strike.is-active::before { transform: translate(-50%,-50%) rotate(45deg); }
.strike.is-active::after { transform: translate(-50%,-50%) rotate(-45deg); }
@keyframes strikePop {
  0% { transform: scale(0.5) rotate(-8deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(4deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.danger-message {
  margin: 0;
  min-height: 1.1em;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
  color: var(--spotlight-gold-soft);
}

/* phase / danger escalation — a pulsing vignette on the game screen itself,
   so the "danger" is felt even without staring at the strike boxes */
.screen--game::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(ellipse 120% 80% at 50% 50%, transparent 55%, rgba(230,72,93,0.35) 100%);
}
.screen--game.danger-1::before { opacity: 0.35; }
.screen--game.danger-2::before {
  opacity: 0.6;
  animation: dangerPulse 1.1s ease-in-out infinite;
}
.screen--game.danger-3::before,
.screen--game.phase-steal::before {
  opacity: 0.85;
  background: radial-gradient(ellipse 120% 80% at 50% 50%, transparent 40%, rgba(230,72,93,0.55) 100%);
  animation: dangerPulse 0.6s ease-in-out infinite;
}
@keyframes dangerPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.85; }
}
.screen--game > * { position: relative; z-index: 1; }

.phase-banner {
  width: 100%;
  text-align: center;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-weight: 800;
  font-size: 0.95rem;
}
.phase-banner--alert {
  background: linear-gradient(145deg, rgba(184, 70, 15, 0.75), rgba(122, 44, 8, 0.82));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid #ff8a3d;
  box-shadow: var(--shadow-ambient-sm), var(--shadow-inset-top);
  animation: dangerPulse 0.8s ease-in-out infinite;
}
.phase-banner--outcome {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--spotlight-gold);
  box-shadow: var(--shadow-ambient-sm), var(--shadow-inset-top);
}

/* ---------------------------------------------------------------- scoreboard */
.scoreboard {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 14px;
}
.score-card {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 2px solid transparent;
  box-shadow: var(--shadow-ambient-sm), var(--shadow-inset-top);
  transition: box-shadow 0.35s var(--ease-out), border-color 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}
.score-card--a { border-color: var(--spotlight-gold-soft); }
.score-card--b { border-color: var(--sky); text-align: right; }
.score-card.is-current {
  transform: translateY(-4px);
  box-shadow: var(--shadow-ambient-sm), var(--shadow-inset-top), 0 0 0 3px rgba(244, 185, 66, 0.3), 0 0 34px rgba(244, 185, 66, 0.4);
}
.score-card--b.is-current {
  box-shadow: var(--shadow-ambient-sm), var(--shadow-inset-top), 0 0 0 3px rgba(78, 168, 222, 0.35), 0 0 34px rgba(78, 168, 222, 0.45);
}
.score-team-name { font-weight: 700; font-size: 0.9rem; opacity: 0.85; }
.score-value {
  font-family: var(--font-display);
  font-size: 2.1rem;
  color: var(--spotlight-gold-soft);
}
.score-card--b .score-value { color: var(--sky); }
.score-status {
  min-height: 1.1em;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--spotlight-gold-soft);
}
.score-card--b .score-status { color: var(--sky); }

.pot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(13, 6, 32, 0.6);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(244, 185, 66, 0.6);
  border-radius: 999px;
  padding: 10px 22px;
  min-width: 110px;
  box-shadow: var(--shadow-ambient-sm), var(--shadow-inset-top);
}
.pot-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1px; opacity: 0.7; }
.pot-value { font-family: var(--font-display); font-size: 1.8rem; color: var(--spotlight-gold); }
.pot-target { font-size: 0.7rem; opacity: 0.8; }
.pot-target strong { color: var(--spotlight-gold-soft); }

/* ---------------------------------------------------------------- controls */
.controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.controls-label { font-size: 0.85rem; opacity: 0.7; margin-right: 4px; }

.chip {
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--cream);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), background 0.25s ease;
}
.chip--a.is-active { background: var(--spotlight-gold-soft); border-color: var(--spotlight-gold-soft); color: var(--ink); }
.chip--b.is-active { background: var(--sky); border-color: var(--sky); color: var(--ink); }
.chip:disabled { opacity: 0.35; cursor: not-allowed; }

.mini-toggle { font-size: 0.8rem; opacity: 0.75; display: flex; align-items: center; gap: 5px; }
.controls-row--mini { gap: 14px; }

/* ---------------------------------------------------------------- end screen */
.final-scores {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  width: 100%;
}
.final-score { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.final-score span { opacity: 0.8; font-weight: 700; }
.final-score strong { font-family: var(--font-display); font-size: 2.6rem; color: var(--spotlight-gold-soft); }
.final-score--b strong { color: var(--sky); }
.final-trophy { font-size: 2.6rem; }
.winner-line { font-weight: 800; font-size: 1.2rem; color: var(--spotlight-gold); text-align: center; }

/* =====================================================================
/* =====================================================================
   Desktop — team panels flank the gameplay on either side. Everything
   fits one screen, no scrolling. Falls back to the original stacked
   layout below this breakpoint (tablets/phones use the mobile block
   further down).
===================================================================== */
@media (min-width: 1000px) and (min-height: 640px) {
  .stage { height: 100vh; padding: 18px 28px; }
  #screen-game.is-active {
    height: 100%;
    max-width: 1180px;
    display: grid;
    grid-template-columns: 220px 1fr 220px;
    grid-template-rows: auto auto auto 1fr auto;
    grid-template-areas:
      "banner banner banner"
      "teamA  header  teamB"
      "teamA  question teamB"
      "teamA  board   teamB"
      "controls controls controls";
    column-gap: 20px;
    row-gap: 12px;
    align-items: start;
  }
  .practice-banner, .phase-banner { grid-area: banner; }
  .game-header { grid-area: header; }
  .question-banner { grid-area: question; align-self: center; }
  .board-wrap { grid-area: board; height: 100%; justify-content: center; }
  .controls { grid-area: controls; }

  /* team side panels: the .scoreboard wrapper steps out of the box
     tree so its two score-cards become direct grid items */
  .scoreboard { display: contents; }
  .score-card--a { grid-area: teamA; align-self: stretch; }
  .score-card--b { grid-area: teamB; align-self: stretch; }
  .score-card {
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 22px 16px;
  }
  .score-card--b { text-align: center; }
  .score-team-name { font-size: 1rem; }
  .score-value { font-size: 3.2rem; }
  .score-status { font-size: 0.8rem; min-height: 2.4em; }

  .announce-count { font-size: 8rem; }
}

/* =====================================================================
   Mobile — fit the whole game screen in one viewport, no scrolling.
   Uses dynamic viewport height (dvh) so mobile browser toolbars don't
   cause a scrollbar to appear/disappear as they show or hide.
===================================================================== */
@media (max-width: 640px), (max-height: 720px) {
  .stage {
    height: 100dvh;
    min-height: 100dvh;
    padding: 8px 10px;
    align-items: stretch;
  }
  .screen {
    gap: 8px;
    max-width: 100%;
  }
  .screen--title, .screen--rules, .screen--end {
    height: 100%;
    justify-content: center;
    overflow-y: auto;
  }

  /* ---- game screen: fixed-height flex layout, everything shrinks to fit ---- */
  .screen--game {
    height: 100%;
    justify-content: flex-start;
    gap: 6px;
  }
  .practice-banner, .phase-banner { padding: 6px 10px; font-size: 0.75rem; }

  .game-header { flex: 0 0 auto; }
  .round-pill { padding: 5px 12px; font-size: 0.8rem; gap: 6px; }
  .round-progress { font-size: 0.7rem; }
  .icon-btn { width: 32px; height: 32px; font-size: 0.85rem; }

  .question-banner { padding: 8px 12px; flex: 0 0 auto; }
  .question-banner p { font-size: 0.82rem; line-height: 1.25; }

  .board-wrap { gap: 6px; flex: 1 1 auto; min-height: 0; justify-content: center; }
  .board { gap: 5px; }
  .board-tile { height: 34px; }
  .tile-face { padding: 0 10px; border-radius: 7px; }
  .tile-front .tile-number { font-size: 0.9rem; width: 20px; }
  .tile-back .tile-text { font-size: 0.62rem; }
  .tile-back .tile-points {
    font-size: 0.8rem;
    padding: 1px 8px;
    min-width: 28px;
  }

  .strikes-row { gap: 8px; }
  .strikes-label { font-size: 0.65rem; }
  .strike { width: 26px; height: 26px; border-radius: 6px; }
  .danger-message { font-size: 0.68rem; min-height: 1em; }

  .scoreboard { gap: 6px; flex: 0 0 auto; }
  .score-card { padding: 6px 10px; gap: 0; }
  .score-team-name { font-size: 0.65rem; }
  .score-value { font-size: 1.3rem; }
  .pot { padding: 4px 12px; min-width: 70px; }
  .pot-label { font-size: 0.55rem; }
  .pot-value { font-size: 1.1rem; }
  .pot-target { font-size: 0.55rem; }

  .announce-card { padding: 24px 18px; }
  .announce-team { font-size: clamp(1.6rem, 9vw, 2.4rem); }
  .announce-count { font-size: clamp(3rem, 22vw, 5rem); }
  .host-view-box { padding: 10px 12px; }
  .host-view-copy { font-size: 0.75rem; }
  .btn--tiny-plus { padding: 5px 10px; font-size: 0.68rem; }

  .controls { gap: 6px; flex: 0 0 auto; }
  .controls-row { gap: 6px; }
  .controls-label { font-size: 0.7rem; }
  .chip { padding: 5px 12px; font-size: 0.75rem; }
  .btn { padding: 8px 16px; font-size: 0.75rem; }
  .btn--tiny { padding: 4px 8px; font-size: 0.62rem; }
  .mini-toggle { font-size: 0.62rem; }

  /* setup form + rules stay comfortably scrollable/compact too */
  .marquee-frame { padding: 16px 14px 12px; }
  .show-title { font-size: clamp(1.6rem, 8vw, 2.4rem); }
  .setup-form, .team-form { gap: 10px; }
  .rules-list { gap: 8px; }
  .rules-list li { font-size: 0.85rem; }
}

/* ---------------------------------------------------------------- confetti */
.confetti-piece {
  position: fixed;
  top: -10px;
  width: 10px; height: 14px;
  z-index: 50;
  pointer-events: none;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(540deg); opacity: 0.3; }
}
