/* trainers.css — стили интерактивных тренажёров razvitierebenka-online.ru
   Использует переменные дизайн-системы из style.css (--forest, --amber, --cream …). */

/* ---- Общий каркас страницы тренажёра ---- */
.trainer-page { padding: 2rem 0 3rem; }
.trainer-page .container { max-width: 760px; }

.trainer-head { text-align: center; margin-bottom: 1.5rem; }
.trainer-head .trainer-emoji { font-size: 2.6rem; display: block; line-height: 1; margin-bottom: .4rem; }
.trainer-head h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  color: var(--forest); line-height: 1.15; margin-bottom: .5rem;
}
.trainer-head p.lead { color: var(--muted); font-size: 1.02rem; max-width: 560px; margin: 0 auto; }

/* ---- Панель настроек ---- */
.trainer-controls {
  display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center;
  align-items: center; margin: 1.2rem 0 1.4rem; max-width: 100%;
}
.trainer-controls .ctl-group {
  display: flex; gap: .35rem; align-items: center;
  max-width: 100%; min-width: 0;
}
.trainer-controls label { font-size: .82rem; color: var(--muted); font-weight: 700; flex-shrink: 0; }
.seg {
  display: inline-flex; background: var(--ivory); border: 1px solid var(--border);
  border-radius: 0; padding: 3px; gap: 2px;
  overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button { flex-shrink: 0; }
.seg button {
  border: none; background: transparent; cursor: pointer; font-family: inherit;
  font-weight: 700; font-size: .85rem; color: var(--text-md);
  padding: .35rem .8rem; border-radius: 0; transition: all .15s;
  /* Цель нажатия под палец. Без min-height кнопка режима выходит 30px в
     высоту — при ширине 89px промахнуться по ней с телефона легко, а
     переключатель режимов это первое, что трогает ребёнок. Замерено
     браузером 21.08.2026 на 390, 844 и 1280px. */
  min-height: 44px;
}
.seg button.active { background: var(--forest); color: #fff; }
.seg button:hover:not(.active) { background: var(--border-lt); }

.chk { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; user-select: none; }
.chk input { width: 1.05rem; height: 1.05rem; accent-color: var(--forest); cursor: pointer; }

/* ---- Табло: таймер / счёт / рекорд ---- */
.trainer-stats {
  display: flex; justify-content: center; gap: 1.6rem; flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.stat-box { text-align: center; min-width: 84px; }
.stat-box .stat-num {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 800;
  font-size: 1.7rem; color: var(--forest); line-height: 1; font-variant-numeric: tabular-nums;
}
.stat-box .stat-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: .2rem; }
.stat-box.best .stat-num { color: var(--amber); }

/* ---- Кнопки старт/повтор ---- */
.trainer-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-family: inherit; font-weight: 800; font-size: 1rem; cursor: pointer;
  border: none; border-radius: 0; padding: .75rem 1.9rem; transition: all .18s;
}
.trainer-btn.primary { background: var(--amber); color: #fff; box-shadow: 0 4px 14px rgba(212,135,10,.28); }
.trainer-btn.primary:hover { background: var(--amber-lt); transform: translateY(-1px); }
.trainer-btn.ghost { background: transparent; color: var(--forest); border: 2px solid var(--forest); }
.trainer-btn.ghost:hover { background: var(--forest); color: #fff; }
.trainer-actions { text-align: center; margin-top: 1.2rem; }

/* ---- Шульте: сетка ---- */
.shulte-grid {
  display: grid; gap: 6px; width: 100%; max-width: 460px; margin: 0 auto;
  aspect-ratio: 1 / 1; touch-action: manipulation;
}
.shulte-cell {
  display: flex; align-items: center; justify-content: center;
  background: var(--white); border: 1px solid var(--border); border-radius: 0;
  font-family: 'Nunito', sans-serif; font-weight: 800;
  font-size: clamp(1rem, 5vw, 1.7rem); color: var(--text);
  cursor: pointer; user-select: none; transition: background .1s, transform .06s, color .1s;
}
.shulte-cell:hover { background: var(--cream); }
.shulte-cell:active { transform: scale(.96); }
.shulte-cell.done { background: var(--forest); color: rgba(255,255,255,.35); border-color: var(--forest); cursor: default; }
.shulte-cell.next-hint { outline: 3px solid var(--amber-lt); outline-offset: -3px; }
.shulte-cell.wrong { animation: cell-wrong .35s; }
@keyframes cell-wrong {
  0%,100% { background: var(--white); }
  30% { background: #F8D7D3; border-color: var(--red); }
}
/* блокируем сетку до старта */
.shulte-grid.locked .shulte-cell { pointer-events: none; opacity: .6; }

/* ---- Умножение: пример и варианты ---- */
.mult-question {
  text-align: center; font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800; color: var(--forest); font-size: clamp(2.2rem, 9vw, 3.4rem);
  margin: 1rem 0 1.4rem; font-variant-numeric: tabular-nums; min-height: 1.2em;
}
/* состояние-подсказка до старта — мельче, спокойнее */
.mult-question.is-hint {
  font-size: 1.15rem; font-weight: 700; color: var(--muted);
  font-family: 'Nunito', sans-serif;
}
.mult-options {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem;
  max-width: 420px; margin: 0 auto;
}
.mult-opt {
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.5rem;
  background: var(--white); border: 2px solid var(--border); border-radius: 0;
  padding: 1rem; cursor: pointer; color: var(--text);
  transition: all .12s; font-variant-numeric: tabular-nums;
}
.mult-opt:hover { border-color: var(--forest-lt); background: var(--cream); }
.mult-opt:active { transform: scale(.97); }
.mult-opt.correct { background: var(--forest); color: #fff; border-color: var(--forest); animation: opt-correct .3s; }
.mult-opt.wrong { background: #F8D7D3; border-color: var(--red); color: var(--red); }
.mult-opt:disabled { cursor: default; }
@keyframes opt-correct { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* прогресс серии */
.mult-progress { max-width: 420px; margin: 0 auto 1.1rem; }
.mult-progress .bar { height: 8px; background: var(--ivory); border-radius: 0; overflow: hidden; }
.mult-progress .bar > span { display: block; height: 100%; width: 0; background: var(--forest); transition: width .3s; }
.mult-progress .count { text-align: center; font-size: .8rem; color: var(--muted); margin-top: .35rem; font-weight: 700; }

/* ---- Корректурная проба: задание и поле ---- */
.kp-target {
  text-align: center; font-family: 'Nunito', sans-serif; font-size: 1.05rem;
  color: var(--text-md); background: var(--cream); border: 1px solid var(--border-lt);
  border-radius: 0; padding: .6rem 1rem; max-width: 460px; margin: 0 auto 1.1rem;
}
.kp-target .kp-target-char {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 900;
  color: var(--amber); font-size: 1.5rem; vertical-align: middle;
  margin: 0 .15rem; line-height: 1;
}
.kp-target .kp-target-hint { color: var(--muted); font-size: .85rem; font-weight: 700; }

.kp-grid {
  display: grid; gap: 4px; width: 100%; max-width: 500px; margin: 0 auto;
  touch-action: manipulation;
}
.kp-cell {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1; background: var(--white); border: 1px solid var(--border);
  border-radius: 0; font-family: 'Nunito', sans-serif; font-weight: 800;
  font-size: clamp(.7rem, 2.6vw, 1.15rem); color: var(--text);
  cursor: pointer; user-select: none; padding: 0;
  transition: background .1s, transform .06s, color .1s, border-color .1s;
}
.kp-cell:hover { background: var(--cream); }
.kp-cell:active { transform: scale(.93); }
.kp-cell.hit {
  background: var(--forest); color: #fff; border-color: var(--forest); cursor: default;
  animation: opt-correct .28s;
}
.kp-cell.miss {
  background: #F8D7D3; color: var(--red); border-color: var(--red); cursor: default;
}
.kp-grid.locked .kp-cell { pointer-events: none; opacity: .6; }

/* ---- Экран результата ---- */
.trainer-result {
  text-align: center; background: var(--cream); border: 1px solid var(--border-lt);
  border-radius: 0; padding: 1.6rem 1.2rem; max-width: 460px; margin: 1.2rem auto 0;
}
.trainer-result.hidden { display: none; }
.trainer-result .res-title {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 800;
  font-size: 1.5rem; color: var(--forest); margin-bottom: .4rem;
}
.trainer-result .res-big {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 900;
  font-size: 2.6rem; color: var(--amber); line-height: 1; margin: .3rem 0;
  font-variant-numeric: tabular-nums;
}
.trainer-result .res-sub { color: var(--muted); font-size: .95rem; }
.trainer-result .res-badge {
  display: inline-block; background: var(--amber); color: #fff; font-weight: 800;
  font-size: .8rem; padding: .25rem .8rem; border-radius: 0; margin-top: .6rem;
}

/* ---- Текстовый блок «зачем и как» ---- */
/* Текст о пользе занятия НАД игровым полем. Здесь стоит первая из трёх
   партнёрских ссылок: норма владельца — начало, середина, конец, а всё, что
   лежит под игровым полем, человек читает, только если доскроллит.
   Блок намеренно короткий: на 390px каждые лишние 60px уводят кнопку
   «Начать» под сгиб. */
.trainer-intro { max-width: 680px; margin: 0 auto 1.1rem; }
.trainer-intro p { margin: 0; color: var(--text-md); font-size: .97rem; line-height: 1.5; }

.trainer-about { max-width: 680px; margin: 2.6rem auto 0; }
.trainer-about h2 {
  font-family: 'Playfair Display', Georgia, serif; color: var(--forest);
  font-size: 1.35rem; margin: 1.4rem 0 .6rem;
}
.trainer-about p { margin-bottom: .8rem; color: var(--text-md); }
.trainer-about ul { margin: 0 0 .8rem 1.2rem; }
.trainer-about li { margin-bottom: .35rem; color: var(--text-md); }
/* Ссылки в текстовых блоках тренажёров — подчёркнутые и выделенные фоном:
   без этого они терялись в тексте и по ним не кликали. */
.trainer-about a,
.trainer-intro a,
.trainer-faq a {
  color: var(--forest); font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  background: rgba(212, 135, 10, 0.1);
  padding: .05em .25em; border-radius: 0;
  transition: background .15s, color .15s;
}
.trainer-about a:hover,
.trainer-intro a:hover,
.trainer-faq a:hover {
  color: var(--white); background: var(--forest);
  text-decoration-color: var(--amber-lt);
}

/* Партнёрские ссылки выделяются сильнее обычных: плотнее фон, толще
   подчёркивание, рамка. Остаются живым текстом в потоке — не баннер. */
.trainer-about a[rel~="sponsored"],
.trainer-intro a[rel~="sponsored"],
.trainer-faq a[rel~="sponsored"] {
  background: rgba(212, 135, 10, 0.2);
  border: 1px solid rgba(212, 135, 10, 0.45);
  text-decoration-thickness: 3px;
  text-decoration-color: var(--amber);
  padding: .12em .4em;
  border-radius: 0;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.trainer-about a[rel~="sponsored"]:hover,
.trainer-intro a[rel~="sponsored"]:hover,
.trainer-faq a[rel~="sponsored"]:hover {
  /* --amber-dk, а не --amber: с белым текстом фирменный янтарь даёт 2,89:1
     при норме 4,5:1. Переменная объявлена в :root файла style.css, который
     подключён на каждой странице тренажёра рядом с этим файлом. */
  background: var(--amber-dk); color: var(--white);
  border-color: var(--amber-dk); text-decoration-color: var(--white);
}

/* блок «частые вопросы» */
.trainer-faq { margin-top: .4rem; }
.trainer-faq h3 {
  font-family: 'Nunito', sans-serif; font-weight: 800; color: var(--forest-md);
  font-size: 1.02rem; line-height: 1.4; margin: 1.1rem 0 .35rem;
  padding-left: .9rem; border-left: 3px solid var(--amber-lt);
}
.trainer-faq p { margin-bottom: .7rem; }

/* ссылка «другие тренажёры» */
.trainer-more { text-align: center; margin-top: 1.6rem; }
.trainer-more a {
  color: var(--forest); font-weight: 800;
  text-decoration: underline; text-decoration-color: var(--amber);
  text-decoration-thickness: 2px; text-underline-offset: 3px;
}

/* ============ Мемори «Найди пару зверят» ============ */
.memori-grid {
  display: grid; gap: .6rem; max-width: 520px; margin: 1.2rem auto 0;
  perspective: 800px;
}
.memori-grid.locked { opacity: .55; pointer-events: none; }

.memori-card {
  display: block; aspect-ratio: 1 / 1; border: none; background: transparent; padding: 0;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.memori-card-inner {
  display: block; position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .4s ease;
  border-radius: 0;
}
.memori-card.is-flipped .memori-card-inner,
.memori-card.is-matched .memori-card-inner { transform: rotateY(180deg); }

.memori-face {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 0; box-shadow: 0 3px 8px rgba(28,43,14,0.18);
}
/* рубашка */
.memori-back {
  background: var(--forest-md);
  color: rgba(255,255,255,0.5); font-size: 1.6rem;
}
.memori-back::after { content:""; }
/* лицо со зверем */
.memori-front {
  transform: rotateY(180deg); background: var(--cream);
  border: 2px solid var(--ivory); font-size: clamp(1.8rem, 9vw, 3rem);
  line-height: 1;
}
.memori-card.is-matched .memori-front {
  background: #F7EEDF; border-color: var(--amber-lt);
  box-shadow: 0 0 0 3px rgba(240,168,50,0.35);
}

/* подпрыг найденной пары */
@keyframes memori-pop {
  0% { transform: rotateY(180deg) scale(1); }
  40% { transform: rotateY(180deg) scale(1.14); }
  100% { transform: rotateY(180deg) scale(1); }
}
.memori-card.is-matched .memori-card-inner { animation: memori-pop .45s ease; }

/* покачивание при промахе */
@keyframes memori-shake {
  0%,100% { transform: rotateY(180deg) translateX(0); }
  25% { transform: rotateY(180deg) translateX(-5px); }
  75% { transform: rotateY(180deg) translateX(5px); }
}
.memori-card.is-wrong .memori-card-inner { animation: memori-shake .35s ease; }

/* кнопка звука */
.memori-sound {
  border: 1px solid var(--border-lt); background: var(--cream);
  border-radius: 50px; font-size: 1.1rem; width: 42px; height: 42px;
  cursor: pointer; line-height: 1;
}
.memori-sound.off { opacity: .55; }

/* конфетти */
.memori-confetti {
  position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50;
}
.confetti-piece {
  position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 2px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: .9; }
}

/* ============ Состав числа: числовые домики ============ */
.sc-house { max-width: 300px; margin: .4rem auto 0; user-select: none; }
.sc-house.hidden { display: none; }
.sc-roof {
  width: 78%; margin: 0 auto; aspect-ratio: 2.4 / 1;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: var(--forest-md);
  display: flex; align-items: flex-end; justify-content: center;
}
.sc-roof span {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 800;
  font-size: 1.9rem; color: #fff; line-height: 1; padding-bottom: .3rem;
  font-variant-numeric: tabular-nums;
}
.sc-body {
  background: var(--white); border: 2px solid var(--border);
  border-radius: 0;
  padding: 1rem 1.1rem 1.1rem;
  display: flex; gap: .9rem; justify-content: center;
}
.sc-window {
  width: 88px; max-width: 42%; aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream); border: 2px solid var(--border); border-radius: var(--r);
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 2rem;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.sc-window.unknown {
  background: rgba(212,135,10,0.08); border-color: var(--amber); color: var(--amber);
}
.sc-window.solved {
  background: var(--forest); border-color: var(--forest); color: #fff;
  animation: opt-correct .3s;
}
/* подпись под домиком — тем же блоком, что и пример, но спокойнее */
.mult-question.is-house {
  font-family: 'Nunito', sans-serif; font-weight: 800;
  font-size: 1.25rem; color: var(--text-md); margin: .7rem 0 1.1rem;
}

/* ---- Партнёрская плашка после серии ---- */
.promo-plate {
  position: fixed; left: 50%; bottom: 14px; z-index: 60;
  transform: translate(-50%, 130%); transition: transform .35s ease;
  width: min(430px, calc(100% - 24px));
  background: var(--paper); border: 1px solid var(--border);
  border-radius: 0; box-shadow: 0 10px 30px rgba(28,43,14,.18);
  padding: .9rem 2.3rem .9rem 1.1rem; text-align: left;
}
.promo-plate.is-open { transform: translate(-50%, 0); }
.promo-text { margin: 0 0 .4rem; font-size: .92rem; line-height: 1.45; color: var(--text-md); font-weight: 700; }
.promo-link { font-weight: 800; color: var(--amber); font-size: .95rem; }
.promo-link:hover { color: var(--amber-lt); }
.promo-close {
  position: absolute; top: .25rem; right: .4rem; border: none; background: none;
  font-size: 1.45rem; line-height: 1; color: var(--muted); cursor: pointer; padding: .25rem;
}
/* Ветка «вам это не нужно»: та же плашка, но без оффера. Отличается
   спокойной рамкой и зелёной ссылкой — янтарный тут читался бы как
   реклама, а это ровно то, чего в этой ветке нет. */
.promo-plate.is-clear { border-color: var(--forest); }
.promo-plate.is-clear .promo-link { color: var(--forest); }
.promo-plate.is-clear .promo-link:hover { text-decoration: underline; }

/* ---- Чтение по слогам: собираемое слово и банк слогов ---- */
.cs-word {
  display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap;
  margin: 1.4rem 0 1.6rem; min-height: 3.2rem;
}
.cs-slot {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 3.6rem; height: 3.2rem; padding: 0 .5rem;
  background: var(--ivory); border: 2px dashed var(--border);
  border-radius: 0; font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800; font-size: clamp(1.2rem, 6vw, 1.8rem); color: var(--forest);
  transition: background .15s, border-color .15s;
}
.cs-slot.filled { background: var(--white); border: 2px solid var(--forest-lt); }
.cs-word.cs-word-done .cs-slot {
  background: var(--forest); border-color: var(--forest); color: #fff;
  animation: opt-correct .3s;
}
.cs-slogi {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem;
  max-width: 480px; margin: 0 auto;
}
.cs-slog {
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.15rem;
  background: var(--white); border: 2px solid var(--border); border-radius: 0;
  padding: .65rem 1.1rem; cursor: pointer; color: var(--text); transition: all .12s;
}
.cs-slog:hover:not(:disabled) { border-color: var(--forest-lt); background: var(--cream); }
.cs-slog:active:not(:disabled) { transform: scale(.96); }
.cs-slog.used { opacity: 0; pointer-events: none; }
.cs-slog.cs-wrong { background: #F8D7D3; border-color: var(--red); animation: cell-wrong .35s; }

/* ============ Спряжение глаголов ============ */
.sprj-card {
  text-align: center; font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800; color: var(--forest); font-size: clamp(1.8rem, 8vw, 2.8rem);
  margin: 1rem 0 1.4rem; min-height: 1.2em;
}
.sprj-cats {
  display: flex; flex-direction: column; gap: .7rem;
  max-width: 420px; margin: 0 auto;
}
@media (min-width: 560px) {
  .sprj-cats { flex-direction: row; }
}
.sprj-cat {
  flex: 1; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.05rem;
  background: var(--white); border: 2px solid var(--border); border-radius: 0;
  padding: .9rem 1rem; cursor: pointer; color: var(--text); transition: all .12s;
}
.sprj-cat:hover:not(:disabled) { border-color: var(--forest-lt); background: var(--cream); }
.sprj-cat:active:not(:disabled) { transform: scale(.97); }
.sprj-cat.correct { background: var(--forest); color: #fff; border-color: var(--forest); animation: opt-correct .3s; }
.sprj-cat.wrong { background: #F8D7D3; border-color: var(--red); color: var(--red); }
.sprj-cat:disabled { cursor: default; }

/* ============ Словарные слова ============ */
.slov-card {
  text-align: center; font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800; color: var(--forest); font-size: clamp(1.8rem, 8vw, 2.8rem);
  margin: 1rem 0 .5rem; min-height: 1.2em; letter-spacing: .02em;
  word-break: break-word;
}
.slov-card.is-correct { color: var(--forest-lt); }
.slov-card.is-wrong { color: var(--red); }

.slov-hint {
  text-align: center; color: var(--muted); font-size: .9rem;
  font-weight: 700; margin-bottom: 1rem; min-height: 1.3em;
}

.slov-letters {
  display: flex; gap: .8rem; max-width: 420px; margin: 0 auto;
}
.slov-letters.hidden { display: none; }
.slov-letter {
  flex: 1; min-height: 60px; font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800; font-size: 1.8rem; color: var(--text);
  background: var(--white); border: 2px solid var(--border);
  border-radius: 0; cursor: pointer; transition: all .12s;
  -webkit-tap-highlight-color: transparent;
}
.slov-letter:hover:not(:disabled) { border-color: var(--forest-lt); background: var(--cream); }
.slov-letter:active:not(:disabled) { transform: scale(.97); }
.slov-letter.correct { background: var(--forest); color: #fff; border-color: var(--forest); animation: opt-correct .3s; }
.slov-letter.wrong { background: #F8D7D3; border-color: var(--red); color: var(--red); }
.slov-letter:disabled { cursor: default; }

.slov-dictation {
  display: flex; flex-direction: column; gap: .7rem;
  max-width: 420px; margin: 0 auto;
}
.slov-dictation.hidden { display: none; }
.slov-input {
  font-family: 'Nunito', sans-serif; font-size: 1.3rem; font-weight: 700;
  text-align: center; padding: .8rem 1rem; color: var(--text);
  background: var(--white); border: 2px solid var(--border);
  border-radius: 0; width: 100%;
}
.slov-input:focus { outline: none; border-color: var(--forest-lt); }
.slov-input:disabled { background: var(--ivory); }
.slov-dict-row { display: flex; gap: .6rem; }
.slov-dict-row button { flex: 1; padding-left: .8rem; padding-right: .8rem; }

.slov-voice-row {
  display: flex; align-items: center; gap: .5rem;
  justify-content: center; flex-wrap: wrap;
}
.slov-voice-row label { font-size: .82rem; color: var(--muted); font-weight: 700; }
.slov-voice {
  font-family: 'Nunito', sans-serif; font-size: .88rem; font-weight: 700;
  color: var(--text); background: var(--white);
  border: 2px solid var(--border); border-radius: 0;
  padding: .4rem .9rem; max-width: 100%; cursor: pointer;
}
.slov-voice:focus { outline: none; border-color: var(--forest-lt); }
.slov-voice-warn {
  font-size: .84rem; color: var(--muted); text-align: center;
  background: var(--ivory); border-radius: 0;
  padding: .7rem .9rem; margin: 0;
}

.slov-mastery {
  max-width: 420px; margin: 1.6rem auto 0; text-align: center;
  background: var(--cream); border-radius: 0; padding: 1rem 1.2rem;
}
.slov-mastery-text { font-weight: 800; color: var(--forest); font-size: .95rem; }
.slov-mastery-track {
  height: 10px; background: var(--white); border-radius: 0;
  overflow: hidden; margin: .6rem 0 .7rem;
}
.slov-mastery-track > span {
  display: block; height: 100%; width: 0;
  background: var(--forest-lt); transition: width .3s;
}
.slov-reset {
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--muted); font-family: 'Nunito', sans-serif;
  font-size: .82rem; font-weight: 700; text-decoration: underline;
}
.slov-reset:hover { color: var(--red); }

@media (max-width: 480px) {
  .trainer-stats { gap: 1rem; }
  .slov-card { font-size: clamp(1.6rem, 11vw, 2.4rem); }
  .slov-letter { min-height: 56px; font-size: 1.6rem; }
  .stat-box .stat-num { font-size: 1.4rem; }
  .mult-question { font-size: clamp(2rem, 12vw, 3rem); }
  .mult-question.is-house { font-size: 1.1rem; }
  .sc-house { max-width: 250px; }
  .sc-window { font-size: 1.7rem; }
  .memori-grid { gap: .4rem; }
  .memori-front { font-size: clamp(2.2rem, 15vw, 3.4rem); }
  .memori-back { font-size: 2rem; }
  .sprj-card { font-size: clamp(1.6rem, 11vw, 2.4rem); }
}


/* Проверочное слово в тренажёре безударных гласных: показывается под словом
   после ответа. Подтверждает правило ударением, а не просто «верно/неверно». */
.trainer-check {
  display: block;
  margin-top: .5rem;
  font-family: 'Nunito', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  color: var(--forest-md);
  letter-spacing: .01em;
}

/* Ряд коротких кнопок-букв (тренажёр безударных гласных). Пять одиночных
   букв столбиком занимали бы весь экран телефона, поэтому ставим в ряд;
   min-height держит палец-совместимый размер касания. */
.sprj-cats--compact { flex-direction: row; flex-wrap: wrap; gap: .5rem; }
.sprj-cats--compact .sprj-cat {
  flex: 1 1 0; min-width: 3.4rem; min-height: 3.2rem;
  padding: .7rem .4rem; font-size: 1.35rem;
}

/* ============ Падежи: квест на шесть этапов ============
   Карта этапов — главный экран тренажёра, а не список режимов: этапы
   открываются по очереди, и закрытый этап должен быть виден (замок и
   «откроется после…»), иначе непонятно, ради чего проходить текущий.
   Во время серии карта скрывается классом .pdz-playing на контейнере —
   ребёнок не должен видеть соседние этапы, пока отвечает. */
.pdz-map { display: flex; flex-direction: column; gap: .7rem; margin: 1.2rem 0 .8rem; }
.pdz-playing .pdz-map,
.pdz-playing .pdz-reset { display: none; }

.pdz-stage {
  display: flex; align-items: center; gap: .9rem; width: 100%;
  text-align: left; font-family: 'Nunito', sans-serif;
  background: var(--white); border: 2px solid var(--border);
  border-radius: 0; padding: .85rem 1rem;
  cursor: pointer; color: var(--text); transition: all .14s;
  -webkit-tap-highlight-color: transparent;
}
.pdz-stage:hover:not(:disabled) { border-color: var(--forest-lt); background: var(--cream); transform: translateX(2px); }
.pdz-stage:active:not(:disabled) { transform: scale(.99); }
.pdz-stage.done { border-color: var(--forest-lt); background: var(--cream); }
.pdz-stage.locked { cursor: default; opacity: .55; background: var(--ivory); }

.pdz-stage-num {
  flex: 0 0 auto; width: 2.6rem; height: 2.6rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; background: var(--ivory); border-radius: 50%;
}
.pdz-stage.done .pdz-stage-num { background: var(--white); }
.pdz-stage-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.pdz-stage-title { font-weight: 800; font-size: .98rem; line-height: 1.25; }
.pdz-stage-sub { font-size: .82rem; color: var(--muted); line-height: 1.3; }

.pdz-stars { flex: 0 0 auto; letter-spacing: .05em; font-size: 1.05rem; color: var(--border); }
.pdz-star.on { color: var(--amber); }
.trainer-result .pdz-stars { display: block; font-size: 1.8rem; margin: .3rem 0 .5rem; }

.pdz-reset {
  display: block; margin: .5rem auto 0; background: none; border: none;
  cursor: pointer; padding: 0; color: var(--muted);
  font-family: 'Nunito', sans-serif; font-size: .8rem; font-weight: 700;
  text-decoration: underline;
}
.pdz-reset:hover { color: var(--red); }

/* Игровая зона */
.pdz-game.hidden { display: none; }
.pdz-game-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .8rem; flex-wrap: wrap; margin-bottom: .2rem;
}
.pdz-game-head h2 {
  font-family: 'Playfair Display', Georgia, serif; font-size: 1.25rem;
  color: var(--forest); margin: 0;
}
.pdz-timer { font-weight: 800; color: var(--amber); font-size: 1.1rem; }
.pdz-timer.hidden { display: none; }
.pdz-game-sub { color: var(--muted); font-size: .87rem; margin: 0 0 .9rem; }

.pdz-card {
  text-align: center; font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700; color: var(--text); font-size: clamp(1.35rem, 5.6vw, 2rem);
  line-height: 1.35; margin: 1.1rem 0 .6rem; min-height: 2.4em;
  display: flex; align-items: center; justify-content: center;
  word-break: break-word;
}
.pdz-card.hidden, .pdz-hint.hidden { display: none; }
/* Единственный флекс-элемент карточки: внутри него куски фразы остаются
   inline и пробелы вокруг выделенного слова не схлопываются. */
.pdz-line { max-width: 100%; }
/* Выделенное слово — то, о падеже которого спрашивают. Подчёркивание, а не
   только цвет: на телефоне при ярком свете один цвет теряется. */
.pdz-hl {
  color: var(--forest); font-weight: 800;
  border-bottom: 3px solid var(--amber); padding-bottom: .1em;
}
.pdz-card.is-wrong .pdz-hl { color: var(--red); border-bottom-color: var(--red); }

.pdz-hint {
  text-align: center; color: var(--muted); font-size: .9rem;
  font-weight: 700; margin: 0 auto 1rem; min-height: 2.6em;
  max-width: 520px; line-height: 1.35;
}
.pdz-hint.is-ok { color: var(--forest-md); }
.pdz-hint.is-wrong { color: var(--red); }

.pdz-cats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem;
  max-width: 520px; margin: 0 auto;
}
@media (min-width: 620px) { .pdz-cats { grid-template-columns: repeat(3, 1fr); } }
.pdz-cats--endings { grid-template-columns: repeat(2, 1fr); max-width: 320px; }

.pdz-cat {
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: .95rem;
  background: var(--white); border: 2px solid var(--border); border-radius: 0;
  padding: .85rem .5rem; min-height: 3.1rem; cursor: pointer;
  color: var(--text); transition: all .12s; -webkit-tap-highlight-color: transparent;
}
.pdz-cat:hover:not(:disabled) { border-color: var(--forest-lt); background: var(--cream); }
.pdz-cat:active:not(:disabled) { transform: scale(.97); }
.pdz-cat.correct { background: var(--forest); color: #fff; border-color: var(--forest); animation: opt-correct .3s; }
.pdz-cat.wrong { background: #F8D7D3; border-color: var(--red); color: var(--red); }
.pdz-cat:disabled { cursor: default; }
.pdz-cats--endings .pdz-cat {
  font-family: 'Playfair Display', Georgia, serif; font-size: 1.9rem; min-height: 4rem;
}

.pdz-res-actions {
  display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1rem;
}

@media (max-width: 480px) {
  .pdz-card { font-size: clamp(1.2rem, 6.4vw, 1.7rem); }
  .pdz-cat { font-size: .86rem; padding: .8rem .35rem; }
  .pdz-stage-num { width: 2.2rem; height: 2.2rem; font-size: 1.2rem; }
  .pdz-stage-title { font-size: .92rem; }
}

/* «Дневник тренировок»: чипы серии дней / дневной цели / медалей под
   статистикой тренажёра и блок-мостик на экране результата. Общие данные
   в localStorage (rr_diary), рисует js/trainer-diary.js. */
.diary-widget {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .5rem; margin: .8rem auto 0; max-width: 560px;
}
.diary-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  font-family: 'Nunito', sans-serif; font-size: .85rem; font-weight: 700;
  color: var(--text); background: var(--ivory);
  border: 1px solid var(--border); border-radius: 0;
  padding: .3rem .75rem; text-decoration: none;
}
.diary-chip--fire { border-color: var(--amber); background: #FDF3E3; }
.diary-chip--done { border-color: var(--forest-lt); background: #F7EEDF; }
.diary-chip--link { color: var(--forest-md); border-color: var(--forest-lt); }
.diary-chip--link:hover { background: var(--cream); }

.diary-after {
  margin-top: 1rem; padding-top: .9rem;
  border-top: 1px dashed var(--border);
  font-family: 'Nunito', sans-serif; font-size: .95rem; line-height: 1.55;
}
.diary-after p { margin: 0 0 .7rem; }
.diary-next {
  display: inline-block; font-weight: 800; text-decoration: none;
  color: #fff; background: var(--forest-md);
  border-radius: 0; padding: .55rem 1.2rem;
}
.diary-next:hover { background: var(--forest); }

/* Страница дневника: карточки сводки, таблица, совет. */
.diary-summary {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: .7rem; margin: 1.2rem 0;
}
@media (max-width: 560px) { .diary-summary { grid-template-columns: repeat(2, 1fr); } }
.diary-card {
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
  background: var(--white); border: 2px solid var(--border);
  border-radius: 0; padding: .9rem .5rem; text-align: center;
}
.diary-card__icon { font-size: 1.5rem; }
.diary-card__num {
  font-family: 'Playfair Display', serif; font-size: 1.6rem; color: var(--forest);
}
.diary-card__label {
  font-family: 'Nunito', sans-serif; font-size: .8rem; color: var(--muted);
}
.diary-empty, .diary-tip p {
  font-family: 'Nunito', sans-serif; background: var(--cream);
  border: 1px solid var(--border); border-radius: 0;
  padding: .9rem 1.1rem; line-height: 1.55;
}
.diary-tip { margin: 1rem 0 1.4rem; }
.diary-table-wrap { margin: 1rem 0; }

/* Хаб /trainers/: сетка карточек (разметка карточек общая с главной,
   стили .trainer-card живут в style.css) и бейдж прогресса из дневника. */
.hub-filters { display: flex; justify-content: center; margin: 1.1rem 0; }
.hub-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem; margin: 1.2rem 0 2rem;
}
.trainer-card__progress {
  display: inline-block; margin-top: .5rem;
  font-family: 'Nunito', sans-serif; font-size: .78rem; font-weight: 800;
  color: var(--forest-md); background: #F7EEDF;
  border-radius: 0; padding: .18rem .6rem;
}


/* Тренажёр «Часы»: циферблат рисуется в SVG самим js (js/trainer-chasy.js),
   поэтому здесь только оформление — цвета стрелок и делений. Часовая
   стрелка короче и толще минутной: на детском циферблате их путают, и
   разница в длине — единственный надёжный признак. */
.clk {
  display: block; width: 100%; max-width: 300px; margin: .4rem auto 1rem;
  height: auto; overflow: visible;
}
.clk--sm { max-width: 128px; margin: 0 auto; }
.clk-face { fill: var(--white); stroke: var(--forest); stroke-width: 4; }
.clk-tick { stroke: var(--border); stroke-width: 1.6; }
.clk-tick--big { stroke: var(--forest-lt); stroke-width: 3.2; }
.clk-num {
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 21px;
  fill: var(--text); text-anchor: middle; dominant-baseline: central;
}
.clk-min {
  font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 13px;
  fill: var(--amber); text-anchor: middle; dominant-baseline: central;
}
.clk-hand { stroke-linecap: round; }
.clk-hand--h { stroke: var(--forest); stroke-width: 9; }
.clk-hand--m { stroke: var(--amber); stroke-width: 5.5; }
.clk-pin { fill: var(--forest); stroke: var(--white); stroke-width: 2; }
.clk--sm .clk-num { font-size: 24px; }
.clk--sm .clk-hand--h { stroke-width: 11; }
.clk--sm .clk-hand--m { stroke-width: 7; }
#ch-clock.hidden { display: none; }

/* варианты ответа: словесные фразы длиннее чисел, циферблаты — квадратные */
.mult-opt.is-text {
  font-size: 1.02rem; font-weight: 700; line-height: 1.3; padding: .85rem .6rem;
}
.mult-opt.is-clock { padding: .5rem; }
.mult-opt.is-clock.correct .clk-face { stroke: #fff; }
.mult-opt.is-clock.correct .clk-num { fill: #fff; }
.mult-opt.is-clock.correct .clk-hand--h { stroke: #fff; }
.mult-opt.is-clock.correct .clk-tick, .mult-opt.is-clock.correct .clk-tick--big { stroke: rgba(255,255,255,.6); }
.mult-opt.is-clock.correct .clk-pin { fill: #fff; stroke: var(--forest); }
@media (max-width: 420px) {
  .clk { max-width: 250px; }
  .mult-opt.is-text { font-size: .93rem; }
}

/* Тренажёр «Дроби»: круги и полосы рисуются в SVG самим js
   (js/trainer-drobi.js), здесь только цвета. Закрашенные части — янтарь,
   незакрашенные — светлый крем: контраст должен читаться и на маленьком
   экране, и в кнопках-вариантах. */
.drb-pie {
  display: block; width: 100%; max-width: 190px; margin: .4rem auto 1rem;
  height: auto;
}
.drb-pie--sm { max-width: 96px; margin: 0 .5rem; display: inline-block; vertical-align: middle; }
.drb-bar {
  display: block; width: 100%; max-width: 320px; margin: 1.2rem auto 1.6rem;
  height: auto;
}
.drb-seg { fill: var(--ivory); stroke: var(--forest); stroke-width: 2.5; }
.drb-seg--fill { fill: var(--amber); }
.drb-rim { fill: none; stroke: var(--forest); stroke-width: 4; }
.drb-cell { fill: var(--ivory); stroke: var(--forest); stroke-width: 2.5; }
.drb-cell--fill { fill: var(--amber); }

/* дробь столбиком: числитель над чертой, знаменатель под */
.drb-frac {
  display: inline-flex; flex-direction: column; align-items: center;
  font-family: 'Nunito', sans-serif; font-weight: 800; line-height: 1.25;
  vertical-align: middle;
}
.drb-fnum { border-bottom: 3px solid currentColor; padding: 0 .45em .05em; }
.drb-fden { padding: .05em .45em 0; }

/* сцена задания: пара дробей со знаком вопроса, «дробь от числа» */
#drb-stage { text-align: center; }
#drb-stage.hidden { display: none; }
.drb-duo {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  font-size: 1.9rem; color: var(--text); margin: .6rem 0 .8rem;
}
.drb-ask {
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.6rem;
  color: var(--amber); background: var(--cream); border: 2px dashed var(--amber);
  border-radius: 0; padding: .2rem .7rem;
}
.drb-of { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.5rem; }
.drb-duo-pics { margin-bottom: 1rem; }

/* Разбор ошибки. .mult-question свёрстан под короткие «7 × 8» шрифтом до
   3.4rem, а здесь в него попадает целое предложение: «Правильно: 1/3 > 1/8:
   числители равны, а чем больше знаменатель, тем мельче доля». Тем же
   кеглем оно занимает 636px и выталкивает кнопки за нижний край экрана —
   проверено в браузере на 390×844. Поэтому разбор набирается текстом. */
.mult-question.is-explain {
  font-family: 'Nunito', sans-serif; font-weight: 700;
  font-size: 1.05rem; line-height: 1.45; color: var(--text-md);
  margin: .7rem auto 1.1rem; max-width: 30rem;
}

/* варианты ответа: дроби крупно, знаки сравнения — ещё крупнее */
.mult-opt.is-frac { font-size: 1.25rem; padding: .6rem .5rem; }
.mult-opt.is-sign { font-size: 1.7rem; font-weight: 800; padding: .55rem .5rem; }
@media (max-width: 420px) {
  .drb-duo { font-size: 1.55rem; gap: .7rem; }
  .drb-pie { max-width: 160px; }
  .drb-pie--sm { max-width: 82px; }
}

/* ---- Карточка-шеринг (js/trainer-share.js) ----
   Кнопка намеренно вторичная — белая с обводкой, тогда как .diary-next
   залита цветом: мостик «Дальше: <тренажёр>» уводит в следующий тренажёр и
   для сайта важнее, чем отправка картинки. */
.shr-wrap {
  margin-top: .9rem; padding-top: .85rem;
  border-top: 1px dashed var(--border);
}
.shr-btn {
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: .95rem;
  color: var(--forest-md); background: #fff;
  border: 2px solid var(--forest-lt); border-radius: 0;
  padding: .55rem 1.2rem; cursor: pointer;
}
.shr-btn:hover:not(:disabled) { background: var(--cream); }
.shr-btn:disabled { opacity: .55; cursor: default; }
.shr-note { margin: .7rem 0 0; font-size: .85rem; color: var(--muted); }
.shr-preview {
  display: block; width: 100%; max-width: 240px;
  margin: .6rem auto 0; border-radius: 0;
}

/* ============================================================
   Вертикальный ритм на телефоне (16.08.2026)
   ============================================================
   На 390x844 варианты ответа уезжали ниже экрана: у «Состава числа»
   в режиме «домики» низ поля был на 294px ниже нижней границы, у
   «Умножения» — на 121px, у «Чтения по слогам» запас был всего 16px.
   Ребёнок жал «Начать» и не видел, куда отвечать, пока не прокрутит.

   Причина не в одном блоке, а в сумме воздуха: над игрой стоят полоса
   «к школе» (88px), шапка (60), хлебные крошки, эмодзи, h1, лид, панель
   режимов, табло, чипы дневника и полоса прогресса — почти 800px на
   экране высотой 844. Поэтому режется весь вертикальный ритм разом, а не
   один отступ.

   Блок стоит последним в файле намеренно: он перекрывает более ранний
   @media (max-width: 480px), где заданы .sc-house и .mult-question.
   Правило: правишь этот блок — перемеряй пробой
   .tmp/polish/verstka_probe.js на 390 и 360. */
@media (max-width: 560px) {
  .trainer-page { padding: .75rem 0 2rem; }

  /* шапка страницы: эмодзи декоративное, на телефоне съедает 48px */
  .trainer-head { margin-bottom: .6rem; }
  .trainer-head .trainer-emoji { display: none; }
  .trainer-head h1 { margin-bottom: .35rem; }
  .trainer-head p.lead { font-size: .94rem; line-height: 1.4; }

  .trainer-intro { margin-bottom: .7rem; }
  .trainer-intro p { font-size: .92rem; line-height: 1.45; }
  .trainer-controls { margin: .5rem 0 .6rem; gap: .45rem; }
  .trainer-stats { margin-bottom: .5rem; }
  .stat-box .stat-num { font-size: 1.35rem; }
  .stat-box .stat-label { margin-top: .1rem; font-size: .68rem; }

  /* Чипы дневника: четыре штуки занимали 343px при доступных 342 — из-за
     одного пикселя строка ломалась пополам и блок стоил 66px вместо 30.
     Ужаты padding и gap, запас теперь ~30px. */
  .diary-widget { margin-top: .4rem; gap: .3rem; }
  .diary-chip { font-size: .76rem; padding: .2rem .5rem; gap: .22rem; }

  .mult-progress { margin-bottom: .55rem; }
  .mult-question { margin: .5rem 0 .7rem; }
  .mult-options { gap: .55rem; }
  .mult-opt { padding: .8rem; }
  .trainer-actions { margin-top: .8rem; }

  /* домик «Состава числа» — самый высокий игровой элемент сайта */
  .sc-house { max-width: 200px; margin-top: .2rem; }
  .sc-body { padding: .7rem .7rem .8rem; gap: .6rem; }
  .mult-question.is-house { margin: .45rem 0 .6rem; }

  .cs-word { margin: .5rem 0 .6rem; }
  .slov-card { margin: .5rem 0 .4rem; }
}

/* ---- Замер техники чтения ----
   Текст крупный и с большим межстрочным: по нему ребёнок читает вслух с
   расстояния вытянутой руки, а родитель должен попасть пальцем в конкретное
   слово — отсюда и padding у слова, и высота строки почти в два кегля. */
/* Общего .hidden на сайте нет — каждый тренажёр объявляет свой. Без этого
   правила все три экрана замера показывались бы разом. */
#tc .hidden { display: none; }
.tc-short {
  background: var(--cream); border-left: 4px solid var(--forest);
  border-radius: 0; padding: .9rem 1.1rem; margin: 0 0 1.6rem;
}
.tc-short p { margin: 0; font-size: .95rem; line-height: 1.6; color: var(--text-md); }

.tc-steps { margin: 1.2rem auto 1.4rem; max-width: 620px; padding-left: 1.3rem; }
.tc-steps li { margin-bottom: .5rem; color: var(--text-md); line-height: 1.5; }

.tc-bar-top {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  flex-wrap: wrap; margin-bottom: .6rem;
}
.tc-bar-top strong { font-family: 'Playfair Display', Georgia, serif; color: var(--forest); font-size: 1.1rem; }
.tc-clock {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 800; font-size: 1.8rem;
  color: var(--forest); font-variant-numeric: tabular-nums; min-width: 84px;
}
.tc-clock.is-over { color: var(--amber); }
.tc-hint { color: var(--muted); font-size: .9rem; margin: 0 0 .8rem; }

.tc-text {
  font-size: clamp(1.15rem, 4vw, 1.4rem); line-height: 2; color: var(--text);
  background: var(--white); border: 1px solid var(--border); border-radius: 0;
  padding: 1.1rem 1.2rem; user-select: none;
}
.tc-w { padding: .1rem .12rem; border-radius: 0; cursor: pointer; }
.tc-w:hover { background: var(--amber-lt); color: #fff; }
.tc-w.is-read { background: rgba(184, 67, 26,.09); }

.tc-h { font-family: 'Playfair Display', Georgia, serif; color: var(--forest); font-size: 1.25rem; margin: .2rem 0 .3rem; }
.tc-q { margin: 0 0 1.1rem; }
.tc-q-t { font-weight: 700; color: var(--text); margin: 0 0 .4rem; }
.tc-a {
  display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem;
  border: 1px solid var(--border-lt); border-radius: 0; margin-bottom: .35rem;
  cursor: pointer; color: var(--text-md);
}
.tc-a:hover { border-color: var(--forest-lt); background: var(--cream); }
.tc-a input { accent-color: var(--forest); width: 1.05rem; height: 1.05rem; }

.tc-nums { display: flex; justify-content: center; gap: 2.2rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tc-num { text-align: center; }
.tc-num span {
  display: block; font-family: 'Playfair Display', Georgia, serif; font-weight: 800;
  font-size: 2.4rem; line-height: 1; color: var(--forest); font-variant-numeric: tabular-nums;
}
.tc-num small { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

.tc-scale { max-width: 460px; margin: 0 auto 1rem; }
.tc-bar { position: relative; height: 12px; background: var(--ivory); border-radius: 0; overflow: hidden; }
.tc-bar-norm { position: absolute; top: 0; height: 100%; background: rgba(184, 67, 26,.16); }
.tc-bar-fill { position: absolute; top: 0; left: 0; height: 100%; background: var(--forest); border-radius: 0; }
.tc-scale-cap { font-size: .82rem; color: var(--muted); margin: .4rem 0 0; }

.tc-verdict { font-family: 'Playfair Display', Georgia, serif; font-size: 1.2rem; font-weight: 800; margin: .2rem 0 .5rem; }
.tc-verdict.is-above, .tc-verdict.is-in { color: var(--forest); }
.tc-verdict.is-below { color: var(--amber); }
.tc-advice { color: var(--text-md); line-height: 1.6; max-width: 620px; margin: 0 auto .6rem; }
.tc-compare { font-size: .9rem; color: var(--muted); }
/* Рекомендация в совете должна читаться как ссылка: без этого она выглядела
   как обычный текст в кавычках, и родитель просто не понимал, что это переход. */
.tc-advice a { color: var(--forest); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.tc-advice a:hover { color: var(--amber); }

.tc-norms { width: 100%; border-collapse: collapse; margin: 1rem 0 1.2rem; font-size: .95rem; }
.tc-norms th, .tc-norms td { padding: .55rem .7rem; border-bottom: 1px solid var(--border-lt); text-align: left; }
.tc-norms th { color: var(--forest); font-weight: 800; }

/* ---- Устный счёт: трасса, пример, цифровая клавиатура (25.08.2026) ---- */
.usch-track { max-width: 480px; margin: 0 auto 1.1rem; padding: 0 6px; }
.usch-track__road {
  position: relative; height: 34px;
  background: var(--ivory);
  border-radius: 0; overflow: hidden; border: 1px solid var(--border);
}
.usch-track__road::after {
  content:''; position: absolute; right: 2px; top: 50%;
  transform: translateY(-50%); font-size: 1.15rem; line-height: 1;
}
.usch-track__car {
  position: absolute; top: 50%; left: 0%; transform: translateY(-50%);
  font-size: 1.5rem; line-height: 1; transition: left .25s ease;
}

.usch-task {
  text-align: center; font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800; color: var(--forest); font-size: clamp(2rem, 8vw, 2.9rem);
  margin: .8rem 0 .35rem; font-variant-numeric: tabular-nums; min-height: 1.2em;
}
/* Разбор ошибки — короткая фраза, не заголовочный кегль: тем же приёмом,
   что у «Дробей» (is-explain), иначе текст выталкивает клавиатуру за экран. */
.usch-task.is-wrong {
  font-family: 'Nunito', sans-serif; font-weight: 700; color: var(--red);
  font-size: clamp(1.1rem, 4.5vw, 1.4rem);
}
.usch-answer {
  text-align: center; font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800; color: var(--amber); font-size: clamp(1.7rem, 6.5vw, 2.4rem);
  min-height: 1.3em; margin: 0 auto .9rem; max-width: 240px;
  border-bottom: 3px solid var(--border); padding-bottom: .15rem;
  font-variant-numeric: tabular-nums;
}

.usch-keypad {
  max-width: 320px; margin: 0 auto; display: grid;
  grid-template-columns: repeat(3, 1fr); gap: .5rem;
}
.usch-keypad.hidden { display: none; }
.usch-keypad button {
  min-height: 52px; border-radius: 0; border: 1px solid var(--border);
  background: var(--white); font-family: inherit; font-weight: 800;
  font-size: 1.3rem; color: var(--text); cursor: pointer; transition: all .12s;
}
.usch-keypad button:hover { background: var(--cream); border-color: var(--forest-lt); }
.usch-keypad button:active { transform: scale(.95); }
/* Знак «±» нужен только на уровне 5–6 класса (отрицательные числа) — на
   младших уровнях он путает больше, чем помогает, и скрыт по умолчанию. */
.usch-keypad__sign { visibility: hidden; color: var(--muted); }
.usch-keypad--neg .usch-keypad__sign { visibility: visible; }
.usch-keypad__back { color: var(--muted); font-size: 1.1rem; }
.usch-keypad__ok {
  grid-column: 1 / -1; background: var(--forest); color: #fff;
  min-height: 52px; border-radius: 0; font-size: 1.05rem; border: none;
}
.usch-keypad__ok:hover { background: var(--forest-md); }

@media (max-width: 560px) {
  .usch-task { margin: .5rem 0 .25rem; }
  .usch-answer { margin-bottom: .6rem; }
  .usch-keypad { max-width: 270px; gap: .4rem; }
  .usch-keypad button { min-height: 46px; font-size: 1.15rem; }
  .usch-keypad__ok { min-height: 46px; font-size: .95rem; }
  .usch-track { margin-bottom: .7rem; }
}

/* ---- Уравнения: падающие «захватчики», уравнение, клавиатура (26.08.2026) ---- */
.uravn-sky {
  position: relative; max-width: 480px; height: 110px; margin: 0 auto .7rem;
  background: var(--ivory);
  border-radius: 0; border: 1px solid var(--border); overflow: hidden;
}
.uravn-invader {
  position: absolute; top: 2%; left: 0; transform: translateX(-50%);
  text-align: center; transition-property: top; transition-timing-function: linear;
}
.uravn-invader__icon { display: block; font-size: 1.5rem; line-height: 1; }
.uravn-invader__num {
  display: block; margin-top: .15rem; font-family: 'Nunito', sans-serif;
  font-weight: 800; font-size: .85rem; color: var(--forest);
  background: var(--white); border: 1px solid var(--border); border-radius: 0;
  padding: .05rem .5rem; font-variant-numeric: tabular-nums;
}
.uravn-invader.is-hit { animation: uravn-pop .35s ease forwards; }
.uravn-invader.is-hit .uravn-invader__num { background: var(--forest); color: #fff; border-color: var(--forest); }
.uravn-invader.is-miss .uravn-invader__num { background: var(--red); color: #fff; border-color: var(--red); }
@keyframes uravn-pop { to { opacity: 0; transform: translateX(-50%) scale(1.5); } }
@media (prefers-reduced-motion: reduce) { .uravn-invader { transition-duration: .01s !important; } }

.uravn-task {
  text-align: center; font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800; color: var(--forest); font-size: clamp(1.35rem, 6.5vw, 2.1rem);
  margin: .4rem 0 .35rem; font-variant-numeric: tabular-nums; min-height: 1.3em;
}
.uravn-task.is-wrong {
  font-family: 'Nunito', sans-serif; font-weight: 700; color: var(--red);
  font-size: clamp(1.02rem, 4.2vw, 1.25rem);
}
.uravn-answer {
  text-align: center; font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800; color: var(--amber); font-size: clamp(1.5rem, 6vw, 2.1rem);
  min-height: 1.3em; margin: 0 auto .9rem; max-width: 240px;
  border-bottom: 3px solid var(--border); padding-bottom: .15rem;
  font-variant-numeric: tabular-nums;
}

.uravn-keypad {
  max-width: 320px; margin: 0 auto; display: grid;
  grid-template-columns: repeat(3, 1fr); gap: .5rem;
}
.uravn-keypad.hidden { display: none; }
.uravn-keypad button {
  min-height: 52px; border-radius: 0; border: 1px solid var(--border);
  background: var(--white); font-family: inherit; font-weight: 800;
  font-size: 1.3rem; color: var(--text); cursor: pointer; transition: all .12s;
}
.uravn-keypad button:hover { background: var(--cream); border-color: var(--forest-lt); }
.uravn-keypad button:active { transform: scale(.95); }
/* Знак «±» скрыт только на уровне «2–4 класс» (корень всегда положительный) —
   на уровнях с двумя действиями и со скобками отрицательный корень обычное дело. */
.uravn-keypad__sign { color: var(--muted); }
.uravn-keypad--pos .uravn-keypad__sign { visibility: hidden; }
.uravn-keypad__back { color: var(--muted); font-size: 1.1rem; }
.uravn-keypad__ok {
  grid-column: 1 / -1; background: var(--forest); color: #fff;
  min-height: 52px; border-radius: 0; font-size: 1.05rem; border: none;
}
.uravn-keypad__ok:hover { background: var(--forest-md); }

@media (max-width: 560px) {
  .uravn-sky { height: 92px; }
  .uravn-invader__icon { font-size: 1.25rem; }
  .uravn-invader__num { font-size: .75rem; }
  .uravn-task { margin: .3rem 0 .2rem; }
  .uravn-answer { margin-bottom: .6rem; }
  .uravn-keypad { max-width: 270px; gap: .4rem; }
  .uravn-keypad button { min-height: 46px; font-size: 1.15rem; }
  .uravn-keypad__ok { min-height: 46px; font-size: .95rem; }
}

/* Силуэты зверей вместо эмодзи (30.08.2026). Размер задаём в CSS: svg с
   width/height 100% растянулся бы на всю карточку до самых краёв, а фигуре
   нужен воздух — иначе уши и рога упираются в рамку и силуэты перестают
   различаться, ради чего всё и делалось. */
.memori-front svg { width: 66%; height: 66%; color: var(--forest); display: block; }
.memori-card.is-matched .memori-front svg { color: var(--amber-dk); }
.memori-sound svg { width: 22px; height: 22px; color: currentColor; }

/* ── Деление столбиком (11.09.2026) ──
   Уголок как в тетради: слева делимое и вычитания по клеткам, справа делитель
   под углом и частное. Клетки — сетка фиксированной ширины, иначе цифры
   произведения уезжают из-под своих разрядов, и столбик перестаёт быть
   столбиком. Углы прямые, без эмодзи — строгая сетка сайта. */
.dst-board {
  display: flex; justify-content: center; align-items: flex-start;
  margin: 1.2rem auto .6rem; font-size: 1.6rem; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--text); line-height: 1;
}
.dst-work {
  display: grid; grid-auto-rows: 2.1rem;
  grid-template-columns: repeat(var(--dst-cols, 4), 1.35em); padding-right: .35em;
}
.dst-cell { display: flex; align-items: center; justify-content: center; }
.dst-cell.is-under { border-bottom: 2px solid var(--text); }
.dst-cell.is-minus { color: var(--muted); }
.dst-cell.is-now { background: rgba(212,135,10,.16); }
.dst-side { display: flex; flex-direction: column; }
.dst-divisor {
  height: 2.1rem; min-width: 3.2em; padding: 0 .4em; display: flex; align-items: center;
  border-left: 2px solid var(--text); border-bottom: 2px solid var(--text);
}
.dst-quot { display: flex; height: 2.1rem; align-items: center; padding-left: .4em; }
.dst-qcell { width: 1.35em; height: 1.8rem; display: flex; align-items: center; justify-content: center; }
.dst-qcell.is-now { outline: 2px solid var(--amber); background: rgba(212,135,10,.12); }
.dst-prompt { text-align: center; font-size: 1.15rem; font-weight: 700; margin: .4rem 0 .2rem; min-height: 1.6em; }
.dst-prompt.is-wrong, .dst-answer.is-wrong { color: #B3261E; }
.dst-answer { text-align: center; font-size: 2rem; font-weight: 800; margin-bottom: .6rem; min-height: 1.3em; }
@media (max-width: 560px) {
  .dst-board { font-size: 1.25rem; }
  .dst-work { grid-auto-rows: 1.8rem; }
  .dst-divisor, .dst-quot { height: 1.8rem; }
  .dst-prompt { font-size: 1rem; }
}
