/* ЙЦУКЕН — тренажёр слепой печати. Light, friendly, keyboard-themed. */

:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1d2433;
  --ink-2: #3a4356;
  --muted: #6b7489;
  --line: #e2e6ef;
  --line-2: #cfd5e2;
  --accent: #5146e8;
  --accent-dark: #3a30c4;
  --accent-soft: #ecebff;
  --accent-ring: rgba(81, 70, 232, 0.55);
  --focus: #ff9f1c;
  --ok: #23955d;
  --ok-soft: #e3f6ec;
  --bad: #e5484d;
  --bad-soft: #ffe1e1;
  --warn-soft: #fff4d6;
  --gold: #ffb400;
  --gold-dark: #e09a00;

  /* finger colours: pinky / ring / middle / index; left & right index differ so the
     border between the hands stays visible in the middle of the keyboard */
  --c-lp: #f8c4d8;
  --c-lr: #ffe09c;
  --c-lm: #bfeac0;
  --c-li: #b3dbff;
  --c-ri: #d7caff;
  --c-rm: #bfeac0;
  --c-rr: #ffe09c;
  --c-rp: #f8c4d8;
  --c-th: #e9ecf3;
  --c-mod: #eef0f5;

  --radius: 18px;
  --shadow: 0 1px 2px rgba(22, 30, 60, 0.06), 0 8px 24px rgba(22, 30, 60, 0.08);
  --shadow-lg: 0 2px 4px rgba(22, 30, 60, 0.06), 0 18px 48px rgba(22, 30, 60, 0.14);
  --font: 'Roboto', system-ui, 'Segoe UI', 'Noto Sans', 'DejaVu Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Cousine', 'Roboto Mono', 'DejaVu Sans Mono', ui-monospace, monospace;
  --u: 44px;
  color-scheme: light;
}

.f-lp { --fc: var(--c-lp); }
.f-lr { --fc: var(--c-lr); }
.f-lm { --fc: var(--c-lm); }
.f-li { --fc: var(--c-li); }
.f-ri { --fc: var(--c-ri); }
.f-rm { --fc: var(--c-rm); }
.f-rr { --fc: var(--c-rr); }
.f-rp { --fc: var(--c-rp); }
.f-th { --fc: var(--c-th); }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at -10% -20%, #e6e3ff 0, rgba(230, 227, 255, 0) 60%),
    radial-gradient(900px 500px at 110% -10%, #fff0d4 0, rgba(255, 240, 212, 0) 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
body.is-play { overflow: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; font-weight: 800; }
p { margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
kbd {
  display: inline-block;
  min-width: 1.8em;
  padding: 0.05em 0.45em;
  border-radius: 0.4em;
  background: #fff;
  border: 1px solid var(--line-2);
  box-shadow: inset 0 -2px 0 var(--line-2);
  font: 600 0.88em var(--font);
  text-align: center;
  color: var(--ink);
}

/* ---------- buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 44px;
  padding: 0.6em 1.15em;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s;
}
.btn-primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 0 var(--accent-dark), 0 8px 20px rgba(81, 70, 232, 0.28);
}
.btn-primary:hover { background: #5e54f0; }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-dark), 0 4px 10px rgba(81, 70, 232, 0.2); }
.btn-ghost {
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 var(--line);
}
.btn-ghost:hover { background: #f8f9fd; }
.btn-ghost:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px var(--line), 0 1px 0 var(--line); }
.btn-big { font-size: 1.12rem; padding: 0.75em 1.5em; border-radius: 16px; min-height: 52px; }
.btn-link { background: none; color: var(--accent); padding: 0.4em 0.6em; min-height: 40px; }
.btn-link:hover { text-decoration: underline; }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.row-buttons { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--bg);
  font-size: 18px;
  cursor: pointer;
  color: var(--ink-2);
}
.icon-btn:hover { background: var(--accent-soft); }

/* ---------- inputs ------------------------------------------------------------- */
.input {
  width: 100%;
  padding: 0.65em 0.85em;
  border: 2px solid var(--line-2);
  border-radius: 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input-big { font-size: 1.3rem; font-weight: 600; }
.input-code { text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--mono); }
.label { display: block; font-weight: 700; margin: 14px 0 6px; color: var(--ink-2); }
.form-error { min-height: 1.5em; color: var(--bad); font-weight: 600; margin: 8px 0 4px; }

/* ---------- layout --------------------------------------------------------------- */
.screen { min-height: 100vh; }
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page-main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 4px 24px 48px; }
.page-center { align-items: center; justify-content: center; padding: 24px 16px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.page-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 8px 0 18px; }

.loading { display: flex; gap: 12px; align-items: center; justify-content: center; min-height: 60vh; color: var(--muted); font-weight: 600; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-card { max-width: 460px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.error-emoji { font-size: 56px; }

/* ---------- header ----------------------------------------------------------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px 10px;
}
.logo { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.logo-keys { display: inline-flex; gap: 3px; }
.logo-key {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 29px;
  border-radius: 7px;
  background: var(--fc);
  font-weight: 800;
  font-size: 15px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}
.logo-sub { font-size: 12.5px; line-height: 1.15; color: var(--muted); max-width: 8em; font-weight: 600; }
.logo-big .logo-key { width: 46px; height: 50px; border-radius: 11px; font-size: 26px; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.12); }
.logo-big .logo-keys { gap: 6px; }
.logo-big { flex-direction: column; gap: 10px; }
.logo-big .logo-sub { max-width: none; font-size: 15px; }
.header-right { display: flex; align-items: center; gap: 14px; }
.nav { display: flex; gap: 4px; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--ink-2);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
.nav-link:hover { background: rgba(81, 70, 232, 0.08); }
.nav-link.active { background: #fff; color: var(--accent); box-shadow: var(--shadow); }
.nav-icon { font-size: 16px; }
.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 6px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  max-width: 220px;
}
.chip-avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); font-size: 20px; }
.chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- keycaps (mini) ---------------------------------------------------- */
.keycap {
  display: inline-grid;
  place-items: center;
  min-width: 2em;
  height: 2.05em;
  padding: 0 0.35em;
  border-radius: 0.42em;
  background: var(--fc, var(--c-mod));
  color: var(--ink);
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 -0.16em 0 rgba(0, 0, 0, 0.13), 0 1px 2px rgba(0, 0, 0, 0.08);
}
.keycap-xs { font-size: 12px; }
.keycap-sm { font-size: 15px; }
.keycap-md { font-size: 22px; }
.keycap-lg { font-size: 38px; border-radius: 0.3em; }

/* ---------- stars ------------------------------------------------------------ */
.stars { display: inline-flex; gap: 1px; line-height: 1; white-space: nowrap; }
.star { font-size: 1.05em; }
.star.on { color: var(--gold); text-shadow: 0 1px 0 var(--gold-dark); }
.star.off { color: #c9cfdb; }

/* ---------- who is typing ---------------------------------------------------------- */
.who-page { gap: 26px; }
.who-logo { text-align: center; }
.who-card { width: min(720px, 100%); padding: 30px 32px; }
.who-title { text-align: center; margin-bottom: 22px; font-size: 1.8rem; }
.who-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.who-grid .who-tile { width: 150px; }
.who-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 10px 16px;
  border: 0;
  border-radius: 18px;
  background: var(--bg);
  font: inherit;
  cursor: pointer;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--line);
  transition: transform 0.12s, box-shadow 0.12s, background-color 0.12s;
}
.who-tile:hover { transform: translateY(-3px); background: #fff; box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.who-avatar { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: #fff; font-size: 44px; box-shadow: var(--shadow); }
.who-plus { background: var(--accent-soft); color: var(--accent); font-size: 40px; font-weight: 700; box-shadow: none; }
.who-name { font-weight: 800; font-size: 1.1rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-new .who-name { color: var(--accent); }
.who-footer { display: flex; justify-content: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.new-form .who-title, .code-form .who-title { margin-bottom: 10px; }
.new-name-row { display: flex; align-items: flex-end; gap: 16px; }
.new-name-row .field { flex: 1; }
.new-preview { display: grid; place-items: center; width: 72px; height: 72px; flex: none; border-radius: 50%; background: var(--accent-soft); font-size: 42px; }
.avatar-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; }
.avatar-option {
  aspect-ratio: 1;
  border: 0;
  border-radius: 14px;
  background: var(--bg);
  font-size: 28px;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px transparent;
  transition: transform 0.1s, box-shadow 0.1s;
}
.avatar-option:hover { transform: scale(1.08); }
.avatar-option.selected { background: var(--accent-soft); box-shadow: inset 0 0 0 3px var(--accent); }
.new-form .row-buttons, .code-form .row-buttons { justify-content: center; margin-top: 6px; }
.code-form .muted { text-align: center; margin-bottom: 8px; }

/* ---------- level map ------------------------------------------------------------ */
.hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px 22px;
  margin-bottom: 16px;
}
.hero-who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hero-avatar { display: grid; place-items: center; width: 66px; height: 66px; flex: none; border-radius: 50%; background: var(--accent-soft); font-size: 38px; }
.hero-name { font-size: 1.6rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 9em; }
.hero-hello { font-size: 0.95rem; }
.hero-stats { display: flex; gap: 20px; justify-content: center; flex-wrap: nowrap; }
.hero-stat, .goal { display: flex; align-items: center; gap: 10px; }
.hero-stat > div, .goal-text { display: flex; flex-direction: column; line-height: 1.2; }
.hero-stat .muted, .goal-text .muted { font-size: 0.85rem; }
.hero-stat-icon { font-size: 30px; width: 44px; text-align: center; }
.star-icon { color: var(--gold); text-shadow: 0 2px 0 var(--gold-dark); font-size: 34px; }
.goal-ring-wrap { position: relative; width: 48px; height: 48px; }
.goal-ring { width: 48px; height: 48px; display: block; }
.goal-track { fill: none; stroke: var(--line); stroke-width: 7; }
.goal-fill { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray 0.6s; }
.goal-fill.done { stroke: var(--ok); }
.goal-num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.hero-go { flex-direction: column; gap: 2px; padding: 0.6em 1.6em; }
.hero-go-sub { font-size: 0.8rem; font-weight: 600; opacity: 0.85; max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.weak-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  margin-bottom: 18px;
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(90deg, #fff 0, #fff7e8 100%);
  transition: transform 0.12s, box-shadow 0.12s;
}
.weak-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.weak-card > div { display: flex; flex-direction: column; flex: 1; }
.weak-icon { font-size: 30px; }
.weak-go { font-size: 24px; color: var(--accent); font-weight: 800; }

.stage { margin: 22px 0 6px; }
.stage-head { display: flex; align-items: baseline; gap: 12px; margin: 0 4px 10px; flex-wrap: wrap; }
.stage-title { font-size: 1.3rem; }
.stage-sub { flex: 1; }
.stage-stars { font-weight: 800; color: var(--gold-dark); }
.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 12px; }
/* every stage has at most 7 levels: on wide screens use exactly 7 columns so the rows fill the page */
@media (min-width: 1100px) { .level-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.level-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 132px;
  padding: 12px 12px 12px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.level-card.open:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.level-card.done { background: linear-gradient(180deg, #fff 0, #f2fbf6 100%); }
.level-card.perfect { background: linear-gradient(180deg, #fff 0, #fff8e5 100%); }
.level-card.next { box-shadow: 0 0 0 3px var(--accent), var(--shadow-lg); }
.level-card.locked { background: rgba(255, 255, 255, 0.55); box-shadow: inset 0 0 0 2px var(--line); color: var(--muted); }
.level-card.locked .keycap { filter: grayscale(1); opacity: 0.45; }
.level-card.locked .card-badge { filter: grayscale(1); opacity: 0.45; }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-num {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--bg);
  font-weight: 800;
  font-size: 14px;
  color: var(--ink-2);
}
.level-card.next .card-num { background: var(--accent); color: #fff; }
.level-card.done .card-num { background: var(--ok-soft); color: var(--ok); }
.card-stars { font-size: 18px; }
.lock { font-size: 16px; opacity: 0.7; }
.card-keys { display: flex; flex-wrap: wrap; gap: 4px; min-height: 34px; align-items: center; margin-top: 4px; }
.card-badge { display: inline-grid; place-items: center; height: 32px; min-width: 32px; padding: 0 6px; border-radius: 8px; background: var(--bg); font-size: 18px; font-weight: 800; }
.card-title { font-weight: 800; font-size: 1.02rem; line-height: 1.2; }
.card-sub { font-size: 0.82rem; color: var(--muted); line-height: 1.25; text-wrap: balance; }
.card-next-btn {
  align-self: flex-start;
  margin-top: auto;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 3px 0 var(--accent-dark);
}
.card-partial { margin-top: auto; font-size: 0.8rem; font-weight: 700; color: var(--accent); }

/* ---------- level intro --------------------------------------------------------- */
.intro-main { padding-bottom: 16px; }
.intro-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 26px; padding: 18px 26px; margin-bottom: 14px; }
.intro-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.intro-kicker { font-weight: 700; color: var(--muted); font-size: 0.9rem; }
.back-link { font-weight: 700; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.intro-keys { display: flex; gap: 8px; flex-wrap: wrap; max-width: 300px; justify-content: center; }
.intro-badge { display: grid; place-items: center; width: 76px; height: 78px; border-radius: 16px; background: var(--bg); font-size: 40px; font-weight: 800; }
.intro-title { font-size: 2rem; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.intro-sub { font-size: 1.05rem; font-weight: 700; color: var(--muted); }
.intro-text { font-size: 1.06rem; line-height: 1.5; max-width: 50em; color: var(--ink-2); }
.intro-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.intro-target { font-size: 0.85rem; line-height: 1.3; }
.intro-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.ex-card { padding: 16px 14px; }
.ex-head { margin: 0 6px 8px; font-size: 1.1rem; }
.ex-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ex-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  transition: background-color 0.12s;
}
.ex-item:hover { background: var(--bg); }
.ex-item.current { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.ex-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--bg); font-size: 14px; color: var(--ink-2); }
.ex-item.passed .ex-num { background: var(--ok-soft); color: var(--ok); }
.ex-item.current .ex-num { background: var(--accent); color: #fff; }
.ex-title { flex: 1; }
.ex-stars { font-size: 17px; }
.intro-visual { container-type: inline-size; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 4px; }
.intro-visual > * { --u: max(28px, min(calc(100cqw / 17.2), calc((100vh - 325px) / 8.9), 50px)); }
.help-visual > *, .heat-card > .kb-wrap { --u: min(calc(100cqw / 17.2), 46px); }

/* ---------- keyboard picture ---------------------------------------------------- */
.kb-wrap { width: 100%; display: flex; justify-content: center; }
.kb {
  --gap: calc(var(--u) * 0.09);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  width: max-content;
  padding: calc(var(--u) * 0.22);
  border-radius: calc(var(--u) * 0.32);
  background: linear-gradient(180deg, #e3e7f0 0, #d6dbe6 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(22, 30, 60, 0.08), 0 10px 28px rgba(22, 30, 60, 0.12);
  user-select: none;
}
.kb-row { display: flex; gap: var(--gap); }
.key {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: none;
  width: calc(var(--w) * (var(--u) + var(--gap)) - var(--gap));
  height: var(--u);
  border-radius: calc(var(--u) * 0.17);
  background: var(--fc);
  color: var(--ink);
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 calc(var(--u) * -0.075) 0 rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.1);
  transition: transform 0.08s, opacity 0.2s, filter 0.2s, background-color 0.15s;
}
.key .k-ru { font-size: calc(var(--u) * 0.44); }
.key .k-en {
  position: absolute;
  top: calc(var(--u) * 0.08);
  left: calc(var(--u) * 0.11);
  font-size: calc(var(--u) * 0.21);
  font-weight: 600;
  color: rgba(29, 36, 51, 0.42);
}
.key.sym { gap: calc(var(--u) * 0.04); }
.key.sym .k-ru { font-size: calc(var(--u) * 0.34); }
.key.sym .k-shift { font-size: calc(var(--u) * 0.24); color: rgba(29, 36, 51, 0.62); }
.key.sym .k-en { top: auto; bottom: calc(var(--u) * 0.08); left: calc(var(--u) * 0.1); }
.key.mod { --fc: var(--c-mod); }
.key.mod .k-label { font-size: calc(var(--u) * 0.24); font-weight: 600; color: var(--muted); }
.key.search .k-label { font-size: calc(var(--u) * 0.32); }
.key.space .k-label { font-size: calc(var(--u) * 0.24); font-weight: 600; color: rgba(29, 36, 51, 0.5); }
.k-bump {
  position: absolute;
  bottom: calc(var(--u) * 0.13);
  left: 50%;
  width: calc(var(--u) * 0.28);
  height: calc(var(--u) * 0.055);
  min-height: 2px;
  border-radius: 2px;
  background: rgba(29, 36, 51, 0.5);
  transform: translateX(-50%);
}
.key.unlearned { opacity: 0.4; filter: saturate(0.35); }
.key.mod-off { opacity: 0.7; }
.key.glow {
  opacity: 1;
  filter: none;
  z-index: 1;
  box-shadow: 0 0 0 calc(var(--u) * 0.06) var(--accent), 0 0 calc(var(--u) * 0.4) rgba(81, 70, 232, 0.45), inset 0 calc(var(--u) * -0.075) 0 rgba(0, 0, 0, 0.12);
  animation: glow 1.8s ease-in-out infinite;
}
.key.target, .key.target-shift {
  opacity: 1;
  filter: none;
  z-index: 2;
  transform: translateY(calc(var(--u) * -0.04));
  box-shadow: 0 0 0 calc(var(--u) * 0.07) var(--accent), inset 0 calc(var(--u) * -0.075) 0 rgba(0, 0, 0, 0.12);
  animation: target-pulse 1.1s ease-out infinite;
}
.key.target .k-ru { color: #000; }
.key.pressed { transform: translateY(calc(var(--u) * 0.04)) scale(0.97); filter: brightness(0.92); }
.key.wrong {
  z-index: 3;
  background: var(--bad) !important;
  color: #fff;
  opacity: 1;
  filter: none;
  animation: wrong-key 0.42s ease-out;
}
.key.wrong .k-en, .key.wrong .k-shift, .key.wrong .k-label { color: rgba(255, 255, 255, 0.8); }
@keyframes target-pulse {
  0% { box-shadow: 0 0 0 calc(var(--u) * 0.07) var(--accent), 0 0 0 calc(var(--u) * 0.07) var(--accent-ring), inset 0 calc(var(--u) * -0.075) 0 rgba(0, 0, 0, 0.12); }
  100% { box-shadow: 0 0 0 calc(var(--u) * 0.07) var(--accent), 0 0 0 calc(var(--u) * 0.32) rgba(81, 70, 232, 0), inset 0 calc(var(--u) * -0.075) 0 rgba(0, 0, 0, 0.12); }
}
@keyframes glow {
  50% { box-shadow: 0 0 0 calc(var(--u) * 0.06) var(--accent), 0 0 calc(var(--u) * 0.15) rgba(81, 70, 232, 0.25), inset 0 calc(var(--u) * -0.075) 0 rgba(0, 0, 0, 0.12); }
}
@keyframes wrong-key {
  0% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* heat map */
.kb.heat .key.char { background: color-mix(in oklab, #fff1e6, #d93636 calc(var(--heat, 0) * 100%)); }
.kb.heat .key.char.heat-none { background: #f1f3f7; color: #9aa2b4; }
.kb.heat .key { cursor: default; }
.heat-legend { display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; font-size: 0.9rem; color: var(--muted); }
.heat-scale { width: 160px; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #fff1e6, #d93636); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
.heat-none-swatch { width: 18px; height: 12px; border-radius: 4px; background: #f1f3f7; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); margin-left: 12px; }
.heat-worst { text-align: center; margin-top: 10px; }

/* ---------- hands ----------------------------------------------------------------- */
.hands-wrap { display: flex; justify-content: center; width: 100%; }
.hands { display: block; width: calc(var(--u) * 16.7); height: auto; max-width: 100%; overflow: visible; }
.finger-body { fill: var(--fc); stroke: rgba(29, 36, 51, 0.3); stroke-width: 2.5; transition: opacity 0.2s; }
.finger-nail { fill: rgba(255, 255, 255, 0.6); }
.palm { stroke: rgba(29, 36, 51, 0.22); stroke-width: 2.5; }
.finger { transition: opacity 0.2s; }
.hands.has-active .finger { opacity: 0.55; }
.hands.has-active .finger.active { opacity: 1; }
.finger.active .finger-body { stroke: var(--accent); stroke-width: 5; filter: drop-shadow(0 0 7px rgba(81, 70, 232, 0.75)); }
.finger.active rect { animation: finger-bob 1.1s ease-in-out infinite; }
@keyframes finger-bob { 50% { transform: translateY(-14px); } }
.finger-caption { min-height: 1.4em; text-align: center; font-weight: 700; color: var(--ink-2); font-size: 1rem; }

/* ---------- typing screen ------------------------------------------------------------ */
.play {
  --fs: clamp(22px, 4.5vh, 40px);
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 20px 8px;
  max-width: 1500px;
  margin: 0 auto;
}
.play.no-kb.no-hands { --fs: clamp(26px, 6vh, 52px); }
.play.no-kb.no-hands .text-panel { margin-block: auto; }
.play.no-kb.no-hands .play-visual { display: none; }
.play-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 10px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  flex: none;
}
.play-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; max-width: 32%; }
.play-title strong { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-title .muted { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { flex: 1; height: 10px; border-radius: 5px; background: var(--bg); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); min-width: 60px; }
.progress-fill { height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, var(--accent), #7c73ff); transition: width 0.2s; }
.metrics { display: flex; gap: 6px; }
.metric { display: flex; align-items: baseline; gap: 4px; padding: 5px 10px; border-radius: 10px; background: var(--bg); min-width: 72px; justify-content: center; }
.metric-val { font-weight: 800; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.metric-unit { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.metric-err .metric-val { color: var(--bad); }

.text-panel {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 24px calc(var(--fs) * 0.32);
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.ex-hint { font-size: 0.88rem; font-weight: 700; color: var(--muted); min-height: 1.3em; }
.text-window {
  --lines: 3;
  position: relative;
  width: min(100%, 44ch);
  height: calc(var(--fs) * 1.55 * 3);
  overflow: hidden;
  font-family: var(--mono);
  font-size: var(--fs);
}
.text-inner { width: fit-content; max-width: 100%; margin: 0 auto; line-height: 1.55; transition: transform 0.25s ease; white-space: normal; }
.text-window.few-lines .text-inner { padding-top: calc((3 - var(--lines)) * 0.775em); }
.w { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; position: relative; border-radius: 0.14em; color: var(--ink); }
.ch.done { color: #6db38e; }
.ch.done.missed { color: #e58a3a; }
.ch.cur {
  color: #000;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent), inset 0 -0.13em 0 var(--accent);
}
.ch.sp.cur::after {
  content: '␣';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 0.9em;
}
.ch.err { background: var(--bad-soft); color: #c62828; box-shadow: inset 0 0 0 2px var(--bad), inset 0 -0.13em 0 var(--bad); animation: shake 0.35s; }
.ch.err.sp::after { color: var(--bad); }
.text-window.complete .ch { color: var(--ok); }
@keyframes shake {
  20% { transform: translateX(-0.12em); }
  40% { transform: translateX(0.12em); }
  60% { transform: translateX(-0.08em); }
  80% { transform: translateX(0.06em); }
}
.start-hint {
  position: absolute;
  left: 50%;
  bottom: -15px;
  z-index: 4;
  transform: translateX(-50%);
  padding: 5px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(81, 70, 232, 0.35);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.start-hint.gone { opacity: 0; transform: translate(-50%, 6px); }
.banners { position: absolute; top: -8px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 5; pointer-events: none; }
.banner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px 8px 16px;
  border-radius: 12px;
  background: #fff3c4;
  box-shadow: 0 0 0 2px #f5c542, var(--shadow-lg);
  font-weight: 700;
  pointer-events: auto;
  animation: drop-in 0.25s ease-out;
}
.banner-caps { background: #ffe3e3; box-shadow: 0 0 0 2px #f08b8b, var(--shadow-lg); padding-right: 16px; }
.banner-shift { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent), var(--shadow-lg); padding-right: 16px; font-weight: 600; }
.banner-close { margin-left: 8px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: rgba(0, 0, 0, 0.06); font-size: 18px; cursor: pointer; }
@keyframes drop-in { from { transform: translateY(-8px); opacity: 0; } }

.play-visual { flex: 1; min-height: 0; padding-top: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u, 40px) * 0.18); }
.play-visual .finger-caption { font-size: clamp(14px, 2.2vh, 18px); min-height: 1.4em; }

.pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(244, 246, 251, 0.72);
  backdrop-filter: blur(5px);
  cursor: pointer;
}
.pause-box { text-align: center; background: #fff; padding: 28px 40px; border-radius: 22px; box-shadow: var(--shadow-lg); max-width: 420px; display: grid; gap: 8px; }
.pause-icon { font-size: 44px; }

/* ---------- result --------------------------------------------------------------- */
.result-page, .complete-page { min-height: 100vh; }
.result-card { width: min(640px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 30px 20px; }
.res-kicker { font-weight: 700; font-size: 0.92rem; }
.big-stars { display: flex; gap: 8px; line-height: 1; margin-top: 2px; }
.big-star { --lift: 0px; display: inline-block; font-size: 72px; color: #dfe3ec; text-shadow: 0 3px 0 #cdd3df; transform: translateY(var(--lift)); }
.big-star:nth-child(2) { --lift: -12px; font-size: 84px; }
.big-star.on { transform: translateY(var(--lift)) scale(0); }
.big-star.on.pop { color: var(--gold); text-shadow: 0 4px 0 var(--gold-dark), 0 8px 18px rgba(255, 180, 0, 0.35); animation: star-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) forwards; }
@keyframes star-pop {
  0% { transform: translateY(var(--lift)) scale(0) rotate(-30deg); }
  100% { transform: translateY(var(--lift)) scale(1) rotate(0); }
}
.res-title { font-size: 2rem; }
.tone-fail .res-title { color: var(--ink-2); }
.pb-badge { padding: 6px 14px; border-radius: 999px; background: #fff3c4; box-shadow: 0 0 0 2px #f5c542; font-weight: 800; animation: drop-in 0.4s ease-out; }
.res-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; margin: 4px 0; }
.res-metric { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; border-radius: 14px; background: var(--bg); }
.res-label { font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.res-value { font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.res-value small { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.res-metric.hit { background: var(--ok-soft); }
.res-metric.hit .res-value { color: #17784a; }
.res-metric.miss { background: var(--bad-soft); }
.res-message { font-size: 1.08rem; font-weight: 600; color: var(--ink-2); max-width: 30em; text-wrap: balance; }
.problems { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.problem-keys { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.problem { display: inline-flex; align-items: center; gap: 4px; }
.problem small { font-weight: 800; color: var(--bad); }
.clean-run { font-weight: 800; color: var(--ok); }
.save-note { padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); font-size: 0.9rem; font-weight: 600; }
.res-buttons { justify-content: center; margin-top: 6px; }
.kbd-hint { font-size: 0.85rem; }

/* ---------- level complete ---------------------------------------------------------- */
.complete-card { width: min(620px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 32px 26px; }
.complete-trophy { font-size: 76px; line-height: 1; animation: bounce 1.2s ease-in-out infinite; }
@keyframes bounce { 50% { transform: translateY(-10px) rotate(-4deg); } }
.complete-title { font-size: 2.2rem; }
.complete-level { font-size: 1.15rem; font-weight: 700; color: var(--ink-2); }
.complete-stars { font-size: 46px; }
.complete-note { max-width: 30em; text-wrap: balance; }
.unlock {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px rgba(81, 70, 232, 0.25);
  text-align: left;
  margin: 4px 0 6px;
}
.unlock > div { display: flex; flex-direction: column; flex: 1; }
.unlock-icon { font-size: 30px; }
.unlock-keys { display: flex; gap: 4px; }
.complete-card .row-buttons { justify-content: center; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }

/* ---------- stats ------------------------------------------------------------------ */
.stat-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.stat-tile strong { font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-tile .muted { font-size: 0.88rem; }
.stat-icon { font-size: 22px; }
.stat-tiles .stat-tile:last-child .stat-icon { color: var(--gold); }
.chart-card { margin-bottom: 16px; padding: 18px 20px 12px; }
.chart-card h2 { font-size: 1.05rem; }
.chart-note { font-size: 0.85rem; }
.chart-pair, .table-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.table-pair { grid-template-columns: 1fr 1.25fr; align-items: start; }
.chart-pair .chart-card { margin-bottom: 16px; }
.chart { position: relative; margin-top: 8px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-svg .grid { stroke: #edf0f5; stroke-width: 1; }
.chart-svg .axis-base { stroke: var(--line-2); stroke-width: 1; }
.chart-svg .tick { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart-svg .bar { fill: #8f88f2; }
.chart-svg .bar-goal { fill: var(--accent); }
.chart-svg .goal-line { stroke: var(--ok); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart-svg .goal-label { fill: var(--ok); font-size: 11px; font-weight: 700; font-family: var(--font); }
.chart-svg .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .dot { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.chart-svg.line-acc .line { stroke: #1a9e8f; }
.chart-svg.line-acc .dot { fill: #1a9e8f; }
.chart-svg .hit { fill: transparent; cursor: crosshair; }
.chart-svg .hit:hover { fill: rgba(81, 70, 232, 0.06); }
.chart-svg .empty-label { fill: var(--muted); font-size: 14px; font-family: var(--font); }
.chart-tip { position: absolute; z-index: 5; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 0.85rem; font-weight: 600; white-space: nowrap; pointer-events: none; }
.heat-card { margin-bottom: 16px; container-type: inline-size; display: flex; flex-direction: column; gap: 10px; }
.heat-card > .muted { margin-top: -4px; }
.table-pair .card { padding: 18px 20px; }
.table-wrap { overflow-x: auto; margin-top: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th { text-align: left; font-size: 0.8rem; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 2px solid var(--line); }
.table td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .stars { font-size: 15px; }

/* ---------- settings ----------------------------------------------------------------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.settings-col { display: grid; gap: 16px; }
.settings-card h2 { margin-bottom: 10px; }
.setting { display: flex; align-items: center; gap: 16px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.setting:last-of-type { border-bottom: 0; }
.setting-text { display: flex; flex-direction: column; flex: 1; }
.setting-text .muted { font-size: 0.9rem; }
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { position: relative; flex: none; width: 52px; height: 30px; border-radius: 15px; background: var(--line-2); transition: background-color 0.15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.15s; }
.switch-input:checked + .switch { background: var(--accent); }
.switch-input:checked + .switch::after { transform: translateX(22px); }
.switch-input:focus-visible + .switch { outline: 3px solid var(--focus); outline-offset: 2px; }
.setting-tip { margin-top: 12px; font-size: 0.92rem; padding: 10px 12px; background: var(--bg); border-radius: 12px; }
.profile-form .avatar-grid { grid-template-columns: repeat(10, 1fr); gap: 6px; }
.profile-form .avatar-option { font-size: 24px; border-radius: 12px; }
.profile-form .row-buttons { margin-top: 6px; }
.code-big { font-family: var(--mono); font-size: 2rem; font-weight: 700; letter-spacing: 0.06em; padding: 10px 16px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-dark); display: inline-block; margin-bottom: 10px; user-select: all; }
.code-card .row-buttons { margin-top: 14px; }

/* ---------- help ------------------------------------------------------------------- */
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.help-card { display: flex; flex-direction: column; gap: 10px; }
.help-card h2 { display: flex; align-items: center; gap: 10px; }
.help-icon { font-size: 24px; color: var(--gold); }
.help-wide { grid-column: 1 / -1; container-type: inline-size; }
.help-visual { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.path { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.path li { counter-increment: step; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); font-weight: 700; color: var(--accent-dark); }
.path li::before { content: counter(step); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; }
.tips { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.stars-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stars-rules li { display: flex; align-items: center; gap: 12px; }
.stars-rules .stars { font-size: 20px; min-width: 66px; }
.help-back { text-align: center; margin-top: 18px; }

/* ---------- toast & modal ----------------------------------------------------------- */
#toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast { padding: 12px 20px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 700; box-shadow: var(--shadow-lg); max-width: 90vw; }
.toast-error { background: #b42318; }
.modal-back { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; background: rgba(29, 36, 51, 0.35); backdrop-filter: blur(3px); animation: fade-in 0.15s; }
.modal { width: min(420px, 92vw); padding: 26px 26px 22px; border-radius: 22px; background: #fff; box-shadow: var(--shadow-lg); text-align: center; display: grid; gap: 10px; animation: drop-in 0.2s ease-out; }
.modal-title { font-size: 1.35rem; }
.modal-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- responsive --------------------------------------------------------------- */
@media (max-width: 1100px) {
  .nav-text { display: none; }
  .nav-link { padding: 8px 10px; }
  .nav-icon { font-size: 20px; }
}
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .hero-stats { justify-content: center; flex-wrap: wrap; }
  .intro-grid, .chart-pair, .table-pair, .settings-grid, .help-grid { grid-template-columns: 1fr; }
  .intro-card { grid-template-columns: auto 1fr; }
  .intro-actions { grid-column: 1 / -1; flex-direction: row; }
  .intro-visual > * { --u: min(calc(100cqw / 17.2), 46px); }
  .stat-tiles { grid-template-columns: repeat(3, 1fr); }
  .avatar-grid { grid-template-columns: repeat(5, 1fr); }
  .play-title { display: none; }
}
@media (max-width: 640px) {
  .app-header { flex-direction: column; gap: 10px; }
  .logo-sub { display: none; }
  .res-metrics { grid-template-columns: repeat(2, 1fr); }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
  .metric-unit { display: none; }
  .metric { min-width: 0; }
}
@media (max-height: 700px) {
  .result-card { gap: 8px; padding-top: 16px; padding-bottom: 14px; }
  .big-star { font-size: 60px; }
  .big-star:nth-child(2) { font-size: 70px; }
  .res-title { font-size: 1.7rem; }
  .complete-trophy { font-size: 60px; }
  .complete-card { gap: 8px; padding-top: 20px; padding-bottom: 18px; }
  .who-page { gap: 14px; }
  .logo-big .logo-key { width: 40px; height: 44px; font-size: 23px; }
  .who-card { padding: 22px 28px; }
  .who-title { margin-bottom: 14px; }
}

@media (min-width: 1600px) and (min-height: 900px) {
  .result-card { width: min(760px, 100%); gap: 16px; padding: 30px 40px 26px; font-size: 1.08rem; }
  .big-star { font-size: 92px; }
  .big-star:nth-child(2) { font-size: 106px; }
  .res-title { font-size: 2.4rem; }
  .res-value { font-size: 1.8rem; }
  .res-metric { padding: 14px 10px; }
  .complete-card { width: min(720px, 100%); padding: 40px 40px 32px; }
  .page-main, .app-header { max-width: 1320px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .big-star.on { transform: translateY(var(--lift)); color: var(--gold); }
  .text-inner { transition: none; }
}
