/* ==========================================================================
   Foxam Design System — mobile first
   Токены → база → компоненты → экраны → совместимость со старыми страницами.
   Брейкпоинты: 768 (планшет), 1024 (ноутбук), 1440 (десктоп).
   ========================================================================== */

/* ---------- 1. Токены ---------- */
:root {
  /* Бренд */
  --fx-orange: #FF7A1A;
  --fx-orange-dark: #E25F00;
  --fx-orange-soft: #FFF0E3;
  /* Поверхности */
  --fx-bg: #FFF8EE;
  --fx-surface: #FFFFFF;
  --fx-surface-2: #FBF5EC;
  --fx-line: #F0E5D6;
  --fx-line-strong: #E4D5C1;
  /* Текст */
  --fx-ink: #1F2E45;
  --fx-ink-2: #4A5568;
  --fx-muted: #8A8F9C;
  /* Семантика */
  --fx-yellow: #FFC531;      --fx-yellow-dark: #E3A400;  --fx-yellow-soft: #FFF6D6;
  --fx-blue: #2FA4F0;        --fx-blue-dark: #1782C9;    --fx-blue-soft: #E5F4FE;
  --fx-green: #46C25E;       --fx-green-dark: #2E9E45;   --fx-green-soft: #E6F8EA;
  --fx-coral: #FF6B5E;       --fx-coral-dark: #E04A3C;   --fx-coral-soft: #FFECEA;
  --fx-purple: #8D63F2;      --fx-purple-dark: #6C43D6;  --fx-purple-soft: #F1EBFF;
  --fx-grey: #C9CDD4;        --fx-grey-dark: #A7ADB7;    --fx-grey-soft: #F2F3F5;
  /* Типографика */
  --fx-font: 'Nunito', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --fx-fs-xs: 0.8125rem;
  --fx-fs-sm: 0.9375rem;
  --fx-fs-md: 1.0625rem;
  --fx-fs-lg: 1.25rem;
  --fx-fs-xl: 1.5rem;
  --fx-fs-2xl: 1.875rem;
  --fx-fs-3xl: 2.25rem;
  /* Пространство */
  --fx-s1: 4px; --fx-s2: 8px; --fx-s3: 12px; --fx-s4: 16px; --fx-s5: 20px; --fx-s6: 24px; --fx-s8: 32px; --fx-s10: 40px; --fx-s12: 48px;
  /* Форма */
  --fx-r-sm: 12px; --fx-r-md: 16px; --fx-r-lg: 20px; --fx-r-xl: 28px; --fx-r-full: 999px;
  --fx-shadow-card: 0 2px 0 var(--fx-line), 0 8px 24px rgba(31, 46, 69, 0.06);
  --fx-shadow-pop: 0 18px 48px rgba(31, 46, 69, 0.18);
  --fx-press: 4px;              /* глубина «объёмной» кнопки */
  /* Движение */
  --fx-ease: cubic-bezier(.2, .8, .2, 1);
  --fx-ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --fx-t-fast: 120ms;
  --fx-t: 220ms;
  --fx-t-slow: 420ms;
  /* Каркас */
  --fx-header-h: 60px;
  --fx-bottom-nav-h: 68px;
  --fx-max: 1120px;
  --fx-gutter: 16px;
  /* Совместимость со старыми inline-стилями страниц */
  --main-orange: var(--fx-orange);
  --dark-blue: var(--fx-ink);
  --accent-gradient: var(--fx-orange);
}

/* ---------- 2. База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--fx-font);
  font-size: var(--fx-fs-md);
  line-height: 1.5;
  color: var(--fx-ink);
  background: var(--fx-bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body.has-bottom-nav { padding-bottom: calc(var(--fx-bottom-nav-h) + env(safe-area-inset-bottom)); }
img, svg, video { max-width: 100%; }
img { height: auto; }
a { color: var(--fx-blue-dark); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 var(--fx-s3); font-weight: 900; letter-spacing: -0.01em; }
h1 { font-size: var(--fx-fs-2xl); }
h2 { font-size: var(--fx-fs-xl); }
h3 { font-size: var(--fx-fs-lg); }
p { margin: 0 0 var(--fx-s3); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--fx-blue); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--fx-max); margin: 0 auto; padding-left: var(--fx-gutter); padding-right: var(--fx-gutter); }
.container.narrow { max-width: 720px; }
.page { padding-top: var(--fx-s5); padding-bottom: var(--fx-s10); }
.section { margin-top: var(--fx-s8); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: var(--fx-s3); margin-bottom: var(--fx-s4); }
.section-title h2 { margin: 0; font-size: var(--fx-fs-lg); }
.muted, .text-muted { color: var(--fx-muted); }
.mt-2 { margin-top: var(--fx-s2); } .mt-3 { margin-top: var(--fx-s4); } .mt-4 { margin-top: var(--fx-s8); }
.stack > * + * { margin-top: var(--fx-s4); }

/* ---------- 3. Кнопки (объёмные, с эффектом нажатия) ---------- */
.btn, button.login-btn, a.login-btn, .login-btn {
  --btn-bg: var(--fx-orange);
  --btn-edge: var(--fx-orange-dark);
  --btn-fg: #fff;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--fx-s2);
  min-height: 48px;
  padding: 12px 22px !important;
  margin: 0 0 var(--fx-press) 0;
  border: 0 !important;
  border-radius: var(--fx-r-md) !important;
  background: var(--btn-bg) !important;
  color: var(--btn-fg) !important;
  box-shadow: 0 var(--fx-press) 0 var(--btn-edge);
  font-weight: 800; font-size: var(--fx-fs-md); line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none; text-align: center;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform var(--fx-t-fast) var(--fx-ease), box-shadow var(--fx-t-fast) var(--fx-ease), filter var(--fx-t-fast);
}
.btn:hover, .login-btn:hover { filter: brightness(1.05); }
.btn:active, .login-btn:active, .btn.is-pressed { transform: translateY(var(--fx-press)); box-shadow: 0 0 0 var(--btn-edge); }
.btn:disabled, .btn.is-disabled, .login-btn:disabled {
  --btn-bg: var(--fx-grey-soft); --btn-edge: var(--fx-line-strong); --btn-fg: var(--fx-grey-dark);
  cursor: not-allowed; filter: none; transform: none;
}
.btn--secondary, .secondary-btn {
  --btn-bg: var(--fx-surface); --btn-edge: var(--fx-line-strong); --btn-fg: var(--fx-ink);
  border: 2px solid var(--fx-line-strong) !important;
}
.btn--green { --btn-bg: var(--fx-green); --btn-edge: var(--fx-green-dark); }
.btn--blue { --btn-bg: var(--fx-blue); --btn-edge: var(--fx-blue-dark); }
.btn--coral { --btn-bg: var(--fx-coral); --btn-edge: var(--fx-coral-dark); }
.btn--purple { --btn-bg: var(--fx-purple); --btn-edge: var(--fx-purple-dark); }
.btn--ghost { --btn-bg: transparent; --btn-edge: transparent; --btn-fg: var(--fx-blue-dark); box-shadow: none; }
.btn--ghost:active { transform: none; }
.btn--lg { min-height: 56px; font-size: var(--fx-fs-lg); border-radius: var(--fx-r-lg) !important; }
.btn--sm { min-height: 40px; padding: 8px 14px !important; font-size: var(--fx-fs-sm); }
.btn--block { display: flex; width: 100%; }
.btn--icon { width: 48px; padding: 0 !important; }
.link-btn { background: none; border: 0; padding: 6px 0; color: var(--fx-blue-dark); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 4. Карточки, чипы, прогресс ---------- */
.card {
  background: var(--fx-surface);
  border: 2px solid var(--fx-line);
  border-radius: var(--fx-r-lg);
  padding: var(--fx-s5);
  box-shadow: 0 3px 0 var(--fx-line);
}
.card--flat { box-shadow: none; }
.card--tap { display: block; color: inherit; text-decoration: none; cursor: pointer; transition: transform var(--fx-t-fast) var(--fx-ease), box-shadow var(--fx-t-fast), border-color var(--fx-t-fast); }
.card--tap:hover { border-color: var(--fx-line-strong); }
.card--tap:active { transform: translateY(3px); box-shadow: 0 0 0 var(--fx-line); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 4px 12px;
  border-radius: var(--fx-r-full);
  background: var(--fx-surface); border: 2px solid var(--fx-line);
  font-weight: 800; font-size: var(--fx-fs-sm); color: var(--fx-ink);
  white-space: nowrap; text-decoration: none;
}
.chip img, .chip svg { width: 22px; height: 22px; flex: none; }
.chip--streak { color: var(--fx-orange-dark); }
.chip--streak.is-off { color: var(--fx-muted); }
.chip--xp { color: var(--fx-purple-dark); }
.chip--grade { color: var(--fx-blue-dark); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: var(--fx-r-full); font-size: var(--fx-fs-xs); font-weight: 800; background: var(--fx-grey-soft); color: var(--fx-ink-2); }
.badge--green { background: var(--fx-green-soft); color: var(--fx-green-dark); }
.badge--orange { background: var(--fx-orange-soft); color: var(--fx-orange-dark); }
.badge--purple { background: var(--fx-purple-soft); color: var(--fx-purple-dark); }
.badge--blue { background: var(--fx-blue-soft); color: var(--fx-blue-dark); }

.progress { position: relative; height: 14px; border-radius: var(--fx-r-full); background: var(--fx-grey-soft); overflow: hidden; }
.progress__fill {
  height: 100%; width: 0; border-radius: inherit;
  background: var(--fx-green);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.08);
  transition: width var(--fx-t-slow) var(--fx-ease);
  position: relative;
}
.progress__fill::after { /* блик */
  content: ''; position: absolute; left: 8px; right: 8px; top: 3px; height: 3px; border-radius: 3px; background: rgba(255,255,255,0.45);
}
.progress--orange .progress__fill { background: var(--fx-orange); }
.progress--purple .progress__fill { background: var(--fx-purple); }
.progress--yellow .progress__fill { background: var(--fx-yellow); }
.progress--sm { height: 10px; }
.progress--sm .progress__fill::after { display: none; }

.ring { position: relative; display: inline-grid; place-items: center; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring__track { stroke: var(--fx-grey-soft); }
.ring__value { stroke: var(--fx-green); stroke-linecap: round; transition: stroke-dashoffset 900ms var(--fx-ease); }
.ring__label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-weight: 900; line-height: 1.1; }

/* ---------- 5. Иконки UI ---------- */
.ico { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ico--fill { fill: currentColor; stroke: none; }

/* ---------- 6. Шапка ---------- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 248, 238, 0.94);
  -webkit-backdrop-filter: saturate(1.4) blur(8px); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 2px solid var(--fx-line);
}
.app-header__inner { display: flex; align-items: center; gap: var(--fx-s2); height: var(--fx-header-h); }
.app-logo { display: flex; align-items: center; flex: none; margin-right: auto; }
.app-logo img { height: 40px; width: auto; display: block; }
.app-nav { display: none; }
.app-header__stats { display: flex; align-items: center; gap: 6px; }
.app-header__stats .chip { min-height: 34px; padding: 2px 10px; border-width: 0; background: transparent; }
.grade-select {
  appearance: none; -webkit-appearance: none;
  min-height: 36px; padding: 4px 30px 4px 12px;
  border-radius: var(--fx-r-full); border: 2px solid var(--fx-line);
  background: var(--fx-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231782C9' stroke-width='2.2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  font-weight: 800; font-size: var(--fx-fs-sm); color: var(--fx-blue-dark); cursor: pointer;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: var(--fx-r-sm); border: 0; background: transparent; color: var(--fx-ink-2); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--fx-surface-2); }
.icon-btn:active { transform: scale(0.94); }
.avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; background: var(--fx-orange-soft); border: 2px solid var(--fx-line); display: grid; place-items: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 88px; height: 88px; border-width: 3px; }
.app-header__account { display: none; }

/* Поиск */
.search-panel { display: none; padding: 0 0 var(--fx-s3); }
.search-panel.is-open { display: block; }
.header-search { position: relative; display: flex; }
.header-search input {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px 0 44px;
  border: 2px solid var(--fx-line-strong); border-radius: var(--fx-r-md); background: var(--fx-surface);
  font-size: var(--fx-fs-md); outline: none; transition: border-color var(--fx-t);
}
.header-search input:focus { border-color: var(--fx-blue); }
.header-search > .ico { position: absolute; left: 14px; top: 12px; color: var(--fx-muted); }
.header-search button[type=submit] { display: none; }
.header-search-results {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--fx-surface); border: 2px solid var(--fx-line); border-radius: var(--fx-r-md); box-shadow: var(--fx-shadow-pop);
  max-height: 60vh; overflow-y: auto;
}
.header-search-results.active { display: block; }
.header-search-result { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--fx-ink); text-decoration: none; border-bottom: 1px solid var(--fx-line); }
.header-search-result:hover { background: var(--fx-surface-2); }
.header-search-result-icon { font-size: 1.2rem; }
.header-search-result-name { display: block; font-weight: 800; font-size: var(--fx-fs-sm); }
.header-search-result-meta { display: block; font-size: var(--fx-fs-xs); color: var(--fx-muted); }
.header-search-empty, .header-search-more { display: block; padding: 12px 14px; text-align: center; font-size: var(--fx-fs-sm); color: var(--fx-muted); text-decoration: none; }
.header-search-more { color: var(--fx-blue-dark); font-weight: 800; }

/* ---------- 7. Нижняя навигация (мобильная) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--fx-bottom-nav-h) + env(safe-area-inset-bottom));
  padding: 6px 6px env(safe-area-inset-bottom);
  background: var(--fx-surface); border-top: 2px solid var(--fx-line);
}
.bottom-nav__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: var(--fx-r-md); color: var(--fx-muted); text-decoration: none;
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.01em;
  transition: color var(--fx-t), background var(--fx-t);
}
.bottom-nav__item .ico { width: 28px; height: 28px; transition: transform var(--fx-t) var(--fx-ease-bounce); }
.bottom-nav__item.is-active { color: var(--fx-orange-dark); background: var(--fx-orange-soft); }
.bottom-nav__item.is-active .ico { transform: translateY(-1px) scale(1.06); }
.bottom-nav__item:active .ico { transform: scale(0.9); }

/* ---------- 8. Хлебные крошки ---------- */
.breadcrumbs { padding: var(--fx-s3) 0 0; font-size: var(--fx-fs-xs); color: var(--fx-muted); }
.breadcrumbs .container { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.breadcrumbs a { color: var(--fx-ink-2); text-decoration: none; font-weight: 700; }
.breadcrumbs a:hover { color: var(--fx-orange-dark); }
.breadcrumbs .crumb-current { color: var(--fx-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }

/* ---------- 9. Персонаж (Mascot) ---------- */
.mascot { position: relative; display: inline-flex; flex-direction: column; align-items: center; flex: none; }
.mascot__stage { position: relative; width: var(--mascot-size, 140px); aspect-ratio: 1 / 1; display: grid; place-items: end center; }
.mascot__media { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; display: block; transform-origin: 50% 100%; }
.mascot__lottie { position: absolute; inset: 0; }
.mascot__lottie svg { width: 100% !important; height: 100% !important; }
.mascot__bubble {
  position: relative; max-width: 320px;
  background: var(--fx-surface); border: 2px solid var(--fx-line); border-radius: var(--fx-r-lg);
  padding: 12px 16px; font-weight: 700; font-size: var(--fx-fs-sm); color: var(--fx-ink); box-shadow: 0 3px 0 var(--fx-line);
}
.mascot-row { display: flex; align-items: flex-end; gap: var(--fx-s3); }
.mascot-row .mascot__bubble::before {
  content: ''; position: absolute; left: -10px; bottom: 18px; width: 16px; height: 16px;
  background: var(--fx-surface); border-left: 2px solid var(--fx-line); border-bottom: 2px solid var(--fx-line);
  transform: rotate(45deg);
}
/* Временные движения для заглушек (пока нет Lottie/WebP-анимаций).
   Только трансформации готовой картинки — без подмены графики. */
.mascot[data-anim="anim-welcome"] .mascot__media { animation: fxWave 1.4s var(--fx-ease) 1; }
.mascot[data-anim="anim-thinking"] .mascot__media { animation: fxSway 3.2s ease-in-out infinite; }
.mascot[data-anim="anim-joy-jump"] .mascot__media { animation: fxJump 0.9s var(--fx-ease) 1; }
.mascot[data-anim="anim-hint"] .mascot__media { animation: fxNod 1.2s var(--fx-ease) 1; }
.mascot[data-anim="anim-surprise"] .mascot__media { animation: fxPop 0.6s var(--fx-ease-bounce) 1; }
.mascot[data-anim="anim-support"] .mascot__media { animation: fxNod 1.4s var(--fx-ease) 1; }
.mascot[data-anim="anim-run"] .mascot__media { animation: fxDash 0.6s var(--fx-ease) 1; }
.mascot[data-anim="anim-sleep"] .mascot__media { animation: fxBreath 3.4s ease-in-out infinite; }
.mascot[data-anim="anim-winner"] .mascot__media { animation: fxJump 0.9s var(--fx-ease) 2; }
.mascot[data-anim="anim-level-up"] .mascot__media { animation: fxSpinPop 1.1s var(--fx-ease-bounce) 1; }
.mascot.has-real-anim .mascot__media { animation: none !important; }
@keyframes fxWave { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-5deg); } 40% { transform: rotate(4deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(2deg); } }
@keyframes fxSway { 0%,100% { transform: rotate(-1.5deg) translateY(0); } 50% { transform: rotate(1.5deg) translateY(-2px); } }
@keyframes fxJump { 0% { transform: translateY(0) scale(1,1); } 15% { transform: translateY(0) scale(1.06,0.92); } 45% { transform: translateY(-22%) scale(0.96,1.05); } 70% { transform: translateY(0) scale(1.04,0.95); } 100% { transform: translateY(0) scale(1,1); } }
@keyframes fxNod { 0%,100% { transform: rotate(0); } 30% { transform: rotate(-4deg) translateY(2px); } 60% { transform: rotate(3deg); } }
@keyframes fxPop { 0% { transform: scale(1); } 40% { transform: scale(1.12) translateY(-6%); } 100% { transform: scale(1); } }
@keyframes fxDash { 0% { transform: translateX(0); } 40% { transform: translateX(14%) skewX(-6deg); } 100% { transform: translateX(0); } }
@keyframes fxBreath { 0%,100% { transform: scale(1, 1); } 50% { transform: scale(1.02, 0.985); } }
@keyframes fxSpinPop { 0% { transform: scale(0.8) rotate(-8deg); } 60% { transform: scale(1.12) rotate(4deg); } 100% { transform: scale(1) rotate(0); } }

/* ---------- 10. Главная ---------- */
.home-hero { padding: var(--fx-s5) 0 var(--fx-s2); }
.home-hero__grid { display: grid; gap: var(--fx-s4); align-items: center; }
.home-hero__mascot { display: flex; justify-content: center; }
.home-hero__mascot .mascot { --mascot-size: 170px; }
.home-hero__copy { text-align: center; }
.home-hero__eyebrow { display: inline-block; font-weight: 900; color: var(--fx-orange-dark); background: var(--fx-orange-soft); border-radius: var(--fx-r-full); padding: 4px 14px; margin-bottom: var(--fx-s3); font-size: var(--fx-fs-sm); }
.home-hero h1 { font-size: var(--fx-fs-2xl); margin-bottom: var(--fx-s3); }
.home-hero__lead { color: var(--fx-ink-2); font-size: var(--fx-fs-md); max-width: 520px; margin: 0 auto var(--fx-s5); }
.home-hero__actions { display: grid; gap: var(--fx-s3); max-width: 420px; margin: 0 auto; }

.continue-card { display: flex; align-items: center; gap: var(--fx-s4); }
.continue-card__icon { width: 64px; height: 64px; flex: none; border-radius: var(--fx-r-md); background: var(--fx-orange-soft); display: grid; place-items: center; overflow: hidden; }
.continue-card__icon img { width: 56px; height: 56px; object-fit: contain; }
.continue-card__body { flex: 1; min-width: 0; }
.continue-card__label { font-size: var(--fx-fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fx-muted); }
.continue-card__title { font-weight: 900; font-size: var(--fx-fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.grade-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: var(--fx-s2); max-width: 600px; }
.grade-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--fx-s2);
  padding: var(--fx-s3) var(--fx-s3) var(--fx-s4);
  background: var(--fx-surface); border: 2px solid var(--fx-line); border-radius: var(--fx-r-lg); box-shadow: 0 4px 0 var(--fx-line);
  text-decoration: none; color: inherit; cursor: pointer;
  transition: transform var(--fx-t-fast) var(--fx-ease), box-shadow var(--fx-t-fast), border-color var(--fx-t);
}
.grade-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--fx-r-sm); }
.grade-card__num { font-size: var(--fx-fs-lg); font-weight: 900; }
.grade-card:hover { border-color: var(--fx-blue); }
.grade-card:active { transform: translateY(4px); box-shadow: 0 0 0 var(--fx-line); }
.grade-card.is-active { border-color: var(--fx-blue); background: var(--fx-blue-soft); box-shadow: 0 4px 0 var(--fx-blue-dark); }
.grade-card.is-active .grade-card__num { color: var(--fx-blue-dark); }
.grade-card.is-active::after {
  content: ''; position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--fx-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' stroke='%23fff' stroke-width='3' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat;
  animation: fxPop var(--fx-t-slow) var(--fx-ease-bounce);
}

.subject-grid { display: grid; grid-template-columns: 1fr; gap: var(--fx-s3); }
.subject-card {
  --accent: var(--fx-orange); --accent-soft: var(--fx-orange-soft);
  display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: var(--fx-s3);
  padding: var(--fx-s3) var(--fx-s4) var(--fx-s3) var(--fx-s3);
  background: var(--fx-surface); border: 2px solid var(--fx-line); border-radius: var(--fx-r-lg); box-shadow: 0 4px 0 var(--fx-line);
  text-decoration: none; color: inherit;
  transition: transform var(--fx-t-fast) var(--fx-ease), box-shadow var(--fx-t-fast), border-color var(--fx-t);
}
.subject-card:hover { border-color: var(--accent); }
.subject-card:active { transform: translateY(4px); box-shadow: 0 0 0 var(--fx-line); }
.subject-card__icon { width: 76px; height: 76px; border-radius: var(--fx-r-md); background: var(--accent-soft); display: grid; place-items: center; overflow: hidden; }
.subject-card__icon img { width: 68px; height: 68px; object-fit: contain; }
.subject-card__name { font-weight: 900; font-size: var(--fx-fs-md); line-height: 1.2; }
.subject-card__desc { font-size: var(--fx-fs-xs); color: var(--fx-muted); margin-top: 2px; }
.subject-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.subject-card__progress { margin-top: 8px; }
.subject-card__go { color: var(--fx-grey-dark); }
.subject-card--math { --accent: var(--fx-blue); --accent-soft: var(--fx-blue-soft); }
.subject-card--russian, .subject-card--reading { --accent: var(--fx-coral); --accent-soft: var(--fx-coral-soft); }
.subject-card--world, .subject-card--technology { --accent: var(--fx-green); --accent-soft: var(--fx-green-soft); }
.subject-card--music, .subject-card--izo { --accent: var(--fx-purple); --accent-soft: var(--fx-purple-soft); }
.subject-card--vpr { --accent: var(--fx-yellow-dark); --accent-soft: var(--fx-yellow-soft); }

.feature-strip { display: grid; gap: var(--fx-s3); }
.feature-item { display: flex; gap: var(--fx-s3); align-items: center; }
.feature-item img { width: 72px; height: 72px; object-fit: contain; flex: none; }
.feature-item h3 { font-size: var(--fx-fs-md); margin-bottom: 2px; }
.feature-item p { margin: 0; font-size: var(--fx-fs-sm); color: var(--fx-ink-2); }

/* Сводка игрока (главная / обучение) */
.player-bar { display: flex; align-items: center; gap: var(--fx-s3); }
.player-bar__info { flex: 1; min-width: 0; }
.player-bar__level { display: flex; justify-content: space-between; gap: var(--fx-s2); font-size: var(--fx-fs-xs); font-weight: 800; color: var(--fx-ink-2); margin-bottom: 6px; }
.player-bar__name { font-weight: 900; font-size: var(--fx-fs-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Ежедневные цели */
.goals-card .goal-row { display: grid; grid-template-columns: 40px 1fr; gap: var(--fx-s3); align-items: center; padding: var(--fx-s2) 0; }
.goal-row + .goal-row { border-top: 2px dashed var(--fx-line); }
.goal-row__icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--fx-yellow-soft); color: var(--fx-yellow-dark); }
.goal-row.is-done .goal-row__icon { background: var(--fx-green); color: #fff; animation: fxPop var(--fx-t-slow) var(--fx-ease-bounce); }
.goal-row__title { font-weight: 800; font-size: var(--fx-fs-sm); }
.goal-row__meta { display: flex; align-items: center; gap: var(--fx-s2); margin-top: 4px; }
.goal-row__meta .progress { flex: 1; }
.goal-row__count { font-size: var(--fx-fs-xs); font-weight: 800; color: var(--fx-muted); min-width: 48px; text-align: right; }

.cta-card { display: flex; gap: var(--fx-s4); align-items: center; background: var(--fx-purple-soft); border-color: #E1D5FF; }
.cta-card .mascot { --mascot-size: 76px; }

/* ---------- 11. Экран обучения: карта ---------- */
.learn-head { display: grid; gap: var(--fx-s3); }
.learn-head__subject { display: flex; align-items: center; gap: var(--fx-s3); }
.learn-head__subject img { width: 64px; height: 64px; object-fit: contain; }
.learn-head h1 { margin: 0; font-size: var(--fx-fs-xl); }
.learn-head__sub { color: var(--fx-muted); font-weight: 700; font-size: var(--fx-fs-sm); }
.learn-links { display: flex; flex-wrap: wrap; gap: var(--fx-s2); }
.learn-links .chip { text-decoration: none; }

.path-unit {
  position: sticky; top: calc(var(--fx-header-h) + 8px); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: var(--fx-s3);
  margin: var(--fx-s6) 0 var(--fx-s4); padding: var(--fx-s3) var(--fx-s4);
  border-radius: var(--fx-r-lg); color: #fff; background: var(--unit-bg, var(--fx-green));
  box-shadow: 0 4px 0 var(--unit-edge, var(--fx-green-dark));
}
.path-unit h2 { margin: 0; font-size: var(--fx-fs-md); }
.path-unit p { margin: 0; font-size: var(--fx-fs-xs); font-weight: 700; opacity: 0.9; }
.path { position: relative; list-style: none; margin: 0 auto; padding: var(--fx-s2) 0 var(--fx-s8); max-width: 420px; }
.path__item { position: relative; display: flex; justify-content: center; height: 108px; }
.path__item > .path-node { transform: translateX(var(--offset, 0)); }
.path-node {
  --node-bg: var(--fx-grey); --node-edge: var(--fx-grey-dark); --node-fg: #fff;
  position: relative; display: grid; place-items: center;
  width: 76px; height: 70px; border-radius: 50%;
  background: var(--node-bg); color: var(--node-fg);
  box-shadow: 0 8px 0 var(--node-edge);
  border: 0; cursor: pointer; text-decoration: none;
  transition: transform var(--fx-t-fast) var(--fx-ease), box-shadow var(--fx-t-fast);
}
.path-node:active { transform: translateX(var(--offset, 0)) translateY(8px) !important; box-shadow: 0 0 0 var(--node-edge); }
.path-node .ico { width: 34px; height: 34px; stroke-width: 2.8; }
.path-node__label {
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 180px; text-align: center;
  font-size: var(--fx-fs-xs); font-weight: 800; color: var(--fx-ink-2); line-height: 1.2;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.path-node--done { --node-bg: var(--fx-yellow); --node-edge: var(--fx-yellow-dark); }
.path-node--review { --node-bg: var(--fx-purple); --node-edge: var(--fx-purple-dark); }
.path-node--current { --node-bg: var(--fx-orange); --node-edge: var(--fx-orange-dark); }
.path-node--current::before {
  content: ''; position: absolute; inset: -10px; border-radius: 50%;
  border: 4px solid var(--fx-orange); opacity: 0.45; animation: fxPulse 1.8s ease-out infinite;
}
.path-node--upcoming { --node-bg: var(--fx-surface); --node-edge: var(--fx-line-strong); --node-fg: var(--fx-grey-dark); border: 3px solid var(--fx-line-strong); }
.path-node--locked { --node-bg: var(--fx-grey-soft); --node-edge: var(--fx-grey); --node-fg: var(--fx-grey-dark); cursor: default; }
.path-node__medal { position: absolute; right: -8px; top: -6px; min-width: 34px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--fx-surface); color: var(--fx-ink); font-size: 0.7rem; font-weight: 900; display: grid; place-items: center; box-shadow: 0 2px 0 var(--fx-line-strong); }
.path-start {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--fx-surface); color: var(--fx-orange-dark); border: 2px solid var(--fx-line);
  border-radius: var(--fx-r-sm); padding: 4px 12px; font-weight: 900; font-size: var(--fx-fs-xs); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
  animation: fxFloat 1.8s ease-in-out infinite;
}
.path-start::after { content: ''; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px; background: var(--fx-surface); border-right: 2px solid var(--fx-line); border-bottom: 2px solid var(--fx-line); transform: translateX(-50%) rotate(45deg); }
.path-mascot { position: absolute; top: 4px; pointer-events: none; }
.path-mascot .mascot { --mascot-size: 96px; }
.path-legend { display: flex; flex-wrap: wrap; gap: var(--fx-s2) var(--fx-s4); font-size: var(--fx-fs-xs); font-weight: 700; color: var(--fx-ink-2); }
.path-legend span { display: inline-flex; align-items: center; gap: 6px; }
.path-legend i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
@keyframes fxPulse { 0% { transform: scale(0.9); opacity: 0.55; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes fxFloat { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -4px); } }

/* ---------- 12. Bottom sheet / модальные окна ---------- */
.sheet { position: fixed; inset: 0; z-index: 200; display: none; }
.sheet.is-open { display: block; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(31, 46, 69, 0.45); opacity: 0; transition: opacity var(--fx-t); }
.sheet.is-visible .sheet__backdrop { opacity: 1; }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 88vh; overflow-y: auto;
  background: var(--fx-surface); border-radius: var(--fx-r-xl) var(--fx-r-xl) 0 0;
  padding: var(--fx-s3) var(--fx-s5) calc(var(--fx-s6) + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform var(--fx-t-slow) var(--fx-ease);
  box-shadow: var(--fx-shadow-pop);
}
.sheet.is-visible .sheet__panel { transform: translateY(0); }
.sheet__grip { width: 44px; height: 5px; border-radius: 3px; background: var(--fx-line-strong); margin: 0 auto var(--fx-s4); }
.sheet__title { font-size: var(--fx-fs-lg); margin-bottom: var(--fx-s2); }
.sheet__actions { display: grid; gap: var(--fx-s3); margin-top: var(--fx-s5); }
.node-sheet__head { display: flex; gap: var(--fx-s3); align-items: center; margin-bottom: var(--fx-s3); }
.node-sheet__badge { width: 56px; height: 52px; flex: none; }
.node-sheet__stats { display: flex; flex-wrap: wrap; gap: var(--fx-s2); margin: var(--fx-s3) 0; }

/* ---------- 13. Плеер теста ---------- */
.quiz-intro { padding: var(--fx-s4) 0 var(--fx-s6); }
.quiz-intro__card { display: grid; gap: var(--fx-s4); justify-items: center; text-align: center; }
.quiz-intro__card .mascot { --mascot-size: 150px; }
.quiz-intro h1 { font-size: var(--fx-fs-xl); margin: 0; }
.quiz-intro__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--fx-s2); }
.quiz-intro__form { width: 100%; max-width: 380px; display: grid; gap: var(--fx-s3); }
.quiz-intro__error { color: var(--fx-coral-dark); font-weight: 800; font-size: var(--fx-fs-sm); min-height: 1.2em; }
.input, .quiz-intro__form input[type=text], .form-row input[type=text], .form-row input[type=email], .form-row input[type=password], .form-row input[type=number], .form-row select, .form-row textarea {
  width: 100%; min-height: 52px; padding: 12px 16px;
  border: 2px solid var(--fx-line-strong); border-radius: var(--fx-r-md); background: var(--fx-surface);
  font-size: var(--fx-fs-md); outline: none; transition: border-color var(--fx-t), box-shadow var(--fx-t);
}
.input:focus, .quiz-intro__form input:focus, .form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--fx-blue); box-shadow: 0 0 0 4px var(--fx-blue-soft); }
.profile-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--fx-s3); width: 100%; }
.profile-pick__item { display: grid; justify-items: center; gap: 6px; padding: var(--fx-s3); border: 2px solid var(--fx-line); border-radius: var(--fx-r-lg); background: var(--fx-surface); cursor: pointer; box-shadow: 0 4px 0 var(--fx-line); font-weight: 800; transition: transform var(--fx-t-fast); }
.profile-pick__item:active { transform: translateY(4px); box-shadow: none; }
.profile-pick__item input { position: absolute; opacity: 0; pointer-events: none; }
.profile-pick__item:has(input:checked), .profile-pick__item.is-selected { border-color: var(--fx-blue); background: var(--fx-blue-soft); box-shadow: 0 4px 0 var(--fx-blue-dark); }

body.quiz-open { overflow: hidden; }
.quiz-shell {
  position: fixed; inset: 0; z-index: 100;
  display: none; flex-direction: column;
  background: var(--fx-bg);
}
.quiz-shell.is-open { display: flex; animation: fxShellIn var(--fx-t-slow) var(--fx-ease); }
@keyframes fxShellIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.quiz-top { flex: none; display: flex; align-items: center; gap: var(--fx-s3); width: 100%; max-width: 760px; margin: 0 auto; padding: calc(10px + env(safe-area-inset-top)) var(--fx-gutter) 8px; }
.quiz-top .progress { flex: 1; height: 16px; }
.quiz-top__count { font-weight: 900; font-size: var(--fx-fs-sm); color: var(--fx-ink-2); min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
.quiz-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.quiz-body__inner { max-width: 680px; margin: 0 auto; padding: var(--fx-s3) var(--fx-gutter) var(--fx-s6); }
.q-head { display: flex; align-items: flex-end; gap: var(--fx-s3); margin-bottom: var(--fx-s4); }
.q-head .mascot { --mascot-size: 84px; }
.q-head__bubble { flex: 1; }
.q-kind { display: inline-block; font-size: var(--fx-fs-xs); font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fx-purple-dark); margin-bottom: 6px; }
.q-text { font-size: var(--fx-fs-lg); font-weight: 800; line-height: 1.35; margin: 0; overflow-wrap: anywhere; }
.q-image { display: block; max-width: 100%; max-height: 240px; margin: 0 auto var(--fx-s4); border-radius: var(--fx-r-md); border: 2px solid var(--fx-line); background: #fff; }
.passage-box { margin: 0 0 var(--fx-s4); border: 2px solid var(--fx-line); border-radius: var(--fx-r-md); background: var(--fx-surface); }
.passage-box summary { cursor: pointer; list-style: none; padding: 12px 16px; font-weight: 800; color: var(--fx-blue-dark); display: flex; align-items: center; gap: 8px; min-height: 48px; }
.passage-box summary::-webkit-details-marker { display: none; }
.passage-box summary .ico { transition: transform var(--fx-t); }
.passage-box[open] summary .ico { transform: rotate(90deg); }
.passage-body { padding: 0 16px 16px; white-space: pre-wrap; line-height: 1.65; font-size: var(--fx-fs-md); max-height: 50vh; overflow-y: auto; }

.answer-list { display: grid; gap: var(--fx-s3); }
.answer-list--grid { grid-template-columns: 1fr 1fr; }
.answer-card {
  position: relative; display: flex; align-items: center; gap: var(--fx-s3);
  width: 100%; min-height: 60px; padding: 12px 16px;
  background: var(--fx-surface); border: 2px solid var(--fx-line-strong); border-radius: var(--fx-r-lg);
  box-shadow: 0 4px 0 var(--fx-line-strong);
  font-size: var(--fx-fs-md); font-weight: 700; text-align: left; color: var(--fx-ink);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform var(--fx-t-fast) var(--fx-ease), box-shadow var(--fx-t-fast), border-color var(--fx-t-fast), background var(--fx-t-fast);
}
.answer-card__key {
  flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  border: 2px solid var(--fx-line-strong); color: var(--fx-muted); font-size: var(--fx-fs-sm); font-weight: 900;
  transition: inherit;
}
.answer-card__key--box { border-radius: 8px; }
.answer-card__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.answer-card__img { max-width: 120px; max-height: 96px; border-radius: 8px; }
@media (hover: hover) { .answer-card:hover:not(:disabled):not(.is-locked) { background: var(--fx-surface-2); border-color: var(--fx-blue); } }
.answer-card:active:not(:disabled):not(.is-locked) { transform: translateY(4px); box-shadow: 0 0 0 var(--fx-line-strong); }
.answer-card.is-selected { border-color: var(--fx-blue); background: var(--fx-blue-soft); box-shadow: 0 4px 0 var(--fx-blue); color: var(--fx-blue-dark); }
.answer-card.is-selected .answer-card__key { border-color: var(--fx-blue); background: var(--fx-blue); color: #fff; }
.answer-card.is-correct { border-color: var(--fx-green); background: var(--fx-green-soft); box-shadow: 0 4px 0 var(--fx-green); color: var(--fx-green-dark); animation: fxCorrect 0.5s var(--fx-ease-bounce); }
.answer-card.is-correct .answer-card__key { border-color: var(--fx-green); background: var(--fx-green); color: #fff; }
.answer-card.is-wrong { border-color: var(--fx-coral); background: var(--fx-coral-soft); box-shadow: 0 4px 0 var(--fx-coral); color: var(--fx-coral-dark); animation: fxShake 0.42s var(--fx-ease); }
.answer-card.is-wrong .answer-card__key { border-color: var(--fx-coral); background: var(--fx-coral); color: #fff; }
.answer-card.is-locked { cursor: default; }
.answer-card.is-locked:not(.is-correct):not(.is-wrong):not(.is-selected) { opacity: 0.55; }
.answer-card.is-eliminated { opacity: 0.35; text-decoration: line-through; cursor: not-allowed; box-shadow: none; }
.answer-card:disabled { cursor: not-allowed; }
@keyframes fxCorrect { 0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes fxShake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

.order-hint { font-size: var(--fx-fs-sm); color: var(--fx-muted); font-weight: 700; margin-bottom: var(--fx-s2); }
.order-slots { display: flex; flex-wrap: wrap; gap: var(--fx-s2); min-height: 64px; padding: var(--fx-s3); margin-bottom: var(--fx-s3); border: 2px dashed var(--fx-line-strong); border-radius: var(--fx-r-lg); background: var(--fx-surface-2); }
.order-slots:empty::before { content: attr(data-empty); color: var(--fx-muted); font-weight: 700; font-size: var(--fx-fs-sm); align-self: center; }
.order-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 14px;
  background: var(--fx-surface); border: 2px solid var(--fx-line-strong); border-radius: var(--fx-r-md); box-shadow: 0 4px 0 var(--fx-line-strong);
  font-weight: 800; cursor: pointer; transition: transform var(--fx-t-fast), opacity var(--fx-t);
  animation: fxPop var(--fx-t) var(--fx-ease-bounce);
}
.order-chip:active { transform: translateY(4px); box-shadow: none; }
.order-chip__num { width: 24px; height: 24px; border-radius: 50%; background: var(--fx-blue); color: #fff; font-size: 0.8rem; display: grid; place-items: center; }
.order-chip.is-used { opacity: 0.3; pointer-events: none; box-shadow: none; }
.order-chip.is-hinted { border-color: var(--fx-yellow); box-shadow: 0 4px 0 var(--fx-yellow-dark); animation: fxPulseRing 1s ease-in-out infinite alternate; }
.order-pool { display: flex; flex-wrap: wrap; gap: var(--fx-s2); }
.order-slots.is-correct { border-color: var(--fx-green); background: var(--fx-green-soft); }
.order-slots.is-wrong { border-color: var(--fx-coral); background: var(--fx-coral-soft); animation: fxShake 0.42s; }
@keyframes fxPulseRing { from { box-shadow: 0 4px 0 var(--fx-yellow-dark), 0 0 0 0 rgba(255,197,49,.6); } to { box-shadow: 0 4px 0 var(--fx-yellow-dark), 0 0 0 6px rgba(255,197,49,0); } }

.q-textarea { width: 100%; min-height: 120px; padding: 14px 16px; border: 2px solid var(--fx-line-strong); border-radius: var(--fx-r-lg); background: var(--fx-surface); font-size: var(--fx-fs-md); resize: vertical; outline: none; user-select: text; -webkit-user-select: text; }
.q-textarea:focus { border-color: var(--fx-blue); box-shadow: 0 0 0 4px var(--fx-blue-soft); }

.hint-panel { display: flex; gap: var(--fx-s3); align-items: flex-start; margin-top: var(--fx-s4); padding: var(--fx-s3) var(--fx-s4); border-radius: var(--fx-r-md); background: var(--fx-yellow-soft); border: 2px solid #FBE3A0; color: #7A5600; font-weight: 700; font-size: var(--fx-fs-sm); animation: fxSlideUp var(--fx-t-slow) var(--fx-ease); }
.hint-panel .ico { color: var(--fx-yellow-dark); }

.quiz-footer { flex: none; border-top: 2px solid var(--fx-line); background: var(--fx-surface); transition: background var(--fx-t), border-color var(--fx-t); }
.quiz-footer__inner { max-width: 680px; margin: 0 auto; padding: var(--fx-s3) var(--fx-gutter) calc(var(--fx-s3) + env(safe-area-inset-bottom)); display: grid; gap: var(--fx-s3); }
.quiz-footer__row { display: flex; gap: var(--fx-s3); align-items: center; }
.quiz-footer__row .btn { flex: 1; }
.quiz-footer__row .btn--secondary { flex: 0 0 auto; }
.quiz-footer.is-correct { background: var(--fx-green-soft); border-color: #C7EECF; }
.quiz-footer.is-wrong { background: var(--fx-coral-soft); border-color: #FFD3CE; }
.feedback { display: none; gap: var(--fx-s3); align-items: flex-start; animation: fxSlideUp var(--fx-t-slow) var(--fx-ease); }
.quiz-footer.is-correct .feedback, .quiz-footer.is-wrong .feedback { display: flex; }
.feedback__icon { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; }
.quiz-footer.is-correct .feedback__icon { background: var(--fx-green); }
.quiz-footer.is-wrong .feedback__icon { background: var(--fx-coral); }
.feedback__title { font-weight: 900; font-size: var(--fx-fs-lg); }
.quiz-footer.is-correct .feedback__title { color: var(--fx-green-dark); }
.quiz-footer.is-wrong .feedback__title { color: var(--fx-coral-dark); }
.feedback__text { font-size: var(--fx-fs-sm); font-weight: 700; color: var(--fx-ink-2); margin-top: 2px; max-height: 30vh; overflow-y: auto; }
.feedback__text b { color: var(--fx-ink); }
.feedback__report { margin-left: auto; }
@keyframes fxSlideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.q-enter { animation: fxQIn var(--fx-t-slow) var(--fx-ease); }
@keyframes fxQIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

.exam-dots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 0 var(--fx-gutter) 8px; max-width: 760px; margin: 0 auto; }
.exam-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--fx-line-strong); background: var(--fx-surface); font-size: 0.72rem; font-weight: 900; color: var(--fx-muted); cursor: pointer; }
.exam-dot.is-answered { background: var(--fx-blue-soft); border-color: var(--fx-blue); color: var(--fx-blue-dark); }
.exam-dot.is-current { background: var(--fx-orange); border-color: var(--fx-orange-dark); color: #fff; }

/* ---------- 14. Экран результатов ---------- */
.result { display: none; flex: 1; overflow-y: auto; }
.quiz-shell.is-result .result { display: block; }
.quiz-shell.is-result .quiz-body, .quiz-shell.is-result .quiz-footer, .quiz-shell.is-result .quiz-top .progress, .quiz-shell.is-result .quiz-top__count, .quiz-shell.is-result .exam-dots { display: none; }
.result__inner { max-width: 600px; margin: 0 auto; padding: var(--fx-s2) var(--fx-gutter) calc(var(--fx-s10) + env(safe-area-inset-bottom)); text-align: center; }
.result__hero { display: grid; justify-items: center; gap: var(--fx-s2); }
.result__hero .mascot { --mascot-size: 170px; }
.result__title { font-size: var(--fx-fs-2xl); margin: var(--fx-s2) 0 0; }
.result__lead { color: var(--fx-ink-2); font-weight: 700; margin: 0; }
.result__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--fx-s3); margin: var(--fx-s5) 0; }
.stat-tile { border-radius: var(--fx-r-lg); border: 2px solid var(--tile, var(--fx-line)); overflow: hidden; background: var(--fx-surface); }
.stat-tile__label { background: var(--tile, var(--fx-line)); color: #fff; font-size: 0.72rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 6px; }
.stat-tile__value { display: flex; align-items: center; justify-content: center; gap: 4px; padding: var(--fx-s3) 4px; font-size: var(--fx-fs-xl); font-weight: 900; color: var(--tile-ink, var(--fx-ink)); font-variant-numeric: tabular-nums; }
.stat-tile__value .ico { width: 22px; height: 22px; }
.stat-tile--green { --tile: var(--fx-green); --tile-ink: var(--fx-green-dark); }
.stat-tile--purple { --tile: var(--fx-purple); --tile-ink: var(--fx-purple-dark); }
.stat-tile--yellow { --tile: var(--fx-yellow); --tile-ink: var(--fx-yellow-dark); }
.stat-tile--blue { --tile: var(--fx-blue); --tile-ink: var(--fx-blue-dark); }
.result__notes { display: grid; gap: var(--fx-s2); margin-bottom: var(--fx-s5); text-align: left; }
.note { display: flex; gap: var(--fx-s3); align-items: center; padding: var(--fx-s3) var(--fx-s4); border-radius: var(--fx-r-md); font-weight: 700; font-size: var(--fx-fs-sm); background: var(--fx-surface); border: 2px solid var(--fx-line); }
.note--green { background: var(--fx-green-soft); border-color: #C7EECF; color: var(--fx-green-dark); }
.note--orange { background: var(--fx-orange-soft); border-color: #FFD9B8; color: var(--fx-orange-dark); }
.note--purple { background: var(--fx-purple-soft); border-color: #E1D5FF; color: var(--fx-purple-dark); }
.note--blue { background: var(--fx-blue-soft); border-color: #C6E6FB; color: var(--fx-blue-dark); }
.note img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.result__actions { display: grid; gap: var(--fx-s3); }
.result__actions .btn--ghost { justify-self: center; }
.review { text-align: left; margin-top: var(--fx-s6); }
.review h2 { font-size: var(--fx-fs-lg); }
.review-item { padding: var(--fx-s4); border-radius: var(--fx-r-lg); background: var(--fx-surface); border: 2px solid var(--fx-line); margin-bottom: var(--fx-s3); }
.review-item.is-wrong { border-color: #FFD3CE; }
.review-item.is-correct { border-color: #C7EECF; }
.review-item__q { font-weight: 800; margin-bottom: var(--fx-s2); display: flex; gap: 8px; }
.review-item__q .ico { flex: none; width: 22px; height: 22px; margin-top: 2px; }
.review-item.is-correct .review-item__q .ico { color: var(--fx-green); }
.review-item.is-wrong .review-item__q .ico, .review-item.is-skipped .review-item__q .ico { color: var(--fx-coral); }
.review-item__row { font-size: var(--fx-fs-sm); margin: 2px 0; color: var(--fx-ink-2); }
.review-item__row b { color: var(--fx-ink); }
.review-item__expl { margin-top: var(--fx-s2); padding: var(--fx-s2) var(--fx-s3); border-radius: var(--fx-r-sm); background: var(--fx-blue-soft); color: var(--fx-blue-dark); font-size: var(--fx-fs-sm); font-weight: 600; }
.review-item__report { margin-top: var(--fx-s2); }
.report-form { display: flex; flex-wrap: wrap; gap: var(--fx-s2); margin-top: var(--fx-s2); }
.report-form input { flex: 1; min-width: 180px; min-height: 44px; padding: 8px 12px; border: 2px solid var(--fx-line-strong); border-radius: var(--fx-r-sm); }
.report-status { font-size: var(--fx-fs-xs); font-weight: 700; color: var(--fx-muted); align-self: center; }

/* ---------- 15. Празднования (оверлеи) ---------- */
.celebrate { position: fixed; inset: 0; z-index: 300; display: none; place-items: center; padding: var(--fx-s5); background: rgba(31, 46, 69, 0.55); }
.celebrate.is-open { display: grid; animation: fxFade var(--fx-t) var(--fx-ease); }
.celebrate__card {
  position: relative; width: 100%; max-width: 360px; text-align: center;
  background: var(--fx-surface); border-radius: var(--fx-r-xl); padding: var(--fx-s6) var(--fx-s5) var(--fx-s5);
  box-shadow: var(--fx-shadow-pop); animation: fxCardIn 0.5s var(--fx-ease-bounce);
}
.celebrate__card .mascot { --mascot-size: 140px; margin-top: -84px; }
.celebrate__media { width: 120px; height: 120px; object-fit: contain; margin: -76px auto var(--fx-s2); display: block; animation: fxSpinPop 0.9s var(--fx-ease-bounce); }
.celebrate__eyebrow { font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--fx-fs-xs); color: var(--fx-orange-dark); }
.celebrate__title { font-size: var(--fx-fs-xl); margin: 4px 0; }
.celebrate__value { font-size: var(--fx-fs-3xl); font-weight: 900; color: var(--fx-purple-dark); font-variant-numeric: tabular-nums; }
.celebrate__text { color: var(--fx-ink-2); font-weight: 700; font-size: var(--fx-fs-sm); }
.celebrate__card .btn { margin-top: var(--fx-s4); }
@keyframes fxFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fxCardIn { from { opacity: 0; transform: scale(0.7) translateY(30px); } to { opacity: 1; transform: none; } }

.fx-particles { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; }
.fx-particle { position: absolute; width: 22px; height: 22px; will-change: transform, opacity; }
.fx-float-xp { position: fixed; z-index: 400; pointer-events: none; font-weight: 900; font-size: var(--fx-fs-lg); color: var(--fx-purple-dark); text-shadow: 0 2px 0 #fff; animation: fxFloatUp 1.1s var(--fx-ease) forwards; }
@keyframes fxFloatUp { from { opacity: 0; transform: translate(-50%, 0) scale(0.8); } 20% { opacity: 1; transform: translate(-50%, -10px) scale(1.1); } to { opacity: 0; transform: translate(-50%, -60px) scale(1); } }

.toast { position: fixed; left: 50%; bottom: calc(var(--fx-bottom-nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 500; transform: translateX(-50%); background: var(--fx-ink); color: #fff; padding: 12px 18px; border-radius: var(--fx-r-md); font-weight: 800; font-size: var(--fx-fs-sm); box-shadow: var(--fx-shadow-pop); animation: fxSlideUp var(--fx-t) var(--fx-ease); max-width: calc(100% - 32px); }

/* ---------- 16. Достижения ---------- */
.ach-summary { display: flex; align-items: center; gap: var(--fx-s4); }
.ach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--fx-s3); }
.ach-card { display: grid; justify-items: center; gap: 6px; text-align: center; padding: var(--fx-s4) var(--fx-s3); background: var(--fx-surface); border: 2px solid var(--fx-line); border-radius: var(--fx-r-lg); box-shadow: 0 4px 0 var(--fx-line); }
.ach-card__img { width: 80px; height: 80px; object-fit: contain; transition: filter var(--fx-t), opacity var(--fx-t); }
.ach-card.is-locked .ach-card__img { filter: grayscale(1); opacity: 0.45; }
.ach-card.is-earned { border-color: #FBE3A0; background: linear-gradient(180deg, var(--fx-yellow-soft), var(--fx-surface) 60%); }
.ach-card__name { font-weight: 900; font-size: var(--fx-fs-sm); line-height: 1.2; }
.ach-card__desc { font-size: var(--fx-fs-xs); color: var(--fx-muted); line-height: 1.3; }
.ach-card .progress { width: 100%; margin-top: 4px; }
.ach-card__count { font-size: 0.72rem; font-weight: 800; color: var(--fx-muted); }

/* ---------- 17. Профиль ---------- */
.profile-hero { display: grid; justify-items: center; text-align: center; gap: var(--fx-s2); }
.profile-hero__name { font-size: var(--fx-fs-xl); font-weight: 900; margin: 0; }
.profile-hero__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--fx-s2); }
.level-card { display: flex; align-items: center; gap: var(--fx-s3); }
.level-card img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.level-card__body { flex: 1; }
.level-card__title { font-weight: 900; }
.level-card__hint { font-size: var(--fx-fs-xs); color: var(--fx-muted); font-weight: 700; margin-top: 4px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--fx-s3); }
.stat-card { display: flex; align-items: center; gap: var(--fx-s3); padding: var(--fx-s3) var(--fx-s4); border: 2px solid var(--fx-line); border-radius: var(--fx-r-lg); background: var(--fx-surface); }
.stat-card .ico { width: 28px; height: 28px; flex: none; }
.stat-card__value { font-size: var(--fx-fs-lg); font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-card__label { font-size: var(--fx-fs-xs); font-weight: 700; color: var(--fx-muted); }
.streak-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.streak-cal__dow { font-size: 0.7rem; font-weight: 800; color: var(--fx-muted); text-align: center; }
.streak-cal__day { aspect-ratio: 1; border-radius: 10px; background: var(--fx-grey-soft); display: grid; place-items: center; font-size: 0.72rem; font-weight: 800; color: var(--fx-grey-dark); }
.streak-cal__day.is-active { background: var(--fx-orange); color: #fff; box-shadow: 0 3px 0 var(--fx-orange-dark); }
.streak-cal__day.is-today { outline: 3px solid var(--fx-blue); outline-offset: 1px; }
.streak-cal__day.is-future { background: transparent; border: 2px dashed var(--fx-line); }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-item { display: flex; align-items: center; gap: var(--fx-s3); padding: var(--fx-s3) 0; border-bottom: 2px solid var(--fx-line); }
.history-item:last-child { border-bottom: 0; }
.history-item__score { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: var(--fx-fs-sm); background: var(--fx-grey-soft); color: var(--fx-ink-2); }
.history-item__score.is-good { background: var(--fx-green-soft); color: var(--fx-green-dark); }
.history-item__score.is-mid { background: var(--fx-yellow-soft); color: var(--fx-yellow-dark); }
.history-item__body { flex: 1; min-width: 0; }
.history-item__title { font-weight: 800; font-size: var(--fx-fs-sm); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.history-item__meta { font-size: var(--fx-fs-xs); color: var(--fx-muted); font-weight: 700; }
.settings-group { border: 2px solid var(--fx-line); border-radius: var(--fx-r-lg); background: var(--fx-surface); margin-bottom: var(--fx-s3); overflow: hidden; }
.settings-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--fx-s3); padding: var(--fx-s4); font-weight: 800; min-height: 56px; }
.settings-group > summary::-webkit-details-marker { display: none; }
.settings-group > summary .ico:last-child { margin-left: auto; color: var(--fx-muted); transition: transform var(--fx-t); }
.settings-group[open] > summary .ico:last-child { transform: rotate(90deg); }
.settings-group__body { padding: 0 var(--fx-s4) var(--fx-s4); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: var(--fx-s3); padding: var(--fx-s3) 0; font-weight: 700; }
.switch { position: relative; width: 56px; height: 32px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--fx-grey); transition: background var(--fx-t); }
.switch span::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 rgba(0,0,0,0.12); transition: transform var(--fx-t) var(--fx-ease-bounce); }
.switch input:checked + span { background: var(--fx-green); }
.switch input:checked + span::after { transform: translateX(24px); }
.switch input:focus-visible + span { outline: 3px solid var(--fx-blue); outline-offset: 2px; }

/* ---------- 18. Подвал ---------- */
.app-footer { margin-top: var(--fx-s10); padding: var(--fx-s8) 0 var(--fx-s6); background: var(--fx-surface); border-top: 2px solid var(--fx-line); font-size: var(--fx-fs-sm); color: var(--fx-ink-2); }
.app-footer__grid { display: grid; gap: var(--fx-s5); }
.app-footer h3 { font-size: var(--fx-fs-sm); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fx-muted); margin-bottom: var(--fx-s2); }
.app-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.app-footer a { color: var(--fx-ink-2); text-decoration: none; font-weight: 700; }
.app-footer a:hover { color: var(--fx-orange-dark); }
.app-footer__bottom { margin-top: var(--fx-s6); padding-top: var(--fx-s4); border-top: 2px solid var(--fx-line); font-size: var(--fx-fs-xs); color: var(--fx-muted); }
.footer-support-link { display: inline-block; margin-top: var(--fx-s2); font-weight: 800; color: var(--fx-orange-dark) !important; }
.cookie-consent { position: fixed; left: var(--fx-s3); right: var(--fx-s3); bottom: calc(var(--fx-bottom-nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 90; display: none; gap: var(--fx-s3); align-items: center; flex-wrap: wrap; padding: var(--fx-s4); border-radius: var(--fx-r-lg); background: var(--fx-ink); color: #fff; box-shadow: var(--fx-shadow-pop); font-size: var(--fx-fs-xs); }
.cookie-consent p { margin: 0; flex: 1 1 220px; }
.cookie-consent a { color: #FFD3A8; }

/* ---------- 19. Совместимость: старые страницы (вход, рейтинг, учитель, поиск, о проекте) ---------- */
.hero { padding: var(--fx-s5) 0 var(--fx-s6); }
.hero h1 { font-size: var(--fx-fs-2xl); }
.hero p { font-size: var(--fx-fs-md); }
.alert-box { padding: var(--fx-s3) var(--fx-s4); border-radius: var(--fx-r-md); margin: var(--fx-s3) 0; font-weight: 700; font-size: var(--fx-fs-sm); border: 2px solid; }
.alert-error { background: var(--fx-coral-soft); border-color: #FFD3CE; color: var(--fx-coral-dark); }
.alert-success { background: var(--fx-green-soft); border-color: #C7EECF; color: var(--fx-green-dark); }
.alert-info { background: var(--fx-blue-soft); border-color: #C6E6FB; color: var(--fx-blue-dark); }
.auth-form, .legal-text { background: var(--fx-surface); border: 2px solid var(--fx-line); border-radius: var(--fx-r-lg); padding: var(--fx-s5); max-width: 560px; box-shadow: 0 4px 0 var(--fx-line); }
.legal-text { max-width: 820px; line-height: 1.65; }
.legal-text h2 { font-size: var(--fx-fs-lg); margin-top: var(--fx-s5); }
.parent-guide { margin-top: var(--fx-s5); }
.form-row { margin-bottom: var(--fx-s4); }
.form-row label { display: block; font-weight: 800; font-size: var(--fx-fs-sm); margin-bottom: 6px; color: var(--fx-ink-2); }
.form-row input:disabled { background: var(--fx-grey-soft); color: var(--fx-muted); }
.checkbox-row label { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; cursor: pointer; }
.checkbox-row input, .auth-method-choice input { width: 22px; height: 22px; accent-color: var(--fx-orange); flex: none; margin-top: 1px; }
.auth-method-choice { display: grid; gap: var(--fx-s2); margin-bottom: var(--fx-s4); }
.auth-method-choice label { display: flex; gap: 10px; align-items: center; padding: var(--fx-s3) var(--fx-s4); border: 2px solid var(--fx-line); border-radius: var(--fx-r-md); font-weight: 700; cursor: pointer; }
.auth-method-choice label:has(input:checked) { border-color: var(--fx-blue); background: var(--fx-blue-soft); }
.table-simple, .lb-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--fx-surface); border: 2px solid var(--fx-line); border-radius: var(--fx-r-lg); overflow: hidden; font-size: var(--fx-fs-sm); }
.table-simple th, .table-simple td, .lb-table th, .lb-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--fx-line); }
.table-simple th, .lb-table th { background: var(--fx-surface-2); font-weight: 800; color: var(--fx-ink-2); }
.table-simple tr:last-child td, .lb-table tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.grade-picker { display: flex; flex-wrap: wrap; gap: var(--fx-s3); }
.grade-option { display: grid; justify-items: center; gap: 6px; padding: var(--fx-s3); border: 2px solid var(--fx-line); border-radius: var(--fx-r-lg); background: var(--fx-surface); cursor: pointer; font-weight: 800; box-shadow: 0 4px 0 var(--fx-line); }
.grade-option img { width: 96px; border-radius: var(--fx-r-sm); }
.grade-option input { position: absolute; opacity: 0; }
.grade-option.selected, .grade-option:has(input:checked) { border-color: var(--fx-blue); background: var(--fx-blue-soft); }
.tests-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--fx-s3); padding: var(--fx-s4) 0; }
.tests-blocks .test, .test { display: block; padding: var(--fx-s4); background: var(--fx-surface); border: 2px solid var(--fx-line); border-radius: var(--fx-r-lg); box-shadow: 0 4px 0 var(--fx-line); text-decoration: none; color: inherit; }
.test .subject { font-weight: 900; }
.test .forClass { font-size: var(--fx-fs-xs); color: var(--fx-muted); }
.test .image img { max-width: 100%; }
.profile-card { background: var(--fx-surface); border: 2px solid var(--fx-line); border-radius: var(--fx-r-lg); padding: var(--fx-s4); margin-bottom: var(--fx-s3); }
.profile-card.profile-active { border-color: var(--fx-blue); }
.profile-card-head { display: flex; gap: var(--fx-s3); align-items: center; margin-bottom: var(--fx-s3); }
.profile-card-head img { width: 64px; height: 44px; object-fit: cover; border-radius: 10px; }
.badge-active { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: var(--fx-r-full); background: var(--fx-blue-soft); color: var(--fx-blue-dark); font-size: var(--fx-fs-xs); font-weight: 800; }
.profile-stats-line { font-size: var(--fx-fs-xs); color: var(--fx-muted); font-weight: 700; }
.profile-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fx-s3); }
.totp-secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: var(--fx-fs-lg); letter-spacing: 0.1em; background: var(--fx-surface-2); padding: var(--fx-s3); border-radius: var(--fx-r-sm); word-break: break-all; }
.faq-block { margin-top: var(--fx-s8); }
.faq-item { background: var(--fx-surface); border: 2px solid var(--fx-line); border-radius: var(--fx-r-md); margin-bottom: var(--fx-s2); }
.faq-item summary { cursor: pointer; padding: var(--fx-s3) var(--fx-s4); font-weight: 800; min-height: 48px; display: flex; align-items: center; }
.faq-item > *:not(summary) { padding: 0 var(--fx-s4) var(--fx-s3); margin: 0; color: var(--fx-ink-2); font-size: var(--fx-fs-sm); }
.dash-stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--fx-s3); }
.dash-stat-card { background: var(--fx-surface); border: 2px solid var(--fx-line); border-radius: var(--fx-r-lg); padding: var(--fx-s4); }
.dash-stat-num { font-size: var(--fx-fs-2xl); font-weight: 900; }
.dash-stat-label { font-size: var(--fx-fs-xs); color: var(--fx-muted); font-weight: 700; }
.invite-link-input { width: 100%; min-height: 48px; padding: 10px 12px; border: 2px solid var(--fx-line-strong); border-radius: var(--fx-r-sm); }

/* ---------- 20. Адаптив ---------- */
@media (min-width: 400px) {
  .answer-list--grid { gap: var(--fx-s3); }
}
@media (min-width: 768px) {
  :root { --fx-gutter: 24px; --fx-header-h: 68px; }
  h1 { font-size: var(--fx-fs-3xl); }
  .home-hero { padding: var(--fx-s10) 0 var(--fx-s4); }
  .home-hero__grid { grid-template-columns: 1fr 1.2fr; gap: var(--fx-s8); }
  .home-hero__copy { text-align: left; }
  .home-hero__lead { margin-left: 0; }
  .home-hero__actions { margin: 0; grid-template-columns: auto auto; justify-content: start; }
  .home-hero__mascot .mascot { --mascot-size: 260px; }
  .home-hero h1 { font-size: var(--fx-fs-3xl); }
  .subject-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-strip { grid-template-columns: repeat(3, 1fr); }
  .ach-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .app-footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .sheet__panel { left: 50%; right: auto; bottom: 50%; width: 440px; border-radius: var(--fx-r-xl); transform: translate(-50%, 60%); opacity: 0; transition: transform var(--fx-t-slow) var(--fx-ease), opacity var(--fx-t); }
  .sheet.is-visible .sheet__panel { transform: translate(-50%, 50%); opacity: 1; }
  .sheet__grip { display: none; }
  .q-head .mascot { --mascot-size: 110px; }
  .q-text { font-size: var(--fx-fs-xl); }
  .result__hero .mascot { --mascot-size: 200px; }
  .learn-head { grid-template-columns: 1fr auto; align-items: end; }
  .cookie-consent { left: auto; right: var(--fx-s5); bottom: var(--fx-s5); max-width: 420px; }
  .toast { bottom: var(--fx-s8); }
}
@media (min-width: 1024px) {
  body.has-bottom-nav { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .app-nav { display: flex; align-items: center; gap: 4px; margin-left: var(--fx-s4); }
  .app-nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: var(--fx-r-md); color: var(--fx-ink-2); text-decoration: none; font-weight: 800; font-size: var(--fx-fs-sm); transition: background var(--fx-t), color var(--fx-t); }
  .app-nav a .ico { width: 22px; height: 22px; }
  .app-nav a:hover { background: var(--fx-surface-2); color: var(--fx-ink); }
  .app-nav a.is-active { background: var(--fx-orange-soft); color: var(--fx-orange-dark); }
  .app-logo { margin-right: 0; }
  .app-header__spacer { flex: 1; }
  .app-header__account { display: inline-flex; }
  .search-panel { padding: 0; }
  .app-header .search-toggle { display: none; }
  .search-panel--desktop { display: block; width: 260px; }
  .search-panel--mobile { display: none !important; }
  .subject-grid { grid-template-columns: repeat(3, 1fr); }
  .ach-grid { grid-template-columns: repeat(4, 1fr); }
  .learn-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--fx-s8); align-items: start; }
  .learn-aside { position: sticky; top: calc(var(--fx-header-h) + 20px); display: grid; gap: var(--fx-s4); }
  .profile-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: var(--fx-s8); align-items: start; }
  .profile-layout > aside { position: sticky; top: calc(var(--fx-header-h) + 20px); }
  .home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--fx-s8); align-items: start; }
  .home-aside { position: sticky; top: calc(var(--fx-header-h) + 20px); display: grid; gap: var(--fx-s4); }
  .path__item { height: 116px; }
  .path-node { width: 84px; height: 78px; }
}
@media (max-width: 1023.98px) {
  .search-panel--desktop { display: none !important; }
  .learn-aside, .home-aside { display: grid; gap: var(--fx-s4); margin-top: var(--fx-s6); }
}
@media (min-width: 1440px) {
  :root { --fx-max: 1240px; }
}
@media (max-width: 359.98px) {
  :root { --fx-gutter: 12px; }
  .app-header__stats .chip { padding: 2px 6px; }
  .answer-list--grid { grid-template-columns: 1fr; }
  .subject-card { grid-template-columns: 60px 1fr auto; }
  .subject-card__icon { width: 60px; height: 60px; }
  .subject-card__icon img { width: 54px; height: 54px; }
  .result__stats { gap: var(--fx-s2); }
  .stat-tile__value { font-size: var(--fx-fs-lg); }
}

/* ---------- 21. Уменьшение движения ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .path-node--current::before, .path-start { animation: none !important; }
  .fx-particles { display: none; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition: none !important; }

/* ---------- 22. Точечные правки ---------- */
.home-hero__actions .btn { white-space: nowrap; }
@media (min-width: 1024px) { .app-nav a[data-guest-profile] { display: none; } }
.home-hero__mascot .mascot { --mascot-size: 150px !important; }
@media (min-width: 768px) { .home-hero__mascot .mascot { --mascot-size: 250px !important; } }
@media (max-width: 767.98px) { .grade-card { padding: 8px 8px 10px; } .grade-card__num { font-size: var(--fx-fs-md); } }

/* ==========================================================================
   23. Игровая платформа: верхняя панель, док-навигация, карта мира
   Графика локаций — только из public/assets/world/ (см. asset-manifest.md).
   Пока файлов нет, остров = нейтральная «подложка» (.island__ground) +
   иконка предмета; фон карты — спокойный градиент «моря».
   ========================================================================== */
:root {
  --fx-choco: #7B4F2C; --fx-choco-dark: #5C3A1E; --fx-choco-soft: #F3E6D8;
  --fx-sea-1: #8FDCFA; --fx-sea-2: #4DB5EC;
  --fx-sand: #F6E3BC; --fx-sand-dark: #E7C98F;
}

/* --- Верхняя игровая панель --- */
.game-bar { background: rgba(255, 248, 238, 0.96); border-bottom: 0; box-shadow: 0 2px 0 var(--fx-line), 0 6px 18px rgba(123, 79, 44, 0.06); }
.game-bar .app-logo { margin-right: 0; }
.game-bar .app-logo img { height: 36px; width: auto; }
.game-bar .app-header__inner { gap: 6px; }
.game-bar .app-header__stats { gap: 4px; }
.game-bar .app-header__stats .chip { min-height: 36px; padding: 2px 9px; background: var(--fx-surface); border: 2px solid var(--fx-line); box-shadow: 0 2px 0 var(--fx-line); }
.chip--stars { color: var(--fx-yellow-dark); }
.chip--stars .ico { fill: var(--fx-yellow); stroke: var(--fx-yellow-dark); stroke-width: 1.6; }
.game-bar .search-toggle { display: inline-grid !important; width: 40px; height: 40px; }
.app-header__login { flex: none; }
.player-chip {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  padding: 3px; border-radius: var(--fx-r-full); text-decoration: none; color: var(--fx-ink);
  background: var(--fx-surface); border: 2px solid var(--fx-line); box-shadow: 0 2px 0 var(--fx-line);
  transition: transform var(--fx-t-fast);
}
.player-chip:active { transform: translateY(2px); box-shadow: none; }
.player-chip__avatar { position: relative; width: 36px; height: 36px; border-radius: 50%; background: var(--fx-orange-soft); flex: none; }
.player-chip__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.player-chip__lvl {
  position: absolute; right: -5px; bottom: -4px; min-width: 20px; height: 20px; padding: 0 4px;
  display: grid; place-items: center; border-radius: 10px; border: 2px solid #fff;
  background: var(--fx-purple); color: #fff; font-size: 11px; font-weight: 900; line-height: 1;
}
.player-chip__info { display: none; min-width: 0; padding-right: 10px; }
.player-chip__name { display: block; font-weight: 900; font-size: var(--fx-fs-sm); line-height: 1.1; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-chip__xp { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: var(--fx-purple-dark); white-space: nowrap; }
.player-chip__bar { display: block; width: 64px; height: 7px; border-radius: 4px; background: var(--fx-purple-soft); overflow: hidden; }
.player-chip__bar .progress__fill { background: var(--fx-purple); box-shadow: none; }
.player-chip__bar .progress__fill::after { display: none; }
.search-panel--mobile.is-open { display: block !important; }

/* --- Док-навигация (на всех экранах; на десктопе — плавающая «панель игры») --- */
.game-dock { border-top: 0; box-shadow: 0 -2px 0 var(--fx-line), 0 -8px 24px rgba(123, 79, 44, 0.08); }
.game-dock .bottom-nav__item.is-active { color: #fff; background: var(--fx-orange); box-shadow: inset 0 -4px 0 var(--fx-orange-dark); }

/* --- Сцена мира --- */
.world { padding: var(--fx-s3) 0 var(--fx-s2); }
.world__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--fx-s2) var(--fx-s4); margin-bottom: var(--fx-s3); }
.world__eyebrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: var(--fx-fs-sm); color: var(--fx-orange-dark); }
.world__eyebrow .ico { width: 20px; height: 20px; }
.world__title h1 { font-size: 1.1rem; line-height: 1.25; margin: 2px 0 0; color: var(--fx-choco-dark); }
.grade-tabs { display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--fx-r-full); background: var(--fx-choco-soft); box-shadow: inset 0 2px 0 rgba(123, 79, 44, 0.08); }
.grade-tabs__item {
  min-width: 44px; min-height: 40px; padding: 6px 14px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--fx-r-full); font-weight: 900; color: var(--fx-choco); text-decoration: none; transition: background var(--fx-t), color var(--fx-t);
}
.grade-tabs__item span { font-weight: 800; }
.grade-tabs__item.is-active { background: var(--fx-surface); color: var(--fx-orange-dark); box-shadow: 0 3px 0 var(--fx-line-strong); }

.world__frame { position: relative; }
.world__scene {
  --h: var(--h-m);
  position: relative; height: var(--h); overflow: hidden;
  margin: 0 calc(var(--fx-gutter) * -1);
  border-radius: 0;
  background: var(--map-bg, none) center / cover no-repeat, linear-gradient(180deg, var(--fx-sea-1), var(--fx-sea-2));
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.35), inset 0 -40px 80px rgba(23, 130, 201, 0.25);
  isolation: isolate;
}
/* Мягкая «рябь» воды — только для временного фона, пока нет world/map-bg */
.world__sea { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.world__scene--placeholder .world__sea {
  background:
    radial-gradient(ellipse 22px 6px at 30% 40%, rgba(255,255,255,.45) 50%, transparent 52%) 0 0 / 140px 90px,
    radial-gradient(ellipse 16px 5px at 70% 75%, rgba(255,255,255,.3) 50%, transparent 52%) 0 0 / 120px 110px;
}
.world__cloud { position: absolute; width: 120px; height: 34px; border-radius: 30px; background: rgba(255, 255, 255, 0.75); animation: fxCloud 60s linear infinite; }
.world__cloud::before { content: ""; position: absolute; left: 22px; top: -18px; width: 56px; height: 44px; border-radius: 50%; background: inherit; }
.world__cloud--1 { top: 6%; left: -10%; }
.world__cloud--2 { top: 46%; left: -30%; transform: scale(.7); animation-duration: 80s; animation-delay: -30s; opacity: .8; }
.world__cloud--3 { top: 78%; left: -20%; transform: scale(.85); animation-duration: 70s; animation-delay: -50s; }
@keyframes fxCloud { from { translate: 0 0; } to { translate: 130vw 0; } }

.world__trail { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; display: none; overflow: visible; pointer-events: none; }
.world__trail--m { display: block; }
.world__trail path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.world__trail-bed { stroke: var(--fx-sand); stroke-width: 18px; }
.world__trail-dash { stroke: rgba(123, 79, 44, 0.35); stroke-width: 3px; stroke-dasharray: 2 12; }
.world__trail-walked { stroke: var(--fx-orange); stroke-width: 5px; stroke-dasharray: 10 10; opacity: .85; }

/* --- Остров --- */
.island {
  --x: var(--xm); --y: var(--ym); --w: 150px;
  --tone-top: #8EDB7A; --tone-side: #4FAE52;
  position: absolute; left: var(--x); top: var(--y); z-index: 2;
  width: var(--w); transform: translate(-50%, -58%);
  display: flex; flex-direction: column; align-items: center;
  color: var(--fx-ink); text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: transform var(--fx-t) var(--fx-ease-bounce);
}
.island--blue   { --tone-top: #9FD8FF; --tone-side: #4C9FDB; }
.island--coral  { --tone-top: #FFC2B8; --tone-side: #E9786A; }
.island--purple { --tone-top: #D4C2FF; --tone-side: #8F6BE8; }
.island--yellow { --tone-top: #FFE58A; --tone-side: #E8B524; }
.island--orange { --tone-top: #FFD0A3; --tone-side: #F08A35; }
.island--pink   { --tone-top: #FFC9E3; --tone-side: #E07AAE; }
.island--teal   { --tone-top: #A8EBDD; --tone-side: #3FB89E; }
.island--sky    { --tone-top: #CFE9FF; --tone-side: #8AB6DA; }
.island:focus-visible { outline: none; }
.island:focus-visible .island__sign { outline: 4px solid var(--fx-blue); outline-offset: 3px; }
@media (hover: hover) { a.island:hover { transform: translate(-50%, -58%) scale(1.05); } }
a.island:active { transform: translate(-50%, -58%) scale(0.96); }

.island__art { position: relative; width: 100%; aspect-ratio: 5 / 4; display: block; }
.island__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 10px rgba(16, 70, 110, 0.25)); }
.island__ground {
  position: absolute; left: 4%; right: 4%; bottom: 8%; height: 44%;
  border-radius: 50% / 46%;
  background: radial-gradient(ellipse at 50% 30%, rgba(255,255,255,.55), transparent 55%), var(--tone-top);
  box-shadow: 0 10px 0 var(--tone-side), 0 17px 0 var(--fx-sand-dark), 0 26px 24px rgba(16, 70, 110, 0.28);
}
.island__icon {
  position: absolute; left: 50%; bottom: 30%; width: 62%; transform: translateX(-50%);
  animation: fxBob 3.6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -0.7s);
}
.island__icon img { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 4px rgba(0,0,0,.18)); }
@keyframes fxBob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }
.island.is-here .island__art::before {
  content: ""; position: absolute; left: -6%; right: -6%; bottom: 0; height: 48%; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 226, 122, .85), transparent 70%);
  animation: fxGlow 2s ease-in-out infinite;
}
@keyframes fxGlow { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.1); } }
.island__flag, .island__lock {
  position: absolute; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.12); color: #fff;
}
.island__flag { left: 6%; top: 10%; background: var(--fx-green); }
.island__lock { left: 50%; top: 42%; transform: translate(-50%, -50%); width: 46px; height: 46px; background: var(--fx-grey-dark); }
.island__flag .ico, .island__lock .ico { width: 18px; height: 18px; }

.island__sign {
  position: relative; z-index: 1; margin-top: -4px; min-width: 128px; max-width: 100%;
  padding: 6px 10px 8px; border-radius: 14px; text-align: center;
  background: linear-gradient(180deg, #A0704A, var(--fx-choco)); color: #FFF6E6;
  box-shadow: 0 4px 0 var(--fx-choco-dark), 0 8px 14px rgba(60, 35, 10, .25);
}
.island__name { display: block; font-weight: 900; font-size: 0.95rem; line-height: 1.15; color: #fff; }
.island__place { display: block; font-size: 11px; font-weight: 700; opacity: .85; line-height: 1.2; }
.island__meta { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; font-weight: 900; }
.island__stars { display: inline-flex; align-items: center; gap: 2px; color: #FFE27A; }
.island__stars .ico { width: 14px; height: 14px; color: var(--fx-yellow); }
.island__count { display: none; opacity: .85; font-weight: 800; }
.island__bar { display: block; height: 6px; margin-top: 5px; border-radius: 3px; background: rgba(0,0,0,.25); overflow: hidden; }
.island__bar span { display: block; height: 100%; background: var(--fx-green); border-radius: 3px; transition: width 900ms var(--fx-ease); }
.island__state {
  position: absolute; top: 0; right: 0; z-index: 2; padding: 2px 9px; border-radius: var(--fx-r-full);
  font-size: 11px; font-weight: 900; color: #fff; background: var(--fx-blue); border: 2px solid #fff; box-shadow: 0 2px 0 rgba(0,0,0,.12);
}
.island.is-done .island__state { background: var(--fx-green); }
.island.is-active .island__state { background: var(--fx-orange); animation: fxPulse 1.8s ease-in-out infinite; }
.island.is-locked .island__state { background: var(--fx-grey-dark); }
.island.is-locked .island__art { filter: saturate(.25) brightness(1.05); opacity: .8; }
.island.is-locked .island__sign { background: linear-gradient(180deg, #A9A39C, #8A847D); box-shadow: 0 4px 0 #6E6963; }
.island.is-new .island__state { display: none; }
@keyframes fxPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* --- Лисёнок на карте --- */
.world-fox {
  --x: var(--xm); --y: var(--ym);
  position: absolute; left: var(--x); top: var(--y); z-index: 3;
  transform: translate(-50%, -88%); pointer-events: none;
  transition: left 700ms var(--fx-ease), top 700ms var(--fx-ease);
}
.world-fox .mascot { --mascot-size: 92px !important; filter: drop-shadow(0 8px 6px rgba(16, 70, 110, .3)); }
.world-fox__bubble {
  position: absolute; bottom: calc(100% - 4px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 210px; padding: 8px 12px;
  background: #fff; border: 2px solid var(--fx-line); border-radius: 16px; box-shadow: 0 3px 0 var(--fx-line);
  font-size: 13px; font-weight: 800; line-height: 1.3; color: var(--fx-ink); text-align: center;
  animation: fxBubbleIn 420ms var(--fx-ease-bounce) both; animation-delay: 600ms;
}
.world-fox__bubble::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 14px; height: 14px; margin-left: -7px; background: #fff; border-right: 2px solid var(--fx-line); border-bottom: 2px solid var(--fx-line); transform: rotate(45deg); }
.world-fox__bubble:empty { display: none; }
.world-fox.is-running .world-fox__bubble { opacity: 0; transition: opacity 120ms; }
@keyframes fxBubbleIn { from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(.9); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }

/* --- Сундук дня --- */
.world-chest {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px;
  border-radius: 18px; background: rgba(255, 255, 255, .96); color: var(--fx-ink); text-decoration: none;
  border: 2px solid var(--fx-line); box-shadow: 0 4px 0 var(--fx-line-strong), 0 10px 20px rgba(16, 70, 110, .15);
  transition: transform var(--fx-t-fast);
}
.world-chest:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--fx-line-strong); }
.world-chest__art { width: 46px; height: 46px; flex: none; display: grid; place-items: center; }
.world-chest__art img { width: 46px; height: 46px; object-fit: contain; }
.world-chest__icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--fx-yellow); color: var(--fx-choco-dark); box-shadow: inset 0 -4px 0 var(--fx-yellow-dark); }
.world-chest__icon .ico { width: 28px; height: 28px; }
.world-chest.is-open .world-chest__icon { background: var(--fx-green); color: #fff; box-shadow: inset 0 -4px 0 var(--fx-green-dark); }
.world-chest.is-locked .world-chest__icon { background: var(--fx-grey-soft); color: var(--fx-grey-dark); box-shadow: inset 0 -4px 0 var(--fx-grey); }
.world-chest__text { display: flex; flex-direction: column; line-height: 1.15; }
.world-chest__text b { font-size: var(--fx-fs-sm); font-weight: 900; }
.world-chest__text span { font-size: 12px; font-weight: 800; color: var(--fx-muted); }
.world-chest.is-pulse { animation: fxPop 600ms var(--fx-ease-bounce) 2; }

/* --- Лист острова --- */
.sheet__x { position: absolute; top: 10px; right: 10px; }
.island-sheet__head { display: flex; align-items: center; gap: var(--fx-s3); margin-bottom: var(--fx-s3); padding-right: 40px; }
.island-sheet__icon { width: 76px; height: 76px; flex: none; border-radius: 22px; display: grid; place-items: center; background: var(--fx-orange-soft); }
.island-sheet__icon img { width: 64px; height: 64px; object-fit: contain; }
.island-sheet__place { display: block; font-size: var(--fx-fs-xs); font-weight: 900; color: var(--fx-orange-dark); text-transform: uppercase; letter-spacing: .04em; }
.island-sheet .sheet__title { margin: 0; }
.island-sheet__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--fx-s2); }
.island-stat { padding: 10px 6px; border-radius: var(--fx-r-md); background: var(--fx-surface-2); text-align: center; }
.island-stat b { display: block; font-size: var(--fx-fs-lg); font-weight: 900; line-height: 1.1; }
.island-stat span { font-size: 12px; font-weight: 800; color: var(--fx-muted); }
.island-stat--stars b { color: var(--fx-yellow-dark); }
.island-sheet__quest { margin-top: var(--fx-s3); }
.quest-card { display: flex; gap: var(--fx-s3); align-items: center; padding: 12px 14px; border-radius: var(--fx-r-md); background: var(--fx-yellow-soft); border: 2px dashed #F2D374; }
.quest-card .ico { width: 30px; height: 30px; color: var(--fx-choco); flex: none; }
.quest-card small { display: block; font-size: 12px; font-weight: 900; color: var(--fx-choco); text-transform: uppercase; letter-spacing: .03em; }
.quest-card b { display: block; font-size: var(--fx-fs-sm); line-height: 1.3; }
.sheet .goal-row { display: grid; grid-template-columns: 40px 1fr; gap: var(--fx-s3); align-items: center; padding: var(--fx-s2) 0; }

/* --- Под картой --- */
.world-below { padding-top: var(--fx-s4); }
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--fx-s3); counter-reset: how; }
.how-step { position: relative; display: flex; align-items: center; gap: var(--fx-s3); padding: var(--fx-s3) var(--fx-s4) var(--fx-s3) var(--fx-s3); border-radius: var(--fx-r-lg); background: var(--fx-surface); border: 2px solid var(--fx-line); box-shadow: 0 3px 0 var(--fx-line); }
.how-step .mascot { --mascot-size: 72px !important; }
.how-step b { display: block; font-weight: 900; }
.how-step b::before { counter-increment: how; content: counter(how) ". "; color: var(--fx-orange-dark); }
.how-step span { display: block; font-size: var(--fx-fs-sm); color: var(--fx-ink-2); line-height: 1.35; }
.world-panels { display: grid; gap: var(--fx-s4); margin-top: var(--fx-s5); }

/* --- Раскладки карты --- */
@media (min-width: 480px) {
  .player-chip__info { display: block; }
}
@media (min-width: 768px) {
  .world__title h1 { font-size: 1.5rem; }
  .world__scene { --h: var(--h-t); margin: 0; border-radius: 32px; }
  .island, .world-fox { --x: var(--xt); --y: var(--yt); }
  .island { --w: 180px; }
  .island__count { display: inline; }
  .world__trail--m { display: none; }
  .world__trail--t { display: block; }
  .world-fox .mascot { --mascot-size: 112px !important; }
  .world-chest { top: 16px; right: 16px; }
  .how-steps { grid-template-columns: repeat(3, 1fr); }
  .island-sheet .sheet__actions { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  body.has-bottom-nav { padding-bottom: calc(var(--fx-bottom-nav-h) + 32px); }
  .bottom-nav.game-dock {
    display: grid; left: 50%; right: auto; bottom: 16px; width: 480px; transform: translateX(-50%);
    height: var(--fx-bottom-nav-h); padding: 6px; border-radius: 24px;
    box-shadow: 0 0 0 2px var(--fx-line), 0 6px 0 var(--fx-line-strong), 0 18px 40px rgba(123, 79, 44, .18);
  }
  .game-dock .bottom-nav__item { flex-direction: row; gap: 8px; font-size: var(--fx-fs-sm); border-radius: 18px; }
  .game-dock .bottom-nav__item .ico { width: 24px; height: 24px; }
  .game-bar .app-logo img { height: 44px; }
  .player-chip__name { max-width: 180px; }
  .player-chip__bar { width: 96px; }
  .world__scene { --h: var(--h-d); }
  .island, .world-fox { --x: var(--xd); --y: var(--yd); }
  .island { --w: 200px; }
  .world__trail--t { display: none; }
  .world__trail--d { display: block; }
  .world-fox .mascot { --mascot-size: 108px !important; }
  .world-panels { grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 359.98px) {
  .game-bar .app-logo img { height: 30px; }
  .game-bar .app-header__stats .chip { padding: 2px 6px; }
  .island { --w: 136px; }
  .island__sign { min-width: 116px; }
}
@media (prefers-reduced-motion: reduce) {
  .world__cloud, .island__icon, .island.is-here .island__art::before, .island.is-active .island__state { animation: none !important; }
  .world-fox { transition: none; }
}

/* --- Карта с настоящей графикой (public/assets/world/) --- */
.world__scene:not(.world__scene--placeholder) .world__cloud { display: none; }
.world__scene:not(.world__scene--placeholder) { box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.35); }
.island.has-art { --w: 164px; }
.island.has-art .island__img { object-position: center bottom; }
.island.has-art .island__sign { margin-top: -14px; }
.island.has-art .island__flag { left: 2%; top: 2%; }
@media (min-width: 768px) { .island.has-art { --w: 196px; } }
@media (min-width: 1024px) { .island.has-art { --w: 224px; } }
@media (max-width: 359.98px) { .island.has-art { --w: 146px; } }

/* Более цельная игровая карта и выразительное открытие сундука. */
.world__scene { border: 4px solid rgba(255,255,255,.72); box-shadow: inset 0 0 0 1px rgba(73,132,161,.16), inset 0 -52px 90px rgba(26,104,151,.2), 0 16px 36px rgba(34,89,119,.18); }
.world__scene--placeholder { background: radial-gradient(ellipse at 20% 18%,rgba(255,255,255,.72),transparent 25%), radial-gradient(ellipse at 80% 72%,rgba(86,194,204,.5),transparent 32%), linear-gradient(145deg,#86d7ec,#52b5d5 55%,#3e9fc5); }
.world__scene--placeholder .world__sea { opacity: .75; }
.world__trail-bed { stroke: rgba(255,246,216,.95); stroke-width: 22px; filter: drop-shadow(0 4px 2px rgba(37,97,113,.18)); }
.world__trail-dash { stroke: rgba(140,100,54,.4); stroke-width: 2px; stroke-dasharray: 2 10; }
.island__sign { border: 2px solid rgba(255,239,205,.9); box-shadow: 0 5px 0 var(--fx-choco-dark), 0 11px 20px rgba(46,64,50,.25); }
.island__state { padding: 4px 11px; box-shadow: 0 3px 0 rgba(28,59,61,.2),0 5px 12px rgba(28,59,61,.14); }
.world-chest { gap: 10px; padding: 8px 16px 8px 8px; border: 2px solid #fff; background: linear-gradient(135deg,#fffdf8,#fff2dc); box-shadow: 0 5px 0 #dfc9a6, 0 12px 24px rgba(48,75,82,.2); }
.world-chest__art { position: relative; width: 54px; height: 54px; border-radius: 17px; background: radial-gradient(circle at 50% 42%,#fff4c8,#ffe1a1 70%); box-shadow: inset 0 -3px rgba(202,139,45,.14); }
.world-chest__art img { width: 52px; height: 52px; filter: drop-shadow(0 4px 3px rgba(92,52,16,.24)); }
.world-chest__text b { color: #593d24; font-size: 14px; }
.world-chest__text span { color: #8a6a48; }
.world-chest.is-opening { animation: chestUnlock .72s cubic-bezier(.2,.8,.3,1) both; }
.world-chest.is-opening::after { content: "✦"; position: absolute; left: 50%; top: 50%; z-index: 2; color: #f4ad36; font-size: 30px; pointer-events: none; animation: chestSpark .72s ease-out both; }
.world-chest.is-opening .world-chest__art img, .world-chest.is-opening .world-chest__icon { animation: chestLid .72s cubic-bezier(.2,.8,.3,1) both; }
.world-chest.is-open .world-chest__art { background: radial-gradient(circle at 50% 42%,#fff7bd,#ffe07a 70%); }
.world-chest.is-pulse { animation: chestReward 1.1s cubic-bezier(.2,.8,.3,1) 2; }
@keyframes chestUnlock { 0% { transform: scale(1) rotate(0); } 18% { transform: scale(1.08) rotate(-4deg); } 36% { transform: scale(1.08) rotate(4deg); } 55% { transform: scale(.94) rotate(-2deg); } 75% { transform: scale(1.12) translateY(-5px); box-shadow: 0 7px 0 #dfc9a6,0 18px 30px rgba(48,75,82,.24),0 0 0 9px rgba(255,216,115,.26); } 100% { transform: scale(1); } }
@keyframes chestLid { 0%,100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-5px) rotate(-7deg); } 50% { transform: translateY(-8px) rotate(8deg); } 75% { transform: translateY(-4px) scale(1.13); } }
@keyframes chestSpark { 0% { opacity: 0; transform: translate(-50%,-30%) scale(.2) rotate(0); } 35% { opacity: 1; transform: translate(-50%,-95%) scale(1.4) rotate(35deg); } 100% { opacity: 0; transform: translate(-50%,-150%) scale(.5) rotate(80deg); } }
@keyframes chestReward { 0%,100% { transform: scale(1); } 35% { transform: scale(1.13) translateY(-5px); box-shadow: 0 7px 0 #dfc9a6,0 18px 32px rgba(48,75,82,.26),0 0 0 10px rgba(255,215,103,.25); } 65% { transform: scale(.98); } }
@media (max-width: 480px) { .world-chest { top: 9px; right: 9px; gap: 7px; padding: 6px 10px 6px 6px; } .world-chest__art { width: 44px; height: 44px; } .world-chest__art img { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .world-chest.is-opening, .world-chest.is-opening::after, .world-chest.is-opening .world-chest__art img, .world-chest.is-opening .world-chest__icon, .world-chest.is-pulse { animation: none !important; } }

/* ==========================================================================
   24. Каталог тем (без игровой формы): страница «Темы» и страница предмета
   Картинка темы — public/assets/topics/<ключ>.webp, иначе иконка предмета.
   ========================================================================== */
.topics-head { display: flex; align-items: center; gap: var(--fx-s4); margin-bottom: var(--fx-s4); }
.topics-head__icon { width: 72px; height: 72px; flex: none; display: grid; place-items: center; }
.topics-head__icon img { width: 72px; height: 72px; object-fit: contain; }
.topics-head__icon .mascot { --mascot-size: 72px !important; }
.topics-head h1 { margin: 0; font-size: var(--fx-fs-xl); line-height: 1.2; }
.topics-head p { margin: 4px 0 0; font-size: var(--fx-fs-sm); }
.topics-links { display: flex; flex-wrap: wrap; gap: var(--fx-s2); margin-bottom: var(--fx-s4); }
.topics-links .btn .ico { width: 20px; height: 20px; }
.topics-tools { display: flex; flex-wrap: wrap; gap: var(--fx-s3); align-items: center; margin-bottom: var(--fx-s3); }
.topics-search { position: relative; flex: 1 1 220px; display: block; }
.topics-search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--fx-muted); }
.topics-search input { width: 100%; height: 48px; padding: 0 16px 0 44px; border: 2px solid var(--fx-line-strong); border-radius: var(--fx-r-md); background: var(--fx-surface); font: inherit; font-size: var(--fx-fs-md); outline: none; }
.topics-search input:focus { border-color: var(--fx-blue); }
.topics-filter { display: flex; gap: var(--fx-s2); overflow-x: auto; padding: 2px 0 var(--fx-s2); margin-bottom: var(--fx-s2); scrollbar-width: none; }
.topics-filter::-webkit-scrollbar { display: none; }
.topics-filter .chip { cursor: pointer; font: inherit; font-weight: 800; font-size: var(--fx-fs-sm); }
.topics-filter .chip.is-active { background: var(--fx-orange); border-color: var(--fx-orange-dark); color: #fff; }
.topics-section .section-title h2 a { color: inherit; text-decoration: none; }
.topics-section .section-title h2 a:hover { color: var(--fx-orange-dark); }

.topic-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--fx-s2); }
.topic-row[hidden], .topics-section[hidden] { display: none; }
.topic-row__link {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) 24px; gap: var(--fx-s3); align-items: center;
  padding: 10px 12px 10px 10px; border-radius: var(--fx-r-lg); text-decoration: none; color: var(--fx-ink);
  background: var(--fx-surface); border: 2px solid var(--fx-line); box-shadow: 0 3px 0 var(--fx-line);
  transition: transform var(--fx-t-fast), border-color var(--fx-t);
}
@media (hover: hover) { .topic-row__link:hover { border-color: var(--fx-blue); } }
.topic-row__link:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--fx-line); }
.topic-row__pic { width: 72px; height: 72px; border-radius: 16px; overflow: hidden; background: var(--fx-surface-2); display: grid; place-items: center; }
.topic-row__img { width: 72px; height: 72px; object-fit: cover; display: block; }
.topic-row__img--fallback { width: 54px; height: 54px; object-fit: contain; }
.topic-row__name { display: block; font-weight: 800; font-size: var(--fx-fs-sm); line-height: 1.3; }
.topic-row__desc { display: block; font-size: var(--fx-fs-xs); color: var(--fx-muted); line-height: 1.3; margin-top: 2px; }
.topic-row__status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 12px; font-weight: 800; color: var(--fx-green-dark); }
.topic-row__status:empty { display: none; }
.topic-stars { display: inline-flex; gap: 1px; }
.topic-stars .ico { width: 16px; height: 16px; color: var(--fx-grey); }
.topic-stars .ico.is-on { color: var(--fx-yellow); }
.topic-row__go { color: var(--fx-muted); }
.topic-row.is-done .topic-row__link { background: linear-gradient(90deg, var(--fx-green-soft), var(--fx-surface) 40%); }
@media (min-width: 768px) {
  .topic-list { grid-template-columns: 1fr 1fr; gap: var(--fx-s3); }
  .topics-head h1 { font-size: var(--fx-fs-2xl); }
}
