:root {
  --bg-top: #dff4ff;
  --bg-bottom: #fff6df;
  --card: #ffffff;
  --ink: #24304a;
  --muted: #5d6c89;
  --dino: #2ecc71;
  --dino-dark: #219653;
  --space: #6c5ce7;
  --space-dark: #4b3bc2;
  --car: #ff6b6b;
  --car-dark: #d94848;
  --animal: #ff9f43;
  --animal-dark: #d97a1f;
  --gold: #feca57;
  --gold-dark: #e1a825;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow-card: 0 12px 30px rgba(36, 48, 74, 0.1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Noto Sans Georgian', 'Fredoka', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background-color: #16204d;
  background: linear-gradient(180deg, #16204d 0%, #16204d 16%, #12193d 55%, #0a0f29 100%);
  overflow-x: hidden;
}

/* Deep Twinkling Space Sky */
.sky-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  background-image:
    radial-gradient(2px 2px at 14% 22%, #fff, transparent),
    radial-gradient(2px 2px at 42% 12%, #ffeaa7, transparent),
    radial-gradient(1.5px 1.5px at 78% 18%, #74b9ff, transparent),
    radial-gradient(2px 2px at 88% 42%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 26% 64%, #ff9ff3, transparent),
    radial-gradient(2px 2px at 66% 74%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 12% 84%, #81ecec, transparent),
    radial-gradient(2px 2px at 92% 82%, #ffeaa7, transparent);
}

.float-shape {
  position: absolute;
  font-size: clamp(22px, 4vw, 42px);
  opacity: 0.35;
  animation: drift 14s ease-in-out infinite;
}
.float-shape.s1 { top: 8%; left: 6%; animation-delay: 0s; }
.float-shape.s2 { top: 18%; right: 8%; animation-delay: -3s; }
.float-shape.s3 { bottom: 20%; left: 5%; animation-delay: -6s; }
.float-shape.s4 { bottom: 12%; right: 10%; animation-delay: -9s; }
.float-shape.s5 { top: 50%; left: 48%; animation-delay: -4s; }

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(6deg); }
}

#confettiCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 200;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 16px 36px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 3px solid #d5ebff;
  border-radius: 999px;
  padding: 8px 18px 8px 12px;
  font: inherit;
  font-weight: 900;
  font-size: clamp(16px, 2.8vw, 21px);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 5px 0 #c7e2fa;
  transition: transform 0.12s, box-shadow 0.12s;
}
.brand-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #c7e2fa;
}
.brand-icon {
  font-size: 26px;
  line-height: 1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.voice-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid #d8e7f5;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.voice-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #feca57;
  flex-shrink: 0;
}
.voice-chip.ready .voice-dot { background: #2ecc71; }
.voice-chip.error .voice-dot { background: #ff6b6b; }
.voice-chip.loading .voice-dot { animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}

.star-pill, .icon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  border-radius: 999px;
  border: 3px solid transparent;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.star-pill {
  background: #fff5cc;
  border-color: var(--gold);
  color: #9e6b00;
  padding: 0 16px;
  font-size: 18px;
  box-shadow: 0 4px 0 var(--gold-dark);
}
.star-pill:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-dark); }

.icon-pill {
  width: 44px;
  background: var(--card);
  border-color: #d8e7f5;
  font-size: 20px;
  box-shadow: 0 4px 0 #c9dcef;
}
.icon-pill:active { transform: translateY(3px); box-shadow: 0 1px 0 #c9dcef; }

/* Main Stage */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Hero Mission Banner */
.hero-mission {
  background: linear-gradient(135deg, #5f27cd 0%, #341f97 55%, #2e86de 100%);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: clamp(20px, 4vw, 30px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 14px 32px rgba(75, 59, 194, 0.28);
  position: relative;
  overflow: hidden;
}

.hero-left {
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1;
}

.mascot-btn {
  width: clamp(72px, 12vw, 96px);
  height: clamp(72px, 12vw, 96px);
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.18);
  font-size: clamp(40px, 7vw, 54px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.mascot-btn:hover { transform: scale(1.06) rotate(-5deg); }
.mascot-btn:active { transform: scale(0.94); }

.hero-title {
  margin: 0 0 6px;
  font-size: clamp(22px, 4.2vw, 32px);
  font-weight: 900;
  line-height: 1.15;
}
.hero-sub {
  margin: 0;
  font-size: clamp(14px, 2.2vw, 16px);
  opacity: 0.92;
  font-weight: 600;
}

.hero-play-btn {
  background: var(--gold);
  color: #4b2e00;
  border: none;
  border-radius: 999px;
  padding: 16px 28px;
  font: inherit;
  font-size: clamp(17px, 2.6vw, 20px);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--gold-dark);
  white-space: nowrap;
  z-index: 1;
  transition: transform 0.12s, box-shadow 0.12s;
}
.hero-play-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--gold-dark);
}

/* 4 Worlds Grid */
.worlds-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.world-card {
  border: none;
  border-radius: var(--radius-xl);
  padding: clamp(18px, 3vw, 26px);
  text-align: left;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.14s, box-shadow 0.14s;
  font: inherit;
}
.world-card:hover { transform: translateY(-3px); }
.world-card:active { transform: translateY(4px); }

.world-card.dino {
  background: linear-gradient(135deg, #2ecc71, #1dd1a1);
  box-shadow: 0 8px 0 var(--dino-dark), var(--shadow-card);
}
.world-card.dino:active { box-shadow: 0 3px 0 var(--dino-dark); }

.world-card.space {
  background: linear-gradient(135deg, #6c5ce7, #54a0ff);
  box-shadow: 0 8px 0 var(--space-dark), var(--shadow-card);
}
.world-card.space:active { box-shadow: 0 3px 0 var(--space-dark); }

.world-card.car {
  background: linear-gradient(135deg, #ff6b6b, #ff9f43);
  box-shadow: 0 8px 0 var(--car-dark), var(--shadow-card);
}
.world-card.car:active { box-shadow: 0 3px 0 var(--car-dark); }

.world-card.animal {
  background: linear-gradient(135deg, #ff9f43, #feca57);
  color: #472800;
  box-shadow: 0 8px 0 var(--animal-dark), var(--shadow-card);
}
.world-card.animal:active { box-shadow: 0 3px 0 var(--animal-dark); }

.world-emoji {
  font-size: clamp(42px, 7vw, 58px);
  line-height: 1;
}
.world-title {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 900;
}
.world-desc {
  font-size: clamp(13px, 2vw, 15px);
  font-weight: 700;
  opacity: 0.92;
}

/* Extra Bottom Cards (Discovery & Sticker Album) */
.extras-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.extra-card {
  background: var(--card);
  border: 3px solid #ddebf7;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--ink);
  box-shadow: 0 6px 0 #d0e2f2;
  transition: transform 0.12s, box-shadow 0.12s;
}
.extra-card:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #d0e2f2;
}
.extra-icon { font-size: 40px; line-height: 1; }
.extra-title { font-size: 18px; font-weight: 900; }
.extra-sub { font-size: 13px; color: var(--muted); font-weight: 700; }

/* Game Arena Header */
.arena-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.back-btn {
  background: var(--card);
  border: 3px solid #d5e6f7;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 4px 0 #c6dcf0;
}
.back-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #c6dcf0; }

.progress-stars {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  padding: 8px 16px;
  border-radius: 999px;
  border: 3px solid #ffe9a8;
}
.p-star {
  font-size: 22px;
  opacity: 0.25;
  transform: scale(0.9);
  transition: transform 0.3s, opacity 0.3s;
}
.p-star.done {
  opacity: 1;
  transform: scale(1.15);
}

.mode-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.mode-pill {
  background: var(--card);
  border: 2px solid #d5e6f7;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.mode-pill.active {
  background: var(--space);
  border-color: var(--space-dark);
  color: #fff;
}

/* Game Card */
.game-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: clamp(18px, 4vw, 32px);
  box-shadow: var(--shadow-card);
  border: 4px solid #e6f2ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 3vw, 24px);
}

.game-top-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.game-badge {
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 14px;
  color: #fff;
}
.badge-dino { background: var(--dino); }
.badge-space { background: var(--space); }
.badge-car { background: var(--car); }
.badge-animal { background: var(--animal); }

.speak-pill {
  background: #eaf5ff;
  color: #1c65b8;
  border: 2px solid #b8dcff;
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}
.speak-pill:active { transform: scale(0.95); }

.big-emoji {
  font-size: clamp(76px, 16vw, 116px);
  line-height: 1.05;
  cursor: pointer;
}

/* Syllables */
.syllable-slots {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.syllable-slot {
  min-width: 82px;
  height: 70px;
  padding: 0 18px;
  border-radius: 20px;
  border: 4px dashed #b9d7f5;
  background: #f5faff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 900;
  color: #9cb8d4;
}
.syllable-slot.filled {
  border-style: solid;
  border-color: var(--dino);
  background: #e9fbf0;
  color: var(--dino-dark);
  animation: popIn 0.25s ease;
}

.syllable-bank {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.tile-btn {
  min-width: 92px;
  height: 74px;
  padding: 0 22px;
  border-radius: 22px;
  border: none;
  background: linear-gradient(180deg, #ffdd75, #feca57);
  color: #4d2e00;
  font: inherit;
  font-size: 30px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--gold-dark);
  transition: transform 0.12s;
}
.tile-btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--gold-dark); }
.tile-btn.used { opacity: 0.28; box-shadow: none; cursor: default; }

.mini-reset-btn {
  background: transparent;
  border: 2px solid #d5e4f2;
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

/* Read Word & Missing Letter */
.read-word-box {
  background: #f3f9ff;
  border: 4px solid #c7e2ff;
  border-radius: 24px;
  padding: 18px 34px;
  text-align: center;
  cursor: pointer;
}
.read-word-main {
  display: block;
  font-size: clamp(36px, 8vw, 56px);
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--ink);
}
.read-word-hint {
  display: block;
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
}

.letter-slots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.letter-box {
  width: clamp(46px, 11vw, 62px);
  height: clamp(54px, 12vw, 68px);
  border-radius: 16px;
  background: #f2f7fc;
  border: 3px solid #d2e4f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(26px, 6vw, 36px);
  font-weight: 900;
}
.letter-box.missing {
  background: #fff8de;
  border: 3px dashed var(--gold-dark);
  color: var(--gold-dark);
}
.letter-box.solved {
  background: #e6faee;
  border-color: var(--dino);
  color: var(--dino-dark);
  animation: popIn 0.25s ease;
}

/* Sentences */
.sentence-words {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.word-tap-btn {
  background: #eef6ff;
  border: 3px solid #b9dcff;
  border-radius: 18px;
  padding: 12px 20px;
  font: inherit;
  font-size: clamp(20px, 4.5vw, 28px);
  font-weight: 900;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 4px 0 #a8d0f7;
}
.word-tap-btn.word-active {
  background: var(--gold);
  border-color: var(--gold-dark);
  transform: scale(1.06);
}

/* Choice Grids */
.choice-grid {
  width: 100%;
  display: grid;
  gap: 14px;
}
.grid-2, .grid-2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); max-width: 540px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); max-width: 560px; }

.choice-btn {
  background: #f9fcff;
  border: 4px solid #d5e8fa;
  border-radius: 24px;
  min-height: 88px;
  padding: 14px 10px;
  font: inherit;
  font-weight: 900;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 6px 0 #c7dff5;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
}
.choice-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #c7dff5; }
.choice-btn.correct-hit {
  background: #e5faee;
  border-color: var(--dino);
  box-shadow: 0 6px 0 var(--dino-dark);
  transform: scale(1.05);
}

.choice-emoji { font-size: clamp(46px, 10vw, 68px); line-height: 1; }
.choice-emoji-pair { font-size: clamp(36px, 8vw, 54px); line-height: 1; }
.choice-caption { font-size: 14px; color: var(--muted); font-weight: 800; }
.letter-choice, .num-choice { font-size: clamp(30px, 7vw, 42px); min-height: 80px; }

/* Math Stages */
.count-stage {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 560px;
  padding: 14px;
  background: #f5f3ff;
  border-radius: 24px;
  border: 3px solid #dfd8ff;
}
.count-item {
  background: #fff;
  border: 3px solid #e3dcff;
  border-radius: 18px;
  width: 64px;
  height: 64px;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: popIn 0.3s ease backwards;
  transition: transform 0.15s, background 0.15s;
}
.count-stage.dense .count-item { width: 52px; height: 52px; font-size: 28px; }
.count-item.counted {
  background: #e5faee;
  border-color: var(--dino);
  transform: scale(0.92);
}
.count-helper {
  font-size: 16px;
  font-weight: 800;
  color: var(--space);
}

.visual-equation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.eq-group {
  background: #f4f2ff;
  border: 3px solid #dcd5ff;
  border-radius: 20px;
  padding: 12px 16px;
  text-align: center;
  min-width: 100px;
}
.eq-group.sub-group {
  background: #fff2f2;
  border-color: #ffd1d1;
}
.eq-emojis {
  font-size: clamp(22px, 4.5vw, 30px);
  letter-spacing: 2px;
  max-width: 170px;
  line-height: 1.3;
}
.eq-num {
  font-size: 26px;
  font-weight: 900;
  margin-top: 4px;
}
.eq-op {
  font-size: 36px;
  font-weight: 900;
  color: var(--space);
}
.eq-answer-box {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  border: 4px dashed var(--gold-dark);
  background: #fff8dc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 900;
  color: var(--gold-dark);
}

.compare-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: 580px;
}
.compare-card {
  flex: 1;
  min-height: 180px;
  background: #f5f9ff;
  border: 4px solid #c9e0fa;
  border-radius: 26px;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font: inherit;
  box-shadow: 0 7px 0 #b8d3f2;
}
.compare-card:active { transform: translateY(4px); }
.compare-num { font-size: clamp(46px, 10vw, 66px); font-weight: 900; color: var(--ink); line-height: 1; }
.compare-dots { font-size: 24px; line-height: 1.25; }
.compare-big-icon { font-size: 46px; }
.compare-vs { font-size: 22px; font-weight: 900; color: var(--muted); }

.train-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.train-engine { font-size: 48px; }
.train-car {
  width: clamp(58px, 14vw, 78px);
  height: clamp(58px, 14vw, 78px);
  border-radius: 20px;
  background: linear-gradient(135deg, #6c5ce7, #8b7ef8);
  color: #fff;
  font-size: clamp(26px, 6vw, 36px);
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 0 var(--space-dark);
}
.train-car.missing {
  background: #fff8de;
  color: var(--gold-dark);
  border: 4px dashed var(--gold-dark);
  box-shadow: none;
}
.train-car.solved {
  background: var(--dino);
  box-shadow: 0 5px 0 var(--dino-dark);
}

/* English */
.abc-hero, .en-word-banner {
  background: #fff6f6;
  border: 4px solid #ffc9c9;
  border-radius: 26px;
  padding: 18px 36px;
  text-align: center;
  cursor: pointer;
}
.abc-big-letter {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(68px, 15vw, 96px);
  font-weight: 700;
  color: var(--car);
  line-height: 1;
}
.abc-sub, .en-word-sub {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
}
.en-word-text {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(40px, 9vw, 60px);
  font-weight: 700;
  color: var(--ink);
}

/* Patterns & Memory */
.pattern-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.pattern-box {
  width: clamp(62px, 15vw, 84px);
  height: clamp(62px, 15vw, 84px);
  border-radius: 22px;
  background: #fff7ea;
  border: 3px solid #ffe0b2;
  font-size: clamp(34px, 8vw, 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}
.pattern-box.missing {
  border: 4px dashed var(--animal-dark);
  color: var(--animal-dark);
}
.pattern-box.solved {
  border-color: var(--dino);
  background: #e8fbf0;
}

.memory-grid {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 480px;
}
.memory-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.memory-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.mem-card {
  aspect-ratio: 1;
  border-radius: 20px;
  border: 4px solid #d5e5f7;
  background: linear-gradient(135deg, #54a0ff, #5f27cd);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(34px, 8vw, 52px);
  box-shadow: 0 5px 0 #3f2094;
  transition: transform 0.2s, background 0.2s;
}
.mem-card .mem-back { display: none; }
.mem-card.flipped {
  background: #fff;
  border-color: var(--gold);
  box-shadow: 0 5px 0 var(--gold-dark);
}
.mem-card.flipped .mem-front { display: none; }
.mem-card.flipped .mem-back { display: block; animation: popIn 0.2s ease; }
.mem-card.matched {
  border-color: var(--dino);
  background: #e9fbf0;
  box-shadow: 0 4px 0 var(--dino-dark);
}

/* Discovery Cards */
.discovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.disc-card {
  border: none;
  border-radius: 24px;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(36, 48, 74, 0.1);
  transition: transform 0.14s;
}
.disc-card:hover { transform: translateY(-4px); }
.disc-card:active { transform: scale(0.96); }
.disc-emoji { font-size: 56px; line-height: 1; }
.disc-title { font-size: 16px; font-weight: 900; text-align: center; }

.disc-detail {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-card);
  border: 4px solid #e2f1ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.disc-detail-emoji { font-size: 88px; line-height: 1; }
.disc-detail-title { margin: 0; font-size: 28px; font-weight: 900; }
.disc-fact-text {
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  max-width: 560px;
  font-weight: 600;
}
.disc-joke-box {
  background: #fff7dc;
  border: 3px solid var(--gold);
  border-radius: 20px;
  padding: 14px 20px;
  font-size: 17px;
  font-weight: 800;
  color: #6b4300;
  max-width: 540px;
}
.disc-btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Sticker Album */
.album-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 14px;
}
.sticker-tile {
  background: var(--card);
  border: 3px solid #e1effb;
  border-radius: 22px;
  padding: 18px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font: inherit;
  box-shadow: 0 5px 0 #d4e4f3;
}
.sticker-tile.locked {
  opacity: 0.55;
  background: #f2f5f9;
  cursor: default;
  box-shadow: none;
}
.sticker-tile.locked .sticker-em { filter: grayscale(1) brightness(0.4); }
.sticker-em { font-size: 52px; line-height: 1; }
.sticker-name { font-size: 14px; font-weight: 800; color: var(--ink); }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 34, 58, 0.55);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 150;
}
.modal-backdrop.hidden { display: none; }

.modal-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 26px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: popIn 0.25s ease;
}

.celebration-card {
  text-align: center;
  max-width: 440px;
}
.cel-emoji { font-size: 72px; line-height: 1; margin-bottom: 6px; }
.celebration-card h2 { margin: 0 0 6px; font-size: 30px; font-weight: 900; }
.celebration-card p { margin: 0 0 16px; font-size: 16px; color: var(--muted); font-weight: 700; }

.cel-sticker-box {
  background: #fff9e3;
  border: 3px solid var(--gold);
  border-radius: 22px;
  padding: 14px;
  margin-bottom: 18px;
}
.cel-sticker-box.hidden { display: none; }
.cel-sticker-label { font-size: 13px; font-weight: 800; color: #9c6800; }
.cel-sticker-emoji { font-size: 62px; margin: 6px 0; }
.cel-sticker-name { font-size: 18px; font-weight: 900; }

.cel-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.big-cta-btn {
  border: none;
  border-radius: 999px;
  padding: 14px 24px;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}
.big-cta-btn.small { padding: 10px 20px; font-size: 15px; }
.big-cta-btn.primary {
  background: var(--dino);
  color: #fff;
  box-shadow: 0 5px 0 var(--dino-dark);
}
.big-cta-btn.secondary {
  background: var(--space);
  color: #fff;
  box-shadow: 0 5px 0 var(--space-dark);
}
.big-cta-btn.gold {
  background: var(--gold);
  color: #4d2e00;
  box-shadow: 0 5px 0 var(--gold-dark);
}
.big-cta-btn:active { transform: translateY(3px); }

/* Parent Panel */
.parent-card {
  max-height: 90dvh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-header h2 { margin: 0; font-size: 22px; font-weight: 900; }
.close-modal-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #edf3f9;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}
.parent-section { margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 6px;
}
.voice-select-row {
  display: flex;
  gap: 8px;
}
.styled-select {
  flex: 1;
  padding: 10px 12px;
  border-radius: 14px;
  border: 2px solid #cfe0f0;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  background: #f8fbff;
}
.test-voice-btn {
  background: #eaf4ff;
  border: 2px solid #b5d8ff;
  border-radius: 14px;
  padding: 0 14px;
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  color: #195da8;
  cursor: pointer;
  white-space: nowrap;
}
.styled-range { width: 100%; accent-color: var(--space); }

.parent-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.seg-group {
  display: flex;
  gap: 6px;
}
.seg-btn {
  flex: 1;
  padding: 9px 8px;
  border-radius: 12px;
  border: 2px solid #d5e4f2;
  background: #f7fbff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.seg-btn.active {
  background: var(--space);
  border-color: var(--space-dark);
  color: #fff;
}

.parent-stats {
  background: #f4f8fc;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 16px;
}
.parent-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.danger-link {
  background: none;
  border: none;
  color: #d64545;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
}

/* Animations */
@keyframes popIn {
  0% { transform: scale(0.75); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.bounce-in { animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }

@keyframes wiggleAnim {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px) rotate(-2deg); }
  50% { transform: translateX(8px) rotate(2deg); }
  75% { transform: translateX(-5px); }
}
.wiggle { animation: wiggleAnim 0.4s ease; }

/* Responsive adjustments for phones */
@media (max-width: 640px) {
  .hero-mission {
    flex-direction: column;
    text-align: center;
  }
  .hero-left {
    flex-direction: column;
  }
  .hero-play-btn {
    width: 100%;
  }
  .worlds-grid, .extras-grid, .parent-grid-2 {
    grid-template-columns: 1fr;
  }
  .voice-chip {
    display: none;
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ============================================================
   SPACE JOURNEY HOME MAP & FLYING ROCKET
   ============================================================ */
.space-hud {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-xl);
  padding: clamp(16px, 3vw, 24px);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.hud-greeting h1 {
  margin: 0 0 4px;
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 900;
}
.hud-greeting p {
  margin: 0;
  font-size: clamp(14px, 2.2vw, 16px);
  color: #cfe3ff;
  font-weight: 600;
}

.hud-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.launch-cta-btn {
  background: linear-gradient(135deg, #feca57, #ff9f43);
  color: #3d2100;
  border: none;
  border-radius: 999px;
  padding: 13px 24px;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 #c9770e, 0 0 22px rgba(254, 202, 87, 0.45);
  transition: transform 0.12s;
}
.launch-cta-btn:active { transform: translateY(3px); }

.hud-pill-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}
.hud-pill-btn:hover { background: rgba(255, 255, 255, 0.24); }
.hud-pill-btn:active { transform: scale(0.96); }

.space-journey {
  position: relative;
  padding: 28px 12px 24px;
  border-radius: var(--radius-xl);
  background: radial-gradient(circle at 50% 0%, rgba(108, 92, 231, 0.25), rgba(10, 15, 41, 0.35) 75%);
  border: 2px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.space-trail {
  position: absolute;
  top: 70px;
  bottom: 70px;
  left: 50%;
  width: 6px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(
    to bottom,
    rgba(254, 202, 87, 0.8) 0 12px,
    transparent 12px 24px
  );
  border-radius: 999px;
  opacity: 0.7;
  pointer-events: none;
}

.rocket-ship {
  position: absolute;
  top: 75%;
  left: 50%;
  z-index: 12;
  cursor: pointer;
  transition: top 0.65s cubic-bezier(0.22, 1, 0.36, 1), left 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.3s;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
  animation: rocketBob 2.8s ease-in-out infinite;
}
.rocket-ship.flying {
  animation: none;
  transform: scale(1.18) rotate(-8deg);
}
.rocket-flame {
  transform-origin: 60px 84px;
  animation: flameFlicker 0.22s ease-in-out infinite alternate;
}

@keyframes rocketBob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-9px) rotate(4deg); }
}
@keyframes flameFlicker {
  from { transform: scaleY(0.85); opacity: 0.85; }
  to { transform: scaleY(1.18); opacity: 1; }
}

.planets-column {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 740px;
  margin: 0 auto;
}

.planet-stop {
  display: flex;
  width: 100%;
}
.planet-stop.side-left { justify-content: flex-start; padding-left: 6%; }
.planet-stop.side-right { justify-content: flex-end; padding-right: 6%; }

.planet-node {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 10px 24px 10px 10px;
  color: #ffffff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  max-width: 440px;
  transition: transform 0.18s, border-color 0.2s, box-shadow 0.2s;
}
.planet-node:hover {
  transform: scale(1.04);
  border-color: var(--gold);
  box-shadow: 0 0 28px rgba(254, 202, 87, 0.35);
}
.planet-node.current {
  border-color: #74b9ff;
  box-shadow: 0 0 26px rgba(116, 185, 255, 0.4);
}
.planet-node.completed {
  border-color: var(--gold);
}

.planet-orb {
  position: relative;
  flex-shrink: 0;
  animation: planetFloat 5s ease-in-out infinite;
}
@keyframes planetFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.planet-num {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold);
  color: #4d2e00;
  font-size: 15px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #151e48;
}

.planet-title {
  font-size: clamp(17px, 2.8vw, 21px);
  font-weight: 900;
  line-height: 1.2;
}
.planet-sub {
  font-size: 13px;
  color: #cfe3ff;
  font-weight: 600;
  margin-top: 3px;
}

.launchpad-base {
  text-align: center;
  margin-top: 26px;
}
.launchpad-base span {
  display: inline-block;
  background: rgba(46, 204, 113, 0.22);
  border: 2px solid rgba(46, 204, 113, 0.55);
  color: #b8ffd0;
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 800;
}

/* Gentle English Whisper Pill */
.en-whisper-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef6ff;
  border: 2px solid #b8dcff;
  color: #1c5ba3;
  border-radius: 999px;
  padding: 6px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
}
.en-whisper-pill.clickable { cursor: pointer; }
.en-whisper-pill.clickable:active { transform: scale(0.95); }
.disc-en-mini {
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.65);
  padding: 2px 10px;
  border-radius: 999px;
  color: #24304a;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.toggle-row input { width: 18px; height: 18px; accent-color: var(--space); }

/* ============================================================
   NEW GAMES: BALLOONS, FEED DINO, CAR RACE, DRAW, XYLOPHONE
   ============================================================ */
.balloon-card {
  background: linear-gradient(180deg, #dff3ff 0%, #ffffff 100%);
}
.balloon-prompt {
  font-size: clamp(19px, 3.8vw, 26px);
  font-weight: 800;
  text-align: center;
  color: var(--ink);
}
.balloon-sky {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  padding: 12px 6px;
  width: 100%;
}
.balloon-btn {
  width: clamp(86px, 19vw, 114px);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  animation: balloonFloat 2.8s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  transition: transform 0.2s, opacity 0.25s;
}
.balloon-btn:hover { transform: scale(1.08); }
.balloon-btn.popped {
  transform: scale(1.45);
  opacity: 0;
  pointer-events: none;
}
@keyframes balloonFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* Feed the Hungry Dino */
.dino-feed-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  width: 100%;
}
.dino-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.svg-dino.chomp { transform: scale(1.08); transition: transform 0.15s; }
.dino-speech-bubble {
  background: #fff7dc;
  border: 3px solid var(--gold);
  border-radius: 20px;
  padding: 10px 18px;
  font-size: 20px;
  font-weight: 900;
  color: #5c3800;
}
.dino-plate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.plate-counter {
  font-size: 22px;
  font-weight: 900;
  color: var(--dino-dark);
}
.plate-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.feed-tap-btn {
  background: linear-gradient(180deg, #ffdd75, #feca57);
  border: none;
  border-radius: 24px;
  padding: 16px 24px;
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  color: #4d2e00;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--gold-dark);
}
.feed-tap-btn:active { transform: translateY(4px); }
.feed-done-btn {
  background: var(--dino);
  border: none;
  border-radius: 24px;
  padding: 16px 24px;
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--dino-dark);
}
.feed-done-btn:active { transform: translateY(4px); }

/* Car Race Track */
.race-track {
  position: relative;
  width: 100%;
  height: 92px;
  background: #2f3542;
  border-radius: 22px;
  border: 4px solid #57606f;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.race-lane-dashes {
  position: absolute;
  left: 14px;
  right: 54px;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(to right, #feca57 0 22px, transparent 22px 42px);
}
.race-car-mover {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: left 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}
.race-finish {
  position: absolute;
  right: 12px;
  font-size: 40px;
  z-index: 1;
}
.race-question-box {
  background: #fff5f5;
  border: 4px solid #ffc9c9;
  border-radius: 22px;
  padding: 14px 32px;
  font-size: clamp(28px, 7vw, 44px);
  font-weight: 900;
  color: var(--ink);
}

/* Space Drawing Canvas */
.draw-palette, .draw-stamps {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.color-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid #dce8f5;
  cursor: pointer;
  transition: transform 0.12s;
}
.color-dot.active {
  transform: scale(1.2);
  border-color: var(--ink);
}
.stamp-btn {
  background: #f2f7fc;
  border: 3px solid #d2e4f5;
  border-radius: 16px;
  padding: 8px 14px;
  font-size: 22px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}
.stamp-btn.active {
  background: #fff5cc;
  border-color: var(--gold-dark);
  transform: scale(1.08);
}
.stamp-btn.clear-btn { font-size: 14px; color: var(--ink); }
.draw-canvas {
  width: 100%;
  max-width: 680px;
  height: auto;
  aspect-ratio: 680 / 380;
  border-radius: 22px;
  border: 4px solid #c7e2ff;
  touch-action: none;
  cursor: crosshair;
  display: block;
}

/* Rainbow Xylophone */
.xylo-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(6px, 1.5vw, 12px);
  width: 100%;
  height: 220px;
  padding: 10px 6px;
}
.xylo-bar {
  flex: 1;
  max-width: 72px;
  height: var(--h, 100%);
  border: none;
  border-radius: 18px;
  color: #ffffff;
  font: inherit;
  font-size: clamp(14px, 2.8vw, 20px);
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.22);
  transition: transform 0.1s, filter 0.1s;
}
.xylo-bar.hit, .xylo-bar:active {
  transform: translateY(5px) scale(0.97);
  filter: brightness(1.18);
}

@media (max-width: 640px) {
  .planet-stop.side-left, .planet-stop.side-right {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
  .planet-node {
    width: 100%;
    border-radius: 28px;
  }
  .space-trail { display: none; }
}


/* ============================================================
   FULL COSMIC THEME ACROSS ENTIRE APP + NO-SCROLL HOME MAP
   ============================================================ */
body.is-home-map {
  height: 100dvh;
  overflow: hidden;
}
body.is-home-map .app-shell {
  height: 100dvh;
  padding: 10px 14px 12px;
  overflow: hidden;
}
body.is-home-map .top-bar {
  margin-bottom: 8px;
}
body.is-home-map .app-main {
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

/* Cosmic Glass Header & Navigation */
.brand-btn {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}
.voice-chip {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: #dbe9ff;
}
.icon-pill {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}
.back-btn, .mode-pill {
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(8px);
  border-color: rgba(255, 255, 255, 0.26);
  color: #ffffff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
}
.mode-pill.active {
  background: linear-gradient(135deg, #feca57, #ff9f43);
  border-color: #d98212;
  color: #3d2100;
}
.progress-stars {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(254, 202, 87, 0.45);
}

/* Cosmic Glass Game Cards & Modals */
.game-card, .disc-detail {
  background: rgba(18, 28, 66, 0.78);
  backdrop-filter: blur(14px);
  border: 3px solid rgba(130, 177, 255, 0.32);
  color: #ffffff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}
.balloon-card {
  background: linear-gradient(180deg, rgba(28, 56, 122, 0.85) 0%, rgba(16, 25, 62, 0.9) 100%);
}
.balloon-prompt, .read-word-main, .disc-detail-title, .disc-fact-text, .plate-counter {
  color: #ffffff;
}
.read-word-box, .race-question-box, .count-stage, .eq-group {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.26);
  color: #ffffff;
}
.read-word-hint, .count-helper { color: #b8d8ff; }
.syllable-slot {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(130, 177, 255, 0.45);
  color: #a6c4f5;
}
.syllable-slot.filled {
  background: rgba(46, 204, 113, 0.25);
  border-color: #2ecc71;
  color: #b8ffd0;
}
.letter-box {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.26);
  color: #ffffff;
}
.choice-btn, .compare-card, .word-tap-btn, .pattern-box {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(145, 190, 255, 0.35);
  color: #ffffff;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
}
.choice-btn:hover, .compare-card:hover {
  background: rgba(255, 255, 255, 0.2);
}
.compare-num, .eq-op { color: #feca57; }
.compare-vs { color: #a8c7f5; }
.speak-pill {
  background: rgba(116, 185, 255, 0.22);
  border-color: rgba(116, 185, 255, 0.5);
  color: #e6f2ff;
}
.mini-reset-btn {
  border-color: rgba(255, 255, 255, 0.25);
  color: #cfe3ff;
}
.sticker-tile {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3);
}
.sticker-name { color: #ffffff; }
.sticker-tile.locked {
  background: rgba(255, 255, 255, 0.05);
  opacity: 0.5;
}
.modal-card {
  background: #16204a;
  border: 3px solid rgba(130, 177, 255, 0.35);
  color: #ffffff;
}
.celebration-card p, .field-label, .toggle-row, .parent-stats { color: #cfe3ff; }
.parent-stats { background: rgba(255, 255, 255, 0.08); }
.styled-select {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
.styled-select option { color: #16204a; background: #ffffff; }
.seg-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
.seg-btn.active {
  background: var(--gold);
  border-color: var(--gold-dark);
  color: #3d2100;
}
.close-modal-btn { background: rgba(255, 255, 255, 0.14); color: #ffffff; }
.cel-sticker-box {
  background: rgba(254, 202, 87, 0.16);
  border-color: var(--gold);
}
.cel-sticker-label { color: #ffe58f; }

/* Compact Top HUD Bar on Space Map */
.space-hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  padding: 10px 16px;
  color: #ffffff;
  flex-shrink: 0;
}
.hud-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.hud-hi { font-size: clamp(16px, 2.5vw, 21px); font-weight: 900; }
.hud-next { font-size: 13px; color: #cfe3ff; font-weight: 700; }
.hud-next strong { color: var(--gold); }

/* Full-Height Zero-Scroll Space Stage */
.space-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  border-radius: var(--radius-xl);
  background: radial-gradient(circle at 50% 10%, rgba(108, 92, 231, 0.28), rgba(10, 15, 41, 0.45) 75%);
  border: 2px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.space-curve-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.rocket-ship {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 15;
  pointer-events: auto;
  transition: top 0.65s cubic-bezier(0.22, 1, 0.36, 1), left 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.3s;
}
.rocket-ship.flying {
  transform: translate(-50%, -50%) scale(1.22) rotate(-8deg);
}

.planet-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  z-index: 6;
  font: inherit;
  color: #ffffff;
  transition: transform 0.18s;
}
.planet-pin.label-left { flex-direction: row-reverse; text-align: right; }
.planet-pin.label-right { flex-direction: row; text-align: left; }
.planet-pin.unlocked:hover { transform: translate(-50%, -50%) scale(1.07); }

.planet-pin.locked {
  cursor: not-allowed;
}
.planet-pin.locked .planet-orb svg {
  filter: grayscale(0.85) brightness(0.45);
}
.planet-pin.locked .planet-tag {
  opacity: 0.6;
}
.planet-pin.is-next .planet-orb {
  filter: drop-shadow(0 0 18px rgba(254, 202, 87, 0.8));
}
.planet-pin.completed .planet-orb {
  filter: drop-shadow(0 0 12px rgba(46, 204, 113, 0.65));
}

.planet-badge-num {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gold);
  color: #3d2100;
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #12193d;
}
.planet-pin.locked .planet-badge-num {
  background: #485478;
  color: #ffffff;
}

.planet-tag {
  background: rgba(16, 24, 58, 0.78);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  padding: 6px 12px;
  white-space: nowrap;
}
.planet-pin.is-next .planet-tag {
  border-color: var(--gold);
}
.planet-tag-title {
  font-size: clamp(12px, 2vw, 15px);
  font-weight: 900;
  line-height: 1.15;
}
.planet-tag-sub {
  font-size: 11px;
  color: #b8d8ff;
  font-weight: 700;
}

.earth-horizon {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(46, 204, 113, 0.22);
  border: 2px solid rgba(46, 204, 113, 0.5);
  color: #b8ffd0;
  border-radius: 999px;
  padding: 4px 16px;
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

@keyframes pinShake {
  0%, 100% { transform: translate(-50%, -50%); }
  25% { transform: translate(calc(-50% - 7px), -50%); }
  75% { transform: translate(calc(-50% + 7px), -50%); }
}
.pin-shake { animation: pinShake 0.38s ease; }

@media (max-width: 640px) {
  .hud-next { display: none; }
  .launch-cta-btn { padding: 9px 16px; font-size: 14px; }
  .hud-pill-btn { padding: 8px 12px; font-size: 13px; }
  .planet-orb svg { width: 58px; height: 58px; }
  .rocket-ship svg { width: 56px; height: 56px; }
  .planet-tag { padding: 4px 8px; }
  .planet-tag-title { font-size: 11px; }
  .planet-tag-sub { display: none; }
}


/* ============================================================
   2-GALAXY SWITCHER, STORY QUIZ, LIVE SCORE & PARENT ANALYTICS
   ============================================================ */
.hidden { display: none !important; }

.galaxy-switcher {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.gal-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.24);
  color: #dbe9ff;
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.gal-btn.active {
  background: var(--gold);
  border-color: var(--gold-dark);
  color: #3d2100;
}
.gal-btn.locked {
  opacity: 0.6;
}

/* Live Correct / Wrong Score HUD in Arena */
.score-hud {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
}
.sc-ok strong { color: #7bed9f; }
.sc-err strong { color: #ff9f9f; }

/* Interactive Story Card */
.story-card {
  text-align: center;
}
.story-scene {
  font-size: clamp(48px, 11vw, 76px);
  letter-spacing: 8px;
  line-height: 1.1;
}
.story-mini-scene {
  font-size: 38px;
  letter-spacing: 6px;
}
.story-title {
  margin: 0;
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 900;
  color: var(--gold);
}
.story-body {
  margin: 0;
  max-width: 580px;
  font-size: clamp(16px, 3vw, 20px);
  line-height: 1.65;
  font-weight: 600;
  color: #e8f1ff;
}
.story-question-text {
  font-size: clamp(19px, 3.8vw, 25px);
  font-weight: 900;
  color: #ffffff;
  max-width: 560px;
}
.story-opt-btn {
  min-height: 112px;
  padding: 14px 10px;
}
.story-opt-label {
  font-size: clamp(14px, 2.8vw, 17px);
  font-weight: 800;
  color: #ffffff;
}

/* Parent Analytics Dashboard */
.parent-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.ptab-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  color: #cfe3ff;
  cursor: pointer;
}
.ptab-btn.active {
  background: var(--gold);
  border-color: var(--gold-dark);
  color: #3d2100;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.kpi-box {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 10px 6px;
  text-align: center;
}
.kpi-val { font-size: 17px; font-weight: 900; color: #ffffff; }
.kpi-val.ok { color: #7bed9f; }
.kpi-val.err { color: #ff9f9f; }
.kpi-val.acc { color: var(--gold); }
.kpi-lbl { font-size: 11px; color: #b8d2f7; font-weight: 700; margin-top: 2px; }

.parent-insight {
  background: rgba(254, 202, 87, 0.14);
  border: 2px solid rgba(254, 202, 87, 0.45);
  border-radius: 16px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #fff2c6;
  margin-bottom: 14px;
  line-height: 1.45;
}

.skills-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.skill-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
  color: #e6f1ff;
  margin-bottom: 4px;
}
.skill-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}
.skill-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.history-box {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 14px;
  max-height: 170px;
  overflow-y: auto;
}
.history-empty { font-size: 13px; color: #9eb9e3; }
.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
}
.history-row:last-child { border-bottom: none; }
.hist-title { color: #ffffff; }
.hist-meta { color: #b8d2f7; white-space: nowrap; }

@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .galaxy-switcher { width: 100%; }
}


/* Next Round Bar ("შემდეგი ➜") after completing a round */
.next-round-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: rgba(46, 204, 113, 0.22);
  backdrop-filter: blur(12px);
  border: 3px solid #2ecc71;
  border-radius: 24px;
  padding: 14px 20px;
  animation: popIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.next-praise-text {
  font-size: clamp(17px, 3.2vw, 22px);
  font-weight: 900;
  color: #ffffff;
}
.next-round-btn {
  padding: 14px 32px;
  font-size: clamp(18px, 3vw, 22px);
  animation: nextPulse 1.6s ease-in-out infinite;
}
@keyframes nextPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@media (max-width: 640px) {
  .next-round-bar {
    flex-direction: column;
    text-align: center;
  }
  .next-round-btn {
    width: 100%;
  }
}


/* Cloud Sync Row in Parent Analytics */
.sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 800;
  color: #8ee6b3;
}


/* ============================================================
   3-LEVEL COSMIC ZOOM: SYSTEM NAV, PORTAL & GALAXY STAR MAP
   ============================================================ */
.sys-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 4px 8px;
}
.sys-title-text {
  font-size: clamp(13px, 2.2vw, 16px);
  font-weight: 900;
  color: #ffffff;
  white-space: nowrap;
}
.sys-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.sys-arrow:disabled { opacity: 0.28; cursor: default; }

/* Glowing Wormhole Portal to Next Star System */
.portal-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(162, 155, 254, 0.35), rgba(72, 219, 251, 0.35));
  backdrop-filter: blur(10px);
  border: 2px solid #74b9ff;
  border-radius: 999px;
  padding: 8px 16px;
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(116, 185, 255, 0.55);
  animation: nextPulse 1.8s ease-in-out infinite;
}
.portal-swirl {
  display: inline-block;
  font-size: 20px;
  animation: spinSlow 4s linear infinite;
}
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Galaxy Zoom-Out Star Map */
.galaxy-zoom-stage {
  background: radial-gradient(circle at 50% 45%, rgba(108, 92, 231, 0.32), rgba(7, 11, 32, 0.72) 78%);
}
.star-sys-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  z-index: 6;
  font: inherit;
  color: #ffffff;
  transition: transform 0.2s;
}
.star-sys-pin.unlocked:hover { transform: translate(-50%, -50%) scale(1.08); }
.star-sys-pin.locked { cursor: not-allowed; }
.star-sys-pin.locked .star-sun-orb { filter: grayscale(0.9) brightness(0.45); }

.star-sun-orb {
  width: clamp(64px, 11vw, 84px);
  height: clamp(64px, 11vw, 84px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6a9, #feca57 55%, #ff9f43 100%);
  border: 3px solid #ffffff;
  box-shadow: 0 0 28px rgba(254, 202, 87, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: planetFloat 4.5s ease-in-out infinite;
}
.star-sun-icon {
  font-size: clamp(28px, 5vw, 38px);
}

@media (max-width: 640px) {
  .portal-btn { top: 8px; right: 8px; padding: 6px 12px; font-size: 11px; }
  .sys-title-text { font-size: 12px; }
}


/* Parent Test Mode Banner */
.test-mode-banner {
  background: rgba(254, 202, 87, 0.2);
  border: 2px solid rgba(254, 202, 87, 0.65);
  color: #ffeaa7;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
  flex-shrink: 0;
}


/* ============================================================
   VISUAL MAGIC PASS: STARFIELD, TOUCH SPARKLES, ORBIT HALO, POLISH
   ============================================================ */
#spaceStarfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.sparkle-dot {
  position: fixed;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 250;
  box-shadow: 0 0 10px currentColor;
  transform: translate(-50%, -50%) scale(1);
  animation: sparkleBurst 0.56s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes sparkleBurst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.1); }
}

/* Glowing pulsing halo on the next active planet */
.planet-pin.is-next .planet-orb::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 3px solid rgba(254, 202, 87, 0.75);
  box-shadow: 0 0 24px rgba(254, 202, 87, 0.55);
  animation: haloPulse 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes haloPulse {
  0%, 100% { transform: scale(0.96); opacity: 0.85; }
  50% { transform: scale(1.12); opacity: 0.25; }
}

/* Lock solved puzzle buttons cleanly while keeping Repeat audio clickable */
#gameMount.round-won .choice-btn,
#gameMount.round-won .tile-btn,
#gameMount.round-won .compare-card,
#gameMount.round-won .balloon-btn,
#gameMount.round-won .feed-tap-btn,
#gameMount.round-won .feed-done-btn {
  pointer-events: none;
}

/* Visual fruit pile in Feed the Hungry Dino */
.fed-fruits-row {
  min-height: 30px;
  max-width: 280px;
  text-align: center;
  font-size: 24px;
  letter-spacing: 2px;
  line-height: 1.2;
}

/* Elevated button hover/press feel */
.choice-btn, .tile-btn, .compare-card, .launch-cta-btn, .feed-tap-btn, .feed-done-btn {
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.14s, background 0.15s, border-color 0.15s;
}
.choice-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(254, 202, 87, 0.7);
}
.choice-btn.correct-hit {
  background: rgba(46, 204, 113, 0.32) !important;
  border-color: #2ecc71 !important;
  box-shadow: 0 0 24px rgba(46, 204, 113, 0.55), 0 5px 0 #1e8449 !important;
}


/* ============================================================
   CHILD PROFILE ONBOARDING & MULTI-CHILD SWITCHER
   ============================================================ */
.child-setup-card {
  text-align: center;
  max-width: 440px;
}
.child-setup-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 900;
  color: var(--gold);
}
.child-modal-sub {
  margin: 0 0 16px;
  font-size: 14px;
  color: #cfe3ff;
  font-weight: 600;
}
.child-name-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 18px;
  border: 3px solid rgba(130, 177, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  outline: none;
}
.child-name-input:focus {
  border-color: var(--gold);
}
.child-name-input::placeholder {
  color: rgba(207, 227, 255, 0.55);
}
.child-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.avatar-pick-btn {
  height: 58px;
  border-radius: 18px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  font-size: 32px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s;
}
.avatar-pick-btn.active {
  border-color: var(--gold);
  background: rgba(254, 202, 87, 0.22);
  transform: scale(1.08);
}

.child-switcher-box {
  margin-bottom: 14px;
}
.child-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.child-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
}
.child-pill.active {
  background: var(--gold);
  border-color: var(--gold-dark);
  color: #3d2100;
}
.child-pill.add-child {
  border-style: dashed;
  color: #8ee6b3;
  border-color: rgba(142, 230, 179, 0.55);
}


.parent-footer-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}


/* ============================================================
   SPACIOUS, PREMIUM PARENT DASHBOARD & INTUITIVE SETTINGS MODAL
   ============================================================ */
.modal-card.parent-dashboard {
  max-width: 820px;
  padding: clamp(20px, 3vw, 30px);
  background: linear-gradient(165deg, #182352 0%, #10173a 100%);
  border: 2px solid rgba(130, 177, 255, 0.35);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
}
.modal-header-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: #a8c5f0;
  font-weight: 600;
}

.analytics-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.sync-row.compact {
  margin-bottom: 0;
}

.kpi-rich .kpi-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
}
.kpi-sub {
  font-size: 11px;
  color: #9bb8e6;
  font-weight: 700;
  margin-top: 4px;
}
.acc-ring { display: block; margin-bottom: 2px; }

.analytics-cols {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  margin-bottom: 16px;
}
.analytics-panel {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 16px;
}
.panel-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 12px;
}

.sys-progress-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sys-mini-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 9px 10px;
}
.sys-mini-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  color: #e6f1ff;
  margin-bottom: 6px;
  gap: 4px;
}

.history-box.tall {
  background: transparent;
  padding: 0;
  margin-bottom: 0;
  max-height: 290px;
}
.hist-date { font-size: 11px; color: #8faad8; margin-top: 2px; }
.hist-right { text-align: right; }
.hist-acc {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 2px;
}
.hist-acc.good { background: rgba(46, 204, 113, 0.25); color: #7bed9f; }
.hist-acc.mid { background: rgba(254, 202, 87, 0.25); color: #ffe58f; }

/* Settings Cards Grid */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.setting-card {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.setting-card.test-card {
  border-color: rgba(254, 202, 87, 0.35);
  background: rgba(254, 202, 87, 0.07);
}
.setting-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.setting-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.field-desc {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #a8c5f0;
  font-weight: 600;
}
.speed-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.speed-chip {
  flex: 1;
  min-width: 90px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 7px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  color: #e6f1ff;
  cursor: pointer;
}
.speed-chip.active, .speed-chip:hover {
  background: rgba(254, 202, 87, 0.22);
  border-color: var(--gold);
  color: #fff3c4;
}
.toggle-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
}
.toggle-card-row input { width: 19px; height: 19px; accent-color: var(--gold); flex-shrink: 0; }

@media (max-width: 720px) {
  .analytics-cols, .settings-grid, .sys-progress-grid {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   FIX: ZERO HORIZONTAL OVERFLOW IN PARENT MODAL & LONG SELECTS
   ============================================================ */
.modal-card.parent-dashboard {
  overflow-x: hidden;
  width: min(820px, calc(100vw - 24px));
}
.settings-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.analytics-cols {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}
.setting-card,
.analytics-panel,
.setting-card-head > div,
.voice-select-row {
  min-width: 0;
  max-width: 100%;
}
.styled-select {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.speed-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.speed-chip {
  min-width: 0;
  padding: 7px 4px;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 760px) {
  .settings-grid,
  .analytics-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* ============================================================
   REDESIGNED FEED THE HUNGRY DINO PICNIC UI
   ============================================================ */
.dino-picnic-card {
  background: linear-gradient(160deg, rgba(22, 54, 62, 0.85) 0%, rgba(16, 26, 62, 0.9) 100%);
}
.dino-picnic-stage {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: center;
  width: 100%;
}
.dino-hero-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(46, 204, 113, 0.35);
  border-radius: 26px;
  padding: 16px;
}
.dino-want-bubble {
  background: linear-gradient(135deg, #fff5cc, #ffe58f);
  color: #4a2c00;
  border: 3px solid var(--gold-dark);
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.want-num {
  font-size: 26px;
  color: #d63031;
}
.want-em { font-size: 24px; }
.dino-avatar-wrap {
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.35));
}
.dino-tummy-bar {
  width: 100%;
  background: rgba(46, 204, 113, 0.16);
  border: 2px solid rgba(46, 204, 113, 0.45);
  border-radius: 16px;
  padding: 8px 12px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: #b8ffd0;
}
.tummy-emojis {
  display: block;
  min-height: 26px;
  font-size: 22px;
  letter-spacing: 2px;
  margin-top: 2px;
}

.dino-basket-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.basket-label {
  font-size: 15px;
  font-weight: 800;
  color: #cfe3ff;
  text-align: center;
}
.fruit-basket {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 3px solid rgba(254, 202, 87, 0.35);
  border-radius: 24px;
  padding: 14px;
}
.fruit-item-btn {
  aspect-ratio: 1;
  border-radius: 20px;
  border: 3px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  font-size: clamp(32px, 6vw, 44px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s;
}
.fruit-item-btn:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.08);
  border-color: var(--gold);
}
.fruit-item-btn:active:not(:disabled) {
  transform: scale(0.88);
}
.fruit-item-btn.eaten {
  opacity: 0.14;
  transform: scale(0.75);
  box-shadow: none;
  cursor: default;
}

@media (max-width: 680px) {
  .dino-picnic-stage {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* Color Mixing Lab & Living Orbiting Planets */
.color-mix-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.mix-drop {
  background: rgba(255, 255, 255, 0.12);
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-radius: 22px;
  padding: 12px 18px;
  font-size: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.mix-drop span {
  font-size: 14px;
  font-weight: 800;
  color: #e8f1ff;
}

/* Living orbiting sparkle on unlocked planets */
.planet-pin.unlocked .planet-orb::after {
  content: '✦';
  position: absolute;
  top: -4px;
  left: -4px;
  font-size: 14px;
  color: #ffeaa7;
  text-shadow: 0 0 10px #feca57;
  animation: orbitTwinkle 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes orbitTwinkle {
  0%, 100% { transform: translate(0, 0) scale(0.8); opacity: 0.45; }
  50% { transform: translate(6px, -6px) scale(1.25); opacity: 1; }
}


/* ============================================================
   CRISP PLANET ORB ICONS & VISUAL WORLD PICKER OVERLAY
   ============================================================ */
.planet-sphere-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.planet-orb-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(26px, 4.2vw, 34px);
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}
.planet-pin.locked .planet-orb-icon {
  opacity: 0.45;
  filter: grayscale(0.9);
}

.world-picker-card {
  max-height: 88dvh;
  overflow-y: auto;
}
.gal-group-block {
  margin-bottom: 18px;
}
.gal-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.gal-group-head strong {
  font-size: 16px;
  font-weight: 900;
  color: var(--gold);
}
.gal-group-head span {
  font-size: 12px;
  font-weight: 700;
  color: #a8c5f0;
}
.sys-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.sys-pick-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  padding: 14px 16px;
  text-align: left;
  color: #ffffff;
  font: inherit;
  cursor: pointer;
  min-width: 0;
  transition: transform 0.14s, border-color 0.15s, box-shadow 0.15s;
}
.sys-pick-card.unlocked:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.sys-pick-card.current {
  border-color: var(--gold);
  box-shadow: 0 0 22px rgba(254, 202, 87, 0.35);
}
.sys-pick-card.locked {
  opacity: 0.55;
  filter: grayscale(0.6);
  cursor: not-allowed;
}
.sys-pick-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  flex-shrink: 0;
}
.sys-pick-info {
  min-width: 0;
  flex: 1;
}
.sys-pick-title {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
}
.sys-pick-meta {
  font-size: 12px;
  color: #cfe3ff;
  font-weight: 700;
  margin-top: 3px;
}
@media (max-width: 640px) {
  .sys-cards-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* ============================================================
   FIXED-WIDTH SYSTEM NAV (NO JUMPING) & VERTICAL ASCENT ANIMATION
   ============================================================ */
.sys-nav-pill {
  width: 280px;
  max-width: 100%;
  justify-content: space-between;
}
.sys-title-text {
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sys-arrow {
  flex-shrink: 0;
}

.space-camera-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  will-change: transform, opacity;
  transition: transform 0.36s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.32s ease;
}
.space-camera-layer.exit-to-bottom {
  transform: translateY(100%);
  opacity: 0.25;
}
.space-camera-layer.exit-to-top {
  transform: translateY(-100%);
  opacity: 0.25;
}
.space-camera-layer.enter-from-top {
  animation: flyInFromTop 0.48s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.space-camera-layer.enter-from-bottom {
  animation: flyInFromBottom 0.48s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes flyInFromTop {
  from { transform: translateY(-92%); opacity: 0.2; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes flyInFromBottom {
  from { transform: translateY(92%); opacity: 0.2; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 640px) {
  .sys-nav-pill { width: 220px; }
}


.next-round-btn.speaking-wait {
  opacity: 0.55;
  cursor: wait;
  animation: none;
  filter: saturate(0.4);
}

/* ============================================================
   Interactive Visual Addition & Subtraction Playground
   ============================================================ */
.eq-formula-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.16);
  margin: 4px auto 12px;
}
.eq-f-num {
  min-width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: #fff;
}
.eq-f-a { background: linear-gradient(135deg, #3b82f6, #2563eb); box-shadow: 0 4px 12px rgba(59,130,246,0.35); }
.eq-f-b { background: linear-gradient(135deg, #ec4899, #a855f7); box-shadow: 0 4px 12px rgba(236,72,153,0.35); }
.eq-f-op {
  font-size: 26px;
  font-weight: 900;
  color: #feca57;
}
.eq-formula-bar .eq-answer-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 26px;
  border: 3px dashed #feca57;
  background: rgba(254, 202, 87, 0.16);
  color: #feca57;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s, border-color 0.25s;
}
.eq-formula-bar .eq-answer-box.solved {
  border-style: solid;
  border-color: #2ecc71;
  background: linear-gradient(135deg, #2ecc71, #16a34a);
  color: #fff;
  transform: scale(1.14);
  box-shadow: 0 0 18px rgba(46, 204, 113, 0.55);
}

.math-play-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.eq-pods-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}
.eq-pod {
  flex: 1 1 130px;
  max-width: 240px;
  min-height: 112px;
  border-radius: 24px;
  padding: 14px 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
}
.eq-pod-a {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.22), rgba(37, 99, 235, 0.12));
  border: 2.5px solid rgba(96, 165, 250, 0.55);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}
.eq-pod-b {
  background: linear-gradient(145deg, rgba(236, 72, 153, 0.22), rgba(168, 85, 247, 0.12));
  border: 2.5px solid rgba(244, 114, 182, 0.55);
  box-shadow: 0 10px 24px rgba(168, 85, 247, 0.18);
}
.eq-pod-num {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  background: rgba(15, 23, 42, 0.45);
  padding: 2px 12px;
  border-radius: 999px;
}
.eq-pod-toys {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.eq-action-pill {
  border: 0;
  border-radius: 20px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #feca57, #ff9f43);
  color: #1e293b;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  box-shadow: 0 8px 20px rgba(254, 202, 87, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  animation: pulseSoft 2s infinite;
}
.eq-action-pill:hover { transform: scale(1.06); }
.eq-action-pill:active { transform: scale(0.95); }
.eq-action-sym { font-size: 28px; line-height: 1; }
.eq-action-lbl { font-size: 12px; font-weight: 900; letter-spacing: 0.2px; }
.eq-fly-btn {
  flex-direction: row;
  margin-top: 6px;
  padding: 9px 18px;
  font-size: 15px;
  background: linear-gradient(135deg, #ff7675, #ff9f43);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 118, 117, 0.4);
}

.eq-merged-pod {
  width: 100%;
  max-width: 480px;
  border-radius: 26px;
  padding: 14px 16px 16px;
  background: linear-gradient(145deg, rgba(46, 204, 113, 0.18), rgba(59, 130, 246, 0.16));
  border: 2.5px solid rgba(110, 231, 183, 0.55);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: popInCard 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.eq-sub-pod {
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.18), rgba(59, 130, 246, 0.15));
  border-color: rgba(192, 132, 252, 0.5);
}
.eq-merged-tag {
  font-size: 14px;
  font-weight: 800;
  color: #fef08a;
  letter-spacing: 0.2px;
}

.eq-toy-btn {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, opacity 0.35s, border-color 0.2s;
  padding: 0;
}
.eq-toy-btn:hover { transform: scale(1.1); background: rgba(255, 255, 255, 0.2); }
.eq-toy-btn:active { transform: scale(0.92); }
.eq-toy-emoji {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.28));
}
.eq-toy-btn.from-a { border-color: rgba(96, 165, 250, 0.65); background: rgba(59, 130, 246, 0.22); }
.eq-toy-btn.from-b { border-color: rgba(244, 114, 182, 0.65); background: rgba(236, 72, 153, 0.22); }
.eq-toy-btn.counted {
  border-color: #feca57;
  background: rgba(254, 202, 87, 0.28);
  box-shadow: 0 0 14px rgba(254, 202, 87, 0.45);
}
.eq-toy-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #feca57, #ff9f43);
  color: #1e293b;
  font-size: 13px;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.eq-toy-btn.counted .eq-toy-badge {
  display: inline-flex;
  animation: popInCard 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.eq-toy-btn.to-remove {
  border: 2.5px dashed #ff7675;
  background: rgba(255, 118, 117, 0.2);
  animation: gentleShake 1.8s ease-in-out infinite;
}
.eq-toy-btn.is-gone {
  opacity: 0.22;
  transform: scale(0.75) translateY(-10px);
  filter: grayscale(1);
  border-style: dashed;
  cursor: default;
  pointer-events: none;
}
.eq-toy-btn.is-gone::after {
  content: '✕';
  position: absolute;
  font-size: 26px;
  font-weight: 900;
  color: #ff7675;
}
.eq-toy-btn.toy-bounce { animation: toyHop 0.36s cubic-bezier(0.34, 1.56, 0.64, 1); }
.eq-toy-btn.toy-win { animation: toyHop 0.55s ease infinite alternate; border-color: #2ecc71; }
@keyframes toyHop {
  0% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.18) translateY(-8px); }
  100% { transform: scale(1) translateY(0); }
}
@keyframes gentleShake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}
@keyframes popInCard {
  from { transform: scale(0.85); opacity: 0.2; }
  to { transform: scale(1); opacity: 1; }
}
.eq-helper-tip {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}
@media (max-width: 520px) {
  .eq-toy-btn { width: 48px; height: 48px; border-radius: 14px; }
  .eq-toy-emoji { font-size: 26px; }
  .eq-pod { min-height: 96px; padding: 10px 8px 8px; }
}

/* ============================================================
   Mobile PWA Standalone & Safe-Area Polish
   ============================================================ */
html, body {
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
.app-shell {
  padding-top: max(10px, env(safe-area-inset-top));
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  padding-left: max(10px, env(safe-area-inset-left));
  padding-right: max(10px, env(safe-area-inset-right));
}
.pwa-install-card {
  border-color: rgba(46, 204, 113, 0.45);
  background: linear-gradient(145deg, rgba(46, 204, 113, 0.14), rgba(59, 130, 246, 0.12));
}
.pwa-install-btn {
  margin-top: 10px;
  width: 100%;
}

.compare-dots-grid {
  display: grid;
  grid-template-columns: repeat(5, auto);
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
  font-size: clamp(20px, 4.4vw, 28px);
  line-height: 1.1;
}
.compare-dots-grid.compact {
  font-size: clamp(16px, 3.6vw, 22px);
  gap: 3px;
}

/* ============================================================
   Clean Intuitive Feed-the-Dino UI
   ============================================================ */
.dino-feed-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.dino-feed-card .dino-avatar-wrap {
  width: 130px;
  height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dino-feed-card .dino-avatar-wrap svg {
  width: 100%;
  height: 100%;
}
.dino-plate-box {
  width: 100%;
  max-width: 380px;
  border-radius: 18px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.dino-plate-head {
  font-size: 14px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 6px;
}
.dino-fed-count {
  font-size: 18px;
  color: #feca57;
}
.dino-plate-items {
  min-height: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 24px;
}
.dino-plate-empty {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
}
.fed-item-pop {
  display: inline-block;
  animation: popInCard 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.feed-tap-btn {
  width: 100%;
  max-width: 320px;
  padding: 13px 20px;
  border-radius: 22px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(135deg, #feca57, #ff9f43);
  color: #1e293b;
  font: inherit;
  font-weight: 900;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(254, 202, 87, 0.35);
  transition: transform 0.14s ease;
}
.feed-tap-btn:active { transform: scale(0.95); }
.feed-tap-em { font-size: 28px; line-height: 1; }

/* ============================================================
   Pixel 8 Pro & Mobile Zero-Scroll Optimization (<= 640px)
   ============================================================ */
@media (max-width: 640px) {
  .app-shell {
    padding-top: max(6px, env(safe-area-inset-top));
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
    gap: 6px;
  }

  /* Single-row sleek Top Bar (saves ~60px vertical space!) */
  .top-bar {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 4px 0;
  }
  .brand-btn {
    padding: 6px 11px;
    font-size: 14px;
    gap: 6px;
    min-width: 0;
    flex-shrink: 1;
  }
  .brand-icon { font-size: 18px; }
  .brand-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .top-actions {
    gap: 6px;
    flex-shrink: 0;
  }
  .star-pill {
    padding: 5px 10px;
    font-size: 14px;
    height: 36px;
  }
  .icon-pill {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  .voice-chip { display: none !important; }

  /* Compact Home HUD Bar */
  .space-hud-bar {
    padding: 8px 10px;
    gap: 8px;
    border-radius: 18px;
  }
  .hud-left, .hud-buttons {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }
  .sys-nav-pill {
    flex: 1;
    width: auto;
    min-width: 0;
    padding: 4px 6px;
  }
  .sys-title-text { font-size: 13px; }
  .hud-pill-btn {
    padding: 6px 10px;
    font-size: 13px;
  }
  .launch-cta-btn {
    padding: 8px 14px;
    font-size: 14px;
  }

  /* Big, crisp, centered planets on mobile — zero edge clipping & easy 4yo tapping! */
  .planet-pin,
  .planet-pin.label-left,
  .planet-pin.label-right {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 4px;
    max-width: 146px;
  }
  .planet-orb,
  .planet-orb .planet-sphere-wrap,
  .planet-orb svg {
    width: 68px !important;
    height: 68px !important;
  }
  .planet-pin.is-next .planet-orb,
  .planet-pin.is-next .planet-orb .planet-sphere-wrap,
  .planet-pin.is-next .planet-orb svg {
    width: 76px !important;
    height: 76px !important;
  }
  .planet-orb-icon {
    font-size: 28px !important;
  }
  .planet-pin.is-next .planet-orb-icon {
    font-size: 32px !important;
  }
  .planet-badge-num {
    width: 24px;
    height: 24px;
    font-size: 12px;
    right: -2px;
    bottom: -2px;
  }
  .planet-tag {
    padding: 3px 9px;
    border-radius: 999px;
    max-width: 138px;
    background: rgba(13, 19, 48, 0.82);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
  }
  .planet-tag-title {
    font-size: 11.5px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .planet-tag-sub { display: none; }
  .rocket-ship svg { width: 52px; height: 52px; }
  .earth-horizon {
    bottom: 6px;
    padding: 4px 12px;
    font-size: 11px;
  }

  /* Compact Game Arena Navigation & Mode Pills */
  .arena-nav {
    gap: 6px;
    padding: 2px 0;
    margin-bottom: 4px;
  }
  .back-btn {
    padding: 6px 10px;
    font-size: 13px;
  }
  .progress-stars {
    padding: 4px 8px;
    gap: 4px;
  }
  .p-star { font-size: 15px; }
  .score-hud {
    padding: 4px 8px;
    font-size: 13px;
    gap: 6px;
  }
  .mode-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 6px;
    padding: 2px 2px 4px;
    margin-bottom: 6px;
    scrollbar-width: none;
  }
  .mode-pills::-webkit-scrollbar { display: none; }
  .mode-pill {
    flex-shrink: 0;
    padding: 6px 11px;
    font-size: 12px;
  }

  /* Compact Zero-Scroll Game Card */
  .game-card {
    padding: 12px 12px 14px;
    border-radius: 22px;
    gap: 10px;
    min-height: 0 !important;
  }
  .game-top-row { margin-bottom: 0; }
  .game-badge { font-size: 13px; padding: 5px 11px; }
  .speak-again-btn { font-size: 13px; padding: 6px 11px; }

  .choice-grid { gap: 8px; }
  .choice-btn {
    padding: 12px 10px;
    min-height: 54px;
    font-size: 20px;
    border-radius: 16px;
  }
  .choice-btn.num-choice {
    font-size: 24px;
    min-height: 54px;
  }
  .compare-stage { gap: 10px; }
  .compare-card { padding: 12px 8px; border-radius: 18px; }
  .compare-num { font-size: 34px; }
  .compare-vs { font-size: 18px; }

  .eq-formula-bar { padding: 6px 14px; margin: 0 auto 6px; gap: 8px; }
  .eq-f-num { min-width: 36px; height: 36px; font-size: 20px; }
  .eq-f-op { font-size: 22px; }
  .eq-formula-bar .eq-answer-box { width: 40px; height: 40px; font-size: 22px; }
  .math-play-stage { gap: 6px; margin-bottom: 8px; }
  .eq-helper-tip { font-size: 12px; }

  .dino-feed-card .dino-avatar-wrap { width: 105px; height: 96px; }
  .dino-want-bubble { font-size: 16px; padding: 6px 14px; }
  .feed-tap-btn { padding: 11px 16px; font-size: 16px; }
  .feed-done-btn { padding: 10px 16px; font-size: 15px; }

  /* Sticky Bottom Next-Round Bar — always visible without scrolling! */
  .next-round-bar {
    position: sticky;
    bottom: max(6px, env(safe-area-inset-bottom));
    z-index: 30;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 18px;
    gap: 8px;
    background: rgba(16, 24, 58, 0.94);
    backdrop-filter: blur(12px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  }
  .next-praise-text { font-size: 14px; }
  .next-round-btn { padding: 10px 18px; font-size: 15px; }
}

/* ============================================================
   New Mechanic #1: Shadow Detective & #2: First-Letter Match
   ============================================================ */
.shadow-spotlight {
  width: 100%;
  max-width: 280px;
  padding: 18px 16px 14px;
  border-radius: 26px;
  background: radial-gradient(circle at 50% 42%, rgba(254, 202, 87, 0.24), rgba(16, 23, 58, 0.75) 72%);
  border: 2.5px solid rgba(254, 202, 87, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: background 0.35s ease, border-color 0.35s ease, transform 0.35s ease;
}
.shadow-spotlight.revealed {
  background: radial-gradient(circle at 50% 42%, rgba(46, 204, 113, 0.34), rgba(24, 42, 92, 0.72) 72%);
  border-color: #2ecc71;
  transform: scale(1.04);
}
.shadow-figure {
  font-size: clamp(68px, 16vw, 96px);
  line-height: 1.05;
  filter: brightness(0) saturate(0) drop-shadow(0 0 14px rgba(254, 202, 87, 0.75));
  transition: filter 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: toyHop 2.4s ease-in-out infinite;
}
.shadow-figure.revealed {
  filter: drop-shadow(0 6px 18px rgba(46, 204, 113, 0.5));
  transform: scale(1.12);
}
.shadow-caption {
  font-size: 14px;
  font-weight: 800;
  color: #fef08a;
}
.shadow-opt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.first-letter-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.16);
  width: 100%;
  max-width: 340px;
}
.first-letter-pic {
  font-size: clamp(60px, 15vw, 86px);
  line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.28));
}
.first-letter-word-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(28px, 7vw, 38px);
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
}
.fl-blank {
  min-width: 48px;
  height: 52px;
  border-radius: 14px;
  border: 3px dashed #feca57;
  background: rgba(254, 202, 87, 0.16);
  color: #feca57;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s, border-color 0.25s;
}
.fl-blank.solved {
  border-style: solid;
  border-color: #2ecc71;
  background: linear-gradient(135deg, #2ecc71, #16a34a);
  color: #fff;
  transform: scale(1.12);
}
.fl-letter-btn {
  font-size: clamp(26px, 6vw, 34px) !important;
  font-weight: 900 !important;
}

@media (max-width: 640px) {
  .shadow-spotlight {
    max-width: 220px;
    padding: 10px 12px 8px;
    border-radius: 20px;
    gap: 4px;
  }
  .shadow-figure {
    font-size: 62px;
  }
  .shadow-caption {
    font-size: 13px;
  }
  .shadow-opt-btn {
    padding: 10px 8px !important;
    min-height: 78px !important;
  }
  .shadow-opt-btn .choice-emoji,
  .story-opt-btn .choice-emoji {
    font-size: 38px;
  }
  .story-opt-btn {
    min-height: 82px;
    padding: 10px 6px;
  }
  .story-opt-label {
    font-size: 13px;
  }
  .first-letter-stage {
    padding: 10px 14px;
    gap: 8px;
  }
  .first-letter-pic {
    font-size: 56px;
  }
  .first-letter-word-row {
    font-size: 28px;
  }
  .fl-blank {
    min-width: 40px;
    height: 44px;
  }
}

/* ============================================================
   Chapter Reward Arcade & 2D Cosmic Car Stunt Jump Game
   ============================================================ */
.rewards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 820px;
  margin: 6px auto 0;
}
.reward-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 18px 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
}
.reward-card.unlocked {
  background: linear-gradient(145deg, rgba(254, 202, 87, 0.2), rgba(255, 107, 107, 0.16));
  border-color: rgba(254, 202, 87, 0.6);
  box-shadow: 0 12px 28px rgba(254, 202, 87, 0.18);
}
.reward-card.locked {
  opacity: 0.68;
}
.reward-icon { font-size: 48px; line-height: 1; }
.reward-title { font-size: 19px; font-weight: 900; color: #fff; }
.reward-sub { font-size: 12px; font-weight: 800; color: #feca57; margin-top: 2px; }
.reward-desc { font-size: 13px; color: rgba(255, 255, 255, 0.82); margin: 4px 0 0; line-height: 1.4; }
.reward-play-btn { width: 100%; margin-top: 4px; }
.reward-lock-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.reward-game-wrap {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.car-canvas-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  max-height: 54vh;
  border-radius: 24px;
  overflow: hidden;
  border: 3px solid rgba(254, 202, 87, 0.45);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  background: #0f163b;
}
#carJumpCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.car-banner {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 48, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  text-align: center;
}
.car-banner.hidden { display: none; }
.car-banner-title { font-size: clamp(24px, 6vw, 34px); font-weight: 900; color: #feca57; }
.car-banner-sub { font-size: 16px; font-weight: 800; color: #fff; }

.car-controls {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1.35fr;
  gap: 10px;
  width: 100%;
  touch-action: manipulation;
}
.car-pedal {
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-radius: 22px;
  padding: 14px 10px;
  min-height: 76px;
  color: #fff;
  font: inherit;
  font-weight: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: transform 0.1s ease, filter 0.1s ease;
}
.car-pedal.pressed, .car-pedal:active {
  transform: scale(0.94);
  filter: brightness(1.15);
}
.pedal-ic { font-size: 26px; line-height: 1; }
.pedal-lbl { font-size: 14px; font-weight: 900; }
.pedal-back { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.pedal-jump { background: linear-gradient(135deg, #feca57, #ff9f43); color: #1e293b; }
.pedal-gas  { background: linear-gradient(135deg, #2ecc71, #16a34a); }

@media (max-width: 640px) {
  .car-canvas-shell { aspect-ratio: 16 / 10; max-height: 46vh; border-radius: 18px; }
  .car-pedal { min-height: 68px; padding: 10px 6px; border-radius: 18px; }
  .pedal-ic { font-size: 22px; }
  .pedal-lbl { font-size: 13px; }
}

/* ============================================================
   Habitats ("ვისი სახლია?") & Size Sorting ("პატარიდან დიდამდე")
   ============================================================ */
.habitat-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.16);
}
.habitat-em {
  font-size: clamp(56px, 14vw, 80px);
  line-height: 1.05;
}
.habitat-q {
  font-size: clamp(16px, 4.2vw, 21px);
  font-weight: 900;
  color: #fef08a;
  text-align: center;
}

.size-pedestals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 460px;
  align-items: end;
}
.size-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 18px;
  border: 2.5px dashed rgba(254, 202, 87, 0.45);
  background: rgba(255, 255, 255, 0.06);
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}
.size-slot.slot-1 { min-height: 76px; }
.size-slot.slot-2 { min-height: 96px; }
.size-slot.slot-3 { min-height: 116px; }
.size-slot.filled {
  border-style: solid;
  border-color: #2ecc71;
  background: rgba(46, 204, 113, 0.2);
}
.size-slot-em {
  font-size: 38px;
  line-height: 1;
  animation: popInCard 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.size-slot.slot-1 .size-slot-em { font-size: 28px; }
.size-slot.slot-2 .size-slot-em { font-size: 38px; }
.size-slot.slot-3 .size-slot-em { font-size: 48px; }
.size-slot-lbl {
  font-size: 12px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.78);
}
.size-pick-btn.used {
  opacity: 0.25;
  pointer-events: none;
  transform: scale(0.92);
}

/* ============================================================
   Interactive Georgia Map Game ("ჩემი საქართველო")
   ============================================================ */
.geo-map-question {
  font-size: clamp(16px, 4.2vw, 20px);
  font-weight: 900;
  color: #fef08a;
  text-align: center;
  line-height: 1.35;
}
.geo-map-stage {
  position: relative;
  width: 100%;
  max-width: 540px;
  aspect-ratio: 400 / 230;
  border-radius: 22px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, rgba(28, 46, 108, 0.9), rgba(11, 18, 46, 0.96));
  border: 2.5px solid rgba(254, 202, 87, 0.4);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.geo-map-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.geo-pin-btn {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 8px;
  border-radius: 16px;
  border: 2px solid rgba(254, 202, 87, 0.8);
  background: rgba(13, 19, 48, 0.88);
  color: #fff;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.16s ease, background 0.2s, border-color 0.2s;
  z-index: 4;
}
.geo-pin-btn:hover { transform: translate(-50%, -50%) scale(1.08); }
.geo-pin-btn:active { transform: translate(-50%, -50%) scale(0.94); }
.geo-pin-btn.correct-hit {
  background: linear-gradient(135deg, #2ecc71, #16a34a);
  border-color: #a8f0c6;
  transform: translate(-50%, -50%) scale(1.14);
  z-index: 8;
}
.geo-pin-em {
  font-size: clamp(20px, 5.2vw, 26px);
  line-height: 1;
}
.geo-pin-lbl {
  font-size: clamp(10.5px, 2.8vw, 13px);
  font-weight: 900;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .geo-map-stage { border-radius: 18px; }
  .geo-pin-btn { padding: 4px 6px; border-radius: 13px; }
}

/* ============================================================
   Kid-Readable Georgian Typography & Mtavruli (Uppercase) Polish
   ============================================================ */
.brand-text,
.sys-title-text,
.game-badge,
.story-title,
.reward-title,
.earth-horizon,
.gal-group-head strong,
.sys-pick-title,
.geo-pin-lbl,
.launch-cta-btn,
.next-round-btn {
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

/* Larger, clearer reading size across all questions, stories & answer labels */
.story-title {
  font-size: clamp(19px, 5vw, 25px);
  line-height: 1.3;
}
.story-body,
.disc-fact-text,
.disc-joke-box {
  font-size: clamp(17px, 4.3vw, 21px) !important;
  line-height: 1.6 !important;
}
.story-question-text,
.habitat-q,
.geo-map-question {
  font-size: clamp(18px, 4.8vw, 24px) !important;
  line-height: 1.38 !important;
}
.story-opt-label,
.choice-caption {
  font-size: clamp(15px, 3.9vw, 18px) !important;
  font-weight: 900 !important;
  line-height: 1.22;
}
.game-badge {
  font-size: clamp(14px, 3.6vw, 16px) !important;
}
.speak-again-btn,
.speak-pill {
  font-size: 14.5px !important;
}
.eq-helper-tip,
.eq-merged-tag,
.count-helper,
.dino-plate-head,
.dino-plate-empty {
  font-size: 15px !important;
}
.size-slot-lbl {
  font-size: 14px !important;
}
.geo-pin-lbl {
  font-size: clamp(12.5px, 3.3vw, 15px) !important;
}
.next-praise-text {
  font-size: clamp(16px, 4.2vw, 20px) !important;
  line-height: 1.3;
}
.planet-tag-title {
  font-size: clamp(13.5px, 3.4vw, 16px) !important;
  font-weight: 900 !important;
}
.planet-tag-sub {
  font-size: 12.5px;
}
.reward-desc {
  font-size: 15px;
}
.sys-pick-meta {
  font-size: 13.5px;
}

@media (max-width: 640px) {
  .sys-title-text { font-size: 14.5px !important; }
  .planet-tag { max-width: 156px; padding: 4px 10px; }
  .planet-tag-title { font-size: 13px !important; }
  .earth-horizon { font-size: 12.5px !important; }
  .mode-pill { font-size: 13.5px !important; padding: 6px 12px; }
  .back-btn { font-size: 14px !important; }
  .hud-pill-btn { font-size: 14px !important; }
  .story-opt-label { font-size: 14.5px !important; }
  .geo-pin-lbl { font-size: 12px !important; }
  .eq-helper-tip { font-size: 13.5px !important; }
  .next-praise-text { font-size: 15.5px !important; }
}
