:root {
  --bg1: #fff9f2;
  --bg2: #ecf7ff;
  --ink: #1f2440;
  --primary: #7a41ff;
  --primary-2: #4d7dff;
  --accent: #ff9b42;
  --success: #17a159;
  --warn: #be6500;
  --card: #ffffff;
  --radius: 20px;
  --shadow: 0 12px 28px rgba(44, 62, 120, 0.14);
  --page-max-width: 100%;
  --site-edge-gap: clamp(10px, 2vw, 28px);
  --header-offset: 86px;
}

.picture-choice {
  width: min(210px, 100%);
  display: grid;
  gap: 8px;
  text-align: center;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.picture-choice.selected {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 16px rgba(79, 98, 183, 0.18);
}

.picture-choice.correct .picture-illustration {
  border-color: #4db56f;
  box-shadow: 0 0 0 3px rgba(77, 181, 111, 0.22);
}

.picture-illustration {
  width: 100%;
  height: 112px;
  border-radius: 10px;
  border: 1px solid #dbe6ff;
  object-fit: contain;
  object-position: center;
  padding: 6px;
  background: #f4f7ff;
}

.picture-label {
  font-size: 0.86rem;
  color: #2f3a6d;
}

.picture-match-lottie {
  width: 86px;
  height: 66px;
  margin: 2px auto 8px;
  pointer-events: none;
}

.prompt-illustration {
  display: inline-block;
  margin-left: 10px;
  vertical-align: middle;
  width: min(120px, 28vw);
}

.lesson-mascot {
  margin: 10px 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  pointer-events: none;
  max-width: 360px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "Noto Sans Devanagari", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg1), var(--bg2));
  min-height: 100%;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  background: #111;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  z-index: 20;
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 14px clamp(12px, 3vw, 30px);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e7ecff;
}

.main-nav {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.main-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 12px;
}

.language-chooser-link {
  text-decoration: none;
}

.language-hero-layout {
  display: grid;
  grid-template-columns: minmax(120px, 220px) 1fr;
  gap: 14px;
  align-items: center;
}

.language-hero-mithu {
  display: grid;
  place-items: center;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  perspective: 1000px;
}

.language-card {
  display: grid;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  border: 2px solid #d9e5ff;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  padding: 14px 14px 16px;
  box-shadow: 0 10px 22px rgba(44, 62, 120, 0.14);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, filter 0.24s ease;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

.language-card::after {
  content: "";
  position: absolute;
  inset: auto -24px -38px auto;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.language-card:hover,
.language-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 14px 26px rgba(44, 62, 120, 0.2);
  border-color: #9fb5ff;
  filter: saturate(1.05);
}

.language-card.is-language-locked {
  border-color: #d8dcef;
  background: linear-gradient(180deg, #fbfcff, #f5f7fc);
  box-shadow: 0 8px 16px rgba(44, 62, 120, 0.11);
}

.language-card.is-language-locked:hover,
.language-card.is-language-locked:focus-visible {
  transform: none;
  border-color: #d8dcef;
  box-shadow: 0 8px 16px rgba(44, 62, 120, 0.11);
}

.language-lock-badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef1fb;
  border: 1px solid #d8def1;
  color: #4f5680;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.language-lock-badge[hidden] {
  display: none !important;
}

.language-portal {
  position: relative;
  width: 100%;
  min-height: 114px;
  border-radius: 16px;
  display: block;
  overflow: hidden;
  background: linear-gradient(150deg, #ddeeff, #fff);
  border: 1px solid #c8ddff;
}

.language-portal .portal-ring {
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 2px rgba(140, 173, 255, 0.25), inset 0 0 28px rgba(109, 140, 255, 0.2);
  animation: iconTwinkle 3.1s ease-in-out infinite;
}

.language-portal .portal-core {
  position: absolute;
  left: 16px;
  top: 15px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.94);
  overflow: hidden;
  box-shadow: 0 10px 16px rgba(67, 89, 170, 0.24);
  animation: languagePortalBob 2.8s ease-in-out infinite;
}

.language-portal .portal-core img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.language-portal .portal-word {
  position: absolute;
  right: 14px;
  bottom: 16px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e2f72;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
  animation: languageWordGlow 2.6s ease-in-out infinite;
}

.portal-country {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  font-size: 1.2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(20, 30, 70, 0.2));
}

.portal-sanskrit .language-portal {
  background: linear-gradient(145deg, #fff2dd, #fffdf2);
}

.portal-spanish .language-portal {
  background: linear-gradient(145deg, #ffe5d8, #fff7d7);
}

.portal-portuguese .language-portal {
  background: linear-gradient(145deg, #ddf4ff, #e9ffe7);
}

.portal-sanskrit .portal-word {
  color: #7f4d11;
}

.portal-spanish .portal-word {
  color: #8f1f2b;
}

.portal-portuguese .portal-word {
  color: #17603c;
}

body.lang-theme-spanish .site-header {
  border-bottom-color: #f7bf7b;
}

body.lang-theme-portuguese .site-header {
  border-bottom-color: #78d6b1;
}

body.lang-theme-spanish .panel {
  border-color: #f5d6ba;
}

body.lang-theme-portuguese .panel {
  border-color: #bde8d8;
}

.portal-sanskrit:hover .portal-ring,
.portal-spanish:hover .portal-ring,
.portal-portuguese:hover .portal-ring,
.portal-sanskrit:focus-visible .portal-ring,
.portal-spanish:focus-visible .portal-ring,
.portal-portuguese:focus-visible .portal-ring {
  animation-duration: 1.5s;
}

@keyframes languagePortalBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes languageWordGlow {
  0%, 100% { opacity: 0.9; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65), 0 0 0 rgba(77, 104, 216, 0); }
  50% { opacity: 1; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65), 0 0 10px rgba(77, 104, 216, 0.34); }
}

.language-hero-mithu.state-dancing .mithu-body {
  animation: mithuDance 1s ease-in-out 3;
}

.language-hero-mithu.state-dancing .mithu-wing-left {
  transform-origin: 72% 36%;
  animation: mithuWingFlapLeft 0.2s ease-in-out 7;
}

.language-hero-mithu.state-dancing .mithu-wing-right {
  transform-origin: 28% 36%;
  animation: mithuWingFlapRight 0.2s ease-in-out 7;
}

.medal-celebration {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 2px dashed #ffd264;
  background: linear-gradient(180deg, #fffcee, #fff6cc);
  color: #7b4c00;
  font-weight: 700;
  font-size: 0.92rem;
}

.medal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.medal-card {
  border-radius: 16px;
  border: 2px solid #dbe6ff;
  padding: 12px 12px 14px;
  background: #fff;
  position: relative;
  overflow: hidden;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, filter 0.24s ease;
}

.medal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 16% 15%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.medal-card.pending {
  opacity: 0.86;
  filter: saturate(0.88);
  background: linear-gradient(180deg, #fbfcff, #f2f5ff);
}

.medal-card.earned {
  border-color: #ffd464;
  background: linear-gradient(180deg, #fff9de, #fff1c6);
  box-shadow: 0 10px 16px rgba(255, 199, 57, 0.28);
}

.medal-card:hover,
.medal-card:focus-within {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 26px rgba(67, 89, 170, 0.22);
}

.medal-card.pending:hover,
.medal-card.pending:focus-within {
  border-color: #c9d6ff;
}

.medal-card.earned:hover,
.medal-card.earned:focus-within {
  border-color: #ffc73a;
  filter: saturate(1.08);
}

.medal-icon {
  margin: 0 0 6px;
  font-size: 1.5rem;
}

.medal-art {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  box-shadow: 0 10px 18px rgba(66, 79, 146, 0.24);
  background: linear-gradient(150deg, #ffe78c, #ffa955);
  font-size: 1.5rem;
  position: relative;
  animation: medalOrbFloat 3.1s ease-in-out infinite;
}

.medal-art::before,
.medal-art::after {
  content: "";
  position: absolute;
  bottom: -11px;
  width: 12px;
  height: 16px;
  border-radius: 0 0 4px 4px;
  z-index: -1;
}

.medal-art::before {
  left: 11px;
  background: linear-gradient(180deg, #7fa2ff, #3d5fc2);
}

.medal-art::after {
  right: 11px;
  background: linear-gradient(180deg, #9de8ff, #4e96cf);
}

.medal-card.medal-sanskrit .medal-art {
  background: linear-gradient(140deg, #ffe68c, #ff9f58);
}

.medal-card.medal-spanish .medal-art {
  background: linear-gradient(140deg, #ff9f8f, #ffd269);
}

.medal-card.medal-portuguese .medal-art {
  background: linear-gradient(140deg, #7de0b4, #4ea4ff);
}

.medal-title {
  margin: 0;
  font-size: 1.02rem;
}

.medal-card.unlocking {
  animation: unlockPulse 0.9s ease-out 1, medalRise 0.72s ease-out 1;
}

.medal-card.unlocking::after {
  content: "";
  position: absolute;
  inset: -20% -20%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0));
  animation: medalSparkle 0.9s ease-out 1;
}

.medal-card.unlocking .medal-art {
  animation: medalUnlockSpin 0.9s ease-out 1, medalOrbFloat 3.1s ease-in-out infinite;
}

@keyframes medalOrbFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes medalUnlockSpin {
  0% { transform: scale(1) rotate(0deg); }
  55% { transform: scale(1.14) rotate(16deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@media (max-width: 780px) {
  .language-hero-layout {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .language-card,
  .language-card::before,
  .language-portal .portal-ring,
  .language-portal .portal-core,
  .language-portal .portal-word,
  .medal-art,
  .medal-card.unlocking .medal-art {
    animation: none !important;
  }
}

.main-nav a[aria-current="page"] {
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
}

.mute-btn {
  border: 0;
  border-radius: 12px;
  background: #111b5a;
  color: #fff;
  font-weight: 700;
  padding: 10px 12px;
  cursor: pointer;
}

.test-mode-badge {
  position: fixed;
  right: 10px;
  bottom: 10px;
  z-index: 30;
  border-radius: 999px;
  border: 1px solid #f2c85f;
  background: #fff6d8;
  color: #6a4b00;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.page-wrap {
  width: 100%;
  max-width: none;
  margin: 12px auto 28px;
  padding-inline: var(--site-edge-gap);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.page-wrap > * {
  min-width: 0;
}

.page-wrap.with-mascot {
  grid-template-columns: minmax(0, 1fr) clamp(220px, 20vw, 290px);
  column-gap: 20px;
  align-items: start;
}

.page-wrap.with-mascot > section,
.page-wrap.with-mascot > nav {
  grid-column: 1;
}

.mascot-rail {
  grid-column: 2;
  grid-row: 1 / span 100;
  position: relative;
  align-self: start;
  min-height: 100%;
  pointer-events: none;
}

.hero-card,
.panel,
.feature-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: clamp(14px, 2vw, 22px);
  border: 2px solid #dbe6ff;
}

.hero-guide {
  background: radial-gradient(circle at 50% 30%, #f7fcff, #dbe8ff);
  border-radius: 18px;
  display: grid;
  place-items: center;
}

.guide-face {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffdc8f, #ffb775);
  position: relative;
  box-shadow: inset 0 -8px 0 rgba(120, 72, 0, 0.12);
}

.eye {
  width: 14px;
  height: 14px;
  background: #251f53;
  border-radius: 50%;
  position: absolute;
  top: 48px;
}

.eye.left {
  left: 34px;
}

.eye.right {
  right: 34px;
}

.smile {
  position: absolute;
  width: 58px;
  height: 28px;
  border: 4px solid #8d3f00;
  border-top: 0;
  border-left-color: transparent;
  border-right-color: transparent;
  left: 36px;
  top: 74px;
  border-radius: 0 0 30px 30px;
}

.hero-badge {
  display: inline-block;
  margin: 0;
  background: #fef1cf;
  color: #7a4e00;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 10px 0 8px;
}

p {
  margin: 8px 0;
  line-height: 1.45;
}

.hero-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  text-decoration: none;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.button:hover,
.choice-btn:hover,
.tile-btn:hover,
.letter-btn:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
}

.button:focus-visible,
.choice-btn:focus-visible,
.tile-btn:focus-visible,
.letter-btn:focus-visible,
.world-card:focus-visible {
  outline: 3px solid #ffb347;
  outline-offset: 2px;
}

.button:active,
.choice-btn:active,
.tile-btn:active,
.letter-btn:active {
  transform: scale(0.98);
}

.button.primary {
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  color: #fff;
}

.button.ghost {
  background: #eef2ff;
  color: #29348f;
}

.button.secondary {
  background: #fff5e8;
  color: #914f00;
}

.button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.15);
}

.activity-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.compact-activity-nav {
  margin-top: 10px;
}

.activity-jump-nav .jump-link {
  flex: 0 0 auto;
}

.jump-link {
  min-height: 44px;
}

.jump-link.active {
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  color: #fff;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.feature-card {
  padding: 14px;
  border: 2px solid #e8ecff;
}

.panel {
  padding: 16px;
  border: 2px solid #dbe6ff;
}

.category-banner {
  border-width: 2px;
  padding: 12px 16px;
}

.category-banner h2 {
  margin: 2px 0 6px;
}

.category-banner p {
  margin: 0;
  font-weight: 600;
  color: #30416b;
}

.learn-banner {
  background: linear-gradient(120deg, #eef8ff, #f4fff8);
  border-color: #bfe2ff;
}

.practice-banner {
  background: linear-gradient(120deg, #fff5ec, #fff9ef);
  border-color: #ffd9b5;
}

.privacy-note {
  font-size: 0.95rem;
  background: #edf8ff;
  border: 1px solid #bee5ff;
  border-radius: 14px;
  padding: 10px 12px;
}

.lesson-strip {
  margin: 10px 0 14px;
  border: 2px solid #d5e3ff;
  background: linear-gradient(180deg, #f3f8ff, #ffffff);
  border-radius: 12px;
  padding: 8px 12px;
}

.lesson-strip .button {
  margin-top: 8px;
}

.lesson-strip .button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.forest-scene {
  background: linear-gradient(180deg, #eafff3 0%, #f7fffb 45%, #fffef2 100%);
}

.magical-tree-stage {
  position: relative;
  height: clamp(300px, 36vw, 410px);
  margin-top: 12px;
  border-radius: 18px;
  border: 2px solid #b8e8cb;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.magical-tree-art {
  width: 100%;
  height: 100%;
  display: block;
}

.tree-ground {
  fill: rgba(149, 224, 177, 0.54);
}

.tree-canopy circle {
  fill: #5dbd84;
  opacity: 0.95;
}

.tree-canopy.cluster-a {
  transform-origin: 50% 40%;
  animation: canopySway 7.2s ease-in-out infinite;
}

.tree-trunk-shade {
  fill: rgba(38, 22, 10, 0.3);
}

.tree-branches .branch {
  fill: none;
  stroke: #5f3c20;
  stroke-width: 15;
  stroke-linecap: round;
  transform-origin: 55% 48%;
}

.tree-branches .b1 { animation: branchSwayA 5.4s ease-in-out infinite; }
.tree-branches .b2 { animation: branchSwayB 6.1s ease-in-out infinite; }
.tree-branches .b3 { animation: branchSwayA 5.8s ease-in-out infinite reverse; }
.tree-branches .b4 { animation: branchSwayB 6.6s ease-in-out infinite reverse; }
.tree-branches .b5 { animation: branchSwayA 4.9s ease-in-out infinite; }

.tree-flowers .tree-flower {
  transform-origin: center;
  animation: blossomPulse 3.2s ease-in-out infinite;
  opacity: 0.32;
}

.tree-flowers .petal {
  fill: #ff7fbc;
  filter: drop-shadow(0 0 6px rgba(255, 120, 188, 0.35));
}

.tree-flowers .center {
  fill: #ffe48f;
}

.tree-flowers .f2 { animation-delay: -0.4s; }
.tree-flowers .f3 { animation-delay: -1.1s; }
.tree-flowers .f4 { animation-delay: -1.8s; }
.tree-flowers .f5 { animation-delay: -2.3s; }
.tree-flowers .f6 { animation-delay: -2.8s; }

.tree-fruits .fruit {
  fill: #ffb55c;
  stroke: #e88929;
  stroke-width: 2;
  transform-origin: center;
  animation: branchSwayA 5.8s ease-in-out infinite;
  opacity: 0.28;
}

.tree-fruits .leaf {
  fill: #56b768;
}

.tree-perch path {
  fill: none;
  stroke: #5a3518;
  stroke-width: 9;
  stroke-linecap: round;
}

.tree-perch circle {
  fill: #6e4321;
}

.tree-ornament-guides .ornament-guide {
  fill: rgba(255, 255, 255, 0);
  stroke: rgba(254, 203, 98, 0.3);
  stroke-width: 1.2;
}

.tree-particles,
.tree-progress-blooms,
.magical-tree-grid,
.tree-lottie,
.letter-spotlight,
.tree-mithu {
  position: absolute;
  inset: 0;
}

.tree-particles {
  pointer-events: none;
  display: none;
}

.tree-particle {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(129, 222, 240, 0.4));
  animation: sparkleDrift 8s linear infinite;
}

.tree-progress-blooms {
  pointer-events: none;
}

.progress-bloom {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 34%, #ffe6f4, #ff78b8 72%);
  box-shadow: 0 0 0 10px rgba(255, 205, 230, 0.36);
  transform: scale(0);
}

.progress-star {
  position: absolute;
  color: #ffd866;
  font-size: 1.1rem;
  text-shadow: 0 0 10px rgba(255, 212, 73, 0.8);
  transform: scale(0);
}

.tree-lottie {
  pointer-events: none;
}

.tree-lottie-sparkle {
  display: none;
}

.tree-lottie-celebration {
  display: none;
}

.magical-tree-grid {
  inset: 10px;
  pointer-events: none;
}

.tree-letter-btn {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 78px;
  height: 78px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  font-family: "Noto Sans Devanagari", "Mangal", "Nirmala UI", "Kohinoor Devanagari", "Segoe UI", sans-serif;
  display: grid;
  place-items: center;
  padding: 0;
  pointer-events: auto;
  z-index: 2;
  animation: treeLetterGlow 3s ease-in-out infinite;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.tree-ornament {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.tree-petal-ring,
.tree-fruit-body {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  transition: transform 0.45s ease, opacity 0.42s ease, filter 0.42s ease, background 0.42s ease;
}

.tree-petal-ring {
  background:
    radial-gradient(circle at 50% 16%, #ffd2e9 0 22%, transparent 24%),
    radial-gradient(circle at 82% 36%, #ff9fd2 0 23%, transparent 25%),
    radial-gradient(circle at 72% 74%, #ff8fc6 0 23%, transparent 25%),
    radial-gradient(circle at 28% 74%, #ff8fc6 0 23%, transparent 25%),
    radial-gradient(circle at 18% 36%, #ff9fd2 0 23%, transparent 25%),
    radial-gradient(circle at 50% 50%, #ffe9a8 0 28%, #ffd878 30%, #ffc358 55%, transparent 57%);
  filter: drop-shadow(0 6px 10px rgba(197, 89, 138, 0.28));
}

.tree-fruit-body {
  inset: 10px;
  background: radial-gradient(circle at 34% 28%, #fff7dd, #ffbf4f 60%, #eb8f2a 100%);
  box-shadow: inset 0 -2px 0 rgba(163, 78, 17, 0.35), 0 6px 10px rgba(140, 77, 27, 0.24);
  transform: scale(0.54);
  opacity: 0;
}

.tree-fruit-body::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 8px;
  border-radius: 10px;
  right: 9px;
  top: -3px;
  background: linear-gradient(120deg, #74cc76, #4ea85d);
  transform: rotate(-18deg);
}

.tree-letter-btn .tree-dev {
  position: relative;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.1;
  color: #2b2361;
  text-shadow: 0 1px 4px rgba(255, 255, 255, 0.5), 0 0 10px rgba(108, 115, 255, 0.3);
  z-index: 2;
}

.tree-letter-btn:hover {
  transform: translate(-50%, -50%) scale(1.04);
}

.tree-letter-btn:focus-visible {
  outline: 3px solid #4d7dff;
  outline-offset: 2px;
}

.tree-letter-btn.discovered {
  animation: none;
}

.tree-letter-btn.tree-active {
  transform: translate(-50%, -50%) scale(1.07);
  filter: drop-shadow(0 0 12px rgba(154, 117, 255, 0.38));
  z-index: 12;
}

.tree-letter-btn.discovered .tree-petal-ring {
  transform: scale(0.4);
  opacity: 0;
}

.tree-letter-btn.discovered .tree-fruit-body {
  transform: scale(1);
  opacity: 1;
}

.tree-letter-btn.just-picked .tree-petal-ring {
  transform: scale(1.18);
}

.tree-letter-btn.just-picked .tree-fruit-body {
  transform: scale(1.12);
}

.tree-letter-btn.discovered .tree-dev {
  color: #4b2a0c;
  text-shadow: 0 1px 4px rgba(255, 255, 255, 0.44);
}

.letter-spotlight {
  pointer-events: none;
  display: grid;
  align-content: end;
  justify-items: center;
  padding-bottom: 14px;
  z-index: 10;
  opacity: 0;
}

.letter-spotlight::before {
  display: none;
}

.spotlight-letter-dev,
.spotlight-letter-tran,
.spotlight-letter-example {
  position: relative;
  margin: 0;
  text-align: center;
}

.spotlight-letter-dev {
  font-size: 1.9rem;
  font-weight: 800;
  color: #3f2f98;
  line-height: 1;
  margin-top: 6px;
}

.spotlight-letter-tran {
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #4b5290;
}

.spotlight-letter-example {
  margin-top: 6px;
  font-size: 0.86rem;
  color: #2f3a6d;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d3deff;
  padding: 3px 10px;
  border-radius: 10px;
}

.letter-spotlight p {
  width: fit-content;
  min-width: 188px;
  text-align: center;
}

.letter-spotlight {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(235, 247, 255, 0.58));
}

.tree-mithu {
  width: 64px;
  height: 64px;
  inset: auto;
  left: 80%;
  top: 62%;
  pointer-events: none;
  z-index: 6;
  will-change: transform, left, top;
}

.tree-mithu-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 14px rgba(34, 65, 44, 0.24));
}

.mini-cursor-mithu {
  position: fixed;
  left: 0;
  top: 0;
  width: 42px;
  height: 42px;
  pointer-events: none;
  z-index: 2147483000;
  opacity: 0;
  transition: opacity 0.18s ease;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 8px 14px rgba(33, 48, 102, 0.26));
  will-change: transform, left, top;
}

.mini-cursor-mithu.visible {
  opacity: 1;
}

.mini-cursor-mithu-svg {
  width: 100%;
  height: 100%;
}

.mini-cursor-mithu .mithu-wing-left,
.mini-cursor-mithu .mithu-wing-right {
  transform-origin: 50% 42%;
  animation: mithuWingFlap 0.56s ease-in-out infinite;
}

.mini-cursor-mithu.is-moving .mithu-wing-left,
.mini-cursor-mithu.is-moving .mithu-wing-right {
  animation-duration: 0.42s;
}

.mini-cursor-mithu .mithu-body {
  animation: miniMithuRest 2.2s ease-in-out infinite;
}

.mini-cursor-mithu.is-moving .mithu-body {
  animation-duration: 1.35s;
}

.top-lock-guide {
  border-color: #f0d6ff;
  background: linear-gradient(180deg, #fffaff, #f8f5ff);
  padding: 12px 14px;
}

.top-lock-guide-layout {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: start;
}

.top-lock-guide-mithu {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e9fff2, #dcf0ff);
  border: 1px solid #b8dff0;
  padding: 2px;
}

.top-lock-guide-mithu-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 10px rgba(57, 74, 132, 0.2));
}

.top-lock-guide-message {
  margin: 0;
  font-weight: 700;
  color: #394479;
}

.about-mithu-guide {
  display: grid;
  grid-template-columns: minmax(118px, 140px) 1fr;
  gap: 14px;
  align-items: start;
}

.about-mithu-guide-art {
  width: 100%;
  max-width: 132px;
  background: linear-gradient(150deg, #edf9ff, #f6fff3);
  border: 1px solid #cde8f7;
  border-radius: 16px;
  padding: 8px;
}

.about-mithu-guide .mithu-svg {
  width: 100%;
  height: auto;
}

.about-mithu-guide-list {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
}

.tree-mithu.listening .mithu-body {
  animation: treeMithuListen 0.82s ease-in-out infinite;
}

.tree-mithu.following .mithu-wing-left,
.tree-mithu.following .mithu-wing-right {
  transform-origin: 50% 42%;
  animation: mithuWingFlap 0.46s ease-in-out infinite;
}

.tree-mithu.pointing .mithu-wing-right {
  animation: treeMithuPoint 0.7s ease-in-out 2;
}

.tree-mithu.hovering .mithu-body {
  animation: treeMithuHover 0.8s ease-in-out infinite;
}

.tree-mithu.celebrating .mithu-body {
  animation: treeMithuCelebrate 0.9s ease-in-out 2;
}

.tree-mithu.dancing .mithu-body {
  animation: treeMithuDance 1.1s ease-in-out infinite;
}

.tree-instruction {
  font-weight: 800;
  color: #2c3f6f;
}

.tree-actions {
  align-items: center;
  justify-content: space-between;
}

#treeCompletionActions {
  margin-top: 8px;
}

.group-bloom {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffeaf6, #ff82c2 70%);
  box-shadow: 0 0 0 8px rgba(255, 205, 230, 0.3);
  animation: bloomPop 0.95s ease-out forwards;
}

.writing-card {
  max-width: 620px;
  margin: 0 auto;
  border: 1px solid #dbe6ff;
  border-radius: 14px;
  background: #f8fbff;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.trace-work-area {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.trace-target {
  display: grid;
  place-items: center;
  min-height: 170px;
  border: 2px solid #d8e2ff;
  border-radius: 12px;
  background: #f7faff;
}

#traceTargetLetter {
  font-size: 2.8rem;
  font-weight: 800;
  color: #4a33c6;
  font-family: "Noto Sans Devanagari", "Mangal", "Nirmala UI", "Kohinoor Devanagari", "Segoe UI", sans-serif;
}

#traceCanvas {
  width: 100%;
  border: 2px dashed #abc3ff;
  border-radius: 14px;
  background: #ffffff;
  touch-action: none;
  min-height: 170px;
}

.trace-canvas-wrap {
  min-width: 0;
}

.trace-self-check {
  padding: 6px 2px 0;
  display: grid;
  gap: 8px;
}

.trace-flower-burst {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #ff6fba;
  text-shadow: 0 0 6px rgba(255, 149, 205, 0.7);
  pointer-events: none;
  z-index: 12;
  animation: traceFlowerBurst 1s ease-out forwards;
}

.trace-flower-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#activityTraceGamePanel .activity {
  position: relative;
  overflow: hidden;
}

.category-tab.active {
  border: 2px solid #6f86ff;
}

#consonantSubgroupTabs .button.active {
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  color: #fff;
}

.forest-layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) 1fr;
  gap: 14px;
}

[data-activity-id] {
  scroll-margin-top: 88px;
}

.activity-local-controls {
  margin-top: 10px;
  border-top: 1px solid #dbe6ff;
  padding-top: 10px;
}

.activity-local-controls .hero-actions {
  margin-top: 8px;
}

.activity-progress {
  color: #3a497a;
  font-weight: 700;
  margin: 0;
}

.activity-complete-note {
  color: #1a7b42;
  font-weight: 800;
  margin: 8px 0 0;
}

.section-warning {
  color: #7d2a2a;
  font-weight: 700;
}

#celebration-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

.flying-fruit {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  width: 42px;
  height: 42px;
  object-fit: contain;
  transform: translate(-50%, -50%);
}

.mascot-rail .lesson-mascot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  z-index: 4;
  pointer-events: auto;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
}

.mascot-rail .lesson-mascot.is-journey-guide {
  box-shadow: 0 14px 26px rgba(51, 88, 156, 0.2);
}

.lesson-mascot-mobile {
  position: static;
  width: min(100%, 360px);
  max-width: 100%;
  margin: 8px auto 0;
}

.mithu-eye-left,
.mithu-eye-right {
  transform-origin: center;
  animation: mithuBlink 4.8s infinite;
}

.state-welcome .mithu-body,
.state-wave .mithu-body,
.state-idle .mithu-body {
  animation: mithuFloat 2.6s ease-in-out infinite, mithuBreath 2.6s ease-in-out infinite;
}

.state-welcome .mithu-wing-left,
.state-wave .mithu-wing-left,
.state-idle .mithu-wing-left {
  transform-origin: 72% 36%;
  animation: mithuWingFlapLeft 0.95s ease-in-out infinite;
}

.state-welcome .mithu-wing-right,
.state-wave .mithu-wing-right,
.state-idle .mithu-wing-right {
  transform-origin: 28% 36%;
  animation: mithuWingFlapRight 0.95s ease-in-out infinite;
}

.state-flying .mithu-body {
  animation: mithuFly 0.7s ease-in-out 1;
}

.state-listening .mithu-body {
  animation: mithuListen 0.72s ease-in-out infinite;
}

.state-pointing .mithu-wing-right {
  animation: treeMithuPoint 0.7s ease-in-out 2;
}

.state-thinking .mithu-body {
  animation: mithuThink 0.8s ease-in-out 2;
}

.state-eating .mithu-beak-top,
.state-eating .mithu-beak-bottom {
  animation: mithuEat 0.32s ease-in-out 3;
}

.state-encouraging .mithu-body {
  animation: mithuEncourage 0.52s ease-in-out 2;
}

.state-celebrating .mithu-body {
  animation: treeMithuCelebrate 0.8s ease-in-out infinite;
}

.state-celebrating .mithu-wing-left,
.state-celebrating .mithu-wing-right {
  animation: mithuWingFlap 0.24s ease-in-out infinite;
}

.state-dancing .mithu-body {
  animation: treeMithuDance 1s ease-in-out infinite;
}

.state-dancing .mithu-wing-left {
  transform-origin: 72% 36%;
  animation: mithuWingFlapLeft 0.32s ease-in-out infinite;
}

.state-dancing .mithu-wing-right {
  transform-origin: 28% 36%;
  animation: mithuWingFlapRight 0.32s ease-in-out infinite;
}

@keyframes mithuFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes mithuBreath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes mithuFly {
  0% { transform: translateX(-20px) scale(0.95); opacity: 0.75; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes mithuListen {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg); }
}

@keyframes mithuThink {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes mithuEat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2px); }
}

@keyframes mithuEncourage {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px) scale(1.02); }
}

@keyframes mithuDance {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-6px) rotate(4deg); }
  50% { transform: translateY(0) rotate(-4deg); }
  75% { transform: translateY(-5px) rotate(3deg); }
}

@keyframes mithuWingFlap {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(12deg); }
}

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

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

@keyframes cursorMithuWing {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(16deg); }
}

@keyframes miniMithuRest {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes mithuBlink {
  0%, 44%, 48%, 100% { transform: scaleY(1); }
  46% { transform: scaleY(0.08); }
}

body.audio-disabled .audio-control {
  display: none !important;
}

.letter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
}

.letter-btn {
  border: 2px solid #d9defa;
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  padding: 6px 4px;
  min-height: 68px;
  font-size: 1rem;
  font-weight: 800;
  position: relative;
  font-family: "Noto Sans Devanagari", "Mangal", "Nirmala UI", "Kohinoor Devanagari", "Segoe UI", sans-serif;
}

.letter-btn .dev {
  display: block;
  font-size: 1.45rem;
  color: #2b2361;
  line-height: 1.15;
  position: relative;
  z-index: 2;
}

.letter-btn .tran {
  display: block;
  font-size: 0.72rem;
  color: #4f5a85;
  line-height: 1.1;
  position: relative;
  z-index: 2;
}

.tile-star {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.78rem;
  line-height: 1;
  opacity: 0.7;
}

.letter-btn.learned .tile-star {
  opacity: 1;
}

.letter-btn.active {
  background: linear-gradient(180deg, #ecf1ff, #fff4f8);
  border-color: #6483ff;
  box-shadow: 0 6px 14px rgba(76, 99, 210, 0.2);
}

.selected-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: #3d4a72;
}

.learned-badge {
  font-weight: 700;
  color: #5a678f;
}

.learned-badge.learned {
  color: #7a5a00;
}

.letter-detail {
  background: #f5f8ff;
  border: 1px solid #dbe6ff;
  border-radius: 14px;
  padding: 12px;
}

.big-dev {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  margin: 0;
}

.fallback {
  color: var(--warn);
  font-weight: 700;
}

.activity {
  border: 2px solid #e8ecff;
  border-radius: 16px;
  padding: 12px;
  margin-top: 10px;
}

.activity h3 {
  margin-top: 0;
}

.choices,
.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-btn,
.tile-btn {
  border: 2px solid #d9defa;
  border-radius: 12px;
  background: #fff;
  min-height: 46px;
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
}

.choice-btn.correct,
.tile-btn.correct {
  border-color: #25aa66;
  background: #ecfff5;
}

.choice-btn.wrong,
.tile-btn.wrong {
  border-color: #d75f5f;
  background: #fff0f0;
}

.status {
  min-height: 24px;
  font-weight: 700;
}

.flashcard {
  margin: 10px 0;
  border: 2px dashed #b8c7ff;
  border-radius: 16px;
  min-height: 170px;
  padding: 12px;
  display: grid;
  place-items: center;
  text-align: center;
  background: linear-gradient(180deg, #fdf9ff, #eef4ff);
  cursor: pointer;
  perspective: 900px;
}

.flashcard.flip {
  border-style: solid;
}

.flashcard .flash-face {
  width: 100%;
  max-width: 280px;
}

.flashcard .flash-back .picture-illustration {
  margin: 6px auto 0;
  max-width: 180px;
}

.flashcard.flip.is-flipped .flash-front {
  animation: flashFlipOut 0.35s ease forwards;
}

.flashcard.flip.is-flipped .flash-back {
  animation: flashFlipIn 0.35s ease forwards;
}

.flashcard .flash-tran {
  margin: 6px 0 0;
  font-weight: 700;
  color: #4a567f;
}

.flash-dev {
  font-size: 2.3rem;
  margin: 0;
  font-weight: 800;
}

@keyframes flashFlipIn {
  from { transform: rotateY(90deg); opacity: 0; }
  to { transform: rotateY(0deg); opacity: 1; }
}

@keyframes flashFlipOut {
  from { transform: rotateY(0deg); opacity: 1; }
  to { transform: rotateY(-90deg); opacity: 0; }
}

.star-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff9d8;
  color: #7d5a00;
  border: 1px solid #f1dd88;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
}

.gem-reward-fly {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  font-size: 1.35rem;
  filter: drop-shadow(0 3px 5px rgba(72, 48, 140, 0.25));
  will-change: transform, opacity;
}

.progress-meter {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #ecedfa;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(120deg, #37c96f, #95de4f);
  transition: width 0.35s ease;
}

.progress-compact {
  display: grid;
  gap: 6px;
}

.progress-compact p {
  margin: 0;
  font-size: 0.95rem;
}

.next-world-status {
  font-weight: 800;
  color: #8a5a00;
}

.review-list li {
  margin-bottom: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: #fff;
}

th,
td {
  border: 1px solid #dbe6ff;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f2f6ff;
}

.done-banner {
  display: none;
  padding: 12px;
  border-radius: 14px;
  background: #ebfff3;
  border: 1px solid #88d8a9;
  color: #10673b;
  font-weight: 800;
}

.done-banner.show {
  display: block;
}

#nextAdventureBtn {
  margin-left: 10px;
}

.completion-screen {
  display: none;
  text-align: center;
  border: 2px solid #9fd7b2;
  background: linear-gradient(180deg, #f2fff7, #f8fbff);
}

.completion-screen.show {
  display: block;
}

.compact-next-adventure {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  padding: 1rem;
}

.completion-lottie {
  width: 240px;
  height: 200px;
  margin: 6px auto 8px;
}

.magic-door {
  margin: 8px auto 0;
  width: 130px;
  position: relative;
}

.door-frame {
  width: 78px;
  height: 102px;
  margin: 0 auto;
  border-radius: 42px 42px 12px 12px;
  background: linear-gradient(180deg, #8152ff, #5a30cc);
  padding: 8px;
  box-shadow: 0 8px 20px rgba(79, 43, 172, 0.28);
}

.door-inner {
  width: 100%;
  height: 100%;
  border-radius: 34px 34px 8px 8px;
  background: radial-gradient(circle at 50% 20%, #d9f4ff, #7ec2ff 62%, #5f94f5);
}

.door-spark {
  position: absolute;
  font-size: 1.05rem;
  color: #6d59ff;
  text-shadow: 0 0 8px rgba(99, 83, 255, 0.35);
}

.door-spark.s1 { left: 6px; top: 8px; animation: sparkle 3.2s ease-in-out infinite; }
.door-spark.s2 { right: 8px; top: 18px; animation: sparkle 3.2s ease-in-out infinite -0.8s; }
.door-spark.s3 { right: 20px; top: 82px; animation: sparkle 3.2s ease-in-out infinite -1.4s; }

.footer-note {
  color: #354178;
  font-size: 0.92rem;
}

.applause-burst {
  position: fixed;
  left: 50%;
  top: 30%;
  transform: translate(-50%, -50%) scale(0.5);
  opacity: 0;
  font-size: 2.1rem;
  pointer-events: none;
  z-index: 30;
}

.applause-burst::before {
  content: "👏 ⭐ 🎉";
}

.applause-burst.show {
  animation: burst 0.85s ease-out forwards;
}

.home-adventure {
  gap: 18px;
}

.magic-hero {
  overflow: hidden;
  position: relative;
  background: linear-gradient(180deg, #f6fbff 0%, #fef6ff 45%, #fffef2 100%);
}

.sky-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cloud {
  position: absolute;
  display: block;
  width: 130px;
  height: 50px;
  background: #fff;
  border-radius: 80px;
  opacity: 0.8;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}

.cloud::before {
  width: 48px;
  height: 48px;
  left: 18px;
  top: -18px;
}

.cloud::after {
  width: 38px;
  height: 38px;
  right: 16px;
  top: -12px;
}

.cloud-a {
  top: 16px;
  left: 5%;
  animation: cloudDrift 12s linear infinite;
}

.cloud-b {
  top: 58px;
  right: 6%;
  animation: cloudDrift 16s linear infinite reverse;
}

.rainbow {
  position: absolute;
  width: 240px;
  height: 130px;
  border-radius: 180px 180px 0 0;
  border: 12px solid #ff7ec8;
  border-bottom: 0;
  right: 8%;
  top: 80px;
  opacity: 0.35;
  box-shadow: 0 -10px 0 #ffd166, 0 -20px 0 #72ddf7, 0 -30px 0 #8ce99a;
}

.butterfly,
.spark {
  position: absolute;
  font-weight: 800;
}

.butterfly {
  font-size: 1.2rem;
  animation: flutter 5.2s ease-in-out infinite;
}

.b-one { top: 42%; left: 11%; }
.b-two { top: 30%; left: 43%; animation-delay: -1.2s; }
.b-three { top: 38%; right: 22%; animation-delay: -2.1s; }

.spark {
  color: #6a3fff;
  font-size: 1.4rem;
  text-shadow: 0 0 12px rgba(131, 70, 255, 0.35);
  animation: sparkle 3.2s ease-in-out infinite;
}

.s1 { left: 22%; top: 16%; }
.s2 { left: 57%; top: 20%; animation-delay: -0.7s; }
.s3 { left: 36%; top: 48%; animation-delay: -1.4s; }
.s4 { left: 73%; top: 44%; animation-delay: -2.1s; }

.hero-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(200px, 290px) 1fr;
  gap: 16px;
  align-items: center;
}

.parrot-mascot {
  background: linear-gradient(180deg, #e8fff0, #d8f4ff);
  border: 2px solid #9ddfc3;
  border-radius: 18px;
  padding: 12px;
  position: relative;
}

.lesson-mascot-floating {
  position: fixed;
  top: 92px;
  right: max(10px, calc((100vw - min(var(--page-max-width), 96vw)) / 2 + 8px));
  width: min(240px, 34vw);
  z-index: 26;
  box-shadow: 0 12px 28px rgba(33, 79, 152, 0.24);
  transition: top 0.35s ease, transform 0.2s ease;
}

.tap-audio {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: rgba(90, 85, 225, 0.55);
}

.example-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.example-art {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255, 206, 93, 0.22);
  font-size: 1.2rem;
}

.mithu-svg {
  display: block;
  width: 170px;
  height: 170px;
  margin: 0 auto;
}

.mithu-shadow {
  fill: rgba(20, 40, 80, 0.2);
}

.mithu-body {
  fill: #1f8fff;
}

.mithu-belly {
  fill: #d8f2ff;
}

.mithu-tail {
  fill: #0b57c8;
}

.mithu-wing-left,
.mithu-wing-right {
  fill: #1273e6;
}

.mithu-eye-left,
.mithu-eye-right {
  fill: #16254f;
}

.mithu-beak-top {
  fill: #ff9d34;
}

.mithu-beak-bottom {
  fill: #f08217;
}

.mithu-leg-left,
.mithu-leg-right {
  fill: #f4a22d;
}

.mithu-crest {
  stroke: #ff3b5f;
  stroke-width: 7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mascot-speech {
  position: relative;
  background: linear-gradient(145deg, #fffdf3, #eef6ff 58%, #f8f1ff);
  border: 2px solid #d8e5ff;
  border-radius: 16px;
  margin: 10px 0 0;
  padding: 12px 12px 10px;
  font-weight: 700;
  min-height: 56px;
  line-height: 1.38;
  font-size: 0.95rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  box-shadow: 0 10px 20px rgba(84, 103, 181, 0.18);
  transform-origin: 16% 20%;
  transition: background 0.24s ease, border-color 0.24s ease, transform 0.2s ease, box-shadow 0.24s ease;
}

.mascot-speech::before {
  content: "";
  position: absolute;
}

.mascot-speech[data-label]:not([data-label=""])::before {
  content: attr(data-label);
  top: -10px;
  left: 12px;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  color: #3c4b87;
  background: #f0f5ff;
  border: 1px solid #ccdafb;
  text-transform: uppercase;
}

.mascot-speech::after {
  content: "";
  position: absolute;
  right: auto;
  bottom: auto;
}

.mascot-speech.tone-instruction {
  background: linear-gradient(145deg, #fffdf3, #eef6ff 58%, #f8f1ff);
  border-color: #d8e5ff;
}

.mascot-speech.tone-encourage {
  background: linear-gradient(145deg, #fff8f0, #fff2fb 62%, #eef7ff);
  border-color: #ffd7e8;
}

.mascot-speech.tone-correct {
  background: linear-gradient(145deg, #f3fff6, #e8fff8 62%, #eef8ff);
  border-color: #bce9c9;
}

.mascot-speech.tone-complete {
  background: linear-gradient(145deg, #fff8dc, #fff1cf 50%, #ffe8f8);
  border-color: #f3d17f;
}

.mascot-speech.tone-world {
  background: linear-gradient(145deg, #f6edff, #e7eeff 52%, #e7fff5);
  border-color: #c9b8ff;
}

.mascot-invite {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mascot-invite .button {
  white-space: nowrap;
  line-height: 1.1;
  padding-inline: 14px;
  min-height: 42px;
  font-size: clamp(0.84rem, 2.4vw, 0.96rem);
}

@keyframes flowerRainFall {
  0% { transform: translate3d(0, -8px, 0) rotate(0deg); opacity: 0; }
  8% { opacity: 0.95; }
  100% { transform: translate3d(var(--flower-rain-x, 0px), var(--flower-rain-y, 240px), 0) rotate(var(--flower-rain-rot, 130deg)); opacity: 0; }
}

.flower-rain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9500;
}

.flower-rain-petal {
  position: absolute;
  width: 12px;
  height: 16px;
  border-radius: 70% 40% 72% 44%;
  background: linear-gradient(145deg, #ff9ccc, #ffd2e9);
  filter: drop-shadow(0 1px 2px rgba(61, 33, 98, 0.18));
  animation: flowerRainFall linear forwards;
}
.parrot-mascot.state-wave .mithu-wing-left,
.parrot-mascot.state-waving .mithu-wing-left {
  transform-origin: 72% 36%;
  animation: mithuWingFlapLeft 0.95s ease-in-out infinite;
}

.parrot-mascot.state-wave .mithu-wing-right,
.parrot-mascot.state-waving .mithu-wing-right {
  transform-origin: 28% 36%;
  animation: mithuWingFlapRight 0.95s ease-in-out infinite;
}

.parrot-mascot.state-celebrate .mithu-body,
.parrot-mascot.state-celebrating .mithu-body {
  animation: bounceHappy 0.9s ease-in-out infinite;
}

.parrot-mascot.state-dance .mithu-body,
.parrot-mascot.state-dancing .mithu-body {
  animation: dance 0.76s ease-in-out infinite;
}

.big-action {
  min-width: 180px;
  justify-content: center;
}

.button.challenge {
  background: linear-gradient(120deg, #ff9347, #ff6b6b);
  color: #fff;
}

.world-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.world-card {
  border: 2px solid #d5dfff;
  border-radius: 18px;
  background: #fff;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 4px;
  min-height: 140px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.world-card:hover,
.world-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 22px rgba(75, 88, 166, 0.2);
  border-color: #7e93ff;
}

.world-card:active {
  transform: translateY(0);
}

.world-card.locked {
  opacity: 0.82;
  filter: saturate(0.75);
  border-color: #d9def3;
}

.world-lock-note {
  font-size: 0.78rem;
  color: #5d6285;
  line-height: 1.25;
}

.world-icon {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: inline-block;
  background: linear-gradient(150deg, #dce9ff, #f7fbff);
  position: relative;
  overflow: hidden;
  border: 1px solid #c9d8ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.world-icon.world-photo {
  background: #ffffff;
  border: 1px solid #cfe0ff;
  box-shadow: 0 6px 12px rgba(88, 111, 198, 0.18);
}

.world-icon.world-photo::before,
.world-icon.world-photo::after {
  display: none;
}

.world-icon.world-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}

.world-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(189, 232, 255, 0.95), rgba(168, 219, 193, 0.9) 62%, rgba(134, 204, 152, 0.95));
}

.world-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 7px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(89, 160, 99, 0.92), rgba(51, 125, 76, 0.95));
}

.world-icon i {
  position: absolute;
  z-index: 2;
  display: block;
  border-radius: 999px;
}

.world-icon i:nth-child(1) {
  width: 24px;
  height: 24px;
  left: 12px;
  bottom: 14px;
  background: #49ad64;
}

.world-icon i:nth-child(2) {
  width: 30px;
  height: 30px;
  right: 12px;
  bottom: 14px;
  background: #5bbb6f;
}

.world-icon i:nth-child(3) {
  width: 8px;
  height: 8px;
  left: 31px;
  top: 14px;
  background: #fff6a2;
  box-shadow: 0 0 10px rgba(255, 239, 146, 0.8);
}

.world-icon.forest i:nth-child(3) { animation: iconTwinkle 2.8s ease-in-out infinite; }
.world-icon.jungle i:nth-child(1),
.world-icon.jungle i:nth-child(2) { animation: iconSway 3.2s ease-in-out infinite; }
.world-icon.galaxy::before { background: linear-gradient(180deg, #cdd5ff, #9fafee 55%, #7d86d8); }
.world-icon.galaxy i:nth-child(1) { background: #9ec0ff; }
.world-icon.galaxy i:nth-child(2) { background: #7f95e0; }
.world-icon.galaxy i:nth-child(3) { animation: iconTwinkle 2.1s ease-in-out infinite; }
.world-icon.colour::before { background: linear-gradient(180deg, #ffd8f1, #ffc0d0 56%, #ffca84); }
.world-icon.word::before { background: linear-gradient(180deg, #d8f1ff, #b7d8ff 56%, #8ab6ff); }
.world-icon.sentence::before { background: linear-gradient(180deg, #e4e7ff, #cdd0ff 56%, #aab0f4); }
.world-icon.story::before { background: linear-gradient(180deg, #d5fbff, #b7ecf6 56%, #86d1e0); }
.world-icon.culture::before { background: linear-gradient(180deg, #ffe8cf, #ffd49d 56%, #f7b77b); }
.world-icon.word i:nth-child(3),
.world-icon.sentence i:nth-child(3),
.world-icon.story i:nth-child(3),
.world-icon.culture i:nth-child(3) { animation: iconTwinkle 3.1s ease-in-out infinite; }

.lottie-butterfly {
  position: absolute;
  width: 70px;
  height: 70px;
}

.lottie-spark {
  position: absolute;
  width: 50px;
  height: 50px;
}

.home-celebration-lottie {
  position: fixed;
  inset: auto 18px 18px auto;
  width: 150px;
  height: 150px;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
}

.home-celebration-lottie.show {
  opacity: 1;
}

.letter-btn.learned {
  background: linear-gradient(180deg, #f1fff5, #fffdf4);
  border-color: #8fd0a9;
  box-shadow: 0 6px 12px rgba(83, 178, 118, 0.2);
}

.letter-btn.just-learned {
  animation: letterBloom 0.62s ease-out 1;
}

.world-title {
  font-weight: 800;
  font-size: 1.05rem;
}

.world-text {
  font-size: 0.9rem;
  color: #3f4a84;
}

.world-alphabet { background: linear-gradient(180deg, #ecfff5, #ffffff); }
.world-jungle { background: linear-gradient(180deg, #f1ffe8, #ffffff); }
.world-galaxy { background: linear-gradient(180deg, #eef0ff, #ffffff); }
.world-colour { background: linear-gradient(180deg, #fff0ff, #ffffff); }
.world-word { background: linear-gradient(180deg, #fff8ed, #ffffff); }
.world-sentence { background: linear-gradient(180deg, #f2f7ff, #ffffff); }
.world-story { background: linear-gradient(180deg, #eefcff, #ffffff); }
.world-culture { background: linear-gradient(180deg, #fff4e8, #ffffff); }

.world-illustration {
  position: relative;
  margin: 10px 0 14px;
  border: 2px solid #d6e4ff;
  border-radius: 16px;
  overflow: hidden;
  min-height: 170px;
  background: #f4f8ff;
}

.world-illustration--numbers {
  background: radial-gradient(circle at 18% 20%, #2f3f8f 0%, #1d275f 42%, #101733 100%);
  border-color: #7489ff;
}

.world-illustration--numbers .world-clouds,
.world-illustration--numbers .world-castle {
  opacity: 0;
}

.world-illustration--numbers .world-sparkles circle {
  fill: #d7e2ff;
}

.number-galaxy-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.number-galaxy-planet {
  position: absolute;
  border-radius: 50%;
  box-shadow: inset 0 -8px 22px rgba(12, 23, 63, 0.35), 0 0 24px rgba(150, 185, 255, 0.4);
  animation: planetDrift 16s ease-in-out infinite;
}

.number-galaxy-planet.planet-a {
  width: 90px;
  height: 90px;
  left: 14%;
  top: 30%;
  background: radial-gradient(circle at 32% 28%, #f6e39b, #f2ac4f 68%, #bf6e2d);
}

.number-galaxy-planet.planet-b {
  width: 118px;
  height: 118px;
  right: 17%;
  top: 18%;
  background: radial-gradient(circle at 36% 31%, #bde9ff, #6c8bff 62%, #2f4cb6);
  animation-delay: -5s;
}

.number-galaxy-planet.planet-c {
  width: 70px;
  height: 70px;
  left: 44%;
  bottom: 20%;
  background: radial-gradient(circle at 36% 31%, #c3ffc8, #74d89e 62%, #2f9365);
  animation-delay: -2.2s;
}

.number-galaxy-stars span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #f7fbff;
  box-shadow: 0 0 10px rgba(232, 242, 255, 0.8);
  animation: starTwinkle 3.2s ease-in-out infinite;
}

.number-galaxy-stars span:nth-child(1) { left: 11%; top: 16%; }
.number-galaxy-stars span:nth-child(2) { left: 22%; top: 58%; animation-delay: -0.8s; }
.number-galaxy-stars span:nth-child(3) { left: 41%; top: 22%; animation-delay: -1.4s; }
.number-galaxy-stars span:nth-child(4) { left: 54%; top: 66%; animation-delay: -0.4s; }
.number-galaxy-stars span:nth-child(5) { left: 63%; top: 30%; animation-delay: -1.8s; }
.number-galaxy-stars span:nth-child(6) { left: 76%; top: 14%; animation-delay: -0.6s; }
.number-galaxy-stars span:nth-child(7) { left: 82%; top: 48%; animation-delay: -2.4s; }

.number-galaxy-badges {
  position: absolute;
  inset: 0;
}

.number-galaxy-rocket {
  position: absolute;
  left: 10%;
  bottom: 14%;
  width: 88px;
  height: 34px;
  border-radius: 24px 10px 10px 24px;
  background: linear-gradient(135deg, #f7fbff 0%, #bdd0ff 55%, #7f99f6 100%);
  box-shadow: 0 8px 20px rgba(12, 26, 76, 0.4);
  transform: rotate(-15deg);
  animation: rocketFloat 4.8s ease-in-out infinite;
}

.number-galaxy-rocket::before {
  content: "";
  position: absolute;
  right: -16px;
  top: 8px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 17px solid #c2d4ff;
}

.number-galaxy-rocket::after {
  content: "";
  position: absolute;
  left: -12px;
  top: 11px;
  width: 14px;
  height: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffe39b, #ff8d43);
}

.number-galaxy-badge {
  position: absolute;
  min-width: 72px;
  text-align: center;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.93);
  color: #1d2c80;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(8, 20, 68, 0.34);
  border: 1px solid rgba(210, 224, 255, 0.85);
  animation: badgeFloat 4.4s ease-in-out infinite;
}

.number-galaxy-badge:nth-child(1) { left: 26%; top: 24%; }
.number-galaxy-badge:nth-child(2) { left: 56%; top: 46%; animation-delay: -1.2s; }
.number-galaxy-badge:nth-child(3) { left: 74%; top: 25%; animation-delay: -0.6s; }

.number-galaxy-badge.active {
  background: linear-gradient(180deg, #fff3a7, #ffd977);
  color: #5e3e00;
  transform: scale(1.08);
  box-shadow: 0 0 0 2px rgba(255, 221, 123, 0.58), 0 10px 18px rgba(255, 198, 73, 0.42);
}

.number-galaxy-layer.celebrate .number-galaxy-planet {
  box-shadow: inset 0 -8px 22px rgba(12, 23, 63, 0.24), 0 0 28px rgba(255, 230, 137, 0.56);
}

.world-illustration-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.world-clouds ellipse {
  fill: rgba(255, 255, 255, 0.78);
}

.world-castle rect,
.world-castle path {
  fill: #8ea9ff;
}

.world-sparkles circle {
  fill: #fff3a1;
  opacity: 0.9;
}

.world-illustration-sparkle {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.world-illustration-sparkle::before,
.world-illustration-sparkle::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(255, 241, 141, 0.5));
  box-shadow: 0 0 10px rgba(255, 236, 127, 0.7);
  animation: iconTwinkle 2.8s ease-in-out infinite;
}

.world-illustration-sparkle::before {
  left: 21%;
  top: 25%;
}

.world-illustration-sparkle::after {
  right: 20%;
  top: 34%;
  animation-delay: -1.2s;
}

.preview-panel {
  border-style: dashed;
  overflow: visible;
}

.preview-panel .choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.preview-panel .tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 8px;
}

.preview-panel .choice-btn,
.preview-panel .tile-btn {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.preview-panel.correct {
  border-color: #53bf7a;
  background: #f2fff6;
}

.preview-panel.wrong {
  border-color: #d37f7f;
  background: #fff5f5;
}

.reset-confirm-modal {
  position: fixed;
  inset: 0;
  background: rgba(28, 37, 84, 0.42);
  display: grid;
  place-items: center;
  z-index: 120;
  padding: 16px;
}

.reset-confirm-modal[hidden] {
  display: none !important;
  pointer-events: none;
}

.reset-confirm-card {
  width: min(520px, 94vw);
  background: #fff;
  border: 2px solid #dbe6ff;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(32, 54, 140, 0.22);
  padding: 16px;
}

.island-strip {
  position: relative;
  z-index: 2;
  margin-top: 10px;
  display: flex;
  justify-content: space-around;
  font-size: 1.8rem;
}

.island-tree,
.island-flower,
.island-animal {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: inline-block;
  background: linear-gradient(180deg, #d8f0ff, #f8fbff);
  border: 2px solid #c9ddff;
  animation: bob 3.2s ease-in-out infinite;
}

.island-tree::before,
.island-flower::before,
.island-animal::before {
  content: "";
  width: 24px;
  height: 24px;
  display: block;
  border-radius: 50%;
  margin: 12px auto;
  background: #7fcf80;
}

.island-flower::before { background: #ff9ac8; }
.island-animal::before { background: #8eb0ff; }

.island-flower { animation-delay: -1.2s; }
.island-animal { animation-delay: -0.6s; }

.confetti-zone {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 35;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  font-size: 1.2rem;
  animation: confettiFall 1.4s ease-in forwards;
}

.learning-path {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.path-node {
  border: 2px solid #cfe0ff;
  border-radius: 14px;
  background: linear-gradient(180deg, #f4f8ff, #ffffff);
  padding: 10px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.path-node.locked {
  opacity: 0.56;
  filter: grayscale(0.2);
}

.path-node.unlocked {
  border-color: #7da4ff;
}

.path-node.completed {
  border-color: #6acd8f;
  background: linear-gradient(180deg, #eafff1, #ffffff);
}

.path-title {
  font-weight: 800;
}

.path-state {
  font-size: 0.86rem;
  color: #44518f;
}

.path-node.unlock-pulse {
  animation: unlockPulse 0.9s ease-out 1;
}

@keyframes cloudDrift {
  0% { transform: translateX(0); }
  50% { transform: translateX(12px); }
  100% { transform: translateX(0); }
}

@keyframes canopySway {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(1.8deg) translateY(-4px); }
}

@keyframes branchSwayA {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(1.4deg); }
}

@keyframes branchSwayB {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-1.6deg); }
}

@keyframes blossomPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.86; }
  50% { transform: scale(1.15); opacity: 1; }
}

@keyframes sparkleDrift {
  0% { transform: translateY(0) scale(0.4); opacity: 0; }
  16% { opacity: 0.7; }
  84% { opacity: 0.2; }
  100% { transform: translateY(-62px) scale(1); opacity: 0; }
}

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

@keyframes iconTwinkle {
  0%, 100% { transform: scale(0.7); opacity: 0.55; }
  45% { transform: scale(1.15); opacity: 1; }
}

@keyframes medalRise {
  0% { transform: translateY(8px) scale(0.94); opacity: 0.7; }
  100% { transform: translateY(0px) scale(1); opacity: 1; }
}

@keyframes medalSparkle {
  0% { transform: scale(0.6); opacity: 0; }
  35% { opacity: 0.8; }
  100% { transform: scale(1.2); opacity: 0; }
}

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

@keyframes starTwinkle {
  0%, 100% { transform: scale(0.75); opacity: 0.45; }
  50% { transform: scale(1.2); opacity: 1; }
}

@keyframes badgeFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-7px); }
}

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

body.page-transitioning main,
body.page-transitioning .site-header {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes treeSway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg); }
}

@keyframes bloom {
  0%, 100% { transform: scale(0.95); }
  50% { transform: scale(1.08); }
}

@keyframes glowLetter {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(-4px); opacity: 1; }
}

@keyframes treeLetterGlow {
  0%, 100% { box-shadow: 0 8px 18px rgba(49, 110, 133, 0.2), 0 0 12px rgba(126, 166, 255, 0.44); }
  50% { box-shadow: 0 10px 20px rgba(49, 110, 133, 0.28), 0 0 22px rgba(126, 166, 255, 0.7); }
}

@keyframes unlockPulse {
  0% { box-shadow: 0 0 0 0 rgba(113, 147, 255, 0.5); }
  100% { box-shadow: 0 0 0 18px rgba(113, 147, 255, 0); }
}

@keyframes traceFlowerBurst {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.5); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -100%) scale(1.1); }
}

@keyframes flutter {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(7deg); }
}

@keyframes sparkle {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes blink {
  0%, 46%, 50%, 100% { transform: scaleY(1); }
  48% { transform: scaleY(0.1); }
}

@keyframes wingFlap {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(18deg); }
}

@keyframes wingWave {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(32deg); }
}

@keyframes bounceHappy {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes dance {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(4deg) translateY(-5px); }
}


@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(95vh) rotate(420deg);
    opacity: 0;
  }
}

@keyframes burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -60%) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -95%) scale(1.2);
  }
}

@keyframes treeMithuListen {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(3deg) translateY(-2px); }
}

@keyframes treeMithuPoint {
  0%, 100% { transform: rotate(0deg); }
  40% { transform: rotate(24deg); }
  70% { transform: rotate(14deg); }
}

@keyframes treeMithuCelebrate {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
  68% { transform: translateY(-4px); }
}

@keyframes treeMithuDance {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-6px) rotate(5deg); }
  50% { transform: translateY(-1px) rotate(-5deg); }
  75% { transform: translateY(-5px) rotate(4deg); }
}

@keyframes treeMithuHover {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes letterBloom {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes bloomPop {
  0% { transform: scale(0.35); opacity: 0; }
  45% { transform: scale(1.22); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

@media (max-width: 980px) {
  .page-wrap.with-mascot {
    grid-template-columns: 1fr;
  }

  .mascot-rail {
    display: none;
  }
}

@media (max-width: 860px) {
  .site-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .main-nav {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .main-nav a {
    flex: 1 1 0;
    text-align: center;
    padding: 9px 10px;
    font-size: 0.92rem;
  }

  .hero-card {
    grid-template-columns: 1fr;
  }

  .hero-layout {
    grid-template-columns: 1fr;
  }

  .about-mithu-guide {
    grid-template-columns: 1fr;
  }

  .about-mithu-guide-art {
    margin: 0 auto;
  }

  .world-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .learning-path {
    grid-template-columns: 1fr;
  }

  .forest-layout {
    grid-template-columns: 1fr;
  }

  .activity-jump-nav {
    justify-content: flex-start;
  }

  .page-wrap.with-mascot {
    grid-template-columns: 1fr;
  }

  .magical-tree-stage {
    height: clamp(270px, 70vw, 360px);
  }

  .tree-letter-btn {
    width: 68px;
    height: 68px;
  }

  .tree-letter-btn .tree-dev {
    font-size: 1.35rem;
  }

  .tree-mithu {
    width: 58px;
    height: 58px;
  }

  .letter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .writing-card {
    max-width: 100%;
  }

  .trace-work-area {
    grid-template-columns: 1fr;
  }

  .trace-target {
    min-height: 102px;
  }

  #traceCanvas {
    min-height: 160px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .big-action {
    min-width: 100%;
  }

  .mascot-rail {
    display: none;
  }

  .lesson-mascot-mobile .mithu-svg {
    width: 120px;
    height: 120px;
  }

  .lesson-mascot-mobile .mascot-speech {
    min-height: 0;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Force bright rainbow Mithu palette on home, even if old cached HTML is served. */
#homeMithuBodyRainbow stop:nth-of-type(1),
#guideMithuBodyRainbow stop:nth-of-type(1) { stop-color: #ff2f2f !important; }
#homeMithuBodyRainbow stop:nth-of-type(2),
#guideMithuBodyRainbow stop:nth-of-type(2) { stop-color: #ff4a4a !important; }
#homeMithuBodyRainbow stop:nth-of-type(3),
#guideMithuBodyRainbow stop:nth-of-type(3) { stop-color: #ff6b6b !important; }
#homeMithuBodyRainbow stop:nth-of-type(4),
#guideMithuBodyRainbow stop:nth-of-type(4) { stop-color: #2f6bff !important; }
#homeMithuBodyRainbow stop:nth-of-type(5),
#guideMithuBodyRainbow stop:nth-of-type(5) { stop-color: #1f86ff !important; }
#homeMithuBodyRainbow stop:nth-of-type(6),
#guideMithuBodyRainbow stop:nth-of-type(6) { stop-color: #1553d6 !important; }
#homeMithuBodyRainbow stop:nth-of-type(7),
#guideMithuBodyRainbow stop:nth-of-type(7) { stop-color: #5b3dff !important; }

#homeMithuWingLeft stop:nth-of-type(1),
#guideMithuWingLeft stop:nth-of-type(1) { stop-color: #ff2f55 !important; }
#homeMithuWingLeft stop:nth-of-type(2),
#guideMithuWingLeft stop:nth-of-type(2) { stop-color: #ff3a3a !important; }
#homeMithuWingLeft stop:nth-of-type(3),
#guideMithuWingLeft stop:nth-of-type(3) { stop-color: #ff6a6a !important; }

#homeMithuWingRight stop:nth-of-type(1),
#guideMithuWingRight stop:nth-of-type(1) { stop-color: #4aa3ff !important; }
#homeMithuWingRight stop:nth-of-type(2),
#guideMithuWingRight stop:nth-of-type(2) { stop-color: #2d7dff !important; }
#homeMithuWingRight stop:nth-of-type(3),
#guideMithuWingRight stop:nth-of-type(3) { stop-color: #2f4dff !important; }

#homeMithuTail stop:nth-of-type(1),
#guideMithuTail stop:nth-of-type(1) { stop-color: #3a9dff !important; }
#homeMithuTail stop:nth-of-type(2),
#guideMithuTail stop:nth-of-type(2) { stop-color: #2546cc !important; }

.hero .mithu .mithu-crest,
.journey-guide .mithu-svg .mithu-crest { stroke: #ff1f4a !important; }
