:root {
  --bg: #EEF3FA;
  --surface: #FFFFFF;
  --ink: #1E2A4A;
  --ink-soft: #55607D;
  --line: #DCE4EF;
  --primary: #FF6B4A;
  --primary-dark: #E2553A;
  --ok: #1FAF63;
  --bad: #E5484D;
  --f-pinky: #A77BF3;
  --f-ring: #4C9DF0;
  --f-middle: #2FC692;
  --f-index: #FFAE3B;
  --f-thumb: #FF7FA8;
  --font-display: 'Chillax', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
  --radius: 18px;
  --shadow: 0 2px 0 rgba(30,42,74,.06), 0 10px 30px -12px rgba(30,42,74,.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
  min-height: 100vh;
}
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; }

.touch-banner {
  background: var(--ink); color: #fff; text-align: center; padding: 10px 16px; font-weight: 700;
}

/* Top bar */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 28px; height: 68px;
  background: var(--surface); border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; color: var(--ink); }
.logo { width: 38px; height: 38px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: -.01em; }
.lesson-meta { flex: 1; display: flex; align-items: center; gap: 18px; min-width: 0; }
.lesson-title { font-weight: 800; font-size: 17px; white-space: nowrap; }
.progress { flex: 1; max-width: 460px; height: 14px; background: #E2E9F3; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--f-middle), #22B07F); border-radius: 99px; transition: width .35s ease; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.stat { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.stat-label { font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.stat-val { font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.stat-val small { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--ink-soft); }

.screen { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 28px 20px; position: relative; }

/* Map */
.welcome { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: stretch; margin-bottom: 28px; }
.eyebrow { margin: 0 0 4px; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.welcome h1 { font-family: var(--font-display); font-size: 44px; margin: 0 0 8px; line-height: 1.05; letter-spacing: -.02em; }
.lede { margin: 0 0 16px; font-size: 18px; color: var(--ink-soft); max-width: 46ch; }
.preview-toggle { white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 700; color: var(--ink-soft); background: #E3EAF4; padding: 8px 12px; border-radius: 10px; }
.posture-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px; }
.posture-card h2 { font-size: 18px; margin: 0 0 10px; font-weight: 800; }
.posture-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.posture-card li { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }

.path { display: grid; gap: 22px; }
.unit { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px; }
.unit-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.unit-head h3 { margin: 0; font-size: 18px; font-weight: 800; }
.unit-head span { color: var(--ink-soft); font-weight: 700; font-size: 14px; }
.nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.node {
  text-align: left; border: 2px solid var(--line); background: #F8FAFD; border-radius: 14px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px; color: var(--ink); min-height: 92px; transition: transform .12s ease, border-color .12s ease;
}
.node:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--primary); }
.node:disabled { cursor: not-allowed; opacity: .5; }
.node .n-num { font-size: 12px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.node .n-keys { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: .04em; }
.node .n-stars { display: flex; gap: 2px; margin-top: auto; }
.node.current { border-color: var(--primary); background: #FFF1EC; box-shadow: 0 0 0 4px rgba(255,107,74,.15); }
.node.game { background: #F3EEFF; border-color: #DCCEFB; }
.node.game .n-keys { font-size: 18px; }
.star { width: 18px; height: 18px; }
.star.on path { fill: #FFB547; stroke: #E59A26; }
.star.off path { fill: #EFE6D8; stroke: #E0D4C2; }

/* Lesson */
.lesson-screen { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; }
.type-panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 28px 14px; }
.step-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.step-label { font-weight: 800; font-size: 15px; color: var(--primary); text-transform: uppercase; letter-spacing: .08em; }
.step-count { font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.line {
  font-family: var(--font-body); font-weight: 800; font-size: 46px; letter-spacing: .06em;
  min-height: 76px; display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; white-space: pre; overflow: hidden;
}
.ch { position: relative; padding: 0 1px; color: #B9BFD0; transition: color .1s; }
.ch.space { min-width: .55em; }
.ch.space::after { content: none; }
.ch.done { color: var(--ink); }
.ch.done.space::after { background: transparent; }
.ch.missed { color: var(--bad); }
.ch.missed.space { background: rgba(229,72,77,.18); border-radius: 8px; }
.ch.cur { color: var(--ink); }
.ch.cur::before {
  content: ''; position: absolute; left: -2px; right: -2px; top: 6px; bottom: 2px; border-radius: 10px;
  background: rgba(255,174,59,.25); border-bottom: 5px solid var(--f-index); z-index: -1;
  animation: pulse 1.1s ease-in-out infinite;
}
.ch.cur.err::before { background: rgba(229,72,77,.18); border-bottom-color: var(--bad); animation: shake .25s; }
.ch { z-index: 0; }
@keyframes pulse { 50% { transform: translateY(-2px); } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.hint-row { display: flex; justify-content: center; gap: 18px; min-height: 26px; align-items: center; }
.finger-hint { font-weight: 700; color: var(--ink-soft); font-size: 17px; }
.finger-hint b { color: var(--ink); }
.finger-hint .fdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.caps-warn { background: #FFE9E6; color: #B4302E; font-weight: 800; padding: 4px 12px; border-radius: 8px; font-size: 15px; }

.kb-wrap { flex: 1; display: flex; justify-content: center; align-items: flex-start; min-height: 0; }
.kb { width: 100%; max-width: 1000px; height: auto; max-height: calc(100vh - 280px); display: block; overflow: hidden; }
.tip-glow { stroke-width: 3; opacity: .85; animation: tip 1s ease-in-out infinite; }
@keyframes tip { 50% { opacity: .45; } }
.reach { opacity: .9; }
.key rect.cap { stroke: rgba(30,42,74,.14); stroke-width: 2; transition: fill .15s; }
.key text { font-family: var(--font-body); font-weight: 800; fill: var(--ink); pointer-events: none; }
.key.muted text { fill: #A3A9BB; }
.key.hit-ok rect.cap { fill: #BDF0D2 !important; stroke: var(--ok); stroke-width: 3; }
.key.hit-bad rect.cap { fill: #FFCACA !important; stroke: var(--bad); stroke-width: 3; }
.target-ring { fill: none; stroke-width: 5; animation: ring 1s ease-in-out infinite; }
@keyframes ring { 50% { stroke-opacity: .35; } }
.hand-outline { stroke: var(--ink); }
.hand-fill { stroke: #FFFFFF; }
.hand-palm-o { fill: none; stroke: var(--ink); stroke-width: 5; }
.hand-palm-f { fill: #FFFFFF; }

/* Overlays */
.overlay { position: absolute; inset: 0; background: rgba(238,243,250,.84); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 5; }
.overlay-card { background: var(--surface); border-radius: 24px; box-shadow: 0 30px 60px -20px rgba(30,42,74,.35); padding: 30px 40px; text-align: center; max-width: 560px; }
.overlay-card h2 { font-family: var(--font-display); font-size: 32px; margin: 12px 0 8px; letter-spacing: -.01em; }
.overlay-card p { font-size: 17px; color: var(--ink-soft); margin: 0 0 12px; line-height: 1.5; }
.overlay-cta { font-weight: 800; color: var(--ink) !important; }
kbd { display: inline-block; min-width: 30px; padding: 2px 8px; border-radius: 8px; background: #F3F6FB; border: 2px solid #CFD9E8; border-bottom-width: 4px; font-family: var(--font-body); font-weight: 800; color: var(--ink); }
.home-diagram { display: flex; justify-content: center; gap: 6px; }
.hk { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 18px; background: color-mix(in srgb, var(--c) 30%, white); border: 2px solid color-mix(in srgb, var(--c) 70%, white); position: relative; }
.hk.bump::after { content: ''; position: absolute; bottom: 6px; width: 12px; height: 3px; border-radius: 2px; background: var(--ink); opacity: .5; }
.gap { width: 18px; }
.stars { display: flex; justify-content: center; gap: 8px; }
.stars .star { width: 56px; height: 56px; }
.stars .star.on { animation: pop .5s cubic-bezier(.2,1.6,.4,1) both; }
.stars .star:nth-child(2) { animation-delay: .15s; transform: translateY(-10px); }
.stars .star:nth-child(3) { animation-delay: .3s; }
@keyframes pop { from { transform: scale(0); } }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 12px; }
.result-stats div { background: #F1F5FB; border-radius: 14px; padding: 12px 8px; display: flex; flex-direction: column; }
.rs-val { font-weight: 800; font-size: 28px; font-variant-numeric: tabular-nums; }
.rs-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.tricky { font-weight: 700; color: var(--ink-soft); margin-bottom: 16px; min-height: 22px; }
.tricky kbd { margin: 0 2px; }
.result-actions { display: flex; gap: 12px; justify-content: center; }
.btn { background: var(--primary); color: #fff; border: 0; border-bottom: 4px solid var(--primary-dark); border-radius: 14px; padding: 12px 26px; font-weight: 800; font-size: 17px; }
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: #E6ECF5; color: var(--ink); border-bottom-color: #CBD6E6; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.kbd-tip { font-size: 14px !important; margin: 12px 0 0 !important; }

@media (max-width: 860px) {
  .welcome { grid-template-columns: 1fr; }
  .stat { display: none; }
  .line { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}

/* ---------- Trail map dashboard ---------- */
.map-screen { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.trail-card { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); padding: 20px 22px 22px; }
.trail-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.trail-head h1 { font-family: var(--font-display); font-size: 30px; line-height: 1.1; margin: 0; letter-spacing: -.015em; }
.trail { position: relative; width: 100%; aspect-ratio: 880 / 760; border-radius: 18px; overflow: hidden; }
.trail-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sign {
  position: absolute; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 99px; padding: 5px 12px 5px 6px; font-weight: 800; font-size: 13px;
  box-shadow: 0 2px 0 rgba(30,42,74,.08); white-space: nowrap;
}
.sign .badge { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; }
.sign .cnt { color: var(--ink-soft); font-weight: 700; }
.stop {
  position: absolute; transform: translate(-50%, -50%); width: 8.4%; aspect-ratio: 1 / .92; min-width: 58px;
  border: 0; border-radius: 18px; padding: 0; color: var(--ink);
  background: var(--cap); border-bottom: 7px solid var(--cap-d);
  box-shadow: 0 6px 14px -6px rgba(30,42,74,.35);
  display: grid; place-items: center; transition: transform .15s ease;
}
.stop:hover:not(:disabled) { transform: translate(-50%, -54%); }
.stop:active:not(:disabled) { transform: translate(-50%, -48%); border-bottom-width: 4px; }
.stop .s-keys { font-family: var(--font-display); font-weight: 700; font-size: clamp(15px, 1.7vw, 22px); letter-spacing: .06em; line-height: 1; }
.stop .s-sub { position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%); display: flex; gap: 1px; white-space: nowrap; }
.stop .s-sub .star { width: 16px; height: 16px; }
.stop.locked { background: #E8EDF4; border-bottom-color: #CCD5E2; color: #98A2B6; cursor: not-allowed; box-shadow: none; }
.stop.locked .s-keys { font-size: clamp(12px, 1.2vw, 15px); letter-spacing: 0; }
.stop .lock { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(30,42,74,.2); }
.stop .check { position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; border: 3px solid #fff; }
.stop.current { animation: bob 1.6s ease-in-out infinite; }
.stop.current::after { content: ''; position: absolute; inset: -9px -9px -14px; border-radius: 24px; border: 4px solid var(--primary); opacity: .55; animation: halo 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, -56%); } }
@keyframes halo { 50% { opacity: .15; } }
.stop.game { border-radius: 50%; aspect-ratio: 1; }
.stop.game .s-keys { font-size: clamp(11px, 1.1vw, 14px); letter-spacing: 0; font-family: var(--font-body); font-weight: 800; }
.stop.game svg { width: 42%; height: 42%; }
.cub-marker { position: absolute; width: 4.4%; transform: translate(-50%, 0); pointer-events: none; filter: drop-shadow(0 4px 4px rgba(30,42,74,.18)); }
.bubble { position: absolute; transform: translate(-50%, -100%); background: var(--ink); color: #fff; font-weight: 800; font-size: 13px; padding: 5px 10px; border-radius: 10px; white-space: nowrap; pointer-events: none; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: var(--ink); }

.side { display: grid; gap: 16px; position: sticky; top: 16px; }
.side-card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 16px 18px; }
.side-card h2 { font-family: var(--font-display); font-size: 24px; margin: 0 0 2px; line-height: 1.1; }
.side-card h3 { font-size: 16px; font-weight: 800; margin: 0 0 4px; }
.muted { color: var(--ink-soft); margin: 0; font-size: 14px; font-weight: 600; }
.hello { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; background: linear-gradient(135deg, #FFE9E2, #FFF6E6); }
.hello-cub { width: 64px; height: auto; }
.goal { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; position: relative; }
.goal-ring { width: 96px; height: 96px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #E6ECF4; stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--f-middle); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 314.16; stroke-dashoffset: 314.16; transition: stroke-dashoffset .6s ease; }
.goal-center { position: absolute; left: 18px; top: 50%; width: 96px; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; line-height: 1; pointer-events: none; }
.goal-center b { font-size: 26px; font-weight: 800; }
.goal-center span { font-size: 11px; font-weight: 700; color: var(--ink-soft); margin-top: 3px; }
.goal-text .muted { font-size: 13px; }
.week { display: flex; gap: 5px; margin-top: 8px; }
.week span { width: 24px; height: 24px; border-radius: 8px; background: #EEF2F8; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.week span.today { outline: 2px solid var(--primary); outline-offset: 1px; }
.week span.done { background: var(--f-middle); color: #fff; }
.kc-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.mini-kb { display: grid; gap: 4px; }
.mini-row { display: flex; gap: 4px; }
.mini-row:nth-child(2) { padding-left: 10px; }
.mini-row:nth-child(3) { padding-left: 22px; }
.mk { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: #EEF2F8; color: #AAB3C5; }
.mk.on { background: var(--c); color: var(--ink); }
.tips ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 7px; }
.tips li { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }

@media (max-width: 1100px) {
  .map-screen { grid-template-columns: 1fr; }
  .side { position: static; grid-template-columns: repeat(2, 1fr); }
}

/* ---------- v3: older, more modern look ---------- */
:root {
  --bg: #EEF2F8;
  --ink: #131A2E;
  --ink-soft: #56607A;
  --line: #DCE3EE;
  --primary: #5146E8;
  --primary-dark: #3B31C9;
  --f-pinky: #9B6BFF;
  --f-ring: #3B8EF0;
  --f-middle: #1FBF8A;
  --f-index: #F5A524;
  --f-thumb: #F2668B;
  --font-display: 'Cabinet Grotesk', 'Satoshi', system-ui, sans-serif;
  --font-body: 'Satoshi', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(19,26,46,.05), 0 8px 24px -14px rgba(19,26,46,.22);
}
.brand-name { font-weight: 800; font-size: 23px; letter-spacing: -.02em; }
.eyebrow { color: var(--primary); letter-spacing: .1em; font-size: 12px; }
.trail-head h1 { font-weight: 800; font-size: 32px; letter-spacing: -.025em; }
.trail-card { border-radius: 18px; }
.trail { border-radius: 12px; }
.side-card { border-radius: 14px; }
.side-card h2 { font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.hello { background: linear-gradient(135deg, #E9E7FF, #F4F6FB); padding: 16px; gap: 14px; }
.avatar { width: 56px; height: 56px; border-radius: 14px; background: linear-gradient(135deg, #5146E8, #9B6BFF); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 26px; flex: none; }
.preview-toggle { background: #E6EBF3; border-radius: 8px; }
.sign { border-radius: 8px; padding: 5px 10px 5px 5px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.sign .badge { border-radius: 6px; }

.stop { border-radius: 12px; background: #1B2340; border-bottom: 6px solid #0A0F1F; color: #fff; box-shadow: 0 8px 16px -8px rgba(19,26,46,.55); }
.stop::before { content: ''; position: absolute; top: 7px; left: 50%; width: 36%; height: 3px; margin-left: -18%; border-radius: 2px; background: var(--cap); box-shadow: 0 0 8px var(--cap); }
.stop .s-keys { font-family: var(--font-mono); font-weight: 700; letter-spacing: .04em; font-size: clamp(14px, 1.5vw, 20px); }
.stop.locked { background: #E1E6EE; border-bottom-color: #C8D0DC; color: #939CB0; }
.stop.locked::before { background: #C8D0DC; box-shadow: none; }
.stop.locked .s-keys { font-family: var(--font-body); font-weight: 700; }
.stop.current { animation: none; }
.stop.current::after { border-radius: 16px; border-color: var(--primary); inset: -7px -7px -12px; }
.stop.game { background: linear-gradient(135deg, #5146E8, #9B6BFF); border-bottom-color: #3B31C9; }
.stop.game::before { display: none; }
.next-pill { position: absolute; transform: translate(-50%, 0); background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 4px 9px; border-radius: 6px; pointer-events: none; white-space: nowrap; }
.game-label { position: absolute; transform: translate(-50%, 0); background: #fff; color: var(--ink); font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 6px; box-shadow: 0 1px 4px rgba(19,26,46,.15); white-space: nowrap; pointer-events: none; }
.mk { border-radius: 5px; font-family: var(--font-mono); font-weight: 700; }
.week span { border-radius: 6px; }

.type-panel { border-radius: 16px; }
.step-label { color: var(--primary); font-size: 13px; letter-spacing: .1em; }
.line { font-family: var(--font-mono); font-weight: 700; font-size: 44px; letter-spacing: .02em; }
.ch { color: #B3BACB; }
.ch.cur::before { border-radius: 6px; background: rgba(81,70,232,.12); border-bottom: 4px solid var(--primary); animation: none; }
.ch.cur.err::before { background: rgba(229,72,77,.16); border-bottom-color: var(--bad); }
.key text { font-family: var(--font-body); font-weight: 700; }
.overlay-card { border-radius: 18px; }
.overlay-card h2 { font-weight: 800; letter-spacing: -.02em; font-size: 30px; }
.hk { border-radius: 8px; font-family: var(--font-mono); }
kbd { font-family: var(--font-mono); border-radius: 6px; font-weight: 700; font-size: .9em; }
.btn { border-radius: 10px; border-bottom-width: 3px; font-weight: 700; font-size: 16px; }
.icon-btn { border-radius: 10px; }
.progress-fill { background: linear-gradient(90deg, var(--primary), #8B6BFF); }
.ring-fg { stroke: var(--primary); }
.week span.done { background: var(--primary); }
.week span.today { outline-color: var(--primary); }
.stat-val { font-family: var(--font-mono); font-size: 19px; }
.rs-val { font-family: var(--font-mono); font-weight: 700; }

/* ---------- Practice Lab ---------- */
.main-col { display: grid; gap: 22px; min-width: 0; }
.practice-card { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; position: relative; }
.pc-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.pc-head h2 { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -.02em; margin: 2px 0 4px; }
.goal-badge { flex: none; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 6px 10px; border-radius: 8px; background: #E9E7FF; color: var(--primary); }
.goal-badge.met { background: #D8F5E6; color: #128A53; }
.pc-lock { display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: 14px; color: var(--ink-soft); background: #EEF2F8; border-radius: 10px; padding: 10px 12px; margin-bottom: 16px; }
.practice-card.locked .pc-body, .practice-card.locked .modes { opacity: .45; pointer-events: none; filter: grayscale(.4); }
.pc-body { display: grid; grid-template-columns: 1fr 1.1fr; gap: 22px; margin-bottom: 18px; }
.meter { margin-bottom: 14px; }
.m-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; gap: 10px; }
.m-top b { font-family: var(--font-mono); color: var(--ink); font-size: 14px; }
.m-bar { position: relative; height: 12px; background: #E6EBF3; border-radius: 99px; overflow: visible; }
.m-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--primary), #8B6BFF); transition: width .5s ease; }
.m-fill.acc { background: linear-gradient(90deg, #1FBF8A, #15A374); }
.m-fill.hit { background: linear-gradient(90deg, #1FBF8A, #15A374); }
.m-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: .5; border-radius: 1px; }
.runs-count { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.pc-chart svg { width: 100%; height: 130px; display: block; background: #F5F7FB; border-radius: 10px; }
.legend { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; font-size: 12px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-hit { background: #1FBF8A; } .lg-miss { background: var(--primary); margin-left: 6px; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mode { text-align: left; background: #131A2E; color: #fff; border: 0; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 4px; min-height: 124px; transition: transform .15s ease, box-shadow .15s ease; position: relative; overflow: hidden; }
.mode::after { content: ''; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(139,107,255,.55), transparent 70%); }
.mode:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -12px rgba(19,26,46,.6); }
.mode-k { font-family: var(--font-mono); font-size: 12px; color: #8B93B0; }
.mode-t { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.mode-d { font-size: 13px; color: #B9C0D6; font-weight: 500; line-height: 1.4; }
.mode-d kbd { background: #28324F; border-color: #3A4566; color: #fff; font-size: 11px; padding: 0 5px; min-width: 0; }

.line-next { font-family: var(--font-mono); font-weight: 700; font-size: 30px; color: #CDD3DF; text-align: center; min-height: 0; white-space: pre; overflow: hidden; margin-top: -4px; }
.line-next:empty { display: none; }
.timer-chip { font-family: var(--font-mono); font-weight: 700; color: var(--ink); background: #E9E7FF; padding: 3px 9px; border-radius: 6px; }
.timer-chip.low { background: #FFE3E3; color: #B4302E; }

/* ---------- Raindrop Rescue ---------- */
.game-screen { display: flex; flex-direction: column; gap: 14px; }
.game-bar { display: flex; justify-content: space-between; align-items: flex-end; }
.game-bar h2 { font-family: var(--font-display); font-weight: 800; font-size: 28px; margin: 0; letter-spacing: -.02em; }
.g-stats { display: flex; gap: 28px; }
.lives { display: flex; gap: 4px; }
.lives i { width: 14px; height: 18px; display: inline-block; background: #3B8EF0; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; clip-path: polygon(50% 0, 100% 60%, 85% 95%, 15% 95%, 0 60%); }
.lives i.lost { background: #D5DBE6; }
.sky { position: relative; flex: 1; min-height: 480px; border-radius: 18px; overflow: hidden; background: radial-gradient(120% 80% at 50% 0%, #2B3566 0%, #131A2E 60%, #0C1122 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.sky::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.35) 1px, transparent 1.2px); background-size: 46px 46px; opacity: .25; }
.ground { position: absolute; left: 0; right: 0; bottom: 0; height: 36px; background: linear-gradient(180deg, rgba(59,142,240,.0), rgba(59,142,240,.35)); border-top: 2px solid rgba(139,107,255,.6); }
.drop { position: absolute; width: 58px; height: 70px; margin-left: -29px; display: grid; place-items: center; padding-top: 14px; font-family: var(--font-mono); font-weight: 700; font-size: 26px; color: #fff;
  background: linear-gradient(160deg, #6FB4FF, #3B6FF0); clip-path: path('M29 0 C29 0 58 34 58 47 A29 23 0 0 1 0 47 C0 34 29 0 29 0 Z'); filter: drop-shadow(0 0 10px rgba(111,180,255,.6)); }
.drop.pop { animation: pop-out .22s ease-out forwards; }
.drop.splash { animation: splash .35s ease-out forwards; background: linear-gradient(160deg, #FF8FA3, #E5484D); }
@keyframes pop-out { to { transform: scale(1.6); opacity: 0; } }
@keyframes splash { to { transform: scaleX(1.8) scaleY(.2); opacity: 0; } }
.score-pop { position: absolute; font-family: var(--font-mono); font-weight: 700; color: #7CF0C0; font-size: 18px; pointer-events: none; animation: rise .6s ease-out forwards; }
@keyframes rise { to { transform: translateY(-40px); opacity: 0; } }
.sky.shake { animation: shake .2s; }
@media (max-width: 1100px) { .pc-body { grid-template-columns: 1fr; } .modes { grid-template-columns: 1fr; } }
.res-goal { margin-top: 10px; font-size: 15px; color: var(--ink); background: #F1F5FB; border-radius: 10px; padding: 8px 12px; }
.stop.game:not(.locked) { cursor: pointer; animation: none; box-shadow: 0 0 0 4px rgba(139,107,255,.25), 0 8px 16px -8px rgba(19,26,46,.55); }
.niv-note { margin: 14px 0 0; font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
/* Scenic, subtle game background */
.sky { background: #0C1122; }
.sky::before { display: none; }
.scene { position: absolute; inset: 0; background: url('assets/rain-scene.webp') center 60% / cover no-repeat; opacity: .75; filter: saturate(.8) blur(1.5px); transform: scale(1.03); }
.scene::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,17,34,.55) 0%, rgba(12,17,34,.25) 45%, rgba(12,17,34,.6) 100%); }
.rain { position: absolute; inset: -40px 0 0; pointer-events: none; opacity: .18;
  background-image: repeating-linear-gradient(100deg, transparent 0 22px, rgba(200,215,255,.9) 22px 23px, transparent 23px 58px);
  background-size: 100% 140px; animation: rainfall .9s linear infinite; opacity: .12; mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent); }
.rain.far { opacity: .1; background-size: 60% 90px; animation-duration: 1.4s; background-image: repeating-linear-gradient(100deg, transparent 0 14px, rgba(200,215,255,.9) 14px 15px, transparent 15px 41px); }
@keyframes rainfall { from { background-position: 0 0; } to { background-position: -24px 140px; } }
.rain.far { animation-name: rainfall-far; }
@keyframes rainfall-far { from { background-position: 0 0; } to { background-position: -16px 90px; } }
.ground { background: linear-gradient(180deg, rgba(59,142,240,0), rgba(59,142,240,.22)); border-top: 1px solid rgba(160,180,255,.35); }
.drop { z-index: 2; filter: drop-shadow(0 0 12px rgba(111,180,255,.75)) drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.score-pop { z-index: 3; }
@media (prefers-reduced-motion: reduce) { .rain { animation: none; } }

.lesson-niv { text-align: center; margin: -6px 0 0; font-size: 11px; }

/* ---------- Multi-game scenes ---------- */
.stop.game.g-summit { background: linear-gradient(135deg, #3B8EF0, #5146E8); border-bottom-color: #2E5FC0; }
.stop.game.g-reef { background: linear-gradient(135deg, #1FBF8A, #138A9E); border-bottom-color: #0F6F74; }
.stop.game.locked { background: #DDE3EC; border-bottom-color: #C5CDDA; }
.stop.game.locked svg { opacity: .55; }
.summit-ui, .reef-ui { display: none; position: absolute; inset: 0; pointer-events: none; }
.sky[data-kind="summit"] .summit-ui, .sky[data-kind="reef"] .reef-ui { display: block; }
.sky:not([data-kind="rain"]) .rain, .sky:not([data-kind="rain"]) .ground { display: none; }
.sky[data-kind="summit"] .scene { background-image: url('assets/summit-scene.webp'); background-position: center calc(70% - var(--climb, 0) * 30%); transition: background-position .6s ease; opacity: .7; }
.sky[data-kind="reef"] .scene { background-image: url('assets/reef-scene.webp'); background-position: center 55%; opacity: .72; }
.sky[data-kind="reef"] .scene::after { background: linear-gradient(180deg, rgba(8,20,36,.35), rgba(8,20,36,.15) 40%, rgba(8,20,36,.55)); }

/* Summit Sprint */
.fog { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(180deg, rgba(200,210,235,0), rgba(200,210,235,.32) 40%, rgba(220,228,245,.5)); backdrop-filter: blur(2px); }
.alt-track { position: absolute; left: 36px; top: 28px; bottom: 28px; width: 8px; border-radius: 6px; background: rgba(255,255,255,.14); }
.alt-track .flag { position: absolute; top: -14px; left: 2px; width: 3px; height: 22px; background: #fff; border-radius: 2px; }
.alt-track .flag::after { content: ''; position: absolute; left: 3px; top: 0; border-left: 16px solid #F5A524; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.climber { position: absolute; left: 50%; width: 22px; height: 22px; margin: 0 0 -11px -11px; border-radius: 50%; background: #F5A524; box-shadow: 0 0 0 4px rgba(245,165,36,.3), 0 0 16px rgba(245,165,36,.7); transition: bottom .35s ease; }
.fog-line { position: absolute; left: -6px; right: -6px; height: 2px; margin-bottom: -1px; background: rgba(230,236,250,.85); }
.word-card { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; padding: 22px 40px 18px; border-radius: 18px; background: rgba(12,17,34,.62); box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 20px 50px -20px rgba(0,0,0,.6); backdrop-filter: blur(6px); min-width: 320px; }
.sw-cur { font-family: var(--font-mono); font-weight: 700; font-size: 56px; letter-spacing: .06em; color: rgba(255,255,255,.55); line-height: 1.1; }
.sw-cur .ok { color: #7CF0C0; }
.sw-cur .now { color: #fff; border-bottom: 4px solid #F5A524; }
.sw-next { margin-top: 10px; font-family: var(--font-mono); font-size: 20px; color: rgba(255,255,255,.4); white-space: pre; }
.word-card.step { animation: step-up .3s ease-out; }
.word-card.miss { animation: shake .2s; box-shadow: 0 0 0 2px rgba(229,72,77,.8), 0 20px 50px -20px rgba(0,0,0,.6); }
@keyframes step-up { 0% { transform: translate(-50%, -50%) scale(1); } 40% { transform: translate(-50%, -54%) scale(1.04); } 100% { transform: translate(-50%, -50%) scale(1); } }

/* Reef Rescue */
.net { position: absolute; right: 0; top: 0; bottom: 0; width: 70px; background:
  repeating-linear-gradient(45deg, rgba(255,255,255,.14) 0 1px, transparent 1px 14px),
  repeating-linear-gradient(-45deg, rgba(255,255,255,.14) 0 1px, transparent 1px 14px),
  linear-gradient(90deg, rgba(229,72,77,0), rgba(229,72,77,.14)); border-left: 1px dashed rgba(255,255,255,.3); }
.bubbles { position: absolute; inset: 0; opacity: .25; background-image: radial-gradient(circle, rgba(255,255,255,.8) 1.5px, transparent 2px), radial-gradient(circle, rgba(255,255,255,.6) 1px, transparent 1.5px); background-size: 120px 160px, 70px 110px; animation: bubbles 7s linear infinite; }
@keyframes bubbles { from { background-position: 0 0, 30px 0; } to { background-position: 0 -160px, 30px -220px; } }
.fish { position: absolute; left: 0; top: 0; width: 150px; height: 64px; z-index: 2; will-change: transform; filter: drop-shadow(0 4px 8px rgba(0,0,0,.45)); }
.fish svg { position: absolute; left: 18px; top: 2px; width: 120px; height: 60px; opacity: .92; }
.fish .fw { position: absolute; left: 32px; top: 50%; transform: translateY(-50%); padding: 3px 9px; border-radius: 8px; background: rgba(12,17,34,.78); font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: #fff; letter-spacing: .04em; white-space: nowrap; }
.fish .fw b { font-weight: 700; }
.fish .fw b.ok { color: #7CF0C0; }
.fish.target .fw { box-shadow: 0 0 0 2px #7CF0C0; }
.fish.miss .fw { box-shadow: 0 0 0 2px #E5484D; }
.fish.saved { transition: opacity .5s, filter .5s; opacity: 0; filter: brightness(1.6); }
.fish.caught { transition: opacity .4s; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .bubbles { animation: none; } }
.fish { width: 200px; height: 84px; }
.fish svg { left: 26px; top: 2px; width: 168px; height: 80px; }
.fish .fw { left: 52px; font-size: 24px; background: rgba(12,17,34,.7); }
.bubbles { opacity: .14; background-size: 137px 173px, 83px 121px; }

/* ---------- Kingdom of the Keys: brand + rank ladder ---------- */
.brand-name i { font-style: normal; font-weight: 600; font-size: .78em; color: var(--ink-soft); margin: 0 .1em; }
.ladder-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.ladder { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; position: relative; }
.rung { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px 10px; border-radius: 14px; background: #F2F5FA; border: 1px solid #E2E7F0; color: #8A93A8; text-align: center; }
.rung + .rung::before { content: ''; position: absolute; left: -9px; top: 50%; width: 10px; height: 2px; background: #DDE3EC; }
.rung .r-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #E4E9F2; }
.rung .r-ico svg { width: 20px; height: 20px; }
.rung .r-name { font-family: var(--font-display); font-weight: 800; font-size: 14px; color: #5B6479; line-height: 1.15; }
.rung .r-wpm { font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
.rung.earned { background: #131A2E; border-color: #131A2E; color: #C9D2E6; }
.rung.earned .r-name { color: #fff; }
.rung.earned .r-ico { background: rgba(255,255,255,.1); color: #F5C24A; }
.rung.earned + .rung::before, .rung.earned::before { background: #131A2E; }
.rung.next { background: #fff; border: 2px dashed var(--primary); color: var(--primary); }
.rung.next .r-name { color: var(--ink); }
.rung.next .r-ico { background: #E9E7FF; color: var(--primary); }
.rung.r-crown .r-ico { color: #C7951B; }
.rung.r-crown.earned { background: linear-gradient(135deg, #1B2240, #3A2E6E); }
.title-pick { flex: none; display: flex; flex-direction: column; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.title-pick button { font: inherit; text-transform: none; letter-spacing: 0; font-size: 13px; padding: 6px 12px; border-radius: 8px; border: 1px solid #DDE3EC; background: #fff; color: var(--ink); cursor: pointer; }
.title-pick button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
@media (max-width: 900px) { .ladder-wrap { flex-direction: column; align-items: stretch; } .title-pick { flex-direction: row; align-items: center; } }

/* ---------- Accounts: auth, profiles, parent view ---------- */
[data-color="indigo"] { --av: #5146E8; } [data-color="violet"] { --av: #9B6BFF; } [data-color="blue"] { --av: #3B8EF0; }
[data-color="teal"] { --av: #1FBF8A; } [data-color="amber"] { --av: #F5A524; } [data-color="rose"] { --av: #F2668B; }
.avatar[data-color] { background: var(--av); }
.boot-screen { display: grid; place-items: center; min-height: 60vh; }
.boot-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--primary); animation: boot 1s ease-in-out infinite alternate; }
@keyframes boot { from { opacity: .3; transform: scale(.8); } to { opacity: 1; transform: scale(1.1); } }
.btn.primary { background: var(--primary); }
.btn.wide { width: 100%; }
.btn.danger-ghost { background: #FDECEC; color: #B4232A; border-bottom-color: #F3C7C9; }
.link-btn { background: none; border: 0; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 0; }
.link-btn:hover { text-decoration: underline; }
.hint { font-weight: 500; color: var(--ink-soft); font-size: 13px; margin-left: 4px; }
.form-err { color: #B4232A; font-weight: 700; font-size: 14px; margin: 0; }
.form-ok { color: #128A53; font-weight: 700; font-size: 14px; margin: 0; }

.auth-screen { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; max-width: 1120px; margin: 0 auto; padding: 56px 32px; width: 100%; }
.auth-hero h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(36px, 4.4vw, 56px); line-height: 1.02; letter-spacing: -.03em; margin: 8px 0 16px; }
.auth-hero .lead { font-size: 18px; line-height: 1.55; color: var(--ink-soft); max-width: 54ch; margin: 0 0 24px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.auth-points li { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.auth-points .dot, .tips .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.auth-card { background: var(--surface); border-radius: 20px; box-shadow: 0 30px 60px -30px rgba(19,26,46,.35); padding: 28px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: #EEF2F8; border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.auth-tabs button { border: 0; background: none; padding: 10px; border-radius: 9px; font: inherit; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.auth-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(19,26,46,.12); }
.auth-form { display: grid; gap: 14px; }
.auth-form h2 { font-family: var(--font-display); font-weight: 800; margin: 0; font-size: 24px; }
.auth-form label, .modal-card label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.auth-form input[type=email], .auth-form input[type=password], .modal-card input[name=nickname], .inline-form input {
  font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 10px; border: 1.5px solid #D5DCE8; background: #fff; color: var(--ink); }
.auth-form input:focus, .modal-card input:focus, .inline-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(81,70,232,.18); }
.auth-form label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; line-height: 1.4; }
.auth-form label.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); }
.auth-form a { color: var(--primary); }
@media (max-width: 900px) { .auth-screen { grid-template-columns: 1fr; padding: 32px 20px; gap: 28px; } }

.profiles-screen { max-width: 980px; margin: 0 auto; padding: 64px 24px; width: 100%; text-align: center; }
.profiles-screen h1 { font-family: var(--font-display); font-weight: 800; font-size: 44px; letter-spacing: -.03em; margin: 6px 0 34px; }
.profile-grid { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; }
.profile { background: var(--surface); border: 2px solid transparent; border-radius: 20px; padding: 24px 18px 18px; width: 170px; display: grid; justify-items: center; gap: 12px; cursor: pointer; box-shadow: 0 10px 30px -18px rgba(19,26,46,.35); transition: transform .15s ease, border-color .15s ease; font: inherit; color: var(--ink); }
.profile:hover, .profile:focus-visible { transform: translateY(-3px); border-color: var(--primary); outline: none; }
.pf-av { width: 84px; height: 84px; border-radius: 22px; display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 38px; background: var(--av, #5146E8); box-shadow: inset 0 -5px 0 rgba(0,0,0,.18); }
.pf-av.sm { width: 48px; height: 48px; border-radius: 14px; font-size: 22px; }
.pf-av.plus { background: #E6ECF5; color: var(--ink-soft); box-shadow: none; font-family: var(--font-body); }
.pf-name { font-weight: 800; font-size: 17px; }
.profile-foot { margin-top: 40px; display: flex; gap: 20px; justify-content: center; align-items: center; }

.typist-chip { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
.typist-chip:hover { border-color: var(--primary); }
.tc-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--av, #5146E8); }

.parent-screen { max-width: 1160px; margin: 0 auto; padding: 40px 24px 60px; width: 100%; }
.parent-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.parent-head h1 { font-family: var(--font-display); font-weight: 800; font-size: 36px; letter-spacing: -.02em; margin: 4px 0; }
.parent-actions { display: flex; gap: 10px; }
.parent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.kid-card { background: var(--surface); border-radius: 18px; padding: 20px; box-shadow: 0 10px 30px -20px rgba(19,26,46,.35); display: grid; gap: 12px; }
.kid-card header { display: flex; gap: 12px; align-items: center; }
.kid-card header h3 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.kid-card header p { margin: 2px 0 0; font-size: 13px; }
.kid-card header .edit-kid { margin-left: auto; }
.kid-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.kid-stats div { background: #F2F5FA; border-radius: 12px; padding: 10px; display: grid; gap: 2px; }
.kid-stats b { font-family: var(--font-mono); font-size: 18px; }
.kid-stats b small { font-size: 12px; color: var(--ink-soft); }
.kid-stats span { font-size: 11.5px; color: var(--ink-soft); font-weight: 700; line-height: 1.25; }
.kid-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-top: 1px solid #EDF1F6; padding-top: 10px; }
.kid-line span { color: var(--ink-soft); }
.kid-line kbd { font-family: var(--font-mono); background: #131A2E; color: #fff; border-radius: 5px; padding: 1px 6px; font-size: 12px; }
.empty { background: var(--surface); border-radius: 18px; padding: 32px; text-align: center; }
.parent-account { margin-top: 28px; background: var(--surface); border-radius: 18px; padding: 20px; }
.parent-account h2 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.pa-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.inline-form input { width: 140px; }

.modal { position: fixed; inset: 0; background: rgba(19,26,46,.45); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 18px; padding: 24px; width: min(440px, 100%); display: grid; gap: 14px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); }
.modal-card h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 24px; }
.modal-card p { margin: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.modal-actions .spacer { flex: 1; }
.pin-input { font-family: var(--font-mono); font-size: 32px; letter-spacing: .5em; text-align: center; padding: 10px; border-radius: 12px; border: 1.5px solid #D5DCE8; }
.pin-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(81,70,232,.18); }
.swatches, .title-choice { border: 0; padding: 0; margin: 0; }
.swatches legend, .title-choice legend { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
#swatches { display: flex; gap: 10px; }
.sw { display: block !important; cursor: pointer; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw span { display: block; width: 38px; height: 38px; border-radius: 11px; background: var(--av); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.sw input:checked + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.sw input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.title-choice label { display: flex !important; gap: 8px; align-items: center; font-weight: 600 !important; margin-bottom: 4px; }
.title-choice input { accent-color: var(--primary); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #131A2E; color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; opacity: 0; transition: .25s; pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Lion crest brand */
.logo { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(19,26,46,.18)); }
.brand { gap: 10px; }
.brand-name { display: inline-flex; align-items: baseline; gap: .28em; color: #1E1B6B; }
.brand-name b { font-weight: 800; }
.brand-name i { font-style: normal; font-weight: 800; font-size: .62em; letter-spacing: .08em; text-transform: uppercase; color: #A86A00; margin: 0; transform: translateY(-.12em); }
.hero-lion { display: block; width: 168px; height: 168px; margin: 0 0 8px -10px; filter: drop-shadow(0 14px 24px rgba(30,27,107,.25)); }
.hero-lion.sm { width: 96px; height: 96px; margin: 0 auto 4px; }
.brand-name, .brand-name i { white-space: nowrap; }
@media (max-width: 520px) { .brand-name { font-size: 17px; } .logo { width: 36px; height: 36px; } }

/* Parent PIN entry */
.modal-card > * { min-width: 0; }
.pin-card { width: min(380px, 100%); text-align: center; justify-items: center; }
.pin-card .modal-actions { width: 100%; justify-content: center; }
.pin-card .modal-actions .btn { flex: 1; }
.pin-boxes { position: relative; display: flex !important; gap: 12px; justify-content: center; margin: 4px 0; cursor: text; }
.pin-boxes .pin-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; font-size: 16px; color: transparent; caret-color: transparent; }
.pin-cell { width: 56px; height: 64px; border-radius: 14px; border: 2px solid #D5DCE8; background: #F6F8FC; display: grid; place-items: center; transition: border-color .15s, background .15s; }
.pin-cell.active { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(81,70,232,.15); }
.pin-cell.filled::after { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); }
.pin-boxes.shake { animation: pinshake .35s; }
@keyframes pinshake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.home-btn { display: inline-flex; align-items: center; gap: 8px; }
.home-btn[hidden] { display: none; }
#game-overlay .result-actions { margin-top: 14px; }
