:root {
  --ink: #171329;
  --paper: #f6f1e8;
  --panel: rgba(255,255,255,.67);
  --violet: #6d3df2;
  --violet-dark: #5426d5;
  --coral: #ff645c;
  --mint: #40d6a4;
  --muted: #777184;
  --line: rgba(23,19,41,.11);
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; background: linear-gradient(145deg,#fbf8f2 0%,#f4eee7 100%); }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.ambient { position: fixed; border-radius: 50%; filter: blur(1px); opacity: .55; pointer-events: none; }
.ambient-one { width: 330px; height: 330px; right: -190px; top: -120px; background: radial-gradient(circle,rgba(109,61,242,.25),transparent 68%); }
.ambient-two { width: 280px; height: 280px; left: -190px; bottom: -110px; background: radial-gradient(circle,rgba(255,100,92,.20),transparent 68%); }
.app-shell { position: relative; width: min(100%, 620px); min-height: 100dvh; margin: 0 auto; padding: max(24px,env(safe-area-inset-top)) 22px max(28px,env(safe-area-inset-bottom)); }
.brand { display: flex; align-items: center; gap: 11px; font-family: "DM Sans",sans-serif; font-weight: 800; font-size: .84rem; letter-spacing: .16em; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 2px solid var(--ink); border-radius: 50%; }
.brand-mark span, .brand-mark i { display: block; width: 12px; height: 7px; border: 2px solid var(--ink); border-radius: 50% 50% 45% 45%; position: relative; }
.brand-mark span::after, .brand-mark i::after { content:""; position:absolute; width:3px; height:3px; background:var(--ink); border-radius:50%; right:1px; top:0; }
.screen { display: none; animation: enter .28s ease both; }
.screen.active { display: block; }
#setup-screen { padding-top: clamp(56px,12vh,100px); }
.eyebrow { color: var(--violet); font-size: .7rem; font-weight: 800; letter-spacing: .19em; margin-bottom: 14px; }
h1,h2 { font-family: "DM Sans",sans-serif; letter-spacing: -.04em; line-height: .94; margin: 0; font-size: clamp(3.25rem,16vw,5.7rem); }
h2 { font-size: clamp(3rem,14vw,5rem); }
h1 em,h2 em { color: var(--violet); font-style: normal; }
.lead { color: var(--muted); font-size: .98rem; line-height: 1.55; max-width: 430px; margin: 22px 0 25px; }
.panel { background: var(--panel); border: 1px solid rgba(255,255,255,.85); border-radius: 24px; box-shadow: 0 18px 60px rgba(52,37,76,.08); backdrop-filter: blur(18px); }
.setup-panel { padding: 7px 20px; }
.field-row { min-height: 93px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.field-row label { display: block; font-weight: 700; font-size: 1.02rem; }
.field-row small { color: var(--muted); font-size: .76rem; }
.divider { height: 1px; background: var(--line); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { border: 0; width: 38px; height: 38px; border-radius: 12px; background: #eae4f5; color: var(--violet); font-size: 1.4rem; cursor: pointer; }
.stepper button:active { transform: scale(.92); }
.stepper output { min-width: 29px; text-align: center; font-family: "DM Sans",sans-serif; font-size: 1.35rem; font-weight: 800; }
.stepper.danger button { color: var(--coral); background: #fae6e2; }
.primary-button { width: 100%; min-height: 58px; margin-top: 22px; border: 0; border-radius: 17px; color: white; background: var(--ink); font-weight: 700; cursor: pointer; box-shadow: 0 12px 28px rgba(23,19,41,.15); display:flex; align-items:center; justify-content:center; gap:13px; }
.primary-button span { font-size: 1.2rem; }
.primary-button:active { transform: translateY(1px) scale(.99); }
.privacy-note { text-align: center; font-size: .7rem; color: #8a8490; margin-top: 16px; }
.privacy-note span { color: var(--mint); font-size: .7rem; }
.back-button { display: flex; gap: 9px; align-items:center; background: none; border: 0; padding: 8px 0; margin: 25px 0 43px; color: var(--ink); cursor:pointer; }
.back-button span { font-size: .84rem; font-weight: 700; }
.names-list { display: grid; gap: 10px; margin-top: 26px; }
.name-field { position: relative; }
.name-field span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 29px; height: 29px; display: grid; place-items: center; border-radius: 10px; background: #eae4f5; color: var(--violet); font-size: .7rem; font-weight: 800; }
.name-field input { width:100%; height:58px; border:1px solid var(--line); border-radius:16px; background:rgba(255,255,255,.66); padding:0 16px 0 58px; color: var(--ink); outline:none; font-weight:600; }
.name-field input:focus { border-color: var(--violet); box-shadow:0 0 0 3px rgba(109,61,242,.11); background:#fff; }
.form-error { min-height: 18px; margin: 9px 4px 0; color: #d84640; font-size: .78rem; }
.game-topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom: 31px; }
.mini-brand { display:flex; align-items:center; gap:9px; font-family:"DM Sans",sans-serif; font-size:.7rem; letter-spacing:.12em; font-weight:800; }
.mini-brand .brand-mark { width:27px; height:27px; }
.top-actions { display:flex; gap:8px; }
.top-actions button { border:1px solid var(--line); background:rgba(255,255,255,.6); color:var(--ink); border-radius:12px; min-width:42px; height:38px; padding:0 13px; font-size:.76rem; font-weight:700; cursor:pointer; }
.progress-label { display:flex; justify-content:space-between; color:var(--muted); font-size:.67rem; font-weight:700; margin-bottom:8px; }
.progress-track { height:5px; border-radius:5px; background:rgba(23,19,41,.09); overflow:hidden; }
#progress-bar { width:20%; height:100%; border-radius:5px; background:linear-gradient(90deg,var(--violet),#9b74ff); transition:width .35s ease; }
.progress-wrap { margin-bottom: 38px; }
#game-screen { padding-top: max(8px,env(safe-area-inset-top)); }
#game-screen .lead { margin-bottom: 22px; }
.player-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.player-tile { position:relative; min-height:95px; border:1px solid var(--line); border-radius:18px; background:rgba(255,255,255,.54); color:var(--ink); text-align:left; padding:16px; overflow:hidden; transition:.2s ease; }
.player-tile strong { display:block; font-size:1rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.player-tile small { display:block; color:#99929e; margin-top:7px; font-size:.67rem; font-weight:600; }
.player-tile .tile-number { position:absolute; right:11px; bottom:6px; font-family:"DM Sans",sans-serif; font-weight:800; font-size:2.4rem; color:rgba(23,19,41,.055); }
.player-tile:not(.current):not(.starter) { cursor:not-allowed; }
.player-tile.done { opacity:.5; }
.player-tile.done small { color:#529c82; }
.player-tile.current { border-color:var(--violet); background:var(--violet); color:white; box-shadow:0 12px 30px rgba(109,61,242,.28); cursor:pointer; transform:translateY(-2px); animation:pulse 1.8s ease-in-out infinite; }
.player-tile.current small { color:rgba(255,255,255,.75); }
.player-tile.current .tile-number { color:rgba(255,255,255,.12); }
.player-tile.starter { grid-column:1/-1; min-height:106px; border-color:var(--coral); background:linear-gradient(135deg,var(--coral),#ff846c); color:white; }
.player-tile.starter small { color:rgba(255,255,255,.8); }
.player-tile.starter .tile-number { color:rgba(255,255,255,.14); }
.starter-callout { margin-top:15px; border:1px solid rgba(255,100,92,.25); background:rgba(255,255,255,.57); border-radius:18px; padding:17px 19px; }
.starter-callout span { font-size:.62rem; color:var(--coral); font-weight:800; letter-spacing:.14em; }
.starter-callout strong { display:block; font-family:"DM Sans",sans-serif; font-size:1.3rem; margin-top:4px; }
.starter-callout p { margin:3px 0 0; color:var(--muted); font-size:.78rem; }
.modal { position:fixed; inset:0; z-index:20; display:none; align-items:flex-end; justify-content:center; padding:18px; }
.modal.open { display:flex; }
.modal-backdrop { position:absolute; inset:0; background:rgba(14,11,26,.72); backdrop-filter:blur(9px); animation:fade .2s ease; }
.role-card,.confirm-card { position:relative; z-index:1; width:min(100%,520px); border-radius:29px; background:#fbf8f2; padding:25px 22px 22px; text-align:center; animation:sheet .3s cubic-bezier(.2,.8,.2,1); box-shadow:0 26px 80px rgba(0,0,0,.3); }
.role-card-top { display:flex; align-items:center; justify-content:center; gap:7px; color:var(--muted); font-size:.66rem; letter-spacing:.12em; }
.role-card-top strong { color:var(--ink); letter-spacing:0; font-size:.75rem; }
.role-icon { width:84px; height:84px; margin:29px auto 18px; display:grid; place-items:center; border-radius:27px; background:#e9e2fb; }
.role-icon::before { content:"◉"; font-size:2.8rem; color:var(--violet); }
.role-card.impostor .role-icon { background:#ffe1dc; }
.role-card.impostor .role-icon::before { content:"?"; color:var(--coral); font-family:"DM Sans",sans-serif; font-weight:800; }
.role-label { margin:0 0 7px; color:var(--violet); font-size:.72rem; letter-spacing:.16em; font-weight:800; }
.role-card.impostor .role-label { color:var(--coral); }
.role-card h3 { margin:0; font-family:"DM Sans",sans-serif; font-size:clamp(2.3rem,12vw,4.2rem); line-height:1; word-break:break-word; }
.role-help { min-height:39px; margin:15px auto 2px; max-width:350px; color:var(--muted); font-size:.82rem; line-height:1.45; }
.confirm-card { padding:31px 25px 22px; }
.confirm-icon { width:60px; height:60px; display:grid; place-items:center; margin:0 auto 17px; border-radius:20px; background:#eee7fc; color:var(--violet); font-size:1.6rem; }
.confirm-card h3 { font-family:"DM Sans",sans-serif; font-size:1.55rem; margin:0; }
.confirm-card p { color:var(--muted); font-size:.88rem; }
.confirm-card .primary-button { margin-top:20px; }
.text-button { width:100%; border:0; background:none; padding:17px; font-weight:700; color:var(--muted); cursor:pointer; }
.hidden { display:none !important; }
@keyframes enter { from{opacity:0;transform:translateY(7px)} to{opacity:1;transform:none} }
@keyframes fade { from{opacity:0} }
@keyframes sheet { from{opacity:0;transform:translateY(30px) scale(.97)} }
@keyframes pulse { 50%{box-shadow:0 15px 38px rgba(109,61,242,.38)} }
@media (min-width:560px) { .app-shell{padding-left:36px;padding-right:36px}.player-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.player-tile.starter{grid-column:auto}.modal{align-items:center}.role-card,.confirm-card{padding:31px}.names-list{grid-template-columns:1fr 1fr} }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after{animation:none!important;transition:none!important} }
