:root {
  --bg: #0b0e1a; --panel: #141829; --line: #262c45; --ink: #eef0f8; --muted: #9aa1bd;
  --sun: #ffd23f; --teal: #7ed6d6; --red: #e85a5a;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { overscroll-behavior: none; }
[hidden] { display: none !important; }

.screen { max-width: 520px; margin: 0 auto; padding: 24px 16px calc(32px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.hero { padding: 20px 4px 6px; }
.hero.small { padding-top: 8px; text-align: center; }
.eyebrow { margin: 0 0 8px; font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--teal); }
h1 { margin: 0; font-size: 46px; line-height: .98; letter-spacing: -1.5px; font-weight: 800; }
h1 span { color: var(--sun); }
#roomCode { font-size: 64px; letter-spacing: 8px; color: var(--sun); margin-bottom: 12px; }
.lead { color: var(--muted); margin: 12px 0 0; line-height: 1.45; }
h2 { margin: 0 0 10px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
h2:not(:first-child) { margin-top: 16px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
input { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: #0d1120; color: var(--ink); font-size: 16px; outline: none; }
input:focus { border-color: var(--teal); }
.btn { width: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: #1c2238; color: var(--ink); font-size: 16px; font-weight: 700; cursor: pointer; }
.btn.primary { background: var(--sun); color: #1a1a1a; border-color: var(--sun); }
.btn.ghost { background: transparent; color: var(--muted); margin-top: 8px; }
.btn:disabled { opacity: .45; }
.join { display: flex; gap: 8px; margin-top: 10px; }
.join input { width: 120px; text-align: center; letter-spacing: 4px; text-transform: uppercase; font-weight: 700; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }

.lvl { margin-top: 14px; }
.lvl strong { font-size: 15px; }
.bar { height: 8px; border-radius: 8px; background: #0d1120; margin: 8px 0 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--sun)); transition: width .5s; }
.lvl small { color: var(--muted); }

.picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick { text-align: left; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: #0d1120; color: var(--ink); cursor: pointer; font: inherit; }
.pick b { display: block; font-size: 14px; margin: 4px 0 2px; }
.pick em { font-style: normal; font-size: 22px; }
.pick small { color: var(--muted); font-size: 12px; line-height: 1.3; display: block; }
.pick.on { border-color: var(--sun); box-shadow: inset 0 0 0 1px var(--sun); }
.pick.locked { opacity: .45; cursor: not-allowed; }
.pick .tag { color: var(--teal); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }

ul { list-style: none; margin: 0; padding: 0; }
li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
li:last-child { border-bottom: 0; }
li .nm { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
li .sub { color: var(--muted); font-size: 13px; }
li .xp { color: var(--sun); font-weight: 700; }
footer { color: var(--muted); font-size: 12px; text-align: center; line-height: 1.6; }
a { color: var(--teal); }

#game { position: fixed; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#hud { position: absolute; top: calc(8px + env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
#hud > div { background: rgba(10, 13, 26, .78); border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; font-weight: 700; font-size: 14px; }
#timer { font-variant-numeric: tabular-nums; }
#who { position: absolute; top: calc(50px + env(safe-area-inset-top)); left: 10px; font-size: 12px; color: var(--muted); pointer-events: none; background: rgba(10, 13, 26, .6); padding: 4px 8px; border-radius: 8px; }
#banner { position: absolute; left: 50%; top: 28%; transform: translateX(-50%); background: rgba(10, 13, 26, .9); border: 1px solid var(--sun); border-radius: 14px; padding: 14px 20px; text-align: center; font-weight: 800; font-size: 18px; pointer-events: none; max-width: 86vw; }
#banner small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; margin-top: 4px; }
.gbtn { position: absolute; right: calc(18px + env(safe-area-inset-right)); width: 92px; height: 92px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); background: rgba(255, 210, 63, .9); color: #1a1a1a; font-weight: 800; font-size: 15px; touch-action: none; cursor: pointer; }
#btnAct { bottom: calc(26px + env(safe-area-inset-bottom)); }
#btnAct.hold { background: #fff; transform: scale(.94); }
#btnAbil { bottom: calc(132px + env(safe-area-inset-bottom)); right: calc(28px + env(safe-area-inset-right)); width: 72px; height: 72px; background: rgba(126, 214, 214, .92); font-size: 24px; }
#btnAbil small { display: block; font-size: 10px; }
#btnAbil.cd { background: rgba(60, 66, 90, .9); color: #fff; font-size: 20px; }
#btnAct.killer { background: rgba(232, 90, 90, .95); color: #fff; }

#toasts { position: fixed; left: 0; right: 0; bottom: calc(140px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 5; }
.toast { background: rgba(10, 13, 26, .92); border: 1px solid var(--line); padding: 8px 14px; border-radius: 20px; font-size: 14px; max-width: 80vw; animation: pop 3.2s forwards; }
@keyframes pop { 0% { opacity: 0; transform: translateY(8px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
