:root {
  --bg-deep:      #0f172a;
  --bg-indigo:    #1e1b4b;
  --primary:      #ff8a3d;   /* оранжевый — главный */
  --secondary:    #06b6d4;   /* бирюзовый */
  --sun:          #fbbf24;   /* жёлтый */
  --grass:        #10b981;   /* зелёный */
  --danger:       #ef4444;   /* красный */
  --magic:        #a855f7;   /* фиолетовый */
  --sky:          #3b82f6;   /* синий */
  --white:        #f8fafc;
  --cream:        #fff9f0;
  --ink:          #0f172a;
  --ink-soft:     #64748b;
  --radius:       26px;
  --shadow-pop:   0 10px 0 var(--ink);
  --font:         'Fredoka', 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ===== ФОН: ТЁМНЫЙ КОСМОС С НЕБУЛОЗАМИ ===== */
body {
  font-family: var(--font);
  font-weight: 500;
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background:
    radial-gradient(circle at 15% 20%, rgba(168, 85, 247, .45) 0%, transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(59, 130, 246, .4) 0%, transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(255, 138, 61, .35) 0%, transparent 45%),
    radial-gradient(circle at 20% 90%, rgba(6, 182, 212, .35) 0%, transparent 40%),
    var(--bg-deep);
  background-attachment: fixed;
}

/* Мелкие статичные звёзды на фоне */
.stars-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-repeat: repeat;
  opacity: .9;
}
@keyframes twinkle-soft {
  0%, 100% { opacity: .6; }
  50% { opacity: 1; }
}

/* Летающие объекты: ракеты, планеты, кометы, немного конфет */
.float-item {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  opacity: .85;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.4));
  animation: float-up linear infinite;
}
@keyframes float-up {
  0%   { transform: translateY(0) rotate(0); }
  100% { transform: translateY(-115vh) rotate(360deg); }
}

/* Астероид-пульсация */
.asteroid {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  font-size: 1.4rem;
  opacity: .55;
  animation: asteroid-spin 12s linear infinite;
}
@keyframes asteroid-spin {
  from { transform: rotate(0) scale(1); }
  to   { transform: rotate(360deg) scale(1.2); }
}

/* ===== ЗАГОЛОВКИ ===== */
h1, h2, h3 {
  font-weight: 700;
  line-height: 1.1;
  color: var(--white);
}

h1.hero-title {
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  color: var(--white);
  text-shadow:
    4px 4px 0 var(--primary),
    8px 8px 0 rgba(15,23,42,.4);
  letter-spacing: .02em;
  margin-bottom: .5rem;
}

.title-letter {
  display: inline-block;
  animation: letter-bounce .7s cubic-bezier(.68,-.55,.265,1.55) both;
}
@keyframes letter-bounce {
  0%   { transform: scale(0) rotate(-30deg) translateY(-40px); opacity: 0; }
  60%  { transform: scale(1.2) rotate(10deg) translateY(10px); opacity: 1; }
  100% { transform: scale(1) rotate(0) translateY(0); opacity: 1; }
}

.subtitle {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 500;
  color: var(--sun);
  text-shadow: 0 2px 0 rgba(0,0,0,.4);
  letter-spacing: .02em;
}

/* ===== HERO БЛОК С КОТОМ СВЕРХУ ===== */
.hero {
  padding: 2rem 1rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-inner {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  max-width: 900px;
  width: 100%;
}
.hero-cat-wrap {
  flex-shrink: 0;
  position: relative;
  width: 200px;
  height: 220px;
  animation: cat-hover 3s ease-in-out infinite;
}
@keyframes cat-hover {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
.hero-text {
  flex: 1;
  text-align: left;
  min-width: 0;
}
.hero-actions {
  margin-top: 1.2rem;
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .hero-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .hero-text { text-align: center; }
  .hero-cat-wrap { width: 150px; height: 170px; }
  .hero-actions { justify-content: center; }
}

/* ===== КОТ ===== */
.cat-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 20px rgba(255, 138, 61, .5))
          drop-shadow(0 4px 8px rgba(0,0,0,.4));
}

/* Машущая лапка */
.cat-paw {
  transform-origin: 195px 145px;
  animation: paw-wave 1.3s ease-in-out infinite;
}
@keyframes paw-wave {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(-28deg); }
}

/* Пламя реактивного ранца */
.flame {
  transform-origin: 70px 245px;
  animation: flame-flicker .35s ease-in-out infinite alternate;
}
@keyframes flame-flicker {
  0%   { transform: scaleY(1)   scaleX(1);    opacity: 1; }
  100% { transform: scaleY(1.2) scaleX(0.85); opacity: .9; }
}

/* Моргание (если понадобится) */
.cat-eye {
  transform-origin: center;
  animation: blink 5s infinite;
}
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%, 97%      { transform: scaleY(0.1); }
}

/* Облачко с фразой */


.hero-cat-wrap:hover 

@media (max-width: 640px) {
  
  
  .hero-cat-wrap:hover 
}

/* ===== КНОПКИ ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .9rem 1.8rem;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--ink);
  transition: transform .15s cubic-bezier(.68,-.55,.265,1.55),
              box-shadow .15s;
  text-decoration: none;
  user-select: none;
}
.btn:hover, .btn:focus-visible {
  transform: translateY(-3px) rotate(-2deg);
  box-shadow: 0 10px 0 var(--ink);
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--ink);
}
.btn--primary { background: var(--primary); color: var(--white); }
.btn--cyan    { background: var(--secondary); color: var(--ink); }
.btn--sound {
  position: fixed; top: 1rem; right: 1rem; z-index: 100;
  padding: .6rem .9rem; font-size: 1.5rem;
  background: var(--white); border-color: var(--ink);
  box-shadow: 0 5px 0 var(--ink);
}

/* ===== КОНТЕЙНЕР ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1rem 5rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* ===== СЕТКА КАРТОЧЕК ===== */
.galaxies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem 1.5rem;
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== КАРТОЧКА ===== */
.galaxy-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  padding: 1.8rem 1rem 1.4rem;
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--white) 0%, #e2e8f0 100%);
  border: 4px solid var(--ink);
  box-shadow:
    0 8px 0 var(--ink),
    0 12px 30px rgba(0,0,0,.4);
  transition: transform .3s cubic-bezier(.68,-.55,.265,1.55),
              box-shadow .3s;
}
.galaxy-card:hover, .galaxy-card:focus-visible {
  transform: translateY(-10px) rotate(-2deg) scale(1.04);
  box-shadow:
    0 16px 0 var(--ink),
    0 20px 50px rgba(0,0,0,.5),
    0 0 50px var(--planet-color);
  outline: none;
}
.galaxy-card:nth-child(2n):hover { transform: translateY(-10px) rotate(2deg) scale(1.04); }

/* ===== ПЛАНЕТА ===== */
.planet {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin-bottom: 1.2rem;
  border: 3.5px solid var(--ink);
  background:
    /* блик сверху-слева */
    radial-gradient(circle at 28% 22%, rgba(255,255,255,.95) 0%, rgba(255,255,255,.5) 12%, transparent 32%),
    /* кратеры */
    radial-gradient(circle at 65% 68%, rgba(0,0,0,.35) 9px, transparent 10px),
    radial-gradient(circle at 28% 58%, rgba(0,0,0,.28) 6px, transparent 7px),
    radial-gradient(circle at 78% 32%, rgba(0,0,0,.25) 5px, transparent 6px),
    radial-gradient(circle at 48% 82%, rgba(0,0,0,.3) 7px, transparent 8px),
    radial-gradient(circle at 75% 78%, rgba(255,255,255,.5) 4px, transparent 5px),
    /* основа */
    radial-gradient(circle at 50% 50%, var(--planet-color) 0%, var(--planet-color) 55%, rgba(15,23,42,.65) 100%);
  box-shadow:
    inset -12px -15px 25px rgba(0,0,0,.4),
    inset 5px 5px 20px rgba(255,255,255,.25),
    0 0 40px -5px var(--planet-color),
    0 6px 0 var(--ink);
  animation: planet-float 4s ease-in-out infinite;
  transition: transform .3s cubic-bezier(.68,-.55,.265,1.55);
}
.galaxy-card:hover .planet {
  transform: scale(1.12) rotate(10deg);
}
@keyframes planet-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* Кольцо вокруг планеты */
.planet-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 205px;
  height: 48px;
  border: 5px solid rgba(251, 191, 36, .75);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-20deg);
  box-shadow:
    0 0 20px rgba(251, 191, 36, .55),
    inset 0 0 12px rgba(251, 191, 36, .35);
  pointer-events: none;
  animation: ring-tilt 6s ease-in-out infinite;
}
@keyframes ring-tilt {
  0%, 100% { transform: translate(-50%, -50%) rotate(-20deg); }
  50%      { transform: translate(-50%, -50%) rotate(-12deg); }
}
.galaxy-card:hover .planet-ring {
  transform: translate(-50%, -50%) rotate(-30deg) scale(1.08);
}

/* Символ операции */
.operation-symbol {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  font-weight: 700;
  color: var(--white);
  text-shadow:
    0 2px 0 var(--ink),
    0 4px 10px rgba(0,0,0,.6),
    0 0 20px var(--planet-color);
  pointer-events: none;
  animation: symbol-pulse 1.8s ease-in-out infinite;
}
@keyframes symbol-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.15) rotate(-4deg); }
}

/* Луна на орбите */
.planet-moon {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 1.6rem;
  animation: moon-orbit 12s linear infinite;
  transform-origin: 0 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
}
@keyframes moon-orbit {
  from { transform: rotate(0deg)   translateX(95px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(95px) rotate(-360deg); }
}

/* Название */
.galaxy-name {
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  color: var(--ink);
  line-height: 1.2;
  margin-top: .3rem;
}

/* ===== ИГРОВОЙ БЛОК ===== */
.exercise-box {
  background: var(--white);
  color: var(--ink);
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  max-width: 640px;
  margin: 2rem auto;
  box-shadow:
    0 10px 0 var(--ink),
    0 20px 40px rgba(0,0,0,.4);
  position: relative;
  z-index: 1;
}

.question {
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  font-weight: 700;
  color: var(--ink);
  margin: 1rem 0;
  text-shadow: 3px 3px 0 var(--sun);
}

.answers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
.answer-btn {
  padding: 1.2rem;
  font-family: var(--font);
  font-size: 1.9rem;
  font-weight: 700;
  border: 4px solid var(--ink);
  border-radius: 20px;
  background: var(--sun);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 6px 0 var(--ink);
  transition: transform .12s, box-shadow .12s, background .2s;
}
.answer-btn:nth-child(2) { background: var(--secondary); }
.answer-btn:nth-child(3) { background: var(--magic); color: var(--white); }
.answer-btn:nth-child(4) { background: var(--primary); color: var(--white); }
.answer-btn:hover:not(:disabled) {
  transform: translateY(-3px) rotate(-2deg);
  box-shadow: 0 9px 0 var(--ink);
}
.answer-btn:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--ink);
}
.answer-btn.correct {
  background: var(--grass) !important;
  color: var(--white);
  animation: correct-pop .5s cubic-bezier(.68,-.55,.265,1.55);
}
.answer-btn.wrong {
  background: var(--danger) !important;
  color: var(--white);
  animation: wrong-shake .5s;
}
.answer-btn:disabled { cursor: default; }
@keyframes correct-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.15) rotate(3deg); }
  100% { transform: scale(1); }
}
@keyframes wrong-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-8px) rotate(-3deg); }
  75%      { transform: translateX(8px) rotate(3deg); }
}

.progress {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}
.coins { color: var(--primary); font-size: 1.3rem; }
.stars { color: var(--sun); font-size: 1.4rem; }
.feedback {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  min-height: 2rem;
  margin-top: 1rem;
}

/* ===== КОНФЕТТИ ===== */
.confetti {
  position: fixed;
  font-size: 1.8rem;
  pointer-events: none;
  z-index: 9999;
  animation: confetti-fall 1.6s ease-out forwards;
}
@keyframes confetti-fall {
  0%   { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) rotate(var(--rot)); opacity: 0; }
}

/* ===== ХВОСТИК КУРСОРА ===== */
.cursor-spark {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  font-size: 1rem;
  animation: spark-fade .7s ease-out forwards;
}
@keyframes spark-fade {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0) translateY(-20px); }
}

/* ===== ДОСТУПНОСТЬ ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ===== КОТИК: АНИМАЦИИ И УЛУЧШЕНИЯ ===== */
.mascot { animation: catFloat 4s ease-in-out infinite; }
@keyframes catFloat {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%     { transform: translateY(-6px) rotate(-2deg); }
}
.mascot svg { transition: transform .3s cubic-bezier(.68,-.55,.265,1.55); overflow: visible; }
.mascot:hover svg { transform: scale(1.12) rotate(-5deg); }
.mascot::before {
  content: ''; position: absolute; inset: -15px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,210,63,0.35), transparent 70%);
  opacity: 0; transition: opacity .3s; pointer-events: none; z-index: -1;
}
.mascot:hover::before { opacity: 1; }
.mascot:focus-visible { outline: 4px solid var(--yellow); outline-offset: 4px; border-radius: 50%; }
@media (min-width: 900px) { .mascot { width: 180px; height: 180px; } }

.cat-tail { transform-box: fill-box; transform-origin: right center; animation: catTailWag 2s ease-in-out infinite; }
@keyframes catTailWag { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(12deg); } }

.cat-paw { transform-box: fill-box; transform-origin: left bottom; animation: catWave 2s ease-in-out infinite; }
@keyframes catWave {
  0%,100% { transform: rotate(0deg); }
  30%     { transform: rotate(-22deg); }
  60%     { transform: rotate(15deg); }
}

.cat-eyelid { transform-box: fill-box; transform-origin: center; animation: catBlink 5s ease-in-out infinite; transform: scaleY(0); }
@keyframes catBlink {
  0%,90%,100% { transform: scaleY(0); }
  93%,97%     { transform: scaleY(1); }
}

.cat-antenna-light { animation: antennaBlink 2.5s ease-in-out infinite; }
@keyframes antennaBlink {
  0%,80%,100% { fill: #ff6b6b; }
  85%,95%     { fill: #ffd23f; }
}

@media (prefers-reduced-motion: reduce) {
  .mascot, .cat-tail, .cat-paw, .cat-eyelid, .cat-antenna-light { animation: none !important; }
}


/* Переопределяем фиксированное позиционирование для верхнего котика */


/* Убираем абсолютное позиционирование облачка для верхнего котика,
   чтобы оно не улетало за пределы экрана */


/* Убедимся, что SVG/IMG внутри верхнего котика масштабируется */


/* Делаем шапку флексом, чтобы котик и заголовок стояли в ряд */



/* Сдвигаем облачко выше и левее, чтобы оно не наезжало на заголовок */


/* Настраиваем хвостик облачка, чтобы он указывал на котика */


/* Защита от наложения на мобильных экранах */
@media (max-width: 768px) {
  
  
}


/* Центрируем пузырь ровно над головой котика */


/* Делаем правильный хвостик, указывающий на котика */


/* Убеждаемся, что сам котик relative, чтобы пузырь позиционировался от него */



/* 1. Даем котику относительное позиционирование и убираем обрезку */


/* 2. Поднимаем сам пузырь на самый верхний слой (z-index 9999) */


/* 3. Правильный хвостик, смотрящий вниз */


/* 4. Защита для мобильных */
@media (max-width: 768px) {
  
}


/* 1. Контейнер котика должен быть изолирован */


/* 2. Сама картинка/свг котика должна быть НИЖЕ облачка */


/* 3. Облачко поднимаем на самый верх */


/* Хвостик пузыря */




/* Позиционируем пузырь СПРАВА от котика */


/* Класс для показа */


/* Хвостик пузыря указывает ВЛЕВО на котика */


/* ===== АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ ===== */
@media (max-width: 768px) {
  
  
  
  
  
}


/* ===== БОКОВОЕ ОБЛАЧКО (ФИНАЛ v2) ===== */




/* Позиционируем пузырь СПРАВА от котика */


/* Класс для показа */


/* Хвостик пузыря указывает ВЛЕВО на котика */


/* ===== АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ ===== */
@media (max-width: 768px) {
  
  
  
  
  
}

/* ===== STARFIELD FIX ===== */
.stars-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.8;
  animation: twinkle 3s ease-in-out infinite alternate;
}
/* Убираем старые слои, чтобы не было конфликтов */
.stars-layer {
  display: none !important;
}


/* Шляпы для котика */




/* Адаптация для мобильных (чтобы не перекрывал котика) */
@media (max-width: 768px) {
  
}


/* 1. Общая шапка */


/* 2. HUD переезжает в левый нижний угол */
.game-hud {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  top: auto;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  z-index: 1000;
  background: rgba(26, 20, 64, 0.9);
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  border: 3px solid var(--light);
  box-shadow: 0 8px 0 rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--light);
  text-shadow: 0 2px 0 var(--ink);
  transition: transform 0.3s cubic-bezier(.68,-.55,.265,1.55);
}
.game-hud span { display: flex; align-items: center; gap: 0.5rem; }
.hud-quest { font-size: 1rem; color: var(--turquoise); margin-left: 0.5rem; border-left: 2px dashed rgba(255,255,255,0.2); padding-left: 0.8rem; }

/* 3. Кнопка звука переезжает в правый верхний угол */
.btn--sound {
  position: fixed !important;
  top: 1.5rem !important;
  right: 1.5rem !important;
  left: auto !important;
  bottom: auto !important;
}

/* 4. Стили для новых кнопок навигации */









/* 5. Адаптация для мобильных */
@media (max-width: 768px) {
  .game-hud {
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    justify-content: center;
    font-size: 1rem;
  }
  
  
}



/* 1. Шапка: строгая колонка по центру */


/* 2. Котик: относительный контейнер для короны */


/* 3. Корона (SVG): прибиваем гвоздями к макушке */


/* 4. Заголовки */
header h1 { margin: 0 !important; }
header .subtitle { margin-bottom: 0.5rem !important; }

/* 5. Кнопки навигации: яркие и сочные */









/* 6. HUD: всегда в левом нижнем углу */
.game-hud {
  position: fixed !important;
  bottom: 1.5rem !important;
  left: 1.5rem !important;
  top: auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 1.2rem !important;
  z-index: 1000 !important;
  background: rgba(26, 20, 64, 0.9) !important;
  padding: 0.8rem 1.5rem !important;
  border-radius: 50px !important;
  border: 3px solid var(--light) !important;
  box-shadow: 0 8px 0 rgba(0,0,0,0.3) !important;
  backdrop-filter: blur(8px) !important;
  font-weight: 900 !important;
  font-size: 1.2rem !important;
  color: var(--light) !important;
  text-shadow: 0 2px 0 var(--ink) !important;
}

/* 7. Кнопка звука: правый верхний угол */
.btn--sound {
  position: fixed !important;
  top: 1.5rem !important;
  right: 1.5rem !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 1000 !important;
}

/* 8. Мобильная версия */
@media (max-width: 768px) {
  .game-hud {
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 90% !important;
    justify-content: center !important;
    font-size: 1rem !important;
  }
  
  
}



/* Котик */


/* Шляпа: жестко привязана к макушке */
.cat-hat {
  position: absolute !important;
  top: -35px !important; /* Поднимаем выше */
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 75px !important;
  height: auto !important;
  z-index: 100 !important;
  pointer-events: none !important;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,0.3)) !important;
}

/* Кнопки */
.header-nav {
  display: flex !important;
  gap: 1.5rem !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
}









/* HUD и Звук */
.game-hud {
  position: fixed !important;
  bottom: 1.5rem !important;
  left: 1.5rem !important;
  z-index: 1000 !important;
  background: rgba(26, 20, 64, 0.95) !important;
  padding: 0.8rem 1.5rem !important;
  border-radius: 50px !important;
  border: 3px solid var(--light) !important;
  box-shadow: 0 6px 0 rgba(0,0,0,0.4) !important;
  display: flex !important;
  gap: 1rem !important;
  font-weight: 900 !important;
  font-size: 1.2rem !important;
}

.btn--sound {
  position: fixed !important;
  top: 1.5rem !important;
  right: 1.5rem !important;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
  .header-top {
    flex-direction: column !important;
    gap: 1rem !important;
  }
  .header-titles {
    align-items: center !important;
    text-align: center !important;
  }
  .header-nav {
    flex-direction: column !important;
    width: 100%;
  }
  
}


/* ===== FINAL UI V5 (ЧИСТЫЙ) ===== */
header {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 3rem 1rem 1rem !important;
  position: relative;
  z-index: 10;
}

.header-content {
  display: flex !important;
  align-items: center !important;
  gap: 1.5rem !important;
  text-align: left;
}

.header-titles h1 { margin: 0 0 0.2rem 0 !important; font-size: 3rem !important; }
.header-titles .subtitle { font-size: 1.1rem !important; margin: 0 !important; }

/* Котик */
.header-mascot {
  position: relative !important;
  display: inline-block !important;
  width: 160px !important;
  height: 160px !important;
  flex-shrink: 0 !important;
}

/* Шляпа */
.cat-hat {
  position: absolute !important;
  top: -25px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 80px !important;
  height: auto !important;
  z-index: 100 !important;
  pointer-events: none !important;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,0.3)) !important;
}

/* Круглые кнопки в правом верхнем углу */
.top-controls {
  position: fixed !important;
  top: 1rem !important;
  right: 1rem !important;
  display: flex !important;
  gap: 0.8rem !important;
  z-index: 1000 !important;
}

.btn-circle {
  width: 55px !important;
  height: 55px !important;
  border-radius: 50% !important;
  background: var(--light) !important;
  border: 3px solid var(--ink) !important;
  box-shadow: 0 5px 0 var(--ink) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.5rem !important;
  text-decoration: none !important;
  color: var(--ink) !important;
  cursor: pointer !important;
  transition: transform 0.1s !important;
  padding: 0 !important;
}

.btn-circle:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 7px 0 var(--ink) !important;
}

.btn-circle:active {
  transform: translateY(5px) !important;
  box-shadow: none !important;
}

/* HUD снизу */
.game-hud {
  position: fixed !important;
  bottom: 1.5rem !important;
  left: 1.5rem !important;
  z-index: 1000 !important;
  background: rgba(26, 20, 64, 0.95) !important;
  padding: 0.8rem 1.5rem !important;
  border-radius: 50px !important;
  border: 3px solid var(--light) !important;
  box-shadow: 0 6px 0 rgba(0,0,0,0.4) !important;
  display: flex !important;
  gap: 1rem !important;
  font-weight: 900 !important;
  font-size: 1.2rem !important;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column !important;
    text-align: center !important;
    gap: 0.5rem !important;
  }
  .header-titles { align-items: center; text-align: center; }
  .header-titles h1 { font-size: 2rem !important; }
  .game-hud {
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 90% !important;
    justify-content: center !important;
    font-size: 1rem !important;
  }
}

/* ===== БЛОГ И ПОДВАЛ (добавлено 2026-12-01) ===== */
.header-titles .site-title {
  margin: 0 0 0.2rem 0 !important;
  font-size: 3rem !important;
  font-weight: 700;
  line-height: 1.1;
  color: var(--white);
}
@media (max-width: 768px) {
  .header-titles .site-title { font-size: 2rem !important; }
}
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  margin: 1.5rem 0 2rem;
}
.post-card {
  display: block;
  background: rgba(255,255,255,.08);
  border: 2px solid rgba(255,255,255,.15);
  border-radius: 18px;
  padding: 1.2rem 1.3rem;
  text-decoration: none;
  color: var(--white);
  transition: transform .15s ease, border-color .15s ease;
}
.post-card:hover, .post-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--primary);
  outline: none;
}
.post-card h2 { font-size: 1.15rem; margin: 0 0 .5rem; color: var(--white); }
.post-card p { margin: 0; font-size: .95rem; color: rgba(255,255,255,.82); line-height: 1.5; }
.post-meta { display: block; margin-top: .7rem; font-size: .8rem; color: var(--sun); }
.site-footer {
  margin: 3rem auto 2rem;
  max-width: 1100px;
  padding: 1.5rem 1rem;
  text-align: center;
  color: rgba(255,255,255,.75);
  font-size: .95rem;
}
.site-footer .footer-nav { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; margin-top: .6rem; }
.site-footer a { color: var(--sun); text-decoration: none; font-weight: 600; }
.site-footer a:hover { text-decoration: underline; }
.crumbs { font-size: .9rem; color: rgba(255,255,255,.7); margin: .4rem 0 1rem; }
.crumbs a { color: var(--sun); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.lead { font-size: 1.1rem; line-height: 1.65; color: rgba(255,255,255,.9); margin-bottom: 1.2rem; }

/* ===== РЕПЛИКА КОТА (.speech-bubble) =====
   Лежит в шапке на всех страницах. Показывается по наведению/фокусу на кота
   и из JS через window.mascotSay() — он добавляет класс .is-visible.
   Раньше висела НАД котом (bottom: calc(100% + 2.6rem)) и на всех страницах
   уезжала за верхний край экрана — шапка начинается с padding-top 3rem,
   сверху места нет, видна только нижняя рамка. Теперь кот говорит В СТОРОНУ:
   облачко слева от него, хвостик смотрит вправо; на экранах уже 1400px —
   снова сверху, но шапка получает запас по высоте (padding-top 7.5rem). */
.speech-bubble {
  --bubble-hidden: translateY(calc(-50% + 8px)) scale(.95);
  --bubble-shown: translateY(-50%) scale(1);
  position: absolute;
  top: 42%;                        /* уровень морды кота (голова = 37% высоты SVG) */
  right: calc(100% + 1.1rem);
  left: auto;
  bottom: auto;
  max-width: 20rem;
  transform: var(--bubble-hidden);
  transform-origin: 100% 50%;
  background: var(--white);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: .4rem .8rem;
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  white-space: normal;             /* длинные фразы переносятся, а не растягивают облачко */
  overflow-wrap: break-word;
  box-shadow: 0 4px 0 var(--ink);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 30;
}
/* Хвостик вправо, на кота */
.speech-bubble::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 9px solid transparent;
  border-left-color: var(--ink);
}
.header-mascot:hover .speech-bubble,
.header-mascot:focus .speech-bubble,
.header-mascot:focus-within .speech-bubble,
.speech-bubble.is-visible {
  opacity: 1;
  visibility: visible;
  transform: var(--bubble-shown);
}
/* Узкие окна и мобильные: кот по центру, сбоку места нет — облачко сверху,
   но шапке добавлен отступ, чтобы реплика целиком влезала в экран.
   Ширина облачка упирается в свободное место слева от кота (100vw - 36rem),
   иначе на 800-1000px оно свисает за левый край. */
@media (max-width: 1399px) {
  header:not(.p-head) { padding-top: 7.5rem !important; }  /* .p-head — шапка /profile/, ей отступ не нужен */
  .speech-bubble {
    --bubble-hidden: translate(-50%, 8px) scale(.95);
    --bubble-shown: translate(-50%, 0) scale(1);
    top: auto;
    left: 50%;
    right: auto;
    bottom: calc(100% + 1.2rem);
    max-width: min(20rem, calc(100vw - 36rem));
    transform-origin: 50% 100%;
  }
  .speech-bubble::after {
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border-left-color: transparent;
    border-top-color: var(--ink);
  }
}
/* На стопке (≤768) кот стоит по центру — облачку ничего не мешает */
@media (max-width: 768px) {
  .speech-bubble { max-width: min(20rem, 78vw); }
}
@media (max-width: 620px) {
  .speech-bubble { font-size: .82rem; padding: .3rem .6rem; bottom: calc(100% + 1rem); max-width: min(20rem, 82vw); }
}
@media (prefers-reduced-motion: reduce) {
  .speech-bubble { transition: none; }
}

/* ===== СТАТЬИ БЛОГА (контейнер .card и вложенные блоки) ===== */
main.card {
  background: var(--white);
  color: var(--ink);
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  max-width: 800px;
  margin: 2rem auto;
  box-shadow: 0 10px 0 var(--ink), 0 20px 40px rgba(0,0,0,.35);
}
main.card h1 { color: var(--ink); font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.2; }
main.card .planet { font-size: 2.2rem; line-height: 1; }
main.card .intro { font-size: 1.08rem; line-height: 1.6; color: #2d2a4a; margin-bottom: 1.1rem; }
main.card .bubble { background: #fff7e6; border: 2px solid #ffb703; border-radius: 14px; padding: .9rem 1rem; margin: 1.2rem 0; color: #3a2f1b; line-height: 1.55; }
main.card .hack { background: #f3f0ff; border: 2px dashed #8b5cf6; border-radius: 12px; padding: .9rem 1rem; margin: 1rem 0; color: #2d2a4a; }
main.card .sub-cta { display: block; text-align: center; font-size: .85rem; color: #6b7280; margin-top: .6rem; }
main.card .crumbs { color: #4b5563; }
main.card .crumbs a { color: #1d4ed8; }
main.card .back { display: inline-block; margin-top: 1.2rem; color: #1d4ed8; font-weight: 600; text-decoration: none; }
main.card .digits { font-variant-numeric: tabular-nums; }
article .callout { color: #3a2f1b; }

/* ===== SEO-БЛОКИ (.seo-level на 39 уровнях, .seo-text на 6 хабах) =====
   Разметка была, CSS не было: абзацы висели простым текстом на фоне. */
.seo-level,
.seo-text {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1.3rem 1.5rem;
  background: rgba(15, 23, 42, .55);
  border: 3px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  backdrop-filter: blur(2px);
}
.seo-level h2,
.seo-text h2 {
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 0 0 .7rem;
  color: var(--sun);
}
.seo-level p,
.seo-text p {
  font-size: .97rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, .86);
  margin: 0 0 .75rem;
}
.seo-level p:last-child,
.seo-text p:last-child { margin-bottom: 0; }
.seo-level a,
.seo-text a { color: var(--sun); text-decoration: underline; }
@media (max-width: 620px) {
  .seo-level, .seo-text { margin: 1.4rem .8rem; padding: 1rem 1.1rem; }
  .seo-level h2, .seo-text h2 { font-size: 1.05rem; }
}

/* ===== ФОН .space-bg (7 страниц) =====
   Пустой div без стилей. Фон страницы уже градиентный (см. body), поэтому
   делаем только слой мелких звёзд ПОД контентом: z-index:-1 и никаких правил
   для соседних элементов (иначе перебивается position:fixed у .top-controls). */
.space-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255,255,255,.85), transparent 55%),
    radial-gradient(1.5px 1.5px at 78% 12%, rgba(255,255,255,.7), transparent 55%),
    radial-gradient(2px 2px at 33% 62%, rgba(255,255,255,.75), transparent 55%),
    radial-gradient(1.5px 1.5px at 62% 78%, rgba(255,255,255,.65), transparent 55%),
    radial-gradient(1.5px 1.5px at 88% 55%, rgba(255,255,255,.6), transparent 55%),
    radial-gradient(2px 2px at 5% 84%, rgba(255,255,255,.55), transparent 55%),
    radial-gradient(1.5px 1.5px at 46% 30%, rgba(255,255,255,.7), transparent 55%),
    radial-gradient(1.5px 1.5px at 95% 88%, rgba(255,255,255,.5), transparent 55%);
}

/* ===== БЛОК «СОХРАНИТЬ ЗВЁЗДЫ» (главная) ===== */
.profile-promo {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  margin: 30px 0 8px; padding: 20px 22px;
  background: rgba(15, 23, 42, .55);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 10px 0 rgba(0, 0, 0, .2);
}
.profile-promo .promo-ico {
  font-size: 2.6rem; line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .35));
}
.profile-promo .promo-text { flex: 1 1 340px; min-width: 0; }
.profile-promo h2 { margin: 0 0 .4rem; font-size: 1.3rem; color: var(--sun); }
.profile-promo p { margin: 0; line-height: 1.55; font-size: .98rem; color: var(--white); opacity: .92; }
.profile-promo .btn { flex: 0 0 auto; }
.profile-promo.is-on { border-color: var(--sun); }
.profile-promo.is-on h2::after { content: ' ✓'; color: var(--grass); }
@media (max-width: 640px) {
  .profile-promo { padding: 16px; gap: 12px; }
  .profile-promo .btn { width: 100%; }
}

/* Видимый фокус для клавиатуры: ребёнок должен видеть, какой вариант выбран Tab-ом */
.answer-btn:focus-visible,
.answer-btn:focus {
  outline: 4px solid var(--sun);
  outline-offset: 3px;
  box-shadow: 0 0 0 8px rgba(251, 191, 36, .35);
}
@media (prefers-reduced-motion: reduce) {
  .cat-paw { animation: none; }
  .speech-bubble { transition: none; }
}
