/* Наосліп — стиль «Скло»: пастельні плями під матовими скляними панелями. */

:root {
  --bg: #f3eefc;
  --text: #2f2a4a;
  --muted: #7d7699;
  --todo: #b9b2d3;
  --glass: rgba(255, 255, 255, .32);
  --glass-strong: rgba(255, 255, 255, .78);
  --border: rgba(255, 255, 255, .78);
  --inner: rgba(255, 255, 255, .9);
  --shadow: 0 30px 80px rgba(80, 60, 140, .16);
  --key-bg: rgba(255, 255, 255, .38);
  --key-ink: #4b4470;
  --accent: #7c5cff;
  --accent-soft: #e9e2ff;
  --ok: #23a46d;
  --err: #e5487a;
  --star: #ffb938;
  --blob1: #ffb5d1; --blob2: #a8e6cf; --blob3: #ffd98a; --blob4: #b9c7ff;
  --blob-opacity: 1;
  --radius: 28px;
  --k: 34px;
  --gap: calc(var(--k) * .14);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0f0d1e;
  --text: #ece9ff;
  --muted: #a39fc6;
  --todo: #5c5880;
  --glass: rgba(255, 255, 255, .06);
  --glass-strong: rgba(255, 255, 255, .16);
  --border: rgba(255, 255, 255, .14);
  --inner: rgba(255, 255, 255, .12);
  --shadow: 0 30px 80px rgba(0, 0, 0, .45);
  --key-bg: rgba(255, 255, 255, .05);
  --key-ink: #e5e1ff;
  --accent: #9d85ff;
  --accent-soft: rgba(157, 133, 255, .18);
  --blob1: #6b3cff; --blob2: #00a6c9; --blob3: #ff3c9a; --blob4: #3c5bff;
  --blob-opacity: .45;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Nunito, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ---------- фон ---------- */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; opacity: var(--blob-opacity); pointer-events: none; }
.bg-blobs i { position: absolute; border-radius: 50%; filter: blur(60px); animation: drift 22s ease-in-out infinite alternate; }
.bg-blobs i:nth-child(1) { width: 46vw; height: 46vw; background: var(--blob1); left: 4%; top: -6%; }
.bg-blobs i:nth-child(2) { width: 40vw; height: 40vw; background: var(--blob2); right: -4%; top: 18%; animation-duration: 26s; }
.bg-blobs i:nth-child(3) { width: 36vw; height: 36vw; background: var(--blob3); left: 34%; bottom: -14%; animation-duration: 30s; }
.bg-blobs i:nth-child(4) { width: 32vw; height: 32vw; background: var(--blob4); left: -8%; bottom: 4%; animation-duration: 34s; }
@keyframes drift { to { transform: translate(6vw, -5vh) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .bg-blobs i { animation: none; } }

/* ---------- скло і кнопки ---------- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 var(--inner);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 16px; border: 1px solid transparent;
  font-weight: 800; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: transform .1s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn-primary:hover { box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 55%, transparent); }
.btn-ghost { background: var(--glass); border-color: var(--border); backdrop-filter: blur(16px); }
.btn-ghost:hover { background: var(--glass-strong); }
.btn kbd { font: 700 12px Nunito, sans-serif; opacity: .7; border: 1px solid currentColor; border-radius: 6px; padding: 0 5px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(16px); cursor: pointer; font-size: 18px; }

/* ---------- шапка ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1200px; margin: 0 auto; padding: 16px 24px; transition: opacity .3s;
}
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 23px; text-decoration: none; letter-spacing: -.01em; }
.logo-mark { width: 48px; height: 37px; display: block; overflow: visible; flex: none; }
.logo-mark { color: var(--logo); }
:root { --logo: #7a58ff; }
[data-theme="dark"] { --logo: #cbbdff; }
/* у світлій темі знак без світіння — чистіший; у темній — легке сяйво */
:root:not([data-theme="dark"]) .logo-mark g { filter: none; }

/* меню мов */
.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none; cursor: pointer; height: 40px; min-width: 40px; padding: 0 10px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--muted);
  border: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(16px);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu[open] summary { color: var(--text); }
.lang-menu nav { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; display: flex; flex-direction: column; padding: 6px; border-radius: 16px; min-width: 150px; background: color-mix(in srgb, var(--bg) 82%, transparent); }
.lang-menu nav a { padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.lang-menu nav a:hover, .lang-menu nav a[aria-current] { background: var(--glass-strong); }
.foot-langs { display: flex; gap: 12px; flex-wrap: wrap; }
.foot-langs a { color: var(--muted); text-decoration: none; }
.foot-langs a:hover, .foot-langs a[aria-current] { color: var(--text); }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { padding: 8px 14px; border-radius: 12px; text-decoration: none; color: var(--muted); font-weight: 800; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--glass); }
body.typing .top { opacity: .15; }

/* ---------- клавіатура ---------- */
.kb { display: flex; flex-direction: column; gap: var(--gap); user-select: none; }
.kb-row { display: flex; gap: var(--gap); justify-content: center; }
.key {
  position: relative; flex: none;
  width: calc(var(--k) * var(--w, 1) + var(--gap) * (var(--w, 1) - 1));
  height: var(--k);
  display: flex; align-items: center; justify-content: center;
  border-radius: calc(var(--k) * .28);
  font-weight: 800; font-size: calc(var(--k) * .38);
  color: color-mix(in srgb, var(--key-ink) calc((1 - var(--fade, 0)) * 100%), transparent);
  background: color-mix(in srgb, var(--c) 58%, var(--key-bg));
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--inner), 0 4px 12px rgba(80, 60, 140, .07);
  transition: transform .08s, background .15s, box-shadow .15s;
}
[data-theme="dark"] .key { background: color-mix(in srgb, var(--c) 20%, var(--key-bg)); --key-ink: color-mix(in srgb, var(--c) 88%, white); }
.key b { font-weight: 800; }
.key i { position: absolute; font-style: normal; font-weight: 800; font-size: calc(var(--k) * .21); opacity: .62; line-height: 1; }
.key .sh { left: 13%; top: 11%; }
.key .alt { right: 12%; bottom: 10%; }
.kb-compact .key i { display: none; }
.key-special { font-size: calc(var(--k) * .24); color: var(--muted); background: var(--key-bg); }
.key-bump::after { content: ""; position: absolute; bottom: 16%; width: 24%; height: 3px; border-radius: 2px; background: var(--key-ink); opacity: .45; }
.key.next {
  color: #3a3358;
  background: color-mix(in srgb, var(--c) 82%, white);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--c) 70%, transparent), inset 0 1px 0 #fff;
}
.key.down { transform: scale(.93); }
.key.wrong { background: #ff9bb5; color: #6b1730; animation: shake .26s; }
.kb-heat .key:not(.key-special) { background: color-mix(in srgb, #ff5d8f calc(var(--heat, 0) * 90%), var(--key-bg)); }
.kb-compact { --k: clamp(20px, 2.5vw, 36px); }

/* ---------- рядок тексту ---------- */
.track {
  position: relative; width: min(94vw, calc(var(--k) * 17)); height: calc(var(--k) * 1.7); overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
/* курсор лівіше центру: попереду видно більше тексту, ніж позаду */
.track-line {
  position: absolute; left: 34%; top: 50%; display: flex; white-space: pre;
  transform: translate(0, -50%); transition: transform .14s ease-out;
  font-size: calc(var(--k) * .86); font-weight: 800; letter-spacing: .01em;
}
.ch { padding: 0 .03em; border-radius: .2em; transition: color .12s; }
.ch.sp { min-width: .32em; }
.ch.todo { color: var(--todo); }
.ch.done { color: var(--muted); }
.ch.done.had-err { color: color-mix(in srgb, var(--err) 55%, var(--muted)); }
.ch.cur { color: var(--text); background: var(--glass-strong); box-shadow: 0 6px 18px rgba(80, 60, 140, .18); }
.ch.cur.sp { box-shadow: inset 0 -.12em 0 var(--accent), 0 6px 18px rgba(80, 60, 140, .18); }
.ch.err { color: var(--err); }
.ch.shake { animation: shake .26s; }
@keyframes shake { 25% { translate: -3px 0; } 75% { translate: 3px 0; } }

/* ---------- тренажер (урок і тест) ---------- */
.page-trainer { --k: clamp(26px, min(4.9vw, calc((100vh - 150px) / 10.8)), 76px); }
.page-trainer main { min-height: calc(100vh - 80px); display: flex; align-items: center; justify-content: center; padding: 0 2vw 2vh; }
.trainer { display: flex; flex-direction: column; align-items: center; gap: calc(var(--k) * .42); padding: calc(var(--k) * .55) calc(var(--k) * .7); }
.live { display: flex; gap: calc(var(--k) * .6); font-size: max(13px, calc(var(--k) * .26)); color: var(--muted); font-weight: 800; }
.live b { color: var(--text); }
.finger-hint { min-height: 1.4em; font-size: max(13px, calc(var(--k) * .26)); color: var(--muted); font-weight: 800; }
.lesson-head { display: flex; align-items: center; gap: 14px; }
.lesson-title { font-weight: 800; }
.dots { display: flex; gap: 6px; }
.dots a { width: 12px; height: 12px; border-radius: 50%; background: var(--glass-strong); border: 1px solid var(--border); }
.dots a.done { background: var(--star); }
.dots a.cur { outline: 2px solid var(--accent); outline-offset: 2px; }
.notice { font-size: 14px; color: var(--muted); text-align: center; max-width: 520px; }
.notice.warn { color: var(--err); }

/* ---------- модальні вікна ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(40, 30, 80, .14); backdrop-filter: blur(4px); }
.modal-wrap[hidden] { display: none; }
.modal { width: min(520px, 100%); padding: 34px 36px 30px; text-align: center; display: flex; flex-direction: column; gap: 18px; }
.modal h2 { margin: 0; font-size: 26px; }
.modal p { margin: 0; color: var(--muted); line-height: 1.5; }
.modal .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.stars { font-size: 46px; letter-spacing: 6px; }
.star { color: color-mix(in srgb, var(--muted) 35%, transparent); display: inline-block; }
.star.on { color: var(--star); animation: pop .4s backwards; }
.star.on:nth-child(2) { animation-delay: .15s; }
.star.on:nth-child(3) { animation-delay: .3s; }
@keyframes pop { from { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.25); } }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 12px 8px; border-radius: 16px; background: var(--glass); border: 1px solid var(--border); }
.stat b { display: block; font-size: 26px; }
.stat span { font-size: 13px; color: var(--muted); }
.caps { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cap {
  min-width: 64px; height: 64px; padding: 0 12px; border-radius: 18px; display: grid; place-items: center;
  font-size: 30px; font-weight: 800; color: #3a3358;
  background: color-mix(in srgb, var(--c, #e9e2ff) 80%, white); border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--c, #e9e2ff) 60%, transparent), inset 0 1px 0 #fff;
}
.cap small { display: block; font-size: 11px; color: #6b6390; margin-top: -8px; }

/* ---------- головна ---------- */
.home main { max-width: 1200px; margin: 0 auto; padding: 8px 24px 60px; display: flex; flex-direction: column; gap: 28px; }
.hero { padding: 44px 48px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.08; margin: 0 0 14px; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); font-size: 18px; line-height: 1.55; margin: 0 0 24px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-kb { display: flex; justify-content: center; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.pill { padding: 6px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stats-row .stat { padding: 18px; text-align: left; border-radius: 20px; backdrop-filter: blur(20px); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 4px -8px; }
.section-title h2 { margin: 0; font-size: 24px; }
.section-title span { color: var(--muted); font-size: 14px; }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.lesson-card { display: flex; flex-direction: column; gap: 12px; padding: 18px 18px 16px; border-radius: 22px; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.lesson-card:hover { transform: translateY(-3px); }
.lesson-card.recommended { border: 2px solid var(--accent); }
.lesson-card .num { font-size: 13px; color: var(--muted); font-weight: 800; }
.lesson-card .name { font-weight: 800; line-height: 1.3; min-height: 2.6em; }
.lesson-card .mini-caps { display: flex; gap: 6px; }
.lesson-card .mini-caps span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #3a3358; background: color-mix(in srgb, var(--c) 70%, white); border: 1px solid rgba(255,255,255,.9); }
.lesson-card .meta { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); }
.lesson-card .meta .stars-sm { color: var(--star); letter-spacing: 1px; }
.bar { height: 6px; border-radius: 3px; background: var(--glass-strong); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.weak { padding: 28px 32px; display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; }
.weak h2 { margin: 0 0 8px; }
.weak p { color: var(--muted); margin: 0 0 14px; }
.weak-list { display: flex; gap: 8px; flex-wrap: wrap; }
.article { padding: 32px 40px; line-height: 1.65; }
.article h2 { margin-top: 0; }
.article p { color: var(--muted); }
footer { max-width: 1200px; margin: 0 auto; padding: 0 24px 40px; color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.linklike { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; }

/* ---------- тест ---------- */
.durations { display: flex; gap: 6px; padding: 5px; border-radius: 14px; background: var(--glass); border: 1px solid var(--border); }
.durations button { border: 0; background: transparent; padding: 6px 14px; border-radius: 10px; font-weight: 800; cursor: pointer; color: var(--muted); }
.durations button.on { background: var(--glass-strong); color: var(--text); box-shadow: 0 4px 12px rgba(80,60,140,.12); }
.timer { font-size: max(18px, calc(var(--k) * .5)); font-weight: 800; font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 32px 26px; }
  .hero-kb { display: none; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .weak { grid-template-columns: 1fr; }
  .nav a.hide-sm { display: none; }
}

/* ---------- руки під клавіатурою ---------- */
:root {
  --palm: #f2eefe; --palm-edge: rgba(110, 90, 190, .26);
  --finger-mix: 80%; --finger-base: #ffffff; --finger-edge: #5b4a9e; --nail: rgba(255, 255, 255, .8);
}
[data-theme="dark"] {
  --palm: #5b5391; --palm-edge: rgba(255, 255, 255, .28);
  --finger-mix: 64%; --finger-base: #2a2550; --finger-edge: #ffffff; --nail: rgba(255, 255, 255, .28);
}
.hands { display: flex; justify-content: center; height: calc(var(--k) * 2.95); margin-top: calc(var(--k) * -.12); pointer-events: none; }
.hands[hidden] { display: none; }
.hands svg {
  height: 100%; width: auto; overflow: visible;
  -webkit-mask-image: linear-gradient(to bottom, #000 64%, transparent 98%);
  mask-image: linear-gradient(to bottom, #000 64%, transparent 98%);
}
.hands .palm { fill: var(--palm); }
.hands .knuckles { fill: none; stroke: var(--palm-edge); stroke-width: 1.3; stroke-linecap: round; }
.hands .palm-edge { fill: none; stroke: var(--palm-edge); stroke-width: 1.4; stroke-linecap: round; }
.hands .finger { transition: transform .16s ease-out, opacity .2s; }
.hands .skin { fill: color-mix(in srgb, var(--c) var(--finger-mix), var(--finger-base)); stroke: color-mix(in srgb, var(--c) 55%, var(--finger-edge)); stroke-width: 1.3; transition: fill .16s; }
.hands .crease { fill: none; stroke: color-mix(in srgb, var(--c) 45%, var(--finger-edge)); stroke-width: 1.3; stroke-linecap: round; opacity: .45; }
.hands .nail { fill: var(--nail); }
.hands.has-on .finger:not(.on) { opacity: .5; }
.hands .finger.on { transform: translateY(-6px); filter: drop-shadow(0 0 7px var(--c)); }
.hands .finger.on .skin { fill: var(--c); }
.icon-btn[aria-pressed="false"] { opacity: .5; }

/* ---------- прогрес етапу ---------- */
.stage { padding: 16px 18px 14px; border-radius: 20px; background: var(--glass); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.stage[hidden] { display: none; }
.stage-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); }
.stage-head b { color: var(--text); font-size: 16px; }
.stage.complete .stage-head b { color: var(--accent); }
.stage-path { display: flex; align-items: center; justify-content: center; }
.stage-path .node {
  width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: var(--muted);
  background: var(--glass-strong); border: 2px solid var(--border);
}
.stage-path .node.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.stage-path .node.cur { box-shadow: 0 0 0 4px var(--accent-soft); }
.stage-path .node.just { animation: node-fill .7s .25s both; }
.stage-path .link { flex: 1; max-width: 46px; height: 4px; border-radius: 2px; background: var(--glass-strong); position: relative; overflow: hidden; }
.stage-path .link.done::after { content: ""; position: absolute; inset: 0; background: var(--accent); }
.stage-path .link.just::after { animation: link-fill .35s both; transform-origin: left; }
@keyframes link-fill { from { transform: scaleX(0); } }
@keyframes node-fill {
  0% { background: var(--glass-strong); border-color: var(--border); color: var(--muted); transform: scale(1); }
  45% { transform: scale(1.35); }
  100% { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1); }
}
.stage.complete .node.done { animation: glow 1.6s .9s ease-in-out 2; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px var(--accent-soft), 0 0 22px var(--accent); } }
.stage-sub { font-size: 13px; color: var(--muted); }
.stages-all { display: grid; gap: 6px; }
.seg { height: 8px; border-radius: 4px; background: var(--glass-strong); overflow: hidden; }
.seg.cur { outline: 2px solid var(--accent-soft); outline-offset: 1px; }
.seg i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .9s cubic-bezier(.2, .8, .2, 1); }

/* етапи на головній */
.stage-block { display: flex; flex-direction: column; gap: 14px; }
.stage-title { display: flex; align-items: center; gap: 14px; margin: 6px 4px 0; }
.stage-title h3 { margin: 0; font-size: 18px; }
.stage-title .num { font-size: 13px; color: var(--muted); font-weight: 800; white-space: nowrap; }
.stage-title .bar { flex: 1; max-width: 220px; }
.stage-title .count { font-size: 13px; color: var(--muted); white-space: nowrap; }

#lessons { display: flex; flex-direction: column; gap: 22px; }
/* коли руки показані, клавіші трохи менші, щоб усе вмістилося без прокрутки */
.page-trainer:has(.hands:not([hidden])) { --k: clamp(26px, min(4.9vw, calc((100vh - 150px) / 13.7)), 76px); }
/* модальні вікна щільніші за звичайне скло, щоб клавіатура під ними не заважала читати */
.modal.glass { background: color-mix(in srgb, var(--bg) 72%, transparent); }

/* ---------- вибір мови набору ---------- */
.course-switch { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 2px; }
.course-switch button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 14px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(16px); color: var(--muted); transition: background .15s, color .15s;
}
.course-switch button b { font-size: 15px; }
.course-switch button small { font-size: 11px; opacity: .8; }
.course-switch button:hover { background: var(--glass-strong); color: var(--text); }
.course-switch button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.course-select {
  font: inherit; font-weight: 800; font-size: 14px; color: var(--text); padding: 8px 30px 8px 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--glass) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238a84ad' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  appearance: none; -webkit-appearance: none; backdrop-filter: blur(16px);
}
.course-select option { color: #2f2a4a; }
.test-opts { display: flex; gap: 8px; align-items: center; }
.ch.cur.half { box-shadow: inset 0 -.14em 0 var(--accent), 0 6px 18px rgba(80, 60, 140, .18); }
.stages-all { grid-template-columns: repeat(var(--n, 4), 1fr); }

/* ---------- таблиця лідерів ---------- */
.join { display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 14px 16px; border-radius: 18px; background: var(--glass); border: 1px solid var(--border); }
.join[hidden] { display: none; }
.join label { font-weight: 800; font-size: 14px; }
.join-row { display: flex; gap: 8px; }
.join input {
  flex: 1; min-width: 0; font: inherit; font-weight: 700; padding: 10px 14px; border-radius: 12px; color: var(--text);
  border: 1px solid var(--border); background: var(--glass-strong); outline: none;
}
.join input:focus { border-color: var(--accent); }
.join .btn { padding: 10px 16px; }
.join .btn:disabled, .join input:disabled { opacity: .55; cursor: default; }
.join-msg { font-size: 13px; color: var(--muted); min-height: 1em; }
.join-msg a { color: var(--accent); font-weight: 800; text-decoration: none; }

.board { padding: 32px 36px 28px; display: flex; flex-direction: column; gap: 20px; }
.board-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.board-head h1 { margin: 0 0 6px; font-size: clamp(28px, 3.4vw, 40px); }
.board-head p { margin: 0; color: var(--muted); }
.board-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
#board { min-height: 200px; transition: opacity .2s; }
#board.loading { opacity: .5; }
.board-msg { color: var(--muted); text-align: center; padding: 50px 0; margin: 0; }
.board-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.board-table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 800; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.board-table td { padding: 11px 12px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.board-table td:first-child { width: 48px; font-weight: 800; color: var(--muted); }
.board-table td b { font-size: 18px; }
.board-table tr.me td { background: var(--accent-soft); }
.board-table td small { color: var(--muted); }
@media (max-width: 700px) {
  .board { padding: 22px 16px; }
  .board-table th:nth-child(4), .board-table td:nth-child(4), .board-table th:nth-child(6), .board-table td:nth-child(6) { display: none; }
  .test-opts .course-select { display: none; }
}
[data-theme="dark"] .hands.has-on .finger:not(.on) { opacity: .62; }

/* ---------- покрокова підказка (перший урок) ---------- */
.tour { position: fixed; inset: 0; z-index: 40; opacity: 0; transition: opacity .25s; --dim: rgba(46, 34, 92, .58); }
[data-theme="dark"] .tour { --dim: rgba(6, 4, 18, .68); }
.tour.in { opacity: 1; }
.tour-hole {
  position: fixed; border-radius: 18px; pointer-events: none;
  box-shadow: 0 0 0 200vmax var(--dim), 0 0 0 2px var(--accent), 0 0 28px 2px color-mix(in srgb, var(--accent) 55%, transparent);
}
.tour-hole::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--accent); animation: tour-ring 1.6s ease-out infinite; }
@keyframes tour-ring { to { inset: -14px; border-radius: 26px; opacity: 0; } }
.tour.ready .tour-hole { transition: left .35s, top .35s, width .35s, height .35s; }
.tour.ready .tour-pop { transition: left .35s, top .35s; }
.tour-pop {
  position: fixed; width: min(380px, calc(100vw - 20px), calc(100dvw - 20px)); padding: 18px 20px 16px; border-radius: 20px; outline: none;
  background: color-mix(in srgb, var(--bg) 92%, white); border: 1px solid var(--border); box-shadow: 0 22px 50px rgba(20, 12, 60, .35);
}
[data-theme="dark"] .tour-pop { background: color-mix(in srgb, var(--bg) 86%, #9d85ff); }
.tour-pop h3 { margin: 2px 0 6px; font-size: 19px; }
.tour-pop p { margin: 0 0 14px; color: var(--muted); line-height: 1.5; font-size: 15px; }
.tour-count { font-size: 12px; font-weight: 800; color: var(--accent); }
.tour-actions { display: flex; justify-content: flex-end; gap: 8px; }
.tour-actions .btn { padding: 9px 16px; font-size: 15px; }
.tour-skip[hidden] { display: none; }
.tour-arrow {
  position: absolute; bottom: -8px; width: 14px; height: 14px; background: inherit;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transform: translateX(-50%) rotate(45deg);
}
.tour-pop.below .tour-arrow { bottom: auto; top: -8px; border: 0; border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
.key.blink { animation: key-blink 1s ease-in-out infinite; }
@keyframes key-blink {
  50% { background: color-mix(in srgb, var(--c) 80%, white); color: #3a3358; transform: translateY(-3px); box-shadow: 0 0 0 3px var(--accent), 0 0 24px var(--accent); }
}
@media (prefers-reduced-motion: reduce) { .tour-hole::after, .key.blink { animation-duration: 2.4s; } }

/* ---------- статті й перелік статей ---------- */
.section-title a { color: var(--accent); font-weight: 800; text-decoration: none; font-size: 15px; }
.guides-home { display: flex; flex-direction: column; gap: 22px; }
.guides-home[hidden] { display: none; }
.guide-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.guide-card { padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text); transition: transform .15s, box-shadow .15s; }
.guide-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(60, 40, 120, .14); }
.guide-card h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.guide-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; flex: 1; }
.guide-card span { color: var(--accent); font-weight: 800; font-size: 14px; }
.guides-head { padding: 8px 4px 0; }
.guides-head h1 { margin: 6px 0 8px; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.02em; }
.guides-head p { margin: 0; color: var(--muted); font-size: 18px; max-width: 720px; line-height: 1.55; }
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); font-weight: 800; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.guide { max-width: 860px; width: 100%; margin: 0 auto; padding: 36px 48px 40px; line-height: 1.7; font-size: 17px; }
.guide h1 { margin: 10px 0 6px; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.15; letter-spacing: -.02em; }
.guide-meta { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.guide h2 { margin: 34px 0 10px; font-size: 25px; line-height: 1.25; }
.guide h3 { margin: 24px 0 6px; font-size: 19px; }
.guide p, .guide li { color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
.guide p { margin: 0 0 14px; }
.guide ul, .guide ol { margin: 0 0 16px; padding-left: 24px; }
.guide li { margin: 4px 0; }
.guide a { color: var(--accent); font-weight: 800; }
.guide blockquote { margin: 18px 0; padding: 14px 20px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 14px 14px 0; }
.guide blockquote p:last-child { margin: 0; }
.guide kbd { display: inline-block; min-width: 1.6em; padding: 1px 7px; border-radius: 7px; border: 1px solid var(--border); border-bottom-width: 3px; background: var(--glass-strong); font: 800 .85em Nunito, sans-serif; text-align: center; line-height: 1.5; white-space: nowrap; }
.guide table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: 15px; display: block; overflow-x: auto; }
.guide th, .guide td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.guide th { font-size: 13px; color: var(--muted); }
.guide figure { margin: 22px 0; }
.guide figure img { width: 100%; height: auto; border-radius: 16px; display: block; box-shadow: 0 10px 30px rgba(40, 25, 100, .14); }
.guide figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; text-align: center; }
.guide-cta { max-width: 860px; width: 100%; margin: 0 auto; padding: 26px 32px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.guide-cta h2 { margin: 0 0 4px; font-size: 22px; }
.guide-cta p { margin: 0; color: var(--muted); max-width: 440px; }
.guide-cta .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); text-decoration: none; font-weight: 800; }
.foot-links a:hover { color: var(--text); }
.not-found { grid-template-columns: 1fr; text-align: center; }
.not-found h1 { font-size: 80px; }
.not-found .actions { justify-content: center; }
@media (max-width: 700px) {
  .guide { padding: 24px 18px 28px; font-size: 16px; }
  .guide-cta { padding: 22px 18px; }
}

/* ---------- поділитися результатом тесту ---------- */
.share-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.share-row .btn { padding: 9px 16px; font-size: 15px; }
.share-msg { min-height: 1.2em; font-size: 14px; color: var(--muted); margin-top: -8px; }
