/* ==========================================================================
   Impostral — clean tactical theme (Mistral orange on dark)
   Layout goal: everything fits the viewport on desktop, no page scroll.
   ========================================================================== */

:root {
  --bg: #0b0a08;
  --panel: rgba(17, 15, 11, 0.72);
  --panel-strong: rgba(10, 9, 6, 0.96);
  --orange: #ff8205;
  --orange-bright: #ffaf00;
  --orange-dim: rgba(255, 130, 5, 0.35);
  --red: #e10500;
  --gold: #ffd800;
  --text: #f4efe6;
  --muted: #8d8779;
  --faint: #55503f;
  --line: rgba(255, 130, 5, 0.28);
  --line-soft: rgba(244, 239, 230, 0.1);
  --mono: "SFMono-Regular", "Roboto Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --display: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  --seat-you-suffix: " // you";
  --arena-you-label: "YOU";
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 130, 5, 0.06), transparent 55%),
    linear-gradient(rgba(255, 130, 5, 0.025) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, rgba(255, 130, 5, 0.025) 1px, transparent 1px) 0 0 / 44px 100%,
    var(--bg);
  font-family: var(--mono);
  line-height: 1.5;
}

html[lang="fr"] body {
  --seat-you-suffix: " // vous";
  --arena-you-label: "VOUS";
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   App shell: header / main. Column that fills the viewport.
   -------------------------------------------------------------------------- */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  min-height: 64px;
  padding: 6px clamp(18px, 3vw, 48px) 0;
}
.brand {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: clamp(158px, 18vw, 206px);
  aspect-ratio: 1262 / 236;
  overflow: hidden;
  background: transparent;
  color: var(--text);
  line-height: 0;
  text-decoration: none;
}
.brand img {
  position: absolute;
  top: -147.0339%;
  left: -6.4184%;
  display: block;
  width: 111.7274%;
  max-width: none;
  height: auto;
  image-rendering: pixelated;
  filter: none;
}
.hud-nav { display: flex; align-items: center; gap: 10px; }
.hud-nav a,
.sound-toggle {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--orange);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-transform: uppercase;
}
.hud-nav a:hover,
.sound-toggle:hover { background: var(--orange); color: #180900; }
.hud-nav a:focus-visible,
.sound-toggle:focus-visible {
  outline: 2px solid var(--orange-bright);
  outline-offset: 3px;
}
.sound-meter {
  display: inline-flex;
  width: 14px;
  height: 12px;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}
.sound-meter i {
  display: block;
  width: 2px;
  height: 10px;
  background: currentColor;
  image-rendering: pixelated;
  transform: scaleY(0.45);
  transform-origin: bottom;
}
.sound-toggle[aria-pressed="true"] .sound-meter i {
  animation: sound-meter-pulse 1.2s steps(3, end) infinite;
}
.sound-toggle[aria-pressed="true"] .sound-meter i:nth-child(2) {
  height: 7px;
  animation-delay: -0.42s;
}
.sound-toggle[aria-pressed="true"] .sound-meter i:nth-child(3) {
  height: 11px;
  animation-delay: -0.78s;
}
.sound-toggle[aria-pressed="false"] .sound-meter i {
  height: 2px;
  animation: none;
  opacity: 0.55;
  transform: none;
}
.sound-toggle[hidden] { display: none; }
@keyframes sound-meter-pulse {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}
.voice-gate {
  position: fixed;
  top: 74px;
  left: 50%;
  z-index: 120;
  display: flex;
  width: min(520px, calc(100vw - 32px));
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--orange);
  background: rgba(10, 9, 6, 0.96);
  box-shadow: 8px 8px 0 rgba(255, 130, 5, 0.13);
  color: var(--text);
  font-size: 0.66rem;
  transform: translateX(-50%);
}
.voice-gate button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  background: var(--orange);
  color: #180900;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.voice-gate button:focus-visible {
  outline: 2px solid var(--orange-bright);
  outline-offset: 3px;
}

main { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
main > section { flex: 1 1 auto; min-width: 0; min-height: 0; }

/* --------------------------------------------------------------------------
   Join screen
   -------------------------------------------------------------------------- */
.join-screen {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(18px, 3vh, 32px);
  padding: clamp(18px, 3vh, 34px) clamp(20px, 4vw, 64px) 18px;
  overflow: auto;
}
.join-screen::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, transparent 0 74%, rgba(255, 130, 5, 0.055) 74% 74.1%, transparent 74.1%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(255, 255, 255, 0.012) 5px 6px);
  content: "";
  pointer-events: none;
}
.join-screen::after {
  position: absolute;
  top: 9%;
  right: clamp(8px, 1.4vw, 22px);
  bottom: 9%;
  z-index: -1;
  width: 3px;
  background: repeating-linear-gradient(180deg, var(--orange) 0 32px, transparent 32px 46px);
  content: "";
  opacity: 0.45;
  pointer-events: none;
}

.landing-grid {
  display: grid;
  grid-template-columns: minmax(380px, 0.88fr) minmax(520px, 1.12fr);
  width: min(1420px, 100%);
  min-height: 0;
  align-items: center;
  gap: clamp(40px, 6vw, 104px);
  margin: auto;
}

.landing-copy { min-width: 0; }
.landing-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: clamp(18px, 3vh, 30px);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.landing-kicker > span:not(.live-dot) { color: var(--faint); }
.live-dot {
  width: 7px;
  height: 7px;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(225, 5, 0, 0.13);
  animation: live-pulse 1.8s ease-in-out infinite;
}
@keyframes live-pulse { 50% { opacity: 0.45; } }

.landing-copy h1 {
  display: flex;
  margin: 0 0 20px;
  flex-direction: column;
  font-family: var(--display);
  font-size: clamp(3.4rem, 6.6vw, 6.8rem);
  line-height: 0.76;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}
.landing-copy h1 span:nth-child(2) {
  align-self: flex-end;
  margin-right: 4%;
  color: rgba(244, 239, 230, 0.1);
  -webkit-text-stroke: 1px rgba(244, 239, 230, 0.62);
}
.landing-copy h1 strong {
  align-self: flex-end;
  margin-top: 0.08em;
  color: var(--orange);
  font-weight: inherit;
  text-shadow: 8px 8px 0 rgba(225, 5, 0, 0.24);
}
.landing-lede {
  max-width: 580px;
  margin: 0 0 clamp(20px, 3vh, 32px);
  padding-left: 18px;
  border-left: 2px solid var(--orange);
  color: #bdb6a8;
  font-size: clamp(0.74rem, 1vw, 0.88rem);
  line-height: 1.7;
}

.join-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.72fr);
  gap: 10px 12px;
  width: 100%;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
}
.play-btn {
  display: flex;
  min-height: 68px !important;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px !important;
  background: var(--orange) !important;
  color: #180900 !important;
  font-size: 0.82rem;
}
.play-btn b { font-size: 1.35rem; line-height: 1; }
.play-btn:hover:not(:disabled) { background: var(--orange-bright) !important; }
.join-console label { display: flex; min-width: 0; flex-direction: column; gap: 5px; text-align: left; }
.join-console label > span {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.join-console small { color: var(--faint); }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 0;
  outline: 0;
  background: rgba(10, 9, 6, 0.9);
  color: var(--text);
  transition: border-color 150ms, box-shadow 150ms;
}
input { height: 44px; padding: 0 12px; }
textarea, select { padding: 10px 12px; }
input:focus, textarea:focus, select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 1px rgba(255, 130, 5, 0.25);
}

.btn,
.join-console button,
#input-controls button,
#submit-vote {
  min-height: 46px;
  border: 1px solid var(--orange);
  border-radius: 0;
  background: rgba(255, 130, 5, 0.1);
  color: var(--orange-bright);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 150ms, background 150ms, transform 150ms;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
}
.btn:hover:not(:disabled),
.join-console button:hover:not(:disabled),
#input-controls button:hover:not(:disabled),
#submit-vote:hover:not(:disabled) {
  background: var(--orange);
  color: #180900;
  transform: translateY(-1px);
}
.btn:disabled,
.join-console button:disabled,
#input-controls button:disabled,
#submit-vote:disabled { cursor: not-allowed; opacity: 0.4; transform: none; }

.turnstile-container { grid-column: 1 / -1; display: flex; justify-content: center; }
.turnstile-container:empty { display: none; }
.hint { grid-column: 1 / -1; min-height: 1.1em; margin: 0; color: #c07a52; font-size: 0.7rem; text-align: left; }

.advanced-options { grid-column: 1 / -1; border-top: 1px solid var(--line-soft); padding-top: 8px; text-align: left; }
.advanced-options summary { color: var(--muted); cursor: pointer; font-size: 0.64rem; letter-spacing: 0.14em; list-style-position: inside; text-transform: uppercase; }
.advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 12px; }
.advanced-grid > button { grid-column: 1 / -1; }
.mode-switch { grid-column: 1 / -1; display: flex; gap: 8px; }
.mode-switch button { flex: 1; min-height: 36px; font-size: 0.66rem; opacity: 0.55; }
.mode-switch button[aria-selected="true"] { background: var(--orange); color: #180900; opacity: 1; }

.landing-proof {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 18px;
  margin-top: 14px;
  color: var(--faint);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.landing-proof span::before { margin-right: 7px; color: var(--orange); content: "■"; font-size: 0.46rem; }

.suspect-board {
  position: relative;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 130, 5, 0.55);
  background:
    linear-gradient(135deg, rgba(255, 130, 5, 0.08), transparent 30%),
    rgba(7, 6, 4, 0.92);
  box-shadow: 16px 16px 0 rgba(255, 130, 5, 0.08);
}
.suspect-board::before,
.suspect-board::after {
  position: absolute;
  z-index: 2;
  width: 28px;
  height: 28px;
  content: "";
  pointer-events: none;
}
.suspect-board::before { top: -2px; left: -2px; border-top: 3px solid var(--orange); border-left: 3px solid var(--orange); }
.suspect-board::after { right: -2px; bottom: -2px; border-right: 3px solid var(--orange); border-bottom: 3px solid var(--orange); }
.board-head,
.board-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.board-head { padding: 0 2px 12px; border-bottom: 1px solid var(--line); }
.board-status { color: #c7c1b5; }
.board-status i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  background: var(--red);
  box-shadow: 0 0 8px rgba(225, 5, 0, 0.8);
}
.question-signal {
  display: grid;
  grid-template-columns: minmax(120px, 0.38fr) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: clamp(14px, 2.2vh, 24px) 4px;
}
.question-signal > span {
  color: var(--orange);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.question-signal p {
  margin: 0;
  color: var(--text);
  font-size: clamp(0.72rem, 1.1vw, 0.95rem);
  line-height: 1.45;
}
.suspect-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.suspect-card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  aspect-ratio: 1.15;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(rgba(255, 130, 5, 0.05) 1px, transparent 1px) 0 0 / 100% 20px,
    linear-gradient(90deg, rgba(255, 130, 5, 0.05) 1px, transparent 1px) 0 0 / 20px 100%,
    #0c0a07;
}
.suspect-card::before {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 34%;
  background: linear-gradient(transparent, rgba(5, 4, 3, 0.92));
  content: "";
}
.suspect-card--active { border-color: var(--orange); background-color: rgba(255, 130, 5, 0.08); }
.suspect-card--active::after {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 7px;
  height: 7px;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 130, 5, 0.14);
  content: "";
}
.suspect-card--flagged img { filter: grayscale(0.45) contrast(1.15); }
.suspect-card--flagged::after {
  position: absolute;
  top: 14%;
  right: -10%;
  z-index: 3;
  width: 62%;
  padding: 3px 0;
  background: var(--red);
  color: #fff;
  content: "SUSPECT";
  font-size: clamp(0.38rem, 0.6vw, 0.55rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  text-align: center;
  transform: rotate(35deg);
}
.suspect-card img {
  position: absolute;
  top: 48%;
  left: 50%;
  width: 86%;
  max-height: 82%;
  object-fit: contain;
  image-rendering: pixelated;
  transform: translate(-50%, -50%);
}
.suspect-card figcaption {
  position: absolute;
  right: 8px;
  bottom: 7px;
  left: 8px;
  z-index: 2;
  color: #c8c1b4;
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.suspect-id {
  position: absolute;
  top: 6px;
  left: 7px;
  z-index: 2;
  color: rgba(255, 130, 5, 0.65);
  font-size: 0.52rem;
  font-weight: 800;
}
.board-footer { padding: 13px 2px 0; }
.board-footer strong { color: var(--orange); font-weight: 700; }
.identity-track { height: 3px; flex: 1; overflow: hidden; background: rgba(244, 239, 230, 0.08); }
.identity-track i {
  display: block;
  width: 46%;
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--orange) 0 5px, transparent 5px 8px);
  animation: identity-scan 3.8s ease-in-out infinite alternate;
}
@keyframes identity-scan { to { transform: translateX(118%); } }

.landing-bottom {
  display: flex;
  width: min(1420px, 100%);
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin: 0 auto;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.game-loop {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  width: min(680px, 62%);
  gap: clamp(14px, 2vw, 34px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.game-loop li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.game-loop b {
  display: grid;
  width: 34px;
  height: 34px;
  border: 1px solid var(--orange);
  color: var(--orange);
  font-size: 0.68rem;
  place-items: center;
}
.game-loop li span { line-height: 1.35; }
.game-loop li strong { display: block; color: var(--text); font-size: 0.63rem; }

.hackathon-credit {
  color: var(--faint);
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  text-align: right;
  white-space: nowrap;
}
.hackathon-credit strong { display: block; margin-bottom: 3px; color: var(--orange); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; }
.hackathon-credit span { margin: 0 0.45em; }
.hackathon-credit a { color: var(--muted); text-underline-offset: 3px; }
.hackathon-credit a:hover { color: var(--orange); }

/* --------------------------------------------------------------------------
   Join screen v2 — Mistral-inspired, minimal, pixel-first.
   Kept scoped to the join state so the in-game dark interface stays intact.
   -------------------------------------------------------------------------- */
body[data-screen="join"] {
  --landing-bg: #0b0a08;
  --landing-surface: #151524;
  --landing-surface-raised: #242433;
  --landing-text: #f5f4ef;
  --landing-text-soft: #dcdcde;
  --landing-muted: #88889c;
  --landing-border: #343446;
  overflow: hidden;
  background: var(--landing-bg);
  color: var(--landing-text);
  font-family: Inter, Arial, Helvetica, sans-serif;
}
body[data-screen="join"] .hud-header {
  min-height: 70px;
  padding: 12px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--landing-border);
  background: var(--landing-bg);
}
body[data-screen="join"] .brand {
  background: transparent;
  color: var(--landing-text);
}
body[data-screen="join"] .hud-nav a,
body[data-screen="join"] .sound-toggle {
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--landing-text-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
body[data-screen="join"] .hud-nav a:hover,
body[data-screen="join"] .sound-toggle:hover {
  border-bottom-color: var(--orange);
  background: transparent;
  color: var(--landing-text);
}
body[data-screen="join"] main { background: var(--landing-bg); }
body[data-screen="join"] .join-screen {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 16px;
  padding: clamp(28px, 5vh, 64px) clamp(20px, 5vw, 80px) 20px;
  overflow: auto;
}
body[data-screen="join"] .join-screen::before {
  position: absolute;
  top: 11%;
  right: 0;
  z-index: -2;
  width: clamp(64px, 9vw, 140px);
  height: 28px;
  background: #ff5229;
  box-shadow:
    -28px 28px 0 #ff8204,
    0 56px 0 #ffaf01,
    -56px 84px 0 var(--landing-surface-raised);
  content: "";
  opacity: 0.95;
}
body[data-screen="join"] .join-screen::after {
  position: absolute;
  bottom: 16%;
  left: 0;
  z-index: -2;
  width: 44px;
  height: 18px;
  background: #ffaf01;
  box-shadow: 22px 18px 0 #ff8204, 44px 36px 0 #e51300;
  content: "";
  opacity: 0.7;
}
body[data-screen="join"] .landing-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.84fr) minmax(500px, 1.16fr);
  width: min(1320px, 100%);
  min-height: 0;
  align-items: center;
  gap: clamp(34px, 6vw, 96px);
  margin: auto;
}
body[data-screen="join"] .landing-copy { max-width: 560px; }
body[data-screen="join"] .landing-kicker {
  display: block;
  margin: 0 0 20px;
  color: #fa500f;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
body[data-screen="join"] .landing-kicker::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 9px;
  background: #fa500f;
  content: "";
}
body[data-screen="join"] .landing-copy h1 {
  display: block;
  max-width: 540px;
  margin: 0 0 22px;
  color: var(--landing-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(2.9rem, 4.5vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.98;
  text-transform: none;
}
body[data-screen="join"] .landing-lede {
  max-width: 520px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  color: var(--landing-text-soft);
  font-size: clamp(0.92rem, 1.35vw, 1.14rem);
  line-height: 1.55;
}
body[data-screen="join"] .landing-rule {
  margin: 0 0 30px;
  color: var(--landing-muted);
  font-family: var(--mono);
  font-size: 0.69rem;
}
body[data-screen="join"] .join-console {
  display: block;
  width: min(430px, 100%);
  padding: 0;
  border: 0;
  background: transparent;
}
body[data-screen="join"] .game-language {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
}
body[data-screen="join"] .game-language > span {
  color: var(--landing-muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
body[data-screen="join"] .language-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--landing-border);
  background: var(--landing-surface);
}
body[data-screen="join"] .language-switch button {
  display: grid;
  min-width: 76px;
  min-height: 44px;
  padding: 5px 10px;
  border: 0;
  background: transparent;
  color: var(--landing-muted);
  clip-path: none;
  justify-items: start;
  letter-spacing: 0;
  text-transform: none;
}
body[data-screen="join"] .language-switch button b {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}
body[data-screen="join"] .language-switch button small {
  color: inherit;
  font-size: 0.52rem;
}
body[data-screen="join"] .language-switch button[aria-checked="true"] {
  background: var(--landing-text);
  color: var(--landing-bg);
}
body[data-screen="join"] .language-switch button:hover:not(:disabled) {
  background: #ffaf01;
  color: #151524;
  transform: none;
}
body[data-screen="join"] .language-switch button:focus-visible {
  outline: 2px solid #ff8204;
  outline-offset: 2px;
}
body[data-screen="join"] .play-btn {
  display: flex;
  width: 100%;
  min-height: 60px !important;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px !important;
  border: 2px solid var(--landing-text) !important;
  background: #ff8204 !important;
  box-shadow: 7px 7px 0 #ffaf01;
  color: #151524 !important;
  clip-path: none;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: box-shadow 140ms, transform 140ms, background 140ms;
}
body[data-screen="join"] .play-btn b { font-size: 1.25rem; }
body[data-screen="join"] .play-btn:hover:not(:disabled) {
  background: #ffaf01 !important;
  box-shadow: 3px 3px 0 #ff5229;
  color: #151524 !important;
  transform: translate(4px, 4px);
}
body[data-screen="join"] .turnstile-container {
  display: flex;
  margin-top: 12px;
  justify-content: flex-start;
}
body[data-screen="join"] .turnstile-container:empty { display: none; }
body[data-screen="join"] .hint {
  min-height: 1.2em;
  margin: 10px 0 0;
  color: #ffb598;
  font-family: var(--mono);
  font-size: 0.65rem;
}
body[data-screen="join"] .advanced-options {
  margin-top: 18px;
  padding: 0;
  border: 0;
}
body[data-screen="join"] .advanced-options summary {
  color: var(--landing-muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0;
  text-transform: none;
}
body[data-screen="join"] .advanced-options summary:hover { color: var(--landing-text); }
body[data-screen="join"] .advanced-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--landing-border);
  background: var(--landing-surface);
}
body[data-screen="join"] .advanced-grid .codename-field,
body[data-screen="join"] .advanced-grid .mode-switch,
body[data-screen="join"] .advanced-grid > button { grid-column: 1 / -1; }
body[data-screen="join"] .join-console label > span {
  color: var(--landing-text-soft);
  font-size: 0.58rem;
}
body[data-screen="join"] .join-console small { color: #88889c; }
body[data-screen="join"] input {
  border: 1px solid var(--landing-border);
  background: var(--landing-bg);
  color: var(--landing-text);
}
body[data-screen="join"] input:focus {
  border-color: #ff8204;
  box-shadow: 0 0 0 1px #ff8204;
}
body[data-screen="join"] .mode-switch button,
body[data-screen="join"] #join-btn {
  border: 1px solid var(--landing-border);
  background: var(--landing-bg);
  color: var(--landing-text-soft);
  clip-path: none;
}
body[data-screen="join"] .mode-switch button[aria-selected="true"],
body[data-screen="join"] #join-btn:hover:not(:disabled) {
  border-color: var(--orange);
  background: var(--orange);
  color: #151524;
}
body[data-screen="join"] .landing-note {
  margin: 16px 0 0;
  color: var(--landing-muted);
  font-family: var(--mono);
  font-size: 0.58rem;
}

body[data-screen="join"] .character-stage {
  --orbit-radius: clamp(190px, 21vw, 310px);
  position: relative;
  min-width: 0;
  min-height: clamp(410px, 62vh, 590px);
}
body[data-screen="join"] .pixel-cloud {
  position: absolute;
  z-index: -1;
  width: 36px;
  height: 36px;
  background: #ffaf01;
}
body[data-screen="join"] .pixel-cloud--one {
  top: 18%;
  right: 5%;
  box-shadow: -36px 36px 0 #ff8204, -72px 72px 0 #ff5229;
}
body[data-screen="join"] .pixel-cloud--two {
  bottom: 15%;
  left: 8%;
  width: 28px;
  height: 28px;
  background: #ff5229;
  box-shadow: 28px 28px 0 #ff8204, 56px 56px 0 #ffaf01;
}
body[data-screen="join"] .carousel-scene {
  position: absolute;
  inset: 6% 0 5%;
  overflow: hidden;
  perspective: 980px;
}
body[data-screen="join"] .character-carousel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 150px;
  transform-style: preserve-3d;
  animation: character-orbit 28s linear infinite;
}
body[data-screen="join"] .character-carousel figure {
  position: absolute;
  inset: 0;
  margin: 0;
  backface-visibility: hidden;
  transform: rotateY(calc(var(--i) * 36deg)) translateZ(var(--orbit-radius));
  transform-style: preserve-3d;
}
body[data-screen="join"] .character-carousel figure::before {
  position: absolute;
  inset: 20px 8px 4px;
  z-index: -1;
  border: 2px solid var(--landing-border);
  background: var(--landing-surface);
  box-shadow: 8px 8px 0 var(--card-color, #ff8204);
  content: "";
}
body[data-screen="join"] .character-carousel figure:nth-child(3n + 2) { --card-color: #ffaf01; }
body[data-screen="join"] .character-carousel figure:nth-child(3n) { --card-color: #ff5229; }
body[data-screen="join"] .character-carousel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(8px 10px 0 rgba(0, 0, 0, 0.42));
}
@keyframes character-orbit {
  from { transform: translate(-50%, -50%) rotateX(-7deg) rotateY(0); }
  to { transform: translate(-50%, -50%) rotateX(-7deg) rotateY(-360deg); }
}
body[data-screen="join"] .carousel-floor {
  position: absolute;
  bottom: 9%;
  left: 50%;
  width: 72%;
  height: 16px;
  background: rgba(245, 244, 239, 0.12);
  box-shadow: 0 16px 0 rgba(245, 244, 239, 0.05);
  transform: translateX(-50%) skewX(-35deg);
}
body[data-screen="join"] .stage-caption {
  position: absolute;
  right: 5%;
  bottom: 4%;
  z-index: 8;
  margin: 0;
  padding: 8px 10px;
  background: var(--landing-text);
  color: var(--landing-surface);
  font-family: var(--mono);
  font-size: 0.62rem;
}
body[data-screen="join"] .hackathon-credit {
  display: flex;
  width: min(1320px, 100%);
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  padding-top: 14px;
  border-top: 1px solid var(--landing-border);
  color: var(--landing-muted);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0;
  text-align: left;
  white-space: normal;
}
body[data-screen="join"] .hackathon-credit span { margin: 0; }
body[data-screen="join"] .hackathon-credit a { color: var(--landing-text-soft); }
body[data-screen="join"] .hackathon-credit a:hover { color: #fa500f; }

/* --------------------------------------------------------------------------
   Game screen
   -------------------------------------------------------------------------- */
.game-screen { padding: 4px clamp(14px, 2vw, 32px) 16px; }
.game-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: clamp(12px, 1.6vw, 22px);
  height: 100%;
}
.game-screen.vote-open .game-layout { grid-template-columns: 210px minmax(0, 1fr) 230px; }

.tactical-panel {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 15, 11, 0.7), rgba(8, 7, 5, 0.9));
}
.tactical-panel::before, .tactical-panel::after {
  position: absolute;
  width: 11px;
  height: 11px;
  content: "";
  pointer-events: none;
}
.tactical-panel::before { top: -1px; left: -1px; border-top: 2px solid var(--orange); border-left: 2px solid var(--orange); }
.tactical-panel::after { right: -1px; bottom: -1px; border-right: 2px solid var(--orange); border-bottom: 2px solid var(--orange); }

/* Left: mission panel — metrics + live feed */
.mission-panel { display: flex; min-height: 0; flex-direction: column; padding: 14px 14px 10px; }
.metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(255, 130, 5, 0.14);
}
.metric-row > span {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.metric-row strong {
  color: var(--orange);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.metric-row strong small { color: rgba(255, 130, 5, 0.45); font-size: 0.75rem; font-weight: 500; }
.metric-row strong b, .metric-row strong i { font: inherit; }
#phase-timer { display: inline; }
.metric-row #phase-name {
  overflow: hidden;
  max-width: 60%;
  color: var(--orange-bright);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.feed-label {
  margin: 14px 0 6px;
  color: var(--faint);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
#transcript {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 130, 5, 0.4) transparent;
}
.transcript-empty { margin: 8px 0; color: var(--faint); font-size: 0.6rem; }
.utt { margin: 0 0 7px; color: #b5aea0; font-size: 0.64rem; line-height: 1.4; overflow-wrap: break-word; }
.utt .who { color: var(--orange-bright); font-weight: 800; }
.utt .ctx { color: var(--faint); font-size: 0.56rem; text-transform: uppercase; }
.utt .utterance-text { margin-left: 6px; }
.utt.sys { color: var(--faint); font-size: 0.58rem; }

/* Center: arena */
.arena-shell { display: flex; min-width: 0; min-height: 0; flex-direction: column; gap: 10px; }
.arena-viz {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.arena-viz::before {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: min(86%, 130vh);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 130, 5, 0.18);
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 56px, rgba(255, 130, 5, 0.05) 56px 57px),
    radial-gradient(circle, rgba(255, 130, 5, 0.05), transparent 55%);
  content: "";
  transform: translate(-50%, -50%);
}

#seats { position: absolute; inset: 0; z-index: 2; }
.seat {
  position: absolute;
  top: var(--seat-y, 50%);
  left: var(--seat-x, 50%);
  display: flex;
  width: clamp(120px, 14vw, 168px);
  align-items: center;
  flex-direction: column;
  text-align: center;
  transform: translate(-50%, -46%);
  transition: opacity 300ms, filter 300ms;
}
.seat-avatar-wrap {
  position: relative;
  display: grid;
  width: clamp(58px, 8.5vh, 84px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 130, 5, 0.75);
  border-radius: 50%;
  background: var(--panel-strong);
  box-shadow: 0 0 0 4px rgba(255, 130, 5, 0.05), 0 0 18px rgba(255, 130, 5, 0.08);
  place-items: center;
}
.seat-avatar {
  position: relative;
  z-index: 1;
  display: block;
  width: 80%;
  height: 76%;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}
.seat-index {
  position: absolute;
  bottom: -11px;
  left: 50%;
  z-index: 2;
  display: grid;
  width: 23px;
  height: 23px;
  border: 1px solid var(--orange);
  background: var(--bg);
  color: var(--orange);
  font-size: 0.68rem;
  place-items: center;
  transform: translateX(-50%);
}
.seat-meta { width: 100%; margin-top: 15px; }
.seat-name {
  display: block;
  overflow: hidden;
  font-size: clamp(0.66rem, 1.1vw, 0.8rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seat .role {
  display: block;
  color: var(--faint);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.seat .role.is-llm { color: var(--orange-bright); text-transform: none; }
.seat .role.is-human { color: var(--gold); }
.seat-answer {
  display: block;
  overflow: visible;
  width: 100%;
  min-height: 1.3em;
  margin-top: 2px;
  color: var(--orange);
  font-size: clamp(0.56rem, 0.9vw, 0.68rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
}
.seat.you .seat-avatar-wrap { box-shadow: 0 0 0 4px rgba(255, 130, 5, 0.12), 0 0 26px rgba(255, 130, 5, 0.28); }
.seat.you .seat-name::after { color: var(--orange); content: var(--seat-you-suffix); font-size: 0.55em; text-transform: uppercase; }
.seat.active-turn:not(.dead) .seat-avatar-wrap {
  border-color: var(--yellow);
  background: rgba(255, 175, 1, 0.1);
  box-shadow: 0 0 0 5px rgba(255, 175, 1, 0.08), 0 0 28px rgba(255, 175, 1, 0.32);
  transform: translateY(-3px) scale(1.03);
}
.seat.active-turn:not(.dead) .seat-index {
  border-color: var(--yellow);
  color: var(--yellow);
}
.seat.dead { opacity: 0.3; filter: grayscale(1); }
.seat.dead .seat-name { text-decoration: line-through; }
.seat.dead .seat-avatar-wrap::after {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  border-radius: 50%;
  color: var(--red);
  font-size: 1.7rem;
  font-weight: 700;
  content: "✕";
  place-items: center;
}
.vote-badge {
  position: absolute;
  top: -10px;
  right: -26px;
  z-index: 4;
  padding: 2px 7px;
  border: 1px solid var(--orange);
  background: var(--bg);
  color: var(--orange-bright);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: badge-pop 320ms cubic-bezier(0.2, 1.8, 0.4, 1);
}
.vote-badge.out {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}
@keyframes badge-pop { from { opacity: 0; transform: scale(0.3); } }

.seat.speaking .seat-avatar-wrap {
  background: rgba(255, 130, 5, 0.12);
  box-shadow: 0 0 0 5px rgba(255, 130, 5, 0.1), 0 0 30px rgba(255, 130, 5, 0.45);
  animation: signal-pulse 1s ease-in-out infinite alternate;
}
@keyframes signal-pulse { to { transform: scale(1.05); } }

.question-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: grid;
  width: min(440px, 46%);
  align-content: center;
  min-height: 120px;
  padding: 20px 26px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: 0 0 34px rgba(0, 0, 0, 0.8);
  text-align: center;
  transform: translate(-50%, -50%);
  clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 9px, 100% calc(100% - 9px), calc(100% - 9px) 100%, 9px 100%, 0 calc(100% - 9px), 0 9px);
}
body[data-phase="game_over"] .question-frame { display: none; }
.question-frame::before, .question-frame::after { position: absolute; width: 22px; height: 22px; content: ""; }
.question-frame::before { top: -1px; left: -1px; border-top: 3px solid var(--orange); border-left: 3px solid var(--orange); }
.question-frame::after { right: -1px; bottom: -1px; border-right: 3px solid var(--orange); border-bottom: 3px solid var(--orange); }
.question-label { color: var(--orange); font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; }
.prompt {
  margin: 10px 0 0;
  font-size: clamp(0.95rem, 1.9vh, 1.4rem);
  font-weight: 800;
  line-height: 1.35;
  text-wrap: balance;
}
.lobby-wait-copy { display: block; }
.lobby-countdown {
  display: block;
  margin-top: 8px;
  color: var(--orange);
  font-size: clamp(2.8rem, 8vh, 5.4rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.lobby-player-count {
  display: block;
  margin-top: 8px;
  color: var(--orange);
  font-size: clamp(2.4rem, 7vh, 4.8rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.lobby-player-caption {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Answer input bar */
#input-panel {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}
.input-header {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.input-timer { color: var(--orange); font-variant-numeric: tabular-nums; }
#input-controls { display: flex; align-items: stretch; gap: 8px; padding: 10px; }
#input-controls textarea { min-height: 48px; flex: 1 1 auto; resize: none; }
#input-controls button { min-height: 44px; padding: 0 18px; font-size: 0.62rem; white-space: nowrap; }
#input-controls button.rec { border-color: var(--red); color: #ff8a70; }
#input-controls button.rec.recording {
  background: var(--red);
  color: #fff;
  animation: rec-blink 1s ease-in-out infinite alternate;
}
@keyframes rec-blink { to { background: #8f0300; } }

/* Right: vote panel */
.vote-panel { display: flex; min-width: 0; min-height: 0; flex-direction: column; padding: 18px 16px 16px; }
.vote-heading > span { color: var(--orange); font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; }
.vote-heading p { margin: 8px 0 16px; color: var(--muted); font-size: 0.66rem; line-height: 1.5; }
.vote-options {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.vote-option {
  display: grid;
  grid-template-columns: 16px 32px minmax(0, 1fr);
  min-height: 46px;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: #bbb7b0;
  text-align: left;
}
.vote-option::before { width: 12px; height: 12px; border: 1px solid var(--orange); border-radius: 50%; content: ""; }
.vote-option[aria-checked="true"]::before { background: var(--orange); box-shadow: inset 0 0 0 3px var(--bg); }
.vote-option:hover { color: var(--text); }
.vote-option img { width: 32px; height: 32px; object-fit: contain; }
.vote-option span { overflow: hidden; font-size: 0.66rem; text-overflow: ellipsis; white-space: nowrap; }
#submit-vote { min-height: 42px; margin-top: 12px; font-size: 0.62rem; }

/* --------------------------------------------------------------------------
   Elimination + winner overlays
   -------------------------------------------------------------------------- */
.elim-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  background: rgba(8, 6, 4, 0.94);
  place-items: center;
  animation: overlay-in 240ms ease-out;
  transition: opacity 450ms;
}
.elim-overlay.leaving { opacity: 0; }
@keyframes overlay-in { from { opacity: 0; } }
.elim-card { display: grid; justify-items: center; gap: 10px; text-align: center; }
.elim-card img {
  width: clamp(90px, 16vh, 130px);
  filter: grayscale(1);
  animation: elim-avatar 700ms ease-out;
}
@keyframes elim-avatar {
  from { filter: grayscale(0); transform: scale(1.25); }
  to { filter: grayscale(1); transform: scale(1); }
}
.elim-name { font-size: 1rem; letter-spacing: 0.1em; text-transform: uppercase; }
.elim-stamp {
  padding: 2px 20px;
  border: 4px solid var(--red);
  color: var(--red);
  font-family: var(--display);
  font-size: clamp(2rem, 6vh, 3rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-7deg);
  animation: stamp-in 380ms cubic-bezier(0.2, 2.2, 0.4, 1) 240ms backwards;
}
@keyframes stamp-in {
  from { opacity: 0; transform: rotate(-7deg) scale(2.4); }
}
.elim-tally {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  max-width: min(440px, 80%);
  margin: 2px auto 0;
  color: var(--muted);
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
}
.elim-tally-item { padding: 2px 8px; border: 1px solid var(--line-soft); }
.elim-tally-item.out { border-color: var(--red); color: #ff8a70; }
.elim-role { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.elim-role b { font-weight: 800; }
.elim-role.is-llm b { color: var(--orange-bright); text-transform: none; }
.elim-role.is-human b { color: var(--gold); }

.winner {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 22;
  width: min(520px, 80%);
  padding: 30px;
  border: 1px solid var(--orange);
  background: var(--panel-strong);
  color: var(--orange-bright);
  font-family: var(--display);
  font-size: clamp(1.5rem, 4vh, 2.4rem);
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
  animation: overlay-in 300ms ease-out;
}

/* --------------------------------------------------------------------------
   Final result sequence
   -------------------------------------------------------------------------- */
.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  padding: clamp(16px, 4vw, 48px);
  overflow: auto;
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 130, 4, 0.2), transparent 44%),
    rgba(5, 4, 3, 0.9);
  backdrop-filter: blur(12px);
  place-items: center;
  animation: result-overlay-in 520ms ease-out both;
}
.result-overlay[data-outcome="win"] {
  --result-accent: var(--gold);
  --result-soft: rgba(255, 216, 0, 0.16);
}
.result-overlay[data-outcome="lose"] {
  --result-accent: #ff5229;
  --result-soft: rgba(225, 19, 0, 0.18);
}
.result-overlay[data-outcome="neutral"] {
  --result-accent: var(--orange);
  --result-soft: rgba(255, 130, 4, 0.16);
}
@keyframes result-overlay-in {
  from { opacity: 0; }
}
.result-pixels {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.result-pixels::before,
.result-pixels::after {
  position: absolute;
  width: 32px;
  height: 32px;
  background: var(--result-accent);
  box-shadow:
    32px 32px 0 var(--orange),
    64px 64px 0 var(--red),
    96px 32px 0 var(--gold);
  content: "";
  opacity: 0.58;
  animation: result-pixels-drift 7s steps(7, end) infinite;
}
.result-pixels::before { top: 8%; left: 3%; }
.result-pixels::after {
  right: 8%;
  bottom: 7%;
  transform: rotate(180deg);
  animation-direction: reverse;
}
@keyframes result-pixels-drift {
  50% { transform: translate3d(20px, -16px, 0); opacity: 0.3; }
}
.result-panel {
  position: relative;
  width: min(980px, 100%);
  padding: clamp(20px, 4vw, 42px);
  border: 2px solid var(--result-accent);
  background:
    linear-gradient(135deg, var(--result-soft), transparent 36%),
    rgba(10, 8, 5, 0.97);
  box-shadow:
    14px 14px 0 var(--result-soft),
    0 28px 80px rgba(0, 0, 0, 0.55);
  clip-path: polygon(
    14px 0, 100% 0, 100% calc(100% - 14px),
    calc(100% - 14px) 100%, 0 100%, 0 14px
  );
  animation: result-panel-in 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes result-panel-in {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
}
.result-header {
  display: grid;
  grid-template-columns: minmax(160px, 0.36fr) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 54px);
  align-items: center;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(244, 239, 230, 0.14);
}
.result-verdict { display: grid; gap: 9px; }
.result-signal {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
#result-outcome {
  color: var(--result-accent);
  font-family: var(--display);
  font-size: clamp(2.8rem, 7vw, 5.6rem);
  font-weight: 500;
  letter-spacing: 0.025em;
  line-height: 0.8;
  text-transform: uppercase;
  text-shadow: 7px 7px 0 var(--result-soft);
}
.result-copy h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  font-weight: 500;
  letter-spacing: 0.025em;
  line-height: 1;
  text-transform: uppercase;
}
#result-summary {
  margin: 0 0 7px;
  color: var(--text);
  font-size: clamp(0.76rem, 1.3vw, 0.94rem);
}
#result-reason {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
}
.result-your-role {
  display: inline-block;
  margin-top: 13px;
  padding: 4px 9px;
  border-left: 3px solid var(--result-accent);
  background: var(--result-soft);
  color: var(--text);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.result-roster-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 24px 0 12px;
}
.result-roster-head strong {
  color: var(--result-accent);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.result-roster-head span { color: var(--faint); font-size: 0.58rem; }
.result-roster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 9px;
}
.result-player {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
}
.result-player.is-winner {
  border-color: var(--result-accent);
  background: var(--result-soft);
}
.result-player.is-eliminated:not(.is-winner) { opacity: 0.56; }
.result-player.is-you::after {
  position: absolute;
  top: -1px;
  right: -1px;
  padding: 2px 5px;
  background: var(--result-accent);
  color: #120d05;
  content: var(--arena-you-label);
  font-size: 0.46rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.result-player img {
  width: 44px;
  height: 54px;
  object-fit: contain;
  image-rendering: pixelated;
}
.result-player-copy { min-width: 0; }
.result-player-name {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-player-role {
  display: block;
  margin-top: 2px;
  color: var(--orange-bright);
  font-size: 0.54rem;
  line-height: 1.35;
}
.result-player-role.is-human { color: var(--gold); }
.result-player-status {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.49rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.result-player.is-winner .result-player-status { color: var(--result-accent); }
.result-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.result-actions button {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--result-accent);
  background: transparent;
  color: var(--text);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.result-actions .result-replay {
  background: var(--result-accent);
  color: #160f05;
}
.result-actions button:hover { transform: translateY(-2px); }
.result-actions button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

@media (max-width: 680px) {
  .result-overlay { align-items: start; padding: 12px; }
  .result-panel { padding: 20px 16px; box-shadow: 7px 7px 0 var(--result-soft); }
  .result-header { grid-template-columns: 1fr; gap: 18px; }
  #result-outcome { font-size: clamp(3rem, 18vw, 4.8rem); }
  .result-roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-roster-head span { display: none; }
  .result-actions { display: grid; grid-template-columns: 1fr; }
  .result-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .result-overlay,
  .result-panel,
  .result-pixels::before,
  .result-pixels::after {
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
   Stats page
   -------------------------------------------------------------------------- */
.stats-main { display: block; overflow-y: auto; padding: 8px clamp(18px, 4vw, 60px) 40px; }
.stats-wrap { max-width: 900px; margin: 0 auto; }
.stats-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 6px 0 18px; }
.stats-head h1 { margin: 0; font-family: var(--display); font-size: 1.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
/* The stats-content design lives in web/stats.html (st-* classes). */

/* --------------------------------------------------------------------------
   Responsive: below 980px the page may scroll again (mobile/tablet).
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; }
  main { display: block; }
  .join-screen { display: block; min-height: calc(100vh - 70px); padding-bottom: 28px; overflow: visible; }
  .landing-grid { grid-template-columns: 1fr; gap: 46px; }
  .landing-copy { max-width: 720px; }
  .landing-copy h1 { font-size: clamp(4.2rem, 15vw, 7.6rem); }
  .suspect-board { width: 100%; }
  .landing-bottom { align-items: flex-start; flex-direction: column; margin-top: 44px; }
  .game-loop { width: 100%; }
  .hackathon-credit { text-align: left; }
  .game-screen { padding: 4px 12px 16px; }
  .game-layout, .game-screen.vote-open .game-layout { display: flex; flex-direction: column; height: auto; }
  .mission-panel { padding: 8px 14px; }
  .metric-row { padding: 7px 2px; }
  #transcript { max-height: 110px; }
  .arena-viz { min-height: 0; overflow: visible; }
  .arena-viz::before { display: none; }
  #seats { position: relative; inset: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 8px; }
  .seat { position: relative; top: auto !important; left: auto !important; width: 100%; transform: none; }
  .question-frame { position: relative; top: auto; left: auto; order: -1; width: 100%; margin-bottom: 16px; transform: none; }
  .vote-panel { min-height: 200px; }
  .vote-options { overflow: visible; }
  .elim-overlay { position: fixed; }
}
@media (max-width: 560px) {
  .hud-header { min-height: 56px; padding: 4px 16px 0; }
  .hud-nav a,
  .sound-toggle { padding: 6px 9px; font-size: 0.54rem; }
  .sound-toggle { min-width: 44px; min-height: 44px; justify-content: center; }
  #sound-toggle-label { display: none; }
  .voice-gate {
    top: 64px;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }
  .voice-gate button { min-height: 44px; }
  .join-screen { padding: 22px 16px 28px; }
  .landing-kicker { align-items: flex-start; flex-wrap: wrap; font-size: 0.54rem; }
  .landing-copy h1 { margin-bottom: 24px; font-size: clamp(3.4rem, 20vw, 5.2rem); }
  .landing-copy h1 span:nth-child(2),
  .landing-copy h1 strong { align-self: flex-start; margin-right: 0; }
  .landing-lede { font-size: 0.7rem; }
  .join-console { grid-template-columns: 1fr; }
  .play-btn { min-height: 60px !important; }
  .landing-proof { gap: 7px 12px; }
  .advanced-grid { grid-template-columns: 1fr; }
  .suspect-board { padding: 9px; box-shadow: 8px 8px 0 rgba(255, 130, 5, 0.08); }
  .question-signal { grid-template-columns: 1fr; gap: 7px; padding: 14px 2px; }
  .suspect-grid { gap: 4px; }
  .suspect-card figcaption { right: 4px; bottom: 4px; left: 4px; font-size: 0.42rem; }
  .suspect-id { top: 4px; left: 4px; font-size: 0.44rem; }
  .board-footer { gap: 7px; font-size: 0.43rem; }
  .game-loop { grid-template-columns: 1fr; gap: 10px; }
  .game-loop li { max-width: 220px; }
  .hackathon-credit { white-space: normal; line-height: 1.8; }
  #seats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #input-controls { flex-wrap: wrap; }
  #input-controls textarea { flex-basis: 100%; }
  #input-controls button { flex: 1; }
}
@media (max-width: 980px) {
  body[data-screen="join"] { overflow: auto; }
  body[data-screen="join"] .join-screen {
    display: block;
    padding-top: 44px;
    overflow: visible;
  }
  body[data-screen="join"] .landing-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  body[data-screen="join"] .landing-copy { max-width: 620px; }
  body[data-screen="join"] .character-stage {
    --orbit-radius: clamp(190px, 31vw, 280px);
    min-height: 500px;
  }
  body[data-screen="join"] .hackathon-credit { margin-top: 28px; }
}
@media (max-width: 560px) {
  body[data-screen="join"] .hud-header { padding: 7px 16px; }
  body[data-screen="join"] .hud-nav a,
  body[data-screen="join"] .sound-toggle { font-size: 0.6rem; }
  body[data-screen="join"] .sound-toggle { padding: 6px; }
  body[data-screen="join"] .join-screen { padding: 32px 16px 20px; }
  body[data-screen="join"] .landing-copy h1 {
    max-width: 360px;
    font-size: clamp(2.7rem, 14vw, 3.7rem);
  }
  body[data-screen="join"] .landing-lede { font-size: 0.92rem; }
  body[data-screen="join"] .landing-rule { margin-bottom: 24px; }
  body[data-screen="join"] .advanced-grid { grid-template-columns: 1fr; }
  body[data-screen="join"] .advanced-grid > * { grid-column: 1 / -1; }
  body[data-screen="join"] .character-stage {
    --orbit-radius: 150px;
    min-height: 390px;
    margin-top: 14px;
  }
  body[data-screen="join"] .character-carousel { width: 110px; height: 110px; }
  body[data-screen="join"] .carousel-floor { bottom: 6%; }
  body[data-screen="join"] .stage-caption { right: 0; bottom: 0; }
  body[data-screen="join"] .hackathon-credit {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   Game arena v2 — progressive 3D council chamber.
   The original DOM seats remain available as the WebGL fallback.
   ========================================================================== */
body[data-screen="game"] {
  overflow: hidden;
  background: #080706;
}
body[data-screen="game"] .hud-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  min-height: 66px;
  padding: 8px 20px 0;
  background: linear-gradient(180deg, rgba(8, 7, 6, 0.96), rgba(8, 7, 6, 0));
  pointer-events: none;
}
body[data-screen="game"] .hud-header .brand,
body[data-screen="game"] .hud-header .hud-nav { pointer-events: auto; }
body[data-screen="game"] main { min-height: 100dvh; }
body[data-screen="game"] .game-screen { padding: 0; }
body[data-screen="game"] .game-layout,
body[data-screen="game"] .game-screen.vote-open .game-layout {
  position: relative;
  display: block;
  height: 100dvh;
  min-height: 620px;
  overflow: hidden;
  background: #080706;
}
body[data-screen="game"] .arena-shell {
  position: absolute;
  inset: 0;
  display: block;
}
body[data-screen="game"] .arena-viz {
  position: absolute;
  inset: 0;
  isolation: isolate;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 54%, rgba(255, 130, 4, 0.1), transparent 36%),
    #080706;
}
#arena-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  outline: 0;
  transition: opacity 500ms ease;
}
.arena-viz.webgl-ready #arena-canvas { opacity: 1; }
.arena-viz.webgl-fallback #arena-canvas { display: none; }
.arena-viz.webgl-ready::before { display: none; }
.arena-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.52), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.46)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.68));
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}
.arena-viz.webgl-ready .arena-vignette { display: block; }
.arena-viz.webgl-ready #seats {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.arena-labels {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  overflow: hidden;
  pointer-events: none;
}
.arena-viz.webgl-ready .arena-labels { display: block; }
.arena-tag {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  width: clamp(132px, 13.5vw, 208px);
  padding: 7px 10px 8px;
  border: 1px solid rgba(255, 130, 4, 0.42);
  border-left: 3px solid var(--orange);
  background: rgba(8, 7, 6, 0.92);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.28);
  color: var(--text);
  opacity: 0.9;
  transition: border-color 180ms, opacity 180ms, filter 280ms;
  will-change: transform;
}
.arena-tag[hidden] { display: none; }
.arena-tag-head {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 7px;
}
.arena-tag-head strong {
  overflow: hidden;
  font-size: clamp(0.56rem, 0.72vw, 0.7rem);
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.arena-tag-role {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 0.43rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.arena-tag-answer {
  display: none;
  margin: 5px 0 0;
  color: #f4cda2;
  font-size: clamp(0.56rem, 0.74vw, 0.72rem);
  line-height: 1.36;
  overflow: hidden;
  overflow-wrap: anywhere;
  /* Idle seats keep a compact two-line trace; the speaker expands below. */
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.arena-tag.has-answer .arena-tag-answer { display: -webkit-box; }
.arena-tag-votes {
  display: none;
  margin-top: 5px;
  color: var(--orange-bright);
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.arena-tag.has-votes .arena-tag-votes { display: block; }
.arena-tag.is-you { border-color: rgba(255, 175, 1, 0.8); }
.arena-tag.is-you .arena-tag-head strong::after {
  margin-left: 5px;
  color: var(--yellow);
  content: var(--arena-you-label);
  font-size: 0.68em;
}
.arena-tag.is-answering {
  border-color: var(--yellow);
  border-left-color: var(--yellow);
  background: rgba(24, 18, 8, 0.92);
  box-shadow: 6px 6px 0 rgba(255, 175, 1, 0.12);
  opacity: 1;
}
.arena-tag.is-speaking {
  border-color: var(--yellow);
  border-left-color: var(--yellow);
  background: rgba(28, 20, 7, 0.96);
  box-shadow: 0 0 0 1px rgba(255, 175, 1, 0.4), 7px 7px 0 rgba(255, 175, 1, 0.2);
  opacity: 1;
}
/* The seat that is currently speaking or taking its turn wins the foreground:
   it rises above neighbouring tags and shows its full line as a speech bubble. */
.arena-tag.is-answering,
.arena-tag.is-speaking { z-index: 8; }
.arena-tag.is-answering .arena-tag-answer,
.arena-tag.is-speaking .arena-tag-answer {
  color: #fff4e2;
  font-size: clamp(0.64rem, 0.9vw, 0.82rem);
  -webkit-line-clamp: 5;
  line-clamp: 5;
}
.arena-tag.is-answering::after,
.arena-tag.is-speaking::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -8px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--yellow);
}
.arena-tag.is-selected {
  border-color: var(--red);
  border-left-color: var(--red);
  background: rgba(42, 5, 3, 0.94);
  opacity: 1;
}
.arena-tag.is-vote-target { opacity: 1; }
.arena-tag.is-dead {
  border-color: rgba(141, 135, 121, 0.3);
  border-left-color: var(--faint);
  filter: grayscale(1);
  opacity: 0.32;
}

body[data-screen="game"] .mission-panel {
  position: absolute;
  top: 82px;
  bottom: 18px;
  left: 18px;
  z-index: 12;
  width: 232px;
  padding: 14px;
  border-color: rgba(255, 130, 4, 0.28);
  background: rgba(8, 7, 6, 0.78);
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
}
body[data-screen="game"] .question-frame {
  top: 78px;
  left: 50%;
  z-index: 9;
  width: min(560px, calc(100% - 560px));
  min-height: 84px;
  padding: 14px 22px 16px;
  border-color: rgba(255, 130, 4, 0.5);
  background: rgba(8, 7, 6, 0.82);
  box-shadow: 8px 8px 0 rgba(255, 130, 4, 0.1);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
}
body[data-screen="game"] .question-frame::before,
body[data-screen="game"] .question-frame::after { width: 16px; height: 16px; }
body[data-screen="game"] .question-label { font-size: 0.52rem; }
body[data-screen="game"] .prompt {
  margin-top: 6px;
  font-size: clamp(0.82rem, 1.35vw, 1.08rem);
}
body[data-screen="game"] #input-panel {
  position: absolute;
  bottom: 18px;
  left: 50%;
  z-index: 16;
  width: min(680px, calc(100% - 560px));
  min-width: 360px;
  border-color: rgba(255, 130, 4, 0.45);
  background: rgba(8, 7, 6, 0.92);
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
}
body[data-screen="game"] .vote-panel {
  position: absolute;
  top: 82px;
  right: 18px;
  bottom: 18px;
  z-index: 16;
  width: 252px;
  min-height: 0;
  border-color: rgba(225, 19, 0, 0.48);
  background: rgba(8, 7, 6, 0.9);
  box-shadow: -10px 10px 0 rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
}
body[data-screen="game"] .vote-option {
  min-height: 48px;
  padding: 4px 6px;
  border: 1px solid transparent;
}
body[data-screen="game"] .vote-option:hover,
body[data-screen="game"] .vote-option[aria-checked="true"] {
  border-color: rgba(255, 130, 4, 0.42);
  background: rgba(255, 130, 4, 0.08);
}
body[data-screen="game"] .elim-overlay {
  z-index: 20;
  background: rgba(8, 6, 4, 0.82);
  backdrop-filter: blur(8px);
}
body[data-screen="game"] .winner {
  border: 2px solid var(--orange);
  box-shadow: 10px 10px 0 rgba(255, 130, 4, 0.16);
}
body[data-screen="game"] button:focus-visible,
body[data-screen="game"] textarea:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  body[data-screen="game"] { overflow: auto; }
  body[data-screen="game"] .app-shell { min-height: 100dvh; }
  body[data-screen="game"] .hud-header {
    position: relative;
    min-height: 60px;
    padding: 6px 12px;
    background: #080706;
  }
  body[data-screen="game"] main { min-height: 0; }
  body[data-screen="game"] .game-screen { padding: 0 0 18px; }
  body[data-screen="game"] .game-layout,
  body[data-screen="game"] .game-screen.vote-open .game-layout {
    display: grid;
    height: auto;
    min-height: 0;
    grid-template-areas:
      "arena"
      "mission"
      "vote";
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    overflow: visible;
  }
  body[data-screen="game"] .arena-shell {
    position: relative;
    inset: auto;
    grid-area: arena;
    height: auto;
    min-height: 0;
  }
  /* Mobile runs the optimized 2D arena: a natural-height, scrollable card grid
     rather than a letterboxed WebGL canvas. */
  body[data-screen="game"] .arena-viz {
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 14px 12px 16px;
    overflow: visible;
    background:
      radial-gradient(circle at 50% -8%, rgba(255, 130, 4, 0.1), transparent 58%),
      #080706;
  }
  body[data-screen="game"] .mission-panel {
    position: relative;
    inset: auto;
    grid-area: mission;
    width: auto;
    margin: 0 12px;
    padding: 12px 14px;
    backdrop-filter: none;
  }
  body[data-screen="game"] .mission-panel .metric-row {
    display: inline-flex;
    width: calc(25% - 4px);
    min-width: 120px;
    gap: 8px;
    justify-content: flex-start;
  }
  body[data-screen="game"] #transcript { max-height: 140px; }
  body[data-screen="game"] .question-frame {
    position: relative;
    top: auto;
    left: auto;
    order: -1;
    width: 100%;
    min-height: 0;
    margin: 0 0 14px;
    transform: none;
  }
  /* Sticky answer bar so the input stays reachable while scrolling the grid. */
  body[data-screen="game"] #input-panel {
    position: sticky;
    inset: auto;
    bottom: 8px;
    z-index: 30;
    width: 100%;
    min-width: 0;
    margin-top: 14px;
    transform: none;
  }
  /* --- Optimized 2D seat-card grid ------------------------------------- */
  body[data-screen="game"] #seats {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 42vw, 168px), 1fr));
    gap: 10px;
    align-content: start;
  }
  body[data-screen="game"] .seat {
    position: relative;
    top: auto !important;
    left: auto !important;
    width: 100%;
    padding: 13px 8px 12px;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-top: 2px solid rgba(255, 130, 5, 0.5);
    transform: none;
  }
  body[data-screen="game"] .seat-avatar-wrap { width: clamp(46px, 13.5vw, 66px); }
  body[data-screen="game"] .seat-index {
    width: 20px;
    height: 20px;
    bottom: -9px;
    font-size: 0.6rem;
  }
  body[data-screen="game"] .seat-meta { margin-top: 13px; }
  body[data-screen="game"] .seat-name { font-size: clamp(0.68rem, 3.2vw, 0.8rem); }
  body[data-screen="game"] .seat-answer {
    display: -webkit-box;
    margin: 9px 0 0;
    padding-top: 9px;
    border-top: 1px dashed rgba(255, 130, 5, 0.22);
    color: #f4cda2;
    font-size: clamp(0.6rem, 3vw, 0.68rem);
    line-height: 1.34;
    min-height: 0;
    overflow: hidden;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
  }
  body[data-screen="game"] .seat-answer:empty { display: none; }
  body[data-screen="game"] .vote-badge { top: -4px; right: -4px; }
  body[data-screen="game"] .seat.you { border-top-color: var(--orange-bright); }
  body[data-screen="game"] .seat.dead { opacity: 0.42; }
  /* The seat currently taking its turn or speaking leads the grid. */
  body[data-screen="game"] .seat.active-turn:not(.dead),
  body[data-screen="game"] .seat.speaking:not(.dead) {
    border-color: var(--yellow);
    border-top-color: var(--yellow);
    background: rgba(28, 20, 7, 0.9);
    box-shadow: 0 0 0 1px rgba(255, 175, 1, 0.28);
  }
  body[data-screen="game"] .seat.active-turn:not(.dead) .seat-answer,
  body[data-screen="game"] .seat.speaking:not(.dead) .seat-answer {
    color: #fff4e2;
    border-top-color: rgba(255, 175, 1, 0.45);
  }
  body[data-screen="game"] .vote-panel {
    position: relative;
    inset: auto;
    grid-area: vote;
    width: auto;
    min-height: 220px;
    margin: 0 12px;
    backdrop-filter: none;
  }
  body[data-screen="game"] .vote-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }
  body[data-screen="game"] .elim-overlay { position: fixed; }
}

@media (max-width: 560px) {
  body[data-screen="game"] .hud-nav a,
  body[data-screen="game"] .sound-toggle { padding: 6px 4px; }
  body[data-screen="game"] .arena-shell,
  body[data-screen="game"] .arena-viz {
    height: auto;
    min-height: 0;
  }
  body[data-screen="game"] .arena-viz { padding: 12px 10px 14px; }
  body[data-screen="game"] #seats {
    grid-template-columns: repeat(auto-fill, minmax(clamp(132px, 44vw, 160px), 1fr));
    gap: 8px;
  }
  body[data-screen="game"] .question-frame {
    padding: 11px 13px 12px;
    box-shadow: 5px 5px 0 rgba(255, 130, 4, 0.1);
  }
  body[data-screen="game"] .arena-tag {
    width: clamp(96px, 29vw, 126px);
    padding: 5px 6px 6px;
  }
  body[data-screen="game"] .arena-tag-role { display: none; }
  body[data-screen="game"] .arena-tag-answer { font-size: 0.5rem; }
  body[data-screen="game"] .mission-panel .metric-row {
    width: calc(50% - 4px);
    min-width: 0;
  }
  body[data-screen="game"] #input-controls { padding: 8px; }
  body[data-screen="game"] #input-controls button { min-height: 42px; }
  body[data-screen="game"] .vote-options { grid-template-columns: 1fr; }
}
