/**
 * Kids Learning Adventure — Style System
 * Cheerful, colorful, touch-friendly preschool children's UI (Ages 3-6)
 */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Quicksand:wght@500;600;700;800&display=swap');

:root {
  --primary-blue: #3A86FF;
  --primary-pink: #FF006E;
  --primary-yellow: #FFBE0B;
  --primary-orange: #FB5607;
  --primary-purple: #8338EC;
  --primary-green: #06D6A0;
  --bg-gradient: linear-gradient(180deg, #BAE6FD 0%, #FBCFE8 50%, #FEF08A 100%);
  --card-bg: rgba(255, 255, 255, 0.94);
  --card-shadow: 0 10px 0 rgba(0, 0, 0, 0.12), 0 16px 28px rgba(0, 0, 0, 0.08);
  --btn-shadow: 0 6px 0 rgba(0, 0, 0, 0.18);
  --font-main: 'Fredoka', 'Quicksand', sans-serif;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

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

html, body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  font-family: var(--font-main);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: #2B2D42;
  overflow-x: hidden;
  font-size: 18px;
}

/* -------------------------------------------------------------
   BACKGROUND DECORATIONS: Animated Clouds & Sparkles
   ------------------------------------------------------------- */
.sky-bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 100px;
  filter: blur(1px);
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 50%;
}

.cloud-1 {
  width: 160px;
  height: 55px;
  top: 8%;
  left: -180px;
  animation: floatCloud 32s linear infinite;
}
.cloud-1::before { width: 70px; height: 70px; top: -35px; left: 25px; }
.cloud-1::after { width: 50px; height: 50px; top: -20px; right: 25px; }

.cloud-2 {
  width: 220px;
  height: 70px;
  top: 25%;
  left: -250px;
  animation: floatCloud 45s linear infinite 14s;
}
.cloud-2::before { width: 90px; height: 90px; top: -45px; left: 35px; }
.cloud-2::after { width: 65px; height: 65px; top: -25px; right: 35px; }

.cloud-3 {
  width: 180px;
  height: 60px;
  top: 60%;
  left: -200px;
  animation: floatCloud 38s linear infinite 7s;
}
.cloud-3::before { width: 75px; height: 75px; top: -35px; left: 30px; }
.cloud-3::after { width: 55px; height: 55px; top: -25px; right: 30px; }

@keyframes floatCloud {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(100vw + 350px)); }
}

/* -------------------------------------------------------------
   CONFETTI CANVAS
   ------------------------------------------------------------- */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* -------------------------------------------------------------
   GLOBAL HEADER
   ------------------------------------------------------------- */
.global-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 3px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 8px 16px;
  border-radius: 99px;
  border: none;
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}
.header-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.btn-arcade-exit { background: #64748B; }
.btn-nav-back { background: #3B82F6; }
.btn-nav-home { background: #10B981; }

.header-star-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFBEB;
  border: 3px solid #FDE047;
  padding: 6px 18px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 1.25rem;
  color: #B45309;
  box-shadow: 0 4px 0 #FCD34D;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.header-star-chip.star-bump {
  animation: starBumpAnim 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes starBumpAnim {
  0% { transform: scale(1); }
  50% { transform: scale(1.35) rotate(8deg); }
  100% { transform: scale(1); }
}

.btn-toggle-audio {
  background: #F1F5F9;
  color: #334155;
  border: 2px solid #CBD5E1;
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 #94A3B8;
}
.btn-toggle-audio.active {
  background: #E0E7FF;
  border-color: #6366F1;
  color: #4338CA;
  box-shadow: 0 3px 0 #6366F1;
}

.btn-parent-zone {
  background: #8B5CF6;
  color: #ffffff;
}

/* -------------------------------------------------------------
   MASCOT "BUDDY" WIDGET
   ------------------------------------------------------------- */
.mascot-container {
  position: fixed;
  bottom: 16px;
  right: 18px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.mascot-bubble {
  max-width: 250px;
  background: #ffffff;
  border: 3px solid #3A86FF;
  border-radius: 20px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 1rem;
  color: #1E293B;
  box-shadow: 0 8px 20px rgba(58, 134, 255, 0.25);
  margin-bottom: 8px;
  position: relative;
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: auto;
}
.mascot-bubble.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.mascot-bubble::after {
  content: '';
  position: absolute;
  bottom: -12px;
  right: 32px;
  border-width: 12px 10px 0;
  border-style: solid;
  border-color: #3A86FF transparent;
  display: block;
  width: 0;
}

.mascot-avatar {
  width: 90px;
  height: 90px;
  background: #FFBE0B;
  border: 4px solid #FB5607;
  border-radius: 50%;
  box-shadow: 0 8px 0 #D97706, 0 12px 24px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
  animation: mascotBreath 3.5s ease-in-out infinite;
}
.mascot-avatar:active {
  transform: scale(0.92);
}

@keyframes mascotBreath {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.03); }
}

.mascot-avatar.mood-jump {
  animation: mascotJumpAnim 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes mascotJumpAnim {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-35px) scale(1.15) rotate(-6deg); }
  70% { transform: translateY(-15px) scale(1.08) rotate(4deg); }
  100% { transform: translateY(0) scale(1); }
}

.buddy-svg {
  width: 100%;
  height: 100%;
}

/* -------------------------------------------------------------
   APP SCREENS CONTAINER
   ------------------------------------------------------------- */
.app-screen {
  display: none;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1150px;
  margin: 0 auto;
  padding: 24px 18px 120px;
  animation: screenFadeIn 0.35s ease forwards;
}
.app-screen.active-screen {
  display: block;
}

@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------
   SCREEN: SPLASH
   ------------------------------------------------------------- */
#screen-splash {
  display: none;
  min-height: 90vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}
#screen-splash.active-screen {
  display: flex;
}

.splash-logo-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--card-shadow);
  border: 5px solid #ffffff;
  max-width: 520px;
  width: 100%;
}

.splash-mascot-img {
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
  animation: floatMascot 2.5s ease-in-out infinite;
}
@keyframes floatMascot {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px) rotate(3deg); }
}

.splash-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #FF006E, #FB5607, #FFBE0B, #06D6A0, #3A86FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.splash-subtitle {
  font-size: 1.3rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 28px;
}

.btn-big-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 18px 46px;
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-main);
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 8px 0 #047857, 0 16px 30px rgba(16, 185, 129, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: pulseStartBtn 2s infinite ease-in-out;
}
.btn-big-play:hover {
  transform: translateY(-2px);
}
.btn-big-play:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #047857;
}

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

/* -------------------------------------------------------------
   SCREEN: HOME (Adventure Hub)
   ------------------------------------------------------------- */
.home-hero {
  text-align: center;
  margin-bottom: 24px;
}
.home-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: #1E293B;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);
}
.home-subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  color: #475569;
  margin-top: 4px;
}

/* Today's Challenge Banner */
.daily-challenge-banner {
  background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
  box-shadow: 0 8px 0 #6D28D9, 0 16px 28px rgba(139, 92, 246, 0.35);
  margin-bottom: 28px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.daily-challenge-banner:hover {
  transform: translateY(-3px);
}
.daily-challenge-banner:active {
  transform: translateY(2px);
}
.daily-banner-info h3 {
  font-size: 1.4rem;
  font-weight: 800;
}
.daily-banner-info p {
  font-size: 1rem;
  opacity: 0.92;
}
.btn-play-daily {
  background: #FDE047;
  color: #854D0E;
  border: none;
  font-family: var(--font-main);
  font-size: 1.15rem;
  font-weight: 800;
  padding: 10px 22px;
  border-radius: 99px;
  box-shadow: 0 4px 0 #EAB308;
  cursor: pointer;
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.category-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 24px 18px;
  text-align: center;
  box-shadow: var(--card-shadow);
  border: 4px solid #ffffff;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.category-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 14px 0 rgba(0, 0, 0, 0.12), 0 20px 32px rgba(0, 0, 0, 0.1);
}
.category-card:active {
  transform: translateY(3px) scale(0.98);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}

.category-icon-wrap {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.7rem;
  background: var(--cat-color-soft, #EEF2FF);
  border: 3px solid var(--cat-color, #4338CA);
  margin-bottom: 6px;
  transition: transform 0.25s ease;
}
.category-card:hover .category-icon-wrap {
  transform: scale(1.15) rotate(5deg);
}

.category-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1E293B;
}
.category-desc {
  font-size: 0.92rem;
  font-weight: 600;
  color: #64748B;
}

/* Distinct Category Accents */
.card-abc { --cat-color: #EF4444; --cat-color-soft: #FEE2E2; }
.card-draw { --cat-color: #EC4899; --cat-color-soft: #FCE7F3; }
.card-words { --cat-color: #F59E0B; --cat-color-soft: #FEF3C7; }
.card-animals { --cat-color: #10B981; --cat-color-soft: #D1FAE5; }
.card-sounds { --cat-color: #06B6D4; --cat-color-soft: #CFFAFE; }
.card-fruits { --cat-color: #F43F5E; --cat-color-soft: #FFE4E6; }
.card-veggies { --cat-color: #84CC16; --cat-color-soft: #ECFCCB; }
.card-colors { --cat-color: #8B5CF6; --cat-color-soft: #EDE9FE; }
.card-numbers { --cat-color: #3B82F6; --cat-color-soft: #DBEAFE; }
.card-shapes { --cat-color: #6366F1; --cat-color-soft: #E0E7FF; }
.card-gk { --cat-color: #D946EF; --cat-color-soft: #FAE8FF; }
.card-match { --cat-color: #14B8A6; --cat-color-soft: #CCFBF1; }
.card-memory { --cat-color: #F97316; --cat-color-soft: #FFEDD5; }

/* -------------------------------------------------------------
   SCREEN: LEARN ABC FLASHCARDS
   ------------------------------------------------------------- */
.learn-abc-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 650px;
  margin: 0 auto;
}

.flashcard {
  width: 100%;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--card-shadow);
  border: 5px solid #ffffff;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.flashcard-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flashcard-counter {
  font-weight: 800;
  color: #64748B;
  background: #F1F5F9;
  padding: 4px 14px;
  border-radius: 99px;
  font-size: 0.95rem;
}

.btn-flashcard-picker {
  background: #E2E8F0;
  border: none;
  font-family: var(--font-main);
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 99px;
  cursor: pointer;
}

.flashcard-letter {
  font-size: 6rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.08);
}

.flashcard-emoji {
  font-size: 6.5rem;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.12));
  animation: floatMascot 3s ease-in-out infinite;
}

.flashcard-word {
  font-size: 2.8rem;
  font-weight: 800;
  color: #1E293B;
}

.flashcard-phonics {
  font-size: 1.3rem;
  font-weight: 600;
  color: #475569;
  max-width: 90%;
}

.flashcard-nav {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.btn-circle-nav {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #3B82F6;
  color: #ffffff;
  border: none;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 0 #1D4ED8;
  transition: transform 0.15s ease;
}
.btn-circle-nav:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #1D4ED8;
}

.btn-speak-action {
  background: #10B981;
  color: #ffffff;
  border: none;
  font-family: var(--font-main);
  font-size: 1.3rem;
  font-weight: 800;
  padding: 14px 28px;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 6px 0 #047857;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease;
}
.btn-speak-action:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #047857;
}

/* -------------------------------------------------------------
   SCREEN: DRAW & TRACE ABC / WORDS
   ------------------------------------------------------------- */
.draw-screen-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 780px;
  margin: 0 auto;
  gap: 16px;
}

.draw-top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
}

.draw-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}
.draw-title-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1E293B;
}

.draw-progress-bar {
  flex: 1;
  max-width: 200px;
  height: 16px;
  background: #E2E8F0;
  border-radius: 99px;
  overflow: hidden;
  margin: 0 16px;
}
.draw-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #10B981, #06D6A0);
  border-radius: 99px;
  transition: width 0.2s ease;
}

.canvas-tablet-container {
  position: relative;
  width: 100%;
  height: 420px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  border: 8px solid #F8FAFC;
  overflow: hidden;
  touch-action: none;
}

#draw-letter-canvas,
#draw-words-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

/* Animated Guide Hand */
.tracing-guide-hand {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 2.6rem;
  pointer-events: none;
  z-index: 10;
  transition: transform 0.08s linear, opacity 0.2s ease;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

/* Drawing Toolbar */
.draw-toolbar {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  gap: 12px;
}

.draw-palette {
  display: flex;
  align-items: center;
  gap: 10px;
}

.draw-color-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease;
}
.draw-color-btn.active {
  transform: scale(1.2);
  border-color: #1E293B;
}
.btn-rainbow {
  background: linear-gradient(135deg, red, orange, yellow, green, blue, purple);
}

.draw-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-tool-action {
  padding: 10px 18px;
  border-radius: 99px;
  border: none;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
}
.btn-tool-action:active {
  transform: translateY(3px);
}
.btn-draw-clear { background: #EF4444; color: #ffffff; }
.btn-draw-undo { background: #F59E0B; color: #ffffff; }
.btn-draw-next-step { background: linear-gradient(135deg, #10B981, #059669); color: #ffffff; }

/* 3-Letter Word Specific Indicator */
.draw-word-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 8px;
}
.draw-word-emoji {
  font-size: 3rem;
}
.word-step-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  padding: 6px 18px;
  border-radius: 16px;
  background: #F1F5F9;
  color: #64748B;
  margin: 0 4px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}
.word-step-pill:hover {
  background: #E2E8F0;
  transform: translateY(-2px);
}
.word-step-pill.active-letter {
  background: #3B82F6;
  color: #ffffff;
  border-color: #2563EB;
  transform: scale(1.15);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}
.word-step-pill.completed-letter {
  background: #10B981;
  color: #ffffff;
  border-color: #059669;
}

.words-quick-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}
.word-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 2px solid #E2E8F0;
  padding: 8px 16px;
  border-radius: 99px;
  font-family: var(--font-main);
  font-weight: 700;
  cursor: pointer;
}
.word-chip-btn.active {
  border-color: #3B82F6;
  background: #EFF6FF;
  color: #1D4ED8;
}

/* -------------------------------------------------------------
   SCREEN: QUIZ (Animals, Fruits, Veggies, Colors, Shapes, GK)
   ------------------------------------------------------------- */
.quiz-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.game-nav-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 4px;
}

.game-nav-counter {
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 1.15rem;
  color: #334155;
  background: #ffffff;
  padding: 8px 18px;
  border-radius: 99px;
  border: 2px solid #E2E8F0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.quiz-nav-footer {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.btn-quiz-next-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 36px;
  font-family: var(--font-main);
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: none;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 6px 0 #047857, 0 10px 20px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-quiz-next-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #047857, 0 14px 24px rgba(16, 185, 129, 0.4);
}

.btn-quiz-next-action:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #047857;
}

.btn-quiz-next-action.pulse-hint {
  animation: pulseNextBtn 1.4s infinite;
}

@keyframes pulseNextBtn {
  0% { transform: scale(1); box-shadow: 0 6px 0 #047857, 0 10px 20px rgba(16, 185, 129, 0.35); }
  50% { transform: scale(1.06); box-shadow: 0 8px 0 #047857, 0 14px 28px rgba(16, 185, 129, 0.55); }
  100% { transform: scale(1); box-shadow: 0 6px 0 #047857, 0 10px 20px rgba(16, 185, 129, 0.35); }
}

.btn-circle-nav.pulse-hint {
  animation: pulseCircleNav 1.4s infinite;
}

@keyframes pulseCircleNav {
  0% { transform: scale(1); box-shadow: 0 4px 0 #CBD5E1; }
  50% { transform: scale(1.15); box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5); }
  100% { transform: scale(1); box-shadow: 0 4px 0 #CBD5E1; }
}

.matching-container,
.memory-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0 auto;
}

.quiz-card {
  width: 100%;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--card-shadow);
  border: 5px solid #ffffff;
  text-align: center;
}

.quiz-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #1E293B;
  margin-bottom: 8px;
}

.quiz-prompt {
  font-size: 1.35rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 20px;
}

.quiz-display-emoji {
  font-size: 6rem;
  margin-bottom: 24px;
  display: inline-block;
  animation: floatMascot 3s ease-in-out infinite;
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: 100%;
}

.quiz-option-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px 24px;
  background: var(--opt-color, #ffffff);
  border: 3px solid #E2E8F0;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 1.45rem;
  font-weight: 800;
  color: #1E293B;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition: transform 0.15s ease, border-color 0.2s ease;
}
.quiz-option-btn:hover {
  border-color: #3B82F6;
  transform: translateY(-2px);
}
.quiz-option-btn:active {
  transform: translateY(3px);
}

.quiz-opt-emoji {
  font-size: 2.2rem;
}

.quiz-option-btn.correct-choice {
  background: #10B981 !important;
  color: #ffffff !important;
  border-color: #047857 !important;
  animation: correctBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes correctBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.quiz-option-btn.wrong-choice {
  background: #FEE2E2 !important;
  border-color: #EF4444 !important;
  animation: wrongWobble 0.5s ease;
}
@keyframes wrongWobble {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* -------------------------------------------------------------
   SCREEN: ANIMAL SOUNDS GAME
   ------------------------------------------------------------- */
.sound-game-card {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--card-shadow);
  border: 5px solid #ffffff;
  text-align: center;
}

.btn-listen-sound {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06B6D4 0%, #0891B2 100%);
  color: #ffffff;
  border: none;
  font-size: 3.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 0 #0E7490, 0 16px 28px rgba(6, 182, 212, 0.4);
  margin: 20px 0 28px;
  transition: transform 0.15s ease;
}
.btn-listen-sound:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #0E7490;
}
.btn-listen-sound.pulse-playing {
  animation: soundPulse 0.8s infinite alternate;
}
@keyframes soundPulse {
  0% { transform: scale(1); box-shadow: 0 8px 0 #0E7490, 0 0 0 0 rgba(6, 182, 212, 0.7); }
  100% { transform: scale(1.12); box-shadow: 0 8px 0 #0E7490, 0 0 0 24px rgba(6, 182, 212, 0); }
}

.sound-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.sound-option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: #ffffff;
  border: 3px solid #E2E8F0;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition: transform 0.15s ease, border-color 0.2s ease;
}
.sound-option-btn:hover {
  border-color: #06B6D4;
  transform: translateY(-3px);
}
.sound-opt-emoji {
  font-size: 3.8rem;
}
.sound-opt-text {
  font-family: var(--font-main);
  font-size: 1.35rem;
  font-weight: 800;
  color: #1E293B;
}

/* -------------------------------------------------------------
   SCREEN: NUMBERS & COUNTING
   ------------------------------------------------------------- */
.numbers-card {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--card-shadow);
  border: 5px solid #ffffff;
  text-align: center;
}

.numbers-display-area {
  min-height: 140px;
  background: #F8FAFC;
  border-radius: var(--radius-md);
  border: 3px dashed #CBD5E1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 14px;
  margin: 18px 0 24px;
}

.counting-item {
  font-size: 3.2rem;
  display: inline-block;
  animation: countItemPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}
@keyframes countItemPop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.number-sequence-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.sequence-num-box {
  width: 60px;
  height: 60px;
  background: #3B82F6;
  color: #ffffff;
  font-size: 2rem;
  font-weight: 800;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 #1D4ED8;
}
.sequence-num-box.mystery-box {
  background: #F59E0B;
  box-shadow: 0 4px 0 #B45309;
  animation: pulseStartBtn 1.5s infinite;
}
.sequence-arrow {
  font-size: 1.6rem;
  color: #94A3B8;
}

.numbers-options-grid {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.number-option-btn {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: #ffffff;
  border: 3px solid #CBD5E1;
  font-family: var(--font-main);
  font-size: 2.2rem;
  font-weight: 800;
  color: #1E293B;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition: transform 0.15s ease, border-color 0.2s ease;
}
.number-option-btn:hover {
  border-color: #3B82F6;
  transform: translateY(-3px);
}
.number-option-btn:active {
  transform: translateY(3px);
}

/* -------------------------------------------------------------
   SCREEN: MATCHING GAME
   ------------------------------------------------------------- */
.matching-board {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.match-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.match-card {
  min-height: 80px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 4px solid #ffffff;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
  font-size: 2rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}
.match-card:hover {
  transform: scale(1.03);
}
.match-card.selected {
  border-color: #3A86FF;
  background: #EFF6FF;
  transform: scale(1.02);
}
.match-card.matched {
  background: #ECFDF5;
  border-color: #10B981;
  color: #065F46;
  pointer-events: none;
  opacity: 0.85;
}

/* -------------------------------------------------------------
   SCREEN: MEMORY FLIP GAME
   ------------------------------------------------------------- */
.memory-board-wrap {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
}

.memory-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
}

.memory-card {
  aspect-ratio: 1 / 1;
  perspective: 1000px;
  cursor: pointer;
}

.memory-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card-front, .memory-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #ffffff;
}

.memory-card-front {
  background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
  color: #ffffff;
}
.memory-star-pattern {
  font-size: 2.5rem;
}

.memory-card-back {
  background: #ffffff;
  transform: rotateY(180deg);
}
.memory-emoji {
  font-size: 3.2rem;
}

.memory-card.matched .memory-card-back {
  background: #ECFDF5;
  border-color: #10B981;
}

/* -------------------------------------------------------------
   MODALS: Fullscreen Glassmorphic Overlays
   ------------------------------------------------------------- */
.app-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.app-modal.visible {
  display: flex;
  animation: modalFadeIn 0.25s ease forwards;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  max-width: 580px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  border: 6px solid #ffffff;
  text-align: center;
  position: relative;
  animation: modalPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalPopIn {
  from { transform: scale(0.85); }
  to { transform: scale(1); }
}

.btn-modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #F1F5F9;
  font-size: 1.4rem;
  font-weight: 800;
  color: #64748B;
  cursor: pointer;
}

/* Badges Grid in Rewards Modal */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.badge-card {
  background: #F8FAFC;
  border-radius: 16px;
  padding: 16px 10px;
  border: 2px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.badge-card.unlocked {
  background: #FFFBEB;
  border-color: #FCD34D;
}
.badge-icon-wrap {
  position: relative;
  font-size: 2.6rem;
}
.badge-check {
  position: absolute;
  top: -4px;
  right: -8px;
  font-size: 1rem;
}
.badge-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1E293B;
}
.badge-desc {
  font-size: 0.75rem;
  color: #64748B;
}
.badge-progress-bar {
  width: 100%;
  height: 8px;
  background: #E2E8F0;
  border-radius: 99px;
  overflow: hidden;
}
.badge-progress-fill {
  height: 100%;
  background: #10B981;
}
.badge-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748B;
}

/* Parent Zone Stats List */
.parent-stats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
  text-align: left;
}
.parent-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: #F8FAFC;
  border-radius: 12px;
}

.btn-reset-danger {
  background: #EF4444;
  color: #ffffff;
  border: none;
  font-family: var(--font-main);
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 4px 0 #B91C1C;
}

/* Word Assembly Animation Screen Modal */
.assembly-letters-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 4rem;
  font-weight: 900;
  margin: 20px 0;
}
.bounce-letter {
  display: inline-block;
  color: #3B82F6;
  animation: letterBounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite alternate;
}
@keyframes letterBounceIn {
  from { transform: translateY(0); }
  to { transform: translateY(-16px) scale(1.1); }
}
.assembly-plus {
  color: #F59E0B;
  font-size: 2.5rem;
}
.assembly-result-word {
  font-size: 3.5rem;
  font-weight: 900;
  color: #10B981;
  letter-spacing: 4px;
}

/* Badge Toast Notification */
.badge-toast {
  display: none;
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-25px);
  background: #FFFBEB;
  border: 3px solid #FCD34D;
  border-radius: 99px;
  padding: 6px 16px 6px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  align-items: center;
  gap: 10px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  max-width: 90vw;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0.25s ease;
  cursor: pointer;
}

.badge-toast.visible {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.badge-toast-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.badge-toast-body {
  text-align: left;
  line-height: 1.2;
}

.badge-toast-body h4 {
  font-size: 0.92rem;
  font-weight: 800;
  color: #92400E;
  margin: 0;
}

.badge-toast-body p {
  font-size: 0.76rem;
  color: #78350F;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.btn-toast-close {
  background: transparent;
  border: none;
  font-size: 1rem;
  font-weight: 800;
  color: #92400E;
  cursor: pointer;
  padding: 4px;
  margin-left: 4px;
  opacity: 0.7;
}
.btn-toast-close:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .badge-toast {
    top: 8px;
    padding: 5px 12px 5px 8px;
    gap: 6px;
    max-width: 92vw;
  }
  .badge-toast-icon {
    font-size: 1.4rem;
  }
  .badge-toast-body h4 {
    font-size: 0.82rem;
  }
  .badge-toast-body p {
    font-size: 0.70rem;
    max-width: 150px;
  }
}

/* Parent Gate Arithmetic Options */
.gate-options-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
}
.gate-opt-btn {
  width: 65px;
  height: 65px;
  border-radius: 16px;
  border: 3px solid #CBD5E1;
  background: #ffffff;
  font-family: var(--font-main);
  font-size: 1.8rem;
  font-weight: 800;
  color: #1E293B;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
}
.gate-opt-btn.wrong {
  animation: wrongWobble 0.5s ease;
  border-color: #EF4444;
}

/* -------------------------------------------------------------
   RESPONSIVE DESIGN (Mobile & Tablet)
   ------------------------------------------------------------- */
@media (max-width: 860px) {
  .global-header {
    padding: 8px 10px;
    gap: 6px;
    box-sizing: border-box;
    width: 100%;
  }
  .header-left, .header-right {
    gap: 5px;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }
  .header-btn .btn-text,
  .btn-toggle-audio .btn-text {
    display: none;
  }
  .header-btn,
  .btn-toggle-audio {
    width: 40px;
    height: 40px;
    min-height: 40px;
    min-width: 40px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.16);
  }
  .header-star-chip {
    padding: 4px 10px;
    font-size: 1.05rem;
    gap: 4px;
    border-width: 2px;
    box-shadow: 0 3px 0 #FCD34D;
    flex-shrink: 0;
  }
}

@media (max-width: 768px) {
  html, body {
    font-size: 16px;
  }
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .category-icon-wrap {
    width: 68px;
    height: 68px;
    font-size: 2.2rem;
  }
  .category-name {
    font-size: 1.15rem;
  }
  .category-desc {
    font-size: 0.82rem;
  }
  .canvas-tablet-container {
    height: 320px;
  }
  .memory-cards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
  .mascot-avatar {
    width: 74px;
    height: 74px;
  }
  .mascot-bubble {
    max-width: 200px;
    font-size: 0.9rem;
    padding: 8px 14px;
  }
}

@media (max-width: 480px) {
  .global-header {
    padding: 6px 8px;
    gap: 4px;
  }
  .header-left, .header-right {
    gap: 4px;
  }
  .header-btn,
  .btn-toggle-audio {
    width: 36px;
    height: 36px;
    min-height: 36px;
    min-width: 36px;
    font-size: 1.1rem;
  }
  .header-star-chip {
    padding: 3px 8px;
    font-size: 0.95rem;
    gap: 3px;
  }
  .category-grid {
    grid-template-columns: 1fr;
  }
  .canvas-tablet-container {
    height: 280px;
  }
  .matching-board {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .match-card {
    min-height: 68px;
    font-size: 1.6rem;
  }
}

@media (max-width: 380px) {
  .global-header {
    padding: 5px 4px;
    gap: 2px;
  }
  .header-left, .header-right {
    gap: 2px;
  }
  .header-btn,
  .btn-toggle-audio {
    width: 32px;
    height: 32px;
    min-height: 32px;
    min-width: 32px;
    font-size: 0.95rem;
  }
  .header-star-chip {
    padding: 2px 6px;
    font-size: 0.85rem;
  }
}

/* Alphabet Quick Picker Button */
.abc-picker-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 3px solid var(--btn-accent, #3B82F6);
  border-radius: 16px;
  padding: 10px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease;
}
.abc-picker-btn:hover {
  transform: scale(1.1);
}
.picker-letter {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--btn-accent, #3B82F6);
}
.picker-emoji {
  font-size: 1.6rem;
}

/* Voice Chooser Modal Items */
.voice-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
  border: 3px solid #E2E8F0;
  border-radius: 18px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}
.voice-item-card:hover {
  border-color: #3B82F6;
  background: #EFF6FF;
  transform: translateY(-2px);
}
.voice-item-card.active-voice {
  border-color: #10B981;
  background: #ECFDF5;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.voice-info-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.voice-avatar-emoji {
  font-size: 2.2rem;
}
.voice-name-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1E293B;
}
.voice-sub-text {
  font-size: 0.82rem;
  color: #64748B;
  font-weight: 600;
}
.voice-select-btn {
  background: #3B82F6;
  color: #ffffff;
  border: none;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: 99px;
  cursor: pointer;
  pointer-events: none;
}
.voice-item-card.active-voice .voice-select-btn {
  background: #10B981;
}


