/* Tuma Games portal: "Nairobi night arcade". Matatu-art stickers, neon on deep night blue. */
@font-face { font-family: "Bungee"; src: url("../fonts/bungee-latin.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --ink: #0b0d1f; --ink2: #14183a; --panel: #1b2052; --panel2: #232a66; --line: #2f3780;
  --lime: #c6ff3d; --pink: #ff3d8b; --sun: #ffb020; --cyan: #3de0ff; --violet: #8b5cff; --green: #33e39b; --red: #ff4d5e;
  --paper: #fff6e5; --muted: #a3abdc; --shadow: #05060f;
  --r: 20px; --r-sm: 12px;
  --display: "Bungee", "Figtree", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bar-h: 58px; --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--ink); color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--paper); font: 16px/1.45 var(--body);
  background:
    radial-gradient(60vmax 40vmax at 110% -10%, rgba(255, 61, 139, 0.22), transparent 60%),
    radial-gradient(50vmax 40vmax at -20% 30%, rgba(61, 224, 255, 0.14), transparent 60%),
    radial-gradient(70vmax 50vmax at 50% 120%, rgba(139, 92, 255, 0.2), transparent 60%),
    var(--ink);
  background-attachment: fixed;
  overflow-x: hidden;
}
body::before {   /* matatu-stripe texture */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.05;
  background: repeating-linear-gradient(-55deg, var(--paper) 0 2px, transparent 2px 22px);
}
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
.display { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; line-height: 1.05; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ic { width: 1.1em; height: 1.1em; flex: none; display: inline-block; vertical-align: -0.17em; }
.ic.big { width: 44px; height: 44px; }
.ic.flip { transform: scaleX(-1); }

/* ── shell ─────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--bar-h); display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 0 14px; max-width: 560px; margin: 0 auto;
  background: linear-gradient(var(--ink) 70%, rgba(11, 13, 31, 0));
}
.logo { font-family: var(--display); font-size: 21px; letter-spacing: 0.03em; color: var(--paper); text-shadow: 2px 2px 0 var(--pink); white-space: nowrap; }
.logo span { color: var(--lime); margin-left: 6px; text-shadow: 2px 2px 0 var(--violet); }
#bar-right { display: flex; align-items: center; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 99px; font-weight: 800; font-size: 14px; background: var(--panel); border: 1px solid var(--line); }
.pill-pts .ic { color: var(--lime); }
.pill-fire .ic { color: var(--sun); }
.bar-av .av { border-width: 2px; }

main#view { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 4px 14px calc(var(--nav-h) + 28px + var(--safe-b)); min-height: 70vh; }

#nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  padding: 6px 6px calc(6px + var(--safe-b)); background: rgba(11, 13, 31, 0.94); border-top: 1px solid var(--line);
}
#nav .navin { display: flex; width: 100%; max-width: 560px; }
#nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 14px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.02em; transition: color 0.2s, background 0.2s; }
#nav a svg { width: 24px; height: 24px; transition: transform 0.25s cubic-bezier(.3, 1.6, .5, 1); }
#nav a.on { color: var(--lime); background: rgba(198, 255, 61, 0.08); }
#nav a.on svg { transform: translateY(-2px) scale(1.12); }

/* ── buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px;
  border: 2px solid var(--shadow); border-radius: 16px; background: var(--panel2); color: var(--paper); font-weight: 800; font-size: 16px;
  box-shadow: 0 5px 0 var(--shadow); cursor: pointer; transition: transform 0.08s, box-shadow 0.08s, filter 0.2s; text-align: center;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--shadow); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-go { background: var(--lime); color: var(--ink); }
.btn-go .ic { color: var(--ink); }
.btn-xl { min-height: 58px; font-size: 18px; padding: 12px 22px; border-radius: 18px; width: 100%; }
.btn-ghost { background: transparent; border-color: var(--line); box-shadow: none; }
.btn-ghost:active { transform: translateY(2px); }
.btn-danger { background: var(--red); }
.btn-join { min-height: 40px; padding: 6px 14px; font-size: 14px; border-radius: 12px; background: var(--pink); box-shadow: 0 4px 0 var(--shadow); }
.linkbtn { background: none; border: 0; padding: 6px 0; color: var(--cyan); font-weight: 700; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; border: 2px solid var(--shadow); background: var(--panel2); box-shadow: 0 4px 0 var(--shadow); cursor: pointer; }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow); }
.icon-btn .ic { width: 22px; height: 22px; }
.icon-btn:disabled { opacity: 0.35; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; background: rgba(255, 255, 255, 0.1); }
.chip-hot { background: var(--sun); color: var(--ink); }
.chip-live { background: var(--red); color: var(--paper); }
.chip-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--paper); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

/* ── sections ──────────────────────────────────────────────────────── */
.sec { margin-top: 28px; }
.sec > h2.display, .sec-head h2 { font-size: 20px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sec-head a { color: var(--cyan); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.sec > h2.display { margin-bottom: 12px; }
.page-title { font-size: 30px; margin: 10px 0 16px; }
.page-title span { color: var(--muted); font-size: 18px; }
.empty { padding: 22px 16px; text-align: center; color: var(--muted); background: var(--ink2); border-radius: var(--r); border: 1px dashed var(--line); }
.empty-state { text-align: center; padding: 48px 8px 12px; display: grid; justify-items: center; gap: 12px; }
.empty-state .ic.big { color: var(--muted); }
.empty-state .btn { margin-top: 6px; }

/* reveal on load */
.rv { opacity: 0; transform: translateY(14px); animation: rise 0.55s cubic-bezier(.2, .9, .3, 1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.pop-in { animation: popin 0.42s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes popin { from { opacity: 0; transform: scale(0.85); } }

/* ── hero ──────────────────────────────────────────────────────────── */
.hero { position: relative; margin-top: 8px; padding: 26px 20px 22px; border-radius: 26px; overflow: hidden; border: 2px solid var(--shadow);
  background: linear-gradient(150deg, #3a1765 0%, #1b2052 55%, #0f3b4c 100%); box-shadow: 0 8px 0 var(--shadow); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.12;
  background: repeating-linear-gradient(-55deg, var(--lime) 0 10px, transparent 10px 34px); mask-image: linear-gradient(90deg, transparent 40%, #000); -webkit-mask-image: linear-gradient(90deg, transparent 40%, #000); }
.hero-glow { position: absolute; width: 240px; height: 240px; right: -70px; top: -80px; border-radius: 50%; background: radial-gradient(var(--pink), transparent 65%); opacity: 0.55; animation: drift 7s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(-40px, 40px) scale(1.15); } }
.kicker { color: var(--lime); font-weight: 800; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; position: relative; }
.hero-title { position: relative; font-size: clamp(40px, 12vw, 60px); margin: 10px 0 12px; text-shadow: 4px 4px 0 var(--shadow); }
.hero-title span { color: var(--lime); }
.hero-sub { position: relative; color: #d9dcf5; max-width: 30ch; }
.hero-cta { position: relative; margin-top: 18px; display: grid; gap: 8px; justify-items: center; }
.hero-price { font-size: 13px; color: var(--muted); }

.hello { margin-top: 8px; padding: 18px; border-radius: 24px; background: linear-gradient(160deg, var(--panel2), var(--ink2)); border: 2px solid var(--shadow); box-shadow: 0 7px 0 var(--shadow); }
.hello-top { display: flex; align-items: center; gap: 14px; }
.hello h1 { font-size: 24px; margin-top: 2px; }
.hello .btn { margin-top: 14px; width: 100%; }
.lvl { margin-top: 16px; }
.lvl-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; gap: 8px; }
.lvl-top b { color: var(--av, var(--lime)); }
.lvl-top span { color: var(--muted); }
.bar { height: 10px; border-radius: 99px; background: var(--ink); overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; width: var(--w, 0%); border-radius: 99px; background: linear-gradient(90deg, var(--av, var(--lime)), var(--paper)); transition: width 0.8s; }
.stats3, .stats4 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.stats4 { grid-template-columns: repeat(4, 1fr); }
.stats3 > div, .stats4 > div { background: var(--ink); border-radius: 14px; padding: 10px 6px; text-align: center; border: 1px solid var(--line); }
.stats3 b, .stats4 b { display: block; font-family: var(--display); font-size: 18px; }
.stats3 span, .stats4 span { font-size: 11px; color: var(--muted); }

.announce { margin-top: 14px; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: rgba(255, 176, 32, 0.12); border: 1px solid rgba(255, 176, 32, 0.4); }
.announce .ic { color: var(--sun); margin-top: 2px; }

/* ── daily challenge ───────────────────────────────────────────────── */
.daily { position: relative; margin-top: 20px; border-radius: 24px; padding: 3px; background: conic-gradient(from var(--spin, 0deg), var(--c1), var(--c2), var(--lime), var(--c1)); box-shadow: 0 8px 0 var(--shadow); animation: spin 6s linear infinite; }
.daily.rv { animation: rise 0.55s cubic-bezier(.2, .9, .3, 1) forwards, spin 6s linear infinite; }
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --spin: 360deg; } }
.daily-art { border-radius: 21px 21px 0 0; overflow: hidden; }
.daily-art svg { width: 100%; height: 150px; }
.daily-body { background: var(--ink2); border-radius: 0 0 21px 21px; padding: 14px 16px 16px; display: grid; gap: 8px; justify-items: start; }
.daily-body h2 { font-size: 26px; }
.daily-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); font-weight: 700; }
.daily-meta .cd { color: var(--lime); font-family: var(--display); font-weight: 400; }
.daily .btn { width: 100%; margin-top: 4px; }

/* ── game cards ────────────────────────────────────────────────────── */
.ggrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gcard { position: relative; display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; background: var(--ink2); border: 2px solid var(--shadow);
  box-shadow: 0 6px 0 var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.04) inset; transition: transform 0.15s; }
.gcard:active { transform: translateY(3px) rotate(-0.4deg); }
.gcard-art svg { width: 100%; aspect-ratio: 4 / 3; height: auto; }
.gcard-art { position: relative; }
.gcard-art::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: linear-gradient(90deg, var(--c1), var(--c2)); }
.gcard-body { padding: 10px 12px 14px; display: grid; gap: 3px; }
.gcard-body h3 { font-family: var(--display); font-weight: 400; font-size: 16px; line-height: 1.1; }
.gcard-body p { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.gcard-cat { font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c1, var(--lime)); }
.gcard-play { position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--ink); border: 2px solid var(--shadow); box-shadow: 0 3px 0 var(--shadow); }
.gcard-play .ic { width: 20px; height: 20px; margin-left: 2px; }
.gcard .chip { justify-self: start; margin-top: 4px; }
.sec > .gcard { max-width: 100%; }

.hscroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.hscroll::-webkit-scrollbar { display: none; }
.mini { flex: none; width: 128px; border-radius: 16px; overflow: hidden; background: var(--ink2); border: 2px solid var(--shadow); box-shadow: 0 5px 0 var(--shadow); }
.mini svg { width: 100%; aspect-ratio: 4 / 3; height: auto; }
.mini b { display: block; padding: 8px 10px; font-family: var(--display); font-weight: 400; font-size: 13px; }

/* ── competitions ──────────────────────────────────────────────────── */
.tlist { display: grid; gap: 12px; }
.tcard { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 18px; background: var(--ink2); border: 2px solid var(--shadow); box-shadow: 0 5px 0 var(--shadow); }
.tcard.live { background: linear-gradient(120deg, rgba(255, 77, 94, 0.18), var(--ink2) 60%); }
.tcard-art { border-radius: 12px; overflow: hidden; }
.tcard-art svg { width: 100%; height: auto; aspect-ratio: 4 / 3; }
.tcard-body { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.tcard-body h3 { font-family: var(--display); font-weight: 400; font-size: 16px; }
.tcard-body p, .tcard-meta { font-size: 12.5px; color: var(--muted); }
.tcard-meta .cd { color: var(--lime); font-weight: 800; }
.result-row { display: grid; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--ink2); margin-bottom: 8px; border: 1px solid var(--line); }
.result-row span { font-size: 13px; color: var(--muted); }
.result-row .winner { color: var(--sun); font-weight: 700; }
.prize-card { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 22px; background: linear-gradient(135deg, rgba(255, 176, 32, 0.22), rgba(255, 61, 139, 0.18)); border: 2px solid var(--shadow); box-shadow: 0 6px 0 var(--shadow); }
.prize-card .ic.big { color: var(--sun); flex: none; }
.prize-card h2 { font-size: 20px; margin-bottom: 4px; }
.prize-card p { font-size: 14px; color: #e6e8fb; }
.winners { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.winners li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--ink2); border-radius: 14px; font-size: 14px; }
.winners small { display: block; color: var(--muted); }

/* ── leaderboards ──────────────────────────────────────────────────── */
.lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lb-row { display: grid; grid-template-columns: 38px 34px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--ink2); border: 1px solid transparent; }
.lb-row.me { border-color: var(--lime); background: rgba(198, 255, 61, 0.08); }
.lb-row.pinned { margin-top: 8px; border-style: dashed; }
.lb-rank { display: flex; align-items: center; gap: 2px; font-family: var(--display); font-size: 15px; color: var(--muted); }
.lb-rank .ic { width: 14px; height: 14px; }
.top1 .lb-rank { color: #ffd34d; } .top2 .lb-rank { color: #d9e1ff; } .top3 .lb-rank { color: #ff9d5c; }
.lb-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name em { font-style: normal; font-size: 11px; color: var(--ink); background: var(--lime); padding: 1px 6px; border-radius: 99px; margin-left: 4px; vertical-align: 2px; }
.lb-score { font-family: var(--display); font-size: 16px; }
.lb-score small { font-family: var(--body); font-size: 11px; color: var(--muted); margin-left: 2px; }

.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin: 18px 0 14px; }
.pod { display: grid; justify-items: center; gap: 4px; text-align: center; min-width: 0; }
.pod-name { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-score { font-size: 12px; color: var(--muted); }
.pod-step { width: 100%; display: grid; place-items: center; border-radius: 14px 14px 6px 6px; border: 2px solid var(--shadow); font-family: var(--display); font-size: 22px; color: var(--ink); }
.pod1 .pod-step { height: 92px; background: linear-gradient(#ffe27a, #ffb020); }
.pod2 .pod-step { height: 68px; background: linear-gradient(#f1f4ff, #a9b4e8); }
.pod3 .pod-step { height: 52px; background: linear-gradient(#ffc39a, #ff7a3d); }
.pod1 .av { box-shadow: 0 0 0 3px #ffd34d, 0 0 24px rgba(255, 211, 77, 0.6); }

.seg { display: flex; background: var(--ink2); padding: 4px; border-radius: 14px; gap: 4px; margin-bottom: 12px; border: 1px solid var(--line); }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.seg button.on { background: var(--panel2); color: var(--paper); box-shadow: 0 2px 0 var(--shadow); }
.seg.small button { min-height: 34px; font-size: 13px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px 12px; padding: 0 14px 4px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chipbtn { flex: none; min-height: 38px; padding: 6px 14px; border-radius: 99px; border: 2px solid var(--line); background: transparent; color: var(--paper); font-weight: 700; cursor: pointer; }
.chipbtn.on { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* ── game page ─────────────────────────────────────────────────────── */
.ghero { position: relative; margin-top: 6px; border-radius: 26px; overflow: hidden; background: var(--ink2); border: 2px solid var(--shadow); box-shadow: 0 8px 0 var(--shadow); }
.ghero-art svg { width: 100%; height: auto; aspect-ratio: 16 / 10; }
.ghero-art::after { content: ""; position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 16 / 10; background: linear-gradient(transparent 55%, var(--ink2)); }
.ghero-body { position: relative; padding: 0 18px 18px; margin-top: -26px; display: grid; gap: 6px; justify-items: start; }
.ghero-body h1 { font-size: 32px; text-shadow: 3px 3px 0 var(--shadow); }
.ghero-body .btn { margin-top: 8px; }
.ghero-body .muted { font-size: 13px; }
.intro-sw { color: var(--c1, var(--lime)); font-weight: 800; font-style: italic; }
.back { position: absolute; z-index: 2; left: 10px; top: 10px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(11, 13, 31, 0.7); border: 2px solid var(--shadow); }
.howto { margin: 0; padding-left: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.howto li { counter-increment: s; position: relative; padding-left: 40px; min-height: 28px; display: flex; align-items: center; }
.howto li::before { content: counter(s); position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-family: var(--display); font-size: 14px; color: var(--ink); background: var(--c1, var(--lime)); }
ul.howto li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; left: 9px; }

/* ── profile ───────────────────────────────────────────────────────── */
.profile { display: flex; gap: 16px; align-items: center; margin-top: 10px; }
.profile h1 { font-size: 26px; word-break: break-all; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wday { display: grid; justify-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.wday i { width: 100%; aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; background: var(--ink2); border: 1px solid var(--line); }
.wday.on i { background: linear-gradient(var(--sun), var(--pink)); border-color: var(--shadow); color: var(--ink); }
.wday i .ic { width: 18px; height: 18px; }
.week + p { margin-top: 10px; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge { display: grid; justify-items: center; text-align: center; gap: 3px; padding: 12px 6px; border-radius: 16px; background: var(--ink2); border: 1px solid var(--line); opacity: 0.55; }
.badge .ic { width: 28px; height: 28px; color: var(--muted); }
.badge b { font-size: 12.5px; }
.badge span { font-size: 10.5px; color: var(--muted); line-height: 1.25; }
.badge.got { opacity: 1; border-color: rgba(198, 255, 61, 0.5); background: linear-gradient(160deg, rgba(198, 255, 61, 0.12), var(--ink2)); }
.badge.got .ic { color: var(--lime); }
.bests { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.bests a { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--ink2); }
.bests .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--av); }
.bests span:last-child { font-size: 13px; color: var(--muted); }
.toggles { display: grid; gap: 8px; }
.toggle { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--ink2); cursor: pointer; }
.toggle span { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle i { width: 50px; height: 30px; border-radius: 99px; background: var(--line); position: relative; transition: background 0.2s; flex: none; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); transition: transform 0.2s; }
.toggle input:checked + i { background: var(--lime); }
.toggle input:checked + i::after { transform: translateX(20px); background: var(--ink); }
.toggle input:focus-visible + i { outline: 2px solid var(--cyan); outline-offset: 2px; }
.faq { display: grid; gap: 8px; }
.faq details { background: var(--ink2); border-radius: 14px; padding: 0 14px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--lime); font-weight: 800; }
.faq details[open] summary::after { content: "−"; }
.faq p { padding-bottom: 14px; color: #d9dcf5; font-size: 14.5px; }

/* ── avatars ───────────────────────────────────────────────────────── */
.av { --av: var(--lime); display: inline-grid; place-items: center; flex: none; border-radius: 50%; color: var(--ink);
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.55), transparent 45%), var(--av); border: 2px solid var(--shadow); }
.av svg { width: 58%; height: 58%; }
.av-sm { width: 34px; height: 34px; } .av-md { width: 48px; height: 48px; } .av-lg { width: 62px; height: 62px; } .av-xl { width: 86px; height: 86px; border-width: 3px; box-shadow: 0 5px 0 var(--shadow); }

/* ── sheets (modals) ───────────────────────────────────────────────── */
.sheet { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.sheet.open { pointer-events: auto; }
.sheet-back { position: absolute; inset: 0; background: rgba(5, 6, 15, 0.7); opacity: 0; transition: opacity 0.25s; }
.sheet.open .sheet-back { opacity: 1; }
.sheet-card { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: 92vh; overflow-y: auto; padding: 22px 18px calc(22px + var(--safe-b));
  border-radius: 28px 28px 0 0; background: linear-gradient(var(--panel), var(--ink2)); border: 2px solid var(--shadow); border-bottom: 0;
  transform: translateY(105%); transition: transform 0.32s cubic-bezier(.2, .9, .3, 1); }
.sheet.open .sheet-card { transform: none; }
.sheet-x { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.08); display: grid; place-items: center; cursor: pointer; }
.gate, .onb { display: grid; gap: 12px; justify-items: center; text-align: center; }
.gate h2, .onb h2 { font-size: 24px; }
.gate p { color: #d9dcf5; max-width: 36ch; }
.gate .btn { width: 100%; }
.gate-art { width: 100%; border-radius: 18px; overflow: hidden; border: 2px solid var(--shadow); }
.gate-art svg { width: 100%; height: 130px; }
.gate-badge { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--ink); animation: popin 0.5s cubic-bezier(.3, 1.6, .5, 1); }
.gate-badge .ic { width: 42px; height: 42px; }
.fine { font-size: 12px; color: var(--muted); }
.onb-preview { margin: 6px 0; }
.field { display: grid; gap: 6px; width: 100%; text-align: left; font-weight: 700; font-size: 14px; }
.field input { min-height: 52px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--ink); color: var(--paper); font: 700 18px var(--body); outline: none; }
.field input:focus { border-color: var(--lime); }
.sw-row, .glyph-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sw { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; background: var(--av); cursor: pointer; }
.sw.on { border-color: var(--paper); box-shadow: 0 0 0 2px var(--shadow); }
.gl { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--ink); color: var(--paper); display: grid; place-items: center; cursor: pointer; }
.gl svg { width: 24px; height: 24px; }
.gl.on { border-color: var(--lime); color: var(--lime); }
.err { color: var(--red); font-weight: 700; min-height: 1.2em; font-size: 14px; }
.onb .btn { width: 100%; }

/* ── play screen ───────────────────────────────────────────────────── */
.play { position: fixed; inset: 0; z-index: 50; display: none; flex-direction: column; background: var(--ink); }
.play.open { display: flex; }
.play-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 4px; padding-top: max(10px, env(safe-area-inset-top)); }
.play-tools { display: flex; gap: 8px; }
.play-score { text-align: center; display: grid; line-height: 1; }
.ps-label { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
#ps-score { font-family: var(--display); font-weight: 400; font-size: 34px; text-shadow: 3px 3px 0 var(--pink); }
#ps-score.bump { animation: bump 0.25s ease; }
@keyframes bump { 40% { transform: scale(1.22); } }
.play-best { flex: none; text-align: center; font-size: 12px; color: var(--muted); min-height: 16px; }
.play-stage { position: relative; flex: 1; min-height: 0; margin: 6px 0 calc(6px + var(--safe-b)); }
.play-stage canvas { width: 100%; height: 100%; display: block; }
.play-layer { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 16px; background: rgba(5, 6, 15, 0.6); overflow-y: auto; }
.play-layer.hidden { display: none; }
.intro-card, .pause-card, .result-card { width: 100%; max-width: 380px; display: grid; gap: 10px; justify-items: center; text-align: center; padding: 18px; border-radius: 26px; background: linear-gradient(var(--panel), var(--ink2)); border: 2px solid var(--shadow); box-shadow: 0 8px 0 var(--shadow); }
.intro-card h2 { font-size: 30px; }
.intro-art { width: 100%; border-radius: 18px; overflow: hidden; border: 2px solid var(--shadow); }
.intro-art svg { width: 100%; height: 150px; }
.intro-card .howto { text-align: left; font-size: 14.5px; justify-self: stretch; }
.intro-card .btn { margin-top: 4px; }
.pause-card h2, .result-card h2 { font-size: 28px; }
.pause-card .btn, .result-card .btn { width: 100%; }
.count { font-family: var(--display); font-size: 120px; color: var(--lime); text-shadow: 6px 6px 0 var(--pink); }
.count.tick { animation: tick 0.65s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes tick { from { transform: scale(2.2); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }
.count.go { color: var(--paper); text-shadow: 6px 6px 0 var(--violet); animation: popin 0.4s; }
.res-kicker { font-family: var(--display); color: var(--cyan); font-size: 18px; }
.res-best { font-family: var(--display); font-size: 22px; color: var(--ink); background: var(--lime); padding: 4px 14px; border-radius: 99px; transform: rotate(-3deg); animation: popin 0.5s cubic-bezier(.3, 1.6, .5, 1); box-shadow: 0 4px 0 var(--shadow); }
.res-score { font-size: 64px; text-shadow: 4px 4px 0 var(--pink); }
.is-best .res-score { color: var(--lime); }
.res-unit { color: var(--muted); font-size: 14px; margin-top: -6px; }
.res-points { display: inline-flex; gap: 6px; align-items: center; padding: 6px 14px; border-radius: 99px; background: rgba(198, 255, 61, 0.12); color: var(--lime); font-weight: 800; }
.res-break { list-style: none; margin: 0; padding: 0; width: 100%; font-size: 13px; color: var(--muted); display: grid; gap: 2px; }
.res-break li { display: flex; justify-content: space-between; }
.res-ranks { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.res-rank { display: grid; padding: 8px 14px; border-radius: 14px; background: var(--ink); border: 1px solid var(--line); }
.res-rank b { font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--sun); }
.res-rank span { font-size: 11px; color: var(--muted); }
.res-ach { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.badge-pop { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--violet); font-weight: 800; font-size: 13px; animation: popin 0.6s cubic-bezier(.3, 1.6, .5, 1); }
.res-actions { width: 100%; display: grid; gap: 10px; }
.res-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; width: 100vw; height: 100vh; }

/* ── misc ──────────────────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + var(--safe-b)); z-index: 80; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 16px; background: var(--paper); color: var(--ink); font-weight: 800; box-shadow: 0 6px 0 var(--shadow); transition: transform 0.25s, opacity 0.25s; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { background: var(--lime); }
.in-game .toast { bottom: calc(24px + var(--safe-b)); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.15); border-top-color: var(--lime); animation: rot 0.8s linear infinite; margin: 18px auto; }
.spinner.big { width: 56px; height: 56px; border-width: 6px; }
.spinner.sm { width: 18px; height: 18px; border-width: 3px; margin: 0; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }
.skel { display: grid; gap: 14px; margin-top: 8px; }
.sk { border-radius: 20px; background: linear-gradient(90deg, var(--ink2) 25%, var(--panel) 50%, var(--ink2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; min-height: 150px; }
.sk-hero { min-height: 220px; } .sk-row { min-height: 70px; }
.sk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.foot { margin-top: 40px; padding: 22px 4px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 13px; color: #c7cbea; }
.foot-logo { font-size: 18px; color: var(--paper); }
.foot-logo span { color: var(--lime); margin-left: 4px; }
.foot a { color: var(--cyan); }

/* boot splash */
#boot { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--ink); transition: opacity 0.5s, visibility 0.5s; }
#boot.done { opacity: 0; visibility: hidden; }
.boot-logo { font-family: var(--display); font-size: 40px; text-align: center; line-height: 1; color: var(--paper); text-shadow: 4px 4px 0 var(--pink); animation: pulse 1.2s ease-in-out infinite; }
.boot-logo span { display: block; color: var(--lime); text-shadow: 4px 4px 0 var(--violet); }
.boot-stripes { width: 140px; height: 8px; margin: 18px auto 0; border-radius: 99px; background: repeating-linear-gradient(-55deg, var(--lime) 0 10px, var(--pink) 10px 20px, var(--sun) 20px 30px, var(--cyan) 30px 40px); background-size: 56px 8px; animation: stripes 0.8s linear infinite; }
@keyframes stripes { to { background-position: 56px 0; } }
@keyframes pulse { 50% { transform: scale(1.05); } }

@media (min-width: 600px) {
  body { font-size: 16.5px; }
  .ggrid { grid-template-columns: 1fr 1fr; gap: 16px; }
}
@media (max-width: 350px) {
  .ggrid { gap: 10px; }
  .gcard-body h3 { font-size: 14px; }
  .gcard-body p { display: none; }
  .stats4 { grid-template-columns: repeat(2, 1fr); }
  .badges { grid-template-columns: repeat(2, 1fr); }
  #nav a { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .rv { opacity: 1; transform: none; }
}
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
