:root {
  color-scheme: dark;
  --bg: #090614;
  --panel: rgba(24, 18, 42, 0.92);
  --panel2: rgba(36, 27, 61, 0.88);
  --text: #fff8e8;
  --muted: #b9abc9;
  --hot: #ff4f81;
  --gold: #ffd166;
  --cyan: #61e8ff;
  --green: #65f4a2;
  --bad: #ff6b5f;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at 50% -10%, #2a1854 0, var(--bg) 55%); font-family: ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; touch-action: manipulation; }
.app { min-height: 100svh; display: grid; place-items: center; padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom)); }
.hidden { display: none !important; }
.panel { width: min(460px, 100%); border: 1px solid rgba(255,255,255,.12); background: linear-gradient(180deg, rgba(39,29,72,.96), rgba(12,8,24,.96)); border-radius: 28px; padding: 26px 20px 20px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.eyebrow { margin: 0 0 8px; color: var(--cyan); text-transform: uppercase; letter-spacing: .18em; font-weight: 800; font-size: 12px; }
h1 { margin: 0; font-size: clamp(42px, 16vw, 76px); line-height: .86; letter-spacing: -.07em; }
.tagline { margin: 16px 0 20px; color: var(--muted); font-size: 17px; line-height: 1.4; }
.how { display: grid; gap: 10px; margin: 18px 0 22px; }
.how div { padding: 13px 14px; border-radius: 18px; background: rgba(255,255,255,.06); display: grid; gap: 3px; }
.how span { color: var(--muted); font-size: 13px; }
.primary, .secondary, .ghost { min-height: 54px; border-radius: 17px; font-weight: 900; }
.primary { width: 100%; background: linear-gradient(135deg, var(--hot), #8d5bff); box-shadow: 0 12px 35px rgba(255,79,129,.28); }
.textInput, .joinForm input { width: 100%; min-height: 52px; border-radius: 17px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.07); color: var(--text); padding: 0 13px; font: inherit; font-weight: 900; margin-bottom: 10px; text-transform: uppercase; }
.modeRow { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.joinForm { display: grid; grid-template-columns: 1fr 70px; gap: 7px; }
.joinForm input { margin: 0; min-width: 0; }
.joinForm button { min-height: 52px; }
.fullGhost { width: 100%; margin-top: 10px; }
.lobbyPlayers { display: grid; gap: 8px; margin: 14px 0; }
.lobbyPlayer { display: flex; justify-content: space-between; gap: 10px; align-items: center; border-radius: 16px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); padding: 10px 12px; font-weight: 900; }
.lobbyPlayer span { color: var(--muted); font-size: 12px; }
.game { width: min(500px, 100%); min-height: calc(100svh - 24px); display: grid; grid-template-rows: auto auto minmax(220px, 1fr) auto; gap: 10px; }
.roomBar { display: flex; justify-content: space-between; align-items: center; border-radius: 16px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); padding: 8px 11px; font-size: 12px; font-weight: 1000; letter-spacing: .08em; color: var(--gold); }
.hud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hud > div { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-radius: 17px; padding: 10px 11px; }
.label { display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.hud strong { display: block; margin-top: 2px; font-size: 20px; }
.shaft { position: relative; overflow: hidden; border-radius: 28px; background: linear-gradient(180deg, rgba(97,232,255,.09), rgba(255,79,129,.08)), #0b0817; border: 1px solid rgba(255,255,255,.1); min-height: 210px; box-shadow: inset 0 0 40px rgba(0,0,0,.45); }
.track-lines { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 17px, rgba(255,255,255,.07) 18px 19px), linear-gradient(90deg, transparent 0 22%, rgba(255,255,255,.08) 23% 24%, transparent 25% 75%, rgba(255,255,255,.08) 76% 77%, transparent 78%); opacity: .75; }
.player, .rival, .void, .finish { position: absolute; left: 50%; transform: translate(-50%, 50%); transition: bottom .26s cubic-bezier(.2,.9,.25,1.2), filter .16s, transform .16s; z-index: 2; }
.player { width: 78px; height: 42px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--gold), #ff8f3d); color: #281000; font-size: 12px; font-weight: 1000; box-shadow: 0 0 28px rgba(255,209,102,.45); }
.player.hit { filter: saturate(.4); transform: translate(-50%, 50%) scale(.9) rotate(-2deg); }
.rival { width: 36px; height: 30px; border-radius: 12px; display: grid; place-items: center; font-size: 10px; font-weight: 900; color: #dffaff; background: rgba(97,232,255,.22); border: 1px solid rgba(97,232,255,.38); }
.rival-a { left: 23%; } .rival-b { left: 76%; background: rgba(141,91,255,.25); } .rival-c { left: 50%; background: rgba(101,244,162,.20); }
.void { left: 0; right: 0; width: 100%; height: 72px; transform: translateY(50%); background: linear-gradient(0deg, #05020b, rgba(255,79,129,.68)); border-top: 2px solid rgba(255,79,129,.9); box-shadow: 0 -16px 45px rgba(255,79,129,.3); z-index: 3; display: flex; align-items: flex-start; justify-content: center; color: #ffdce6; font-size: 11px; font-weight: 1000; letter-spacing: .22em; padding-top: 6px; }
.finish { bottom: 94% !important; width: 92px; height: 30px; border-radius: 0 0 14px 14px; background: var(--green); color: #052313; display: grid; place-items: center; font-size: 11px; font-weight: 1000; letter-spacing: .12em; transform: translate(-50%, 0); }
.question-card { background: var(--panel); border: 1px solid rgba(255,255,255,.1); border-radius: 24px; padding: 14px; box-shadow: 0 -12px 40px rgba(0,0,0,.25); }
.question-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 6px; }
.round-type, .needed { margin: 0; color: var(--cyan); font-size: 12px; font-weight: 1000; letter-spacing: .12em; }
.needed { color: var(--gold); }
h2 { margin: 0 0 12px; font-size: clamp(19px, 5.3vw, 26px); line-height: 1.08; letter-spacing: -.03em; }
.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.choice { min-height: 58px; padding: 10px 8px; border-radius: 18px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); font-weight: 850; line-height: 1.05; position: relative; }
.choice.selected { background: rgba(97,232,255,.18); border-color: rgba(97,232,255,.7); box-shadow: inset 0 0 0 2px rgba(97,232,255,.2); }
.choice.correct { background: rgba(101,244,162,.2); border-color: var(--green); color: #dcffe9; }
.choice.wrong { background: rgba(255,107,95,.22); border-color: var(--bad); }
.actions { display: grid; grid-template-columns: 1.4fr .9fr; gap: 9px; margin-top: 11px; }
.secondary { background: linear-gradient(135deg, #2fe5ff, #5e75ff); color: #050817; }
.ghost { background: rgba(255,255,255,.07); color: var(--muted); border: 1px solid rgba(255,255,255,.08); }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10; width: min(420px, calc(100vw - 28px)); padding: 12px 14px; border-radius: 18px; background: rgba(5,3,12,.9); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 15px 45px rgba(0,0,0,.45); text-align: center; font-weight: 900; }
@media (max-height: 720px) { .game { grid-template-rows: auto 180px auto; } .shaft { min-height: 180px; } .choice { min-height: 50px; font-size: 14px; } h2 { font-size: 18px; } .primary, .secondary, .ghost { min-height: 48px; } }
.hallStats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 12px 0 14px; }
.hallStats div { border-radius: 18px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); padding: 12px; }
.hallStats b { display: block; font-size: 26px; line-height: 1; color: var(--gold); }
.hallStats span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
h3 { margin: 16px 0 8px; font-size: 14px; color: var(--cyan); text-transform: uppercase; letter-spacing: .13em; }
.emptyRow { border-radius: 16px; background: rgba(255,255,255,.045); border: 1px dashed rgba(255,255,255,.12); padding: 12px; color: var(--muted); font-weight: 850; text-align: center; }
.roomJoin { width: 100%; min-height: 54px; text-align: left; color: var(--text); }
.roomJoin span { max-width: 58%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.meRow { border-color: rgba(255,209,102,.45); box-shadow: inset 0 0 0 1px rgba(255,209,102,.12); }
@media (max-width: 380px) { .roomJoin span { max-width: 48%; } }
