:root { color-scheme: dark; --bg: #0e0f13; --card: #17191f; --card2: #1f222a; --line: #2b2f39; --ink: #f4f4f5; --muted: #a3a8b4;
  --accent: #f43f5e; --paper: #f5efe1; --paper2: #e9dfc7; --pink: #fb7185; --ok: #4ade80; --gold: #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; background: radial-gradient(1100px 480px at 50% -220px, #3a1420 0%, transparent 70%), var(--bg); }
a { color: var(--pink); }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.muted { color: var(--muted); font-weight: 500; }
.sm { font-size: 14px; }
.center { text-align: center; }
.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); }
html.inroom .top { position: static; }
.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: #3e4350; background: #262a33; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; 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:not(:disabled) { color: var(--ink); }
.btn.pri { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.pri:hover:not(:disabled) { background: #fb5371; border-color: #fb5371; }
.btn.big { min-height: 58px; font-size: 18px; width: 100%; border-radius: 18px; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 10px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: grid; gap: 12px; margin-bottom: 12px; }
.panel h3 { font-size: 17px; display: flex; gap: 8px; align-items: baseline; }
.panel p { margin: 0; }
.panel.ok { border-color: #2f6b45; background: #13241a; }
.fld { display: grid; gap: 6px; }
.fld > span { font-size: 13px; color: var(--muted); font-weight: 600; }
input, textarea { font: inherit; font-size: 18px; color: var(--ink); background: #08090b; border: 1px solid var(--line); border-radius: 14px; width: 100%; }
input { min-height: 52px; padding: 0 14px; }
textarea { padding: 12px 14px; resize: none; line-height: 1.4; min-height: 96px; }
input:focus, textarea:focus { outline: 2px solid var(--pink); outline-offset: 1px; }
input.code { text-transform: uppercase; letter-spacing: .35em; font-weight: 800; text-align: center; }
input.code::placeholder { letter-spacing: .12em; font-weight: 600; }
.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 0 12px; font-size: 15px; text-align: center; }
.hero { text-align: center; padding: 10px 0 18px; }
.hero.sm { padding-top: 0; }
.logo { line-height: 0; margin-bottom: 8px; filter: drop-shadow(0 10px 26px rgba(244,63,94,.3)); }
.logo svg { width: 72px; height: 72px; }
.hero h1 { font: 800 40px/1.1 Georgia, "Times New Roman", serif; letter-spacing: -.01em; }
.tag { color: var(--muted); margin: 8px auto 0; max-width: 34ch; }
.foot { color: var(--muted); font-size: 14px; text-align: center; margin: 16px 0 0; }
.roombar { display: flex; align-items: center; gap: 8px; margin: 2px 0 12px; font-size: 14px; color: var(--muted); }
.roombar .rc b { color: var(--ink); letter-spacing: .14em; }
.roombar .off { color: var(--gold); }
.roombar .btn:first-of-type { margin-left: auto; }
.codebox { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px 14px 16px; margin-bottom: 12px; }
.codebox p { margin: 0; }
.lbl { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 700; }
.bigcode { font: 800 54px/1.1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .18em; margin: 4px 0 6px; padding-left: .18em; }
.plist, .score, .opts, .rvs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plist li, .score li { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--card2); border-radius: 12px; min-height: 44px; }
.plist li.me, .score li.me { box-shadow: inset 0 0 0 1px #4b2530; }
.nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.nm i { color: var(--muted); font-style: normal; font-weight: 500; }
.pill { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: #2b2f39; color: var(--muted); white-space: nowrap; }
.pill.real { background: var(--ok); color: #052e14; }
.pt { font-variant-numeric: tabular-nums; font-size: 18px; min-width: 2ch; text-align: right; }
.rk { width: 22px; color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; }
.gain { color: var(--ok); font-weight: 800; font-size: 14px; }
.seg, .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button, .chips button { appearance: none; font: inherit; font-size: 15px; font-weight: 700; color: var(--muted); background: var(--card2); border: 1px solid var(--line); border-radius: 999px; min-height: 40px; padding: 0 14px; cursor: pointer; }
.seg button { flex: 1; }
.seg button[aria-pressed="true"], .chips button[aria-pressed="true"] { color: #fff; background: #3b1720; border-color: var(--accent); }
.seg button:disabled, .chips button:disabled { cursor: default; }
.card { position: relative; background: linear-gradient(180deg, var(--paper), var(--paper2)); color: #1d1a14; border-radius: 20px; padding: 16px 18px 20px; margin-bottom: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.35); overflow: hidden; }
.card .lbl { color: #7c6a4a; }
.card.small { padding: 12px 16px 14px; }
.card.small .word { font-size: 28px; margin-top: 4px; }
.cardtop { display: flex; justify-content: space-between; gap: 8px; }
.card .gain { color: #15803d; letter-spacing: .04em; }
.word { font: 800 clamp(30px, 9vw, 44px)/1.1 Georgia, "Times New Roman", serif; margin: 10px 0 4px; overflow-wrap: anywhere; letter-spacing: -.01em; }
.ask { margin: 0; color: #5b4d33; font-weight: 600; }
.tbar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(0,0,0,.08); }
.tbar i { display: block; height: 100%; background: #1d1a14; transition: width .25s linear; }
.tbar.low i { background: var(--accent); }
.mine { font: 600 19px/1.4 Georgia, serif; margin: 0; overflow-wrap: anywhere; }
.hint { color: var(--muted); margin: 0 0 10px; font-size: 15px; }
.opt { appearance: none; width: 100%; display: flex; gap: 12px; align-items: flex-start; text-align: left; font: 500 17px/1.4 Georgia, "Times New Roman", serif; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; min-height: 52px; cursor: pointer; touch-action: manipulation; }
.opt:hover:not(:disabled) { border-color: #4a4f5c; }
.opt .ol { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font: 800 13px/1 system-ui, sans-serif; background: var(--card2); color: var(--muted); margin-top: 1px; }
.opt .ot { flex: 1; overflow-wrap: anywhere; }
.opt .pill { align-self: center; }
.opt.sel { border-color: var(--accent); background: #2a1219; }
.opt.sel .ol { background: var(--accent); color: #fff; }
.opt:disabled { cursor: default; opacity: .6; }
.opt.sel:disabled { opacity: 1; }
.wait { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin: 12px 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.hostctl { display: flex; justify-content: center; margin-top: 6px; }
.rvs { margin-bottom: 12px; }
.rv { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 8px; animation: rise .35s ease both; }
.rv:nth-child(2) { animation-delay: .06s; } .rv:nth-child(3) { animation-delay: .12s; } .rv:nth-child(4) { animation-delay: .18s; }
.rv:nth-child(5) { animation-delay: .24s; } .rv:nth-child(n+6) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.rv.real { border-color: #2f6b45; background: #13241a; }
.rvt { font: 500 17px/1.4 Georgia, "Times New Roman", serif; overflow-wrap: anywhere; }
.rvm { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 14px; }
.by { color: var(--pink); font-weight: 700; }
.vs { color: var(--ink); }
.spin { width: 28px; height: 28px; margin: 6px auto 0; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); transform: translateX(-50%); background: #24272f; color: var(--ink); border: 1px solid var(--line); padding: 10px 16px; border-radius: 999px; font-size: 15px; z-index: 50; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
dialog { width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 40px); background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h2 { font: 800 26px/1.2 Georgia, serif; margin-bottom: 8px; }
dialog ol { padding-left: 20px; margin: 0 0 12px; display: grid; gap: 8px; }
dialog .fine { color: var(--muted); font-size: 13px; }
dialog .btn { width: 100%; }
@media (max-width: 360px) { .app { padding-left: 12px; padding-right: 12px; } .bigcode { font-size: 46px; } .opt { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
