:root {
  --bg: #07060b; --bg2: #0d0b14; --card: #14111d; --card2: #1b1727; --card3: #241e35;
  --line: rgba(255, 255, 255, .07); --line2: rgba(177, 77, 255, .28);
  --text: #f2eefb; --muted: #958daf; --dim: #5e5775;
  --violet: #b14dff; --violet2: #7c3aed; --deep: #2a1250; --cyan: #00e5ff; --red: #ff2e63; --green: #39ff88; --amber: #ffb020;
  --r: 18px; --r-sm: 12px;
  --display: 'Unbounded', 'Cairo', 'Arial Black', system-ui, sans-serif;
  --body: 'Manrope', 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.45; }
body { min-height: 100dvh; overflow-x: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.neon { color: var(--cyan); text-shadow: 0 0 18px rgba(0, 229, 255, .55); }

/* ---------- ambient background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: radial-gradient(120% 60% at 50% -10%, #1d0b3a 0%, transparent 60%), var(--bg); }
.bg::after { content: ''; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 36px 36px; mask-image: radial-gradient(80% 60% at 50% 0%, #000 0%, transparent 75%); }
.bg i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; animation: drift 18s ease-in-out infinite alternate; }
.bg i:nth-child(1) { width: 340px; height: 340px; background: #5b17b8; top: -120px; left: -100px; }
.bg i:nth-child(2) { width: 260px; height: 260px; background: #0a5c8a; bottom: 5%; right: -120px; animation-delay: -6s; opacity: .25; }
.bg i:nth-child(3) { width: 200px; height: 200px; background: #8a0f4a; bottom: -80px; left: 10%; animation-delay: -12s; opacity: .2; }
@keyframes drift { to { transform: translate(40px, 60px) scale(1.15); } }

/* ---------- app shell ---------- */
.app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; min-height: 100dvh; }
.screen { display: flex; flex-direction: column; gap: 14px; padding: max(10px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  min-height: 100dvh; animation: enter .45s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 52px; }
.tb-l { justify-self: start; } .tb-r { justify-self: end; display: flex; gap: 6px; align-items: center; }
.tb-t { font-family: var(--display); font-weight: 700; font-size: .95rem; letter-spacing: .02em; }
.dock { position: sticky; bottom: 0; margin-top: auto; padding-top: 16px; padding-bottom: env(safe-area-inset-bottom);
  background: linear-gradient(to top, var(--bg) 55%, transparent); display: flex; flex-direction: column; gap: 10px; z-index: 5; }
.dock.col { align-items: stretch; }

.card { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--r); padding: 16px;
  box-shadow: 0 20px 40px -24px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.04); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.h2 { font-family: var(--display); font-size: 1.25rem; font-weight: 700; margin: 4px 0; letter-spacing: -.01em; }
.eyebrow { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--violet); font-weight: 800; }
.eyebrow.red { color: var(--red); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.section-head h3, .section-title { display: flex; gap: 8px; align-items: center; margin: 4px 0 0; font-size: .95rem; font-weight: 800; }
.count { color: var(--muted); font-weight: 600; }

/* ---------- buttons ---------- */
.btn { border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 800; letter-spacing: .01em; display: inline-flex; gap: 8px;
  align-items: center; justify-content: center; transition: transform .15s var(--ease), box-shadow .2s, opacity .2s, background .2s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn.big { padding: 16px 22px; font-size: 1.02rem; width: 100%; }
.btn.sm { padding: 8px 14px; font-size: .85rem; }
.btn-primary { background: linear-gradient(135deg, #c26bff, var(--violet2)); color: #fff; box-shadow: 0 8px 28px -8px rgba(177, 77, 255, .75), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-ghost { background: rgba(255,255,255,.04); border: 1px solid var(--line2); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: rgba(177,77,255,.12); }
.btn-danger { background: var(--red); color: #fff; box-shadow: 0 8px 24px -8px rgba(255, 46, 99, .8); }
.btn.glow:not(:disabled) { animation: glow 2.4s ease-in-out infinite; }
.btn.danger-glow { background: linear-gradient(135deg, #ff5a86, #d4134a); box-shadow: 0 8px 28px -8px rgba(255,46,99,.8); }
@keyframes glow { 50% { box-shadow: 0 8px 40px -4px rgba(177, 77, 255, .95), inset 0 1px 0 rgba(255,255,255,.3); } }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03); display: grid; place-items: center; color: var(--text); transition: background .2s; }
.icon-btn:hover { background: rgba(255,255,255,.08); }
.icon-btn.off { color: var(--dim); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn.danger:hover { color: var(--red); border-color: rgba(255,46,99,.4); }
.link-btn { background: none; border: 0; color: var(--muted); font-weight: 700; display: inline-flex; gap: 6px; align-items: center; padding: 10px; align-self: center; }
.link-btn:hover { color: var(--text); }
.link-btn.tiny { padding: 2px 4px; font-size: .8rem; color: var(--violet); }
.prefs { display: flex; gap: 8px; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .78rem; font-weight: 800; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; display: flex; gap: 6px; align-items: center; }
.field em { text-transform: none; font-style: normal; font-weight: 600; color: var(--dim); letter-spacing: 0; }
input { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; outline: none; transition: border-color .2s, box-shadow .2s; width: 100%; font-size: 1rem; }
input::placeholder { color: var(--dim); }
input:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(177, 77, 255, .18); }
.code-input { font-family: var(--display); font-size: 2rem; text-align: center; letter-spacing: .45em; padding-left: calc(16px + .45em); text-transform: uppercase; }
.shake { animation: shake .4s; border-color: var(--red) !important; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- home ---------- */
.hero { text-align: center; padding: 6vh 0 2vh; }
.logo { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.logo-mark { display: flex; gap: 8px; }
.logo-mark span { width: 18px; height: 18px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 16px var(--violet); animation: bob 2.4s ease-in-out infinite; }
.logo-mark span:nth-child(2) { animation-delay: .15s; }
.logo-mark span.odd { background: var(--red); box-shadow: 0 0 18px var(--red); animation: bob 2.4s ease-in-out infinite, oddly 4s steps(1) infinite; animation-delay: .3s; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes oddly { 0%, 90% { opacity: 1; } 92% { opacity: .2; } 94% { opacity: 1; } 96% { opacity: .3; } }
.logo h1 { position: relative; margin: 0; font-family: var(--display); font-weight: 900; font-size: clamp(2.6rem, 13vw, 3.8rem); letter-spacing: -.02em; line-height: 1;
  background: linear-gradient(180deg, #fff 20%, #cfa6ff); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(177, 77, 255, .55)); }
.logo h1::after { content: attr(data-text); position: absolute; inset: 0; color: var(--red); -webkit-text-fill-color: var(--red); opacity: 0; clip-path: inset(40% 0 40% 0); animation: glitch 5s infinite; }
@keyframes glitch { 0%, 93%, 100% { opacity: 0; transform: none; } 94% { opacity: .8; transform: translate(-3px, 1px); clip-path: inset(20% 0 55% 0); } 96% { opacity: .7; transform: translate(3px, -1px); clip-path: inset(60% 0 15% 0); } }
.tagline { color: var(--muted); font-size: 1.05rem; margin: 18px 0 0; }
.tagline em { color: var(--text); font-style: normal; font-weight: 700; }
.how { margin: 0; padding: 16px 16px 16px 36px; display: flex; flex-direction: column; gap: 10px; color: var(--muted); animation: enter .3s var(--ease); }
.how b { color: var(--text); }
.stats-card h3 { margin: 0 0 10px; font-size: .85rem; display: flex; gap: 6px; align-items: center; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-grid div { background: rgba(255,255,255,.03); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; }
.stat-grid b { font-family: var(--display); font-size: 1.1rem; }
.stat-grid span { font-size: .72rem; color: var(--muted); }

/* ---------- create ---------- */
.modes { display: flex; flex-direction: column; gap: 10px; }
.mode { display: grid; grid-template-columns: 54px 1fr; grid-template-rows: auto auto; gap: 2px 14px; text-align: left; padding: 16px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line); transition: border-color .2s, background .2s, transform .2s var(--ease); }
.mode:active { transform: scale(.985); }
.mode.sel { border-color: var(--violet); background: linear-gradient(135deg, rgba(177,77,255,.18), rgba(42,18,80,.5)); box-shadow: 0 0 0 1px var(--violet), 0 12px 30px -12px rgba(177,77,255,.6); }
.mode-glyph { grid-row: span 2; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-family: var(--display); font-size: 1.5rem; font-weight: 900;
  background: var(--card3); color: var(--violet); }
.mode.sel .mode-glyph { background: var(--violet); color: #fff; box-shadow: 0 0 20px rgba(177,77,255,.7); }
.mode-body { display: flex; flex-direction: column; }
.mode-body b { font-size: 1.05rem; }
.mode-body small { color: var(--muted); }
.mode-tag { grid-column: 2; font-size: .72rem; color: var(--violet); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- lobby ---------- */
.code-card { text-align: center; padding: 20px 16px; border-radius: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: radial-gradient(120% 120% at 50% 0%, rgba(177,77,255,.22), transparent 70%), var(--card); border: 1px solid var(--line2); }
.code { display: flex; gap: 8px; }
.code span { font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 11vw, 2.8rem); width: 1.35em; height: 1.6em; display: grid; place-items: center;
  background: var(--bg2); border-radius: 14px; border: 1px solid var(--line); color: #fff; text-shadow: 0 0 18px rgba(177,77,255,.9);
  animation: pop .5s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.8); } }
.player-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.player-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; animation: slidein .4s var(--ease) both; }
.player-row.away { opacity: .55; }
.player-row.empty { background: transparent; border-style: dashed; }
@keyframes slidein { from { opacity: 0; transform: translateX(-12px); } }
.pname { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname em { color: var(--muted); font-style: normal; font-weight: 500; }
.host-badge { display: inline-flex; gap: 4px; align-items: center; font-size: .72rem; font-weight: 800; color: var(--amber); background: rgba(255,176,32,.1); padding: 4px 8px; border-radius: 999px; }
.pts { font-family: var(--display); font-size: .8rem; color: var(--cyan); }
.row-actions { display: flex; gap: 6px; }
.collapser { display: flex; justify-content: space-between; align-items: center; background: none; border: 0; padding: 6px 2px; font-weight: 800; color: var(--muted); }
.collapser i { font-style: normal; transition: transform .25s; font-size: 1.2rem; }
.collapser i.open { transform: rotate(180deg); }
.waiting-host { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-weight: 600; text-align: center; }

/* avatars */
.avatar { position: relative; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #0b0912;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c) 60%, #fff), var(--c)); box-shadow: 0 0 0 2px rgba(0,0,0,.4), 0 0 18px -4px var(--c); transition: width .3s var(--ease), height .3s var(--ease); }
.avatar.dim { filter: grayscale(1) brightness(.5); box-shadow: none; }
.avatar.ring::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--c); animation: ring 1.3s ease-out infinite; }
.avatar.ghost { width: 40px; height: 40px; background: transparent; border: 2px dashed var(--line2); box-shadow: none; }
@keyframes ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.offline-dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--dim); border: 2px solid var(--bg); }

/* settings */
.settings { display: flex; flex-direction: column; gap: 12px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg2); border-radius: 14px; padding: 4px; gap: 4px; border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 10px 6px; border-radius: 10px; font-weight: 800; font-size: .85rem; color: var(--muted); transition: background .2s, color .2s; }
.seg button.on { background: var(--violet2); color: #fff; box-shadow: 0 4px 16px -4px rgba(124, 58, 237, .8); }
.stepper-row, .toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stepper-row.disabled, .toggle-row.disabled { opacity: .75; }
.toggle-row span { display: flex; flex-direction: column; }
.toggle-row small { color: var(--muted); font-size: .78rem; }
.stepper { display: flex; align-items: center; background: var(--bg2); border-radius: 12px; border: 1px solid var(--line); }
.stepper button { width: 38px; height: 38px; border: 0; background: none; font-size: 1.2rem; color: var(--violet); }
.stepper button:disabled { color: var(--dim); }
.stepper span { min-width: 44px; text-align: center; font-family: var(--display); font-size: .9rem; }
.toggle { width: 48px; height: 28px; border-radius: 999px; border: 0; background: var(--card3); position: relative; transition: background .2s; flex-shrink: 0; }
.toggle i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); }
.toggle.on { background: var(--violet); box-shadow: 0 0 16px -2px rgba(177,77,255,.8); }
.toggle.on i { transform: translateX(20px); }
.cats-head { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--bg2); border-radius: 999px; padding: 7px 12px; font-size: .85rem; font-weight: 700; color: var(--muted); display: inline-flex; gap: 6px; transition: all .2s; }
.chip.on { border-color: var(--violet); color: var(--text); background: rgba(177, 77, 255, .16); }
.sub { margin: 8px 0 0; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pw-row { display: flex; gap: 10px; align-items: center; }
.pw-form { display: flex; gap: 8px; width: 100%; }
.pw-form input { padding: 10px 14px; }
.warn { color: var(--amber); font-size: .85rem; margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: rgba(255,255,255,.05); border: 1px solid var(--line); white-space: nowrap; }
.pill.big { font-size: 1rem; padding: 8px 16px; }
.pill.dim { color: var(--muted); }
.pill.ok { color: var(--green); border-color: rgba(57,255,136,.3); }

/* ---------- game shared ---------- */
.round-pill { font-family: var(--display); font-size: .9rem; }
.round-pill em { font-style: normal; color: var(--muted); }
.game-sub { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: -6px; }
.secret-chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px dashed var(--line2); background: transparent; font-weight: 800; font-size: .8rem; color: var(--muted); max-width: 60%; }
.secret-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secret-chip.peek { color: var(--cyan); border-color: var(--cyan); border-style: solid; }
.secret-chip.imp.peek { color: var(--red); border-color: var(--red); }
.banner { padding: 10px 14px; border-radius: 14px; background: rgba(0,229,255,.08); border: 1px solid rgba(0,229,255,.25); font-size: .88rem; }
.banner.out { background: rgba(255,46,99,.08); border-color: rgba(255,46,99,.3); }
.timer { position: relative; display: grid; place-items: center; }
.timer svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 4; }
.timer-bg { stroke: rgba(255,255,255,.08); }
.timer-fg { stroke: var(--violet); stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .3s; filter: drop-shadow(0 0 4px var(--violet)); }
.timer b { font-family: var(--display); font-size: .85rem; }
.timer.urgent .timer-fg { stroke: var(--red); filter: drop-shadow(0 0 6px var(--red)); }
.timer.urgent b { color: var(--red); animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.15); } }
.timerbar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; width: 100%; margin-top: 8px; }
.timerbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--cyan)); transform-origin: left; transition: transform .25s linear; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--violet); animation: dot 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
.dots.big i { width: 12px; height: 12px; }
.dots.big { justify-content: center; margin-top: 12px; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-6px); opacity: 1; } }

/* ---------- reveal ---------- */
.flip { background: none; border: 0; padding: 0; perspective: 1200px; width: 100%; aspect-ratio: 3 / 4; max-height: 56dvh; margin: 0 auto; }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform .8s var(--ease); transform-style: preserve-3d; }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 28px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; border: 1px solid var(--line2); }
.front { background: repeating-linear-gradient(45deg, rgba(177,77,255,.06) 0 12px, transparent 12px 24px), linear-gradient(160deg, #241040, #110c1c); box-shadow: 0 30px 60px -30px rgba(177,77,255,.6); }
.fp-glyph { font-family: var(--display); font-size: 5rem; font-weight: 900; color: var(--violet); text-shadow: 0 0 40px var(--violet); animation: bob 2.6s ease-in-out infinite; }
.front small { color: var(--muted); }
.back { transform: rotateY(180deg); background: radial-gradient(100% 80% at 50% 0%, rgba(0,229,255,.18), transparent 70%), var(--card); border-color: rgba(0,229,255,.4); box-shadow: 0 30px 60px -30px rgba(0,229,255,.5); }
.flip.imp .back { background: radial-gradient(100% 80% at 50% 0%, rgba(255,46,99,.28), transparent 70%), #160910; border-color: rgba(255,46,99,.5); box-shadow: 0 30px 70px -25px rgba(255,46,99,.7); }
.role-title { font-family: var(--display); font-weight: 900; margin: 0; line-height: 1.05; word-break: break-word; }
.role-title.word { font-size: clamp(1.8rem, 9vw, 2.8rem); color: #fff; text-shadow: 0 0 24px rgba(0,229,255,.8); }
.role-title.imp { font-size: clamp(2rem, 10vw, 3rem); color: var(--red); text-shadow: 0 0 30px rgba(255,46,99,.9); animation: flickr 3s infinite; }
@keyframes flickr { 0%, 88%, 100% { opacity: 1; } 90% { opacity: .5; } 92% { opacity: 1; } 94% { opacity: .6; } }
.back p { color: var(--muted); margin: 0; }
.mates { color: var(--text) !important; }

/* ---------- clues ---------- */
.turn-strip { display: flex; gap: 10px; overflow-x: auto; padding: 8px 2px 4px; scrollbar-width: none; align-items: flex-end; }
.turn-strip::-webkit-scrollbar { display: none; }
.ts { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 52px; transition: opacity .3s; }
.ts small { font-size: .7rem; color: var(--muted); max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts.done { opacity: .45; }
.ts.now small { color: var(--text); font-weight: 800; }
.turn-callout { padding: 14px 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; }
.turn-callout b { font-family: var(--display); font-size: 1.05rem; }
.turn-callout span { color: var(--muted); font-size: .9rem; }
.turn-callout.mine { border-color: var(--violet); background: linear-gradient(135deg, rgba(177,77,255,.22), rgba(42,18,80,.4)); animation: mine 1.6s ease-in-out infinite; }
@keyframes mine { 50% { box-shadow: 0 0 30px -6px rgba(177,77,255,.8); } }
.feed { display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; min-height: 120px; padding-bottom: 8px; }
.clue { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; }
.clue.me { border-color: var(--line2); }
.clue.fresh { animation: cluein .45s var(--ease) both; }
@keyframes cluein { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.clue small { color: var(--muted); font-size: .72rem; font-weight: 700; }
.clue p { margin: 0; font-weight: 700; font-size: 1.05rem; word-break: break-word; }
.past-round { background: rgba(255,255,255,.02); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; }
.past-round summary { cursor: pointer; color: var(--muted); font-weight: 700; font-size: .85rem; }
.past-round .clue { margin-top: 6px; }
.clue-form { flex-direction: row; align-items: center; }
.clue-form input { flex: 1; border-radius: 999px; padding: 16px 20px; border-color: var(--line2); }
.send { width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--violet); color: #fff; display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 8px 24px -6px rgba(177,77,255,.8); }
.send:disabled { opacity: .4; }

/* ---------- voting ---------- */
.tie-banner { text-align: center; padding: 12px; border-radius: 16px; background: rgba(255,176,32,.1); border: 1px solid rgba(255,176,32,.4); color: var(--amber); animation: shake .5s; }
.tie-banner b { font-family: var(--display); margin-right: 6px; }
.vote-progress { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); font-weight: 700; }
.vp-bar { flex: 1; height: 6px; border-radius: 6px; background: rgba(255,255,255,.07); overflow: hidden; }
.vp-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--violet)); transition: width .4s var(--ease); }
.vote-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.vote-card { position: relative; text-align: left; padding: 12px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px;
  transition: transform .2s var(--ease), border-color .2s, opacity .3s, box-shadow .2s; overflow: hidden; min-height: 112px; }
.vote-card:active:not(:disabled) { transform: scale(.97); }
.vote-card:disabled { cursor: default; }
.vote-card.chosen { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 12px 30px -10px rgba(255,46,99,.7); background: linear-gradient(160deg, rgba(255,46,99,.16), var(--card)); }
.vote-card.faded { opacity: .45; }
.vc-top { display: flex; align-items: center; gap: 8px; }
.vc-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voted-tick { width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #052; display: grid; place-items: center; animation: pop .3s var(--ease); }
.vc-clues { display: flex; flex-wrap: wrap; gap: 4px; }
.vc-clues span { font-size: .78rem; padding: 3px 8px; border-radius: 8px; background: rgba(255,255,255,.05); color: var(--muted); font-weight: 700; }
.vc-clues span.cur { color: var(--text); background: rgba(177,77,255,.16); }
.stamp { position: absolute; right: -6px; bottom: 10px; transform: rotate(-12deg); font-family: var(--display); font-size: .65rem; font-weight: 900; letter-spacing: .1em;
  color: var(--red); border: 2px solid var(--red); padding: 2px 8px; border-radius: 6px; animation: stamp .3s var(--ease); background: rgba(7,6,11,.6); }
@keyframes stamp { from { transform: rotate(-12deg) scale(2); opacity: 0; } }

/* ---------- elimination ---------- */
.elim, .guess { justify-content: center; position: relative; overflow: hidden; }
.spotlight { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(50% 40% at 50% 35%, rgba(177,77,255,.22), transparent 70%); animation: sweep 3s ease-in-out infinite alternate; z-index: -1; }
.spotlight.red { background: radial-gradient(55% 45% at 50% 35%, rgba(255,46,99,.3), transparent 70%); }
.spotlight.cyan { background: radial-gradient(55% 45% at 50% 35%, rgba(0,229,255,.25), transparent 70%); }
@keyframes sweep { from { transform: translateX(-8%); } to { transform: translateX(8%); } }
.flicker { animation: flickr 1.2s infinite; }
.tally { display: flex; flex-direction: column; gap: 12px; }
.tally-row { display: grid; grid-template-columns: 32px 90px 1fr 24px; align-items: center; gap: 10px; animation: slidein .4s var(--ease) both; }
.tn { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbar { height: 14px; background: rgba(255,255,255,.06); border-radius: 8px; overflow: hidden; }
.tbar i { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--violet), var(--red)); animation: grow 1s var(--ease) forwards; }
@keyframes grow { to { width: var(--w); } }
.tally-row b { font-family: var(--display); text-align: right; }
.ejected { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.ej-avatar { animation: eject 1.4s var(--ease) both; }
@keyframes eject { 0% { transform: scale(.2) rotate(-200deg); opacity: 0; filter: blur(8px); } 60% { transform: scale(1.1) rotate(10deg); opacity: 1; filter: none; } 100% { transform: scale(1) rotate(0); } }
.ej-name { font-family: var(--display); font-size: 1.4rem; margin: 0; animation: enter .5s .4s var(--ease) both; }
.verdict { font-family: var(--display); font-weight: 900; font-size: clamp(1.4rem, 7vw, 2rem); padding: 10px 18px; border-radius: 14px; letter-spacing: .02em; animation: verdict .6s var(--ease) both; }
.verdict.imp { color: var(--red); border: 3px solid var(--red); text-shadow: 0 0 20px rgba(255,46,99,.9); box-shadow: 0 0 40px -6px rgba(255,46,99,.8), inset 0 0 20px -6px rgba(255,46,99,.6); }
.verdict.crew { color: var(--cyan); border: 3px solid var(--cyan); text-shadow: 0 0 20px rgba(0,229,255,.9); box-shadow: 0 0 40px -6px rgba(0,229,255,.7); }
@keyframes verdict { 0% { transform: scale(2.4) rotate(-8deg); opacity: 0; } 70% { transform: scale(.94) rotate(-3deg); opacity: 1; } 100% { transform: scale(1) rotate(-3deg); } }
.none-glyph { font-size: 4rem; color: var(--muted); animation: pop .5s var(--ease); }
.voters { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.voter-line { font-size: .8rem; color: var(--muted); text-align: center; animation: enter .4s var(--ease) both; }
.voter-line b { color: var(--text); }

/* ---------- guess ---------- */
.guess-center { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding-top: 4vh; }
.guess-form { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 6px; }
.guess-form input { text-align: center; font-size: 1.3rem; font-weight: 800; padding: 18px; border-color: rgba(255,46,99,.5); }
.guess-word { font-family: var(--display); font-size: clamp(1.8rem, 9vw, 2.6rem); margin: 0; word-break: break-word; animation: pop .6s var(--ease); }
.recap { width: 100%; text-align: left; color: var(--muted); }
.recap summary { cursor: pointer; font-weight: 700; text-align: center; }
.recap-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; justify-content: center; }
.recap-list span { padding: 4px 10px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: .85rem; }

/* ---------- results ---------- */
.win-banner { text-align: center; padding: 26px 16px 20px; border-radius: 24px; position: relative; overflow: hidden; animation: pop .6s var(--ease); }
.win-banner h1 { font-family: var(--display); font-weight: 900; font-size: clamp(1.9rem, 10vw, 2.8rem); margin: 6px 0; line-height: 1; }
.win-banner p { margin: 0; color: var(--muted); }
.win-banner.crew { background: radial-gradient(100% 120% at 50% 0%, rgba(0,229,255,.25), transparent 70%), var(--card); border: 1px solid rgba(0,229,255,.4); }
.win-banner.crew h1 { color: #fff; text-shadow: 0 0 30px rgba(0,229,255,.9); }
.win-banner.crew .eyebrow { color: var(--cyan); }
.win-banner.imp { background: radial-gradient(100% 120% at 50% 0%, rgba(255,46,99,.3), transparent 70%), #13080e; border: 1px solid rgba(255,46,99,.45); }
.win-banner.imp h1 { color: #fff; text-shadow: 0 0 30px rgba(255,46,99,.95); }
.win-banner.imp .eyebrow { color: var(--red); }
.reveal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.reveal-row > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.reveal-row b.big { font-family: var(--display); font-size: 1.2rem; word-break: break-word; }
.reveal-row small { color: var(--muted); }
.imp-list { display: flex; flex-direction: column; gap: 6px; }
.imp-list span { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.points-earned { text-align: center; margin: 0; font-family: var(--display); color: var(--green); font-size: .95rem; text-shadow: 0 0 14px rgba(57,255,136,.5); }
.scoreboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.scoreboard li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; animation: slidein .4s var(--ease) both; }
.scoreboard li.me { border-color: var(--line2); background: linear-gradient(90deg, rgba(177,77,255,.14), var(--card)); }
.scoreboard li:nth-child(1) .rank { background: var(--amber); color: #2a1a00; }
.rank { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; font-size: .8rem; background: var(--card3); }
.role-tag { margin-left: 6px; font-style: normal; font-size: .65rem; padding: 2px 6px; border-radius: 6px; background: rgba(255,46,99,.15); color: var(--red); text-transform: uppercase; letter-spacing: .08em; }
.wl { font-size: .75rem; color: var(--muted); }
.score { font-family: var(--display); font-size: .95rem; display: flex; flex-direction: column; align-items: flex-end; min-width: 48px; }
.score small { font-size: .65rem; color: var(--green); }
.lifetime { text-align: center; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.confetti i { position: absolute; top: -20px; left: calc(var(--i) * 4.2%); width: 8px; height: 14px; border-radius: 2px; opacity: .9;
  background: var(--violet); animation: fall calc(2.5s + (var(--i) * .07s)) calc(var(--i) * -.13s) linear 2 both; }
.confetti.crew i:nth-child(3n) { background: var(--cyan); } .confetti.crew i:nth-child(3n+1) { background: var(--green); }
.confetti.imp i:nth-child(2n) { background: var(--red); } .confetti.imp i:nth-child(3n) { background: #fff; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }

/* ---------- misc ---------- */
.empty-state { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 14vh; }
.pulse-orb { width: 80px; height: 80px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 60px var(--violet); animation: pulse 1.4s ease-in-out infinite alternate; }
.conn-banner { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 50; background: var(--amber); color: #201300;
  padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: .85rem; display: flex; gap: 8px; align-items: center; box-shadow: 0 10px 30px -10px rgba(0,0,0,.8); animation: enter .3s; }
.toasts { position: fixed; bottom: calc(96px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--card3); border: 1px solid var(--line2); padding: 12px 16px; border-radius: 14px; font-weight: 700; font-size: .9rem; text-align: center; animation: toast .35s var(--ease); box-shadow: 0 16px 30px -12px rgba(0,0,0,.9); }
.toast.error { border-color: rgba(255,46,99,.6); background: #2a0d18; }
@keyframes toast { from { opacity: 0; transform: translateY(16px) scale(.95); } }
.modal-wrap { position: fixed; inset: 0; z-index: 70; background: rgba(5,4,8,.7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card2); border: 1px solid var(--line2); border-radius: 22px; padding: 20px; width: min(100%, 380px); animation: pop .3s var(--ease); }
.modal h3 { margin: 0 0 6px; font-family: var(--display); font-size: 1.1rem; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

@media (min-width: 720px) {
  .screen { padding-top: 24px; }
  .vote-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =================== 3D PARTY ROOM =================== */
.room3d { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #0d0818; }
.room-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; }
.room-overlay { position: absolute; inset: 0; pointer-events: none; }
.np { position: absolute; left: 0; top: 0; pointer-events: none; border: 0; background: rgba(13, 8, 24, .78); color: #fff; font: 800 .78rem/1 var(--body);
  padding: 6px 10px; border-radius: 999px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; transform-origin: 50% 0;
  box-shadow: 0 0 0 1.5px var(--c), 0 6px 16px -6px rgba(0,0,0,.8); backdrop-filter: blur(4px); transition: opacity .3s, box-shadow .3s, background .3s; will-change: transform; }
.np em { font-style: normal; color: var(--muted); font-weight: 600; }
.np.away { opacity: .5 !important; }
.np.ghost { background: rgba(40, 40, 60, .6); color: #aaa; text-decoration: line-through; }
.np.active { background: var(--c); color: #0b0912; font-size: .95rem; padding: 8px 14px; box-shadow: 0 0 24px var(--c), 0 0 0 2px #fff; }
.np.active em { color: #0b0912aa; }
.np.pickable { pointer-events: auto; cursor: pointer; }
.np.pickable::before { content: ''; position: absolute; left: 50%; bottom: 0; width: 110px; height: var(--hit, 120px); transform: translateX(-50%); border-radius: 50px 50px 14px 14px; }
.np.pickable { animation: pickpulse 1.6s ease-in-out infinite; }
.np.picked { background: var(--red); color: #fff; box-shadow: 0 0 22px var(--red), 0 0 0 2px #fff; animation: none; }
@keyframes pickpulse { 50% { box-shadow: 0 0 0 1.5px var(--c), 0 0 18px var(--c); } }
.np-mic { font-style: normal; animation: pulse .4s ease-in-out infinite alternate; }
.np-st { font-size: .7rem; padding: 2px 6px; border-radius: 999px; background: var(--green); color: #052; }
.np-st.wait { background: rgba(255,255,255,.15); color: #ddd; }
.bubble { position: absolute; left: 0; top: 0; pointer-events: none; max-width: min(70vw, 260px); background: #fff; color: #140c22; font: 800 1.05rem/1.25 var(--body);
  padding: 10px 16px; border-radius: 20px; box-shadow: 0 10px 30px -8px rgba(0,0,0,.7); opacity: 0; text-align: center; word-break: break-word; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -8px; width: 16px; height: 16px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 3px; }
.bubble.show { animation: bubblein .45s var(--ease) both; }
@keyframes bubblein { from { scale: .4; } 70% { scale: 1.08; } to { scale: 1; } }

/* ---------- HUD over the 3D table ---------- */
.room { position: fixed; inset: 0; overflow: hidden; }
.hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; display: flex; flex-direction: column; }
.hud > *, .hud button, .hud input, .hud form, .hud .sheet-wrap { pointer-events: auto; }
.hud .turn-banner, .hud .tally-chips, .hud .verdict-layer, .hud .countdown, .hud .lobby-code .eyebrow { pointer-events: none; }
.glass { background: rgba(14, 9, 26, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.1); }
.glass-card { background: rgba(14, 9, 26, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(177,77,255,.3); border-radius: 22px; padding: 14px; box-shadow: 0 20px 50px -20px #000; }
.glass-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: rgba(14, 9, 26, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.1); white-space: nowrap; }
.glass-pill em { font-style: normal; color: var(--muted); }
.glass-pill .sep { margin-inline-start: 6px; padding-inline-start: 8px; border-inline-start: 1px solid rgba(255,255,255,.15); color: var(--muted); }
.code-inline { font-family: var(--display); letter-spacing: .12em; color: #fff; }
.hud-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 12px 0; }
.hud-mid { flex: 1; display: flex; justify-content: center; min-width: 0; }
.hud-mid .glass-pill { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hud-right { display: flex; align-items: center; gap: 6px; }
.hud-btn { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: rgba(14, 9, 26, .72); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(10px); flex-shrink: 0; }
.hud .timer { background: rgba(14, 9, 26, .72); border-radius: 50%; }
.secret-chip.glass { border-style: solid; color: #ddd; padding: 8px 12px; max-width: 140px; }
.hud-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 12px calc(14px + env(safe-area-inset-bottom)); max-width: 560px; width: 100%; align-self: center; }
.row-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-btns .grow, .grow { flex: 1; }
.row-btns .btn-ghost { background: rgba(14, 9, 26, .72); backdrop-filter: blur(10px); }
.lobby-meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.lobby-code { align-self: center; margin-top: 8px; padding: 10px 16px 6px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.code.sm span { font-size: 1.5rem; width: 1.5em; height: 1.7em; border-radius: 10px; }
.waiting-host.glass { background: rgba(14, 9, 26, .72); }
.waiting-host.small { padding: 10px; font-size: .85rem; }
.banner.glass { background: rgba(0, 40, 60, .7); }
.banner.glass.out { background: rgba(60, 10, 25, .75); }
.mic-ok { font-size: .8rem; font-weight: 800; color: var(--green); }
.gl-error { position: absolute; inset: 30% 16px auto; text-align: center; padding: 16px; border-radius: 16px; background: var(--card2); border: 1px solid var(--red); }

/* big phase banner (turns, voting, results) */
.turn-banner { align-self: center; margin-top: 10px; text-align: center; padding: 10px 22px 12px; border-radius: 20px; min-width: min(88vw, 340px); max-width: 92vw;
  background: rgba(14, 9, 26, .78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1.5px solid var(--c, rgba(177,77,255,.5));
  box-shadow: 0 0 30px -8px var(--c, rgba(177,77,255,.7)); animation: banner .55s var(--ease) both; }
@keyframes banner { from { opacity: 0; transform: translateY(-16px) scale(.9); } }
.turn-banner b { display: block; font-family: var(--display); font-weight: 900; font-size: clamp(1.15rem, 5.6vw, 1.7rem); letter-spacing: .01em; line-height: 1.1; color: #fff; text-shadow: 0 0 18px var(--c, #b14dff); }
.turn-banner .tb-small { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--c, var(--violet)); font-weight: 800; }
.turn-banner.mine { --c: #39ff88; animation: banner .55s var(--ease) both, mine 1.4s ease-in-out infinite; }
.turn-banner.vote { --c: #ff2e63; }
.turn-banner.tie { --c: #ffb020; }
.turn-banner.imp { --c: #ff2e63; }
.turn-banner.result.crew { --c: #00e5ff; }
.turn-banner.result.imp { --c: #ff2e63; }
.turn-banner .timerbar { margin-top: 8px; }
.turn-banner .vp { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: .75rem; color: var(--muted); font-weight: 700; }
.turn-banner .vp-bar { flex: 1; height: 5px; border-radius: 5px; background: rgba(255,255,255,.1); overflow: hidden; }
.turn-banner .vp-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--violet)); transition: width .4s; }
.guess-big { font-size: clamp(1.4rem, 7vw, 2.2rem) !important; }

/* countdown */
.countdown { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle, rgba(13,8,24,.2), rgba(13,8,24,.65)); }
.countdown span { font-family: var(--display); font-weight: 900; font-size: clamp(6rem, 34vw, 12rem); color: #fff; text-shadow: 0 0 40px var(--violet), 0 0 90px var(--violet); animation: count .95s var(--ease) both; }
.countdown span.go { font-size: clamp(3.2rem, 17vw, 7rem); color: #fff; text-shadow: 0 0 40px var(--green), 0 0 90px var(--green); }
@keyframes count { from { transform: scale(2.4); opacity: 0; } 30% { transform: scale(1); opacity: 1; } to { transform: scale(.85); opacity: .9; } }

/* secret role card */
.role-layer { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 70px 16px calc(18px + env(safe-area-inset-bottom));
  background: rgba(8, 5, 16, .62); backdrop-filter: blur(3px); animation: fade .4s; }
.role-hint { margin: 0; color: var(--muted); font-weight: 700; }
.flip.mini { width: min(78vw, 320px); aspect-ratio: 3 / 4; max-height: 54dvh; }
.flip.mini .role-title.imp { font-size: clamp(1.5rem, 7.5vw, 2.1rem); }
.role-ready { width: min(78vw, 320px) !important; }

/* clue input / voice */
.clue-form { display: flex; gap: 8px; align-items: center; }
.clue-form input { flex: 1; border-radius: 999px; padding: 16px 20px; background: rgba(14,9,26,.85); border-color: var(--green); box-shadow: 0 0 24px -8px var(--green); }
.voice-live { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 999px; font-weight: 800; }
.voice-live .btn { margin-inline-start: auto; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); animation: pulse .6s infinite alternate; }
.clue-drawer { border-radius: 18px; overflow: hidden; }
.cd-toggle { width: 100%; background: none; border: 0; color: #fff; font-weight: 800; padding: 10px 14px; display: flex; gap: 8px; align-items: center; }
.cd-toggle i { margin-inline-start: auto; font-style: normal; color: var(--muted); }
.cd-toggle .count { background: var(--violet); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: .75rem; }
.cd-list { max-height: 34dvh; overflow-y: auto; padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.cd-row { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.cd-row b { min-width: 64px; }
.cd-row span { display: flex; flex-wrap: wrap; gap: 4px; }
.cd-row em { font-style: normal; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: rgba(255,255,255,.07); color: var(--muted); }
.cd-row em.cur { color: #fff; background: rgba(177,77,255,.25); }

/* elimination */
.tally-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 10px 12px 0; }
.tally-chip { animation: enter .4s var(--ease) both; }
.vote-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); display: inline-block; animation: pop .35s var(--ease) both; }
.verdict-layer { position: absolute; left: 0; right: 0; bottom: 18%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.verdict-layer .verdict { background: rgba(8,5,16,.75); }
.verdict-sub { margin: 0; padding: 6px 14px; border-radius: 999px; background: rgba(8,5,16,.7); font-weight: 700; }

/* guess */
.guess-form.glass-card { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.guess-form.glass-card .pill { align-self: center; }

/* results */
.results-sheet { display: flex; flex-direction: column; gap: 10px; max-height: 62dvh; overflow-y: auto; margin: auto 12px calc(12px + env(safe-area-inset-bottom)); align-self: center; width: min(560px, calc(100% - 24px)); }
.results-sheet .cd-toggle { padding: 2px 4px 6px; justify-content: center; color: var(--muted); }
.scoreboard.compact li { padding: 6px 10px; }
.player-list.compact .player-row { padding: 6px 10px; }

/* settings sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(5,3,10,.6); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { width: min(560px, 100%); max-height: 86dvh; display: flex; flex-direction: column; background: var(--card2); border: 1px solid var(--line2); border-bottom: 0; border-radius: 24px 24px 0 0; animation: sheetup .35s var(--ease); }
@keyframes sheetup { from { transform: translateY(100%); } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 8px; }
.sheet-head h3 { margin: 0; font-family: var(--display); font-size: 1rem; }
.sheet-body { overflow-y: auto; padding: 4px 16px calc(20px + env(safe-area-inset-bottom)); }
.speech-row { display: flex; flex-direction: column; gap: 8px; }
.seg.two { grid-template-columns: 1fr 1fr; }
.np-st.host { background: var(--amber); color: #2a1a00; }
@media (min-width: 900px) { .hud-bottom { padding-bottom: 22px; } .turn-banner { margin-top: 16px; } }

@media (max-width: 480px) { .glass-pill .sep { display: none; } }

/* ---------- public games ---------- */
.two-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two-btns .btn { padding: 14px 10px; }
.room-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.room-row { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  transition: border-color .2s, transform .15s var(--ease); animation: slidein .35s var(--ease) both; }
.room-row:hover:not(:disabled) { border-color: var(--violet); }
.room-row:active:not(:disabled) { transform: scale(.98); }
.rr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rr-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-main small { color: var(--muted); font-size: .78rem; }
.rr-st.ok { color: var(--green); } .rr-st.busy { color: var(--amber); }
.rr-count { font-family: var(--display); font-size: .9rem; color: var(--muted); }
.rr-count b { color: #fff; }
.rr-join { padding: 8px 14px; border-radius: 999px; background: var(--violet2); color: #fff; font-weight: 800; font-size: .85rem; }
.empty-public { text-align: center; }
.empty-public p { margin: 4px 0; }

/* ---------- languages ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lang-picker { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03); cursor: pointer; }
.lang-picker select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; color: var(--text); font: 700 .9rem var(--body); padding-inline-end: 14px; cursor: pointer; outline: none; }
.lang-picker::after { content: '⌄'; position: absolute; inset-inline-end: 10px; top: 9px; color: var(--muted); pointer-events: none; }
.lang-picker select option { background: var(--card2); color: var(--text); }
.stepper-row .lang-picker { height: 38px; }
.rr-flag { font-size: 1.4rem; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
[dir="rtl"] .how { padding: 16px 36px 16px 16px; }
[dir="rtl"] .turn-banner b, [dir="rtl"] .countdown span, [dir="rtl"] .logo h1 { letter-spacing: 0; }
[dir="rtl"] .toggle.on i { transform: translateX(20px); }

.music-btn span { font-size: 1.05rem; line-height: 1; }
.music-btn.off span { filter: grayscale(1); opacity: .35; }
