:root { color-scheme: dark; --bg: #0f0f12; --card: #17171c; --card2: #1e1e25; --line: #2a2a33; --ink: #f4f4f6; --muted: #a3a3ad; --accent: #a5b4fc; --ok: #4ade80; --warn: #fbbf24; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 8px; background: linear-gradient(var(--bg) 70%, transparent); }
.back-link { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back-link:hover { color: var(--ink); }
.app { width: min(560px, 100%); margin: 0 auto; padding: 4px 16px calc(env(safe-area-inset-bottom, 0px) + 96px); }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
.btn { appearance: none; font: inherit; font-weight: 700; color: var(--ink); background: var(--card2); border: 1px solid var(--line); border-radius: 14px; min-height: 48px; padding: 0 18px; cursor: pointer; touch-action: manipulation; }
.btn:hover:not(:disabled) { border-color: #3a3a46; background: #24242d; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 999px; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); }
.btn.pri { background: #c7d2fe; color: #14142b; border-color: #c7d2fe; }
.btn.pri:hover:not(:disabled) { background: #e0e7ff; }
.btn.ok { background: var(--ok); color: #052e16; border-color: var(--ok); }
.btn.ok:hover:not(:disabled) { background: #86efac; }
.btn.steal-btn { background: #3b2a06; border-color: #a16207; color: #fde68a; }
.btn.big { min-height: 60px; font-size: 18px; width: 100%; border-radius: 18px; }
.row { display: flex; gap: 10px; align-items: stretch; }
.row .grow { flex: 1; }
.row .btn.big { width: auto; }
.row .btn.big.grow { flex: 1; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: grid; gap: 12px; }
.fld { display: grid; gap: 6px; }
.fld span { font-size: 13px; color: var(--muted); font-weight: 600; }
input { font: inherit; font-size: 18px; color: var(--ink); background: #0b0b0e; border: 1px solid var(--line); border-radius: 14px; min-height: 52px; padding: 0 14px; width: 100%; }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input.code { text-transform: uppercase; letter-spacing: .3em; font-weight: 800; text-align: center; flex: 1; min-width: 0; }
input.code::placeholder { letter-spacing: .1em; font-weight: 600; }
.row .btn { min-width: 96px; }
.or { position: relative; text-align: center; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.or::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.or span { position: relative; background: var(--card); padding: 0 10px; }
.err { color: #fca5a5; margin: 0; font-size: 15px; }
.hero { text-align: center; padding: 18px 0 20px; }
.logo { font-size: 52px; line-height: 1; margin-bottom: 8px; filter: drop-shadow(0 6px 20px rgba(165,180,252,.35)); }
.hero h1 { font-size: 40px; font-weight: 850; }
.tag { color: var(--muted); margin: 8px auto 0; max-width: 34ch; }
.foot { color: var(--muted); font-size: 14px; text-align: center; margin: 18px 0 0; }
.roombar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 14px; font-size: 14px; color: var(--muted); }
.roombar .rc b { color: var(--ink); letter-spacing: .12em; }
.roombar .myteam { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.roombar .off { color: var(--warn); }
.roombar .btn:first-of-type { margin-left: auto; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; flex: none; }
.codebox { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px 14px 16px; margin-bottom: 14px; }
.lbl { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 700; }
.codebox .hint { margin: 0 0 10px; }
.bigcode { margin: 2px 0 10px; font-size: 52px; font-weight: 900; letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.note { color: var(--muted); font-size: 14px; margin: 8px 0; }
.teams { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.team { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--tc); border-radius: 16px; padding: 12px 14px; }
.team.mine { background: color-mix(in srgb, var(--tc) 9%, var(--card)); }
.th { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.th h3 { font-size: 17px; display: flex; align-items: center; }
.you { font-size: 13px; color: var(--tc); font-weight: 700; }
.names { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.names li { background: #0b0b0e; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 14px; }
.names li i { color: var(--muted); font-style: normal; font-size: 12px; }
.names li.empty { color: var(--muted); border-style: dashed; }
.seg { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg span { font-size: 14px; color: var(--muted); font-weight: 600; min-width: 64px; }
.seg button { font: inherit; font-weight: 700; min-width: 44px; min-height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #0b0b0e; color: var(--ink); cursor: pointer; }
.seg button.on { background: #c7d2fe; color: #14142b; border-color: #c7d2fe; }
.hint { margin: 0; font-size: 14px; color: var(--muted); }
.wait { color: var(--muted); text-align: center; margin: 16px 0; }
.turn { display: grid; gap: 14px; }
.kicker { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.smline { font-size: 30px; font-weight: 850; line-height: 1.15; }
.sub { margin: 0; color: var(--muted); }
.cat { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.cat .ce { font-size: 44px; line-height: 1; }
.cat b { display: block; font-size: 26px; color: var(--cc); }
.cat small { color: var(--muted); font-size: 14px; }
.smlist { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.smlist li { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; background: var(--card); }
.scores { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.scores li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto; align-items: center; row-gap: 2px; }
.scores li.on { border-color: var(--tc); box-shadow: inset 0 0 0 1px var(--tc); }
.scores .tn { display: flex; align-items: center; font-weight: 700; font-size: 14px; }
.scores b { font-size: 22px; font-variant-numeric: tabular-nums; grid-row: span 2; }
.scores .life { font-size: 12px; color: var(--muted); }
.playtop { display: flex; align-items: center; gap: 14px; }
.catline { margin: 2px 0 0; font-size: 20px; font-weight: 800; }
.timer { position: relative; width: 76px; height: 76px; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer .trk { fill: none; stroke: #26262f; stroke-width: 4; }
.timer .arc { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 0; transition: stroke-dashoffset .2s linear; }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; font-weight: 850; font-variant-numeric: tabular-nums; }
.timer.low .arc { stroke: #f87171; }
.timer.low span { color: #fca5a5; }
.card { background: linear-gradient(160deg, #1f2033, #17171c); border: 1px solid #34364d; border-radius: 24px; padding: 20px 18px; text-align: center; min-height: 170px; display: grid; align-content: center; gap: 10px; }
.card small { color: var(--muted); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.prompt { margin: 0; font-size: clamp(30px, 9vw, 44px); font-weight: 900; line-height: 1.1; letter-spacing: -.02em; overflow-wrap: anywhere; }
.prompt.sm { font-size: 22px; font-weight: 800; }
.rule { margin: 0; color: var(--muted); font-size: 14px; }
.card.guess { min-height: 130px; background: var(--card); border-color: var(--line); }
.acts .btn { min-height: 68px; }
.lifeline .btn { flex: 1; min-height: 44px; font-size: 15px; }
.steal { border: 2px solid var(--tc); border-radius: 18px; padding: 12px; background: color-mix(in srgb, var(--tc) 12%, var(--card)); display: grid; gap: 10px; }
.steal p { margin: 0; text-align: center; font-size: 17px; }
.last { margin: 0; font-size: 14px; color: var(--muted); text-align: center; }
.last b { color: var(--ink); }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 40vh; overflow: auto; }
.log li { display: flex; justify-content: space-between; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.log b { font-size: 14px; white-space: nowrap; }
.log b.got { color: var(--ok); }
.log b.stolen { color: var(--warn); }
.log b.skip { color: var(--muted); font-weight: 600; }
.auto { font-weight: 600; opacity: .7; margin-left: 6px; }
.final { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.final li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 4px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--tc); border-radius: 14px; padding: 10px 14px; }
.final li span { font-weight: 800; }
.final li small { grid-column: 2; color: var(--muted); font-size: 13px; }
.final li b { grid-row: 1 / span 2; grid-column: 3; font-size: 28px; }
.over .smline { font-size: 34px; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); transform: translateX(-50%); background: #e5e7eb; color: #111; font-weight: 700; padding: 10px 16px; border-radius: 999px; z-index: 60; box-shadow: 0 8px 30px rgba(0,0,0,.4); max-width: 90vw; }
dialog { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 20px; width: min(520px, calc(100vw - 24px)); max-height: 85dvh; }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h2 { font-size: 22px; margin-bottom: 8px; }
dialog ol { padding-left: 20px; margin: 0 0 12px; display: grid; gap: 10px; }
dialog ul { padding-left: 18px; margin: 6px 0 0; display: grid; gap: 4px; }
dialog li { color: #d4d4da; }
dialog .fine { color: var(--muted); font-size: 13px; }
dialog .btn { width: 100%; }
@media (max-width: 380px) { .bigcode { font-size: 42px; } .smline { font-size: 26px; } .hero h1 { font-size: 34px; } }
@media (prefers-reduced-motion: reduce) { .timer .arc { transition: none; } .btn:active:not(:disabled) { transform: none; } }
