/* ═══════════════════════════ سهرة مافيا ═══════════════════════════
   One calm, warm, dark palette for everyone. Nothing in the game UI
   changes color or brightness based on a player's secret role.        */

:root {
  --bg: #0f1114;
  --bg-2: #13161b;
  --surface: #191c22;
  --surface-2: #20242c;
  --surface-3: #2a2f39;
  --line: rgba(240, 225, 195, 0.08);
  --line-2: rgba(240, 225, 195, 0.14);
  --text: #ede6d8;
  --text-2: #c2baa9;
  --muted: #8d877b;
  --gold: #d6ad62;
  --gold-2: #efd29b;
  --gold-a: rgba(214, 173, 98, 0.13);
  --sage: #86b39f;
  --rose: #d38a8f;
  --warn: #f0b3a3;
  --font: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --display: 'Reem Kufi', 'Readex Pro', system-ui, sans-serif;
  --glass: rgba(15, 17, 20, 0.76);
  --glass-strong: rgba(16, 18, 23, 0.92);
  --side-bg: rgba(19, 22, 27, 0.55);
  --scrim: rgba(11, 12, 15, 0.8);
  --scrim-soft: rgba(11, 12, 15, 0.55);
  --toast-bg: rgba(28, 31, 38, 0.96);
  --shadow: rgba(0, 0, 0, 0.45);
  --shadow-soft: rgba(0, 0, 0, 0.25);
  --card-bg: radial-gradient(120% 80% at 50% 0%, #272b34 0%, #1a1d24 55%, #14161b 100%);
  --card-mid: #1a1d24;
  --card-back: radial-gradient(90% 70% at 50% 45%, #1d2027, #121418);
  --card-btn: linear-gradient(160deg, #23272f, #181b21);
  --av-hi: 28%;
  --av-lo: 12%;
  --av-ink: 84%;
  --glow-a: rgba(214, 173, 98, 0.075);
  --glow-b: rgba(161, 66, 76, 0.06);
  color-scheme: dark;
}

/* White & gold — for players in a bright room. Same layout, same parity:
   every player still sees exactly the same colors as everyone else. */
:root[data-theme="light"] {
  --bg: #f6f2ea;
  --bg-2: #efe9de;
  --surface: #fffdf8;
  --surface-2: #f4eee3;
  --surface-3: #e6ddcc;
  --line: rgba(70, 52, 20, 0.1);
  --line-2: rgba(70, 52, 20, 0.18);
  --text: #221c13;
  --text-2: #51473a;
  --muted: #8a7f6d;
  --gold: #a87a2b;
  --gold-2: #85601f;
  --gold-a: rgba(168, 121, 44, 0.12);
  --sage: #3f7d64;
  --rose: #b0545c;
  --warn: #b0473a;
  --glass: rgba(255, 252, 246, 0.84);
  --glass-strong: rgba(255, 252, 246, 0.95);
  --side-bg: rgba(250, 246, 238, 0.85);
  --scrim: rgba(246, 242, 234, 0.88);
  --scrim-soft: rgba(246, 242, 234, 0.62);
  --toast-bg: rgba(255, 252, 246, 0.98);
  --shadow: rgba(90, 70, 30, 0.16);
  --shadow-soft: rgba(90, 70, 30, 0.1);
  --card-bg: radial-gradient(120% 80% at 50% 0%, #fffdf8 0%, #f7f0e2 55%, #efe5d1 100%);
  --card-mid: #f7f0e2;
  --card-back: radial-gradient(90% 70% at 50% 45%, #fbf6ec, #efe5d1);
  --card-btn: linear-gradient(160deg, #fffdf8, #f1e9da);
  --av-hi: 88%;
  --av-lo: 78%;
  --av-ink: 30%;
  --glow-a: rgba(214, 173, 98, 0.16);
  --glow-b: rgba(161, 66, 76, 0.05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 620px at 50% -12%, var(--glow-a), transparent 62%),
    radial-gradient(900px 520px at 100% 110%, var(--glow-b), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: rgba(214, 173, 98, 0.35); }
a { color: var(--gold-2); }
button, input, select, textarea { font-family: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid rgba(214, 173, 98, 0.7); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }

/* ─────────────── controls ─────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: 500 15px/1 var(--font);
  color: var(--text);
  background: none;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s, color 0.2s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }
.btn-gold {
  background: linear-gradient(180deg, #e7c47f, #c99b50);
  color: #1d160b;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(214, 173, 98, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-gold:hover:not(:disabled) { filter: brightness(1.05); box-shadow: 0 10px 30px rgba(214, 173, 98, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.btn-ghost { background: var(--surface-2); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { border-color: rgba(214, 173, 98, 0.45); color: var(--gold-2); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 17px; border-radius: 14px; }
.btn-xl { height: 58px; padding: 0 30px; font-size: 18px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn.loading { pointer-events: none; opacity: 0.7; }
.btn.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line); color: var(--gold-2); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn svg { width: 20px; height: 20px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { color: var(--text-2); font-size: 14px; }
input, select, textarea { color: var(--text); }
.field input, select {
  height: 48px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  font: 500 16px var(--font);
  padding: 0 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, select:focus { border-color: rgba(214, 173, 98, 0.6); box-shadow: 0 0 0 4px rgba(214, 173, 98, 0.12); }
select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-left: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d6ad62' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 10px center;
  background-size: 16px;
}
select:disabled { opacity: 0.65; cursor: default; }
option { background: var(--surface); color: var(--text); }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); transition: 0.2s; }
.switch i::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-2);
  transition: 0.2s;
}
.switch input:checked + i { background: rgba(214, 173, 98, 0.32); border-color: rgba(214, 173, 98, 0.6); }
.switch input:checked + i::after { transform: translateX(-18px); background: var(--gold-2); }
.switch input:disabled { cursor: default; }
.switch input:disabled + i { opacity: 0.6; }

.seg { display: inline-flex; flex-wrap: wrap; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 11px; padding: 3px; gap: 3px; }
.seg button {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: 500 13.5px var(--font);
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}
.seg button.on { background: var(--surface-3); color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(214, 173, 98, 0.35); }
.seg button:disabled { cursor: default; }

.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; }
.stepper button { width: 28px; height: 28px; border: 0; border-radius: 7px; background: var(--surface-2); color: var(--text); font-size: 17px; cursor: pointer; }
.stepper button:disabled { opacity: 0.35; cursor: default; }
.stepper b { min-width: 22px; text-align: center; color: var(--gold-2); }

.muted { color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.center { text-align: center; }
.kicker { color: var(--gold); font-size: 13px; letter-spacing: 0.28em; margin-bottom: 10px; }

/* ─────────────── brand ─────────────── */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-2);
  text-decoration: none;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
}
.brand svg { width: 36px; height: 36px; color: var(--gold); }
.brand.small { font-size: 16px; }
.brand.small svg { width: 24px; height: 24px; }

/* MAFIA — a gold pistol for the F — and NIGHT. White letters by night,
   ink letters by day; the gun stays gold. */
:root { --wm-ink: #ffffff; --wm-glow: rgba(0, 0, 0, 0.45); }
:root[data-theme="light"] { --wm-ink: #17130d; --wm-glow: rgba(90, 70, 30, 0.12); }
.wordmark { display: inline-flex; align-items: center; gap: 0.42em; font-family: 'Montserrat', 'Readex Pro', sans-serif; line-height: 1; white-space: nowrap; }
.wm-word { display: inline-flex; align-items: flex-start; font-weight: 900; letter-spacing: 0.01em; color: var(--wm-ink); text-shadow: 0 2px 12px var(--wm-glow); }
.wm-gun { display: inline-block; height: 1.02em; margin: 0.02em 0.03em -0.14em 0.06em; filter: drop-shadow(0 2px 6px rgba(214, 173, 98, 0.25)); }
.wordmark .wm-gun svg, .brand .wm-gun svg { display: block; width: auto; height: 100%; }
.wm-night { align-self: center; font-weight: 800; font-size: 0.4em; letter-spacing: 0.42em; color: var(--gold); }
.brand .wordmark { font-size: 25px; }
.brand.small .wordmark { font-size: 16px; }
.brand.mini .wordmark { font-size: 20px; }
.hero-logo { margin: 22px 0 18px; font-size: clamp(56px, 8.4vw, 112px); }
.hero-logo .wordmark { flex-direction: column; align-items: flex-start; gap: 0.12em; }
[dir="rtl"] .hero-logo .wordmark { align-items: flex-end; }
.hero-logo .wm-night { align-self: auto; font-size: 0.26em; letter-spacing: 0.9em; margin-inline-end: -0.9em; }
.auth-logo { font-size: 40px; }

/* ─────────────── role cards ─────────────── */

.card-static, .flip { position: relative; aspect-ratio: 5 / 7; container-type: inline-size; }
.rcard {
  position: absolute;
  inset: 0;
  border-radius: 7cqw;
  overflow: hidden;
  color: var(--gold);
  background: var(--card-bg);
  box-shadow: inset 0 0 0 1px rgba(214, 173, 98, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 50px var(--shadow);
}
.rc-frame {
  position: absolute;
  inset: 4.5cqw;
  border: 1px solid rgba(214, 173, 98, 0.42);
  border-radius: 4.5cqw;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6cqw 7cqw 5cqw;
}
.rc-frame::before {
  content: '';
  position: absolute;
  inset: 2cqw;
  border: 1px solid rgba(214, 173, 98, 0.15);
  border-radius: 3cqw;
  pointer-events: none;
}
.rc-corner {
  position: absolute;
  width: 4.5cqw;
  height: 4.5cqw;
  border: 1px solid rgba(214, 173, 98, 0.65);
  background: var(--card-mid);
  transform: rotate(45deg);
}
.rc-corner.c1 { top: -2.25cqw; left: calc(50% - 2.25cqw); }
.rc-corner.c2 { bottom: -2.25cqw; left: calc(50% - 2.25cqw); }
.rc-corner.c3 { top: calc(50% - 2.25cqw); left: -2.25cqw; }
.rc-corner.c4 { top: calc(50% - 2.25cqw); right: -2.25cqw; }
.rc-you { font-size: 5.6cqw; letter-spacing: 0.3em; color: var(--text-2); min-height: 1.4em; }
.rc-emblem {
  position: relative;
  width: 44cqw;
  aspect-ratio: 1;
  margin: 3.5cqw 0 4.5cqw;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: radial-gradient(circle, rgba(214, 173, 98, 0.15), rgba(214, 173, 98, 0) 68%);
  box-shadow: 0 0 0 1px rgba(214, 173, 98, 0.26);
}
.rc-emblem::after { content: ''; position: absolute; inset: -3cqw; border-radius: 50%; border: 1px dashed rgba(214, 173, 98, 0.22); }
.rc-emblem svg { width: 62%; height: 62%; color: var(--gold-2); }
.rc-name { font-family: var(--display); font-size: 11.5cqw; line-height: 1.15; color: var(--gold-2); font-weight: 600; }
.rc-rule { position: relative; width: 44%; height: 1px; margin: 4cqw 0 3.5cqw; background: linear-gradient(90deg, transparent, rgba(214, 173, 98, 0.65), transparent); flex: none; }
.rc-rule span { position: absolute; top: -1.4cqw; left: calc(50% - 1.4cqw); width: 2.8cqw; height: 2.8cqw; background: var(--gold); transform: rotate(45deg); }
.rcard .rc-desc { margin: 0; flex: 1; font-size: 5.4cqw; line-height: 1.65; color: var(--text-2); }
.rcard .rc-desc:empty { display: none; }
.rc-frame:has(.rc-desc:empty) { justify-content: center; }
.rc-frame:has(.rc-desc:empty) .rc-emblem { width: 52cqw; }
.rc-frame:has(.rc-desc:empty) .rc-name { font-size: 13cqw; }
.rc-frame.long .rc-emblem { width: 32cqw; margin: 2.5cqw 0 3cqw; }
.rc-frame.long .rc-rule { margin: 3cqw 0 2.5cqw; }
.rc-frame.long .rc-desc { font-size: 4.9cqw; line-height: 1.6; }
.rc-frame.xlong { padding-top: 4.5cqw; }
.rc-frame.xlong .rc-you { min-height: 1.2em; }
.rc-frame.xlong .rc-emblem { width: 24cqw; margin: 1.5cqw 0 2.5cqw; }
.rc-frame.xlong .rc-name { font-size: 10cqw; }
.rc-frame.xlong .rc-rule { margin: 2.5cqw 0 2cqw; }
.rc-frame.xlong .rc-desc { font-size: 4.45cqw; line-height: 1.55; }
.rcard .rc-team { width: 100%; padding-top: 3cqw; border-top: 1px solid rgba(214, 173, 98, 0.18); font-size: 4.9cqw; line-height: 1.5; color: var(--gold); }

.rcard-back { background: var(--card-back); }
.rc-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-size: 15cqw 15cqw;
  background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23d6ad62' stroke-opacity='.4' stroke-width='1'%3E%3Crect x='12' y='12' width='16' height='16'/%3E%3Crect x='12' y='12' width='16' height='16' transform='rotate(45 20 20)'/%3E%3Cpath d='M0 20h3M37 20h3M20 0v3M20 37v3'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 24%, #000 62%);
  mask-image: radial-gradient(circle at 50% 50%, transparent 24%, #000 62%);
}
.rcard-back .rc-frame { justify-content: center; gap: 4cqw; }
.rc-back-logo { width: 40cqw; color: var(--gold); filter: drop-shadow(0 0 6cqw rgba(214, 173, 98, 0.25)); }
.rc-back-logo svg { width: 100%; height: auto; }
.rc-back-brand { font-family: var(--display); font-size: 9.5cqw; color: var(--gold-2); }

.flip { perspective: 1400px; }
.flip-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 1s cubic-bezier(0.2, 0.75, 0.2, 1); }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip .rcard { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip .rcard-front { transform: rotateY(180deg); }

/* ─────────────── home ─────────────── */

.home { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px; border: 1px solid transparent; color: var(--text-2); text-decoration: none; font-size: 15px; white-space: nowrap; transition: color 0.2s, background 0.2s, border-color 0.2s; }
.nav-links a svg { width: 17px; height: 17px; flex: none; }
.nav-links a:hover { color: var(--gold-2); background: var(--gold-a); }
.nav-links a.on { color: var(--gold-2); border-color: rgba(214, 173, 98, 0.35); background: var(--gold-a); }
.nav-links a.nav-premium { color: var(--gold-2); }
.nav-links a.nav-discord { color: #8b95ff; }
.nav-links a.nav-discord:hover { color: #fff; background: #5865f2; }

/* Public sessions page */
.sessions-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: -18px 0 26px; }
.sessions { display: grid; gap: 10px; }
.session { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.session.busy { opacity: 0.7; }
.ss-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ss-main b { font-size: 16px; }
.ss-main small { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.ss-main small svg { width: 14px; height: 14px; }
.session .btn { text-decoration: none; }
.sessions-empty { text-align: center; padding: 30px 0; }
.nav-links a.nav-sessions { color: var(--sage); }
.pj-privacy { display: grid; grid-template-columns: 1fr 1fr; }
.pj-privacy button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pj-privacy svg { width: 16px; height: 16px; }

/* Extra time: the five-second question, half a screen. */
.extra-ask { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(8, 9, 12, 0.55); backdrop-filter: blur(3px); animation: fade-in 0.2s ease; }
.ea-card { width: min(520px, 100%); padding: 28px 24px 22px; border-radius: 24px; text-align: center; background: linear-gradient(180deg, rgba(214, 173, 98, 0.12), var(--surface) 50%); border: 1px solid rgba(214, 173, 98, 0.45); box-shadow: 0 30px 90px var(--shadow); }
.ea-ic { width: 58px; height: 58px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 18px; background: var(--gold-a); color: var(--gold-2); }
.ea-ic svg { width: 30px; height: 30px; }
.ea-card h2 { margin: 0 0 8px; font: 600 clamp(24px, 4vw, 32px) var(--display); color: var(--gold-2); }
.ea-card p { margin: 0 0 18px; color: var(--text-2); line-height: 1.8; }
.ea-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ea-bar { height: 4px; margin-top: 18px; border-radius: 4px; background: var(--line); overflow: hidden; }
.ea-bar i { display: block; height: 100%; background: var(--gold); animation: ea-time 5s linear forwards; }
@keyframes ea-time { from { width: 100%; } to { width: 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.voters .forced { color: var(--rose); font-weight: 600; }
/* Live site: pictures can't be dragged out, long-pressed or selected. */
html.guarded img, html.guarded video, html.guarded svg { -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }
html.no-lang .g-lang { display: none; }
html.no-lang .admin .g-lang { display: inline-flex; }
.rec-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 9px 11px; border-radius: 12px; background: var(--gold-a); border: 1px solid rgba(214, 173, 98, 0.3); font-size: 13px; line-height: 1.7; color: var(--text-2); }
.rec-note svg { width: 15px; height: 15px; flex: none; margin-top: 4px; color: var(--gold); }
.rec-note b { color: var(--text); font-weight: 600; }
.rec-note a { display: inline-block; margin-inline-start: 4px; color: var(--gold-2); }
.premium-mark { display: inline-block; margin-inline-start: 4px; color: var(--gold); font-size: 0.85em; text-shadow: 0 0 8px rgba(214, 173, 98, 0.5); }

/* Site pages: guide & premium */
.page { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.page-hero { text-align: center; max-width: 760px; margin: 0 auto; padding: 56px 0 60px; }
.page-hero h1 { font-family: var(--display); font-size: clamp(34px, 5vw, 56px); font-weight: 600; margin: 0 0 14px; line-height: 1.25; }
.lead { color: var(--text-2); font-size: 17px; line-height: 1.9; margin: 0 auto; max-width: 620px; }
.section.narrow { max-width: 920px; margin: 0 auto; }
.hero-actions.center { justify-content: center; margin-top: 26px; }
.btn-discord { background: #5865f2; color: #fff; border: 0; text-decoration: none; }
.btn-discord:hover:not(:disabled) { background: #4752c4; color: #fff; }
.page section[id] { scroll-margin-top: 16px; }
.how-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.how-steps li { display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; }
.how-steps .step-n { font-size: 36px; text-align: center; }
.how-steps h3 { margin: 2px 0 6px; font-size: 18px; font-weight: 600; }
.how-steps p { margin: 0; color: var(--text-2); line-height: 1.85; font-size: 15px; }
/* Info pages (/cards, /how, /tips): one subject each, nothing else on the page. */
.section.info { border-top: 0; padding-top: 48px; }
.section.info .section-head h1 { font-family: var(--display); font-size: clamp(34px, 4.5vw, 50px); margin: 0 0 12px; font-weight: 600; }
.tips-h { font-family: var(--display); font-size: 28px; font-weight: 600; text-align: center; margin: 56px 0 20px; }
.sets-note { display: flex; gap: 8px; align-items: center; justify-content: center; margin: -26px auto 22px; max-width: 620px; padding: 9px 14px; border-radius: 999px; background: var(--gold-a); color: var(--text-2); font-size: 14px; text-align: center; }
.sets-note svg { width: 16px; height: 16px; flex: none; color: var(--gold); }
.sets-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.sets { width: 100%; border-collapse: collapse; min-width: 560px; }
.sets th, .sets td { padding: 14px 16px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sets tr:last-child td { border-bottom: 0; }
.sets th { color: var(--muted); font-weight: 500; font-size: 13px; }
.sets td b { font-size: 18px; color: var(--gold-2); }
.role-chip { display: inline-flex; align-items: center; gap: 5px; margin: 3px; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 13px; border: 1px solid var(--line); background: var(--bg-2); white-space: nowrap; }
.role-chip svg { width: 16px; height: 16px; }
.role-chip.mafia { color: var(--rose); border-color: rgba(208, 102, 79, 0.35); }
.role-chip.town { color: var(--sage); border-color: rgba(120, 170, 130, 0.35); }
.sets-rest { display: inline-block; margin: 3px 6px; color: var(--muted); font-size: 13px; }
.tips { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.tips li { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); line-height: 1.8; color: var(--text-2); }
.tips svg { width: 18px; height: 18px; flex: none; margin-top: 4px; color: var(--gold); }
.premium-hero .kicker { font-size: 22px; letter-spacing: 0; margin: 14px 0 10px; }
.pm-crown.big { width: 78px; height: 78px; border-radius: 24px; }
.pm-crown.big svg { width: 40px; height: 40px; }
.pm-price.big { margin-top: 20px; }
.pm-price.big b { font-size: 56px; }
.you-premium { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 8px 14px; border-radius: 999px; background: rgba(120, 170, 130, 0.14); color: var(--sage); }
.you-premium svg { width: 18px; height: 18px; }
.perk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.perk { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); border-radius: 20px; padding: 22px 20px; }
.perk-ic { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--gold-a); color: var(--gold-2); }
.perk-ic svg { width: 24px; height: 24px; }
.perk h3 { margin: 14px 0 6px; font-size: 18px; font-weight: 600; }
.perk p { margin: 0; color: var(--text-2); line-height: 1.8; font-size: 14.5px; }
.cmp { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.cmp th, .cmp td { padding: 14px 18px; border-bottom: 1px solid var(--line); text-align: center; }
.cmp td:first-child, .cmp th:first-child { text-align: start; color: var(--text); }
.cmp tr:last-child td { border-bottom: 0; }
.cmp th { font-weight: 600; color: var(--text-2); }
.cmp .gold { color: var(--gold-2); background: rgba(214, 173, 98, 0.06); }
.cmp th.gold { display: table-cell; }
.cmp th.gold svg { width: 16px; height: 16px; vertical-align: -3px; margin-inline-end: 5px; }
.cmp-yes svg { width: 20px; height: 20px; color: var(--sage); vertical-align: middle; }
.cmp-no { color: var(--muted); }
.buy-panel { padding: 18px; }
.buy-panel .pm-steps { background: none; border: 0; padding-block: 0; font-size: 15.5px; gap: 14px; }
.pm-steps { list-style: none; padding-inline-start: 14px; counter-reset: pm; }
.pm-steps li { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-inline-start: 30px; counter-increment: pm; }
.pm-steps li::before { content: counter(pm); position: absolute; inset-inline-start: 0; top: 2px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--gold-a); color: var(--gold-2); font-size: 12.5px; font-weight: 700; }
.pm-steps .btn { flex: none; text-decoration: none; }
.pm-more { align-self: center; font-size: 13.5px; }
.faq { display: grid; gap: 10px; }
.faq details { padding: 0; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 600; list-style-position: inside; }
.faq details p { margin: 0; padding: 0 18px 16px; color: var(--text-2); line-height: 1.85; }
.page .cta-band { margin-bottom: 40px; }

.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; min-height: calc(100vh - 90px); padding: 20px 0 70px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(214, 173, 98, 0.28);
  background: var(--gold-a);
  color: var(--gold-2);
  font-size: 14px;
}
.eyebrow svg { width: 16px; height: 16px; }
.hero-title { font-family: var(--display); font-size: clamp(60px, 9vw, 124px); line-height: 1.02; margin: 22px 0 18px; font-weight: 700; letter-spacing: -0.01em; }
.hero-title span { background: linear-gradient(180deg, #f7e0b0, #c7974a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: clamp(17px, 1.6vw, 20px); color: var(--text-2); line-height: 1.9; max-width: 34em; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 32px; }
.join-code { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 5px; height: 58px; }
.join-code input { width: 150px; height: 100%; background: transparent; border: 0; outline: none; text-align: center; font: 600 17px var(--font); letter-spacing: 0.25em; text-transform: uppercase; }
.join-code input::placeholder { letter-spacing: 0; font-weight: 400; color: var(--muted); text-transform: none; }
.join-code .btn { height: 46px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 30px; color: var(--muted); font-size: 14px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta svg { width: 17px; height: 17px; color: var(--gold); }

.hero-art { position: relative; height: min(580px, 72vh); }
.hero-glow { position: absolute; inset: 15% 10%; border-radius: 50%; background: radial-gradient(circle, rgba(214, 173, 98, 0.16), transparent 65%); filter: blur(20px); z-index: -1; }
.fan { position: absolute; inset: 0; animation: float 7s ease-in-out infinite; }
.fan-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(150px, 15.5vw, 210px);
  margin-left: calc(clamp(150px, 15.5vw, 210px) / -2);
  margin-top: calc(clamp(150px, 15.5vw, 210px) * -0.7);
  transform-origin: 50% 160%;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fan-card.f0 { transform: rotate(-30deg); }
.fan-card.f1 { transform: rotate(-15deg); }
.fan-card.f2 { transform: translateY(-18px); z-index: 3; }
.fan-card.f3 { transform: rotate(15deg); }
.fan-card.f4 { transform: rotate(30deg); }
.f0, .f4 { z-index: 1; }
.f1, .f3 { z-index: 2; }
.hero-art:hover .fan-card.f0 { transform: rotate(-38deg); }
.hero-art:hover .fan-card.f1 { transform: rotate(-19deg); }
.hero-art:hover .fan-card.f3 { transform: rotate(19deg); }
.hero-art:hover .fan-card.f4 { transform: rotate(38deg); }

.section { padding: 90px 0; border-top: 1px solid var(--line); }
.section-head { text-align: center; max-width: 660px; margin: 0 auto 48px; }
.section-head h2 { font-family: var(--display); font-size: clamp(32px, 4vw, 46px); margin: 0 0 12px; font-weight: 600; }
.section-head p { color: var(--text-2); line-height: 1.85; margin: 0; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px 22px; }
.step-n { display: block; font-family: var(--display); font-size: 42px; line-height: 1; color: var(--gold); }
.steps h3 { font-size: 18px; margin: 16px 0 8px; font-weight: 600; }
.steps p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.8; }

.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.role-tile { display: flex; align-items: center; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; transition: border-color 0.3s, transform 0.3s; }
.role-tile:hover { border-color: rgba(214, 173, 98, 0.3); transform: translateY(-2px); }
.role-tile .card-static { width: 108px; flex: none; }
.role-team { font-size: 12px; letter-spacing: 0.08em; }
.role-team.mafia { color: var(--rose); }
.role-team.town { color: var(--sage); }
.role-tile h3 { font-family: var(--display); font-size: 22px; margin: 4px 0 6px; color: var(--gold-2); font-weight: 600; }
.role-tile p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.75; }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); border-radius: 20px; padding: 26px 22px; }
.feature-ic { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; margin-bottom: 18px; color: var(--gold-2); background: var(--gold-a); border: 1px solid rgba(214, 173, 98, 0.25); }
.feature-ic svg { width: 28px; height: 28px; }
.feature h3 { font-size: 18px; margin: 0 0 8px; font-weight: 600; }
.feature p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.85; }

.cta-band {
  text-align: center;
  padding: 80px 24px;
  margin: 10px 0 40px;
  border-radius: 28px;
  border: 1px solid var(--line-2);
  background: radial-gradient(600px 300px at 50% 0%, rgba(214, 173, 98, 0.14), transparent 70%), var(--surface);
}
.cta-band h2 { font-family: var(--display); font-size: clamp(32px, 4vw, 48px); margin: 0 0 10px; }
.cta-band p { color: var(--text-2); margin: 0 0 28px; }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* ─────────────── pre-join (camera check) ─────────────── */

.prejoin { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 90px 24px 40px; }
.brand.corner { position: absolute; top: 22px; right: 24px; }
.pj { display: grid; grid-template-columns: 1.25fr 1fr; gap: 44px; width: min(1080px, 100%); align-items: center; }
.pj-video { position: relative; aspect-ratio: 4 / 3; border-radius: 24px; overflow: hidden; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 30px 80px var(--shadow); }
.pj-video video { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 0.4s; }
.pj-video[data-state="ok"] video { opacity: 1; }
.mirror { transform: scaleX(-1); }
.pj-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 30px; text-align: center; color: var(--text-2); line-height: 1.8; }
.pj-empty p { margin: 0; max-width: 30em; }
.pj-video[data-state="ok"] .pj-empty { display: none; }
.pj-video[data-state="loading"] .pj-empty .btn { display: none; }
.pj-empty-ic { width: 66px; height: 66px; border-radius: 18px; display: grid; place-items: center; background: var(--gold-a); color: var(--gold-2); }
.pj-empty-ic svg { width: 32px; height: 32px; }
.pj-video[data-state="loading"] .pj-empty-ic { animation: pulse 1.4s infinite; }
.pj-video[data-state="error"] .pj-empty-ic { background: rgba(208, 102, 79, 0.14); color: var(--warn); }
.pj-meter { position: absolute; bottom: 14px; inset-inline-end: 14px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: rgba(10, 11, 14, 0.62); backdrop-filter: blur(8px); color: var(--text-2); }
.pj-meter svg { width: 16px; height: 16px; }
.pj-meter .bar { width: 90px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.pj-meter .bar i { display: block; height: 100%; background: linear-gradient(270deg, var(--gold), var(--gold-2)); transform-origin: right; transform: scaleX(0); transition: transform 0.08s linear; }
.pj-video:not([data-state="ok"]) .pj-meter { display: none; }
.pj-devices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.pj-video:not([data-state="ok"]) + .pj-devices { visibility: hidden; }
.pj-devices label { display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 0; }
.pj-devices label > span svg { width: 18px; height: 18px; }
.pj-devices select { flex: 1; min-width: 0; height: 42px; font-size: 13.5px; }
.pj-form h1 { font-family: var(--display); font-size: clamp(32px, 4vw, 46px); margin: 6px 0 10px; font-weight: 600; }
.pj-room { color: var(--text-2); margin: 0 0 26px; line-height: 1.75; }
.pj-room b { color: var(--gold-2); letter-spacing: 0.15em; }
.bad { color: #e9a08f; }
.checks { list-style: none; padding: 0; margin: 18px 0; display: flex; gap: 20px; color: var(--muted); font-size: 14px; }
.checks li { display: flex; align-items: center; gap: 8px; }
.checks li i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04); }
.checks li.ok { color: var(--text); }
.checks li.ok i { background: var(--sage); box-shadow: 0 0 0 3px rgba(134, 179, 159, 0.18); }
.checks li.bad i { background: #d0664f; box-shadow: 0 0 0 3px rgba(208, 102, 79, 0.18); }
.pj-error { min-height: 1.6em; margin: 10px 0 0; color: #e9a08f; font-size: 14px; line-height: 1.65; }
.pj-note { display: flex; gap: 10px; margin: 18px 0 14px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; line-height: 1.8; }
.pj-note svg { width: 16px; height: 16px; flex: none; margin-top: 4px; color: var(--gold); }

/* ─────────────── room layout ─────────────── */

.room {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "top top" "banner banner" "stage side" "dock side";
}

.topbar {
  grid-area: top;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(10px);
  z-index: 5;
}
.tb-start { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tb-center { display: flex; align-items: center; justify-content: center; gap: 16px; min-width: 0; }
.tb-end { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
/* The background-sound volume: a small slider under the music button. */
.amb-ctl { position: relative; display: inline-flex; }
.amb-pop { position: absolute; top: calc(100% + 8px); inset-inline-end: -8px; z-index: 40; display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 14px 40px var(--shadow); }
.amb-pop[hidden] { display: none; }
.amb-pop input[type="range"] { width: 130px; height: 6px; border-radius: 6px; appearance: none; -webkit-appearance: none; background: linear-gradient(to right, var(--gold) var(--fill, 80%), var(--line-2) var(--fill, 80%)); cursor: pointer; }
[dir="rtl"] .amb-pop input[type="range"] { direction: ltr; }
.amb-pop input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--gold-2); border: 2px solid var(--surface); box-shadow: 0 1px 4px var(--shadow); }
.amb-pop input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--gold-2); border: 2px solid var(--surface); }
.amb-pct { min-width: 38px; font-size: 12.5px; font-weight: 600; color: var(--text-2); text-align: center; }
.host-ctl { display: flex; gap: 2px; padding-inline-end: 6px; margin-inline-end: 4px; border-inline-end: 1px solid var(--line); }
.host-ctl:empty { display: none; }
.brand.mini svg { width: 34px; height: 34px; }
.room-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font: 500 13px var(--font);
  cursor: pointer;
  transition: border-color 0.2s;
}
.room-code:hover { border-color: rgba(214, 173, 98, 0.45); }
.room-code b { color: var(--gold-2); letter-spacing: 0.18em; font-size: 14px; }
.room-code svg { width: 15px; height: 15px; }
.phase { text-align: center; min-width: 0; }
.phase-title { font-family: var(--display); font-size: 22px; line-height: 1.25; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phase-sub { margin-top: 2px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.timer { position: relative; width: 54px; height: 54px; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tr-bg { fill: none; stroke: var(--surface-3); stroke-width: 3.5; }
.tr-fg { fill: none; stroke: var(--gold); stroke-width: 3.5; stroke-linecap: round; transition: stroke-dashoffset 0.25s linear; }
.timer-txt { position: absolute; inset: 0; display: grid; place-items: center; direction: ltr; font: 600 14px var(--font); font-variant-numeric: tabular-nums; }
.timer.low { animation: beat 1s ease-in-out infinite; }
.timer.low .tr-fg { stroke: var(--gold-2); }
.timer.paused { opacity: 0.55; }

.banner { grid-area: banner; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px; font-size: 14px; background: rgba(214, 173, 98, 0.12); color: var(--gold-2); border-bottom: 1px solid rgba(214, 173, 98, 0.2); }
.banner.warn { background: rgba(208, 102, 79, 0.14); color: var(--warn); border-color: rgba(208, 102, 79, 0.25); }

.stage { grid-area: stage; position: relative; min-height: 0; padding: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; overflow: hidden; }
.grid { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: var(--gap, 10px); width: 100%; margin: 0 auto; flex: none; }

/* ── night board: the names the awake role picks from (same for everyone) ── */
.night-board {
  flex: none;
  width: min(780px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--glass-strong);
  border: 1px solid var(--line-2);
  box-shadow: 0 24px 70px var(--shadow);
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nb-steps { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--muted); }
.nb-steps i { width: 12px; height: 1px; background: var(--line-2); }
.ns { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); }
.ns.on { color: var(--gold-2); border-color: rgba(214, 173, 98, 0.5); background: var(--gold-a); }
.ns.done { color: var(--text-2); }
.nb-head-title { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: clamp(20px, 2.6vw, 28px); font-weight: 600; text-align: center; }
.nb-head-title svg { width: 26px; height: 26px; color: var(--gold); flex: none; }
.nb-sub { margin: 0; color: var(--text-2); font-size: 14px; text-align: center; }
.nb-names { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.nb-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
  font: 500 14px var(--font);
  text-align: start;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.nb-name:hover:not(.off) { border-color: rgba(214, 173, 98, 0.55); transform: translateY(-1px); }
.nb-name.on { border-color: var(--gold-2); background: rgba(214, 173, 98, 0.12); box-shadow: 0 0 0 3px rgba(214, 173, 98, 0.18); }
.nb-name.off { cursor: default; }
.nb-name.blocked { opacity: 0.38; border-style: dashed; }
.nb-av, .as-av { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 600 13px var(--display); color: hsl(var(--h) 45% 85%); background: hsl(var(--h) 28% 28%); }
.nb-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-nm small, .as-nm small { color: var(--muted); }
.nb-tag { width: 100%; display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--gold); }
.nb-tag svg { width: 12px; height: 12px; }
.nb-foot { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; }
.answer { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 18px; border-radius: 14px; border: 1px solid rgba(214, 173, 98, 0.4); background: var(--gold-a); color: var(--text-2); text-align: center; font-size: 14px; }
.answer-big { font-family: var(--display); font-size: 22px; color: var(--gold-2); }
.answer-big b { color: var(--text); }

/* ── narrator subtitles ── */
.subtitle {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 8;
  width: max-content;
  max-width: min(720px, 92%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-radius: 14px;
  background: var(--glass-strong);
  border: 1px solid rgba(214, 173, 98, 0.3);
  box-shadow: 0 12px 30px var(--shadow);
  font-size: 15px;
  line-height: 1.7;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s;
}
.subtitle.show { opacity: 1; transform: translate(-50%, 0); }
.sub-who { flex: none; display: inline-flex; align-items: center; gap: 5px; color: var(--gold); font-size: 12px; }
.sub-who svg { width: 14px; height: 14px; }
.icon-btn.off { color: var(--muted); }

/* ── camera tiles ── */

.tile {
  position: relative;
  width: var(--tile-w, 240px);
  aspect-ratio: var(--ar, 4 / 3);
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), 0 10px 30px var(--shadow-soft);
  transition: box-shadow 0.3s, transform 0.3s, opacity 0.3s;
}
.tile-media { position: absolute; inset: 0; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s, filter 0.8s; }
.tile.has-video video { opacity: 1; }
.tile.me:not(.no-mirror) video { transform: scaleX(-1); }
.tile-avatar { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, hsl(var(--h) 28% var(--av-hi)), hsl(var(--h) 22% var(--av-lo))); }
.tile-avatar span {
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 calc(var(--tile-w, 240px) * 0.12) / 1 var(--display);
  color: hsl(var(--h) 45% var(--av-ink));
  background: hsl(var(--h) 28% 50% / 0.25);
  box-shadow: 0 0 0 1px hsl(var(--h) 40% 60% / 0.25);
}
.tile-top { position: absolute; top: 8px; right: 8px; left: 8px; z-index: 3; display: flex; flex-wrap: wrap; gap: 5px; pointer-events: none; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(12, 13, 16, 0.7);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}
.badge svg { width: 14px; height: 14px; flex: none; }
.badge.role { color: var(--gold-2); border-color: rgba(214, 173, 98, 0.35); }
.badge.pick { background: rgba(214, 173, 98, 0.9); color: #1d160b; border-color: transparent; font-weight: 600; }
.badge.warn { color: var(--warn); }
.tile-foot { position: absolute; bottom: 8px; right: 8px; left: 8px; z-index: 3; display: flex; pointer-events: none; }
.tile-name { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 30px; padding: 0 10px; border-radius: 999px; background: rgba(12, 13, 16, 0.68); backdrop-filter: blur(6px); font-size: 13.5px; font-weight: 500; }
.tile-name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-name .crown svg { width: 14px; height: 14px; color: var(--gold); }
.tile-name .you { font-size: 11px; color: var(--muted); }
.mic-ind svg { width: 14px; height: 14px; color: var(--muted); }
.mic-ind.on svg { color: var(--gold-2); }
.tile-stamp { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; }
.stamp { display: flex; flex-direction: column; align-items: center; gap: 4px; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); }
.stamp svg { width: 34px; height: 34px; color: var(--text-2); }
.stamp span { font-family: var(--display); font-size: 20px; }
.stamp small { font-size: 12px; color: var(--text-2); }
.stamp.soft span { font-family: var(--font); font-size: 13px; padding: 6px 12px; border-radius: 999px; background: rgba(12, 13, 16, 0.65); }
.tile-votes { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 90%; pointer-events: none; }
.vote-count {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 24px var(--font);
  color: #1d160b;
  background: radial-gradient(circle at 40% 30%, #f4dba9, #c99b50);
  box-shadow: 0 8px 22px var(--shadow), 0 0 0 4px rgba(214, 173, 98, 0.22);
  animation: pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
.voters { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.tile { container-type: inline-size; }
@container (max-width: 260px) {
  .tile-stamp { align-items: start; padding-top: 14%; }
  .stamp svg { width: 22px; height: 22px; }
  .stamp span { font-size: 15px; }
  .stamp small { display: none; }
  .voters { display: none; }
  .vote-count { width: 42px; height: 42px; font-size: 20px; }
  .tile-votes { top: 44%; }
}
@container (max-width: 190px) {
  .tile-top .badge:not(.pick) { display: none; }
  .tile-name { height: 22px; padding: 0 7px; font-size: 11px; gap: 4px; }
  .tile-name .you, .mic-ind { display: none; }
}
.voters span { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: rgba(12, 13, 16, 0.75); }
.tile-host { position: absolute; bottom: 8px; inset-inline-end: 8px; z-index: 5; display: flex; gap: 4px; opacity: 0; transition: opacity 0.2s; }
.tile:hover .tile-host, .tile:focus-within .tile-host { opacity: 1; }
.tile-host button { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line-2); background: rgba(12, 13, 16, 0.8); color: var(--text-2); cursor: pointer; }
.tile-host button:hover { color: var(--gold-2); border-color: rgba(214, 173, 98, 0.5); }
.tile-host button svg { width: 15px; height: 15px; }

.tile.speaking { box-shadow: 0 0 0 3px var(--gold), 0 0 0 8px rgba(214, 173, 98, 0.16), 0 14px 40px rgba(214, 173, 98, 0.16); }
.tile::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3; box-shadow: inset 0 0 0 2px rgba(239, 210, 155, 0); transition: box-shadow 0.15s; }
.tile.talking::after { box-shadow: inset 0 0 0 2px rgba(239, 210, 155, 0.85); }
.tile.selectable { cursor: pointer; }
.tile.selectable:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px rgba(214, 173, 98, 0.55), 0 14px 34px var(--shadow); }
.tile.selected, .tile.selected:hover { box-shadow: 0 0 0 3px var(--gold-2), 0 0 0 8px rgba(214, 173, 98, 0.2); }
.tile.dimmed { opacity: 0.5; }
.tile.tied { box-shadow: 0 0 0 2px rgba(214, 173, 98, 0.75); }
.tile.dead video { filter: grayscale(1) blur(16px) brightness(0.5); }
.tile.dead .tile-avatar { filter: grayscale(1) brightness(0.55); }
.tile.dead .tile-avatar span { opacity: 0; }
/* Veiled = this camera isn't being sent to me (night, or a ghost by day).
   What's left is a frozen frame, so blur it out and say why. */
.tile.veiled video { filter: blur(22px) brightness(0.45) saturate(0.5); }
.tile.veiled.dead video { filter: grayscale(1) blur(22px) brightness(0.4); }
.tile.sleeping::before { content: ''; position: absolute; inset: 0; z-index: 1; background: radial-gradient(circle at 50% 45%, rgba(24, 27, 36, 0.35), rgba(10, 11, 14, 0.78)); pointer-events: none; }
.tile.sleeping .tile-avatar span { opacity: 0; }
.stamp.sleep svg { width: 30px; height: 30px; color: var(--gold-2); }
.stamp.sleep span { font-size: 16px; color: var(--text-2); }
.tile.offline video { opacity: 0.25; }
.tile.spectator { opacity: 0.7; }
.tile.drawing { animation: roulette 1.2s ease-in-out infinite; animation-delay: calc(var(--draw-i, 0) * 0.3s); }
.tile.nope { animation: nope 0.35s; }

/* ── side panel ── */

.side { grid-area: side; min-height: 0; overflow-y: auto; border: 0; border-inline-start: 1px solid var(--line); background: var(--side-bg); }
.side-inner { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.side-toggle { display: none; }
.side-scrim { display: none; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.panel-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 600; color: var(--gold-2); }
.panel-head h3 svg { width: 18px; height: 18px; }
.auto { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.team-label { margin: 12px 0 2px; font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }
.role-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.role-row:last-of-type { border-bottom: 0; }
.rr-em { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--gold-a); color: var(--gold-2); }
.rr-em svg { width: 22px; height: 22px; }
.rr-name { flex: 1; display: flex; flex-direction: column; font-size: 14px; min-width: 0; }
.rr-name small { color: var(--muted); font-size: 12px; }
.rr-ctl { flex: none; }
.fixed { font-size: 12px; color: var(--muted); }
.count { display: inline-block; min-width: 28px; text-align: center; color: var(--gold-2); }
.comp-sum { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); font-size: 13.5px; color: var(--text-2); text-align: center; line-height: 1.6; }
.comp-sum b { color: var(--gold-2); }
.comp-sum.err { color: var(--warn); background: rgba(208, 102, 79, 0.1); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 14px; }
.set-row > span { display: flex; flex-direction: column; gap: 2px; }
.set-row small { color: var(--muted); font-size: 12px; }
.set-row select { height: 36px; width: 128px; font-size: 13.5px; padding-right: 10px; }
.set-col { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 8px; font-size: 14px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.comp { display: flex; flex-direction: column; gap: 6px; }
.comp-item { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.comp-item .rr-em { width: 30px; height: 30px; }
.comp-item .rr-em svg { width: 19px; height: 19px; }
.comp-item b { margin-inline-start: auto; color: var(--gold-2); }
.secret { margin: 8px 0 0; font-size: 14px; line-height: 1.85; color: var(--text-2); }
.secret b { color: var(--text); }
.secret small { color: var(--muted); }
.secret-role { display: flex; align-items: center; gap: 10px; }
.secret-role b { font-family: var(--display); font-size: 19px; color: var(--gold-2); font-weight: 600; }
.answers { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.answers li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); font-size: 13.5px; }
.answers li span { color: var(--muted); font-size: 12px; }
.answers li em { margin-inline-start: auto; font-style: normal; color: var(--gold-2); }
.log { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.log li { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); font-size: 13.5px; line-height: 1.75; color: var(--text-2); }
.log li:last-child { border-bottom: 0; padding-bottom: 0; }
.log b { color: var(--text); font-weight: 500; }
.log small { color: var(--muted); }
.log-when { color: var(--gold); font-size: 12px; }

/* ── dock ── */

.dock {
  grid-area: dock;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "card main note mic";
  align-items: stretch;
  gap: 14px;
  min-height: 132px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(10px);
}
.dock-card {
  grid-area: card;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 14px;
  border: 1px solid rgba(214, 173, 98, 0.3);
  background: var(--card-btn);
  color: var(--gold-2);
  font: 500 13px var(--font);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.dock-card:hover { border-color: rgba(214, 173, 98, 0.6); transform: translateY(-2px); }
.dc-mini svg { width: 30px; height: 30px; }
.dock-main { grid-area: main; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; }
.is-lobby .dock-main { flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.dock-title { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 19px; font-weight: 600; }
.dock-title svg { width: 20px; height: 20px; color: var(--gold); flex: none; }
.dock-text { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--text-2); }
.dock-text b { color: var(--gold-2); font-weight: 600; }
.dock-flag { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dock-flag svg { width: 16px; height: 16px; flex: none; }
.dock-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--gold-2); }
.dock-line svg { width: 16px; height: 16px; }
.dock-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.speaker-row { display: flex; align-items: center; gap: 14px; }
.sp-avatar { width: 48px; height: 48px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 600 20px var(--display); color: hsl(var(--h) 45% 85%); background: hsl(var(--h) 28% 26%); box-shadow: 0 0 0 3px var(--gold), 0 0 0 7px rgba(214, 173, 98, 0.15); }
.sp-copy { flex: 1; min-width: 0; }
.queue { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.chip { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.vote-meter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.progress { flex: 1; max-width: 260px; min-width: 120px; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(270deg, var(--gold), var(--gold-2)); transition: width 0.3s; }
.night-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.picks { display: flex; gap: 8px; }
.pick { display: flex; flex-direction: column; gap: 1px; min-width: 96px; padding: 6px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.pick span { font-size: 11.5px; color: var(--muted); }
.pick b { font-size: 14px; font-weight: 500; }
.pick.on { border-color: rgba(214, 173, 98, 0.45); }
.done { display: flex; align-items: center; gap: 8px; color: var(--gold-2); font-size: 14px; }
.done svg { width: 18px; height: 18px; flex: none; }
.invite { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.invite-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.invite-row code { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 9px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--gold-2); font: 500 14px/1.2 ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.wa svg { color: #8fd3a6; }
.lobby-go { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lobby-why { font-size: 13px; color: var(--muted); text-align: center; }
.lobby-why.err { color: var(--warn); }
.lobby-wait { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text-2); }
.lobby-wait b { color: var(--gold-2); }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: dots 1.4s infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }

.dock-note { grid-area: note; width: clamp(190px, 20vw, 300px); display: flex; min-height: 0; }
.nb { flex: 1; display: flex; flex-direction: column; height: 104px; overflow: hidden; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.nb-head { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 12.5px; color: var(--gold-2); border-bottom: 1px solid var(--line); white-space: nowrap; min-width: 0; }
.nb-head svg { width: 14px; height: 14px; flex: none; }
.nb-head small { margin-inline-start: auto; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nb-text { flex: 1; resize: none; border: 0; outline: none; background: transparent; padding: 8px 10px; font: 400 13px/1.6 var(--font); }
.nb-text::placeholder, .nb-form input::placeholder { color: var(--muted); }
.nb-msgs { flex: 1; overflow-y: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; line-height: 1.55; }
.msg b { color: var(--gold); margin-inline-end: 6px; font-weight: 500; }
.msg.mine b { color: var(--gold-2); }
.nb-empty { color: var(--muted); }
.nb-form { display: flex; border-top: 1px solid var(--line); }
.nb-form input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 0; outline: none; background: transparent; font: 13px var(--font); }
.nb-form input:disabled { opacity: 0.6; }
.nb-form .icon-btn { width: 34px; height: 32px; border-radius: 0; }
.nb-form .icon-btn svg { width: 16px; height: 16px; }

.mic-btn {
  grid-area: mic;
  --lvl: 0;
  width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text-2);
  font: 500 12.5px var(--font);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, opacity 0.2s;
}
.mic-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); transition: box-shadow 0.1s, background 0.2s; }
.mic-ic svg { width: 20px; height: 20px; }
.mic-btn.on { color: var(--gold-2); border-color: rgba(214, 173, 98, 0.4); }
.mic-btn.on .mic-ic { background: rgba(214, 173, 98, 0.2); box-shadow: 0 0 0 calc(var(--lvl) * 10px) rgba(214, 173, 98, 0.2); }
.mic-btn.muted .mic-ic { background: rgba(208, 102, 79, 0.16); color: var(--warn); }
.mic-btn.locked { cursor: default; opacity: 0.75; }

/* ── overlays ── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: var(--scrim);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s, visibility 0.45s;
}
.overlay.show { opacity: 1; visibility: visible; }
.overlay.soft { background: var(--scrim-soft); pointer-events: none; }
.overlay.full { place-items: start center; }
.overlay-inner { width: 100%; display: grid; place-items: center; }
.ann { text-align: center; max-width: 760px; animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ann-icon { width: 60px; height: 60px; margin: 0 auto 14px; color: var(--gold-2); }
.ann-icon svg { width: 100%; height: 100%; }
.ann-kicker { margin-bottom: 10px; color: var(--gold); font-size: 14px; letter-spacing: 0.22em; }
.ann-title { margin: 0 0 10px; font-family: var(--display); font-size: clamp(42px, 7vw, 80px); line-height: 1.1; font-weight: 700; }
.ann-sub { color: var(--text-2); font-size: clamp(15px, 2vw, 19px); line-height: 1.8; }
.ann-sub b { color: var(--gold-2); }
.ann-faces { display: flex; justify-content: center; flex-wrap: wrap; gap: 24px; margin: 18px 0; }
.face { margin: 0; width: 180px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.face.big { width: 240px; margin: 18px auto 14px; }
.face-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, hsl(var(--h) 28% 26%), hsl(var(--h) 22% 12%));
  box-shadow: 0 0 0 3px rgba(214, 173, 98, 0.6), 0 0 0 11px rgba(214, 173, 98, 0.12), 0 20px 60px var(--shadow);
}
.face-media span { font: 600 56px var(--display); color: hsl(var(--h) 45% 84%); }
.face-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s; }
.face.me .face-media video { transform: scaleX(-1); }
.face-media.has-video video { opacity: 1; }
.face figcaption { display: flex; flex-direction: column; gap: 3px; }
.face figcaption b { font-family: var(--display); font-size: 24px; font-weight: 600; }
.face.big figcaption b { font-size: 42px; }
.face figcaption small { color: var(--text-2); font-size: 14px; }
.face figcaption small.rv { color: var(--gold-2); }
.ann-reveal { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(214, 173, 98, 0.35); background: var(--gold-a); color: var(--text); }
.ann-reveal svg { width: 26px; height: 26px; color: var(--gold-2); }
.ann-reveal b { color: var(--gold-2); }
.ann-note { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); }
.ann-note svg { width: 18px; height: 18px; color: var(--gold); }
.ann-note b { color: var(--text); }

.over { position: relative; width: min(1100px, 100%); padding: 36px 0 60px; text-align: center; animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.over-x { position: absolute; top: 16px; inset-inline-end: 0; }
.over-emblem { width: 86px; height: 86px; margin: 0 auto 10px; color: var(--gold-2); }
.over-emblem svg { width: 100%; height: 100%; }
.over-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 16px; margin: 32px 0; }
.oc .card-static { width: 100%; }
.oc.dead .card-static { filter: grayscale(0.85) brightness(0.65); }
:root[data-theme="light"] .oc.dead .card-static { filter: grayscale(0.9) opacity(0.5); }
.oc-name { margin-top: 8px; font-weight: 600; }
.oc-name small { color: var(--muted); font-weight: 400; }
.oc-state { font-size: 12px; color: var(--muted); }
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 0 0 28px; }
.award { display: flex; align-items: center; gap: 14px; text-align: start; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); }
.aw-ic { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--gold-a); color: var(--gold-2); }
.aw-ic svg { width: 26px; height: 26px; }
.aw-label { font-size: 12px; color: var(--gold); letter-spacing: 0.08em; }
.award b { display: block; font-size: 17px; }
.award small { color: var(--muted); font-size: 13px; }
.recap { text-align: start; margin-bottom: 30px; padding: 18px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.recap h3 { margin: 0 0 12px; font-family: var(--display); font-size: 20px; color: var(--gold-2); font-weight: 600; }
.over-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; }

.card-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--scrim);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
  cursor: pointer;
}
.card-modal.show { opacity: 1; visibility: visible; }
.cm-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.cm-card { width: min(320px, 72vw, 52vh); }
.cm-card .flip { width: 100%; }
.card-modal.show .cm-card { animation: deal 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.cm-hint { margin: 0; color: var(--text-2); font-size: 14px; }

.toasts { position: fixed; bottom: 160px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 12px; background: var(--toast-bg); border: 1px solid var(--line-2); color: var(--text); font-size: 14px; box-shadow: 0 10px 30px var(--shadow); opacity: 0; transform: translateY(10px); transition: 0.3s; }
.toast.in { opacity: 1; transform: none; }
.toast.warn { border-color: rgba(208, 102, 79, 0.5); }

.fatal { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; }
.fatal-card { max-width: 420px; padding: 40px 32px; text-align: center; border-radius: 24px; background: var(--surface); border: 1px solid var(--line-2); }
.fatal-logo { width: 64px; margin: 0 auto 16px; color: var(--gold); }
.fatal-card h2 { margin: 0 0 24px; font-size: 20px; line-height: 1.7; font-weight: 500; }

/* ─────────────── premium + credit ─────────────── */

.panel.premium { border-color: rgba(214, 173, 98, 0.35); background: linear-gradient(180deg, rgba(214, 173, 98, 0.08), var(--surface) 70%); }
.login { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.login input, .acc-form input, .acc-form select {
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--text);
  font: 14px var(--font);
  outline: none;
}
.login input:focus, .acc-form input:focus { border-color: rgba(214, 173, 98, 0.6); }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: 12.5px var(--font); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--gold-2); }
.assign { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.assign-row { display: flex; align-items: center; gap: 8px; }
.as-av { width: 22px; height: 22px; font-size: 11px; }
.as-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.assign-row select { width: 112px; flex: none; height: 32px; font-size: 12.5px; padding-right: 8px; padding-left: 26px; background-position: left 6px center; }
.muted-panel { opacity: 0.55; }
.side-credit { display: flex; justify-content: center; padding: 2px 0 8px; }

.credit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 3px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text-2);
  font: 13px var(--font);
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
}
.credit:hover { border-color: rgba(214, 173, 98, 0.5); }
.credit b { color: var(--gold-2); font-weight: 600; }
.credit-dev { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; padding: 0; border: 0; background: none; color: inherit; font: inherit; line-height: 1.25; cursor: copy; }
.credit-dev:hover { color: var(--text); }
.credit-user { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #95a3ff; }
.credit-user svg { width: 12px; height: 12px; }
.credit-dev:hover .credit-user { color: #b9c2ff; }
.credit-dc { display: inline-flex; align-items: center; gap: 6px; padding-inline-start: 10px; border-inline-start: 1px solid var(--line-2); color: inherit; text-decoration: none; }
.credit-dc:hover { color: #b9c2ff; }
.credit-dc svg { width: 16px; height: 16px; color: #95a3ff; }
.credit.compact { min-height: 34px; font-size: 12px; }

.voice-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ─────────────── admin dashboard ─────────────── */

.admin { max-width: 1180px; margin: 0 auto; padding: 0 20px 60px; }
.admin-top { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 18px 0; }
.admin-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: 14px; }
.admin-tag svg { width: 16px; height: 16px; color: var(--gold); }
.spacer { flex: 1; }
.admin-login { min-height: 70vh; display: grid; place-items: center; }
.admin-login form.panel { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.admin-login h1 { margin: 0; font-family: var(--display); text-align: center; font-weight: 600; }
.admin-login-ic { width: 54px; height: 54px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; background: var(--gold-a); color: var(--gold-2); }
.admin-login-ic svg { width: 26px; height: 26px; }
.admin-dash { display: flex; flex-direction: column; gap: 14px; }
.admin-warn { border-radius: 14px; border: 1px solid rgba(208, 102, 79, 0.3); justify-content: flex-start; }
.admin-warn svg { width: 18px; height: 18px; flex: none; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font: 600 30px var(--font); font-variant-numeric: tabular-nums; color: var(--text); }
.kpi-hint { font-size: 12.5px; color: var(--text-2); }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chart { margin: 0; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.chart figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.chart figcaption b { font-size: 15px; font-weight: 600; }
.chart figcaption span { font-size: 12.5px; color: var(--muted); }
.chart-plot { position: relative; height: 160px; border-bottom: 1px solid var(--line-2); }
.chart-plot::before { content: ''; position: absolute; top: 18px; left: 0; right: 0; border-top: 1px dashed var(--line); }
.chart-max { position: absolute; top: 0; inset-inline-start: 0; font-size: 11px; color: var(--muted); }
.bars { position: absolute; inset: 18px 0 0; display: flex; align-items: flex-end; gap: 2px; }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; outline: none; }
.bar-col i { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: #b48a3e; transition: background 0.15s; }
.bar-col:hover i, .bar-col:focus-visible i { background: #d6ad62; }
.chart-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.chart-tip { position: fixed; z-index: 90; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 8px; background: var(--toast-bg); border: 1px solid var(--line-2); color: var(--text); font-size: 12.5px; white-space: nowrap; pointer-events: none; }
.win-bar { display: flex; gap: 2px; height: 14px; border-radius: 999px; overflow: hidden; background: var(--bg-2); }
.win-bar i { display: block; height: 100%; }
.win-bar i.town, .win-legend i.town { background: #5a8fc8; }
.win-bar i.mafia, .win-legend i.mafia { background: #c4646e; }
.win-legend { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 13.5px; color: var(--text-2); }
.win-legend span { display: inline-flex; align-items: center; gap: 6px; }
.win-legend i { width: 10px; height: 10px; border-radius: 3px; }
.win-legend b { color: var(--text); }
.table-view summary { display: flex; align-items: center; gap: 8px; color: var(--gold-2); font-weight: 500; cursor: pointer; }
.table-view summary svg { width: 18px; height: 18px; }
.table-view table { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: 13px; }
.table-view th, .table-view td { padding: 6px 8px; text-align: start; border-bottom: 1px solid var(--line); }
.table-view th { color: var(--muted); font-weight: 500; }
.table-view td { font-variant-numeric: tabular-nums; }
.admin-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: start; }
.acc-list { list-style: none; padding: 0; margin: 8px 0 12px; display: flex; flex-direction: column; gap: 6px; }
.acc-list li { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border-radius: 10px; background: var(--bg-2); font-size: 13.5px; }
.acc-mail { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.acc-role { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 11.5px; }
.acc-role.admin { color: var(--gold-2); border-color: rgba(214, 173, 98, 0.4); }
.acc-list .icon-btn { width: 32px; height: 32px; }
.acc-list .icon-btn svg { width: 16px; height: 16px; }
.acc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acc-form .btn { height: 40px; }
.me-form { display: flex; flex-direction: column; gap: 10px; }
.me-form .field input { height: 40px; font-size: 14px; }
.status-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; }
.status-chip svg { width: 14px; height: 14px; }
.status-chip.ok { color: var(--sage); }
.status-chip.off { color: var(--warn); }
.tts-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 8px 0; font-size: 13.5px; }
.tts-info dt { color: var(--muted); }
.tts-info dd { margin: 0; overflow-wrap: anywhere; }

/* ─────────────── theme + language buttons ─────────────── */

.g-ctl { display: inline-flex; align-items: center; gap: 2px; }
.g-lang span { font: 700 13px var(--font); letter-spacing: 0.02em; }
.nav-end { display: flex; align-items: center; gap: 10px; }
.pj-top { position: absolute; top: 18px; inset-inline: 24px; display: flex; align-items: center; justify-content: space-between; }
.voice-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.voice-select { flex: 1; min-width: 150px; height: 40px; font-size: 14px; }

/* ─────────────── left-to-right (English) ─────────────── */

[dir="ltr"] select { padding-left: 14px; padding-right: 32px; background-position: right 10px center; }
[dir="ltr"] .set-row select { padding-left: 10px; }
[dir="ltr"] .assign-row select { padding-left: 8px; padding-right: 26px; background-position: right 6px center; }
[dir="ltr"] .switch i::after { right: auto; left: 3px; }
[dir="ltr"] .switch input:checked + i::after { transform: translateX(18px); }
[dir="ltr"] .pj-meter .bar i { transform-origin: left; }
[dir="ltr"] .hero-title, [dir="ltr"] .ann-title, [dir="ltr"] .phase-title { letter-spacing: -0.01em; }

/* ─────────────── reactions ─────────────── */

.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.react-btn {
  width: 34px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s;
}
.react-btn:hover { transform: translateY(-2px) scale(1.08); border-color: rgba(214, 173, 98, 0.5); }
.react-btn:active { transform: scale(0.92); }
.is-lobby .reacts { width: 100%; justify-content: center; }
.react-float {
  position: absolute;
  bottom: 18%;
  left: var(--x, 50%);
  z-index: 9;
  font-size: clamp(26px, 3vw, 40px);
  pointer-events: none;
  animation: floatUp 2.3s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}
.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 20px) scale(0.6); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -140px) scale(1); }
}

/* ─────────────── narrator: speaking wave ─────────────── */

.wave { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; margin-inline-end: 4px; }
.wave i { width: 3px; height: 3px; border-radius: 2px; background: var(--gold); }
.subtitle.speaking .wave i { animation: wave 0.9s ease-in-out infinite; }
.subtitle.speaking .wave i:nth-child(2) { animation-delay: 0.15s; }
.subtitle.speaking .wave i:nth-child(3) { animation-delay: 0.3s; }
.subtitle.speaking .wave i:nth-child(4) { animation-delay: 0.45s; }
@keyframes wave { 0%, 100% { height: 3px; } 50% { height: 12px; } }

/* ─────────────── night: board beside the cameras, mafia meeting ─────────────── */

.stage.board-beside { flex-direction: row; align-items: center; }
/* Stacked (narrow screens): cameras stay a fixed strip on top and the board
   scrolls inside itself, so the narrator's subtitle stays pinned in view. */
.room.board-on .stage:not(.board-beside) { justify-content: flex-start; }
.stage:not(.board-beside) .night-board { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
.stage.board-beside .grid { flex: 1; width: auto; }
.stage.board-beside .night-board { width: clamp(380px, 44%, 560px); max-height: 100%; overflow-y: auto; }
.nb-body { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.nb-meet { width: 100%; padding: 12px; border-radius: 16px; border: 1px solid rgba(214, 173, 98, 0.45); background: linear-gradient(180deg, rgba(214, 173, 98, 0.12), transparent); }
.meet-title { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px; font-family: var(--display); font-size: 18px; color: var(--gold-2); }
.meet-title svg { width: 20px; height: 20px; }
.meet-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.meet-cam { margin: 0; width: clamp(120px, 30%, 200px); display: flex; flex-direction: column; gap: 6px; text-align: center; }
.meet-media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, hsl(var(--h) 28% var(--av-hi)), hsl(var(--h) 22% var(--av-lo)));
  box-shadow: 0 0 0 2px var(--gold), 0 0 26px rgba(214, 173, 98, 0.35);
}
.meet-media span { font: 600 32px var(--display); color: hsl(var(--h) 45% var(--av-ink)); }
.meet-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s; }
.meet-cam.has-video video { opacity: 1; }
.meet-cam.me video { transform: scaleX(-1); }
.meet-cam figcaption { display: flex; flex-direction: column; font-size: 13px; }
.meet-cam figcaption small { color: var(--gold); font-size: 11.5px; }
.tile.awake-mate { box-shadow: 0 0 0 2px var(--gold), 0 0 24px rgba(214, 173, 98, 0.3); }

/* Night sky behind the stage — the same for every player. */
.room.is-night .stage {
  background:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(255, 244, 214, 0.7), transparent 60%),
    radial-gradient(1px 1px at 28% 72%, rgba(255, 244, 214, 0.55), transparent 60%),
    radial-gradient(1.4px 1.4px at 47% 12%, rgba(255, 244, 214, 0.6), transparent 60%),
    radial-gradient(1px 1px at 63% 58%, rgba(255, 244, 214, 0.5), transparent 60%),
    radial-gradient(1.3px 1.3px at 81% 26%, rgba(255, 244, 214, 0.65), transparent 60%),
    radial-gradient(1px 1px at 92% 80%, rgba(255, 244, 214, 0.5), transparent 60%),
    radial-gradient(900px 500px at 85% -10%, rgba(120, 140, 210, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(12, 16, 32, 0.55), rgba(10, 12, 20, 0.2));
}
:root[data-theme="light"] .room.is-night .stage {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(120, 130, 200, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(210, 214, 236, 0.6), rgba(240, 236, 228, 0.2));
}
.room.is-night .stage::after {
  content: '';
  position: absolute;
  top: 18px;
  inset-inline-end: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  box-shadow: -10px 6px 0 0 #efd29b;
  opacity: 0.55;
  pointer-events: none;
}

.hero-moon {
  position: absolute;
  top: 6%;
  inset-inline-end: 10%;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  box-shadow: -18px 10px 0 0 var(--gold);
  opacity: 0.35;
  animation: float 9s ease-in-out infinite;
}

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 70; pointer-events: none; }

/* ─────────────── admin extras ─────────────── */

.admin-cols.two { grid-template-columns: 1fr 1fr; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th, .mini-table td { padding: 7px 8px; text-align: start; border-bottom: 1px solid var(--line); }
.mini-table th { color: var(--muted); font-weight: 500; }
.mini-table small { color: var(--muted); }
.recent-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.recent-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); font-size: 13.5px; }
.rc-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.rc-dot.mafia { background: #c4646e; }
.rc-dot.town { background: #5a8fc8; }
.rc-ago { margin-inline-start: auto; color: var(--muted); font-size: 12px; }

/* ─────────────── motion ─────────────── */

@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes deal { from { opacity: 0; transform: translateY(40px) rotate(-6deg) scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
@keyframes beat { 50% { transform: scale(1.07); } }
@keyframes pulse { 50% { opacity: 0.45; } }
@keyframes float { 50% { transform: translateY(-12px); } }
@keyframes dots { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes nope { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes roulette {
  0%, 30%, 100% { box-shadow: inset 0 0 0 1px var(--line), 0 10px 30px var(--shadow-soft); }
  12% { box-shadow: 0 0 0 4px var(--gold-2), 0 0 44px rgba(214, 173, 98, 0.5); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ─────────────── human narrator ─────────────── */

/* The line the person narrating reads out: a prompt, not a caption. */
.subtitle.prompt { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214, 173, 98, 0.18), 0 12px 30px var(--shadow); font-size: 17px; }
.subtitle.prompt .sub-who { color: var(--gold-2); font-weight: 600; }
.subtitle.prompt .wave { display: none; }
.tile.narrating { box-shadow: 0 0 0 2px rgba(214, 173, 98, 0.7), 0 0 26px rgba(214, 173, 98, 0.22); }
.badge.narr { color: var(--gold-2); border-color: rgba(214, 173, 98, 0.45); }
.dock-flag.narr { color: var(--gold-2); }
.ann-note.narr { border-color: rgba(214, 173, 98, 0.45); background: var(--gold-a); }
.narr-how { margin: 10px 0 0; line-height: 1.75; }
.narr-opts { display: flex; flex-direction: column; gap: 6px; }
.narr-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-2); font: 500 14px var(--font); text-align: start; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.narr-opt small { color: var(--muted); font-size: 12px; font-weight: 400; }
.narr-opt:hover:not(:disabled) { border-color: rgba(214, 173, 98, 0.45); }
.narr-opt.on { border-color: var(--gold); background: var(--gold-a); color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(214, 173, 98, 0.35); }
.narr-opt:disabled { cursor: default; }

/* ─────────────── new cards: mayor, will, fatina ─────────────── */

.mayor-btn { align-self: flex-start; gap: 8px; border-color: rgba(214, 173, 98, 0.5); color: var(--gold-2); }
.mayor-btn svg { width: 20px; height: 20px; }
.will-em { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--gold-a); color: var(--gold-2); box-shadow: 0 0 0 3px var(--gold), 0 0 0 7px rgba(214, 173, 98, 0.15); }
.will-em svg { width: 30px; height: 30px; }
.nb-head-title.charmed { color: var(--rose); }
.nb-head-title.charmed svg { width: 26px; height: 26px; }
.muted.small { margin: 8px 0 0; font-size: 12.5px; }

/* ─────────────── share card ─────────────── */

.share-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(8, 9, 12, 0.88); backdrop-filter: blur(6px); }
.sh-card { display: flex; flex-direction: column; align-items: center; gap: 14px; max-height: calc(100vh - 32px); animation: rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sh-card img { max-height: calc(100vh - 120px); max-width: min(420px, 100%); border-radius: 22px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(214, 173, 98, 0.35); }
.sh-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.share-btn svg { width: 20px; height: 20px; }

/* ─────────────── narrator studio ─────────────── */

.studio-link { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(214, 173, 98, 0.35); background: linear-gradient(180deg, rgba(214, 173, 98, 0.1), transparent); color: var(--text); text-decoration: none; transition: transform 0.2s, border-color 0.2s; }
.studio-link:hover { transform: translateY(-1px); border-color: rgba(214, 173, 98, 0.65); }
.sl-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--gold-a); color: var(--gold-2); }
.sl-ic svg { width: 20px; height: 20px; }
.sl-copy { display: flex; flex-direction: column; gap: 2px; }
.sl-copy b { color: var(--gold-2); font-weight: 600; }
.sl-copy small { color: var(--muted); }

.studio-wrap { display: flex; flex-direction: column; gap: 14px; }
.studio-hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; padding: 24px 26px; border-color: rgba(214, 173, 98, 0.3); background: linear-gradient(180deg, rgba(214, 173, 98, 0.08), var(--surface) 70%); }
.studio-hero h1 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font: 600 28px var(--display); color: var(--gold-2); }
.studio-hero h1 svg { width: 28px; height: 28px; }
.studio-hero p { margin: 0; line-height: 1.8; }
.studio-tips { margin: 14px 0 0; padding-inline-start: 18px; display: grid; gap: 6px; color: var(--text-2); font-size: 14px; line-height: 1.7; }
.studio-tips b { padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--gold-2); font: 600 12.5px var(--font); }
.sh-side { display: flex; flex-direction: column; gap: 16px; }
.st-progress { display: flex; align-items: center; gap: 14px; }
.sp-ring { --p: 0; position: relative; width: 86px; height: 86px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--surface-3) 0); }
.sp-ring::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.sp-ring b, .sp-ring span { position: relative; }
.sp-ring b { font: 600 24px var(--font); font-variant-numeric: tabular-nums; }
.sp-ring span { font-size: 12px; color: var(--muted); }
.st-name { display: flex; align-items: flex-end; gap: 8px; }
.st-name .field { flex: 1; min-width: 0; }
.st-mic { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.st-mic svg { width: 18px; height: 18px; }
.st-level, .st-live { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.st-level { flex: 1; }
.st-live { display: inline-block; width: 46px; }
.st-level i, .st-live i { display: block; width: 0; height: 100%; transition: width 0.08s; }
.st-level i { background: linear-gradient(90deg, var(--sage), var(--gold)); }
.st-live i { background: #d0664f; }

.st-group .panel-head { margin-bottom: 4px; }
.st-row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 12px; border: 1px solid transparent; transition: background 0.2s, border-color 0.2s; }
.st-row + .st-row { margin-top: 2px; }
.st-row.current { background: var(--gold-a); border-color: rgba(214, 173, 98, 0.35); }
.st-row.rec { background: rgba(208, 102, 79, 0.1); border-color: rgba(208, 102, 79, 0.5); }
.st-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.st-text { padding: 0; border: 0; background: none; color: var(--text); font: 400 16.5px/1.75 var(--font); text-align: start; cursor: pointer; }
.st-text > span { margin-inline: 4px; }
.st-row.done .st-text { color: var(--text-2); }
.st-slot { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; border: 1px dashed rgba(214, 173, 98, 0.6); background: var(--gold-a); color: var(--gold-2); font-size: 13px; vertical-align: middle; }
.st-slot svg { width: 13px; height: 13px; }
.st-stale { color: var(--warn); font-size: 12.5px; line-height: 1.6; }
.st-line { display: flex; align-items: flex-start; gap: 6px; }
.st-line .st-text { flex: 1; min-width: 0; }
.st-edit-btn { width: 30px; height: 30px; flex: none; opacity: 0.55; }
.st-row:hover .st-edit-btn, .st-row.current .st-edit-btn { opacity: 1; }
.st-edit-btn svg { width: 16px; height: 16px; }
.st-edited { display: inline-flex; align-items: center; gap: 5px; color: var(--gold); font-size: 12px; }
.st-edited svg { width: 12px; height: 12px; }
.st-edit { display: grid; gap: 8px; }
.st-edit textarea { width: 100%; resize: vertical; min-height: 60px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(214, 173, 98, 0.5); background: var(--bg-2); color: var(--text); font: 400 16px/1.7 var(--font); }
.st-edit-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.st-edit-btns { display: inline-flex; gap: 6px; }
.st-takes { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.st-todo { font-size: 13px; }
.st-take { display: inline-flex; align-items: center; border-radius: 10px; border: 1px solid rgba(134, 179, 159, 0.45); background: rgba(134, 179, 159, 0.1); overflow: hidden; }
.st-take.stale { border-color: rgba(208, 102, 79, 0.45); background: rgba(208, 102, 79, 0.08); }
.st-take button { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px; border: 0; background: none; color: var(--text); font: 500 13px var(--font); cursor: pointer; }
.st-take button:disabled { opacity: 0.4; cursor: default; }
.st-take button + button { border-inline-start: 1px solid var(--line-2); color: var(--muted); }
.st-take svg { width: 13px; height: 13px; }
.st-take small { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.name-voice { margin-top: 10px; }
.name-voice small { display: block; color: var(--muted); font-size: 12px; }
.st-side { display: flex; align-items: center; gap: 12px; flex: none; }
.st-meta { min-width: 70px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sage); font-variant-numeric: tabular-nums; }
.st-meta svg { width: 15px; height: 15px; }
.st-clock { color: #d0664f; font-weight: 600; }
.st-btns { display: flex; align-items: center; gap: 4px; }
.st-rec { min-width: 112px; height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: 500 14px var(--font); cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.st-rec:hover:not(:disabled) { border-color: rgba(208, 102, 79, 0.65); }
.st-rec:disabled { opacity: 0.4; cursor: default; }
.st-rec svg { width: 14px; height: 14px; }
.st-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: #d0664f; box-shadow: 0 0 0 3px rgba(208, 102, 79, 0.2); }
.st-rec.on { background: #c95c46; border-color: transparent; color: #fff; animation: recPulse 1.4s ease-in-out infinite; }
@keyframes recPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(208, 102, 79, 0.45); } 50% { box-shadow: 0 0 0 8px rgba(208, 102, 79, 0); } }

@media (max-width: 760px) {
  .studio-hero { grid-template-columns: 1fr; gap: 18px; padding: 18px 16px; }
  .st-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .st-side { justify-content: space-between; }
}

/* ─────────────── sign-in, the player, premium ─────────────── */

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 90px 16px 40px; position: relative; }
.auth-card { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px 26px; text-align: center; box-shadow: 0 24px 70px var(--shadow); }
.auth-card h1 { margin: 0; font: 600 26px var(--display); color: var(--text); }
.auth-card > p { margin: 0; line-height: 1.7; }
.g-slot { min-height: 46px; display: grid; place-items: center; }
.auth-note { margin: 0; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-2); font-size: 14px; line-height: 1.7; }
.auth-or { width: 100%; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.dev-login { width: 100%; display: flex; gap: 8px; }
.dev-login input { flex: 1; min-width: 0; }
.auth-fine { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.auth-who { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.auth-av { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--gold-a); color: var(--gold-2); font: 600 15px var(--display); }
.nick-form { width: 100%; display: flex; flex-direction: column; gap: 14px; text-align: start; }
.nick-form .field small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.say-row { display: flex; gap: 8px; }
.say-row input { flex: 1; min-width: 0; }
.dev-login input, .say-row input { height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: 15px var(--font); outline: none; }

.user-chip { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); }
.uc-main { display: inline-flex; align-items: center; gap: 8px; padding-inline-end: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.uc-av { width: 30px; height: 30px; flex: none; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--gold-a); color: var(--gold-2); font: 600 14px var(--display); }
.uc-nick { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-crown svg { width: 15px; height: 15px; color: var(--gold); }
.user-chip .icon-btn { width: 30px; height: 30px; }
.user-chip .icon-btn svg { width: 16px; height: 16px; }

.premium-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: var(--scrim); backdrop-filter: blur(6px); }
.premium-modal .pm-card { animation: rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.pm-card { position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 28px 24px 22px; border-radius: 22px; border: 1px solid rgba(214, 173, 98, 0.4); background: linear-gradient(180deg, rgba(214, 173, 98, 0.1), var(--surface) 45%); box-shadow: 0 30px 90px var(--shadow); text-align: center; }
.pm-x { position: absolute; top: 12px; inset-inline-end: 12px; }
.pm-crown { width: 60px; height: 60px; margin: 0 auto; display: grid; place-items: center; border-radius: 18px; background: var(--gold-a); color: var(--gold-2); }
.pm-crown svg { width: 30px; height: 30px; }
.pm-card h2 { margin: 0; font: 600 26px var(--display); color: var(--gold-2); }
.pm-reason { padding: 9px 12px; border-radius: 12px; background: rgba(208, 102, 79, 0.12); border: 1px solid rgba(208, 102, 79, 0.35); color: var(--text); font-size: 14px; line-height: 1.7; }
.pm-price b { font: 700 42px var(--font); color: var(--text); letter-spacing: -0.02em; }
.pm-perks, .pm-steps { margin: 0; text-align: start; display: grid; gap: 8px; font-size: 14.5px; line-height: 1.7; color: var(--text-2); }
.pm-perks { padding: 0; list-style: none; }
.pm-perks li { display: flex; gap: 8px; align-items: flex-start; }
.pm-perks svg { width: 18px; height: 18px; flex: none; margin-top: 3px; color: var(--sage); }
.pm-steps { padding: 12px 14px 12px 14px; padding-inline-start: 32px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.pm-steps b { color: var(--gold-2); }
.pm-id { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
.pm-id b { color: var(--text); font-weight: 500; }

.free-left { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(214, 173, 98, 0.35); background: var(--gold-a); color: var(--gold-2); font: 500 12.5px var(--font); cursor: pointer; }
.free-left svg { width: 14px; height: 14px; }
.free-left.none { border-color: rgba(208, 102, 79, 0.45); background: rgba(208, 102, 79, 0.1); color: var(--warn); }
.free-note { margin: 6px 0 10px; font-size: 13.5px; color: var(--gold-2); }
.free-note.none { color: var(--warn); }

.players-row { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.admin-stack { display: flex; flex-direction: column; gap: 12px; }
.pl-search { width: 100%; height: 42px; margin: 6px 0 10px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: 14px var(--font); outline: none; }
.pl-search:focus { border-color: rgba(214, 173, 98, 0.6); }
.pl-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; max-height: 460px; overflow-y: auto; }
.pl-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; border: 1px solid transparent; }
.pl-row:hover { background: var(--bg-2); }
.pl-row.prem { border-color: rgba(214, 173, 98, 0.35); background: var(--gold-a); }
.pl-av { width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--surface-3); color: var(--gold-2); font: 600 15px var(--display); }
.pl-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pl-who b { display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: 14.5px; }
.pl-who small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-crown svg { width: 14px; height: 14px; color: var(--gold); }
.pl-games { flex: none; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.site-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.site-form .field small { display: block; color: var(--muted); font-size: 12px; }
.site-form button { align-self: flex-start; }

/* ─────────────── responsive ─────────────── */

@media (max-width: 1280px) {
  .room { grid-template-columns: minmax(0, 1fr) 290px; }
  .dock-card { width: 64px; }
  .mic-btn { width: 78px; }
}

@media (max-width: 1100px) {
  .steps, .features { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .charts, .admin-cols, .admin-cols.two { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 10px; }
  .hero-art { height: 420px; order: -1; }
  .pj { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 900px) {
  .room { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "banner" "stage" "dock"; }
  .side {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-end: 0;
    z-index: 40;
    width: min(360px, 88vw);
    background: var(--bg-2);
    border: 0;
    border-inline-start: 1px solid var(--line);
    transform: translateX(-102%);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  [dir="ltr"] .side { transform: translateX(102%); }
  .room.side-open .side { transform: none; }
  .side-scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, 0.5); opacity: 0; visibility: hidden; transition: 0.3s; }
  .room.side-open .side-scrim { opacity: 1; visibility: visible; }
  .side-toggle { display: grid; }
  .dock { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "card main mic" "note note note"; min-height: 0; }
  .dock-note { width: auto; }
  .nb { height: 88px; }
}

@media (max-width: 640px) {
  .home, .page { padding: 0 16px; }
  .nav { flex-wrap: wrap; row-gap: 12px; padding: 16px 0 10px; }
  .nav-links { order: 3; width: 100%; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { flex: none; padding: 7px 11px; font-size: 13.5px; border: 1px solid var(--line); }
  .page-hero { padding: 40px 0 36px; }
  .how-steps li { grid-template-columns: 40px 1fr; gap: 12px; padding: 16px; }
  .sets-note { border-radius: 14px; margin-top: -20px; }
  .perk-grid { grid-template-columns: 1fr; }
  .cmp th, .cmp td { padding: 10px 8px; font-size: 13.5px; }
  .pm-steps li { flex-direction: column; align-items: flex-start; }
  .nav .credit { display: none; }
  .nav .uc-nick { display: none; }
  .nav .uc-main { padding-inline-end: 0; }
  .hide-sm { display: none !important; }
  .night-board { padding: 12px; gap: 8px; }
  .nb-names { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .nb-name { padding: 6px 8px; font-size: 13px; }
  .answer-big { font-size: 18px; }
  .hero-art { height: 330px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .join-code input { flex: 1; width: auto; }
  .steps, .features { grid-template-columns: 1fr; }
  .roles-grid { grid-template-columns: 1fr; }
  .role-tile .card-static { width: 88px; }
  .section { padding: 64px 0; }
  .prejoin { padding: 80px 16px 32px; }
  .pj-devices { grid-template-columns: 1fr; }

  .topbar { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "start end" "center center"; padding: 8px 10px; gap: 6px 8px; }
  .tb-start { grid-area: start; }
  .tb-end { grid-area: end; }
  .tb-center { grid-area: center; }
  .brand.mini { display: none; }
  .room-code { padding: 0 9px; gap: 6px; }
  .room-code span, .room-code svg { display: none; }
  .tb-center { gap: 8px; }
  .phase-title { font-size: 16px; }
  .phase-sub { display: none; }
  .timer { width: 44px; height: 44px; }
  .timer-txt { font-size: 12px; }
  .tb-end { gap: 0; }
  .tb-end .icon-btn { width: 31px; height: 34px; }
  .host-ctl { padding-inline-end: 3px; margin-inline-end: 2px; }
  .tb-end .icon-btn svg { width: 18px; height: 18px; }
  .stage { padding: 8px; }
  .subtitle { bottom: 8px; padding: 7px 12px; font-size: 14px; line-height: 1.6; }
  .dock { gap: 10px; padding: 10px; }
  .dock-card { width: 56px; }
  .mic-btn { width: 66px; font-size: 11px; }
  .mic-ic { width: 36px; height: 36px; }
  .dock-title { font-size: 16px; }
  .dock-text { font-size: 13.5px; }
  .is-lobby .dock-main { flex-direction: column; align-items: stretch; }
  .is-lobby .mic-btn { align-self: start; height: 92px; }
  .react-btn { width: 30px; height: 28px; font-size: 15px; }
  .tile-name { height: 24px; padding: 0 8px; font-size: 12px; }
  .badge { height: 20px; padding: 0 6px; font-size: 10.5px; }
  .vote-count { width: 40px; height: 40px; font-size: 19px; }
  .voters { display: none; }
  .face { width: 130px; }
  .face.big { width: 180px; }
  .face.big figcaption b { font-size: 32px; }
  .toasts { bottom: 200px; }
}
