/* Skaitlis — one stylesheet, system fonts only (nothing loaded from other servers). */

:root {
  --bg: #f5f4ff;
  --bg2: #ebe9ff;
  --card: #ffffff;
  --ink: #1c1a3a;
  --muted: #625f86;
  --line: #e2e0f3;
  --primary: #4f46e5;
  --primary-2: #6366f1;
  --primary-ink: #ffffff;
  --primary-soft: #e0e7ff;
  --green: #15803d;
  --green-soft: #dcfce7;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --anon: #6d28d9;
  --gold: #f59e0b;
  --shadow: 0 1px 2px rgba(28, 20, 90, .06), 0 6px 20px rgba(28, 20, 90, .07);
  --radius: 18px;
  --radius-sm: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12111f; --bg2: #1b1a2e; --card: #1f1e33; --ink: #ecebff; --muted: #a5a3c7; --line: #34324f;
    --primary: #818cf8; --primary-2: #a5b4fc; --primary-ink: #11102a; --primary-soft: #2b2a55;
    --green: #4ade80; --green-soft: #12341f; --amber: #fbbf24; --amber-soft: #3a2c0c; --red: #f87171; --red-soft: #3b1515;
    --anon: #a78bfa; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12111f; --bg2: #1b1a2e; --card: #1f1e33; --ink: #ecebff; --muted: #a5a3c7; --line: #34324f;
  --primary: #818cf8; --primary-2: #a5b4fc; --primary-ink: #11102a; --primary-soft: #2b2a55;
  --green: #4ade80; --green-soft: #12341f; --amber: #fbbf24; --amber-soft: #3a2c0c; --red: #f87171; --red-soft: #3b1515;
  --anon: #a78bfa; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

/* robot mode: teal accent */
body.robot { --primary: #0d9488; --primary-2: #14b8a6; --primary-soft: #ccfbf1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body.robot { --primary: #2dd4bf; --primary-soft: #113a36; } }
:root[data-theme="dark"] body.robot { --primary: #2dd4bf; --primary-soft: #113a36; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 var(--font);
  min-height: 100vh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
a { color: var(--primary); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--primary-2); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 50; background: var(--card); padding: 8px 12px; }
.noscript { padding: 24px; text-align: center; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.left { text-align: left; }
.mono { font-family: var(--mono); }

/* ---------------------------------------------------------------- chrome */

.anon-bar {
  background: var(--anon); color: #fff; text-align: center; font-size: .9rem; font-weight: 600;
  padding: 6px 12px; position: sticky; top: 0; z-index: 20;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 760px; margin: 0 auto; padding: 12px 16px;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.25rem; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: var(--primary); color: var(--primary-ink); font-size: 1.2rem;
}
.topnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.navlink {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px;
  color: var(--muted); text-decoration: none; font-size: .72rem; border-radius: 10px; min-width: 0;
}
.navlink .navicon { font-size: 1.35rem; line-height: 1.2; }
.navlink .navlabel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.navlink.on { color: var(--primary); font-weight: 700; background: var(--primary-soft); }

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .topnav { position: static; display: flex; gap: 4px; background: none; border: 0; padding: 0; }
  .navlink { flex-direction: row; gap: 6px; font-size: .92rem; padding: 8px 12px; }
  .navlink .navicon { font-size: 1.1rem; }
}

main { max-width: 760px; margin: 0 auto; padding: 0 16px 24px; outline: none; }
main:focus-visible { outline: none; }
.foot { max-width: 760px; margin: 0 auto; padding: 8px 16px 24px; text-align: center; color: var(--muted); font-size: .85rem; }
.foot p { margin: 4px 0; }
.foot a, .linkbtn { color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 4px; cursor: pointer; text-decoration: underline; }
.card .linkbtn, .setup .linkbtn { color: var(--primary); }

/* ---------------------------------------------------------------- building blocks */

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin: 0 0 16px;
}
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 0; }
.row.between { justify-content: space-between; margin-top: 0; }
.row.center { justify-content: center; }
.row.end { justify-content: flex-end; }
.stack { display: grid; gap: 10px; margin: 16px auto 8px; max-width: 360px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  font-weight: 650; text-decoration: none; cursor: pointer; transition: transform .08s, background .15s;
}
.btn:hover { border-color: var(--primary-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.danger { color: var(--red); border-color: var(--red); background: transparent; }
.btn.big { min-height: 56px; font-size: 1.08rem; width: 100%; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .82rem; font-weight: 700;
  background: var(--primary-soft); color: var(--primary);
}
.badge.fire { background: var(--amber-soft); color: var(--amber); font-size: .95rem; }
.badge.x2 { background: var(--green-soft); color: var(--green); margin-left: 6px; }
.badge.anon { background: var(--anon); color: #fff; }
.badge.tiny { font-size: .7rem; padding: 2px 7px; margin-left: 6px; }
.badge.block { display: block; text-align: center; border-radius: var(--radius-sm); padding: 8px 12px; margin: 0 0 12px; }
.big-emoji { font-size: 3.4rem; line-height: 1.1; margin: 4px 0 8px; }
.big-avatar { font-size: 4rem; line-height: 1; }

.stars { letter-spacing: 2px; font-size: 1.6rem; white-space: nowrap; }
.stars .on { color: var(--gold); }
.stars .off { color: var(--line); }

.dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dots span.on { background: var(--primary); }

.ticks { padding: 0; list-style: none; max-width: 420px; margin: 0 auto 12px; }
.ticks li { padding: 4px 0 4px 28px; position: relative; }
.ticks li::before { content: '✓'; position: absolute; left: 4px; color: var(--green); font-weight: 800; }

.back { display: inline-block; margin-bottom: 8px; text-decoration: none; font-weight: 600; }
.daily-head { margin: 8px 0 12px; }
.daily-head h1 { margin-bottom: 4px; }

/* ---------------------------------------------------------------- home */

.hero { display: flex; align-items: center; gap: 14px; margin: 8px 0 16px; }
.hero h1 { margin: 0; }
.hero p { margin: 0; }
.hero-avatar {
  font-size: 2.3rem; width: 64px; height: 64px; flex: none; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.tiers { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); margin-top: 12px; }
.tier {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 6px; text-align: center;
  border-radius: var(--radius-sm); border: 2px solid var(--line); text-decoration: none; color: var(--ink); background: var(--bg);
}
.tier:hover { border-color: var(--primary-2); }
.tier-name { font-weight: 750; }
.tier-age { color: var(--muted); }
.tier-play { color: var(--primary); font-weight: 700; margin-top: 4px; }
.tier .stars { font-size: 1.15rem; margin-top: 4px; }
@media (max-width: 420px) { .tiers { gap: 6px; } .tier { padding: 12px 4px; font-size: .92rem; } }

.statrow { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.stat { flex: 1 1 90px; text-align: center; background: var(--bg); border-radius: var(--radius-sm); padding: 10px 6px; }
.stat strong { display: block; font-size: 1.5rem; }
.stat small { color: var(--muted); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
}
.tile:hover { border-color: var(--primary-2); }
.tile-icon { font-size: 1.9rem; }
.tile small { color: var(--muted); }

/* ---------------------------------------------------------------- tabs */

.tabs { display: flex; gap: 6px; margin: 4px 0 12px; overflow-x: auto; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--card); border: 2px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 650;
  white-space: nowrap; cursor: pointer;
}
.tab.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.tabs.small .tab { flex-direction: row; justify-content: center; padding: 6px 10px; font-size: .92rem; }
.tabstars { color: var(--gold); font-size: .85rem; letter-spacing: 1px; }

/* ---------------------------------------------------------------- number board */

.board { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.target { text-align: center; margin-bottom: 14px; }
.target small { display: block; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }
.target strong { font-size: 3.4rem; line-height: 1; font-variant-numeric: tabular-nums; }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; min-height: 68px; }
.numtile {
  min-width: 68px; height: 68px; padding: 0 12px; border-radius: 16px; font-size: 1.6rem; font-weight: 800;
  background: var(--bg2); border: 2.5px solid transparent; cursor: pointer; font-variant-numeric: tabular-nums;
  transition: transform .1s, border-color .15s;
}
.numtile:active { transform: scale(.94); }
.numtile.made { background: var(--primary-soft); color: var(--primary); }
.numtile.sel { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); transform: translateY(-2px); }
.numtile.hit { background: var(--green-soft); color: var(--green); }
.numtile.hinted, .opbtn.hinted { animation: glow 1.2s ease-in-out infinite; }
.ops { display: flex; gap: 10px; justify-content: center; margin: 16px 0 6px; }
.opbtn {
  width: 60px; height: 60px; border-radius: 50%; font-size: 1.7rem; font-weight: 800; cursor: pointer;
  background: var(--card); border: 2.5px solid var(--line); color: var(--ink);
}
.opbtn.sel { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.opbtn:disabled { opacity: .3; cursor: default; }
.board-msg { min-height: 1.5em; text-align: center; color: var(--amber); font-weight: 600; margin: 6px 0; }
.steps { margin: 0 auto 6px; padding: 0; list-style: none; max-width: 280px; font-variant-numeric: tabular-nums; }
.steps li { padding: 4px 10px; border-bottom: 1px dashed var(--line); text-align: center; font-weight: 600; }
.steps.solution li { border-color: var(--line); }
.tools { justify-content: center; }
.tools .btn { min-height: 42px; padding: 8px 12px; font-size: .92rem; }
.shake { animation: shake .35s; }
@media (max-width: 420px) {
  .numtile { min-width: 58px; height: 58px; font-size: 1.4rem; }
  .opbtn { width: 54px; height: 54px; }
  .target strong { font-size: 2.8rem; }
}

.result .stars { font-size: 2.4rem; }
.points { font-size: 1.4rem; font-weight: 800; color: var(--green); margin: 4px 0; }
.solution-box { margin: 12px auto; max-width: 320px; text-align: left; }
.solution-box summary { cursor: pointer; font-weight: 650; color: var(--primary); text-align: center; }
.yday { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
pre.share { background: var(--bg); padding: 12px; border-radius: var(--radius-sm); white-space: pre-wrap; }

/* ---------------------------------------------------------------- topics */

.topic-group h2 small { color: var(--muted); font-weight: 500; font-size: .85rem; }
.group-green h2 { color: var(--green); }
.group-amber h2 { color: var(--amber); }
.group-red h2 { color: var(--red); }
.topic-list { display: grid; gap: 6px; }
.topic-row {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); background: var(--bg);
}
.topic-row:hover { background: var(--primary-soft); }
.topic-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); font-weight: 800; font-size: 1rem;
}
.topic-icon.big { display: inline-grid; width: 52px; height: 52px; font-size: 1.3rem; vertical-align: middle; }
.topic-name { font-weight: 650; }
.topic-stars { display: flex; gap: 4px; }
.mini { min-width: 30px; text-align: center; font-size: .75rem; color: var(--gold); border-radius: 6px; padding: 2px 3px; background: var(--card); }
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.level {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 6px; cursor: pointer;
  border-radius: var(--radius); border: 2.5px solid var(--line); background: var(--bg); color: var(--ink);
}
.level.lv-e { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.level.lv-m { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); }
.level.lv-h { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.level:hover { background: var(--primary-soft); }
.level small { color: var(--muted); }
.level .stars { font-size: 1.1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-width: 44px; height: 40px; padding: 0 12px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-weight: 650; }
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

/* ---------------------------------------------------------------- a round */

.play { text-align: center; }
.progress { position: relative; height: 26px; background: var(--bg2); border-radius: 99px; overflow: hidden; margin: 10px 0 16px; --p: 0%; }
.progress::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--primary); border-radius: 99px; transition: width .3s; }
.progress::after { content: attr(data-label); position: absolute; inset: 0; display: grid; place-items: center; font-size: .82rem; font-weight: 700; mix-blend-mode: difference; color: #fff; }
.question { min-height: 120px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.qtext { font-size: 2.3rem; font-weight: 800; margin: 6px 0; font-variant-numeric: tabular-nums; word-break: break-word; }
.qtext.long { font-size: 1.35rem; font-weight: 700; line-height: 1.35; }
.visual { margin: 4px 0; }
.clock { width: 170px; height: 170px; }
.clock-face { fill: var(--card); stroke: var(--ink); stroke-width: 2.5; }
.tick { stroke: var(--muted); stroke-width: .8; }
.tick.big { stroke: var(--ink); stroke-width: 1.8; }
.clock-num { font-size: 8px; font-weight: 700; text-anchor: middle; fill: var(--ink); font-family: var(--font); }
.hand { stroke: var(--ink); stroke-linecap: round; }
.hand.hour { stroke-width: 4; }
.hand.minute { stroke-width: 2.5; stroke: var(--primary); }
.clock-pin { fill: var(--ink); }
.emoji-grid { font-size: 2rem; line-height: 1.3; max-width: 340px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.egroup { background: var(--bg); border-radius: 12px; padding: 2px 6px; }
.answer { min-height: 64px; display: flex; justify-content: center; align-items: center; }
.answer-box {
  min-width: 140px; padding: 6px 18px; font-size: 2rem; font-weight: 800; border-radius: var(--radius-sm);
  border: 2.5px solid var(--primary); background: var(--bg); font-variant-numeric: tabular-nums;
}
.answer-box.empty { color: var(--muted); border-style: dashed; }
.feedback { min-height: 1.5em; margin: 8px 0; }
.feedback.good { color: var(--green); font-size: 1.2rem; }
.feedback.bad { color: var(--red); }
.feedback.bad p { color: var(--ink); background: var(--red-soft); border-radius: var(--radius-sm); padding: 8px 12px; margin: 8px auto; max-width: 440px; }
p.feedback.bad:empty { display: none; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 320px; margin: 8px auto 0; }
.key {
  height: 58px; border-radius: 14px; font-size: 1.5rem; font-weight: 750; cursor: pointer;
  background: var(--bg2); border: 0; color: var(--ink);
}
.key:active { transform: scale(.95); }
.key.del { background: var(--card); border: 1.5px solid var(--line); }
.key.ok { background: var(--primary); color: var(--primary-ink); grid-column: span 2; }
.key.ok.wide { grid-column: span 3; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; max-width: 420px; margin: 10px auto 0; }
.choice { min-height: 60px; font-size: 1.4rem; }
.choice.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.equation { font-size: 2.2rem; font-weight: 800; margin: 8px 0; }
.equation.small-eq { font-size: 1.5rem; margin: 0 0 6px; }
.gate .choices { max-width: 340px; }

/* ---------------------------------------------------------------- forms */

.form { display: grid; gap: 14px; }
.form h1 { margin-bottom: 0; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 650; }
input[type=text], input[type=password], select {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink);
}
input:focus, select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.form .row input { flex: 1 1 180px; }
.pw { display: flex; gap: 8px; align-items: center; }
.pw-rules { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 2px 12px; font-size: .88rem; color: var(--muted); }
.pw-rules li::before { content: '○ '; }
.pw-rules li.ok { color: var(--green); }
.pw-rules li.ok::before { content: '✓ '; font-weight: 800; }
.pw input { flex: 1; }
.captcha { border: 1.5px dashed var(--line); border-radius: var(--radius-sm); padding: 10px 14px 14px; text-align: center; }
.captcha legend { font-weight: 650; padding: 0 6px; }
.captcha .choices { margin-top: 4px; }
.avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.av { height: 52px; font-size: 1.8rem; border-radius: 14px; border: 2.5px solid var(--line); background: var(--bg); cursor: pointer; }
.av.on { border-color: var(--primary); background: var(--primary-soft); }
.code {
  font-family: var(--mono); font-size: 1.5rem; font-weight: 800; letter-spacing: .06em; padding: 14px; margin: 12px auto;
  background: var(--amber-soft); color: var(--ink); border: 2px dashed var(--amber); border-radius: var(--radius-sm);
  max-width: 420px; word-break: break-all;
}
.check { display: inline-flex; gap: 8px; align-items: center; margin: 12px 0; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 650; }
.switch input { appearance: none; width: 52px; height: 30px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked { background: var(--anon); }
.switch input:checked::after { left: 25px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.seg button { flex: 1; min-height: 44px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--bg); cursor: pointer; font-weight: 650; }
.seg button.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
details summary { cursor: pointer; font-weight: 650; }
details[open] summary { margin-bottom: 10px; }

/* setup options */
.option {
  display: flex; align-items: center; gap: 14px; padding: 14px; text-align: left; cursor: pointer;
  border-radius: var(--radius); border: 2px solid var(--line); background: var(--bg); color: var(--ink);
}
.option:hover, .option.on { border-color: var(--primary); }
.option-icon { font-size: 2rem; }
.option strong { display: block; }
.option small { color: var(--muted); }

/* ---------------------------------------------------------------- social */

.list { display: grid; gap: 6px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); text-decoration: none; }
.list-row:hover { background: var(--primary-soft); }
.list-row small { display: block; color: var(--muted); }
.list-icon { font-size: 1.5rem; }
.leader { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.leader li { display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg); }
.leader li.me { background: var(--primary-soft); font-weight: 700; }
.rank { text-align: center; font-weight: 800; color: var(--muted); }
.who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-sm { font-size: 1.4rem; }
.av-md { font-size: 2rem; }
.pts { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { display: flex; gap: 2px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.qr-screen .qr-box { width: min(78vw, 320px); margin: 12px auto 6px; background: #fff; padding: 8px; border-radius: 16px; box-shadow: var(--shadow); }
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-timer { font-weight: 700; color: var(--primary); }
.requests { display: grid; gap: 10px; margin-top: 16px; }
.request { display: grid; justify-items: center; gap: 4px; padding: 14px; border-radius: var(--radius); background: var(--green-soft); border: 2px solid var(--green); }
.scan-area { position: relative; width: min(86vw, 380px); aspect-ratio: 1; margin: 12px auto; border-radius: 20px; overflow: hidden; background: #000; }
.scan-video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 14%; border: 4px solid rgba(255, 255, 255, .85); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); }
.scan-status { font-weight: 650; }

/* ---------------------------------------------------------------- prose, tables */

.prose h2 { margin-top: 1.2em; }
.prose p { color: var(--ink); }
table.simple { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: .95rem; }
table.simple th, table.simple td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.simple td:last-child { white-space: nowrap; font-weight: 650; }

/* ---------------------------------------------------------------- modal & toast */

.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(10, 8, 30, .45); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--card); border-radius: var(--radius); padding: 20px; width: min(100%, 440px); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); animation: pop .2s; }
.toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 70;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 650;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { background: var(--green); color: #fff; }
.toast.bad { background: var(--red); color: #fff; }
@media (min-width: 760px) { .toast { bottom: 24px; } }

/* ---------------------------------------------------------------- motion */

.pop { animation: pop .3s ease-out; }
.spin-slow { animation: spin 3s linear infinite; display: inline-block; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes glow { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 55%, transparent); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- print (recovery code) */

@media print {
  .topbar, .topnav, .foot, .anon-bar, .btn, .check, .toast { display: none !important; }
  body { background: #fff; padding: 0; }
  .card { box-shadow: none; border: 0; }
}
