/* ==========================================================================
   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 {
  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;
}
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 { display: block; width: clamp(190px, 20vw, 260px); height: 62px; }
.brand img { width: 100%; height: 100%; object-fit: contain; object-position: left center; transform: scale(1.6); transform-origin: left center; filter: drop-shadow(0 0 14px rgba(255, 130, 5, 0.15)); }
.hud-nav { display: flex; align-items: center; gap: 10px; }
.hud-nav a {
  padding: 7px 14px;
  border: 1px solid var(--line);
  color: var(--orange);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-transform: uppercase;
}
.hud-nav a:hover { background: var(--orange); color: #180900; }

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;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(420px, 600px) minmax(190px, 1fr);
  grid-template-rows: auto auto auto auto;
  align-content: center;
  justify-items: center;
  gap: clamp(8px, 2vh, 22px) clamp(16px, 3vw, 48px);
  padding: 8px clamp(18px, 4vw, 60px) 10px;
  overflow: hidden;
}

.hero-radar {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: min(640px, 58vmin);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 130, 5, 0.25);
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 62px, rgba(255, 130, 5, 0.07) 62px 63px),
    radial-gradient(circle, rgba(255, 130, 5, 0.07), transparent 60%);
  opacity: 0.8;
  transform: translate(-50%, -50%);
}
.radar-sweep {
  position: absolute;
  inset: 6%;
  display: block;
  border-right: 1px solid rgba(255, 130, 5, 0.4);
  border-radius: 50%;
  animation: radar-spin 14s linear infinite;
}
.radar-mascot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54%;
  opacity: 0.06;
  transform: translate(-50%, -50%);
}
@keyframes radar-spin { to { transform: rotate(360deg); } }

.hero-copy { grid-column: 1 / -1; text-align: center; }
.hero-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 7vh, 5rem);
  line-height: 0.95;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  text-shadow: 0 0 26px rgba(255, 130, 5, 0.25);
}
.hero-copy p {
  margin: 10px 0 0;
  color: var(--orange-bright);
  font-size: clamp(0.8rem, 1.8vh, 1.05rem);
  letter-spacing: 0.08em;
}

.join-console {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(560px, 100%);
  padding: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(255, 130, 5, 0.06), transparent 14%, transparent 86%, rgba(255, 130, 5, 0.06)), var(--panel-strong);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}
.codename-field, .play-btn, .advanced-options { grid-column: 1 / -1; }
.play-btn { background: var(--orange) !important; color: #180900 !important; font-size: 0.92rem; }
.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: 42px; 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; }

.join-console > button { grid-column: 1 / -1; }
.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 { 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; }

.role-card {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 16px;
  min-height: 96px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}
.role-card--human { grid-area: 2 / 1; }
.role-card--ai { grid-area: 2 / 3; justify-content: flex-end; text-align: right; }
.role-card span { display: block; color: var(--muted); font-size: 0.64rem; letter-spacing: 0.13em; text-transform: uppercase; }
.role-card strong { display: block; margin-top: 4px; color: var(--orange); font-size: 0.82rem; font-weight: 700; }
.role-card img { width: 58px; height: 58px; object-fit: contain; }
.role-icon { flex: 0 0 auto; color: var(--orange) !important; font-size: 2.6rem !important; line-height: 1; text-shadow: 0 0 12px rgba(255, 130, 5, 0.35); }
.join-console { grid-area: 2 / 2; }

.game-loop {
  grid-column: 1 / -1;
  display: flex;
  width: min(620px, 78vw);
  justify-content: space-between;
  margin: 0;
  padding: 0;
  list-style: none;
}
.game-loop li {
  position: relative;
  display: flex;
  min-width: 96px;
  align-items: center;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.game-loop li:not(:last-child)::after {
  position: absolute;
  top: 15px;
  left: calc(50% + 30px);
  width: calc(100% - 6px);
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--orange-dim) 0 5px, transparent 5px 10px);
  content: "";
}
.game-loop b {
  display: grid;
  width: 31px;
  height: 31px;
  border: 1px solid var(--orange);
  color: var(--orange);
  font-size: 0.88rem;
  place-items: center;
}

.character-lineup {
  grid-column: 1 / -1;
  width: min(680px, 72vw);
  max-height: clamp(70px, 13vh, 120px);
  object-fit: cover;
  object-position: center 38%;
  opacity: 0.22;
  mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent);
}

.hackathon-credit {
  grid-column: 1 / -1;
  color: var(--faint);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-align: center;
}
.hackathon-credit span { margin: 0 0.45em; }
.hackathon-credit a { color: var(--muted); text-underline-offset: 3px; }
.hackathon-credit a:hover { color: var(--orange); }

/* --------------------------------------------------------------------------
   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: " // you"; font-size: 0.55em; text-transform: uppercase; }
.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;
}

/* --------------------------------------------------------------------------
   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; }
.card {
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}
.card h2 { margin: 0 0 14px; color: var(--orange); font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; color: var(--muted); font-size: 0.72rem; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { display: inline-block; width: 11px; height: 11px; }
.chart .model-group { margin-bottom: 16px; }
.chart .model-name { margin-bottom: 6px; font-size: 0.78rem; font-weight: 700; word-break: break-word; }
.chart .model-name small { color: var(--faint); font-weight: 400; }
.stats-unavailable { margin: 5px 0 0; color: var(--faint); font-size: 0.68rem; }
.bar-row { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 10px; margin: 4px 0; }
.bar-label { color: var(--muted); font-size: 0.64rem; text-align: right; }
.bar-track { position: relative; height: 17px; overflow: hidden; background: rgba(244, 239, 230, 0.07); }
.bar-fill { display: flex; height: 100%; min-width: 2px; align-items: center; justify-content: flex-end; transition: width 400ms ease; }
.bar-value { padding: 0 6px; color: #14100a; font-size: 0.62rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-value.outside { color: var(--muted); }
.stats-wrap table { width: 100%; border-collapse: collapse; font-size: 0.74rem; }
.stats-wrap th, .stats-wrap td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); text-align: right; }
.stats-wrap th:first-child, .stats-wrap td:first-child { text-align: left; }
.stats-wrap thead th { color: var(--muted); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.stats-wrap tbody td { font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.empty { padding: 36px 0; color: var(--muted); text-align: center; }
.meta { margin: 10px 0 0; color: var(--faint); font-size: 0.66rem; }

/* --------------------------------------------------------------------------
   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: flex; flex-direction: column; align-items: center; min-height: calc(100vh - 70px); justify-content: center; }
  .role-card { width: min(420px, 100%); min-height: 72px; }
  .character-lineup { width: min(560px, 90vw); }
  .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) {
  .brand { height: 42px; }
  .join-console { grid-template-columns: 1fr; }
  .advanced-grid { grid-template-columns: 1fr; }
  .join-meta { flex-wrap: wrap; justify-content: center; }
  #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 (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
