:root {
  --ink: #151a24;
  --paper: #f3ecdd;
  --paper-2: #e7dece;
  --muted: #4f504b;
  --line: #bdb4a4;
  --accent: #1553e7;
  --accent-soft: #dce5ff;
  --signal: #f04a2d;
  --good: #1d6f50;
  --danger: #a8322b;
  --white: #fff9ed;
  --shadow: 0 24px 70px rgba(21,26,36,.12);
  --radius: 22px;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 0%, rgba(21,83,231,.13), transparent 27rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.grain { pointer-events:none; position:fixed; inset:0; opacity:.035; z-index:20; background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E"); }
.shell { width:min(100%, 760px); margin:0 auto; padding:24px 18px calc(32px + env(safe-area-inset-bottom)); min-height:100vh; display:flex; flex-direction:column; }
.brandbar { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:34px; }
.brand { font-weight:900; letter-spacing:-.04em; font-size:1.05rem; }
.brand span { color:var(--accent); }
.leave-game { appearance:none; border:0; background:transparent; color:var(--muted); padding:8px 0 8px 12px; font-size:.78rem; font-weight:850; cursor:pointer; white-space:nowrap; }
.leave-game:hover { color:var(--danger); }
.lobby-chip { border:1px solid var(--ink); border-radius:999px; padding:7px 11px; font-size:.78rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.eyebrow { text-transform:uppercase; letter-spacing:.12em; font-size:.72rem; font-weight:900; color:var(--accent); margin:0 0 13px; }
h1,h2,h3,p { margin-top:0; }
h1 { font-size:clamp(3.3rem, 15vw, 6.3rem); line-height:.84; letter-spacing:-.075em; margin-bottom:22px; max-width:9ch; }
h2 { font-size:clamp(2.3rem, 9vw, 4.2rem); line-height:.92; letter-spacing:-.055em; margin-bottom:18px; }
h3 { font-size:1.2rem; letter-spacing:-.025em; }
.lede { font-size:clamp(1.05rem,4vw,1.3rem); line-height:1.45; max-width:34rem; color:#3e3b36; margin-bottom:32px; }
.hero { flex:1; display:flex; flex-direction:column; justify-content:center; padding:20px 0 50px; }
.actions { display:grid; gap:12px; }
.btn { appearance:none; border:0; border-radius:999px; min-height:58px; padding:14px 21px; font-weight:900; cursor:pointer; transition:transform .12s ease, background .12s ease, opacity .12s ease; display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.btn:active { transform:translateY(1px) scale(.995); }
.btn:disabled { opacity:.38; cursor:not-allowed; }
.btn-primary { background:var(--ink); color:var(--white); }
.btn-primary:hover:not(:disabled) { background:#2c2924; }
.btn-accent { background:var(--accent); color:var(--white); }
.btn-accent:hover:not(:disabled) { background:#0736a8; }
.btn-ghost { background:transparent; border:1px solid var(--ink); }
.btn-small { min-height:42px; padding:9px 15px; font-size:.88rem; }
.panel { background:rgba(255,253,248,.62); border:1px solid var(--line); border-radius:var(--radius); padding:22px; box-shadow:var(--shadow); backdrop-filter:blur(7px); }
.field { display:grid; gap:8px; margin-bottom:16px; }
label { font-size:.78rem; font-weight:900; text-transform:uppercase; letter-spacing:.09em; }
input { width:100%; min-height:58px; border:1px solid var(--line); border-radius:14px; background:var(--white); padding:13px 15px; color:var(--ink); font-size:1.05rem; }
.code-input { text-transform:uppercase; letter-spacing:.28em; font-weight:900; text-align:center; font-size:1.5rem; }
.back { display:inline-flex; margin-bottom:22px; border:0; background:none; padding:0; font-weight:800; cursor:pointer; }
.code-display { font-size:clamp(3rem,15vw,5.6rem); letter-spacing:.12em; line-height:1; font-weight:950; margin:8px 0 10px; }
.muted { color:var(--muted); }
.player-list { display:grid; gap:10px; margin:24px 0; }
.player { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:13px 14px; border-top:1px solid var(--line); }
.player:first-child { border-top:0; }
.player-main { display:flex; align-items:center; min-width:0; gap:10px; }
.dot { width:9px; height:9px; border-radius:50%; background:#aaa49a; flex:none; }
.dot.online { background:var(--good); }
.player-name { font-weight:850; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tag { font-size:.68rem; text-transform:uppercase; letter-spacing:.08em; border:1px solid var(--line); border-radius:999px; padding:5px 7px; font-weight:900; }
.status { font-size:.8rem; font-weight:800; color:var(--muted); }
.role-card { min-height:470px; border-radius:30px; padding:28px; display:flex; flex-direction:column; justify-content:space-between; background:var(--ink); color:var(--white); position:relative; overflow:hidden; box-shadow:0 25px 70px rgba(18,17,15,.22); }
.role-card.ai { background:var(--signal); color:var(--ink); }
.role-card::after { content:""; position:absolute; width:300px; height:300px; border:1px solid currentColor; border-radius:50%; opacity:.18; right:-130px; top:-125px; }
.role-kicker { font-size:.74rem; text-transform:uppercase; letter-spacing:.12em; font-weight:900; opacity:.72; }
.role-name { font-size:clamp(4rem,18vw,7rem); font-weight:950; letter-spacing:-.08em; line-height:.82; margin:20px 0; }
.role-copy { font-size:1.18rem; line-height:1.45; max-width:27rem; }
.role-actions { margin-top:18px; }
.waiting { padding:40px 0; text-align:center; }
.pulse { width:12px; height:12px; display:inline-block; border-radius:50%; background:var(--accent); animation:pulse 1.1s ease-in-out infinite alternate; margin-bottom:18px; }
@keyframes pulse { from{transform:scale(.72);opacity:.45} to{transform:scale(1.2);opacity:1} }
.prompt-card { background:var(--white); border:1px solid var(--line); border-radius:28px; overflow:hidden; box-shadow:var(--shadow); }
.prompt-main { padding:28px; min-height:260px; display:flex; flex-direction:column; justify-content:space-between; }
.prompt-label { color:var(--accent); font-weight:900; text-transform:uppercase; letter-spacing:.11em; font-size:.72rem; }
.prompt-text { font-size:clamp(1.75rem,7vw,3.25rem); letter-spacing:-.045em; line-height:1.04; font-weight:900; margin:28px 0 4px; }
.behaviour { padding:24px 28px 27px; background:var(--signal); color:var(--ink); border-top:1px solid var(--ink); }
.behaviour .prompt-label { color:var(--ink); opacity:.7; }
.behaviour-text { font-size:1.45rem; line-height:1.15; font-weight:900; letter-spacing:-.025em; margin:9px 0 0; }
.timer-wrap { margin:22px 0 0; }
.timer { font-variant-numeric:tabular-nums; font-size:clamp(4.8rem,22vw,9rem); font-weight:950; letter-spacing:-.08em; line-height:.9; }
.timer-caption { display:flex; justify-content:space-between; gap:10px; font-size:.75rem; text-transform:uppercase; letter-spacing:.09em; font-weight:900; margin-top:10px; }
.progress { height:8px; border-radius:99px; background:var(--paper-2); overflow:hidden; margin-top:12px; }
.progress > div { height:100%; background:var(--accent); width:100%; transform-origin:left center; transition:width .2s linear; }
.round-actions { display:flex; justify-content:flex-end; margin-top:18px; }
.btn-end { min-height:44px; padding:10px 17px; color:var(--muted); border-color:var(--line); font-size:.86rem; }
.btn-end:hover:not(:disabled) { color:var(--danger); border-color:var(--danger); background:rgba(168,50,43,.05); }
.vote-grid { display:grid; gap:10px; margin-top:22px; }
.vote-btn { min-height:60px; border:1px solid var(--ink); border-radius:15px; background:transparent; padding:13px 15px; text-align:left; font-weight:900; cursor:pointer; display:flex; justify-content:space-between; align-items:center; }
.vote-btn:hover { background:var(--white); }
.vote-btn.no-ai { background:var(--ink); color:var(--white); }
.scoreboard { margin-top:22px; border-top:1px solid var(--line); }
.score-row { display:grid; grid-template-columns:1fr auto auto; gap:14px; align-items:center; padding:15px 2px; border-bottom:1px solid var(--line); }
.score { font-size:1.25rem; font-weight:950; }
.delta { color:var(--good); font-weight:900; min-width:2rem; text-align:right; }
.reveal-banner { border-radius:26px; padding:26px; background:var(--ink); color:var(--white); margin:10px 0 18px; }
.reveal-banner.no-ai { background:var(--accent); color:var(--white); }
.reveal-title { font-size:clamp(2.5rem,10vw,4.8rem); line-height:.9; font-weight:950; letter-spacing:-.065em; margin:9px 0 13px; }
.votes { display:grid; gap:8px; margin-top:20px; }
.vote-line { display:flex; justify-content:space-between; gap:14px; padding:11px 0; border-bottom:1px solid var(--line); font-size:.92rem; }
.correct { color:var(--good); font-weight:900; }
.wrong { color:var(--danger); font-weight:900; }
.toast { position:fixed; left:50%; bottom:calc(20px + env(safe-area-inset-bottom)); transform:translate(-50%, 20px); opacity:0; pointer-events:none; background:var(--ink); color:white; border-radius:999px; padding:11px 16px; font-size:.88rem; font-weight:800; transition:.2s ease; z-index:30; max-width:calc(100vw - 30px); text-align:center; }
.toast.show { opacity:1; transform:translate(-50%,0); }
@media (min-width:640px) {
  .shell { padding-top:38px; }
  .actions.two { grid-template-columns:1fr 1fr; }
  .panel { padding:30px; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
