/* Азбука — оформление. Крупные кнопки, мягкие цвета, всё под палец. */

@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/unbounded-cyrillic-700.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116, U+2013-2014, U+00AB, U+00BB, U+2026;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/unbounded-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/unbounded-cyrillic-500.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116, U+2013-2014, U+00AB, U+00BB, U+2026;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/unbounded-latin-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/golos-text-cyrillic-400.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/golos-text-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/golos-text-cyrillic-600.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/golos-text-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/golos-text-cyrillic-700.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/golos-text-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC;
}

:root {
  --bg: #FFF7EE;
  --bg-deep: #FFEFDD;
  --surface: #FFFFFF;
  --ink: #2E2440;
  --ink-soft: #7A6C93;
  --line: #EFE1CF;
  --c1: #FF7A59;
  --c2: #FFB020;
  --c3: #14B39B;
  --c4: #4E7CF3;
  --c5: #9B6BF3;
  --c6: #FF5C8A;
  --accent: var(--c1);
  --radius: 22px;
  --top-h: 62px;
  --tab-h: 74px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --shadow-soft: 0 2px 0 rgba(70, 50, 110, 0.06), 0 10px 24px -18px rgba(70, 50, 110, 0.45);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1000px 420px at 8% -8%, #FFE3CE 0%, rgba(255, 227, 206, 0) 62%),
    radial-gradient(900px 520px at 100% 4%, #E6F5F1 0%, rgba(230, 245, 241, 0) 58%),
    var(--bg);
  color: var(--ink);
  font-family: 'Golos Text', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
}

button { font-family: inherit; color: inherit; }

body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

.icon-btn svg { width: 20px; height: 20px; display: block; }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }

.hidden { display: none !important; }

.icon-btn {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 14px;
  background: #F6EADC;
  font-size: 20px;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease;
}
.icon-btn:active { transform: scale(.94); }

/* ---------- шапка ---------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  padding: 0 14px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 247, 238, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(239, 225, 207, 0.7);
}
.logo {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none; color: inherit;
  margin-right: auto;
}
.logo-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: linear-gradient(140deg, #FF8A5C, #FF5C8A);
  color: #fff;
  font-family: 'Unbounded', 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 19px;
  box-shadow: 0 6px 14px -8px rgba(255, 92, 138, 0.9);
}
.logo-name {
  font-family: 'Unbounded', 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.lang-switch {
  display: flex; padding: 3px; gap: 2px;
  background: #F3E6D6;
  border-radius: 12px;
}
.lang-btn {
  border: 0; background: transparent;
  padding: 7px 12px;
  border-radius: 9px;
  font-family: 'Unbounded', 'Segoe UI', sans-serif;
  font-weight: 700; font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.lang-btn.on { background: #fff; color: var(--ink); box-shadow: 0 2px 6px -3px rgba(60, 40, 90, .5); }

/* ---------- нижние вкладки ---------- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tab-h) + var(--safe-b));
  padding: 6px 8px calc(6px + var(--safe-b));
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(239, 225, 207, 0.8);
}
.tab {
  border: 0; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 16px;
  cursor: pointer; color: var(--ink-soft);
  transition: background .15s, color .15s, transform .12s;
}
.tab:active { transform: scale(.96); }
.tab-ico { height: 24px; display: flex; align-items: center; justify-content: center; }
.tab-ico svg { width: 23px; height: 23px; display: block; }
.tab-label { font-size: 10.5px; font-weight: 600; letter-spacing: .01em; }
.tab.on { color: var(--ink); background: #FFF0E4; }
.tab.on .tab-ico { filter: none; }

/* ---------- общие блоки ---------- */

.screen {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 16px 8px;
  animation: screen-in .22s ease both;
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.screen-head { margin: 6px 2px 14px; }
.screen-head h1 {
  margin: 0;
  font-family: 'Unbounded', 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: clamp(23px, 6vw, 30px);
  letter-spacing: -0.025em;
}
.sub { margin: 4px 0 0; color: var(--ink-soft); font-size: 13.5px; }

.btn {
  border: 0; cursor: pointer;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 16px;
  font-family: 'Unbounded', 'Segoe UI', sans-serif;
  font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s ease, box-shadow .15s ease, background .15s;
}
.btn:active { transform: translateY(2px); }
.btn.primary {
  background: linear-gradient(140deg, #FF8A5C, #FF6A6F);
  color: #fff;
  box-shadow: 0 5px 0 #E4553F, 0 12px 22px -14px rgba(228, 85, 63, .9);
}
.btn.primary:active { box-shadow: 0 2px 0 #E4553F; }
.btn.ghost {
  background: #fff; color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 #F0E3D2;
}
.btn.ghost:active { box-shadow: 0 1px 0 #F0E3D2; }
.btn.wide { width: 100%; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 12px;
}

/* ---------- азбука ---------- */

.letters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 10px;
}
.letter-tile {
  position: relative;
  border: 2px solid transparent;
  border-radius: 20px;
  min-height: 88px;
  padding: 6px 4px 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  cursor: pointer;
  background: #fff;
  box-shadow: 0 3px 0 rgba(120, 95, 160, .10);
  transition: transform .1s ease, box-shadow .15s ease;
}
.letter-tile:active { transform: translateY(3px); box-shadow: none; }
.letter-tile.tone-0 { background: #FFEAE4; }
.letter-tile.tone-1 { background: #FFF2D6; }
.letter-tile.tone-2 { background: #DFF6F1; }
.letter-tile.tone-3 { background: #E3EBFF; }
.letter-tile.tone-4 { background: #EFE6FF; }
.letter-tile.tone-5 { background: #FFE6EF; }
.letter-tile.tone-6 { background: #F6EEDF; }
.lt-letter {
  font-family: 'Unbounded', 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: clamp(25px, 7.4vw, 30px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.lt-emoji { font-size: 15px; line-height: 1; opacity: .92; }
.mini-stars { display: flex; gap: 2px; height: 7px; margin-top: 2px; }
.mini-stars i {
  width: 4px; height: 4px; border-radius: 50%;
  background: #E4D8C7;
}
.mini-stars i.on { background: var(--c2); }

/* ---------- карточка буквы ---------- */

.letter-screen {
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start;
  min-height: calc(100dvh - var(--top-h) - 20px);
  padding-bottom: 24px;
}
.letter-top {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.letter-count { color: var(--ink-soft); font-size: 13px; font-variant-numeric: tabular-nums; }
.letter-main {
  flex: 1 1 auto;
  width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  padding: 6px 0 10px;
}
.letter-hero {
  width: 100%;
  flex: 0 0 auto;
  padding: 0;
  display: flex; align-items: center; justify-content: space-between;
  margin: 0;
}
.letter-big {
  flex: 1;
  text-align: center;
  font-family: 'Unbounded', 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: clamp(112px, 36vw, 196px);
  line-height: .95;
  letter-spacing: -0.04em;
  color: var(--ink);
  animation: pop .28s cubic-bezier(.2, 1.5, .4, 1) both;
}
@keyframes pop {
  from { transform: scale(.82); opacity: .3; }
  to { transform: scale(1); opacity: 1; }
}
.nav-arrow {
  width: 48px; height: 48px; flex: 0 0 48px;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 50%;
  font-size: 26px; line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  display: grid; place-items: center;
  padding-bottom: 4px;
}
.nav-arrow:active { transform: scale(.94); }
.letter-word {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
  padding: 8px 18px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 3px 0 #F0E3D2;
}
.lw-emoji { font-size: 30px; line-height: 1; }
.lw-text { font-family: 'Unbounded', 'Segoe UI', sans-serif; font-weight: 500; font-size: 19px; }
.letter-stars { color: var(--c2); font-size: 20px; letter-spacing: 3px; height: 24px; margin-top: 10px; }
.letter-actions {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin-top: auto; padding-top: 14px; width: 100%; max-width: 420px;
}
.letter-actions .btn { flex: 1 1 150px; }

/* ---------- обводка ---------- */

.trace-screen { display: flex; flex-direction: column; align-items: center; }
.trace-top {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 10px;
}
.letter-chip {
  display: flex; align-items: center; gap: 8px;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 14px 6px 8px;
  cursor: pointer;
  box-shadow: 0 3px 0 #F0E3D2;
}
.chip-letter {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #FFE6DE;
  font-family: 'Unbounded', 'Segoe UI', sans-serif;
  font-weight: 700; font-size: 17px;
}
.chip-word { font-size: 14px; color: var(--ink-soft); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.trace-stage-wrap {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}
#stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 4px 0 #F1E4D3, 0 18px 30px -26px rgba(70, 50, 110, .7);
  overflow: hidden;
  touch-action: none;
}
.trace-guide, .trace-ink {
  position: absolute; left: 0; top: 0;
  touch-action: none;
}
.trace-ink { cursor: crosshair; }

.trace-success {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(3px);
  border-radius: 26px;
  animation: fade-in .2s ease both;
  z-index: 5;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.ts-emoji { font-size: 44px; animation: pop .3s cubic-bezier(.2, 1.6, .4, 1) both; }
.ts-title { font-family: 'Unbounded', 'Segoe UI', sans-serif; font-weight: 700; font-size: 22px; }
.ts-stars { color: var(--c2); font-size: 26px; letter-spacing: 5px; }
.ts-btns { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.ts-btns .btn { min-height: 46px; font-size: 13px; padding: 0 16px; }

.trace-progress {
  width: 100%; max-width: 520px;
  height: 10px; margin: 12px auto 0;
  background: #F1E4D3;
  border-radius: 99px;
  overflow: hidden;
}
.tp-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #FFB020, #FF7A59);
  border-radius: 99px;
  transition: width .18s ease;
}
.tp-fill.near { background: linear-gradient(90deg, #2FBFA6, #14B39B); }
.trace-hint { color: var(--ink-soft); font-size: 12.5px; margin: 8px 0 0; text-align: center; }
.trace-actions {
  display: flex; gap: 10px; width: 100%; max-width: 520px; margin-top: 10px;
}
.trace-actions .btn { flex: 1; }

/* ---------- игры: хаб ---------- */

.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.game-card {
  border: 0; cursor: pointer;
  border-radius: 24px;
  padding: 16px 14px 14px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  text-align: left;
  box-shadow: 0 4px 0 rgba(110, 85, 150, .10);
  transition: transform .1s ease, box-shadow .15s ease;
  min-height: 128px;
}
.game-card:active { transform: translateY(4px); box-shadow: none; }
.game-card.c1 { background: #FFE7DF; }
.game-card.c2 { background: #FFF1D2; }
.game-card.c3 { background: #DAF5EF; }
.game-card.c4 { background: #E2EBFF; }
.game-card.c1 .gc-icon { color: #E4553F; }
.game-card.c2 .gc-icon { color: #D89100; }
.game-card.c3 .gc-icon { color: #0E9C87; }
.game-card.c4 .gc-icon { color: #3D67CE; }
.gc-icon { line-height: 1; display: block; }
.gc-icon svg { width: 30px; height: 30px; display: block; }
.gc-title {
  font-family: 'Unbounded', 'Segoe UI', sans-serif;
  font-weight: 700; font-size: 15.5px; letter-spacing: -0.02em;
  margin-top: 6px;
}
.gc-sub { font-size: 12px; color: rgba(46, 36, 64, .62); }

/* ---------- игры: экран ---------- */

.game-screen {
  padding: 12px 14px 16px;
  min-height: calc(100dvh - var(--top-h) - 10px);
}
.game {
  display: flex; flex-direction: column;
  min-height: calc(100dvh - 40px);
  max-width: 640px; margin: 0 auto;
}
.game-top {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 2px 8px;
}
.game-top .icon-btn { background: #F6EADC; }
.dots { display: flex; gap: 5px; margin: 0 auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #EADCC9; }
.dot.now { background: #FFD173; width: 18px; border-radius: 99px; }
.dot.done { background: var(--c3); }
.g-score {
  display: flex; align-items: center; gap: 5px;
  font-family: 'Golos Text', 'Segoe UI', sans-serif;
  font-weight: 700; font-size: 16px;
  font-variant-numeric: tabular-nums;
  background: #FFF3DD; border-radius: 12px; padding: 7px 11px;
}
.star-ico { color: var(--c2); }

.game-body {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: center; gap: 14px;
  padding: 4px 0 8px;
}
.game-body.in .prompt { animation: screen-in .22s ease both; }
.game-body.in .options .opt { animation: opt-in .26s ease both; animation-delay: calc(var(--i) * 45ms); }
@keyframes opt-in {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: none; }
}

.prompt {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 26px;
  padding: 18px 16px 20px;
  box-shadow: 0 4px 0 #F1E4D3;
}
.prompt-text {
  font-size: 15px; color: var(--ink-soft); font-weight: 600;
}
.speaker.round {
  width: 62px; height: 62px;
  border-radius: 50%;
  border: 0; cursor: pointer;
  background: linear-gradient(140deg, #FFD173, #FFB020);
  font-size: 26px;
  box-shadow: 0 4px 0 #E39A12;
  display: grid; place-items: center;
}
.speaker.round:active { transform: translateY(3px); box-shadow: 0 1px 0 #E39A12; }
.prompt-letter {
  font-family: 'Unbounded', 'Segoe UI', sans-serif;
  font-weight: 700; font-size: 46px; line-height: 1;
}
.prompt-picture { font-size: clamp(56px, 17vw, 78px); line-height: 1.05; }
.prompt-word {
  font-family: 'Unbounded', 'Segoe UI', sans-serif;
  font-weight: 700; font-size: clamp(20px, 6vw, 26px);
  letter-spacing: -0.02em;
}
.prompt-hint { font-size: 11.5px; color: #A292B8; margin-top: -2px; }
.prompt-items { width: 100%; max-width: 420px; }
.count-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: 4px 6px;
  justify-items: center;
  align-items: center;
}
.count-item {
  font-size: clamp(23px, 7vw, 31px);
  line-height: 1.1;
  animation: pop .25s ease both;
}
.sequence { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.seq-tile {
  width: 50px; height: 58px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: #FFF2D6;
  font-family: 'Unbounded', 'Segoe UI', sans-serif;
  font-weight: 700; font-size: 24px;
}
.seq-gap { background: #EFE6FF; color: #9B6BF3; border: 2px dashed #C9B4F5; }
.seq-arrow { color: #C9B8A2; font-size: 14px; }

.options {
  display: grid; gap: 10px;
}
.options.cols-3 { grid-template-columns: repeat(3, 1fr); }
.options.cols-4 { grid-template-columns: repeat(4, 1fr); }
.opt {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 22px;
  min-height: 96px;
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 4px 0 #F0E3D2;
  transition: transform .1s ease, box-shadow .15s, background .15s, border-color .15s;
  padding: 6px;
}
.opt:active { transform: translateY(3px); box-shadow: 0 1px 0 #F0E3D2; }
.opt-letter {
  font-family: 'Unbounded', 'Segoe UI', sans-serif;
  font-weight: 700; font-size: clamp(30px, 9vw, 38px); line-height: 1;
}
.opt-num {
  font-family: 'Unbounded', 'Segoe UI', sans-serif;
  font-weight: 700; font-size: clamp(30px, 9vw, 38px); line-height: 1;
}
.opt.ok {
  background: #DDF7EE; border-color: #7FDCC8; box-shadow: 0 4px 0 #A9E8DA;
  animation: ok-bounce .3s ease;
}
@keyframes ok-bounce { 0% { transform: scale(1); } 45% { transform: scale(1.07); } 100% { transform: scale(1); } }
.opt.bad {
  background: #FFE9E6; border-color: #FFB6A6; color: #C34A2E;
  animation: shake .32s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-3px); }
}

.result {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  padding: 22px;
  background: rgba(46, 36, 64, .35);
  backdrop-filter: blur(6px);
  animation: fade-in .2s ease both;
}
.win-card {
  background: #fff;
  border-radius: 30px;
  padding: 26px 22px 20px;
  width: 100%; max-width: 340px;
  text-align: center;
  box-shadow: 0 24px 60px -28px rgba(46, 36, 64, .8);
  animation: pop .34s cubic-bezier(.2, 1.4, .4, 1) both;
}
.win-emoji { font-size: 70px; text-align: center; animation: pop .4s cubic-bezier(.2, 1.6, .4, 1) both; }
.win-card .win-emoji { font-size: 44px; line-height: 1; margin-bottom: 2px; }
.win-title {
  font-family: 'Unbounded', 'Segoe UI', sans-serif;
  font-weight: 700; font-size: 22px; margin-bottom: 2px;
}
.win-stars { color: var(--c2); font-size: 34px; letter-spacing: 6px; }
.win-sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 14px; }
.win-btns { display: flex; flex-direction: column; gap: 8px; }
.win-btns .btn { width: 100%; }

/* ---------- родителям ---------- */

.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 4px 0;
}
.row + .row { margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--line); }
.row-title { font-weight: 700; font-size: 14.5px; }
.row-hint { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.text { font-size: 13.5px; color: var(--ink-soft); margin: 6px 0 14px; line-height: 1.5; }
.text.muted { color: #A292B8; font-size: 12px; }
.switch {
  width: 54px; height: 32px; flex: 0 0 54px;
  border: 0; border-radius: 99px; cursor: pointer;
  background: #E6D9C8; position: relative;
  transition: background .18s;
}
.switch span {
  position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 5px rgba(60, 40, 90, .25);
  transition: transform .18s cubic-bezier(.2, 1.2, .4, 1);
}
.switch.on { background: #34C7A8; }
.switch.on span { transform: translateX(22px); }
.mini-lang { display: flex; gap: 4px; padding: 3px; background: #F3E6D6; border-radius: 11px; }
.mini-lang .lang-btn { padding: 6px 10px; font-size: 11px; }
.stat-row { display: flex; justify-content: space-between; text-align: center; margin-bottom: 12px; }
.stat b {
  display: block;
  font-family: 'Unbounded', 'Segoe UI', sans-serif;
  font-weight: 700; font-size: 22px; line-height: 1.1;
}
.stat span { font-size: 11px; color: var(--ink-soft); }
.install-card { border-color: #CBEDE4; background: #F2FCF8; }

/* ---------- реклама и подвал ---------- */

.ad-slot {
  margin: 14px 0 4px;
  min-height: 62px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 6px;
}
.ad-slot.on { border-style: solid; background: #fff; }
.ad-label { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: #B5A596; }

.house-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 12px 2px 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.house-title { font-weight: 600; }
.house-link {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px dashed #D8C7B2;
}
.house-link:hover { color: var(--ink); }

/* ---------- разное ---------- */

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 26px + var(--safe-b));
  transform: translate(-50%, 10px);
  background: rgba(46, 36, 64, .93);
  color: #fff; font-size: 13px;
  padding: 10px 18px; border-radius: 99px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.confetti-layer {
  position: fixed; inset: 0; z-index: 70;
  pointer-events: none; overflow: hidden;
}
.confetti-layer span {
  position: absolute; top: -12px;
  display: block;
  animation-name: fall;
  animation-timing-function: cubic-bezier(.3, .5, .6, 1);
  animation-fill-mode: both;
}
@keyframes fall {
  0% { transform: translateY(-10px) rotate(0) scale(1); opacity: 1; }
  100% { transform: translateY(105vh) rotate(var(--rot, 300deg)) scale(.9); opacity: .9; }
}

@media (min-width: 700px) {
  .screen { padding: 22px 24px 12px; }
  .letters-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; }
  .letter-tile { min-height: 104px; }
  .games-grid { grid-template-columns: repeat(4, 1fr); }
  .game-card { min-height: 152px; }
  .opt { min-height: 112px; }
  .letter-screen { padding-top: 10px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .trace-screen { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 12px; }
  .trace-top { flex: 0 0 100%; }
  #stage { max-width: 42vh; }
  .trace-stage-wrap { width: auto; }
  .trace-progress, .trace-actions, .trace-hint { flex: 0 0 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 380px) {
  .logo-name { display: none; }
  .options.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .opt { min-height: 84px; }
}
