/* styles.css — Milestone 1: minimal clean styling.
   The full Avalon theme will come back when we port the game UI. */

:root {
  --bg: #0a0e1a;
  --bg-2: #0d1220;
  --panel: #141a2a;
  --panel-2: #1a2136;
  --border: rgba(201, 168, 76, 0.18);
  --border-2: rgba(201, 168, 76, 0.35);
  --text: #f5e6c8;
  --muted: #8a94a8;
  --gold: #c9a84c;
  --gold-bright: #e8c866;
  --gold-dim: #8a7530;
  --good: #5aa8ff;
  --bad: #ff5c5c;
  --good-bg: rgba(90, 168, 255, 0.12);
  --bad-bg: rgba(255, 92, 92, 0.12);
  --font-display: 'Cinzel', Georgia, serif;
  --font-body: 'Crimson Text', Georgia, serif;
  --font-ui: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* When the in-game layout is active, collapse the outer app chrome
   so the game fills the viewport. */
body.in-game #app { max-width: none; padding: 0; min-height: 100dvh; }
body.in-game > #app > header,
body.in-game > #app > footer { display: none; }
body.in-game #app > main,
body.in-game #app > main > #screen { flex: 1; min-height: 100dvh; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
}

body {
  background:
    radial-gradient(ellipse at top, rgba(201, 168, 76, 0.08), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(90, 50, 20, 0.10), transparent 70%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.78  0 0 0 0 0.66  0 0 0 0 0.30  0 0 0 0.035 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    var(--bg);
  background-attachment: fixed;
}

::selection { background: rgba(201, 168, 76, 0.35); color: var(--text); }

#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

h1 {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: 0 0 18px rgba(201, 168, 76, 0.25);
}

.subtitle {
  color: var(--muted);
  font-size: 0.6em;
  font-weight: 400;
  margin-left: 0.5em;
}

.status {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 3px;
  border: 1px solid currentColor;
}

.status.connected { color: var(--good); background: var(--good-bg); }
.status.disconnected { color: var(--bad); background: var(--bad-bg); }
.status.connecting { color: var(--gold); background: rgba(201, 168, 76, 0.1); }

main { flex: 1; }

.panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 40%),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  box-shadow:
    inset 0 1px 0 rgba(201, 168, 76, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.35);
}

h2 {
  margin: 0 0 0.5rem;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

h3 {
  margin: 1.5rem 0 0.5rem;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.description {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.form-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

label {
  font-size: 0.9rem;
  color: var(--muted);
  min-width: 5.5rem;
  flex-shrink: 0;
}

input[type="text"] {
  flex: 1;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.18);
}

button {
  padding: 0.55rem 1.1rem;
  background: rgba(201, 168, 76, 0.15);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.05s ease, color 0.18s ease;
}

button:hover:not(:disabled) {
  background: rgba(201, 168, 76, 0.28);
  color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(201, 168, 76, 0.35), inset 0 0 8px rgba(201, 168, 76, 0.15);
}

button:active:not(:disabled) { transform: translateY(1px); }

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.messages {
  max-height: 400px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column-reverse;  /* newest at top */
  gap: 0.5rem;
}

.empty-state {
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

.message {
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--gold);
  border-radius: 0 2px 2px 0;
  font-size: 0.95rem;
}

.message-from {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.85rem;
}

.message-text { color: var(--text); }

.message-time {
  color: var(--muted);
  font-size: 0.75rem;
  margin-left: 0.5rem;
  opacity: 0.7;
}

footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

/* ---------- Milestone 2: lobby ---------- */

.muted { color: var(--muted); font-size: 0.9rem; }

button.primary {
  background: rgba(201, 168, 76, 0.35);
  font-weight: 600;
}

button.secondary {
  background: transparent;
  border-color: var(--muted);
  color: var(--muted);
}

button.mini {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.landing-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.landing-col h3 { margin-top: 0; }

.error-banner {
  margin-top: 1rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--bad);
  background: var(--bad-bg);
  color: var(--bad);
  border-radius: 3px;
  font-size: 0.9rem;
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.lobby-header h2 { margin-bottom: 0.25rem; }

.code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0.15em;
  color: var(--text);
  background: rgba(201, 168, 76, 0.12);
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
}

.lobby-count {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
}

.count-buttons { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.count-btn {
  min-width: 2.25rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
}

.count-btn.active {
  background: var(--gold);
  color: var(--bg);
}

.player-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--border);
  border-radius: 0 2px 2px 0;
  font-size: 0.95rem;
}

.player-row.empty-seat { opacity: 0.5; font-style: italic; border-left-color: transparent; }

.player-name { color: var(--text); }
.player-tags { display: flex; align-items: center; gap: 0.35rem; }

.tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 2px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}

.tag.host     { color: var(--gold); }
.tag.ready    { color: var(--good); }
.tag.not-ready { color: var(--bad); }
.tag.ai       { color: var(--muted); }

.host-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

@media (max-width: 520px) {
  .landing-actions { grid-template-columns: 1fr; }
  .lobby-header { flex-direction: column; gap: 0.5rem; }
}

/* ---------- Milestone 4: game view ---------- */

/* Role reveal — dramatic banner (per ui_prototype/role-reveal-proto.html) */
.role-modal-overlay {
  display: flex; justify-content: center; align-items: flex-start;
  padding: 2rem 1rem;
}
.reveal-modal {
  width: 100%; max-width: 540px;
  background: var(--bg, #0a0e1a);
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
}
.reveal-banner {
  padding: 1.6rem 1.4rem 1.4rem;
  text-align: center;
  border-bottom: 1px solid rgba(201,168,76,0.18);
  background: radial-gradient(ellipse at top, rgba(201,168,76,0.18), transparent 70%);
  position: relative;
}
.reveal-modal.evil .reveal-banner { background: radial-gradient(ellipse at top, rgba(255,92,92,0.22), transparent 70%); }
.reveal-modal.good .reveal-banner { background: radial-gradient(ellipse at top, rgba(90,168,255,0.22), transparent 70%); }
.reveal-banner::before, .reveal-banner::after {
  content: ''; position: absolute; top: 1rem; height: 1px; width: 22%;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.35), transparent);
}
.reveal-banner::before { left: 6%; }
.reveal-banner::after  { right: 6%; }
.reveal-eyebrow {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.66rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: #c9a84c; opacity: 0.85;
  margin-bottom: 1rem;
}
.big-portrait {
  width: 200px; height: 200px; margin: 0 auto 1rem;
  border-radius: 6px;
  background: #0a0e1a center / cover no-repeat;
  border: 1px solid rgba(201,168,76,0.35);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.6) inset, 0 8px 30px rgba(0,0,0,0.6), 0 0 50px rgba(232,200,102,0.18);
}
.reveal-modal.evil .big-portrait {
  border-color: rgba(255,92,92,0.6);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.6) inset, 0 8px 30px rgba(0,0,0,0.6), 0 0 50px rgba(255,92,92,0.28);
}
.reveal-modal.good .big-portrait {
  border-color: rgba(90,168,255,0.6);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.6) inset, 0 8px 30px rgba(0,0,0,0.6), 0 0 50px rgba(90,168,255,0.28);
}
.big-name {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.7rem; letter-spacing: 0.18em;
  text-transform: uppercase; font-weight: 700;
  color: var(--text, #f5e6c8);
}
.reveal-modal.evil .big-name { color: #ffd7d7; }
.reveal-modal.good .big-name { color: #d8eaff; }
.team-pip {
  display: inline-block; margin-top: 0.55rem;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.68rem; letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.22rem 0.7rem; border-radius: 3px; border: 1px solid;
}
.reveal-modal.good .team-pip { color: #9ac7ff; border-color: rgba(90,168,255,0.5); background: rgba(90,168,255,0.12); }
.reveal-modal.evil .team-pip { color: #ff9090; border-color: rgba(255,92,92,0.5); background: rgba(255,92,92,0.12); }
.big-tagline {
  font-size: 0.92rem; color: var(--muted, #8a8570);
  margin: 0.7rem auto 0; max-width: 32ch; letter-spacing: 0.02em;
}
.reveal-body {
  padding: 1.2rem 1.4rem 1.3rem;
  display: flex; flex-direction: column; gap: 1.1rem;
}
.role-flavor {
  color: var(--text, #f5e6c8);
  font-size: 0.96rem; line-height: 1.55;
}
.role-flavor em {
  color: #e8c866; font-style: normal; font-weight: 600; letter-spacing: 0.02em;
}
.know-block { display: flex; flex-direction: column; gap: 0.7rem; }
.know-heading {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.7rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: #c9a84c; opacity: 0.85;
  padding-bottom: 0.4rem; border-bottom: 1px solid rgba(201,168,76,0.18);
  display: flex; align-items: center; gap: 0.5rem;
}
.know-heading::before { content: '⚜'; color: #e8c866; opacity: 0.7; }
.know-line { display: flex; flex-direction: column; gap: 0.45rem; }
.know-label { color: var(--muted, #8a8570); font-size: 0.88rem; }
.know-players { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.know-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.8rem 0.35rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(201,168,76,0.35);
  background: rgba(255,255,255,0.02);
}
.know-chip .av {
  width: 28px; height: 28px; border-radius: 50%;
  background: #0a0e1a center / cover no-repeat;
  border: 1px solid rgba(201,168,76,0.35);
  flex-shrink: 0;
}
.know-chip .nm {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.88rem; letter-spacing: 0.04em;
  color: var(--text, #f5e6c8);
}
.know-chip.evil { border-color: rgba(255,92,92,0.5); background: rgba(255,92,92,0.08); }
.know-chip.evil .av { border-color: rgba(255,92,92,0.5); }
.know-chip.ambiguous { border-color: rgba(201,168,76,0.55); background: rgba(201,168,76,0.08); }
.know-chip.ambiguous .av { border-color: rgba(201,168,76,0.5); }
.know-empty {
  color: var(--muted, #8a8570);
  font-size: 0.92rem; line-height: 1.55;
  padding: 0.85rem 0.95rem;
  border: 1px dashed rgba(201,168,76,0.18);
  border-radius: 5px;
  background: rgba(255,255,255,0.015);
}
.know-empty strong {
  color: var(--text, #f5e6c8);
  font-family: 'Cinzel', Georgia, serif;
  letter-spacing: 0.05em;
}
.ack-row {
  display: flex; justify-content: flex-end;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(201,168,76,0.18);
}
.ack-btn {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.78rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: #0a0e1a;
  background: linear-gradient(180deg, #e8c866, #c9a84c);
  border: 1px solid #c9a84c;
  padding: 0.6rem 1.5rem; border-radius: 4px; cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 0 18px rgba(232,200,102,0.18);
}
.ack-btn:hover { filter: brightness(1.06); }

/* Landing page — gender toggle */
.gender-row { align-items: center; }
.gender-toggle { display: inline-flex; gap: 0.4rem; }
.gender-btn {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: #c9a84c;
  background: transparent;
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 4px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}
.gender-btn:hover { background: rgba(201,168,76,0.08); border-color: #c9a84c; }
.gender-btn.active {
  background: rgba(201,168,76,0.18);
  border-color: #c9a84c;
  color: #e8c866;
}

/* Legacy M4 game styles — superseded by the M8 two-column layout below.
   (Most classes here are no longer emitted by game.js.) */

/* ---------- Milestone 8+: two-column game layout ---------- */

.game-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-template-rows: auto 1fr;
  gap: 0;
  height: 100dvh;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  overflow: hidden;
}

/* ── Header (spans both columns) ───────────────────────── */
.game-layout .game-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1.4rem;
  background: linear-gradient(180deg, rgba(201,168,76,0.06) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.header-brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-bright);
  font-size: 1.15rem;
  letter-spacing: 0.25em;
  text-shadow: 0 0 20px rgba(201, 168, 76, 0.4);
}
.hdiv { width: 1px; height: 22px; background: var(--border); }
.phase-dot {
  width: 9px; height: 9px; border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
  animation: phasePulse 2s ease-in-out infinite;
}
@keyframes phasePulse {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.35); }
}
.phase-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  font-weight: 600;
}
.phase-leader { color: var(--muted); font-size: 0.9rem; }
.phase-leader strong { color: var(--gold); font-family: var(--font-display); font-weight: 600; }
.header-spacer { flex: 1; }
.status-pill {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(90, 168, 255, 0.08);
  border: 1px solid rgba(90, 168, 255, 0.25);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--good);
  font-family: var(--font-ui);
}
.status-pill .status-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--good);
  box-shadow: 0 0 6px var(--good);
}
.header-actions { display: flex; gap: 0.4rem; margin-left: 0.25rem; }
.game-layout button.ghost {
  padding: 0.4rem 0.9rem;
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}
.game-layout button.ghost:hover {
  background: rgba(201, 168, 76, 0.08);
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Players panel (left) ───────────────────────────── */
.players-panel {
  background: rgba(10, 14, 26, 0.7);
  border-right: 1px solid var(--border);
  padding: 0.4rem 0.85rem 1rem 1rem;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.45rem;
}
.panel-label {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  padding: 0 0.15rem 0.45rem;
  font-weight: 600;
  opacity: 0.75;
}
.selection-hint {
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 3px;
  padding: 0.5rem 0.7rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
  text-align: center;
  margin-bottom: 0.3rem;
}
.players-panel.assassin-mode .selection-hint,
.selection-hint.ended-evil {
  background: rgba(255, 92, 92, 0.1);
  border-color: rgba(255, 92, 92, 0.3);
  color: var(--bad);
}

.player-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(201, 168, 76, 0.1);
  border-radius: 4px;
  transition: all 0.18s;
  position: relative;
}
.player-card.leader {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
  box-shadow: 0 0 0 1px rgba(201, 168, 76, 0.15), inset 0 0 30px rgba(201, 168, 76, 0.04);
}
.player-card.on-mission {
  border-color: rgba(90, 168, 255, 0.5);
  background: rgba(90, 168, 255, 0.06);
}
.player-card.is-me {
  border-left: 3px solid var(--gold);
  padding-left: calc(0.85rem - 2px);
}
.player-card.disconnected { opacity: 0.5; }
.player-card.selectable {
  cursor: pointer;
  border-color: rgba(201, 168, 76, 0.2);
}
.player-card.selectable:hover {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.05);
  transform: translateX(2px);
}
.players-panel.assassin-mode .player-card.selectable:hover {
  border-color: var(--bad);
  background: rgba(255, 92, 92, 0.06);
}
.player-card.selected {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.12);
  box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(201, 168, 76, 0.3);
  animation: breathe-gold 2.4s ease-in-out infinite;
}
.player-card.selected .sel-mark { display: flex; }
.players-panel.assassin-mode .player-card.selected {
  border-color: var(--bad);
  background: rgba(255, 92, 92, 0.12);
  box-shadow: 0 0 0 1px var(--bad), 0 0 16px rgba(255, 92, 92, 0.3);
  animation: heartbeat-red 1.0s ease-in-out infinite;
}
@keyframes breathe-gold {
  0%, 100% { box-shadow: 0 0 0 1px rgba(201, 168, 76, 0.55), 0 0 0 rgba(232, 200, 102, 0); border-color: rgba(201, 168, 76, 0.6); }
  50%      { box-shadow: 0 0 0 1px var(--gold-bright), 0 0 18px rgba(232, 200, 102, 0.45); border-color: var(--gold-bright); }
}
@keyframes heartbeat-red {
  0%, 60%, 100% { box-shadow: 0 0 0 1px rgba(255, 92, 92, 0.55); border-color: rgba(255, 92, 92, 0.65); }
  15%           { box-shadow: 0 0 0 1px #ff8585, 0 0 22px rgba(255, 92, 92, 0.65); border-color: #ff8585; }
  35%           { box-shadow: 0 0 0 1px #ff8585, 0 0 16px rgba(255, 92, 92, 0.5);  border-color: #ff8585; }
}

.player-avatar {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--panel-2) 0%, var(--panel) 100%);
  border: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gold);
  position: relative;
}
.player-card.leader .player-avatar {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: var(--bg);
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(201, 168, 76, 0.45);
}
.sel-mark {
  display: none;
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px;
  background: var(--gold);
  color: var(--bg);
  border-radius: 50%;
  align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
}
.players-panel.assassin-mode .sel-mark { background: var(--bad); color: #fff; }

.player-info { flex: 1; min-width: 0; }
.player-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-you { color: var(--gold); font-size: 0.72rem; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; }
.player-status-text {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.1rem 0 0.25rem;
  line-height: 1.2;
}
.player-badges { display: flex; flex-wrap: wrap; gap: 0.25rem; }

/* Inline AI tag, sits next to the player name */
.name-tag {
  display: inline-block;
  margin-left: 0.35rem;
  font-family: var(--font-display);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  border: 1px solid rgba(160,200,255,0.4);
  color: #a0c8ff;
  background: rgba(90,168,255,0.08);
  vertical-align: 0.12em;
  font-weight: 600;
}

.badge {
  display: inline-flex; align-items: center; gap: 0.2rem;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  font-weight: 600;
}
.badge-leader       { color: var(--gold); background: rgba(201,168,76,0.1); }
.badge-ai           { color: #7ecfff;     background: rgba(100,200,255,0.1); }
.badge-good         { color: var(--good); background: var(--good-bg); }
.badge-evil         { color: var(--bad);  background: var(--bad-bg); }
.badge-on-mission   { color: var(--good); background: var(--good-bg); }
.badge-disconnected { color: var(--bad);  background: var(--bad-bg); }
.badge-role-good    { color: #cfe4ff; border-color: rgba(90,168,255,0.55); background: rgba(90,168,255,0.15); }
.badge-role-evil    { color: #ffcaca; border-color: rgba(255,92,92,0.55); background: rgba(255,92,92,0.15); }
.badge-role-killed  { color: #fff;    border-color: rgba(255,92,92,0.7);  background: rgba(255,92,92,0.3); }

/* End-game role reveal — applied to .player-card when phase === 'ended' */
.player-card.revealed-good {
  border-color: rgba(90,168,255,0.35);
  background: linear-gradient(90deg, rgba(90,168,255,0.08), rgba(90,168,255,0.01));
}
.player-card.revealed-evil {
  border-color: rgba(255,92,92,0.35);
  background: linear-gradient(90deg, rgba(255,92,92,0.08), rgba(255,92,92,0.01));
}
.player-card.revealed-killed { filter: grayscale(0.3); opacity: 0.85; }
.player-card.revealed-killed .player-avatar { position: relative; }
.player-card.revealed-killed .player-avatar::after {
  content: '🗡';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: var(--bad);
  text-shadow: 0 0 6px rgba(255,92,92,0.6);
  background: rgba(10,14,26,0.55); border-radius: 50%;
  pointer-events: none;
}

/* ── Main column (right) ────────────────────────────── */
.main-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Mission track — cog frame + shield glyph (proto Variant C) */
.mission-track-wrap {
  padding: 0.35rem 2rem 0.85rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: radial-gradient(ellipse at center top, rgba(201,168,76,0.05) 0%, transparent 60%);
}
.mission-track {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1.4rem;
  position: relative;
}
.mission-pip {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  position: relative; z-index: 1;
  color: var(--muted);
}
.mission-pip.success { color: var(--good); }
.mission-pip.fail    { color: var(--bad); }
.mission-pip.active  { color: var(--gold); }

/* The pip-circle is the layered wrapper (was the disc itself) */
.mission-pip .pip-circle {
  position: relative;
  width: 78px; height: 78px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  transition: transform 0.2s;
}

/* Cog frame: stepped outer rings via box-shadows */
.mission-pip .pip-circle .frame {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid currentColor;
  box-shadow:
    0 0 0 1px var(--bg-2),
    0 0 0 2px rgba(201,168,76,0.25),
    0 0 0 6px var(--bg-2),
    0 0 0 7px rgba(201,168,76,0.2);
  transition: box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.mission-pip.success .pip-circle .frame {
  background: radial-gradient(circle, rgba(90,168,255,0.20), rgba(90,168,255,0.02));
  box-shadow:
    0 0 0 1px var(--bg-2),
    0 0 0 2px rgba(90,168,255,0.5),
    0 0 0 6px var(--bg-2),
    0 0 0 7px rgba(90,168,255,0.4),
    0 0 18px rgba(90,168,255,0.3);
}
.mission-pip.fail .pip-circle .frame {
  background: radial-gradient(circle, rgba(255,92,92,0.20), rgba(255,92,92,0.02));
  box-shadow:
    0 0 0 1px var(--bg-2),
    0 0 0 2px rgba(255,92,92,0.5),
    0 0 0 6px var(--bg-2),
    0 0 0 7px rgba(255,92,92,0.4),
    0 0 18px rgba(255,92,92,0.3);
  animation: missionShudder 4s ease-in-out infinite;
}
.mission-pip.active .pip-circle .frame {
  background: radial-gradient(circle, rgba(201,168,76,0.18), rgba(0,0,0,0.4));
  box-shadow:
    0 0 0 1px var(--bg-2),
    0 0 0 2px rgba(201,168,76,0.6),
    0 0 0 6px var(--bg-2),
    0 0 0 7px rgba(201,168,76,0.45),
    0 0 22px rgba(232,200,102,0.35);
}

/* Active aura — slow spinning conic gradient */
.mission-pip .pip-circle .aura {
  position: absolute; inset: -6px; z-index: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--gold-bright), transparent 45%, var(--gold-bright) 100%);
  filter: blur(3px);
  opacity: 0.55;
  animation: missionSpin 5s linear infinite;
  pointer-events: none;
}
@keyframes missionSpin { to { transform: rotate(360deg); } }

/* Success: outer halo pulse */
.mission-pip .pip-circle .pulse {
  position: absolute; inset: -4px; z-index: 0;
  border-radius: 50%;
  border: 2px solid var(--good);
  opacity: 0;
  animation: missionPulseOut 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes missionPulseOut {
  0%   { transform: scale(0.92); opacity: 0.7; }
  70%  { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}

/* Fail vibration on the frame */
@keyframes missionShudder {
  0%, 90%, 100% { transform: translate(0,0) rotate(0); }
  91% { transform: translate(-1px, 0) rotate(-0.6deg); }
  93% { transform: translate(1px, 0) rotate(0.6deg); }
  95% { transform: translate(-1px, 0) rotate(-0.4deg); }
  97% { transform: translate(1px, 1px) rotate(0.3deg); }
  99% { transform: translate(0, 0) rotate(0); }
}

/* Shield glyph */
.mission-pip .pip-circle .glyph-wrap {
  position: relative; z-index: 2;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
}
.mission-pip .pip-circle .glyph-wrap svg { width: 100%; height: 100%; overflow: visible; }
.mission-pip .pip-circle .glyph-wrap svg path,
.mission-pip .pip-circle .glyph-wrap svg line,
.mission-pip .pip-circle .glyph-wrap svg circle {
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.mission-pip .pip-circle .glyph-wrap svg .fill { fill: currentColor; stroke: none; opacity: 0.18; }

/* Number readout for active / upcoming */
.mission-pip .pip-circle .num-wrap {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; line-height: 1;
  font-family: var(--font-display);
}
.mission-pip .pip-circle .num-wrap .n  { font-size: 1.55rem; font-weight: 700; color: var(--gold-bright); }
.mission-pip .pip-circle .num-wrap .sz { font-size: 0.62rem; letter-spacing: 0.05em; color: var(--gold); margin-top: 0.18rem; font-weight: 600; }
.mission-pip:not(.active):not(.success):not(.fail) .pip-circle .num-wrap .n,
.mission-pip:not(.active):not(.success):not(.fail) .pip-circle .num-wrap .sz {
  color: var(--muted);
}
.mission-pip.active .pip-circle .num-wrap .n {
  animation: missionLift 2.6s ease-in-out infinite;
}
@keyframes missionLift {
  0%, 100% { text-shadow: 0 0 8px rgba(232,200,102,0.0); }
  50%      { text-shadow: 0 0 14px rgba(232,200,102,0.7), 0 0 4px rgba(232,200,102,0.4); }
}

/* Tag below the pip */
.mission-pip .pip-tag {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.65;
}
.mission-pip.success .pip-tag { color: var(--good); opacity: 0.85; }
.mission-pip.fail    .pip-tag { color: var(--bad); opacity: 0.85; }
.mission-pip.active  .pip-tag { color: var(--gold-bright); opacity: 1; }

/* One-shot resolution animation — fired the moment a mission settles.
   The .resolving-success / .resolving-fail classes are added in JS for ~1.3s
   when renderMissionTrack sees a newly-resolved mission. */
.mission-pip.resolving-success .pip-circle .frame { animation: missionBloomGood 0.9s ease-out 1; }
.mission-pip.resolving-fail    .pip-circle .frame { animation: missionBloomBad 0.9s ease-out 1, missionShudder 4s ease-in-out 0.9s infinite; }

@keyframes missionBloomGood {
  0%   { transform: scale(0.85); box-shadow: 0 0 0 1px var(--bg-2), 0 0 0 2px rgba(90,168,255,0), 0 0 0 6px var(--bg-2), 0 0 0 7px rgba(90,168,255,0), 0 0 0 rgba(90,168,255,0); }
  50%  { transform: scale(1.08); box-shadow: 0 0 0 1px var(--bg-2), 0 0 0 2px rgba(90,168,255,0.8), 0 0 0 6px var(--bg-2), 0 0 0 7px rgba(90,168,255,0.6), 0 0 40px rgba(90,168,255,0.7); }
  100% { transform: scale(1);    box-shadow: 0 0 0 1px var(--bg-2), 0 0 0 2px rgba(90,168,255,0.5), 0 0 0 6px var(--bg-2), 0 0 0 7px rgba(90,168,255,0.4), 0 0 18px rgba(90,168,255,0.3); }
}
@keyframes missionBloomBad {
  0%   { transform: scale(0.85); box-shadow: 0 0 0 1px var(--bg-2), 0 0 0 2px rgba(255,92,92,0), 0 0 0 6px var(--bg-2), 0 0 0 7px rgba(255,92,92,0), 0 0 0 rgba(255,92,92,0); }
  40%  { transform: scale(1.12) rotate(-2deg); box-shadow: 0 0 0 1px var(--bg-2), 0 0 0 2px rgba(255,92,92,0.9), 0 0 0 6px var(--bg-2), 0 0 0 7px rgba(255,92,92,0.7), 0 0 40px rgba(255,92,92,0.7); }
  100% { transform: scale(1) rotate(0); box-shadow: 0 0 0 1px var(--bg-2), 0 0 0 2px rgba(255,92,92,0.5), 0 0 0 6px var(--bg-2), 0 0 0 7px rgba(255,92,92,0.4), 0 0 18px rgba(255,92,92,0.3); }
}

.mission-pip.resolving-success .pip-circle .glyph-wrap svg path,
.mission-pip.resolving-success .pip-circle .glyph-wrap svg line,
.mission-pip.resolving-success .pip-circle .glyph-wrap svg circle {
  stroke-dasharray: 200; stroke-dashoffset: 200;
  animation: missionDraw 0.7s ease-out 0.15s forwards;
}
.mission-pip.resolving-fail .pip-circle .glyph-wrap svg path,
.mission-pip.resolving-fail .pip-circle .glyph-wrap svg line,
.mission-pip.resolving-fail .pip-circle .glyph-wrap svg circle {
  stroke-dasharray: 220; stroke-dashoffset: 220;
  animation: missionDraw 0.55s ease-out 0.1s forwards;
}
.mission-pip.resolving-fail .pip-circle .glyph-wrap .crack {
  stroke-dasharray: 80; stroke-dashoffset: 80;
  animation: missionCrackSnap 0.25s ease-out 0.55s forwards;
}
@keyframes missionDraw      { to { stroke-dashoffset: 0; } }
@keyframes missionCrackSnap { to { stroke-dashoffset: 0; } }

/* Success burst — radiating spokes (only present during resolution) */
.mission-pip .pip-circle .burst { display: none; }
.mission-pip.resolving-success .pip-circle .burst {
  display: block;
  position: absolute; inset: -10px; z-index: 1; pointer-events: none;
  border-radius: 50%;
}
.mission-pip.resolving-success .pip-circle .burst::before,
.mission-pip.resolving-success .pip-circle .burst::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid var(--good);
  opacity: 0;
  animation: missionRing 1.1s ease-out 0.2s 1;
}
.mission-pip.resolving-success .pip-circle .burst::after {
  animation-delay: 0.45s;
  border-color: var(--gold-bright);
}
@keyframes missionRing {
  0%   { transform: scale(0.5); opacity: 0.9; }
  100% { transform: scale(1.7); opacity: 0; }
}

.two-fail-star {
  position: absolute;
  top: -6px; right: -6px;
  z-index: 3;
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font-ui);
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  border-radius: 10px;
  letter-spacing: 0.05em;
}
.mission-pip.clickable .pip-circle { cursor: pointer; }
.mission-pip.clickable .pip-circle:hover {
  transform: scale(1.06);
  filter: brightness(1.1);
}

/* Action strip — banner style: phase header on top, controls below */
.action-strip {
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}
.banner-head {
  padding: 0.55rem 1.1rem;
  background: linear-gradient(90deg, rgba(201,168,76,0.18), rgba(201,168,76,0));
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  color: var(--gold-bright);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.banner-head::before { content: '⚔'; color: var(--gold); }
.banner-head.good {
  background: linear-gradient(90deg, rgba(90,168,255,0.2), rgba(90,168,255,0));
  color: var(--good);
}
.banner-head.good::before { content: '◆'; color: var(--good); }
.banner-head.bad {
  background: linear-gradient(90deg, rgba(255,92,92,0.2), rgba(255,92,92,0));
  color: var(--bad);
}
.banner-head.bad::before { content: '🗡'; color: var(--bad); }
.banner-body {
  padding: 0.85rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Spinner — small ring used in waiting chips and waiting notes */
.spinner {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(201,168,76,0.25);
  border-top-color: var(--gold-bright);
  animation: spin 900ms linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.action-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.action-phase-tag {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0.4rem 0.8rem;
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 3px;
  font-weight: 600;
  white-space: nowrap;
}
.action-phase-tag.good-tag { color: var(--good); background: rgba(90,168,255,0.1); border-color: rgba(90,168,255,0.3); }
.action-phase-tag.bad-tag  { color: var(--bad);  background: rgba(255,92,92,0.1); border-color: rgba(255,92,92,0.3); }
.select-info {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--muted);
}
.waiting-note {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.waiting-note strong { color: var(--text); font-family: var(--font-display); font-weight: 500; letter-spacing: 0.04em; }
/* Long/short phrasing toggle for the waiting-note (desktop = long, phone = short) */
.wn-short { display: none; }
.speech-input-wrap { display: flex; flex: 1; min-width: 200px; }
.action-strip input[type="text"] {
  width: 100%;
  padding: 0.55rem 0.85rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-2);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.action-strip input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}
.action-strip button {
  padding: 0.55rem 1.2rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 600;
  white-space: nowrap;
}
.action-strip button:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dim) 100%);
  border: 1px solid var(--gold);
  color: var(--bg);
  box-shadow: 0 2px 8px rgba(201, 168, 76, 0.25);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 100%);
  box-shadow: 0 2px 14px rgba(201, 168, 76, 0.45);
}
.btn-approve {
  background: rgba(90, 168, 255, 0.15);
  border: 1px solid var(--good);
  color: var(--good);
}
.btn-approve:hover:not(:disabled) { background: rgba(90, 168, 255, 0.25); box-shadow: 0 0 14px rgba(90,168,255,0.3); }
.btn-reject {
  background: rgba(255, 92, 92, 0.1);
  border: 1px solid var(--bad);
  color: var(--bad);
}
.btn-reject:hover:not(:disabled) { background: rgba(255, 92, 92, 0.2); box-shadow: 0 0 14px rgba(255,92,92,0.3); }
.btn-danger {
  background: linear-gradient(180deg, var(--bad) 0%, #aa3333 100%);
  border: 1px solid var(--bad);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 92, 92, 0.25);
}
.btn-danger:hover:not(:disabled) { box-shadow: 0 2px 14px rgba(255,92,92,0.5); }

.action-meta {
  display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border);
  margin-top: 0.2rem;
}
.vote-chips { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.vote-chip {
  font-family: var(--font-display);
  font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.vote-chip.voted   { color: #f5e6c8; border-color: rgba(245,230,200,0.5); background: rgba(245,230,200,0.1); }
.vote-chip.waiting { color: var(--muted); border-color: var(--border); }
.prog-bar-wrap {
  flex: 1; min-width: 120px; max-width: 220px;
  height: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.prog-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--good), var(--gold));
  transition: width 0.35s;
}

/* Chronicle panel */
.chronicle-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: rgba(10, 14, 26, 0.4);
}
.chronicle-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.4rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: transparent;
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 600;
}
.chronicle-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.4rem;
  display: flex;
  flex-direction: column; /* newest first — chronicle.js already reverses */
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.5;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) var(--panel);
}
.chronicle-body::-webkit-scrollbar { width: 10px; }
.chronicle-body::-webkit-scrollbar-track {
  background: var(--panel);
  border-left: 1px solid rgba(201, 168, 76, 0.12);
}
.chronicle-body::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
  border-radius: 4px;
  border: 2px solid var(--panel);
}
.chronicle-body::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* Replay viewer (renders its own `.chronicle-entry` labels) */
.chronicle-entry { line-height: 1.45; padding: 0.25rem 0; }
.chronicle-entry.system     { color: var(--gold); font-family: var(--font-display); font-size: 0.75rem; letter-spacing: 0.22em; text-transform: uppercase; padding-top: 0.7rem; padding-bottom: 0.25rem; opacity: 0.85; }
.chronicle-entry.proposal   { color: var(--text); }
.chronicle-entry.speech     { color: var(--text); padding: 0.25rem 0 0.25rem 0.75rem; border-left: 2px solid var(--gold-dim); }
.chronicle-entry.approve    { color: var(--good); font-weight: 600; }
.chronicle-entry.reject     { color: var(--bad); font-weight: 600; }
.chronicle-entry.success    { color: var(--good); font-weight: 700; font-family: var(--font-display); font-size: 0.9rem; letter-spacing: 0.1em; }
.chronicle-entry.fail       { color: var(--bad);  font-weight: 700; font-family: var(--font-display); font-size: 0.9rem; letter-spacing: 0.1em; }
.chronicle-entry.assassin   { color: var(--bad); font-weight: 600; }
.chronicle-entry.good-wins  { color: var(--good); font-weight: 700; font-size: 1.1rem; font-family: var(--font-display); letter-spacing: 0.15em; text-transform: uppercase; }
.chronicle-entry.evil-wins  { color: var(--bad);  font-weight: 700; font-size: 1.1rem; font-family: var(--font-display); letter-spacing: 0.15em; text-transform: uppercase; }
.chron-who { color: var(--gold); font-weight: 600; font-family: var(--font-display); font-size: 0.88em; margin-right: 0.25rem; }

/* ───────────── Live-game chronicle entries (chron-entry) ───────────── */
/* Structured per entry type; scoped under .chronicle-body to keep the
   replay viewer's legacy .chronicle-entry styles separate.             */

.chronicle-body .chron-entry { padding: 0.2rem 0; }

/* System / quest-begin marker */
.chronicle-body .system {
  color: var(--gold); font-family: var(--font-display);
  font-size: 0.88rem; letter-spacing: 0.22em; text-transform: uppercase;
  padding: 0.55rem 0 0.3rem; display: flex; align-items: center; gap: 0.75rem;
}
.chronicle-body .system::before,
.chronicle-body .system::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Proposal row */
.chronicle-body .proposal-row { padding: 0.5rem 0 0.45rem; }
.chronicle-body .proposal-row .leader {
  font-family: var(--font-display); color: var(--gold-bright);
  font-weight: 600; letter-spacing: 0.04em;
}
.chronicle-body .proposal-row .verb { color: var(--muted, #8a8570); margin: 0 0.4rem; }
.chronicle-body .proposal-row .team { color: var(--text); font-weight: 600; }
.chronicle-body .proposal-row .speech {
  display: block; margin: 0.35rem 0 0 0;
  color: var(--text); opacity: 0.92;
  border-left: 2px solid var(--gold-dim); padding: 0.1rem 0 0.1rem 0.7rem;
}
.chronicle-body .proposal-row .speech.silent {
  color: var(--muted, #8a8570); opacity: 0.55; border-left-color: var(--border);
}
.chronicle-body .proposal-row .speech::before {
  content: '“'; color: var(--gold); font-family: var(--font-display);
  font-size: 1.4em; line-height: 0; margin-right: 0.15em; vertical-align: -0.25em;
}
.chronicle-body .proposal-row .speech.silent::before { content: ''; margin: 0; }

/* Vote row — name+pill on row 1, speech on row 2 */
.chronicle-body .vote-row {
  display: flex; flex-direction: column; gap: 0.25rem;
  font-size: 1.08rem; padding: 0.2rem 0;
}
.chronicle-body .vote-row .head { display: flex; align-items: center; gap: 0.6rem; }
.chronicle-body .vote-row .who {
  font-family: var(--font-display); font-size: 0.82em; color: var(--gold);
}
.chronicle-body .vote-row .pill {
  display: inline-block; font-family: var(--font-display);
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 0.15rem 0.65rem; border-radius: 999px; border: 1px solid;
  flex-shrink: 0;
}
/* Ivory = approve, Charcoal = reject (distinct from mission good/bad) */
.chronicle-body .vote-row .pill.approve {
  color: #f5e6c8; border-color: rgba(245,230,200,0.7); background: rgba(245,230,200,0.12);
}
.chronicle-body .vote-row .pill.reject {
  color: #7a8090; border-color: rgba(90,96,112,0.7); background: rgba(40,46,60,0.45);
}
.chronicle-body .vote-row .said { color: var(--text); opacity: 0.9; line-height: 1.5; padding-left: 0.1rem; }
.chronicle-body .vote-row .said.silent { color: var(--muted, #8a8570); opacity: 0.55; }

/* Vote tally banner */
.chronicle-body .tally {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-size: 0.82rem; letter-spacing: 0.2em;
  text-transform: uppercase; padding: 0.4rem 0.85rem; border-radius: 4px;
  margin-top: 0.25rem; align-self: flex-start;
}
.chronicle-body .tally .score { font-size: 1.05rem; letter-spacing: 0; font-family: var(--font-body); }
.chronicle-body .tally.approved {
  color: #f5e6c8; background: rgba(245,230,200,0.1); border: 1px solid rgba(245,230,200,0.35);
}
.chronicle-body .tally.rejected {
  color: #7a8090; background: rgba(40,46,60,0.45); border: 1px solid rgba(90,96,112,0.5);
}

/* Mission in-progress card plays */
.chronicle-body .card-play {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--muted, #8a8570);
}
.chronicle-body .card-play .glyph {
  width: 14px; height: 20px; border: 1px solid var(--border-2);
  border-radius: 2px; background: linear-gradient(135deg, #1a2340, #0d1220);
  display: inline-block; flex-shrink: 0;
}

/* Mission result banner */
.chronicle-body .mission-result {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.8rem 1.1rem; border-radius: 4px; margin: 0.5rem 0;
  font-family: var(--font-display); letter-spacing: 0.1em; text-transform: uppercase;
  font-size: 1rem; font-weight: 600;
}
.chronicle-body .mission-result.success {
  color: var(--good); background: var(--good-bg); border: 1px solid rgba(90,168,255,0.3);
}
.chronicle-body .mission-result.fail {
  color: var(--bad); background: var(--bad-bg); border: 1px solid rgba(255,92,92,0.3);
}
.chronicle-body .mission-result .count {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-body); font-weight: 700; letter-spacing: 0;
  text-transform: none; font-size: 0.95rem;
}
.chronicle-body .mission-result .count .num { font-size: 1.3rem; }
.chronicle-body .mission-result .count .lbl {
  font-family: var(--font-display); font-size: 0.75rem;
  letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.85;
}

/* Assassin — red-washed block */
.chronicle-body .assassin-row {
  padding: 0.8rem 1rem; margin: 0.5rem 0; border-radius: 4px;
  background: linear-gradient(90deg, rgba(255,92,92,0.12), transparent);
  border-left: 3px solid var(--bad);
}
.chronicle-body .assassin-row .who {
  font-family: var(--font-display); color: var(--bad); font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.95rem;
}
.chronicle-body .assassin-row .speech {
  display: block; margin-top: 0.3rem; color: var(--text);
}
.chronicle-body .assassin-row .strike {
  display: block; margin-top: 0.4rem; font-family: var(--font-display);
  color: var(--bad); letter-spacing: 0.08em;
}

/* Endgame banner */
.chronicle-body .endgame {
  text-align: center; padding: 1.3rem; margin-top: 0.8rem;
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.4rem; letter-spacing: 0.25em; text-transform: uppercase;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.chronicle-body .endgame.good { color: var(--good); }
.chronicle-body .endgame.evil { color: var(--bad); }

/* New-entry animations */
@keyframes chron-enter {
  0%   { opacity: 0; transform: translateY(-10px); max-height: 0;    margin-top: -0.5rem; filter: blur(2px); }
  40%  { opacity: 0.4;                             max-height: 400px; margin-top: 0; filter: blur(1px); }
  100% { opacity: 1; transform: translateY(0);     max-height: 400px; margin-top: 0; filter: blur(0); }
}
.chronicle-body .chron-enter {
  animation: chron-enter 520ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  overflow: hidden;
  transform-origin: top center;
}
@keyframes chron-flash {
  0%   { box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(232,200,102,0.35); background-color: rgba(201,168,76,0.08); }
  100% { box-shadow: 0 0 0 1px transparent, 0 0 0 transparent; background-color: transparent; }
}
.chronicle-body .chron-flash {
  animation: chron-flash 1400ms ease-out both;
  border-radius: 4px;
}

/* End-game modal */
.end-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 0.6rem;
  font-weight: 700;
}
.end-reason { text-align: center; font-family: var(--font-body); font-size: 1.05rem; color: var(--muted); margin-bottom: 1rem; }
.final-list { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.final-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem 0.85rem;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--border);
  border-radius: 0 3px 3px 0;
  font-family: var(--font-display);
}
.final-row.good { border-left-color: var(--good); }
.final-row.evil { border-left-color: var(--bad);  }
.final-row .final-role {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.final-row.good .final-role { color: var(--good); }
.final-row.evil .final-role { color: var(--bad); }


/* Modals */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  max-width: 640px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 0 80px rgba(0,0,0,0.8);
}
.role-info-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-bottom: 1rem;
}
.role-info-header h2 { margin: 0; }
.team-heading {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 1rem 0 0.5rem;
  color: var(--gold);
}
.team-heading.good { color: var(--good); }
.team-heading.evil { color: var(--bad); }
.role-info-card {
  padding: 0.7rem 0.85rem;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--border);
  border-radius: 0 3px 3px 0;
  margin-bottom: 0.5rem;
}
.role-info-card.good { border-left-color: var(--good); }
.role-info-card.evil { border-left-color: var(--bad); }
.role-info-name { font-weight: 600; font-size: 1rem; margin-bottom: 0.2rem; }
.role-info-card.good .role-info-name { color: var(--good); }
.role-info-card.evil .role-info-name { color: var(--bad); }
.role-info-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }
.mission-size-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }
.mission-size-chip {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 3px;
  font-size: 0.85rem;
  color: var(--gold);
}
.how-to-win {
  background: rgba(201,168,76,0.05);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 3px;
  padding: 0.75rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.mission-detail-modal { max-width: 880px; }
.mission-detail-modal {
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) var(--panel);
}
.mission-detail-modal::-webkit-scrollbar { width: 10px; }
.mission-detail-modal::-webkit-scrollbar-track {
  background: var(--panel);
  border-left: 1px solid rgba(201, 168, 76, 0.12);
}
.mission-detail-modal::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
  border-radius: 4px;
  border: 2px solid var(--panel);
}
.mission-detail-modal::-webkit-scrollbar-thumb:hover { background: var(--gold); }
.quest-result { color: var(--muted); font-size: 0.9rem; margin: 0 0 1rem 0; }
.quest-result .good { color: var(--good); font-weight: 600; }
.quest-result .evil { color: var(--bad);  font-weight: 600; }

.mdp-layout {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1rem;
  align-items: stretch;
}
.mdp-tabs {
  display: flex; flex-direction: column; gap: 0.4rem;
  border-right: 1px solid var(--border);
  padding-right: 0.75rem;
}
.mdp-tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
  padding: 0.55rem 0.7rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 0 3px 3px 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.mdp-tab:hover {
  background: rgba(201,168,76,0.08);
  color: var(--gold-bright);
  box-shadow: none;
}
.mdp-tab .mdp-tab-title { font-weight: 600; }
.mdp-tab .mdp-tab-meta {
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.mdp-tab.approved { border-left-color: var(--good); }
.mdp-tab.rejected { border-left-color: var(--bad); }
.mdp-tab.approved .mdp-tab-meta { color: var(--good); }
.mdp-tab.rejected .mdp-tab-meta { color: var(--bad); }
.mdp-tab.active { background: rgba(201,168,76,0.12); color: var(--gold-bright); }
.mdp-tab.active.approved { background: var(--good-bg); }
.mdp-tab.active.rejected { background: var(--bad-bg); }

.mdp-panel { min-width: 0; }
.proposal-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 0.95rem;
}
.proposal-table tbody td {
  padding: 0.5rem 0.6rem; vertical-align: top;
  border-bottom: 1px solid rgba(201,168,76,0.07);
}
.proposal-table tbody tr:last-child td { border-bottom: none; }
.proposal-table tbody td:nth-child(1),
.proposal-table tbody td:nth-child(2) {
  vertical-align: middle; text-align: center;
}
.col-name   { width: 7rem; }
.col-vote   { width: 6rem; }
.col-speech { width: auto; }

.pname { font-weight: 600; color: #ffffff; }
.pname.leader {
  color: var(--gold-bright);
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  font-weight: 700;
}
.proposal-table td.on-team {
  background: var(--good-bg);
  box-shadow: inset 0 0 0 1px rgba(90,168,255,0.45);
  border-radius: 3px;
}

.vpill {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 0.18rem 0.7rem; border-radius: 999px; border: 1px solid;
}
.vpill.approve { color: #f5e6c8; border-color: rgba(245,230,200,0.7); background: rgba(245,230,200,0.12); }
.vpill.reject  { color: #7a8090; border-color: rgba(90,96,112,0.7);   background: rgba(40,46,60,0.55); }
.vpill.abstain { color: var(--muted); border-color: var(--border); background: transparent; }

.speech-cell { color: var(--text); line-height: 1.45; }
.speech-cell.silent { color: var(--muted); }

@media (max-width: 620px) {
  .mdp-layout { grid-template-columns: 1fr; }
  .mdp-tabs {
    flex-direction: row; flex-wrap: wrap;
    border-right: none; border-bottom: 1px solid var(--border);
    padding-right: 0; padding-bottom: 0.5rem;
  }
  .col-name { width: 6rem; }
  .col-vote { width: 4.5rem; }
}

/* ---------- Milestone 10: replay list ---------- */

.replay-list-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.replay-list-header h2 { margin: 0; }

.replay-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.replay-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--border);
  border-radius: 0 3px 3px 0;
  gap: 0.75rem;
}
.replay-main { flex: 1; min-width: 0; }
.replay-title { font-weight: 600; }
.replay-meta { font-size: 0.85rem; margin-top: 0.2rem; }
.replay-names { font-size: 0.8rem; margin-top: 0.2rem; opacity: 0.7; }
.replay-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

.win-good { color: var(--good); }
.win-evil { color: var(--bad); }

.landing-footer { margin-top: 1.25rem; display: flex; justify-content: flex-end; gap: 0.5rem; align-items: center; }

.auth-bar { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; padding: 0.5rem 0.75rem; background: rgba(255,255,255,0.04); border-radius: 6px; }
.auth-bar .auth-label { font-size: 0.85rem; opacity: 0.85; }
.replay-list-tools { display: flex; gap: 0.5rem; align-items: center; }
.replay-filter { display: inline-flex; gap: 0.25rem; }

.delete-btn {
  color: var(--bad);
  border-color: var(--bad);
  background: var(--bad-bg);
}

/* ---------- Past-game review (replay viewer) ---------- */

.replay-review {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 720px;
  margin: 0 auto;
}
.replay-mission-track-wrap { padding: 0.5rem 0 0.25rem; }
.replay-players-panel {
  background: rgba(10, 14, 26, 0.4);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 0.9rem 0.9rem;
  overflow: visible;
  max-height: none;
}

/* Responsive: collapse to vertical on narrow screens */
@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
  .players-panel { max-height: 260px; }
  .replay-players-panel { max-height: none; }
  .chronicle-panel { max-height: 300px; }
}

/* ---------- Phase 1 mobile polish (≤600px) ---------- */
/* Scoped to phones — desktop layout is untouched. */
@media (max-width: 600px) {
  /* Disable horizontal page scroll entirely. `clip` (not `hidden`) avoids
     creating a scroll container, so position:sticky still works on the
     header / mission track / action strip. The horizontal player strip
     keeps its own internal scroll because it's a separate container. */
  html, body {
    overflow-x: clip;
    overscroll-behavior-x: none;
  }

  /* Reclaim horizontal space outside the game */
  #app { padding: 0.75rem 0.85rem; }
  header { margin-bottom: 0.4rem; padding-bottom: 0.3rem; }
  h1 { font-size: 1.4rem; }

  /* In-game: tighter header and mission-track padding */
  .game-layout .game-header { padding: 0.6rem 0.85rem; gap: 0.55rem; }
  .header-brand { font-size: 0.95rem; letter-spacing: 0.18em; }
  .mission-track-wrap { padding: 0.35rem 0.6rem 0.6rem; }

  /* 44px minimum tap target for primary action buttons */
  .action-strip button,
  button.primary,
  button.secondary,
  .ack-btn,
  .gender-btn,
  .count-btn {
    min-height: 44px;
  }

  /* Form rows: stack label over input, allow wrapping */
  .form-row { flex-wrap: wrap; gap: 0.4rem 0.75rem; }
  .form-row label { min-width: 0; width: 100%; font-size: 0.8rem; }
  .form-row input[type="text"] { width: 100%; flex: 1 1 100%; }

  /* Landing: stack the Create / Join columns; lighter panel padding so
     wide uppercase Cinzel text fits the row */
  .panel { padding: 1rem; }
  .landing-actions { grid-template-columns: 1fr; gap: 1rem; min-width: 0; }
  .landing-col { min-width: 0; }
  #create-btn { width: 100%; min-width: 0; }
  /* JOIN sits beside the room-code input — natural width, not 100%. */
  .landing-actions .form-row { flex-wrap: nowrap; min-width: 0; }
  .landing-actions .form-row input[type="text"] { flex: 1 1 auto; width: auto; min-width: 0; }
  #join-btn { flex: 0 0 auto; }

  /* Gender toggle: each option fills half the row */
  .gender-toggle { display: flex; width: 100%; gap: 0.4rem; }
  .gender-toggle .gender-btn { flex: 1; }

  /* Lobby header: stack room code + Leave button */
  .lobby-header { flex-direction: column; align-items: stretch; gap: 0.6rem; }

  /* Lobby player-count row: let the count buttons get a full row of their own */
  .lobby-count { flex-wrap: wrap; gap: 0.5rem; }
  .lobby-count label { width: 100%; }
  .count-buttons { flex: 1 1 100%; }

  /* Host actions: full-width stacked buttons */
  .host-actions { flex-direction: column; }
  .host-actions button { width: 100%; }

  /* Modals: less wasted padding on small viewports */
  .role-modal-overlay { padding: 1rem 0.6rem; }
  .modal { padding: 1rem; width: 94%; }
  .big-portrait { width: 150px; height: 150px; }
  .big-name { font-size: 1.35rem; letter-spacing: 0.14em; }

  /* ── In-game layout on phones ──
     Stop forcing 100dvh fixed-height grid. Let the page flow:
     header → players-strip → sticky mission+action → chronicle (grows). */
  .game-layout {
    display: block;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  .game-layout .game-header {
    position: sticky; top: 0; z-index: 30;
    background: var(--bg);
  }
  /* Drop the brand and "X players" pill so phase + leader + Roles + Leave fit one row */
  .game-layout .game-header .header-brand,
  .game-layout .game-header .hdiv:first-of-type,
  .game-layout .game-header .status-pill { display: none; }
  .game-layout .game-header .header-actions { gap: 0.3rem; }
  .game-layout .game-header .header-actions .ghost {
    padding: 0.4rem 0.65rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
  }

  /* Players: horizontal scrolling strip of compact cards.
     Saves a huge amount of vertical space on phones. */
  .players-panel {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    padding: 0.5rem 0.6rem;
    gap: 0.45rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
  }
  .panel-label, .selection-hint { display: none; }   /* hidden on phone — leader/phase already in header */
  /* Drop the initials avatar circle on phone — role/ally badges take its visual role */
  .player-card .player-avatar { display: none; }
  .player-card {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.55rem;
    min-width: 70px;
    text-align: center;
  }
  .player-card.is-me {
    border-left: 1px solid rgba(201,168,76,0.1);
    padding-left: 0.55rem;
    box-shadow: inset 0 0 0 1px rgba(201,168,76,0.4);
  }
  .player-card .player-status-text { display: none; }
  .player-card .player-info { width: 100%; }
  .player-card .player-name {
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    max-width: 80px;
  }
  .player-card .player-you,
  .player-card .name-tag { display: none; }
  .player-card .player-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-top: 0.15rem;
  }
  .player-card .badge {
    font-size: 0.55rem;
    padding: 0.05rem 0.3rem;
    letter-spacing: 0.04em;
  }
  /* Selected/picked: a clear ring around the whole card now that the avatar is gone */
  .player-card.selected { box-shadow: 0 0 0 2px var(--gold); }
  .players-panel.assassin-mode .player-card.selected { box-shadow: 0 0 0 2px var(--bad); }
  .player-card .sel-mark { display: none; }

  /* Mission track + action strip: stick together under the header */
  .mission-track-wrap {
    position: sticky;
    top: 0;          /* will sit below header due to stacking; header is also sticky at 0 */
    background: var(--bg);
    z-index: 20;
    padding: 0.5rem 0.4rem;
  }
  .mission-track { gap: 0.65rem; }
  .mission-pip .pip-circle { width: 52px; height: 52px; }
  .mission-pip .pip-circle .frame {
    box-shadow:
      0 0 0 1px var(--bg-2),
      0 0 0 2px rgba(201,168,76,0.25),
      0 0 0 4px var(--bg-2),
      0 0 0 5px rgba(201,168,76,0.2);
  }
  .mission-pip.success .pip-circle .frame {
    box-shadow:
      0 0 0 1px var(--bg-2),
      0 0 0 2px rgba(90,168,255,0.5),
      0 0 0 4px var(--bg-2),
      0 0 0 5px rgba(90,168,255,0.4),
      0 0 12px rgba(90,168,255,0.3);
  }
  .mission-pip.fail .pip-circle .frame {
    box-shadow:
      0 0 0 1px var(--bg-2),
      0 0 0 2px rgba(255,92,92,0.5),
      0 0 0 4px var(--bg-2),
      0 0 0 5px rgba(255,92,92,0.4),
      0 0 12px rgba(255,92,92,0.3);
  }
  .mission-pip.active .pip-circle .frame {
    box-shadow:
      0 0 0 1px var(--bg-2),
      0 0 0 2px rgba(201,168,76,0.6),
      0 0 0 4px var(--bg-2),
      0 0 0 5px rgba(201,168,76,0.45),
      0 0 16px rgba(232,200,102,0.35);
  }
  .mission-pip .pip-circle .glyph-wrap { width: 28px; height: 28px; }
  .mission-pip .pip-circle .num-wrap .n  { font-size: 1.05rem; }
  .mission-pip .pip-circle .num-wrap .sz { font-size: 0.5rem; margin-top: 0.1rem; }
  .mission-pip .pip-tag { font-size: 0.5rem; letter-spacing: 0.12em; }

  .action-strip {
    position: sticky;
    top: 0;
    z-index: 19;
    background: var(--panel-2);
  }
  .banner-head { padding: 0.4rem 0.85rem; font-size: 0.7rem; letter-spacing: 0.16em; }
  .banner-body { padding: 0.65rem 0.85rem; gap: 0.5rem; }
  .action-row { gap: 0.5rem; flex-wrap: wrap; }
  .speech-input-wrap { flex: 1 1 100%; min-width: 0; }
  /* Vote chips inside the action strip duplicate the players panel — hide on phone */
  .action-strip .vote-chips { display: none; }
  /* Default: buttons size to content, right-align in their row */
  .action-strip button {
    flex: 0 0 auto;
    padding: 0.55rem 0.7rem;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
  }
  .action-strip .action-row { justify-content: flex-end; }
  /* Approve / Reject (and Success / Fail) share a row equally */
  .action-strip .btn-approve,
  .action-strip .btn-reject,
  .action-strip #play-success,
  .action-strip #play-fail {
    flex: 1 1 0;
    min-width: 0;
  }
  /* Waiting-note: full row above the trailing button, and flow as one line
     of inline text (not inline-flex with per-fragment items) so it doesn't
     break "Waiting for / X / to propose a team" into vertical columns. */
  .action-strip .waiting-note {
    flex: 1 1 100%;
    display: block;
    font-size: 0.88rem;
    line-height: 1.35;
  }
  .action-strip .waiting-note .spinner {
    vertical-align: -1px;
    margin-right: 0.4rem;
  }
  /* Phone uses the short phrasing: "{name} is proposing…" */
  .wn-long { display: none; }
  .wn-short { display: inline; }

  /* Chronicle: no max-height, grows to fit remaining content */
  .chronicle-panel { max-height: none; min-height: 40dvh; }
  .chronicle-header { padding: 0.6rem 1rem; font-size: 0.68rem; letter-spacing: 0.2em; }
  .chronicle-body { padding: 0.75rem 1rem; font-size: 1rem; }

  /* Quest (mission detail) modal: reflow each row into 2 lines —
     line 1 = name + vote pill, line 2 = speech indented beneath. */
  .mission-detail-modal { max-width: none; }
  .proposal-table thead { display: none; }
  .proposal-table, .proposal-table tbody { display: block; }
  .proposal-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    padding: 0.5rem 0.4rem;
    border-bottom: 1px solid rgba(201,168,76,0.07);
  }
  .proposal-table td {
    display: block;
    padding: 0;
    border: none;
    text-align: left;
  }
  .proposal-table td.col-name   { width: auto; flex: 0 0 auto; }
  .proposal-table td.col-vote   { width: auto; flex: 0 0 auto; }
  .proposal-table td.col-speech { flex: 1 1 100%; padding-left: 0.2rem; }
  .proposal-table td.on-team { background: transparent; box-shadow: none; }
  .proposal-table td.on-team .pname::before {
    content: '◆ ';
    color: var(--good);
    font-size: 0.85em;
  }
}

/* ── Intermission modal (vote / mission / first-leader ack gate) ── */
.intermission-overlay { z-index: 200; }
.intermission-modal { max-width: 560px; }
.intermission-modal .im-title {
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  color: var(--gold);
  margin: 0 0 0.85rem 0;
  text-align: center;
}
.intermission-modal.approved .im-title { color: #f5e6c8; }
.intermission-modal.rejected .im-title { color: #9aa3b5; }
.intermission-modal .im-body { margin-bottom: 1.2rem; }
.intermission-modal .im-tally {
  display: flex; gap: 0.6rem; justify-content: center; margin-bottom: 0.85rem;
}
.intermission-modal .im-pill {
  font-family: var(--font-display);
  font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 0.35rem 0.85rem; border-radius: 999px; border: 1px solid;
}
.intermission-modal .im-pill.approve {
  color: #f5e6c8;
  border-color: rgba(245,230,200,0.7);
  background: rgba(245,230,200,0.12);
}
.intermission-modal .im-pill.reject {
  color: #9aa3b5;
  border-color: rgba(120,128,144,0.7);
  background: rgba(40,46,60,0.55);
}
.intermission-modal .im-table {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.95rem;
}
.intermission-modal .im-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(201,168,76,0.07);
}
.intermission-modal .im-table tr:last-child td { border-bottom: none; }
.intermission-modal .im-table td:first-child { width: 60%; }
.intermission-modal .im-table td:last-child { text-align: right; }
.intermission-modal .im-quest-line {
  font-family: var(--font-display);
  font-size: 1.1rem; letter-spacing: 0.06em; text-align: center;
  margin-bottom: 0.4rem;
}
.intermission-modal .im-quest-line .good { color: var(--good); }
.intermission-modal .im-quest-line .evil { color: var(--bad); }
.intermission-modal .im-fail-line {
  text-align: center; color: var(--muted); font-size: 0.95rem;
}
.intermission-modal .im-leader-line {
  font-size: 1.1rem; text-align: center; margin-bottom: 0.3rem;
}
.intermission-modal .im-leader-line strong {
  color: var(--gold-bright); font-family: var(--font-display); letter-spacing: 0.04em;
}
.intermission-modal .im-leader-sub {
  text-align: center; color: var(--muted); font-size: 0.9rem;
}
.intermission-modal .im-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.intermission-modal .im-foot button {
  padding: 0.55rem 1.4rem;
  background: rgba(201,168,76,0.15);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  border-radius: 2px; cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.intermission-modal .im-foot button:hover {
  background: rgba(201,168,76,0.28); color: var(--gold-bright);
}
.intermission-wait-badge {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  z-index: 200;
  padding: 0.55rem 1rem;
  background: rgba(20,26,42,0.92);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem; color: var(--muted);
  box-shadow: 0 4px 24px rgba(0,0,0,0.6);
  display: flex; align-items: center; gap: 0.5rem;
}
.intermission-wait-badge strong { color: var(--text); font-weight: 600; }
