:root {
  color-scheme: light;
  --bg: #f5f6fb;
  --panel: #ffffff;
  --panel-2: #f3f5fa;
  --line: rgba(15, 23, 42, .08);
  --line-2: rgba(15, 23, 42, .14);
  --ink: #0f172a;
  --ink-2: #475569;
  --muted: #7a869a;
  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --accent-ink: #ffffff;
  --accent-soft: rgba(79, 70, 229, .08);
  --owner: #c026d3;
  --owner-soft: rgba(192, 38, 211, .08);
  --good: #16a34a;
  --good-ink: #15803d;
  --good-soft: rgba(22, 163, 74, .1);
  --bad: #d97706;
  --bad-ink: #b45309;
  --bad-soft: rgba(217, 119, 6, .1);
  --gold: #ca8a04;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 18px -10px rgba(15, 23, 42, .14);
  --sh-2: 0 1px 2px rgba(15, 23, 42, .05), 0 18px 44px -18px rgba(30, 27, 75, .28);
  --radius: 16px;
  --ui: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pixel: "Silkscreen", "JetBrains Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.2, 1.5, .4, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.noscroll { overflow: hidden; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(760px 480px at -8% -10%, rgba(99, 102, 241, .13), transparent 62%),
    radial-gradient(620px 420px at 110% 6%, rgba(6, 182, 212, .10), transparent 62%),
    radial-gradient(700px 520px at 104% 110%, rgba(192, 38, 211, .07), transparent 62%),
    radial-gradient(circle, rgba(15, 23, 42, .075) 1px, transparent 1.5px) 0 0 / 22px 22px;
}
::selection { background: rgba(79, 70, 229, .18); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.1; font-weight: 700; }
h1 { font-size: 36px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p { margin: 0; }
a { color: inherit; }
.hint a { color: var(--accent); }
.mono { font-family: var(--mono); }

.wrap { max-width: 560px; margin: 0 auto; padding: 14px 16px calc(40px + env(safe-area-inset-bottom)); }
.wrap.enter > :not(.late) { animation: enter .45s var(--ease-out) both; }
.wrap.enter > :nth-child(2):not(.late) { animation-delay: .04s; }
.wrap.enter > :nth-child(3):not(.late) { animation-delay: .08s; }
.wrap.enter > :nth-child(4):not(.late) { animation-delay: .12s; }
.stack > * + * { margin-top: 14px; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0 16px; }
.top-r { display: flex; align-items: center; gap: 4px; min-width: 0; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.logo svg { width: 28px; height: 26px; color: var(--accent); flex: none; overflow: visible; }
.logo svg .d1, .logo svg .d2, .logo svg .d3 { animation: typing 1.5s steps(1) infinite; }
.logo svg .d2 { animation-delay: .18s; }
.logo svg .d3 { animation-delay: .36s; }
.logo b { font-weight: 700; font-size: 20px; letter-spacing: -0.03em; line-height: 1; white-space: nowrap; }
.logo .tag { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--owner); border: 1px solid rgba(192, 38, 211, .35); border-radius: 6px; padding: 3px 7px; }
.me { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; font-size: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 3px 11px 3px 3px; box-shadow: var(--sh-1); }
.me .mn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30vw; }
.me .pts { font-family: var(--mono); font-weight: 800; color: var(--accent); }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: relative; box-shadow: var(--sh-1); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sec-head.tight { margin-bottom: 4px; }
.sec-head h2 .hash, summary h2 .hash { font-family: var(--mono); color: var(--accent); font-weight: 600; margin-right: 6px; letter-spacing: 0; }
.sec-sub { font-size: 14px; color: var(--muted); margin: 0 0 14px; display: flex; align-items: center; gap: 6px; }
.sec-sub svg { width: 14px; height: 14px; flex: none; color: var(--accent); }
.count { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; white-space: nowrap; }
.count.ok { color: var(--good-ink); border-color: rgba(22, 163, 74, .3); background: var(--good-soft); }
.segs { display: inline-flex; gap: 2px; }
.segs i { width: 6px; height: 11px; border-radius: 1.5px; background: rgba(15, 23, 42, .12); transition: background .3s; }
.segs i.on { background: var(--accent); }
.count.ok .segs i.on { background: var(--good); }
.muted { color: var(--muted); }
.small { font-size: 14px; }

details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
details > summary::-webkit-details-marker { display: none; }
details > summary .chev { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-2); display: grid; place-items: center; transition: transform .25s var(--ease-out), border-color .2s; flex: none; }
details > summary .chev::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: translateY(-2px) rotate(45deg); }
details[open] > summary .chev { transform: rotate(180deg); }
details[open] > summary { margin-bottom: 16px; }
details[open] > summary ~ * { animation: enter .35s var(--ease-out) both; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 11px; padding: 11px 18px; font-weight: 600; font-size: 15px; background: var(--panel); color: var(--ink); text-decoration: none; transition: transform .08s, background .15s, border-color .15s, box-shadow .2s, opacity .15s; white-space: nowrap; }
.btn:hover { border-color: rgba(79, 70, 229, .45); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: 0 6px 18px -8px rgba(79, 70, 229, .8); }
.btn.primary:hover { background: #4338ca; }
.btn.dark { background: linear-gradient(95deg, var(--accent), #7c3aed); border: 0; color: #fff; font-weight: 700; box-shadow: 0 10px 26px -10px rgba(79, 70, 229, .9); }
.btn.ghost { background: transparent; }
.btn.ghost.big { border-style: dashed; color: var(--accent); }
.btn.big { width: 100%; padding: 16px 22px; font-family: var(--mono); font-size: 15px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; border-radius: 13px; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn[disabled] { opacity: .4; pointer-events: none; box-shadow: none; }
.icon-btn { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 9px; display: inline-grid; place-items: center; color: var(--ink-2); transition: background .15s, color .15s; flex: none; }
.icon-btn:hover { background: rgba(15, 23, 42, .06); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.snd.off { color: var(--muted); }

/* ---------- avatars (pixel creatures) ---------- */
.av { --s: 40px; --c: var(--accent); width: var(--s); height: var(--s); border-radius: calc(var(--s) * .28); display: inline-grid; place-items: center; flex: none; position: relative;
  color: var(--c); color: color-mix(in srgb, var(--c) 86%, #0f172a);
  background: #eef0fb; background: color-mix(in srgb, var(--c) 13%, #fff);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .1); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent); }
.av svg { width: 86%; height: 86%; display: block; }
.av b { font-family: var(--mono); font-size: calc(var(--s) * .45); }
.av.xs { --s: 24px; }
.av.sm { --s: 30px; }
.av.lg { --s: 56px; }
.av.xl { --s: 104px; }

/* ---------- inputs ---------- */
.field { display: block; }
.field > span { display: block; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=datetime-local], textarea, select {
  width: 100%; border: 1px solid var(--line-2); background: var(--panel); border-radius: 11px; padding: 12px 14px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .2s; color: var(--ink);
}
input::placeholder, textarea::placeholder { color: #9aa4b6; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
textarea { resize: none; min-height: 108px; line-height: 1.55; font-family: var(--mono); font-size: 16px; caret-color: var(--accent); }
.form-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 10px; }
.form-row .grp { display: flex; align-items: center; gap: 12px; margin-left: auto; }

/* X-style character ring */
.xc { --p: 0; --k: var(--accent); position: relative; width: 22px; height: 22px; display: grid; place-items: center; flex: none; transition: width .22s var(--spring), height .22s var(--spring); }
.xc svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.xc .t { fill: none; stroke: rgba(15, 23, 42, .1); stroke-width: 2.6; }
.xc .a { fill: none; stroke: var(--k); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: calc(var(--p) * 100) 100; transition: stroke-dasharray .12s linear, stroke .2s; }
.xc b { position: relative; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--muted); opacity: 0; transform: scale(.6); transition: opacity .15s, transform .2s var(--spring); }
.xc.warn { --k: var(--bad); width: 30px; height: 30px; }
.xc.warn b { opacity: 1; transform: none; }
.xc.over { --k: #ea580c; width: 30px; height: 30px; }
.xc.over b { opacity: 1; transform: none; color: #ea580c; }
.xc.over.far svg { opacity: 0; }
.xc.bump { animation: bump .3s var(--spring); }
.xsep { width: 1px; height: 26px; background: var(--line-2); flex: none; }

/* ---------- hero ---------- */
.hero { padding: 6px 2px 4px; }
.kicker { font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.cursor { display: inline-block; width: 9px; height: 15px; background: var(--accent); animation: blink 1.06s steps(1) infinite; }
.hero h1 { font-size: 40px; background: linear-gradient(92deg, #0f172a 15%, #4f46e5 62%, #0891b2 100%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 3px; }
.hero .sub { margin-top: 12px; color: var(--ink-2); font-size: 16px; }
.theme { display: inline-flex; align-items: center; gap: 9px; margin-top: 14px; background: var(--owner-soft); border: 1px solid rgba(192, 38, 211, .25); border-radius: 10px; padding: 5px 12px 5px 5px; font-weight: 600; }
.theme b { background: var(--owner); color: #fff; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; border-radius: 6px; padding: 3px 8px; }

/* ---------- how it works ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; counter-increment: step; color: var(--ink-2); font-size: 15px; }
.steps li::before { content: "0" counter(step); width: 34px; height: 28px; border-radius: 8px; background: var(--accent-soft); border: 1px solid rgba(79, 70, 229, .2); color: var(--accent); display: grid; place-items: center; font-family: var(--mono); font-weight: 800; font-size: 13px; }
.steps b { color: var(--ink); }
.scoring { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.scoring div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.scoring strong { display: block; font-family: var(--pixel); font-weight: 400; font-size: 30px; line-height: 1.1; color: var(--good); }
.scoring div + div strong { color: var(--owner); }
.scoring span { font-size: 13px; color: var(--ink-2); line-height: 1.3; display: block; margin-top: 4px; }

/* example stories */
.ex { margin-top: 20px; }
.ex-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ex-head h3 { font-size: 15px; }
.ex-head h3 .hash { font-family: var(--mono); color: var(--accent); font-weight: 600; margin-right: 6px; }
.ex-head span { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.ex-intro { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.ex-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(196px, 64%); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 18px; margin: 12px -18px 0; padding: 2px 18px 6px; scrollbar-width: none; overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 30px), transparent); }
.ex-row::-webkit-scrollbar { display: none; }
.ex-card { scroll-snap-align: start; background: var(--panel-2); border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; animation: rise .4s calc(.15s + var(--i, 0) * .05s) var(--ease-out) both; }
.ex-card p { font-family: var(--mono); font-size: 14px; line-height: 1.55; color: var(--ink); flex: 1; }
.ex-card .tg { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--accent); }
.ex-card .tg i { font-style: normal; color: var(--muted); font-weight: 600; }
.ex-card.small .tg { color: #0891b2; }
.ex-card.wild .tg { color: var(--owner); }
.tip { margin-top: 12px; font-size: 14px; color: var(--ink-2); }

/* ---------- my stories ---------- */
.story-item { border: 1px solid var(--line-2); border-radius: 12px; padding: 0 0 14px; background: var(--panel); overflow: hidden; }
.story-item + .story-item { margin-top: 10px; }
.story-item .si-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 4px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.story-item .actions { display: flex; gap: 2px; }
.story-item .actions .icon-btn { width: 32px; height: 32px; }
.story-item p { padding: 12px 14px 0; font-family: var(--mono); font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.story-item textarea { border: 0; border-radius: 0; background: transparent; box-shadow: none; min-height: 96px; }
.story-item .form-row { padding: 0 12px; }
.story-item.fresh { animation: fresh 1.2s var(--ease-out); }
.empty { color: var(--muted); font-size: 15px; padding: 4px 0 2px; }
.composer { margin-top: 14px; }

/* ---------- player chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 11px; padding: 3px 11px 3px 3px; font-size: 14px; font-weight: 600; }
.pchip.new { animation: pop .45s calc(var(--i, 0) * .05s) var(--spring) both; }
.pchip .tick { color: var(--good); display: inline-grid; }
.pchip .tick svg { width: 13px; height: 13px; }
.pchip.ready { border-color: rgba(22, 163, 74, .3); }
.pchip.wait { color: var(--muted); }
.pchip.wait .av { opacity: .55; }

/* ---------- round ---------- */
.round-head { display: flex; align-items: center; gap: 12px; margin: 0 2px 12px; font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.round-head b { color: var(--ink); }
.progress { --n: 1; flex: 1; height: 8px; background: rgba(15, 23, 42, .08); border-radius: 3px; overflow: hidden; position: relative; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s var(--ease-out); }
.progress::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent calc(100% - 2px), var(--bg) 0) 0 0 / calc(100% / var(--n)) 100%; }

.hud { --hc: var(--accent); --hl: 16px;
  background:
    linear-gradient(var(--hc) 0 0) top left / var(--hl) 2px no-repeat,
    linear-gradient(var(--hc) 0 0) top left / 2px var(--hl) no-repeat,
    linear-gradient(var(--hc) 0 0) top right / var(--hl) 2px no-repeat,
    linear-gradient(var(--hc) 0 0) top right / 2px var(--hl) no-repeat,
    linear-gradient(var(--hc) 0 0) bottom left / var(--hl) 2px no-repeat,
    linear-gradient(var(--hc) 0 0) bottom left / 2px var(--hl) no-repeat,
    linear-gradient(var(--hc) 0 0) bottom right / var(--hl) 2px no-repeat,
    linear-gradient(var(--hc) 0 0) bottom right / 2px var(--hl) no-repeat,
    var(--panel);
}
.story-card { border-radius: 8px; padding: 0 0 24px; position: relative; overflow: hidden; box-shadow: 0 0 0 1px var(--line), var(--sh-2); }
.story-card::after { content: ""; position: absolute; left: 0; right: 0; top: -40%; height: 40%; background: linear-gradient(180deg, transparent, rgba(79, 70, 229, .05), transparent); animation: sweep 4.5s 1.2s linear infinite; pointer-events: none; }
.sc-head { display: flex; align-items: center; gap: 8px; padding: 12px 18px 10px; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px dashed var(--line-2); margin-bottom: 18px; }
.sc-head .rec { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1.4s steps(1) infinite; }
.sc-head .id { margin-left: auto; color: var(--accent); }
.story-card p { padding: 0 20px; font-family: var(--mono); font-size: 20px; font-weight: 500; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; position: relative; }
.story-card.long p { font-size: 16px; }
.scr { color: var(--accent); }
.enc { color: rgba(15, 23, 42, .16); }
.q { display: flex; align-items: center; gap: 12px; margin: 22px 2px 12px; font-family: var(--mono); font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.q::before, .q::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--line-2)); }
.q::after { background: linear-gradient(90deg, var(--line-2), transparent); }

.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.choice { position: relative; display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 13px; padding: 10px 12px 10px 10px; text-align: left; font-weight: 600; font-size: 16px; transition: border-color .15s, background .2s, transform .1s, opacity .3s, box-shadow .25s; min-height: 62px; box-shadow: var(--sh-1); }
.choices.intro .choice { animation: rise .42s calc(.2s + var(--i, 0) * .055s) var(--ease-out) both; }
.choice:active { transform: scale(.97); }
.choice .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choice .ret { position: absolute; inset: -5px; pointer-events: none; opacity: 0; transform: scale(1.14); transition: opacity .18s, transform .3s var(--spring);
  background:
    linear-gradient(var(--accent) 0 0) top left / 12px 2px no-repeat, linear-gradient(var(--accent) 0 0) top left / 2px 12px no-repeat,
    linear-gradient(var(--accent) 0 0) top right / 12px 2px no-repeat, linear-gradient(var(--accent) 0 0) top right / 2px 12px no-repeat,
    linear-gradient(var(--accent) 0 0) bottom left / 12px 2px no-repeat, linear-gradient(var(--accent) 0 0) bottom left / 2px 12px no-repeat,
    linear-gradient(var(--accent) 0 0) bottom right / 12px 2px no-repeat, linear-gradient(var(--accent) 0 0) bottom right / 2px 12px no-repeat; }
.choice.sel { border-color: rgba(79, 70, 229, .6); background: linear-gradient(180deg, rgba(79, 70, 229, .1), rgba(79, 70, 229, .03)), var(--panel); box-shadow: 0 10px 26px -12px rgba(79, 70, 229, .6); }
.choice.sel .ret { opacity: 1; transform: none; }
.choice.sel .av { animation: wiggle .4s steps(4); }
.choices.done .choice:not(.sel) { opacity: .35; filter: grayscale(.7); box-shadow: none; }
.choices.done .choice { pointer-events: none; }
.choices.done .choice.sel { --accent: var(--good); border-color: rgba(22, 163, 74, .6); background: linear-gradient(180deg, rgba(22, 163, 74, .1), rgba(22, 163, 74, .03)), var(--panel); box-shadow: 0 10px 26px -12px rgba(22, 163, 74, .6); }

/* ---------- slide to lock ---------- */
.lockzone { margin-top: 16px; }
.slider { position: relative; height: 66px; border-radius: 15px; background: var(--panel); border: 1px solid rgba(79, 70, 229, .4); overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; box-shadow: var(--sh-1); animation: pop .35s var(--spring); }
.slider.off { border-color: var(--line-2); background: var(--panel-2); box-shadow: none; animation: none; }
.slider .fill { position: absolute; inset: 0 auto 0 0; width: 64px; border-radius: 14px; background: repeating-linear-gradient(-45deg, rgba(79, 70, 229, .17) 0 8px, rgba(79, 70, 229, .07) 8px 16px); background-size: 22.6px 22.6px; animation: stripes .7s linear infinite; }
.slider.off .fill { background: transparent; }
.slider .label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 16px 0 74px; text-align: center; pointer-events: none; font-family: var(--mono); font-size: 14px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }
.slider .label .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slider .label b { color: var(--accent); }
.slider.off .label { color: var(--muted); }
.chevs { display: inline-flex; flex: none; }
.chevs i { width: 8px; height: 8px; border-right: 2.5px solid var(--accent); border-top: 2.5px solid var(--accent); transform: rotate(45deg); margin-left: -1px; opacity: .2; animation: chev 1.1s infinite; }
.chevs i:nth-child(2) { animation-delay: .15s; }
.chevs i:nth-child(3) { animation-delay: .3s; }
.slider .thumb { position: absolute; top: 4px; left: 4px; width: 56px; height: 56px; border-radius: 11px; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .9); cursor: grab; touch-action: none; }
.slider .thumb:active { cursor: grabbing; }
.slider.off .thumb { background: #e2e6ef; color: var(--muted); box-shadow: none; }
.slider .thumb svg { width: 26px; height: 26px; }
.slider:not(.off) .thumb svg { animation: nudge 1.6s ease-in-out infinite; }
.locked { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; height: 66px; border-radius: 15px; background: var(--good-soft); border: 1px solid rgba(22, 163, 74, .5); color: var(--good-ink); font-family: var(--mono); font-weight: 700; font-size: 15px; letter-spacing: .03em; text-transform: uppercase; overflow: hidden; animation: lockin .7s var(--ease-out); }
.locked::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .8), transparent); transform: translateX(-100%); animation: swipe .8s .05s var(--ease-out); }
.locked b { color: #14532d; }
.locked svg { width: 22px; height: 22px; overflow: visible; }
.locked .shackle { animation: shackle .5s .15s var(--spring) both; }
.note { text-align: center; color: var(--muted); font-size: 15px; padding: 14px; }

.waiting { margin-top: 20px; text-align: center; }
.waiting .txt { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.waiting .row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 8px; margin-top: 10px; }
.wv { position: relative; display: grid; justify-items: center; gap: 4px; width: 50px; }
.wv small { font-size: 11px; font-weight: 600; color: var(--ink-2); max-width: 50px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wv.pending .av { opacity: .4; }
.wv.pending small { color: var(--muted); }
.wv.pending .av::after { content: ""; position: absolute; inset: -3px; border-radius: 11px; border: 1px dashed rgba(15, 23, 42, .3); animation: spin 6s linear infinite; }
.wv .lk { position: absolute; right: 2px; top: -4px; width: 17px; height: 17px; border-radius: 5px; background: var(--good); border: 2px solid var(--bg); display: grid; place-items: center; color: #fff; }
.wv .lk svg { width: 9px; height: 9px; }
.wv.ping .av { animation: pop .5s var(--spring); }
.wv.ping .av::before { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid var(--good); animation: ring .7s ease-out forwards; }
.wv.ping .lk { animation: pop .4s .1s var(--spring) both; }

/* ---------- countdown ---------- */
#overlay { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; background: rgba(245, 246, 251, .95); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
#overlay.on { display: grid; animation: fadein .25s ease-out; }
.countdown { text-align: center; }
.countdown .lbl { font-family: var(--mono); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--good-ink); font-size: 13px; }
.countdown .sub { font-family: var(--mono); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-size: 12px; }
.countdown .sub::after, .reveal-hero .kicker.scanning::after { content: "..."; display: inline-block; overflow: hidden; vertical-align: bottom; width: 0; letter-spacing: 0; text-align: left; animation: dots 1.2s steps(4) infinite; }
.ring { position: relative; width: 230px; height: 230px; margin: 22px auto; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring .trk { fill: none; stroke: rgba(15, 23, 42, .08); stroke-width: 6; }
.ring .arc { fill: none; stroke: var(--accent); stroke-width: 6; }
.ring .ticks { fill: none; stroke: rgba(79, 70, 229, .35); stroke-width: 3; stroke-dasharray: 1.5 9.97; transform-origin: 100px 100px; animation: spin 12s linear infinite reverse; }
.ring .num { position: relative; font-family: var(--pixel); font-size: 120px; line-height: 1; color: #1e1b4b; }
.ring .num::before, .ring .num::after { content: attr(data-n); position: absolute; inset: 0; opacity: 0; }
.ring .num::before { color: var(--accent-2); }
.ring .num::after { color: var(--owner); }
.ring .num.go { animation: digit .9s var(--ease-out); }
.ring .num.go::before { animation: glitch-a .3s steps(2); }
.ring .num.go::after { animation: glitch-b .3s steps(2); }

/* ---------- reveal ---------- */
.reveal-hero { text-align: center; padding: 2px 0 4px; }
.reveal-hero .kicker { justify-content: center; gap: 0; margin-bottom: 8px; min-height: 18px; }
.reveal-hero .kicker.scanning { color: var(--muted); }
.spot { --c: var(--accent); position: relative; display: grid; place-items: center; width: 164px; height: 164px; margin: 0 auto; }
.spot::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(15, 23, 42, .25); animation: spin 14s linear infinite; }
.spot .radar { position: absolute; inset: 6px; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 290deg, rgba(79, 70, 229, .28) 360deg); animation: spin .9s linear infinite; transition: opacity .35s; }
.spot .slot { position: relative; z-index: 1; display: grid; }
.spot .slot .av { animation: flick .14s steps(2); box-shadow: var(--sh-2); }
.spot::after { content: ""; position: absolute; inset: 30px; border-radius: 34px; border: 2px solid var(--c); opacity: 0; pointer-events: none; }
.spot.hit .radar { opacity: 0; }
.spot.hit::before { border: 2px dashed var(--c); opacity: .45; animation: spin 14s linear infinite, fadein .5s; }
.spot.hit::after { animation: burst .9s var(--ease-out) forwards; }
.spot.hit .slot .av { animation: pop .55s var(--spring); box-shadow: inset 0 0 0 2px var(--c), 0 16px 40px -12px var(--c); }
.owner-name { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; margin-top: 10px; min-height: 46px; }
.you { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-family: var(--mono); font-weight: 800; letter-spacing: .03em; text-transform: uppercase; border-radius: 10px; padding: 8px 14px; font-size: 14px; border: 1px solid; animation: pop .5s 1.75s var(--spring) both; }
.you.right { color: var(--good-ink); border-color: rgba(22, 163, 74, .4); background: var(--good-soft); }
.you.wrong { color: var(--bad-ink); border-color: rgba(217, 119, 6, .4); background: var(--bad-soft); }
.you.owner { color: var(--owner); border-color: rgba(192, 38, 211, .35); background: var(--owner-soft); }
.you.none { color: var(--ink-2); border-color: var(--line-2); background: var(--panel); }
.recap { margin-top: 14px; font-family: var(--mono); font-size: 14px; line-height: 1.55; color: var(--ink-2); text-align: center; padding: 0 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; animation: rise .45s 1.6s var(--ease-out) both; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 18px; }
.tile { background: var(--panel); border-radius: 13px; padding: 11px 12px 12px; border: 1px solid var(--line-2); position: relative; box-shadow: var(--sh-1); animation: rise .45s calc(1.9s + var(--d, 0) * .07s) var(--ease-out) both; }
.tile .who { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; padding-right: 30px; }
.tile .who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .guess { font-size: 13px; color: var(--ink-2); margin-top: 9px; display: flex; align-items: flex-start; gap: 6px; line-height: 1.35; }
.tile .guess b { font-weight: 700; color: var(--ink); }
.tile .pts { position: absolute; top: 11px; right: 11px; font-family: var(--mono); font-weight: 800; font-size: 14px; color: var(--muted); }
.tile.right { border-color: rgba(22, 163, 74, .45); background: linear-gradient(180deg, rgba(22, 163, 74, .08), transparent 70%), var(--panel); }
.tile.right .pts { color: var(--good); }
.tile.wrong { border-color: rgba(217, 119, 6, .28); }
.tile.owner { border-color: rgba(192, 38, 211, .4); background: linear-gradient(180deg, rgba(192, 38, 211, .08), transparent 70%), var(--panel); }
.tile.owner .pts { color: var(--owner); }
.mark { width: 17px; height: 17px; border-radius: 5px; display: inline-grid; place-items: center; flex: none; }
.mark svg { width: 10px; height: 10px; }
.mark.ok { background: var(--good); color: #fff; }
.mark.no { background: var(--bad); color: #fff; }

.board { margin-top: 14px; }
.board.late { animation: rise .45s 2.15s var(--ease-out) both; }
.board .sec-head { margin-bottom: 4px; }
.brow { display: grid; grid-template-columns: 24px auto 1fr auto; align-items: center; gap: 10px; padding: 8px 6px; margin: 0 -6px; border-radius: 10px; position: relative; }
.brow + .brow::before { content: ""; position: absolute; left: 6px; right: 6px; top: 0; height: 1px; background: var(--line); }
.brow .rk { font-family: var(--mono); font-weight: 800; color: var(--muted); font-size: 13px; text-align: center; }
.brow .rk.gold { color: var(--gold); }
.brow .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow .sc { font-family: var(--mono); font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.brow .dl { font-size: 12px; font-weight: 800; color: var(--good-ink); background: var(--good-soft); border: 1px solid rgba(22, 163, 74, .3); border-radius: 6px; padding: 1px 7px; }
.brow.up { animation: flash 1.2s ease-out; }
.brow.mine .nm::after { content: " (you)"; color: var(--muted); font-weight: 500; }
.next-wrap { margin-top: 16px; animation: rise .45s 2.3s var(--ease-out) both; }

/* ---------- final ---------- */
.final-hero { text-align: center; padding: 4px 0 0; }
.final-hero .kicker { justify-content: center; }
.final-hero h1 { font-size: 38px; animation: rise .5s 1.25s var(--ease-out) both; }
.final-hero .sub { color: var(--ink-2); margin-top: 6px; font-family: var(--mono); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; animation: rise .5s 1.35s var(--ease-out) both; }
.gg { font-family: var(--pixel); font-size: 64px; line-height: 1; letter-spacing: .06em; color: #1e1b4b; text-shadow: 3px 0 0 rgba(192, 38, 211, .45), -3px 0 0 rgba(6, 182, 212, .55); margin: 2px 0 10px; animation: glitch-in .7s steps(6) both; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin: 18px 0 0; padding: 0 6px; }
.pcol { --c: var(--accent); flex: 1; max-width: 150px; display: grid; justify-items: center; }
.pcol .pw { display: grid; justify-items: center; gap: 4px; padding-bottom: 8px; animation: drop .55s calc(.45s + var(--d) * .22s) var(--spring) both; }
.pcol .cup { width: 46px; height: 46px; margin-bottom: 4px; animation: pop .6s 1.1s var(--spring) both; filter: drop-shadow(0 4px 8px rgba(202, 138, 4, .35)); }
.pcol .cup svg { width: 100%; height: 100%; display: block; }
.pcol .nm { font-weight: 700; font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcol .sc { font-family: var(--mono); font-weight: 800; font-size: 14px; color: var(--ink-2); }
.pcol .block { width: 100%; border-radius: 10px 10px 3px 3px; display: grid; place-items: start center; padding-top: 10px; font-family: var(--pixel); font-size: 26px; color: var(--c); color: color-mix(in srgb, var(--c) 85%, #0f172a); transform-origin: bottom; animation: grow .6s calc(var(--d) * .22s) var(--ease-out) both;
  background: linear-gradient(180deg, rgba(79, 70, 229, .16), rgba(79, 70, 229, .03));
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 24%, #fff), color-mix(in srgb, var(--c) 6%, #fff));
  border: 1px solid rgba(15, 23, 42, .14); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); border-bottom: 0; }
.pcol.r1 .block { height: 118px; }
.pcol.r2 .block { height: 86px; }
.pcol.r3 .block { height: 62px; }
.pcol.r1 .sc { color: var(--gold); }
.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.award { background: var(--panel); border: 1px solid var(--line-2); border-radius: 13px; padding: 12px 14px; box-shadow: var(--sh-1); animation: rise .45s calc(1.5s + var(--d, 0) * .1s) var(--ease-out) both; }
.award .t { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--owner); }
.award .t svg { width: 16px; height: 16px; }
.award + .award .t { color: var(--accent); }
.award .n { font-weight: 700; font-size: 16px; margin-top: 9px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.award .n span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.award .d { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 4px; }
.final-board { animation: rise .45s 1.8s var(--ease-out) both; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.confetti i { position: absolute; top: -12px; background: var(--k); animation: fall linear forwards; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: #0f172a; color: #f1f5f9; padding: 11px 16px; border-radius: 11px; font-family: var(--mono); font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease-out); z-index: 60; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 14px 34px -12px rgba(15, 23, 42, .5); }
#toast::before { content: "> "; color: #a5b4fc; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#toast.err::before { content: "! "; color: #fbbf24; }

/* ---------- public home ---------- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.center-page .logo { gap: 14px; }
.center-page .logo svg { width: 50px; height: 46px; }
.center-page .logo b { font-size: 40px; }
.center-page p { margin-top: 16px; color: var(--ink-2); font-size: 17px; }

/* ---------- admin ---------- */
.admin .wrap { max-width: 1120px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.admin-grid > .col { display: grid; gap: 16px; }
.admin-grid > .col, .admin-grid > .col > * { min-width: 0; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }

.add-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; }
@media (max-width: 560px) { .add-row { grid-template-columns: 1fr; } }
.plist { container-type: inline-size; margin-top: 6px; }
.prow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; grid-template-areas: "av info stat sw acts"; align-items: center; gap: 6px 12px; padding: 12px 0; }
.prow + .prow { border-top: 1px solid var(--line); }
.prow.new { animation: rise .4s var(--ease-out) both; }
.prow > .av { grid-area: av; }
.prow .info { grid-area: info; min-width: 0; }
.prow .pstat { grid-area: stat; }
.prow .sw { grid-area: sw; }
.prow .acts { grid-area: acts; display: flex; }
.prow .pname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .psub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .psub .bad { color: var(--bad-ink); font-weight: 600; }
.prow.out > .av, .prow.out .info, .prow.out .pstat { opacity: .4; }
.prow.edit { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "av info"; }
.prow.edit .ed { display: grid; grid-template-columns: 1fr 1.3fr auto auto; gap: 8px; }
.icon-btn[disabled] { opacity: .3; pointer-events: none; }
@container (max-width: 560px) {
  .prow { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "av info info sw" "av stat acts acts"; }
  .prow .sw { justify-self: end; }
  .prow .pstat { justify-self: start; min-width: 0; max-width: 100%; }
  .prow .stat { display: block; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.02em; }
  .prow .acts { justify-self: end; margin-right: -8px; }
  .prow.edit .ed { grid-template-columns: 1fr 1fr; }
  .prow.edit .ed input { grid-column: 1 / -1; }
}
.stat { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 12px; font-weight: 700; border-radius: 8px; padding: 4px 9px; white-space: nowrap; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); }
.stat.ok { background: var(--good-soft); color: var(--good-ink); border-color: rgba(22, 163, 74, .3); }
.stat.dim { color: var(--muted); }

.sw { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted); }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw .tr { width: 42px; height: 24px; border-radius: 8px; background: rgba(15, 23, 42, .1); border: 1px solid var(--line-2); position: relative; transition: background .15s, border-color .15s; flex: none; }
.sw .tr::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 5px; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .3); transition: transform .2s var(--spring), background .15s; }
.sw input:checked + .tr { background: var(--good); border-color: var(--good); }
.sw input:checked + .tr::after { transform: translateX(18px); }
.sw input:focus-visible + .tr { box-shadow: 0 0 0 3px rgba(79, 70, 229, .25); }

.gp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.phase { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); }
.phase .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--muted); }
.phase.live { color: var(--good-ink); }
.phase.live .dot { background: var(--good); box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); animation: blink 1.4s steps(1) infinite; }
.big-num { font-family: var(--mono); font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.kpi { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.kpi .v { font-family: var(--mono); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; color: var(--accent); }
.kpi .l { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.gp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gp-actions .grow { flex: 1; }
.per { display: inline-flex; align-items: center; gap: 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.per button { border: 0; background: transparent; width: 36px; height: 34px; border-radius: 8px; font-family: var(--mono); font-weight: 800; font-size: 14px; color: var(--ink-2); }
.per button.on { background: var(--accent); color: #fff; box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .7); }
.per .pl { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 8px 0 9px; }
.hint { font-size: 14px; color: var(--muted); margin-top: 10px; }
.vlist { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.vlist .pchip.done { color: var(--good-ink); border-color: rgba(22, 163, 74, .3); background: var(--good-soft); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.settings-grid .wide { grid-column: 1 / -1; }
.danger { color: var(--bad-ink); }
.btn.danger:hover { border-color: rgba(217, 119, 6, .55); }
.it-was { display: flex; align-items: center; gap: 14px; margin: 18px 0 6px; }
.it-was .nm { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.last-win { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; }
.last-win .cup { width: 30px; height: 30px; flex: none; }
.last-win .cup svg { width: 100%; height: 100%; display: block; }

/* ---------- game time, place, links ---------- */
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-weight: 600; color: var(--ink); }
.meta .mi { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.meta .mi svg { width: 17px; height: 17px; color: var(--accent); flex: none; }
.meta .mi > a:not(.cal) { text-decoration: none; border-bottom: 1px dashed rgba(79, 70, 229, .5); }
.meta .cal { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(79, 70, 229, .28); border-radius: 7px; padding: 2px 7px; margin-left: 3px; text-decoration: none; white-space: nowrap; }
.btn > svg { width: 16px; height: 16px; flex: none; }
.icon-btn.on { background: var(--accent-soft); color: var(--accent); }
.linkbox { display: flex; align-items: center; gap: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 2px 2px 2px 12px; min-width: 0; }
.linkbox a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink-2); letter-spacing: -.01em; }
.linkbox a b, .ml-txt a b { color: var(--accent); font-weight: 800; }
.qr { display: block; width: 100%; height: auto; }
.code { display: inline-flex; gap: 6px; }
.code i { font-style: normal; width: 42px; height: 50px; display: grid; place-items: center; font-family: var(--pixel); font-size: 28px; line-height: 1; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(79, 70, 229, .25); border-radius: 10px; box-shadow: inset 0 -3px 0 rgba(79, 70, 229, .12); }

/* share tiles */
.shr { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(64px, 1fr); gap: 8px; margin-top: 16px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.shr::-webkit-scrollbar { display: none; }
.shr-t { --k: #475569; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 4px 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-decoration: none; color: var(--ink-2); font-size: 12px; font-weight: 600; transition: transform .1s, border-color .15s, background .15s, color .15s; }
.shr-t:hover { border-color: var(--line-2); background: var(--panel-2); color: var(--ink); }
.shr-t:active { transform: scale(.94); }
.shr-t .ti { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--k); box-shadow: 0 6px 14px -8px var(--k); transition: transform .2s var(--spring); }
.shr-t:hover .ti { transform: translateY(-2px); }
.shr-t .ti svg { width: 22px; height: 22px; }
.shr-t .tl { white-space: nowrap; }
.shr-t.wa { --k: #25d366; }
.shr-t.sms { --k: #f97316; }
.shr-t.mail { --k: #4f46e5; }
.shr-t.tg { --k: #229ed9; }
.shr-t.cp { --k: #0f172a; }
.shr-t.more { --k: #64748b; }

/* admin: group invite */
.inv { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 16px; align-items: center; }
.inv-qr { border: 1px solid var(--line-2); background: #fff; border-radius: 14px; padding: 4px; display: block; width: 128px; height: 128px; cursor: zoom-in; transition: transform .2s var(--spring), box-shadow .2s; }
.inv-qr:hover { transform: scale(1.04) rotate(-1deg); box-shadow: var(--sh-2); }
.inv-main .linkbox { margin-top: 12px; }
.inv.off, .off > .shr { opacity: .4; filter: grayscale(1); pointer-events: none; }
.sw > span:not(.tr) { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 420px) { .inv { grid-template-columns: 104px minmax(0, 1fr); gap: 12px; } .inv-qr { width: 104px; height: 104px; } .inv .code i { width: 36px; height: 44px; font-size: 24px; } }

/* admin: topic picker */
.topics { display: flex; flex-wrap: wrap; gap: 7px; }
.tchip { border: 1px solid var(--line-2); background: var(--panel); border-radius: 10px; padding: 7px 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background .12s, color .12s, border-color .12s, transform .1s, box-shadow .2s; }
.tchip:hover { border-color: rgba(79, 70, 229, .45); color: var(--ink); }
.tchip:active { transform: scale(.95); }
.tchip.on { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 16px -8px rgba(79, 70, 229, .8); }
.tchip.roll { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tchip.landed { animation: pop .45s var(--spring); }
.tchip.shuffle { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); border-style: dashed; border-color: rgba(79, 70, 229, .5); }
.tchip.shuffle svg { width: 16px; height: 16px; }
.tchip.shuffle:hover svg { animation: spin .6s var(--ease-out); }
summary .sum { min-width: 0; display: grid; gap: 5px; }
.sum-line { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details[open] .sum-line { display: none; }

/* admin: per-player share sheet */
.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .36); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .2s; }
.sheet-back.on { opacity: 1; }
.sheet { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border-radius: 20px; padding: 18px; box-shadow: 0 30px 80px -20px rgba(15, 23, 42, .45); transform: translateY(14px) scale(.98); transition: transform .3s var(--spring); }
.sheet-back.on .sheet { transform: none; }
.sh-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sh-head .grow { flex: 1; min-width: 0; }
.sh-k { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sh-head h2 { font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-body { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 14px; align-items: start; }
.sh-qr { width: 116px; height: 116px; border: 1px solid var(--line-2); border-radius: 12px; padding: 3px; background: #fff; }
.sh-msg { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--ink-2); background: var(--panel-2); border-radius: 10px; padding: 9px 11px; max-height: 92px; overflow: auto; }
@media (max-width: 560px) {
  .sheet-back { place-items: end stretch; padding: 0; }
  .sheet { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateY(40%); }
  .sh-body { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
  .sh-qr { width: 84px; height: 84px; }
  .sh-main .linkbox a { font-size: 13px; letter-spacing: -.03em; }
}

/* admin: big screen join view */
.screen { position: fixed; inset: 0; z-index: 70; overflow: auto; background:
  radial-gradient(900px 600px at -10% -10%, rgba(99, 102, 241, .14), transparent 62%),
  radial-gradient(800px 560px at 110% 110%, rgba(6, 182, 212, .12), transparent 62%),
  radial-gradient(circle, rgba(15, 23, 42, .07) 1px, transparent 1.5px) 0 0 / 22px 22px, var(--bg); animation: fadein .25s both; }
.scr-x { position: fixed; top: 14px; right: 14px; z-index: 2; background: var(--panel); box-shadow: var(--sh-1); }
.bigscr { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.15fr) auto; gap: 5vw; align-items: center; padding: 6vh 6vw; }
.bigscr .logo svg { width: 36px; height: 33px; }
.bigscr .logo b { font-size: 26px; }
.bigscr h1 { font-size: clamp(40px, 6vw, 92px); margin-top: 3vh; background: linear-gradient(92deg, #0f172a 15%, #4f46e5 62%, #0891b2 100%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 4px; }
.bigscr .meta { font-size: clamp(16px, 1.8vw, 28px); margin-top: 2.4vh; gap: 8px 28px; }
.bigscr .meta .mi svg { width: 1.1em; height: 1.1em; }
.bigscr .theme { font-size: clamp(15px, 1.5vw, 22px); margin-top: 2.4vh; }
.scr-how { margin-top: 6vh; font-family: var(--mono); font-size: clamp(13px, 1.25vw, 18px); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.scr-url { white-space: nowrap; font-family: var(--mono); font-size: clamp(20px, 2.7vw, 46px); font-weight: 800; letter-spacing: -.02em; margin-top: 4px; color: var(--ink-2); overflow-wrap: anywhere; }
.scr-url b { color: var(--accent); }
.scr-people { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4vh; }
.scr-people .pchip { font-size: clamp(14px, 1.2vw, 18px); }
.scr-qr { background: #fff; border-radius: 28px; padding: clamp(14px, 2vw, 30px); box-shadow: var(--sh-2); border: 1px solid var(--line); display: grid; gap: 2.4vh; justify-items: center; }
.scr-qr .qr { width: min(36vw, 62vh); }
.scr-qr .code i { width: clamp(40px, 4vw, 66px); height: clamp(48px, 4.8vw, 78px); font-size: clamp(26px, 2.8vw, 46px); }
.scr-qr.off { opacity: .3; filter: grayscale(1); }
@media (max-width: 760px) { .bigscr { grid-template-columns: 1fr; } .scr-qr .qr { width: min(78vw, 48vh); } }

/* player: own link */
.mylink .ml-row { display: flex; align-items: center; gap: 2px; }
.mylink .ml-row .icon-btn { border: 1px solid var(--line-2); width: 38px; height: 38px; margin-left: 4px; }
.ml-txt { flex: 1; min-width: 0; }
.ml-k { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ml-txt a { display: block; font-size: 14px; letter-spacing: -.02em; font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); margin-top: 2px; }
.ml-qr { margin-top: 14px; text-align: center; animation: rise .3s var(--ease-out) both; }
.ml-qr .qr { width: 200px; margin: 0 auto; border: 1px solid var(--line-2); border-radius: 14px; }
.mylink.hello { border-color: rgba(22, 163, 74, .35); box-shadow: 0 0 0 4px var(--good-soft), var(--sh-1); }
.ml-hi { font-weight: 600; margin-bottom: 12px; color: var(--good-ink); }

/* home and join */
.home { width: min(420px, 100%); }
.home-card { margin-top: 26px; text-align: left; }
.code-in { text-align: center; font-family: var(--pixel) !important; font-size: 26px !important; letter-spacing: .25em; text-transform: uppercase; }
.code-in::placeholder { color: #cbd2de; }
.err-line { color: var(--bad-ink); font-size: 14px; margin-top: 10px; font-weight: 600; }
.center-page .home-card p.err-line { margin-top: 10px; font-size: 14px; color: var(--bad-ink); }
.or { display: flex; align-items: center; gap: 10px; margin: 16px 0 14px; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.linkish { display: block; margin: 14px auto 0; background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- keyframes ---------- */
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes bump { 50% { transform: scale(1.25); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes typing { 0%, 45%, 100% { transform: none; } 15% { transform: translateY(-1px); } }
@keyframes dots { to { width: 2.4em; } }
@keyframes sweep { to { top: 120%; } }
@keyframes stripes { to { background-position: 22.6px 0; } }
@keyframes chev { 0%, 100% { opacity: .2; } 40% { opacity: 1; } }
@keyframes nudge { 0%, 60%, 100% { transform: translateX(0); } 30% { transform: translateX(4px); } }
@keyframes wiggle { 0% { transform: translateY(0); } 25% { transform: translateY(-3px); } 50% { transform: translateY(0); } 75% { transform: translateY(-2px); } }
@keyframes lockin { 0% { transform: scale(.94); box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); } 40% { transform: scale(1.02); } 100% { transform: scale(1); box-shadow: 0 0 0 16px rgba(22, 163, 74, 0); } }
@keyframes swipe { to { transform: translateX(100%); } }
@keyframes shackle { from { transform: translateY(-5px); } }
@keyframes ring { from { transform: scale(1); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
@keyframes burst { 0% { transform: scale(.7); opacity: 1; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes flick { 0% { opacity: .3; transform: translateY(-6px); } 100% { opacity: 1; transform: none; } }
@keyframes flash { 0% { background: rgba(22, 163, 74, .16); } 100% { background: transparent; } }
@keyframes digit { 0% { transform: scale(1.7); opacity: 0; filter: blur(8px); } 22% { transform: scale(1); opacity: 1; filter: blur(0); } 82% { opacity: 1; } 100% { transform: scale(.88); opacity: .25; } }
@keyframes glitch-a { 0% { opacity: .9; transform: translate(-6px, 2px); clip-path: inset(10% 0 55% 0); } 100% { opacity: .9; transform: translate(5px, -2px); clip-path: inset(60% 0 8% 0); } }
@keyframes glitch-b { 0% { opacity: .8; transform: translate(6px, -2px); clip-path: inset(50% 0 20% 0); } 100% { opacity: .8; transform: translate(-5px, 3px); clip-path: inset(5% 0 70% 0); } }
@keyframes glitch-in { 0% { opacity: 0; transform: translateX(-8px) skewX(-12deg); } 30% { opacity: 1; transform: translateX(6px) skewX(8deg); } 60% { transform: translateX(-3px); } 100% { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes drop { from { opacity: 0; transform: translateY(-30px); } }
@keyframes fresh { 0% { box-shadow: 0 0 0 2px var(--accent), 0 10px 30px -8px rgba(79, 70, 229, .5); border-color: var(--accent); } 100% { box-shadow: none; } }
@keyframes fall { to { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--r)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
