/* KeyFlow — העיצוב: דיו כהה של חצות, מנטה וענבר חם. אותו קובץ באתר ובאפליקציה. */
@font-face { font-family: 'Assistant'; src: url('fonts/Assistant.ttf') format('truetype'); font-weight: 200 800; font-display: swap; }

:root, [data-theme="dark"] {
  --bg: #0B1018; --bg2: #0F1622; --card: #141C2A; --raised: #1A2435; --sunk: #0D131D;
  --line: rgba(255,255,255,.07); --line2: rgba(255,255,255,.12);
  --text: #EEF3F8; --soft: #C9D3E0; --mute: #8C9AB0; --faint: #5D6A7E;
  --acc: #35E0B0; --acc2: #22C3C9; --acc-wash: rgba(53,224,176,.12); --acc-line: rgba(53,224,176,.35);
  --warm: #FFB648; --warm-wash: rgba(255,182,72,.13);
  --err: #FF5D73; --err-wash: rgba(255,93,115,.14);
  --ink: #04140F;
  --key: #18212F; --key-top: #1E2939; --key-edge: #090E15; --key-text: #E3EAF2;
  --shadow: 0 18px 44px -24px rgba(0,0,0,.8);
  --glow1: rgba(53,224,176,.10); --glow2: rgba(255,182,72,.06);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F3F1EC; --bg2: #ECE9E2; --card: #FFFFFF; --raised: #FAF9F6; --sunk: #E9E6DE;
  --line: rgba(20,32,43,.08); --line2: rgba(20,32,43,.14);
  --text: #14202B; --soft: #34414F; --mute: #5E6B7A; --faint: #8D97A3;
  --acc: #0E9F7E; --acc2: #0F8A9A; --acc-wash: rgba(14,159,126,.10); --acc-line: rgba(14,159,126,.35);
  --warm: #C77A0A; --warm-wash: rgba(217,138,18,.12);
  --err: #D93A4F; --err-wash: rgba(217,58,79,.10);
  --ink: #FFFFFF;
  --key: #FFFFFF; --key-top: #FFFFFF; --key-edge: #D3CEC3; --key-text: #1B2834;
  --shadow: 0 18px 40px -26px rgba(30,40,50,.35);
  --glow1: rgba(14,159,126,.08); --glow2: rgba(217,138,18,.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: 'Assistant', system-ui, sans-serif; font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-rendering: optimizeLegibility;
  overscroll-behavior: none; min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(900px 520px at 100% -10%, var(--glow1), transparent 70%),
    radial-gradient(700px 520px at -10% 110%, var(--glow2), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
a { color: var(--acc); text-decoration: none; -webkit-tap-highlight-color: transparent; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--acc-wash); color: var(--text); }
:focus { outline: none; }
:focus-visible { outline: 2.5px solid var(--warm); outline-offset: 3px; border-radius: 10px; }
* { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; } ::-webkit-scrollbar-track { background: transparent; }
svg { display: block; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; }
[hidden] { display: none !important; }

/* ---------- loading ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.boot-key { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; font-size: 34px; font-weight: 800; color: var(--acc);
  background: var(--key); border: 1px solid var(--acc-line); box-shadow: 0 6px 0 var(--key-edge); animation: bootp 1.1s ease-in-out infinite; }
@keyframes bootp { 50% { transform: translateY(4px); box-shadow: 0 2px 0 var(--key-edge); } }

/* ---------- shell ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.page { width: min(1080px, 100%); margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 18px calc(118px + env(safe-area-inset-bottom)); animation: fadeIn .22s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 18px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 21px; letter-spacing: -.2px; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(150deg, var(--key-top), var(--key)); border: 1px solid var(--acc-line); box-shadow: 0 4px 0 var(--key-edge); color: var(--acc); font-weight: 800; font-size: 20px; position: relative; }
.logo::after { content: ''; position: absolute; bottom: 8px; width: 12px; height: 2.5px; border-radius: 3px; background: var(--warm); }
.brand small { display: block; font-size: 12.5px; color: var(--mute); font-weight: 600; letter-spacing: 0; margin-top: -3px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; padding: 0 22px; border-radius: 15px;
  font-weight: 800; font-size: 16.5px; transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s; white-space: nowrap; user-select: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: translateY(2px) scale(.985); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-main { color: var(--ink); background: linear-gradient(135deg, var(--acc), var(--acc2)); box-shadow: 0 5px 0 color-mix(in srgb, var(--acc2) 45%, #000), 0 16px 30px -16px var(--acc); }
.btn-main:hover { filter: brightness(1.05); text-decoration: none; }
.btn-main:active { box-shadow: 0 2px 0 color-mix(in srgb, var(--acc2) 45%, #000); }
.btn-soft { color: var(--text); background: var(--raised); border: 1px solid var(--line2); }
.btn-soft:hover { border-color: var(--acc-line); text-decoration: none; }
.btn-ghost { color: var(--mute); min-height: 44px; padding: 0 14px; }
.btn-ghost:hover { color: var(--text); }
.btn-danger { color: #fff; background: var(--err); }
.btn-sm { min-height: 40px; padding: 0 15px; border-radius: 12px; font-size: 14.5px; }
.btn-wide { width: 100%; }
.chipbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 15px; border-radius: 99px; font-weight: 700; font-size: 14.5px;
  color: var(--text); background: var(--raised); border: 1px solid var(--line2); transition: .2s; }
.chipbtn svg { width: 18px; height: 18px; color: var(--acc); }
.chipbtn:hover { border-color: var(--acc-line); text-decoration: none; }
.iconbtn { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: var(--soft); background: var(--raised); border: 1px solid var(--line); transition: .2s; }
.iconbtn svg { width: 21px; height: 21px; }
.iconbtn:hover { color: var(--text); border-color: var(--line2); }
.iconbtn:active { transform: scale(.95); }

/* ---------- cards & sections ---------- */
.card { background: linear-gradient(180deg, var(--raised), var(--card)); border: 1px solid var(--line); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); }
.sec { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; margin: 30px 2px 13px; }
.sec h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.sec span { color: var(--mute); font-size: 14px; }
.muted { color: var(--mute); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* hero */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 18px 24px; align-items: center; padding: 24px; border-radius: 26px; }
.hero::before { content: ''; position: absolute; inset: auto -60px -90px auto; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, var(--acc-wash), transparent 70%); pointer-events: none; }
.hello { font-size: 15px; color: var(--mute); font-weight: 700; margin: 0 0 4px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(27px, 5.2vw, 40px); line-height: 1.12; font-weight: 800; letter-spacing: -.6px; }
.hero h1 em { font-style: normal; color: var(--acc); }
.hero p { margin: 0 0 18px; color: var(--soft); font-size: 16.5px; max-width: 520px; }
.hero .acts { display: flex; flex-wrap: wrap; gap: 10px; }
.mini-stats { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.ms { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 12px; background: var(--sunk); border: 1px solid var(--line); font-size: 14px; color: var(--soft); }
.ms svg { width: 17px; height: 17px; color: var(--warm); }
.ms b { color: var(--text); font-weight: 800; }

/* ring */
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .trk { stroke: var(--line2); }
.ring .bar { stroke: url(#kfg); transition: stroke-dashoffset .9s cubic-bezier(.2,.8,.2,1); }
.ring .in { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .in b { display: block; font-size: 30px; white-space: nowrap; font-weight: 800; line-height: 1; }
.ring .in span { display: block; font-size: 12.5px; color: var(--mute); margin-top: 4px; font-weight: 700; }

/* challenge banner */
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; margin-bottom: 14px; background: linear-gradient(135deg, var(--warm-wash), var(--card) 70%); border: 1px solid color-mix(in srgb, var(--warm) 40%, transparent); }
.banner svg { width: 28px; height: 28px; color: var(--warm); flex: none; }
.banner b { display: block; font-size: 16px; }
.banner span { color: var(--mute); font-size: 14px; }
.banner .x { margin-inline-start: auto; }

/* the guide card */
.guide-card { display: flex; align-items: center; gap: 16px; cursor: pointer; transition: border-color .2s, transform .15s; text-align: start; width: 100%; color: inherit; }
.guide-card:hover { border-color: var(--acc-line); }
.guide-card:active { transform: scale(.99); }
.gicon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--warm-wash); color: var(--warm); flex: none; }
.gicon svg { width: 28px; height: 28px; }
.guide-card b { display: block; font-size: 17px; }
.guide-card span { color: var(--mute); font-size: 14.5px; }
.go { margin-inline-start: auto; color: var(--faint); }
.go svg { width: 22px; height: 22px; transform: scaleX(-1); }
.done-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 800; color: var(--acc); background: var(--acc-wash); padding: 3px 10px; border-radius: 99px; margin-inline-start: 6px; vertical-align: 2px; }
.done-tag svg { width: 14px; height: 14px; }

/* stages */
.stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stage { position: relative; text-align: start; display: flex; flex-direction: column; gap: 10px; padding: 17px; border-radius: 20px; color: inherit;
  background: var(--card); border: 1px solid var(--line); transition: border-color .2s, transform .15s, background .2s; min-height: 150px; }
.stage:hover { border-color: var(--line2); }
.stage:active { transform: scale(.985); }
.stage.now { background: linear-gradient(160deg, color-mix(in srgb, var(--acc) 16%, var(--card)), var(--card) 75%); border-color: var(--acc-line); }
.stage.locked { opacity: .62; }
.stage .head { display: flex; align-items: center; gap: 11px; }
.sn { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 16px; background: var(--key); border: 1px solid var(--line2); box-shadow: 0 3px 0 var(--key-edge); flex: none; }
.stage.now .sn { color: var(--acc); border-color: var(--acc-line); }
.stage.passed .sn { color: var(--ink); background: var(--acc); border-color: transparent; }
.stage .head b { font-size: 16.5px; line-height: 1.2; display: block; }
.stage .head small { color: var(--mute); font-size: 13px; display: block; }
.stage .lock { margin-inline-start: auto; color: var(--faint); }
.stage .lock svg { width: 19px; height: 19px; }
.letters { font-size: 17px; font-weight: 700; letter-spacing: 1.5px; color: var(--soft); min-height: 26px; }
.letters i { font-style: normal; color: var(--acc); }
.stage .foot { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--mute); }
.pbar { flex: 1; height: 6px; border-radius: 6px; background: var(--sunk); overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--acc2), var(--acc)); transition: width .6s ease; }
[dir="rtl"] .pbar i { background: linear-gradient(270deg, var(--acc2), var(--acc)); margin-inline-start: 0; }
.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 15px; height: 15px; color: var(--faint); }
.stars svg.on { color: var(--warm); }

.test-card { display: flex; align-items: center; gap: 16px; }
.test-card .gicon { background: var(--acc-wash); color: var(--acc); }
.test-card b { display: block; font-size: 17px; }
.test-card span { color: var(--mute); font-size: 14.5px; }
.test-card .btn { margin-inline-start: auto; }

.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; color: var(--mute); font-size: 14px; margin: 34px 0 0; }
.foot-links a { color: var(--mute); }
.foot-links a:hover { color: var(--text); }

/* ---------- bottom navigation ---------- */
.nav { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 4px; padding: 6px;
  border-radius: 22px; background: color-mix(in srgb, var(--card) 88%, transparent); border: 1px solid var(--line2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px -18px rgba(0,0,0,.7); width: min(440px, calc(100% - 24px)); }
.nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px 7px; border-radius: 16px; color: var(--mute); font-size: 13px; font-weight: 700; transition: color .2s, background .2s; min-height: 56px; }
.nav button svg { width: 23px; height: 23px; }
.nav button:hover { color: var(--text); }
.nav button.on { color: var(--acc); background: var(--acc-wash); }
.nav button.mid.on { color: var(--ink); background: linear-gradient(135deg, var(--acc), var(--acc2)); }

/* ---------- profile ---------- */
.me { display: flex; align-items: center; gap: 16px; }
.avatar { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; font-size: 32px; font-weight: 800; color: #04140F; flex: none; box-shadow: 0 5px 0 rgba(0,0,0,.25); }
.me h1 { margin: 0; font-size: 25px; line-height: 1.2; }
.me .lv { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13.5px; font-weight: 800; color: var(--warm); background: var(--warm-wash); padding: 4px 11px; border-radius: 99px; }
.me .lv svg { width: 15px; height: 15px; }
.me .edit { margin-inline-start: auto; }
.stat { padding: 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.stat > span { display: block; color: var(--mute); font-size: 13.5px; font-weight: 700; }
.stat b { display: block; font-size: 27px; font-weight: 800; line-height: 1.15; margin-top: 3px; }
.stat b small { font-size: 14px; color: var(--mute); font-weight: 700; margin-inline-start: 4px; }
.stat svg { width: 20px; height: 20px; color: var(--acc); margin-bottom: 8px; }
.goal { display: flex; align-items: center; gap: 18px; }
.goal .ring { width: 96px; height: 96px; }
.goal .ring .in b { font-size: 22px; }
.goal b.t { display: block; font-size: 17px; }
.goal p { margin: 3px 0 0; color: var(--mute); font-size: 14.5px; }
.ach { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.badge { text-align: center; padding: 14px 8px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.badge .bi { width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 15px; display: grid; place-items: center; background: var(--sunk); color: var(--faint); }
.badge .bi svg { width: 24px; height: 24px; }
.badge.on .bi { background: var(--warm-wash); color: var(--warm); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warm) 35%, transparent); }
.badge b { display: block; font-size: 13.5px; line-height: 1.25; }
.badge span { display: block; font-size: 12px; color: var(--mute); line-height: 1.3; margin-top: 2px; }
.badge:not(.on) b { color: var(--mute); }

/* chart */
.chart { position: relative; }
.chart svg { width: 100%; max-width: 680px; height: auto; overflow: visible; margin: 0 auto; }
.chart .gl { stroke: var(--line); }
.chart .ax { fill: var(--faint); font-size: 11px; font-family: inherit; }
.chart .l1 { stroke: var(--acc); fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart .l2 { stroke: var(--warm); fill: none; stroke-width: 2.5; stroke-dasharray: 5 5; stroke-linecap: round; }
.chart .a1 { fill: url(#kfa); }
.chart .d1 { fill: var(--acc); stroke: var(--card); stroke-width: 2.5; }
.chart .d2 { fill: var(--warm); stroke: var(--card); stroke-width: 2.5; }
.legend { display: flex; gap: 16px; font-size: 13.5px; color: var(--mute); margin-bottom: 10px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 18px; height: 4px; border-radius: 3px; vertical-align: 3px; margin-inline-end: 6px; background: var(--acc); }
.legend i.w { background: repeating-linear-gradient(90deg, var(--warm) 0 5px, transparent 5px 9px); }
.empty { text-align: center; padding: 26px 16px; color: var(--mute); }
.empty svg { width: 42px; height: 42px; margin: 0 auto 10px; color: var(--faint); }
.empty b { display: block; color: var(--text); font-size: 16.5px; margin-bottom: 4px; }

/* ---------- the keyboard ---------- */
.kbd { direction: ltr; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 20px; background: var(--sunk); border: 1px solid var(--line); user-select: none; width: 100%; max-width: 820px; margin: 0 auto; }
.krow { display: flex; gap: 6px; }
.krow.r1 { padding-left: 2.6%; } .krow.r2 { padding-left: 5.6%; }
.key { position: relative; flex: 1; aspect-ratio: 1 / .92; min-width: 0; border-radius: 10px; background: linear-gradient(180deg, var(--key-top), var(--key)); border: 1px solid var(--line2);
  box-shadow: 0 4px 0 var(--key-edge); display: flex; flex-direction: column; align-items: center; justify-content: center; transition: transform .08s, box-shadow .08s, background .15s, border-color .15s; }
.key .he { font-size: clamp(14px, 2.6vw, 22px); font-weight: 800; color: var(--key-text); line-height: 1; }
.key .en { position: absolute; top: 4px; left: 6px; font-size: clamp(8px, 1.2vw, 11px); color: var(--faint); font-weight: 700; }
.key::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: 5px; height: 3px; border-radius: 3px; background: var(--f, transparent); opacity: .85; }
.key.bump .he::after { content: ''; display: block; width: 12px; height: 2.5px; border-radius: 2px; background: var(--key-text); opacity: .55; margin: 5px auto 0; }
.key.space { flex: 6.2; aspect-ratio: auto; height: auto; min-height: clamp(30px, 5vw, 44px); }
.krow.r3 { padding-left: 21%; padding-right: 21%; }
.kbd.colored .key { --f: var(--fc); }
.kbd.colored .key.dim { opacity: .38; }
.key.fresh { border-color: color-mix(in srgb, var(--warm) 70%, transparent); box-shadow: 0 4px 0 var(--key-edge), 0 0 0 2px color-mix(in srgb, var(--warm) 25%, transparent); }
.key.next { background: linear-gradient(180deg, color-mix(in srgb, var(--fc, var(--acc)) 55%, var(--key-top)), color-mix(in srgb, var(--fc, var(--acc)) 35%, var(--key))); border-color: var(--fc, var(--acc));
  box-shadow: 0 4px 0 var(--key-edge), 0 0 22px -2px color-mix(in srgb, var(--fc, var(--acc)) 70%, transparent); }
.key.next .he { color: #fff; }
.key.hit { transform: translateY(3px); box-shadow: 0 1px 0 var(--key-edge); }
.key.miss { background: var(--err); border-color: var(--err); }
.key.miss .he { color: #fff; }
.key.pulse { animation: kp 1.4s ease-in-out infinite; }
@keyframes kp { 50% { box-shadow: 0 4px 0 var(--key-edge), 0 0 0 6px color-mix(in srgb, var(--warm) 30%, transparent); border-color: var(--warm); } }
.key .heat { position: absolute; inset: 0; border-radius: inherit; opacity: .9; }
.kbd.heat .key { --f: transparent; }
.fingers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; font-size: 13.5px; color: var(--soft); margin-top: 12px; }
.fingers span { display: inline-flex; align-items: center; gap: 6px; }
.fingers i { width: 11px; height: 11px; border-radius: 4px; background: var(--fc); }

/* ---------- full-screen views (guide, typing, results) ---------- */
.view { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; width: min(980px, 100%); margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom)); animation: fadeIn .2s ease both; }
.vtop { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.vtop .tt { flex: 1; min-width: 0; }
.vtop .tt b { display: block; font-size: 17.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vtop .tt span { color: var(--mute); font-size: 13.5px; }

/* guide */
.steps-dots { display: flex; gap: 6px; justify-content: center; margin: 6px 0 18px; }
.steps-dots i { width: 8px; height: 8px; border-radius: 8px; background: var(--line2); transition: width .25s, background .25s; }
.steps-dots i.on { width: 26px; background: var(--acc); }
.gstep { flex: 1; display: flex; flex-direction: column; gap: 18px; animation: fadeIn .25s ease both; }
.gstep .gh { text-align: center; max-width: 620px; margin: 0 auto; }
.gstep .gh .gicon { margin: 0 auto 14px; width: 64px; height: 64px; border-radius: 20px; }
.gstep .gh .gicon svg { width: 32px; height: 32px; }
.gstep h2 { margin: 0 0 8px; font-size: clamp(24px, 4.6vw, 32px); line-height: 1.2; letter-spacing: -.4px; }
.gstep p { margin: 0; color: var(--soft); font-size: 17px; }
.rules { display: grid; gap: 10px; max-width: 620px; width: 100%; margin: 0 auto; }
.rule { display: flex; gap: 14px; align-items: flex-start; padding: 15px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.rule .n { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--acc-wash); color: var(--acc); flex: none; }
.rule b { display: block; font-size: 16.5px; }
.rule span { color: var(--mute); font-size: 15px; }
.gnav { display: flex; gap: 10px; margin-top: auto; padding-top: 18px; max-width: 620px; width: 100%; margin-inline: auto; }
.gnav .btn-main { flex: 1; }
.path { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; max-width: 620px; width: 100%; margin: 0 auto; align-items: end; }
.path div { border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--acc), var(--acc2)); opacity: .85; position: relative; }
.path span { position: absolute; top: -21px; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 800; color: var(--mute); }
.path b { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 800; color: var(--ink); }

/* typing */
.tstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ts { padding: 10px 12px; border-radius: 15px; background: var(--card); border: 1px solid var(--line); }
.ts > span { display: block; font-size: 12px; color: var(--mute); font-weight: 700; }
.ts b { display: block; text-align: right; font-size: 22px; font-weight: 800; line-height: 1.15; }
.ts b.good { color: var(--acc); } .ts b.bad { color: var(--err); }
.tprog { height: 6px; border-radius: 6px; background: var(--sunk); overflow: hidden; margin-bottom: 14px; }
.tprog i { display: block; height: 100%; background: linear-gradient(270deg, var(--acc2), var(--acc)); border-radius: 6px; transition: width .15s; }
.paper { position: relative; border-radius: 22px; background: var(--card); border: 1px solid var(--line2); padding: 18px 20px; cursor: text; box-shadow: var(--shadow); }
.paper.focus { border-color: var(--acc-line); }
.txt { --fs: 30px; font-size: var(--fs); line-height: 1.75; height: calc(var(--fs) * 1.75 * 3); overflow: hidden; white-space: pre-wrap; word-break: break-word; font-weight: 600; color: var(--faint); letter-spacing: .4px; scroll-behavior: smooth; }
.txt.s { --fs: 24px; } .txt.l { --fs: 37px; }
.txt span { border-radius: 6px; transition: color .1s, background .1s; }
.txt .ok { color: var(--text); }
.txt .fix { color: var(--warm); }
.txt .bad { color: var(--err); background: var(--err-wash); text-decoration: underline wavy; text-decoration-thickness: 1.5px; text-underline-offset: 6px; }
.txt .cur { color: var(--text); background: var(--acc-wash); box-shadow: inset 0 -3px 0 var(--acc); animation: blink 1.05s steps(1) infinite; }
.txt .cur.sp { box-shadow: inset 0 -3px 0 var(--acc); }
.txt .cur.wr { background: var(--err-wash); box-shadow: inset 0 -3px 0 var(--err); color: var(--err); animation: shake .25s ease; }
@keyframes blink { 50% { box-shadow: inset 0 -3px 0 transparent; } }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.txt span { display: inline; }
.next-hint { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 40px; margin: 12px 0 10px; font-size: 15.5px; color: var(--soft); flex-wrap: wrap; }
.next-hint .kc { min-width: 36px; height: 36px; padding: 0 8px; border-radius: 10px; display: inline-grid; place-items: center; font-weight: 800; font-size: 19px; background: var(--key); border: 1px solid var(--line2); box-shadow: 0 3px 0 var(--key-edge); }
.next-hint .fd { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.next-hint .fd i { width: 12px; height: 12px; border-radius: 4px; background: var(--fc); }
.ready { position: absolute; inset: 0; border-radius: inherit; display: grid; place-items: center; text-align: center; padding: 16px; background: color-mix(in srgb, var(--card) 86%, transparent); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.ready b { display: block; font-size: 20px; margin-bottom: 4px; }
.ready span { color: var(--mute); font-size: 15px; }
.ready .tap { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 9px 16px; border-radius: 99px; background: var(--acc-wash); color: var(--acc); font-weight: 800; font-size: 14.5px; }
.ready .tap svg { width: 18px; height: 18px; }
.paused-note { color: var(--warm); }
.kbd-wrap { margin-top: auto; padding-top: 6px; }
/* the phone's own keyboard is open (the screen got short): the on-screen one steps aside, the hint stays */
@media (max-height: 600px) and (pointer: coarse) { .kbd-wrap { display: none; } .tstats { margin-bottom: 8px; } .ts { padding: 6px 9px; } .next-hint { margin: 8px 0 0; } .vtop { margin-bottom: 8px; } }
.kin { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; resize: none; pointer-events: none; caret-color: transparent; font-size: 16px; }

/* results */
.res-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; align-items: stretch; }
.gauge-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 20px 18px 18px; }
.gauge { width: 100%; max-width: 340px; }
.gauge svg { width: 100%; height: auto; overflow: visible; }
.gauge .g-trk { stroke: var(--sunk); }
.gauge .g-bar { stroke: url(#kfg2); transition: stroke-dashoffset 1.3s cubic-bezier(.2,.8,.2,1); }
.gauge .g-tick { stroke: var(--faint); }
.gauge .g-lab { fill: var(--mute); font-size: 11px; font-weight: 700; font-family: inherit; }
.gauge .g-needle { transform-box: view-box; transform-origin: 150px 150px; transition: transform 1.3s cubic-bezier(.3,1.3,.4,1); }
.gauge .g-goal { stroke: var(--warm); stroke-width: 3; }
.g-val { margin-top: 2px; position: relative; }
.g-val b { display: block; font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.g-val > span { display: block; color: var(--mute); font-size: 14.5px; font-weight: 700; margin-top: 4px; }
.verdict { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; font-weight: 800; font-size: 15px; }
.verdict svg { width: 18px; height: 18px; }
.verdict.ok { color: var(--acc); background: var(--acc-wash); }
.verdict.no { color: var(--warm); background: var(--warm-wash); }
.pcts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pct { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 14px 8px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.pct .ring { width: 92px; height: 92px; }
.pct .ring .in b { font-size: 21px; }
.pct .lbl { margin-top: 8px; font-weight: 800; font-size: 14.5px; }
.pct .sub { color: var(--mute); font-size: 12.5px; }
.pct.err .ring .bar { stroke: var(--err); }
.pct.warm .ring .bar { stroke: var(--warm); }
.rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.row-stat { padding: 13px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.row-stat > span { display: block; color: var(--mute); font-size: 12.5px; font-weight: 700; }
.row-stat b { display: block; font-size: 20px; font-weight: 800; }
.delta { font-size: 13px; font-weight: 800; margin-inline-start: 6px; }
.delta.up { color: var(--acc); } .delta.down { color: var(--err); }
.weak { display: flex; flex-wrap: wrap; gap: 8px; }
.weak .wk { display: inline-flex; align-items: center; gap: 9px; padding: 7px 12px 7px 7px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 14px; color: var(--mute); }
.weak .wk .kc { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: var(--err); background: var(--err-wash); }
.res-acts { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 6px; }
.res-acts .btn-main { flex: 1 1 220px; }
.celebrate { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; margin-bottom: 14px; background: linear-gradient(135deg, var(--acc-wash), var(--card) 70%); border: 1px solid var(--acc-line); }
.celebrate svg { width: 30px; height: 30px; color: var(--warm); flex: none; }
.celebrate b { display: block; font-size: 16.5px; }
.celebrate span { color: var(--mute); font-size: 14px; }

/* ---------- settings ---------- */
.group { margin-bottom: 18px; }
.group h3 { margin: 0 4px 10px; font-size: 14px; color: var(--mute); font-weight: 800; letter-spacing: .2px; }
.list { border-radius: 20px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 62px; width: 100%; text-align: start; color: inherit; }
.item + .item { border-top: 1px solid var(--line); }
.item .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--sunk); color: var(--acc); flex: none; }
.item .ic svg { width: 20px; height: 20px; }
.item .tx { flex: 1; min-width: 0; }
.item .tx b { display: block; font-size: 16px; font-weight: 700; }
.item .tx span { display: block; color: var(--mute); font-size: 13.5px; line-height: 1.35; }
button.item:hover, a.item:hover { background: color-mix(in srgb, var(--raised) 60%, transparent); text-decoration: none; }
.item.danger .ic { color: var(--err); background: var(--err-wash); }
.item.danger b { color: var(--err); }
.item .chev { color: var(--faint); } .item .chev svg { width: 20px; height: 20px; transform: scaleX(-1); }
.item .val { color: var(--mute); font-size: 14.5px; font-weight: 700; }
/* switch (a styled checkbox; the real input stays for keyboards and screen readers) */
.sw { position: relative; width: 52px; height: 31px; flex: none; }
.sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; appearance: none; -webkit-appearance: none; }
.sw i { position: absolute; inset: 0; border-radius: 99px; background: var(--sunk); border: 1px solid var(--line2); transition: background .2s, border-color .2s; }
.sw i::after { content: ''; position: absolute; top: 3px; right: 3px; width: 23px; height: 23px; border-radius: 50%; background: var(--mute); transition: transform .22s cubic-bezier(.3,1.4,.5,1), background .2s; }
.sw input:checked + i { background: var(--acc); border-color: transparent; }
.sw input:checked + i::after { transform: translateX(-21px); background: #fff; }
.sw input:focus-visible + i { outline: 2.5px solid var(--warm); outline-offset: 3px; }
/* segmented choice */
.seg { display: inline-flex; padding: 4px; gap: 3px; border-radius: 13px; background: var(--sunk); border: 1px solid var(--line); flex: none; }
.seg button { min-width: 44px; height: 34px; padding: 0 11px; border-radius: 10px; font-weight: 800; font-size: 14px; color: var(--mute); transition: .18s; }
.seg button.on { background: var(--raised); color: var(--text); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
/* slider (styled) */
.slider { display: flex; align-items: center; gap: 12px; padding: 4px 16px 16px; }
.slider .track { position: relative; flex: 1; height: 34px; touch-action: none; cursor: pointer; }
.slider .track::before { content: ''; position: absolute; left: 0; right: 0; top: 15px; height: 5px; border-radius: 5px; background: var(--sunk); }
.slider .fill { position: absolute; right: 0; top: 15px; height: 5px; border-radius: 5px; background: linear-gradient(270deg, var(--acc2), var(--acc)); }
.slider .thumb { position: absolute; top: 5px; width: 24px; height: 24px; margin-right: -12px; border-radius: 50%; background: #fff; border: 4px solid var(--acc); box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.slider .track:focus-visible { outline: 2.5px solid var(--warm); outline-offset: 2px; border-radius: 8px; }
.slider output { min-width: 82px; text-align: center; font-weight: 800; color: var(--acc); }
.share-box { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 16px; }
.share-box button { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 6px; border-radius: 16px; background: var(--sunk); border: 1px solid var(--line); font-weight: 700; font-size: 14px; color: var(--soft); transition: .2s; }
.share-box button:hover { border-color: var(--acc-line); color: var(--text); }
.share-box button svg { width: 26px; height: 26px; color: var(--acc); }
.share-box button.wa svg { color: #25D366; }

/* ---------- toast, sheet, modal ---------- */
.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; max-width: min(440px, calc(100% - 32px)); padding: 12px 18px; border-radius: 16px; font-weight: 700; font-size: 15px;
  background: var(--raised); color: var(--text); border: 1px solid var(--acc-line); box-shadow: 0 18px 40px -14px rgba(0,0,0,.7); transition: opacity .2s, transform .25s cubic-bezier(.3,1.3,.5,1); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 19px; height: 19px; color: var(--acc); flex: none; }
.layer { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; background: rgba(4,8,14,.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fadeIn .18s ease both; }
.sheet { width: min(520px, 100%); max-height: 92vh; overflow: auto; background: var(--card); border: 1px solid var(--line2); border-radius: 26px 26px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); animation: up .26s cubic-bezier(.2,.9,.3,1) both; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.sheet .grab { width: 44px; height: 5px; border-radius: 5px; background: var(--line2); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 6px; font-size: 22px; }
.sheet p { margin: 0 0 16px; color: var(--soft); }
.sheet .acts { display: flex; gap: 10px; margin-top: 18px; }
.sheet .acts .btn { flex: 1; }
@media (min-width: 700px) { .layer { align-items: center; } .sheet { border-radius: 26px; padding-bottom: 22px; } }
.field { display: block; margin-top: 6px; }
.field input { width: 100%; height: 54px; padding: 0 16px; border-radius: 15px; border: 1px solid var(--line2); background: var(--sunk); font-size: 18px; font-weight: 700; caret-color: var(--acc); transition: border-color .2s; }
.field input:focus { border-color: var(--acc); outline: none; }
.field input::placeholder { color: var(--faint); font-weight: 600; }
.field .err { display: block; color: var(--err); font-size: 13.5px; font-weight: 700; margin-top: 6px; min-height: 18px; }
.colors { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.colors button { width: 40px; height: 40px; border-radius: 13px; border: 3px solid transparent; transition: transform .15s; }
.colors button.on { border-color: var(--text); transform: scale(1.08); }
.intro-keys { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 6px 0 14px; }
.ik { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--mute); }
.ik .kc { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 25px; font-weight: 800; background: var(--key); border: 2px solid var(--fc); box-shadow: 0 4px 0 var(--key-edge); color: var(--key-text); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.facts span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 99px; background: var(--sunk); border: 1px solid var(--line); font-size: 14px; color: var(--soft); font-weight: 700; }
.facts svg { width: 16px; height: 16px; color: var(--acc); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .res-hero { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .page { padding-inline: 14px; }
  .hero { grid-template-columns: 1fr; padding: 20px; }
  .hero .ring { position: absolute; top: 18px; left: 18px; width: 84px; height: 84px; }
  .hero .ring .in b { font-size: 21px; } .hero .ring .in span { font-size: 11px; }
  .hero h1 { padding-left: 92px; } .hello { padding-left: 92px; }
  .hero .acts .btn { flex: 1; }
  .stages { grid-template-columns: 1fr; }
  .stage { min-height: 0; }
  .ach { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tstats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .ts { padding: 8px 9px; } .ts b { font-size: 18px; } .ts span { font-size: 11px; }
  .paper { padding: 14px 14px; }
  .txt { --fs: 24px; } .txt.s { --fs: 20px; } .txt.l { --fs: 29px; }
  .kbd { padding: 7px; gap: 4px; border-radius: 14px; } .krow { gap: 4px; }
  .key { border-radius: 7px; box-shadow: 0 3px 0 var(--key-edge); } .key .en { display: none; }
  .key::after { bottom: 3px; height: 2px; }
  .test-card { flex-wrap: wrap; } .test-card .btn { width: 100%; }
  .share-box { padding: 12px; gap: 8px; }
  .pct .ring { width: 80px; height: 80px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
