:root {
  --bg: #07080c;
  --card: #0f1118;
  --card-2: #151824;
  --line: rgba(255, 255, 255, 0.08);
  --fg: #f2f4f8;
  --muted: #8a90a0;
  --dim: #565c6c;
  --blue: #5aa9e6;
  --blue-deep: #2f7fd0;
  --good: #3fd07d;
  --bad: #ff5a5f;
  --lime: #c8ff5a;
  --sans: "Inter Tight", system-ui, -apple-system, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(16px, 4vw, 32px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overscroll-behavior-y: none; }
body {
  background: radial-gradient(120% 60% at 50% -10%, rgba(90, 169, 230, 0.14), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--fg); font-family: var(--sans); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; min-height: 100svh;
  -webkit-tap-highlight-color: transparent;
}
body.playing { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.dim { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  padding: calc(12px + env(safe-area-inset-top)) var(--pad) 12px; max-width: 760px; margin: 0 auto;
  background: linear-gradient(var(--bg) 60%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 20px; letter-spacing: -0.03em; }
.brand img { border-radius: 10px; box-shadow: 0 0 0 1px rgba(255,255,255,0.14), 0 4px 16px rgba(90,169,230,0.35); }

#view { max-width: 760px; margin: 0 auto; padding: 8px var(--pad) calc(40px + env(safe-area-inset-bottom)); }

/* ---------- shared ---------- */
.card { background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line); border-radius: 24px; padding: 20px; margin-bottom: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,0.05);
  font-weight: 500; font-size: 16px; cursor: pointer; transition: transform 0.2s var(--ease), background 0.3s;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #04121f; font-weight: 600; box-shadow: 0 10px 30px rgba(90,169,230,0.3); }
.btn.wide { width: 100%; }
.tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,0.05); cursor: pointer; font-size: 15px; }

/* ---------- home ---------- */
.hello { padding: 18px 0 22px; }
.hello h1 { font-size: clamp(38px, 9vw, 60px); font-weight: 500; letter-spacing: -0.045em; line-height: 0.98; margin: 10px 0 16px; }
.hello h1 em { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; color: var(--blue); }
.streak { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.streak.on { color: #ffb547; border-color: rgba(255,181,71,0.35); background: rgba(255,181,71,0.08); }

.daily-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.daily-head h2 { font-size: 24px; font-weight: 500; letter-spacing: -0.03em; margin-top: 4px; }
.ring { --p: 0; flex: none; width: 58px; height: 58px; position: relative; display: grid; place-items: center; }
.ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--blue) calc(var(--p) * 360deg), rgba(255,255,255,0.08) 0);
  -webkit-mask: radial-gradient(circle, transparent 23px, #000 24px); mask: radial-gradient(circle, transparent 23px, #000 24px);
}
.ring span { font-family: var(--mono); font-size: 13px; position: relative; }
.daily-list { list-style: none; display: grid; gap: 8px; margin-bottom: 16px; }
.daily-list li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.03); }
.dl-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(90,169,230,0.12); color: var(--blue); }
.dl-icon svg { width: 18px; height: 18px; }
.daily-list li.done { opacity: 0.6; }
.daily-list li.done .dl-icon { background: rgba(63,208,125,0.15); color: var(--good); }
.daily-note { color: var(--muted); font-size: 14px; }

.profile-head { display: flex; justify-content: space-between; margin-bottom: 12px; }
.bar { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 12px; padding: 7px 0; font-size: 15px; }
.bar-track { height: 8px; border-radius: 99px; background: rgba(255,255,255,0.06); overflow: hidden; }
.bar-track i { display: block; height: 100%; width: calc(var(--v) * 1%); border-radius: inherit; background: linear-gradient(90deg, var(--blue-deep), var(--blue)); transition: width 1s var(--ease); }
.bar b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.profile .small { margin-top: 8px; }

.section-title { font-size: 22px; font-weight: 500; letter-spacing: -0.03em; margin: 26px 0 12px; }
.games { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 640px) { .games { grid-template-columns: repeat(3, 1fr); } }
.game {
  display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 20px; min-height: 140px;
  background: var(--card); border: 1px solid var(--line); transition: transform 0.25s var(--ease), border-color 0.3s;
}
a.game:hover { border-color: rgba(90,169,230,0.5); }
a.game:active { transform: scale(0.97); }
.game-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(90,169,230,0.12); color: var(--blue); }
.game-icon svg { width: 22px; height: 22px; }
.game-title { font-weight: 500; font-size: 16px; letter-spacing: -0.01em; line-height: 1.25; }
.game-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: auto; }
.game-meta .mono { font-size: 10px; color: var(--muted); }
.game.soon { opacity: 0.45; }
.foot { text-align: center; margin-top: 34px; color: var(--muted); font-size: 14px; }
.foot b { color: var(--fg); font-weight: 600; letter-spacing: -0.03em; }
.foot em { font-style: normal; color: var(--lime); }

/* ---------- intro ---------- */
.intro { padding-top: 6px; }
.back { display: inline-block; color: var(--muted); margin-bottom: 22px; }
.intro-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: rgba(90,169,230,0.12); color: var(--blue); margin-bottom: 16px; }
.intro-icon svg { width: 32px; height: 32px; }
.intro h1 { font-size: clamp(34px, 8vw, 52px); font-weight: 500; letter-spacing: -0.045em; line-height: 1; margin: 8px 0 12px; }
.lead { font-size: 18px; color: var(--fg); margin-bottom: 18px; }
.rules { list-style: none; counter-reset: r; display: grid; gap: 10px; margin-bottom: 22px; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 26px 1fr; gap: 10px; color: var(--muted); }
.rules li::before { content: counter(r); font-family: var(--mono); font-size: 12px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--fg); }
.best { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,0.04); margin-bottom: 18px; }
.best b { font-weight: 500; font-size: 20px; }

/* ---------- play shell ---------- */
.play { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; animation: in 0.35s var(--ease); }
@keyframes in { from { opacity: 0; transform: scale(0.98); } }
.play-top { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) var(--pad) 10px; position: relative; z-index: 2; }
.play-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-progress { grid-column: 1 / -1; height: 3px; border-radius: 9px; background: rgba(255,255,255,0.08); overflow: hidden; }
.play-progress i { display: block; height: 100%; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease); }
.stage { flex: 1; position: relative; display: flex; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.stage > * { flex: 1; }

/* reaction */
.rx { display: grid; place-items: center; text-align: center; cursor: pointer; transition: background 0.12s; margin: 0 var(--pad) calc(var(--pad) + env(safe-area-inset-bottom)); border-radius: 28px; }
.rx-msg b { display: block; font-size: clamp(40px, 11vw, 72px); font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.rx-msg span { display: block; margin-top: 12px; color: rgba(255,255,255,0.7); }
.rx[data-state="ready"] { background: #181b26; }
.rx[data-state="go"] { background: var(--blue); transition: none; }
.rx[data-state="go"] b { color: #04121f; }
.rx[data-state="early"] { background: #3a1416; }
.rx[data-state="result"] { background: #0f1520; }
.rx[data-state="result"] b { color: var(--blue); font-variant-numeric: tabular-nums; }

/* memory */
.mem { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 0 var(--pad) calc(var(--pad) + env(safe-area-inset-bottom)); }
.mem-msg { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; min-height: 33px; }
.mem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: min(100%, 420px); aspect-ratio: 1; }
.mem-grid.watching { pointer-events: none; }
.mem-tile { border: 0; border-radius: 22px; background: #181b26; cursor: pointer; transition: background 0.18s, transform 0.18s var(--ease), box-shadow 0.18s; }
.mem-tile.on { background: var(--blue); box-shadow: 0 0 40px rgba(90,169,230,0.55); transform: scale(0.96); }
.mem-tile.bad { background: var(--bad); }
.mem-grid.good .mem-tile { background: rgba(63,208,125,0.25); }

/* stroop */
.st { display: flex; flex-direction: column; padding: 0 var(--pad) calc(var(--pad) + env(safe-area-inset-bottom)); gap: 18px; transition: background 0.3s; border-radius: 0; }
.st-timer { height: 6px; border-radius: 9px; background: rgba(255,255,255,0.08); overflow: hidden; }
.st-timer i { display: block; height: 100%; background: var(--blue); transform-origin: left; }
.st-word { flex: 1; display: grid; place-items: center; font-size: clamp(44px, 13vw, 88px); font-weight: 600; letter-spacing: -0.03em; }
.st-word.pop { animation: pop 0.25s var(--ease); }
@keyframes pop { from { transform: scale(0.85); opacity: 0.4; } }
.st.miss { animation: miss 0.35s; }
@keyframes miss { 30% { background: rgba(255,90,95,0.18); } }
.st-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.st-opt { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 20px 10px; border-radius: 18px; border: 1px solid var(--line); background: #141722; font-size: 17px; font-weight: 500; cursor: pointer; }
.st-opt:active { transform: scale(0.97); background: #1b1f2d; }
.st-opt i { width: 16px; height: 16px; border-radius: 50%; }

/* result */
.result { display: flex; flex-direction: column; align-items: center; text-align: center; overflow-y: auto; padding: 20px var(--pad) calc(24px + env(safe-area-inset-bottom)); animation: in 0.4s var(--ease); }
.result-big { font-size: clamp(76px, 22vw, 128px); font-weight: 600; letter-spacing: -0.06em; line-height: 1; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.result-big small { font-size: 0.32em; font-weight: 500; color: var(--muted); margin-left: 6px; letter-spacing: -0.02em; }
.result-rating { font-family: var(--serif); font-style: italic; font-size: 32px; color: var(--blue); margin-bottom: 10px; }
.badge { padding: 8px 14px; border-radius: 999px; background: rgba(200,255,90,0.12); color: var(--lime); font-weight: 500; font-size: 14px; }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: min(100%, 440px); margin: 22px 0; }
.details div { padding: 12px; border-radius: 14px; background: rgba(255,255,255,0.04); text-align: left; }
.details dt { font-size: 12px; color: var(--muted); }
.details dd { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.result-actions { width: min(100%, 440px); display: grid; gap: 10px; margin-top: auto; }
.result-actions .row { display: flex; gap: 10px; }
.result-actions .row .btn { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* precision */
.pr { display: flex; flex-direction: column; padding: 0 var(--pad) calc(var(--pad) + env(safe-area-inset-bottom)); gap: 10px; }
.pr-hud { display: flex; justify-content: space-between; color: var(--muted); }
.pr-arena { flex: 1; position: relative; border-radius: 24px; background: #10131c; border: 1px solid var(--line); overflow: hidden; }
.pr-target {
  position: absolute; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle, #fff 0 18%, var(--blue) 19% 46%, #fff 47% 56%, var(--blue) 57%);
  box-shadow: 0 0 24px rgba(90,169,230,0.6);
  animation: shrink var(--life) linear forwards;
}
.pr-target.hit { animation: none; transform: scale(1.4); opacity: 0; transition: 0.25s; background: var(--good); }
.pr-target.gone { animation: none; opacity: 0; transition: 0.2s; }
@keyframes shrink { from { transform: scale(1); } to { transform: scale(0.15); opacity: 0.4; } }

/* impulse control */
.ic { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; cursor: pointer; }
.ic-dot { width: min(56vw, 240px); aspect-ratio: 1; border-radius: 50%; background: #151824; border: 1px solid var(--line); transition: transform 0.15s var(--ease); }
.ic-dot.go { background: var(--good); box-shadow: 0 0 60px rgba(63,208,125,0.45); border-color: transparent; }
.ic-dot.nogo { background: var(--bad); box-shadow: 0 0 60px rgba(255,90,95,0.45); border-color: transparent; }
.ic-dot.good { transform: scale(0.92); }
.ic-dot.bad { animation: shake 0.35s; }
.ic-msg { min-height: 24px; font-size: 18px; }
@keyframes shake { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }

/* visual search */
.vs { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 0 var(--pad) calc(var(--pad) + env(safe-area-inset-bottom)); }
.vs-msg { min-height: 24px; font-size: 18px; }
.vs-grid { display: grid; gap: 8px; width: min(100%, 440px); aspect-ratio: 1; }
.vs-dot { border: 0; border-radius: 50%; aspect-ratio: 1; cursor: pointer; transition: transform 0.2s var(--ease); }
.vs-dot.found { transform: scale(1.25); box-shadow: 0 0 0 4px #fff; }
.vs-dot.nope { animation: shake 0.3s; opacity: 0.4; }

/* n-back */
.nb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 0 var(--pad) calc(var(--pad) + env(safe-area-inset-bottom)); }
.nb-msg { min-height: 24px; font-size: 18px; }
.nb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(100%, 360px); aspect-ratio: 1; }
.nb-cell { border-radius: 18px; background: #181b26; transition: background 0.15s, box-shadow 0.15s; }
.nb-cell.on { background: var(--blue); box-shadow: 0 0 40px rgba(90,169,230,0.55); }
.nb-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(100%, 360px); }
.nb-btn { padding: 20px 10px; font-size: 17px; }
.nb-btn.good { background: var(--good); border-color: var(--good); }
.nb-btn.bad { background: var(--bad); border-color: var(--bad); }

/* mental rotation */
.mr { display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 0 var(--pad) calc(var(--pad) + env(safe-area-inset-bottom)); }
.mr-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mr-fig { aspect-ratio: 1; border-radius: 22px; background: #10131c; border: 1px solid var(--line); display: grid; place-items: center; padding: 16%; transition: border-color 0.2s; }
.mr-fig svg { width: 100%; height: 100%; fill: var(--blue); }
.mr-fig.good { border-color: var(--good); }
.mr-fig.bad { border-color: var(--bad); }
.mr-msg { text-align: center; font-size: 18px; min-height: 27px; }
.mr-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* rule switch */
.rs { display: flex; flex-direction: column; gap: 18px; padding: 0 var(--pad) calc(var(--pad) + env(safe-area-inset-bottom)); }
.rs-rule { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; border-radius: 18px; background: rgba(90,169,230,0.1); border: 1px solid rgba(90,169,230,0.35); }
.rs-rule b { font-size: 28px; font-weight: 600; letter-spacing: 0.06em; }
.rs-rule[data-rule="shape"] { background: rgba(200,255,90,0.08); border-color: rgba(200,255,90,0.35); }
.rs-rule[data-rule="shape"] b { color: var(--lime); }
.rs-rule[data-rule="color"] b { color: var(--blue); }
.rs-rule.flash { animation: flash 0.5s; }
@keyframes flash { 30% { transform: scale(1.06); filter: brightness(1.5); } }
.rs-shape { flex: 1; margin: auto; width: min(46vw, 200px); max-height: 200px; aspect-ratio: 1; }
.rs-shape.circle { border-radius: 50%; }
.rs-shape.square { border-radius: 14%; }
.rs-shape.blue { background: #4f9dff; }
.rs-shape.orange { background: #ff9a3c; }
.rs.miss { animation: miss 0.35s; }
.rs-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- account ---------- */
.account-link { display: inline-flex; align-items: center; gap: 8px; max-width: 52vw; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.05); font-size: 14px; font-weight: 500; transition: transform 0.2s var(--ease); }
.account-link:active { transform: scale(0.96); }
.account-link.on { padding: 4px 12px 4px 4px; }
.me-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue), var(--blue-deep)); color: #04121f; font-weight: 600; font-size: 24px; }
.avatar.sm { width: 28px; height: 28px; font-size: 13px; }

.save-cta { display: flex; align-items: center; gap: 16px; margin-top: 18px; transition: transform 0.25s var(--ease), border-color 0.3s; }
.save-cta:hover { border-color: rgba(90,169,230,0.5); }
.save-cta:active { transform: scale(0.98); }
.save-cta h3 { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; margin: 4px 0 4px; }
.save-cta .arrow { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #04121f; font-weight: 600; }
.foot { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.foot-link { font-size: 12px; color: var(--dim); }

/* ranking */
.rank { margin-top: 18px; }
.rank-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.rank-list { list-style: none; display: grid; gap: 4px; }
.rank-list li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; font-size: 15px; }
.rank-list li:nth-child(-n+3) .rk { color: var(--lime); }
.rank-list .rk { font-family: var(--mono); font-size: 13px; color: var(--muted); text-align: center; }
.rank-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .nm i { font-style: normal; color: var(--blue); }
.rank-list b { font-weight: 500; font-variant-numeric: tabular-nums; }
.rank-list li.me { background: rgba(90,169,230,0.12); }
.rank-list li.gap { display: block; text-align: center; padding: 0; color: var(--dim); line-height: 1; }
.rank-cta { margin-top: 10px; }
.rank-cta a, .rank-line a, .form-note a, .acct-note a { color: var(--blue); }
.rank-line { min-height: 22px; margin-top: 10px; font-size: 14px; color: var(--muted); opacity: 0; transition: opacity 0.4s; }
.rank-line.on { opacity: 1; }
.rank-line b { color: var(--fg); font-weight: 600; }

/* forms */
.auth h1, .acct h1, .admin h1 { font-size: clamp(34px, 8vw, 52px); font-weight: 500; letter-spacing: -0.045em; line-height: 1; margin: 0 0 12px; }
.auth h1 em { font-family: var(--serif); font-weight: 400; color: var(--blue); letter-spacing: -0.02em; }
.auth .lead { font-size: 16px; color: var(--muted); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); margin-bottom: 14px; }
.seg button { border: 0; background: none; padding: 11px; border-radius: 12px; cursor: pointer; color: var(--muted); font-weight: 500; transition: background 0.25s, color 0.25s; }
.seg button[aria-selected="true"] { background: var(--card-2); color: var(--fg); box-shadow: 0 2px 10px rgba(0,0,0,0.35); }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 14px; }
.form label i { font-style: normal; }
.form input {
  width: 100%; font: inherit; font-size: 16px; color: var(--fg); padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(0,0,0,0.25); outline: none; transition: border-color 0.2s;
}
.form input:focus { border-color: var(--blue); }
.form input::placeholder { color: var(--dim); }
.form-error { color: var(--bad); font-size: 14px; min-height: 0; }
.form-error:empty { display: none; }
.btn:disabled { opacity: 0.6; pointer-events: none; }
.btn.danger { color: var(--bad); border-color: rgba(255,90,95,0.3); background: rgba(255,90,95,0.06); }
[hidden] { display: none !important; }

/* account page */
.acct-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.acct-head h1 { font-size: clamp(28px, 7vw, 40px); margin: 0; overflow-wrap: anywhere; }
.acct-head p { overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stats div { display: grid; padding: 12px; border-radius: 14px; background: rgba(255,255,255,0.04); }
.stats b { font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--muted); }
.acct-actions { display: grid; gap: 10px; margin-top: 4px; }
.acct-note { margin-top: 14px; text-align: center; }

/* admin */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpis .card { display: grid; margin: 0 0 4px; padding: 16px; }
.kpis b { font-size: 30px; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpis span { font-size: 13px; color: var(--muted); }
.kpis i { font-style: normal; font-size: 12px; color: var(--good); }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin-top: 6px; }
.chart i { flex: 1; height: calc(var(--h) * 100%); min-height: 2px; border-radius: 3px 3px 0 0; background: linear-gradient(var(--blue), var(--blue-deep)); }
.chart-axis { display: flex; justify-content: space-between; margin: 6px 0 8px; font-size: 10px; }
.admin .bar { grid-template-columns: minmax(0, 150px) 1fr 40px; font-size: 14px; }
.admin .bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.users { list-style: none; display: grid; gap: 4px; margin-top: 10px; }
.users li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.users li > div { display: grid; min-width: 0; }
.users b { font-weight: 500; }
.users span { overflow-wrap: anywhere; font-size: 14px; }
.users .mono { font-size: 10px; margin-top: 4px; text-transform: none; letter-spacing: 0.02em; }
.users .tag { margin-left: 6px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 100; transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 16px; text-align: center;
  background: #1b2030; border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0,0,0,0.5); font-size: 15px;
  animation: toast 0.4s var(--ease); transition: opacity 0.4s, transform 0.4s var(--ease);
}
.toast.out { opacity: 0; transform: translate(-50%, 10px); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 16px); } }

/* ---------- ranking tabs, evolution, challenges, save nudge ---------- */
.seg-sm { margin-bottom: 10px; border-radius: 12px; padding: 3px; }
.seg-sm button { padding: 8px; border-radius: 9px; font-size: 14px; }
.rank-note { margin-top: 8px; }

.evo { margin-top: 18px; display: block; }
.evo svg { display: block; width: 100%; height: 90px; overflow: visible; }
.evo polyline { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.evo circle { fill: var(--lime); }
.evo-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.evo-legend span { display: grid; font-weight: 500; font-variant-numeric: tabular-nums; }
.evo-legend i { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 400; }
.evo.locked { position: relative; overflow: hidden; transition: transform 0.25s var(--ease), border-color 0.3s; }
.evo.locked:hover { border-color: rgba(90,169,230,0.5); }
.evo.locked:active { transform: scale(0.98); }
.evo.locked svg { filter: blur(5px); opacity: 0.6; }
.evo-lock { position: absolute; inset: 44px 16px 16px; display: grid; place-content: center; text-align: center; gap: 4px; }
.evo-lock b { font-weight: 600; font-size: 17px; }
.evo-lock span { font-size: 13px; color: var(--muted); }

.challenge { background: linear-gradient(180deg, rgba(200,255,90,0.1), rgba(200,255,90,0.03)); border-color: rgba(200,255,90,0.3); }
.challenge .mono { color: var(--lime); }
.challenge h3 { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; margin: 4px 0 2px; }
.challenge h3 b { color: var(--lime); font-weight: 600; }
.duel { display: grid; gap: 2px; padding: 10px 16px; border-radius: 16px; margin-bottom: 10px; font-weight: 600; background: rgba(255,255,255,0.05); }
.duel span { font-weight: 400; font-size: 13px; color: var(--muted); }
.duel.won { background: rgba(200,255,90,0.12); color: var(--lime); }
.duel.lost { background: rgba(255,90,95,0.1); color: #ff8a8d; }

.nudge {
  display: flex; align-items: center; gap: 14px; width: min(100%, 440px); margin-top: 14px; padding: 14px 16px; text-align: left;
  border-radius: 18px; border: 1px solid rgba(90,169,230,0.4); background: rgba(90,169,230,0.1); transition: transform 0.2s var(--ease);
}
.nudge:active { transform: scale(0.98); }
.nudge > span:first-child { display: grid; gap: 2px; }
.nudge b { font-weight: 600; }
.nudge i { font-style: normal; font-size: 13px; color: var(--muted); line-height: 1.4; }
.nudge .arrow { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #04121f; font-weight: 600; }
.details { margin: 18px 0; }
.details { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.details div { padding: 10px 12px; }
.details dd { font-size: 17px; }
.rank-line span { white-space: nowrap; }

/* ---------- brain age ---------- */
.brain-hero {
  display: grid; justify-items: start; gap: 8px; padding: 24px 22px; position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 100% 0%, rgba(90,169,230,0.35), transparent 55%), radial-gradient(80% 90% at 0% 100%, rgba(200,255,90,0.12), transparent 60%), var(--card-2);
  border-color: rgba(90,169,230,0.35); transition: transform 0.25s var(--ease);
}
.brain-hero:active { transform: scale(0.98); }
.brain-hero .mono { color: var(--lime); }
.brain-hero h2 { font-size: clamp(30px, 8vw, 42px); font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.brain-hero h2 em, .brain h1 em { font-family: var(--serif); font-weight: 400; color: var(--blue); letter-spacing: -0.02em; }
.brain-hero .small { color: var(--muted); margin-bottom: 6px; }
.brain-mini { display: flex; align-items: center; gap: 14px; transition: transform 0.25s var(--ease); }
.brain-mini:active { transform: scale(0.98); }
.brain-mini > div { flex: 1; }
.brain-age { flex: none; width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 26px; font-weight: 600; letter-spacing: -0.04em; background: linear-gradient(135deg, var(--blue), var(--blue-deep)); color: #04121f; }
.arrow { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(90,169,230,0.15); color: var(--blue); font-weight: 600; }
.save-cta .arrow, .nudge .arrow { background: var(--blue); color: #04121f; }

.brain h1 { font-size: clamp(38px, 10vw, 60px); font-weight: 500; letter-spacing: -0.045em; line-height: 0.98; margin: 10px 0 14px; }
.brain .lead { color: var(--muted); }
.brain-steps { list-style: none; display: grid; gap: 8px; margin: 6px 0 18px; }
.brain-steps li { display: grid; grid-template-columns: 22px 34px 1fr; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: rgba(255,255,255,0.04); }
.brain-steps .step-n { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: center; }
.brain-steps div { display: grid; }
.brain-steps div span { font-size: 13px; color: var(--muted); }
.brain-steps b { font-weight: 500; }
.brain-note { text-align: center; margin-top: 12px; }
.brain-step { display: flex; flex-direction: column; justify-content: center; padding: 0 var(--pad) calc(var(--pad) + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; width: 100%; animation: in 0.35s var(--ease); }
.brain-step h2 { font-size: 34px; font-weight: 500; letter-spacing: -0.04em; margin: 4px 0 16px; }
.brain-bars { width: min(100%, 440px); margin: 18px 0 8px; text-align: left; }

/* ---------- daily challenge ---------- */
.reto-card { display: block; border-color: rgba(200,255,90,0.3); background: linear-gradient(180deg, rgba(200,255,90,0.07), transparent 70%), var(--card); transition: transform 0.25s var(--ease); }
.reto-card:active { transform: scale(0.98); }
.reto-top { display: flex; justify-content: space-between; margin-bottom: 12px; }
.reto-top .mono:first-child, .reto-label { color: var(--lime); }
.reto-main { display: grid; grid-template-columns: 40px 1fr 36px; align-items: center; gap: 12px; }
.reto-main h3 { font-size: 19px; font-weight: 500; letter-spacing: -0.02em; }
.reto-main b { color: var(--fg); font-weight: 600; }
.reto-rule { font-size: 14px; color: var(--muted); padding: 12px 14px; border-radius: 14px; border: 1px dashed rgba(200,255,90,0.35); margin-bottom: 16px; }
.reto-done { text-align: center; display: grid; gap: 8px; }
.reto-value { font-size: 52px; font-weight: 600; letter-spacing: -0.05em; line-height: 1.1; }
.reto-done a { color: var(--blue); }
.reto-done b { color: var(--fg); }
.reto-next { margin-top: 4px; }

/* ---------- achievements ---------- */
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.achievements { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 640px) { .achievements { grid-template-columns: repeat(4, 1fr); } }
.ach { display: grid; grid-template-columns: 38px 1fr; column-gap: 10px; align-items: center; padding: 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); opacity: 0.45; }
.ach .ach-icon { grid-row: span 2; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: rgba(255,255,255,0.05); filter: grayscale(1); }
.ach b { font-size: 14px; font-weight: 500; line-height: 1.2; }
.ach span:last-child { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.ach.done { opacity: 1; border-color: rgba(200,255,90,0.25); }
.ach.done .ach-icon { filter: none; background: rgba(200,255,90,0.12); }
.ach-won { display: grid; gap: 6px; justify-items: center; margin-top: 10px; }
.ach-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border-radius: 999px; background: rgba(200,255,90,0.1); border: 1px solid rgba(200,255,90,0.3); font-size: 14px; animation: pop 0.5s var(--ease); }
.ach-pill span { font-size: 18px; }
.ach-pill b { font-weight: 600; color: var(--lime); }

/* ---------- install ---------- */
.install { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; position: relative; padding-right: 48px; }
.install img { border-radius: 14px; }
.install h3 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; margin-bottom: 2px; }
.install .btn { margin-top: 10px; padding: 10px 18px; }
.install p + p { margin-top: 8px; }
.install b { color: var(--fg); font-weight: 500; }
.install-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; font-size: 12px; }

/* admin: visits (light part = new people) */
.chart i.v { position: relative; display: flex; align-items: flex-end; overflow: hidden; }
.chart i.v u { display: block; width: 100%; height: calc(var(--h) * 100%); background: var(--lime); opacity: 0.8; }
