:root {
  color-scheme: dark;
  --ink: #08111f;
  --ink-2: #0e1b2d;
  --ink-3: #14263a;
  --paper: #f2ead8;
  --paper-2: #dcd1bb;
  --cyan: #54d7d0;
  --cyan-dark: #153a52;
  --amber: #ffb24d;
  --red: #ff6474;
  --green: #57d594;
  --text: #f7f3e9;
  --muted: #a6b4c4;
  --line: rgba(255, 255, 255, .12);
  --shadow: 0 26px 80px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--ink); }
body {
  min-height: 100svh;
  color: var(--text);
  font-family: "Aptos", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(circle at 10% 0, rgba(84, 215, 208, .12), transparent 30rem),
    radial-gradient(circle at 95% 15%, rgba(255, 178, 77, .09), transparent 25rem),
    linear-gradient(180deg, #08111f, #091522 70%, #07101d);
  overflow-x: hidden;
}
body::before, body::after { content: ""; position: fixed; z-index: 0; width: 24rem; height: 24rem; border-radius: 50%; filter: blur(90px); opacity: .12; pointer-events: none; animation: ambient-drift 14s ease-in-out infinite alternate; }
body::before { left: -12rem; top: 18%; background: var(--cyan); }
body::after { right: -14rem; bottom: 4%; background: var(--amber); animation-delay: -7s; }
@keyframes ambient-drift { to { transform: translate3d(3rem, -2rem, 0) scale(1.12); } }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(84, 215, 208, .45); outline-offset: 2px; }
.hidden { display: none !important; }

.app-shell {
  width: min(100%, 1160px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) clamp(18px, 4vw, 46px) max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.brand { border: 0; padding: 0; background: transparent; color: var(--text); display: flex; align-items: center; gap: 11px; text-align: left; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--paper); color: var(--cyan-dark); font-weight: 800; letter-spacing: -.025em; box-shadow: 0 10px 28px rgba(0, 0, 0, .25); }
.brand b, .brand small { display: block; }
.brand b { font-size: 1rem; letter-spacing: -.02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .78rem; font-weight: 650; }
.icon-button { width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .045); color: var(--paper); font-weight: 700; }
#app { flex: 1; display: flex; flex-direction: column; view-transition-name: app-view; }
.screen { width: 100%; min-height: calc(100svh - 105px); display: flex; flex-direction: column; }
.screen.center { width: min(100%, 720px); margin-inline: auto; }
::view-transition-old(app-view) { animation: view-out .14s ease both; }
::view-transition-new(app-view) { animation: view-in .24s cubic-bezier(.2,.8,.2,1) both; }
@keyframes view-out { to { opacity: 0; transform: translateY(-5px); } }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Trebuchet MS", "Aptos Display", "Segoe UI", sans-serif; font-weight: 700; overflow-wrap: break-word; word-break: normal; }
.button, .theme-option, .section-label span { overflow-wrap: break-word; word-break: normal; }
h1 { max-width: 900px; font-size: clamp(2.9rem, 8vw, 5.65rem); line-height: 1.08; letter-spacing: -.035em; margin-bottom: 24px; }
h1 > span { display: block; }
h1 > .accent { margin-top: .08em; }
h2 { font-size: clamp(2.1rem, 5vw, 3.75rem); line-height: 1.08; letter-spacing: -.03em; margin-bottom: 13px; text-wrap: balance; }
h3 { font-size: 1.05rem; line-height: 1.25; letter-spacing: -.01em; }
p { color: var(--muted); font-size: 1rem; line-height: 1.5; margin-bottom: 0; }
.kicker { color: var(--amber); font-size: .76rem; line-height: 1.3; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 11px; }
.accent { color: var(--cyan); }
.ui-icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.danger-text { color: var(--red); }
.paper-text { color: var(--paper); }
.center { text-align: center; align-items: center; justify-content: center; }
.subtle { font-size: .82rem; }
.microcopy { max-width: 540px; font-size: .9rem; line-height: 1.42; }
.counter { margin-top: 14px; color: var(--cyan); font-size: .8rem; font-weight: 800; letter-spacing: .1em; }

.hero-copy { padding-top: clamp(20px, 8vh, 88px); }
.hero-copy > p { max-width: 520px; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: clamp(30px, 6vh, 64px) 0 18px; }
.mode-card { min-height: 178px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255, 255, 255, .045); color: var(--text); text-align: left; padding: 18px; display: flex; flex-direction: column; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.mode-card:hover { transform: translateY(-2px); border-color: rgba(84, 215, 208, .42); background: rgba(84, 215, 208, .07); }
.mode-card.online:hover { border-color: rgba(255, 178, 77, .42); background: rgba(255, 178, 77, .06); }
.mode-card:disabled { opacity: .62; cursor: not-allowed; transform: none; }
.mode-icon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: rgba(84, 215, 208, .12); color: var(--cyan); font-size: 1.3rem; font-weight: 800; margin-bottom: 24px; animation: icon-float 4s ease-in-out infinite; }
.mode-icon .ui-icon { width: 24px; height: 24px; }
.online .mode-icon { background: rgba(255, 178, 77, .12); color: var(--amber); }
.mode-card.online .mode-icon { animation-delay: -2s; }
@keyframes icon-float { 50% { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(84, 215, 208, .1); } }
.mode-card strong { font-size: 1.02rem; }
.mode-card small { display: block; margin-top: 5px; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.status-line { margin-top: auto; display: flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #708095; }
.status-dot.ok { background: var(--green); box-shadow: 0 0 0 4px rgba(87, 213, 148, .09); }
.resume-card { margin-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid rgba(255, 178, 77, .24); background: rgba(255, 178, 77, .07); border-radius: 18px; padding: 13px 14px; }
.resume-card strong, .resume-card small { display: block; }
.resume-card > div { min-width: 0; }
.resume-card small { color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.panel { border: 1px solid var(--line); background: rgba(255, 255, 255, .04); border-radius: 22px; padding: 18px; }
.panel + .panel { margin-top: 12px; }
.section-head { margin-bottom: 28px; }
.section-head p { max-width: 520px; }
.section-label { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin: 0 2px 9px; color: #dfe7ee; font-size: .88rem; font-weight: 800; }
.section-label span:last-child { color: var(--muted); font-weight: 600; font-size: .82rem; }
.form-stack { display: grid; gap: 11px; }
.input, .select {
  width: 100%; min-height: 54px; border: 1px solid var(--line); border-radius: 15px;
  background: var(--ink-2); color: var(--text); padding: 14px 15px; outline: 0;
}
.input::placeholder { color: #6f8194; }
.player-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px 34px; gap: 8px; align-items: center; }
.player-number, .avatar { display: grid; place-items: center; background: var(--ink-3); color: var(--cyan); font-weight: 800; }
.player-number { width: 42px; height: 52px; border-radius: 14px; }
.remove-button { width: 34px; height: 42px; border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; }
.remove-button:disabled { opacity: .2; cursor: not-allowed; }
.player-picker-button { width: 42px; height: 42px; border: 1px solid rgba(84,215,208,.24); border-radius: 13px; background: rgba(84,215,208,.07); color: var(--cyan); display: grid; place-items: center; }
.player-picker-button:hover { background: rgba(84,215,208,.14); border-color: rgba(84,215,208,.5); }
.add-button { width: 100%; border: 1px dashed rgba(84, 215, 208, .35); background: rgba(84, 215, 208, .04); color: var(--cyan); border-radius: 15px; padding: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; }
.session-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.session-tools span { color: var(--muted); font-size: .78rem; line-height: 1.4; }
.text-button { border: 0; padding: 5px 2px; background: transparent; color: var(--cyan); font-size: .82rem; font-weight: 700; }
.text-button.muted { color: var(--muted); }
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.theme-option { min-height: 70px; border: 1px solid var(--line); border-radius: 16px; background: var(--ink-2); color: var(--text); padding: 12px; text-align: left; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.theme-option:hover { transform: translateY(-1px); border-color: rgba(84, 215, 208, .4); }
.theme-option.selected { border-color: var(--amber); background: rgba(255, 178, 77, .08); box-shadow: inset 0 0 0 1px rgba(255, 178, 77, .15); }
.theme-option strong, .theme-option small { display: block; }
.theme-option small { color: var(--muted); margin-top: 4px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.toggle-row.spaced { margin-top: 18px; }
.toggle-copy strong, .toggle-copy small { display: block; }
.toggle-copy small { color: var(--muted); margin-top: 4px; line-height: 1.35; }
.switch { width: 52px; height: 30px; flex: 0 0 52px; border: 0; border-radius: 99px; padding: 3px; background: #35465a; }
.switch::before { content: ""; display: block; width: 24px; height: 24px; border-radius: 50%; background: white; transition: transform .18s ease; }
.switch.on { background: var(--cyan-dark); }
.switch.on::before { transform: translateX(22px); background: var(--cyan); }

.actions { display: grid; gap: 10px; margin-top: auto; padding-top: 24px; }
.screen.center > .actions { margin-top: 28px; padding-top: 0; }
.actions.inline { grid-template-columns: 1fr 1fr; }
.button { min-height: 55px; border-radius: 16px; border: 0; padding: 14px 17px; font-weight: 700; line-height: 1.35; white-space: normal; display: flex; align-items: center; justify-content: center; gap: 9px; transition: transform .14s ease, opacity .14s ease; }
.button:active { transform: scale(.985); }
.button:disabled { opacity: .38; cursor: not-allowed; }
.button.primary { background: var(--paper); color: var(--cyan-dark); box-shadow: 0 14px 36px rgba(0, 0, 0, .23); }
.button.amber { background: var(--amber); color: #1a2130; }
.button.danger { background: var(--red); color: #210a10; }
.button.secondary { border: 1px solid var(--line); background: var(--ink-2); color: var(--text); }
.button.ghost { background: transparent; color: var(--muted); min-height: 44px; }
.button.compact { min-height: 42px; padding: 9px 13px; border-radius: 13px; }

.setup-grid, .entry-grid { display: grid; gap: 14px; }
.setup-options { display: grid; gap: 12px; align-content: start; }
.name-panel { margin-bottom: 14px; }
.name-suggestions { display: flex; gap: 7px; overflow-x: auto; margin-top: 10px; padding-bottom: 2px; scrollbar-width: thin; }
.name-suggestions button { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 99px; background: rgba(255,255,255,.035); color: var(--muted); padding: 7px 10px; font-size: .8rem; font-weight: 800; }
.join-panel { display: flex; flex-direction: column; justify-content: space-between; }
.room-input { text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }

.stage-line {
  width: 100%; display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 8px; margin: 0 0 clamp(26px, 5vh, 52px);
}
.round-pill, .stage { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; border-radius: 99px; padding: 7px 11px; font-size: .8rem; font-weight: 700; }
.round-pill { background: rgba(255,255,255,.07); color: var(--muted); }
.stage { border: 1px solid var(--line); color: #748497; }
.stage i { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.06); font-size: .66rem; font-style: normal; }
.stage.active { color: var(--text); border-color: rgba(84,215,208,.5); background: rgba(84,215,208,.1); }
.stage.active i { color: #08212b; background: var(--cyan); }
.stage.active i { animation: stage-pulse 1.8s ease-in-out infinite; }
.stage.done { color: var(--green); border-color: rgba(87,213,148,.24); }
@keyframes stage-pulse { 50% { box-shadow: 0 0 0 6px rgba(84,215,208,.1); } }

.clue-prompt, .question-card {
  width: min(100%, 610px); margin: 26px auto 0; border-radius: 18px; text-align: left;
  padding: clamp(22px, 4vw, 34px); border: 1px solid rgba(84,215,208,.28); border-left: 4px solid var(--cyan);
  background: #102338;
}
.clue-prompt small, .question-card small { display: block; color: var(--cyan); font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.clue-prompt strong { display: block; margin: 10px 0 14px; color: var(--text); font-size: clamp(1.65rem, 4vw, 2.7rem); line-height: 1.12; letter-spacing: -.02em; overflow-wrap: break-word; }
.clue-prompt p { font-size: 1rem; line-height: 1.5; }
.question-card { border-color: rgba(255,178,77,.32); border-left-color: var(--amber); background: #172335; }
.question-card small { color: var(--amber); margin-bottom: 14px; }
.question-card strong { display: block; color: var(--text); font-size: clamp(1.05rem, 2.5vw, 1.35rem); line-height: 1.45; font-weight: 700; }
.question-card strong + strong { margin-top: 8px; color: #c9d3dd; }

.word-card {
  width: min(100%, 590px); min-height: 390px; margin: 24px auto; border-radius: 32px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(24px, 6vw, 54px);
  background: linear-gradient(145deg, #f6f0e4, #d9cfbb); color: #0b1c2e; box-shadow: var(--shadow);
  overflow: hidden; position: relative;
}
.word-card::after { content: "AS"; position: absolute; right: -10px; bottom: -36px; color: rgba(8,17,31,.055); font-size: 9rem; font-weight: 800; letter-spacing: -.05em; }
.word-card.locked { background: linear-gradient(145deg, #13263b, #0d1a2b); color: var(--text); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
.word-card.locked::after { color: rgba(255,255,255,.025); }
.word-card.locked strong { font-size: clamp(1.7rem, 5vw, 2.8rem); line-height: 1.15; letter-spacing: -.02em; }
.word-card.locked small { margin-top: 10px; color: var(--muted); font-size: .88rem; }
.lock-mark { width: 68px; height: 68px; margin-bottom: 26px; border: 1px solid rgba(84,215,208,.35); border-radius: 22px; display: grid; place-items: center; color: var(--cyan); box-shadow: inset 0 0 28px rgba(84,215,208,.08); }
.word-card.revealed > span { color: #6a675f; font-size: .76rem; font-weight: 800; letter-spacing: .14em; }
.word-card .secret-word { position: relative; z-index: 1; margin: 20px 0 16px; font-family: "Trebuchet MS", "Aptos Display", "Segoe UI", sans-serif; font-size: clamp(2.8rem, 9vw, 5.7rem); font-weight: 800; line-height: 1.05; letter-spacing: -.025em; overflow-wrap: break-word; word-break: normal; }
.word-card p { position: relative; z-index: 1; max-width: 430px; color: #53606b; font-size: .88rem; text-align: center; }
.word-card > small { margin-top: 12px; color: #687684; }
.word-card.ghost { color: var(--text); background: linear-gradient(145deg, #25364b, #111e2f); }
.word-card.ghost > span, .word-card.ghost > small { color: var(--amber); }
.word-card.ghost p { color: #b8c3ce; }
.word-card.revealed { animation: card-arrive .36s cubic-bezier(.2,.8,.2,1); }
@keyframes card-arrive { from { opacity: .45; transform: perspective(700px) rotateY(-7deg) translateY(8px); } }
.word-card.compact-card { min-height: 270px; margin: 0; padding: 28px; }
.word-card.compact-card .secret-word { font-size: clamp(2.4rem, 7vw, 4.5rem); }

.verdict-card {
  width: min(100%, 690px); min-height: 360px; border-radius: 34px; padding: clamp(30px, 7vw, 64px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: rgba(255,255,255,.045); box-shadow: var(--shadow);
}
.verdict-card span { color: var(--amber); font-size: .76rem; font-weight: 800; letter-spacing: .13em; }
.verdict-card h2 { margin: 18px 0 14px; }
.verdict-card p { max-width: 480px; font-size: .92rem; }
.verdict-card.success { border-color: rgba(87,213,148,.38); background: radial-gradient(circle at 50% 0, rgba(87,213,148,.18), rgba(87,213,148,.04)); }
.verdict-card.success span { color: var(--green); }
.verdict-card.failure { border-color: rgba(255,100,116,.38); background: radial-gradient(circle at 50% 0, rgba(255,100,116,.18), rgba(255,100,116,.04)); }
.verdict-card.failure span { color: var(--red); }
.verdict-card.neutral { border-color: rgba(255,178,77,.32); }

.game-layout { gap: 28px; }
.game-main, .game-side { min-width: 0; }
.game-side .actions { margin-top: 0; }

.dossier {
  position: relative; width: 100%; max-width: 430px; min-height: 390px; margin: 22px auto;
  border-radius: 12px 28px 28px 12px; background: var(--paper); color: #132335;
  padding: 28px; box-shadow: var(--shadow); text-align: left; overflow: hidden;
}
.dossier::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 9px; background: var(--amber); }
.dossier::after { content: "CONFIDENTIEL"; position: absolute; right: -34px; top: 39px; transform: rotate(28deg); color: rgba(150, 42, 38, .14); font-size: 1.2rem; font-weight: 800; border: 4px solid rgba(150, 42, 38, .12); padding: 7px 35px; }
.dossier .kicker { color: #9b4b1c; }
.dossier h2 { color: #102337; margin-top: 42px; }
.dossier .secret-word { font-family: "Trebuchet MS", "Aptos Display", "Segoe UI", sans-serif; font-size: clamp(2.35rem, 10vw, 4.15rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.08; margin: 30px 0 12px; overflow-wrap: break-word; word-break: normal; }
.dossier p { color: #4d5d69; }
.dossier.infiltrator::before { background: var(--red); }
.dossier.ghost::before { background: #8d99a8; }
.dossier.closed { display: grid; place-items: center; text-align: center; }
.dossier.closed h2 { margin-top: 0; }
.dossier.closed .seal { width: 92px; height: 92px; border: 2px solid #153a52; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; margin-bottom: 25px; }

.avatar { width: 82px; height: 82px; border-radius: 25px; font-size: 2rem; margin-bottom: 20px; }
.protocol-card { width: 100%; margin: 24px 0; border: 1px solid rgba(84, 215, 208, .22); background: rgba(84, 215, 208, .065); border-radius: 20px; padding: 17px; text-align: left; }
.protocol-card span { display: block; color: var(--cyan); font-size: .75rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.protocol-card strong { display: block; margin: 7px 0 4px; font-size: 1.18rem; }
.protocol-card small { color: var(--muted); line-height: 1.4; }
.round-screen { justify-content: flex-start; }
.round-screen .stage-line { margin-bottom: 18px; }
.round-board {
  position: relative; isolation: isolate; overflow: hidden; width: min(100%, 980px); margin: 0 auto;
  display: grid; gap: 24px; padding: clamp(20px, 4vw, 34px); border: 1px solid rgba(255,255,255,.13);
  border-radius: 24px; background: #0c1a2a; box-shadow: 0 28px 75px rgba(0,0,0,.28);
}
.round-board::before { content: ""; position: absolute; z-index: 2; inset: 0 0 auto; height: 4px; background: var(--cyan); }
.round-board.question-round::before { background: var(--amber); }
.round-board::after { content: "AS"; position: absolute; z-index: -1; right: -18px; top: 38px; color: rgba(255,255,255,.025); font-family: "Trebuchet MS", sans-serif; font-size: 10rem; font-weight: 800; letter-spacing: -.08em; }
.round-identity { display: grid; grid-template-columns: 72px minmax(0,1fr); align-items: center; gap: 18px; text-align: left; }
.round-identity .avatar { width: 72px; height: 72px; margin: 0; border-radius: 20px; font-size: 1.7rem; }
.round-identity .kicker { color: var(--cyan); margin-bottom: 7px; }
.question-round .round-identity .kicker { color: var(--amber); }
.round-title { margin: 0; font-size: clamp(2rem, 4.5vw, 3.25rem); line-height: 1.06; letter-spacing: -.025em; text-wrap: pretty; }
.round-title span, .round-title small { display: block; }
.round-title small { margin-top: 5px; color: #d6dee6; font-family: "Aptos", "Segoe UI", sans-serif; font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 600; line-height: 1.3; letter-spacing: 0; }
.round-identity .microcopy { margin-top: 13px; font-size: .96rem; }
.round-task { min-width: 0; }
.round-task .clue-prompt, .round-task .question-card { width: 100%; margin: 0; }
.round-footer { display: grid; gap: 20px; padding-top: 22px; border-top: 1px solid var(--line); }
.round-footer .actions { width: 100%; margin: 0; padding: 0; }
.turn-label { color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.turn-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(82px, 1fr)); gap: 8px; margin-top: 10px; }
.turn-chip { min-width: 0; display: flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 11px; padding: 9px 10px; background: rgba(255,255,255,.035); color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turn-chip i { width: 21px; height: 21px; flex: 0 0 21px; display: grid; place-items: center; border-radius: 7px; background: rgba(255,255,255,.07); font-size: .68rem; font-style: normal; font-weight: 700; }
.turn-chip.current { border-color: rgba(84,215,208,.42); color: var(--text); background: rgba(84,215,208,.09); }
.question-round .turn-chip.current { border-color: rgba(255,178,77,.42); background: rgba(255,178,77,.09); }
.turn-chip.done { opacity: .45; }

.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; }
.choice { min-height: 98px; border: 1px solid var(--line); border-radius: 18px; padding: 13px; background: var(--ink-2); color: var(--text); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; }
.choice .mini-avatar { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--ink-3); color: var(--cyan); font-weight: 800; }
.choice.selected { border-color: var(--amber); background: rgba(255, 178, 77, .09); box-shadow: inset 0 0 0 1px rgba(255, 178, 77, .18); }
.suspect-list { width: 100%; display: grid; gap: 10px; margin: 23px 0; }
.suspect { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid rgba(255, 178, 77, .22); background: rgba(255, 178, 77, .07); border-radius: 17px; padding: 13px; }
.suspect .rank { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--amber); color: #17202d; font-weight: 800; }
.suspect strong, .suspect small { display: block; }
.suspect small { color: var(--muted); margin-top: 3px; }
.waiting { width: 100%; max-width: 440px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 255, 255, .04); padding: 22px; margin-top: 22px; }
.spinner { width: 40px; height: 40px; margin: 0 auto 15px; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.room-code { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid rgba(255, 178, 77, .25); background: rgba(255, 178, 77, .07); border-radius: 19px; padding: 14px 16px; margin: 18px 0; }
.room-code span, .room-code strong { display: block; }
.room-code span { color: var(--muted); font-size: .75rem; }
.room-code strong { margin-top: 2px; color: var(--amber); font-size: 1.55rem; letter-spacing: .13em; }
.player-list { display: grid; gap: 8px; }
.lobby-player, .result-row { display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, .035); border-radius: 15px; padding: 11px; }
.mini-avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--ink-3); color: var(--cyan); font-weight: 800; }
.player-info { flex: 1; min-width: 0; }
.player-info strong, .player-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-info small { color: var(--muted); margin-top: 3px; font-size: .8rem; }
.badge { border-radius: 99px; padding: 6px 9px; background: rgba(255,255,255,.06); color: var(--muted); font-size: .75rem; font-weight: 700; }
.badge.ready { background: rgba(87, 213, 148, .1); color: var(--green); }
.badge.threat { background: rgba(255, 100, 116, .1); color: #ff8b98; }
.score { color: var(--amber); font-size: 1.15rem; font-weight: 800; }
.winner-panel { border: 1px solid rgba(84, 215, 208, .23); background: rgba(84, 215, 208, .07); border-radius: 24px; padding: 24px 18px; text-align: center; margin-bottom: 22px; }
.winner-panel.threat { border-color: rgba(255, 100, 116, .24); background: rgba(255, 100, 116, .07); }
.winner-symbol { font-size: 3rem; margin-bottom: 8px; }
.winner-symbol { animation: icon-float 3s ease-in-out infinite; }
.pair-line { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pair-line span { border: 1px solid var(--line); border-radius: 99px; padding: 7px 10px; color: var(--paper); font-size: .8rem; }

.rules-dialog { width: min(calc(100% - 28px), 500px); border: 1px solid var(--line); border-radius: 25px; background: #0e1b2d; color: var(--text); padding: 25px; box-shadow: var(--shadow); }
.rules-dialog::backdrop { background: rgba(2, 8, 16, .82); backdrop-filter: blur(5px); }
.rules-dialog ol { padding-left: 21px; color: #d8e2ea; line-height: 1.5; }
.rules-dialog li + li { margin-top: 8px; }
.dialog-close { position: absolute; right: 13px; top: 11px; border: 0; background: transparent; color: var(--muted); font-size: 1.6rem; }
.player-picker-dialog h2 { font-size: clamp(2rem, 8vw, 3.2rem); margin-right: 28px; }
.player-picker-dialog > p:not(.kicker) { font-size: .88rem; }
.dialog-field { display: block; margin: 22px 0 7px; color: var(--paper); font-size: .78rem; font-weight: 700; }
.saved-player-list { display: grid; gap: 7px; max-height: 250px; overflow-y: auto; margin-top: 18px; }
.saved-player { display: grid; grid-template-columns: minmax(0, 1fr) 42px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.035); overflow: hidden; }
.saved-player > button:first-child { min-width: 0; border: 0; background: transparent; color: var(--text); display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 10px; align-items: center; text-align: left; padding: 9px; }
.saved-player strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-player small { color: var(--cyan); font-size: .76rem; font-weight: 700; }
.saved-player > button:last-child { border: 0; background: transparent; color: var(--muted); font-size: 1.15rem; }
.empty-picker { padding: 15px; border: 1px dashed var(--line); border-radius: 15px; color: var(--muted); text-align: center; font-size: .82rem; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translate(-50%, 18px); max-width: calc(100% - 30px); background: var(--paper); color: #102337; border-radius: 99px; padding: 11px 16px; font-size: .82rem; font-weight: 700; opacity: 0; pointer-events: none; transition: .2s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 620px) {
  .theme-grid { grid-template-columns: repeat(3, 1fr); }
  .choice-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 860px) {
  .topbar { margin-bottom: 34px; }
  .setup-grid { grid-template-columns: minmax(320px, .8fr) minmax(440px, 1.2fr); gap: 18px; align-items: start; }
  .entry-grid { grid-template-columns: 1.35fr .65fr; gap: 18px; }
  .name-panel { max-width: 560px; }
  .game-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); align-items: center; }
  .game-layout .stage-line { justify-content: flex-start; }
  .game-layout .section-head { margin-top: 60px; }
  .game-layout .clue-prompt { margin-inline: 0; }
  .round-screen .stage-line { justify-content: flex-start; }
  .round-board { grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr); align-items: center; min-height: clamp(520px, calc(100svh - 220px), 680px); }
  .round-identity { grid-template-columns: 84px minmax(0,1fr); gap: 22px; }
  .round-identity .avatar { width: 84px; height: 84px; border-radius: 23px; font-size: 2rem; }
  .round-task .clue-prompt, .round-task .question-card { min-height: 245px; display: flex; flex-direction: column; justify-content: center; }
  .round-footer { grid-column: 1 / -1; grid-template-columns: minmax(0,1fr) minmax(250px,320px); align-items: end; }
  .mode-card { min-height: 210px; padding: 24px; }
  .mode-card strong { font-size: 1.22rem; }
  .mode-icon { width: 56px; height: 56px; margin-bottom: 34px; }
  .actions { max-width: 720px; width: 100%; margin-inline: auto; }
  .setup-grid + .actions, .entry-grid + .actions { max-width: 100%; }
}
@media (max-width: 420px) {
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card { min-height: 132px; }
  .mode-icon { margin-bottom: 15px; }
  .actions.inline { grid-template-columns: 1fr; }
  .stage-line { justify-content: flex-start; }
  .round-pill { flex-basis: 100%; width: max-content; }
  .word-card { min-height: 340px; border-radius: 26px; }
  .session-tools { align-items: flex-start; flex-direction: column; }
}
@media (max-height: 700px) {
  .screen { min-height: calc(100svh - 88px); }
  .topbar { margin-bottom: 12px; }
  .dossier { min-height: 315px; margin: 12px auto; }
  .dossier .secret-word { margin-top: 18px; }
  .avatar { width: 68px; height: 68px; margin-bottom: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
