/* ============================================================
   The Imposter Quiz — Stylesheet
   Dark space-mystery theme, mobile-first, no frameworks
   ============================================================ */

/* ── Custom properties ─────────────────────────────────────── */
:root {
  --bg:           #0a0e1a;
  --bg-card:      #0f1523;
  --bg-panel:     #131d2e;
  --bg-input:     #0c1120;
  --border:       rgba(255,255,255,0.08);
  --border-focus: #00d4ff;

  --accent:       #00d4ff;
  --accent-dim:   rgba(0,212,255,0.12);
  --accent-glow:  rgba(0,212,255,0.25);
  --blue:         #1565c0;
  --blue-light:   #1976d2;
  --success:      #00e676;
  --success-dim:  rgba(0,230,118,0.10);
  --warning:      #ffd740;
  --danger:       #ff3a5c;
  --danger-dim:   rgba(255,58,92,0.15);

  --text:         #dde3f0;
  --text-muted:   #546e7a;
  --text-dim:     #7e99b0;

  --radius:       16px;
  --radius-sm:    10px;
  --shadow:       0 16px 48px rgba(0,0,0,0.6);
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Barlow Condensed', system-ui, sans-serif;

  /* SVG ring timer circumference: 2π×28 ≈ 175.9 */
  --ring-circ: 175.9;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }
input  { font-family: inherit; }

/* ── Base ──────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem 1rem 4rem;
  gap: 1rem;
}

/* Animated gradient background — two layers cross-fading, no repaint-heavy transforms */
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    radial-gradient(ellipse at 15% 50%, rgba(0,100,180,0.20) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(0,180,220,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 85%, rgba(0,40,100,0.22)  0%, transparent 55%);
  animation: bgPulseA 20s ease-in-out infinite alternate;
}

body::after {
  background:
    radial-gradient(ellipse at 70% 40%, rgba(0,60,140,0.16)  0%, transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(0,140,200,0.10) 0%, transparent 45%);
  animation: bgPulseB 26s ease-in-out infinite alternate;
}

@keyframes bgPulseA {
  0%   { opacity: 0.6; }
  100% { opacity: 1;   }
}

@keyframes bgPulseB {
  0%   { opacity: 1;   }
  100% { opacity: 0.4; }
}

/* ── Global utility ────────────────────────────────────────── */
.hidden { display: none !important; }

/* Background canvas — fixed behind everything, out of layout flow */
.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

/* ── Screen management ─────────────────────────────────────── */
.screen {
  display: none;
  width: 100%;
  max-width: 680px;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
  animation: screenIn 0.35s ease both;
}

.screen.active { display: flex; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Game screen needs more width */
#screen-game  { max-width: 960px; }
#screen-lobby { max-width: 960px; }

/* Centred screens (reveal, voting, results) */
.screen-centered {
  align-items: center;
  text-align: center;
}

/* ── Reveal screen (3D flip card) ──────────────────────────── */
.reveal-prompt {
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.reveal-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  margin-bottom: 1.5rem;
}

.flip-card {
  perspective: 1200px;
  width: 260px;
  height: 360px;
  cursor: pointer;
  touch-action: manipulation;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.flip-card.flipped .flip-inner { transform: rotateY(180deg); }

.flip-front,
.flip-back {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.flip-front {
  /* Uses .glass-card styles too — added in HTML */
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.flip-question {
  font-family: var(--font-heading);
  font-size: 6rem;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 0 40px var(--accent-glow);
  line-height: 1;
}

.flip-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* Back of card */
.flip-back {
  transform: rotateY(180deg);
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 2rem;
}

/* Innocent back */
.flip-back.role-innocent {
  background: linear-gradient(160deg, #061a10 0%, #0a1f1a 100%);
  border-color: rgba(0,230,118,0.25);
  box-shadow: 0 0 40px rgba(0,230,118,0.08);
}

/* Imposter back — flashes red */
.flip-back.role-imposter {
  background: linear-gradient(160deg, #1a0608 0%, #200a0c 100%);
  border-color: rgba(255,58,92,0.35);
  animation: imposterFlash 1.4s ease-in-out infinite alternate;
}

@keyframes imposterFlash {
  from { box-shadow: 0 0 20px rgba(255,58,92,0.15); }
  to   { box-shadow: 0 0 60px rgba(255,58,92,0.45), inset 0 0 40px rgba(255,58,92,0.08); }
}

.role-reveal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.btn-ready-margin { margin-top: 1.5rem; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  box-shadow: var(--shadow);
}

/* Glass-morphism variant used by new HTML */
.glass-card {
  background: rgba(255,255,255,0.04);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45),
              inset 0 1px 0 rgba(255,255,255,0.07);
}

/* ── Landing screen ────────────────────────────────────────── */
/* Landing screen — content sits in the upper-centre of the viewport */
#screen-landing {
  justify-content: flex-start;
  padding-top: clamp(1.5rem, 8vh, 4rem);
  gap: 1.5rem;
}

/* Hero block: glyph + title + tagline */
.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
}

/* Emoji glyph */
.logo-glyph {
  font-size: 3.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

/* H1 heading */
.logo-text {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 0.95;
  background: linear-gradient(135deg, var(--accent) 0%, #7fffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

/* Tagline */
.logo-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 0.35rem;
  letter-spacing: 0.3px;
}

/* Legacy aliases kept for any old HTML that slips through */
.logo-wrap  { text-align: center; padding: 1rem 0 0.5rem; }
.logo-icon  { font-size: 3.5rem; line-height: 1; filter: drop-shadow(0 0 18px var(--accent-glow)); }
.logo       { font-family: var(--font-heading); font-size: 2.6rem; font-weight: 900; letter-spacing: 1px; text-transform: uppercase;
              background: linear-gradient(135deg, var(--accent) 0%, #7fffff 100%);
              -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.tagline    { color: var(--text-muted); margin-top: 0.35rem; font-size: 0.95rem; }

/* Landing card gets a bit more breathing room */
.landing-card { padding: 2rem; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group,
.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

label,
.field-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

input[type="text"],
.field-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  padding: 0.8rem 1rem;
  min-height: 48px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
.field-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.18);
}

input[type="text"]::placeholder,
.field-input::placeholder { color: var(--text-muted); }

/* Code entry input: spaced capitals */
.code-input {
  text-transform: uppercase;
  letter-spacing: 6px;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
}

/* Error / success inline chips */
.error-chip,
.error-msg {
  background: var(--danger-dim);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--danger);
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  width: 100%;
  animation: screenIn 0.2s ease;
}

.success-chip {
  background: var(--success-dim);
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  color: var(--success);
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  width: 100%;
  text-align: center;
}

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Join row ──────────────────────────────────────────────── */
.join-row {
  display: flex;
  gap: 0.5rem;
}

.join-row input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  /* Mobile-first: generous tap targets */
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  transition: transform 0.12s ease, background 0.15s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  touch-action: manipulation; /* removes 300ms mobile delay */
  -webkit-user-select: none;
  user-select: none;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: var(--accent);
  color: #001a20;
  font-weight: 800;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  background: #33ddff;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 28px var(--accent-glow);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.95) !important;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.btn-secondary {
  background: var(--blue);
  color: #fff;
}

.btn-secondary:hover:not(:disabled)  { background: var(--blue-light); transform: translateY(-1px); }
.btn-secondary:active:not(:disabled) { transform: scale(0.95) !important; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  min-height: 44px;
}

.btn-ghost:hover:not(:disabled)  { color: var(--text); border-color: var(--text-muted); }
.btn-ghost:active:not(:disabled) { transform: scale(0.95) !important; }

.btn-full  { width: 100%; }
.btn-large,
.btn-lg    { font-size: 1.05rem; padding: 0.9rem 1.6rem; min-height: 52px; }
.btn-sm    { font-size: 0.82rem; padding: 0.45rem 0.85rem; min-height: 36px; }

/* btn-accent = btn-primary */
.btn-accent {
  background: var(--accent);
  color: #001a20;
  font-weight: 800;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-accent:hover:not(:disabled)  { background: #33ddff; transform: translateY(-2px) scale(1.02); box-shadow: 0 6px 28px var(--accent-glow); }
.btn-accent:active:not(:disabled) { transform: scale(0.95) !important; }

/* Icon span inside a button */
.btn-icon { font-size: 0.9em; opacity: 0.8; }

/* ── Lobby layout ───────────────────────────────────────────── */
.lobby-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1rem;
  width: 100%;
  max-width: 920px;
  align-items: start;
}

.lobby-left {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.lobby-right {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Card-level heading + pill row */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.card-title,
.ab-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.pill {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
  color: var(--text-muted);
}

/* Small note / toast inside a card */
.inline-note {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 0.55rem 0.9rem;
  text-align: center;
  margin-top: 0.5rem;
  animation: screenIn 0.25s ease;
}

.hint-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 0.4rem;
}

/* Waiting row with animated dot */
.waiting-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.75rem 0;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: dotPulse 1.4s ease-in-out infinite;
}

/* Avatar builder */
.ab-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.ab-randomize {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  min-height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  letter-spacing: 0.3px;
}
.ab-randomize:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.ab-preview-wrap {
  display: flex;
  justify-content: center;
  padding: 0.25rem 0 0.75rem;
}

.ab-preview-circle {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: #1e3050;
  border: 3px solid var(--accent);
  box-shadow: 0 0 22px var(--accent-glow), inset 0 0 12px rgba(0,212,255,0.06);
  overflow: hidden;
}

.ab-options {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Vote cards ─────────────────────────────────────────────── */
/* Grid wrapping the vote cards */
.vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  width: 100%;
  margin-bottom: 1.25rem;
}

/* Each vote card */
.btn-vote {
  background: rgba(255,255,255,0.04);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  width: 100%;
  padding: 1.25rem 0.75rem 1rem;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-height: 110px;
  transition: transform 0.15s ease, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  touch-action: manipulation;
  cursor: pointer;
}

.btn-vote:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: scale(1.04);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-vote:active:not(:disabled) { transform: scale(0.96) !important; }

.btn-vote.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 24px var(--accent-glow);
}

/* ── Lobby ─────────────────────────────────────────────────── */
.code-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.code-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.code-value {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 10px;
  color: var(--accent);
  text-shadow: 0 0 18px var(--accent-glow);
  flex: 1;
}

.section { margin-bottom: 1.25rem; }

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

.section-header h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.15rem 0.6rem;
  color: var(--text-dim);
}

/* ── Player list ───────────────────────────────────────────── */
/* ── Round-table arena ──────────────────────────────────────── */
.player-list-arena {
  position: relative;
  width: 100%;
  height: 280px;
  margin: 0.25rem 0;
}

.lobby-table {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 104px; height: 104px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #1e3a5a 0%, #0d1e33 70%);
  border: 2px solid rgba(79,172,254,0.25);
  box-shadow: 0 0 28px rgba(79,172,254,0.12), inset 0 0 18px rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}

.lobby-table-icon {
  font-size: 2rem;
  opacity: 0.7;
  filter: drop-shadow(0 0 6px rgba(79,172,254,0.5));
}

.player-list {
  position: absolute;
  inset: 0;
  list-style: none;
  margin: 0; padding: 0;
}

.player-list li {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: translate(-50%, -50%);
  animation: seatIn 0.3s ease both;
}

@keyframes seatIn {
  from { opacity: 0; scale: 0.7; }
  to   { opacity: 1; scale: 1; }
}

.p-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-panel);
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.player-list li.p-is-me .p-avatar  { border-color: var(--accent); }
.player-list li.p-is-host .p-avatar { border-color: #fbbf24; }

.p-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.p-badges {
  display: flex;
  gap: 3px;
  justify-content: center;
}

.p-you {
  font-size: 0.6rem;
  color: var(--text-muted);
  background: var(--bg-input);
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
}

.p-host {
  font-size: 0.6rem;
  font-weight: 700;
  color: #1a1a1a;
  background: #fbbf24;
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
}

/* ── Waiting / hints ───────────────────────────────────────── */
.hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 0.6rem;
}

.waiting-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.75rem 0;
  text-align: center;
}

/* Animated dot-pulse indicator */
.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  animation: dotPulse 1.4s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.3; transform: scale(0.6); }
}

/* ── Inline toast (lobby / voted message) ──────────────────── */
.inline-toast {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.88rem;
  padding: 0.6rem 1rem;
  text-align: center;
  margin-top: 0.5rem;
  animation: screenIn 0.25s ease;
}

/* ── Game screen ───────────────────────────────────────────── */
.game-topbar {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  align-items: stretch;
  flex-wrap: wrap;
}

/* role-chip: compact topbar pill (HTML uses this name) */
.role-chip,
.role-banner {
  flex: 1;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
}

.role-chip.imposter,
.role-banner.imposter {
  background: var(--danger-dim);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.role-chip.innocent,
.role-banner.innocent {
  background: var(--success-dim);
  border: 1px solid var(--success);
  color: var(--success);
}

/* category-chip: shown to all players, tells imposter the topic */
.category-chip {
  background: var(--bg-card);
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 120px;
}

.category-chip-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.2rem;
}

.category-chip-value {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
  letter-spacing: 0.5px;
}

/* word-chip: new HTML name for word-box */
.word-chip,
.word-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  text-align: center;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.word-chip-label,
.word-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.2rem;
}

.word-chip-value,
.word-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--warning);
  display: block;
}

/* Three-column game grid */
.game-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 0.75rem;
  width: 100%;
}

/* Panels */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.panel-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* panel-head: HTML uses this name instead of panel-title */
.panel-head,
.panel-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* turn-avatar-svg: wrapper div for the turn avatar */
.turn-avatar-svg {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* game-error-chip */
.game-error-chip {
  background: var(--danger-dim);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--danger);
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  width: 100%;
  text-align: center;
}

/* Clues list (shared between game + voting recap) */
/* HTML uses class="clue-list" (no s) in some places */
.clue-list,
.clues-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  max-height: 260px;
}

.clue-list li,
.clues-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-panel);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  animation: screenIn 0.2s ease;
}

.clue-word { font-weight: 700; color: var(--text); }
.clue-by   { font-size: 0.78rem; color: var(--text-muted); }

.clue-empty {
  color: var(--text-muted);
  font-style: italic;
  background: transparent !important;
  font-size: 0.88rem;
}

/* Turn display (centre panel) */
.panel-center { align-items: center; justify-content: center; }

.turn-display {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.turn-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, #42a5f5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(66,165,245,0.25);
}

.turn-avatar.is-you {
  background: linear-gradient(135deg, var(--accent) 0%, #ff8fa3 100%);
  box-shadow: 0 0 0 3px rgba(255,58,92,0.3);
}

.turn-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.turn-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* SVG ring timer */
.timer-ring {
  position: relative;
  width: 80px;
  height: 80px;
}

.ring-svg { transform: rotate(-90deg); width: 100%; height: 100%; display: block; }

/* Background track — matches HTML class name */
.ring-bg  { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 5; }

/* Arc — matches HTML class name (r=30, circ ≈ 188.5) */
.ring-arc {
  fill: none;
  stroke: var(--success);      /* green by default */
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 188.5;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.5s ease;
}

.ring-arc.warning  { stroke: var(--warning); }
.ring-arc.critical { stroke: var(--danger);  }

.ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--success);
  transition: color 0.5s ease;
}

.ring-num.warning  { color: var(--warning); }
.ring-num.critical {
  color: var(--danger);
  animation: timerPulse 0.7s ease-in-out infinite alternate;
}

@keyframes timerPulse {
  from { opacity: 1;    transform: scale(1);    }
  to   { opacity: 0.65; transform: scale(0.92); }
}

/* Clue input area */
.clue-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.clue-input-wrap input {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: capitalize;
}

/* Turn order list */
.turn-order-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-left: 0;
  counter-reset: turn-counter;
}

.turn-order-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-dim);
  padding: 0.3rem 0;
  counter-increment: turn-counter;
}

.turn-order-list li::before {
  content: counter(turn-counter);
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.turn-order-list li.is-current {
  color: var(--accent);
  font-weight: 700;
}

.turn-order-list li.is-current::before {
  background: var(--accent);
  color: #fff;
}

.turn-order-list li.is-done {
  text-decoration: line-through;
  opacity: 0.35;
}

/* ── Voting screen ─────────────────────────────────────────── */
.voting-card { text-align: center; }

/* screen-heading: HTML alias for screen-title */
.screen-heading,
.screen-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.screen-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.vote-progress-bar {
  height: 4px;
  background: var(--bg-panel);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.vote-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.vote-bar-zero { width: 0; }

.vote-count-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.vote-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

.clues-recap {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 0.75rem;
  text-align: left;
}

/* Results host controls wrapper */
.results-host-ctrl {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* ── Results screen ────────────────────────────────────────── */
.result-banner {
  font-family: var(--font-heading);
  text-align: center;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  padding: 1.25rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.result-banner.win {
  background: var(--success-dim);
  border: 1px solid var(--success);
  color: var(--success);
}

.result-banner.lose {
  background: var(--danger-dim);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.result-rows {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.result-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.result-value { font-size: 1.05rem; font-weight: 800; }
.accent-red    { color: var(--danger); }
.accent-yellow { color: var(--warning); }

/* New HTML names for results: result-facts, fact-row, fact-label, fact-value */
.result-facts {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}

.fact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.fact-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.fact-value { font-size: 1.05rem; font-weight: 800; }
.fact-value.red    { color: var(--danger); }
.fact-value.yellow { color: var(--warning); }
.fact-value.accent { color: var(--accent); }

/* Avatar row on results */
.result-avatar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  width: 100%;
}

/* vote-chips: HTML name for vote-breakdown */
.vote-chips,
.vote-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  min-height: 1rem;
}

.v-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.85rem;
}

.v-chip-count {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
}

/* ── Error message ─────────────────────────────────────────── */
.error-msg {
  background: var(--danger-dim);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--danger);
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  width: 100%;
  animation: screenIn 0.2s ease;
}

/* ── Global toast ──────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 0.65rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  max-width: 90vw;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 700px) {
  body { padding: 1rem 0.85rem 3rem; }

  /* Landing: tighter top padding on small screens */
  #screen-landing { padding-top: 1rem; gap: 1.25rem; }
  .logo-text      { font-size: clamp(2rem, 10vw, 2.8rem); }
  .logo-glyph     { font-size: 2.8rem; }
  .landing-card   { padding: 1.5rem; }

  /* Lobby: stack to single column */
  .lobby-layout   { grid-template-columns: 1fr; }
  .lobby-right    { order: -1; } /* show avatar builder above player list */

  /* Game panels: stack vertically */
  .game-grid      { grid-template-columns: 1fr; }
  #panel-turn     { order: -1; } /* turn panel first */
  .game-topbar    { flex-direction: column; }
  .word-chip,
  .word-box       { min-width: unset; }

  /* Tighten cards */
  .card, .glass-card { padding: 1.25rem; }

  /* Code value */
  .code-value     { font-size: 1.6rem; letter-spacing: 5px; }

  /* Vote grid: 2 columns on narrow screens */
  .vote-grid      { grid-template-columns: repeat(2, 1fr); }

  /* Flip card: slightly smaller on phone */
  .flip-card      { width: 220px; height: 310px; }
  .flip-question  { font-size: 4.5rem; }

  /* Logo aliases */
  .logo      { font-size: 1.6rem; }
  .logo-icon { font-size: 2.5rem; }
}

@media (max-width: 400px) {
  .vote-grid { grid-template-columns: 1fr; }
  .lobby-layout { gap: 0.75rem; }
}

/* ── Mute button ───────────────────────────────────────────── */
.mute-btn {
  position: fixed !important;
  bottom: 1rem !important;
  right: 1rem !important;
  z-index: 9998;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  box-shadow: var(--shadow);
}

.mute-btn:hover { background: var(--bg-panel); border-color: var(--text-muted); }
.mute-btn.muted { opacity: 0.5; }

/* ── Elimination overlay ───────────────────────────────────── */
.elim-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 18, 0.96);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}


/* Overlay itself fades in */
.elim-overlay.anim-in {
  animation: elimOverlayIn 0.5s ease both;
}
.elim-overlay.anim-out {
  animation: elimOverlayOut 0.5s ease forwards;
}

@keyframes elimOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes elimOverlayOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Card centres all elements */
.elim-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  padding: 2rem 1rem;
  text-align: center;
  max-width: 420px;
  width: 100%;
}

/* ── Avatar wrap ── */
.elim-avatar-wrap {
  position: relative;
  width: 120px;
  height: 120px;
}

.elim-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, #42a5f5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(66,165,245,0.25), 0 0 40px rgba(66,165,245,0.2);
  overflow: hidden;
  padding: 0;
}

/* Step 1 — avatar bounces in */
.elim-avatar.anim-entry {
  animation: avatarEntry 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes avatarEntry {
  from { transform: scale(0) rotate(-30deg); opacity: 0; }
  to   { transform: scale(1) rotate(0);      opacity: 1; }
}

/* Step 2 — avatar shakes */
.elim-avatar.anim-shake {
  animation: avatarShake 0.55s ease both;
}

@keyframes avatarShake {
  0%,100% { transform: translateX(0) rotate(0); }
  15%     { transform: translateX(-14px) rotate(-6deg); }
  30%     { transform: translateX(14px)  rotate(6deg); }
  45%     { transform: translateX(-10px) rotate(-4deg); }
  60%     { transform: translateX(10px)  rotate(4deg); }
  75%     { transform: translateX(-5px)  rotate(-2deg); }
  90%     { transform: translateX(5px)   rotate(2deg); }
}

/* Step 3 — avatar dies (grayscale + tilt) */
.elim-avatar.anim-die {
  animation: avatarDie 0.7s ease forwards;
}

@keyframes avatarDie {
  0%   { transform: rotate(0) scale(1);    filter: saturate(1) brightness(1);   box-shadow: 0 0 0 4px rgba(66,165,245,0.25); }
  40%  { transform: rotate(15deg) scale(0.9); filter: saturate(0.3) brightness(0.7); }
  100% { transform: rotate(28deg) scale(0.75); filter: saturate(0) brightness(0.35); box-shadow: 0 0 0 4px rgba(255,58,92,0.3); }
}

/* Red pulse border at the moment of death */
.elim-avatar-wrap.anim-pulse::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid var(--danger);
  animation: deathPulse 0.6s ease forwards;
}

@keyframes deathPulse {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* Skull overlay */
.elim-skull {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.8rem;
  line-height: 1;
  pointer-events: none;
}

.elim-skull.anim-in {
  animation: skullPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes skullPop {
  from { transform: scale(0) rotate(-20deg); opacity: 0; }
  to   { transform: scale(1) rotate(0);      opacity: 1; }
}

/* ── Name ── */
.elim-name {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.5px;
  opacity: 0;
}

.elim-name.anim-in {
  animation: slideUp 0.4s ease both;
}

/* ── ELIMINATED stamp ── */
.elim-stamp {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--danger);
  border: 4px solid var(--danger);
  border-radius: 4px;
  padding: 0.2rem 1rem;
  opacity: 0;
  text-shadow: 0 0 20px rgba(255,58,92,0.6);
  box-shadow: 0 0 0 0 rgba(255,58,92,0.4), inset 0 0 20px rgba(255,58,92,0.08);
}

.elim-stamp.anim-in {
  animation: stampSlam 0.4s cubic-bezier(0.2, 0.8, 0.3, 1.2) both;
}

@keyframes stampSlam {
  0%   { opacity: 0; transform: rotate(-8deg) scale(3.5); }
  65%  { opacity: 1; transform: rotate(-8deg) scale(0.9); }
  82%  { transform: rotate(-8deg) scale(1.06); }
  100% { opacity: 1; transform: rotate(-8deg) scale(1); }
}

/* ── Verdict pill ── */
.elim-verdict {
  font-size: 1.25rem;
  font-weight: 800;
  padding: 0.65rem 1.75rem;
  border-radius: 50px;
  opacity: 0;
}

.elim-verdict.anim-in {
  animation: verdictPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes verdictPop {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

.elim-verdict.was-imposter {
  background: var(--danger-dim);
  border: 2px solid var(--danger);
  color: var(--danger);
}

.elim-verdict.was-innocent {
  background: var(--success-dim);
  border: 2px solid var(--success);
  color: var(--success);
}

/* ── Big team result ── */
.elim-result {
  font-size: 1.5rem;
  font-weight: 900;
  opacity: 0;
  letter-spacing: -0.5px;
}

.elim-result.anim-in {
  animation: resultBang 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes resultBang {
  0%   { opacity: 0; transform: scale(0.4) translateY(10px); }
  60%  { transform: scale(1.1) translateY(-2px); opacity: 1; }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.elim-result.team-win     { color: var(--success); }
.elim-result.imposter-win { color: var(--danger); }

/* ── Skip button ── */
.elim-skip {
  margin-top: 0.5rem;
  opacity: 0;
  transition: opacity 0.4s;
  font-size: 0.82rem;
}

.elim-skip.visible { opacity: 1; }

/* Utility */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Avatar Builder ──────────────────────────────────────────── */
.ab-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.ab-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.ab-row:first-child {
  padding-top: 0;
}

.ab-row-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent);
}

.ab-row-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.ab-opt {
  width: 44px;
  min-height: 52px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg-panel);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 3px;
  gap: 3px;
  transition: border-color 0.15s, transform 0.12s, background 0.15s;
  flex-shrink: 0;
  color: var(--text-muted);
}

.ab-opt:hover:not(.selected) {
  border-color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  transform: scale(1.07);
}

.ab-opt.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.ab-opt-label {
  font-size: 0.52rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  white-space: nowrap;
  line-height: 1;
  pointer-events: none;
}

.ab-opt.selected .ab-opt-label {
  color: var(--accent);
}

.ab-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, transform 0.12s;
}

.ab-swatch:hover:not(.selected) {
  transform: scale(1.14);
  border-color: var(--text-muted);
}

.ab-swatch.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Avatar SVG shared — clips to circle */
.avatar-svg {
  display: block;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Vote card: avatar sized to fill the button top area */
.vote-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

/* Turn avatar wrapper when using SVG */
.turn-avatar-svg-wrap {
  border-radius: 50%;
  overflow: hidden;
  line-height: 0;
}

/* Results screen: individual avatar + label column */
.result-avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 60px;
}

.result-avatar-svg {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.result-avatar-item.is-imposter .result-avatar-svg {
  outline: 3px solid var(--danger);
  outline-offset: 2px;
  border-radius: 50%;
}

.result-avatar-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.result-avatar-votes {
  font-size: 0.62rem;
  color: var(--text-muted);
}

/* Winner celebration bounce */
@keyframes celebrate {
  0%   { transform: scale(1)    rotate(0deg) translateY(0); }
  18%  { transform: scale(1.2)  rotate(-8deg) translateY(-10px); }
  36%  { transform: scale(1.15) rotate(7deg)  translateY(-8px); }
  54%  { transform: scale(1.1)  rotate(-4deg) translateY(-5px); }
  72%  { transform: scale(1.05) rotate(3deg)  translateY(-2px); }
  100% { transform: scale(1)    rotate(0deg) translateY(0); }
}

.celebrate {
  animation: celebrate 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s both;
}

/* ── Host controls wrapper ───────────────────────────────────── */
#host-controls {
  display: flex;
  flex-direction: column;
  gap: 0;
}

#host-controls #btn-start {
  margin-top: 1rem;
}

#host-controls .hint-text {
  margin-top: 0.5rem;
}

/* ── Host game-config panel ──────────────────────────────────── */
.host-config-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 1.25rem 1.25rem;
}

.config-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.config-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-muted);
}

.config-opts {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cfg-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 38px;
  min-width: 48px;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.cfg-btn:hover:not(.cfg-active) {
  border-color: var(--text-muted);
  color: var(--text);
}

.cfg-btn.cfg-active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
}

/* ── Round chip in game topbar ───────────────────────────────── */
.round-chip {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
}

/* ── Round points card (results screen) ──────────────────────── */
.round-points {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1rem 1.25rem 0.75rem;
  width: 100%;
}

.points-awarded-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.points-awarded-row:last-child { border-bottom: none; }

.pts-badge {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 900;
  color: var(--success);
}

.pts-badge.imposter-pts { color: var(--warning); }

/* ── Scoreboard (results screen) ─────────────────────────────── */
.scoreboard {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.score-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  counter-reset: score-rank;
}

.score-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-panel);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  counter-increment: score-rank;
}

.score-list li::before {
  content: counter(score-rank);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Gold first-place row */
.score-list li:first-child {
  background: rgba(255,215,64,0.07);
  border-color: rgba(255,215,64,0.25);
}

.score-list li:first-child::before {
  background: #ffd740;
  color: #1a1200;
}

.score-name {
  flex: 1;
  font-weight: 600;
}

.score-imp-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--danger);
  opacity: 0.8;
  margin-left: 0.35rem;
}

.score-pts {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--accent);
  min-width: 2.5ch;
  text-align: right;
}
