/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Comfortaa', 'Segoe UI', sans-serif;
  background: #FFF5EE;
  min-height: 100vh;
  color: #3a2e4a;
  overflow-x: hidden;
  position: relative;
}
/* Fairytale multi-layer background with color blobs */
body::before {
  content: '';
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(255,182,193,0.35) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 85% 15%, rgba(173,216,230,0.35) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 50% 80%, rgba(255,218,185,0.4) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 20% 70%, rgba(221,160,221,0.25) 0%, transparent 50%),
    radial-gradient(ellipse 40% 30% at 75% 65%, rgba(144,238,144,0.2) 0%, transparent 50%);
  z-index: -3;
  pointer-events: none;
}
/* Decorative floating SVG illustrations */
body::after {
  content: '';
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.18;
  background:
    /* Cloud top-left */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 60'%3E%3Cellipse cx='40' cy='38' rx='38' ry='20' fill='%23c8b6e0'/%3E%3Cellipse cx='70' cy='30' rx='30' ry='22' fill='%23d4c4ec'/%3E%3Cellipse cx='30' cy='32' rx='22' ry='16' fill='%23d8caf0'/%3E%3Cellipse cx='85' cy='38' rx='25' ry='18' fill='%23cebee8'/%3E%3C/svg%3E") no-repeat 3% 8% / 160px auto,
    /* Star top-right */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Cpath d='M25 2l6.2 12.6L45 16.8l-10 9.7 2.4 13.8L25 33.8l-12.4 6.5L15 26.5l-10-9.7 13.8-2.2z' fill='%23F5C842' opacity='0.7'/%3E%3C/svg%3E") no-repeat 92% 5% / 45px auto,
    /* Pencil right */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 120'%3E%3Crect x='6' y='20' width='18' height='80' rx='2' fill='%23F5C842'/%3E%3Crect x='6' y='20' width='18' height='12' rx='2' fill='%23E8706A'/%3E%3Cpolygon points='6,100 24,100 15,118' fill='%23FFDAB9'/%3E%3Crect x='10' y='114' width='10' height='4' rx='1' fill='%234a3560'/%3E%3C/svg%3E") no-repeat 95% 35% / 28px auto,
    /* Heart center-left */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Cpath d='M25 45 C10 32 0 22 0 14 0 6.3 6.3 0 14 0c4.6 0 8.8 2.2 11 5.7C27.2 2.2 31.4 0 36 0 43.7 0 50 6.3 50 14c0 8-10 18-25 31z' fill='%23FFB6C1'/%3E%3C/svg%3E") no-repeat 6% 42% / 38px auto,
    /* Cloud bottom-right */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 70'%3E%3Cellipse cx='50' cy='45' rx='42' ry='22' fill='%23b8d8f0'/%3E%3Cellipse cx='85' cy='35' rx='35' ry='26' fill='%23c4e0f8'/%3E%3Cellipse cx='35' cy='38' rx='28' ry='18' fill='%23cce4fa'/%3E%3Cellipse cx='105' cy='45' rx='30' ry='20' fill='%23b8d8f0'/%3E%3C/svg%3E") no-repeat 88% 78% / 180px auto,
    /* Star mid-left */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Cpath d='M25 2l6.2 12.6L45 16.8l-10 9.7 2.4 13.8L25 33.8l-12.4 6.5L15 26.5l-10-9.7 13.8-2.2z' fill='%23E8706A' opacity='0.6'/%3E%3C/svg%3E") no-repeat 4% 65% / 35px auto,
    /* Paint palette center */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 70'%3E%3Cellipse cx='40' cy='38' rx='36' ry='28' fill='%23FFDAB9' opacity='0.8'/%3E%3Ccircle cx='25' cy='28' r='6' fill='%23E8706A' opacity='0.7'/%3E%3Ccircle cx='42' cy='22' r='5' fill='%235CB8D6' opacity='0.7'/%3E%3Ccircle cx='55' cy='30' r='5.5' fill='%23F5C842' opacity='0.7'/%3E%3Ccircle cx='50' cy='45' r='5' fill='%236BC67E' opacity='0.7'/%3E%3Ccircle cx='30' cy='48' r='4.5' fill='%23D4619B' opacity='0.7'/%3E%3Cellipse cx='18' cy='40' rx='5' ry='8' fill='%23FFF5EE'/%3E%3C/svg%3E") no-repeat 50% 92% / 70px auto,
    /* Rainbow arc top */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60'%3E%3Cpath d='M10 58 Q100-20 190 58' stroke='%23E8706A' stroke-width='4' fill='none' opacity='0.5'/%3E%3Cpath d='M18 58 Q100-10 182 58' stroke='%23F5C842' stroke-width='4' fill='none' opacity='0.5'/%3E%3Cpath d='M26 58 Q100 0 174 58' stroke='%235CB8D6' stroke-width='4' fill='none' opacity='0.4'/%3E%3Cpath d='M34 58 Q100 8 166 58' stroke='%236BC67E' stroke-width='4' fill='none' opacity='0.4'/%3E%3Cpath d='M42 58 Q100 16 158 58' stroke='%23D4619B' stroke-width='4' fill='none' opacity='0.3'/%3E%3C/svg%3E") no-repeat 60% 2% / 220px auto,
    /* Small star bottom-left */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath d='M15 1l3.7 7.6L27 10l-6 5.8 1.4 8.3L15 20.3l-7.4 3.8L9 15.8 3 10l8.3-1.4z' fill='%235CB8D6' opacity='0.6'/%3E%3C/svg%3E") no-repeat 12% 88% / 30px auto,
    /* Brush right-mid */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 100'%3E%3Crect x='8' y='0' width='8' height='55' rx='4' fill='%238B6CC1' opacity='0.7'/%3E%3Cpath d='M4 55 Q12 50 20 55 L20 75 Q12 85 4 75Z' fill='%23E8706A' opacity='0.6'/%3E%3C/svg%3E") no-repeat 97% 58% / 22px auto,
    /* Heart small top-center */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath d='M15 27 C6 19 0 13 0 8.5 0 3.8 3.8 0 8.5 0c2.8 0 5.3 1.3 6.5 3.4C16.2 1.3 18.7 0 21.5 0 26.2 0 30 3.8 30 8.5c0 4.5-6 10.5-15 18.5z' fill='%23D4619B' opacity='0.5'/%3E%3C/svg%3E") no-repeat 42% 15% / 24px auto;
  animation: floatDecor 20s ease-in-out infinite alternate;
}
@keyframes floatDecor {
  0% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-8px) translateX(4px); }
  50% { transform: translateY(-3px) translateX(-3px); }
  75% { transform: translateY(-10px) translateX(2px); }
  100% { transform: translateY(-5px) translateX(-2px); }
}
/* Sparkle dots layer */
.main::before {
  content: '';
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle 3px at 10% 15%, rgba(255,215,0,0.45) 0%, transparent 100%),
    radial-gradient(circle 2px at 25% 35%, rgba(255,182,193,0.5) 0%, transparent 100%),
    radial-gradient(circle 3px at 40% 10%, rgba(173,216,230,0.4) 0%, transparent 100%),
    radial-gradient(circle 2px at 55% 45%, rgba(255,218,185,0.45) 0%, transparent 100%),
    radial-gradient(circle 3px at 70% 20%, rgba(221,160,221,0.35) 0%, transparent 100%),
    radial-gradient(circle 2px at 85% 40%, rgba(144,238,144,0.4) 0%, transparent 100%),
    radial-gradient(circle 2px at 15% 60%, rgba(255,215,0,0.35) 0%, transparent 100%),
    radial-gradient(circle 3px at 90% 70%, rgba(255,182,193,0.35) 0%, transparent 100%),
    radial-gradient(circle 2px at 35% 75%, rgba(173,216,230,0.35) 0%, transparent 100%),
    radial-gradient(circle 3px at 60% 85%, rgba(255,218,185,0.25) 0%, transparent 100%);
  animation: sparkle 8s ease-in-out infinite alternate;
}
@keyframes sparkle {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
img { max-width: 100%; display: block; }

/* ===== HEADER ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 5l2.5 5 5.5 0.8-4 3.9 0.9 5.5L20 17.5l-4.9 2.7 0.9-5.5-4-3.9 5.5-0.8z' fill='%23F5C842' opacity='0.12'/%3E%3C/svg%3E") 30px center / 28px auto no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 5l2.5 5 5.5 0.8-4 3.9 0.9 5.5L20 17.5l-4.9 2.7 0.9-5.5-4-3.9 5.5-0.8z' fill='%23FFB6C1' opacity='0.12'/%3E%3C/svg%3E") calc(100% - 40px) center / 22px auto no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 64'%3E%3Ccircle cx='80' cy='50' r='2' fill='%23E8706A' opacity='0.15'/%3E%3Ccircle cx='180' cy='20' r='1.5' fill='%23F5C842' opacity='0.18'/%3E%3Ccircle cx='280' cy='45' r='2' fill='%235CB8D6' opacity='0.15'/%3E%3Ccircle cx='380' cy='15' r='1.5' fill='%23D4619B' opacity='0.15'/%3E%3Ccircle cx='460' cy='48' r='2' fill='%236BC67E' opacity='0.15'/%3E%3Ccircle cx='540' cy='22' r='1.5' fill='%23FFB6C1' opacity='0.18'/%3E%3Ccircle cx='130' cy='35' r='1' fill='%238B6CC1' opacity='0.12'/%3E%3Ccircle cx='330' cy='32' r='1' fill='%23FFDAB9' opacity='0.2'/%3E%3Ccircle cx='500' cy='38' r='1.2' fill='%23E8706A' opacity='0.12'/%3E%3C/svg%3E") center / 600px 64px repeat-x,
    rgba(255,250,245,0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 2px 24px rgba(180,140,120,0.1);
  height: 64px;
  border-bottom: 2px solid rgba(255,200,160,0.3);
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 0 20px; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: flex; align-items: baseline; gap: 0;
  font-family: 'Baloo 2', cursive; font-weight: 800;
  font-size: 28px;
  transition: transform 0.2s;
}
.logo:hover { transform: scale(1.05); }
.logo-draw { color: #4a3560; letter-spacing: -0.5px; }
.logo-d, .logo-o1, .logo-o2 {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  color: #fff; font-size: 22px; font-weight: 800;
  margin-left: 2px; line-height: 1;
}
.logo-d { background: #E8706A; }
.logo-o1 { background: #F5C842; color: #5a4520; }
.logo-o2 { background: #5CB8D6; }

.nav { display: flex; gap: 8px; }
.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 20px; border-radius: 50px;
  font-weight: 600; font-size: 14px;
  color: #8a7a9a; transition: all 0.3s;
  border: 2px solid transparent;
}
.nav-link:hover {
  color: #E8706A;
  background: rgba(232,112,106,0.08);
}
.nav-link.active {
  background: linear-gradient(135deg, #FFDAB9, #FFB6C1);
  color: #6a3a4a;
  border-color: rgba(255,182,193,0.5);
  box-shadow: 0 4px 16px rgba(255,182,193,0.25);
}
.nav-icon { font-size: 17px; }

.menu-toggle { display: none; width: 32px; height: 24px; position: relative; }
.menu-toggle span {
  display: block; width: 100%; height: 3px;
  background: #E8706A; border-radius: 3px;
  position: absolute; left: 0;
  transition: all 0.3s;
}
.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.menu-toggle span:nth-child(3) { bottom: 0; }

/* ===== BOTTOM NAV (mobile) ===== */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,250,245,0.92);
  backdrop-filter: blur(20px);
  box-shadow: 0 -2px 20px rgba(180,140,120,0.1);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  justify-content: space-around;
  border-top: 2px solid rgba(255,200,160,0.2);
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 6px 16px; border-radius: 16px;
  font-size: 11px; font-weight: 600; color: #b0a0b8;
  transition: all 0.2s;
}
.bottom-nav-item.active { color: #E8706A; }
.bottom-nav-item.active .bottom-nav-icon { transform: scale(1.2); }
.bottom-nav-icon { font-size: 22px; transition: transform 0.2s; }

/* ===== MAIN ===== */
.main {
  max-width: 1400px; margin: 0 auto;
  padding: 84px 20px 40px;
  min-height: 100vh;
}

/* ===== HERO ===== */
.hero {
  text-align: center; padding: 30px 20px 40px;
  animation: fadeInUp 0.6s ease;
  position: relative;
}
.hero-title {
  font-family: 'Baloo 2', cursive;
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 800;
  background: linear-gradient(135deg, #E8706A, #D4619B, #8B6CC1, #5CB8D6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2; margin-bottom: 12px;
}
.hero-subtitle {
  font-size: clamp(15px, 2.2vw, 20px);
  color: #8a7a9a;
  font-weight: 400; max-width: 550px; margin: 0 auto 30px;
}
.hero-stats {
  display: flex; justify-content: center; gap: 20px; flex-wrap: wrap;
}
.hero-stat {
  background: #fff;
  border-radius: 20px; padding: 16px 28px;
  text-align: center;
  border: 2px solid rgba(255,200,180,0.4);
  box-shadow: 0 4px 20px rgba(232,112,106,0.08);
  transition: transform 0.2s;
}
.hero-stat:hover { transform: translateY(-3px); }
.hero-stat:nth-child(1) { border-color: rgba(255,182,193,0.5); }
.hero-stat:nth-child(2) { border-color: rgba(173,216,230,0.5); }
.hero-stat:nth-child(3) { border-color: rgba(144,238,144,0.5); }
.hero-stat-number {
  font-family: 'Baloo 2', cursive;
  font-size: 32px; font-weight: 800;
  background: linear-gradient(135deg, #E8706A, #D4619B);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.hero-stat:nth-child(2) .hero-stat-number {
  background: linear-gradient(135deg, #5CB8D6, #6B9FD6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-stat:nth-child(3) .hero-stat-number {
  background: linear-gradient(135deg, #6BC67E, #45B88A);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-stat-label { font-size: 12px; color: #a098aa; margin-top: 4px; font-weight: 500; }

/* ===== THEME CHIPS ===== */
.themes-section { margin-bottom: 32px; }
.themes-title {
  font-family: 'Baloo 2', cursive;
  font-size: 22px; font-weight: 700; color: #5a4570;
  margin-bottom: 14px;
}
.theme-chips {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.theme-chip {
  padding: 9px 20px; border-radius: 50px;
  font-size: 14px; font-weight: 600;
  background: #fff;
  color: #7a6a8a; cursor: pointer;
  border: 2px solid rgba(200,180,220,0.3);
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.theme-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(232,112,106,0.4);
  box-shadow: 0 6px 20px rgba(232,112,106,0.1);
  color: #E8706A;
}
.theme-chip.active {
  background: linear-gradient(135deg, #FFD6CC, #FFB6C1, #E8C5F0);
  color: #6a3a50;
  border-color: rgba(255,182,193,0.6);
  box-shadow: 0 4px 16px rgba(255,182,193,0.3);
}
.theme-emoji { margin-right: 6px; }

/* ===== CATEGORY GRID ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  animation: fadeInUp 0.5s ease;
}
/* Pastel color palette for card borders */
.category-card {
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 3px 16px rgba(0,0,0,0.05);
  position: relative;
  border: 2.5px solid rgba(200,180,220,0.25);
}
.category-card:nth-child(6n+1) { border-color: rgba(255,182,193,0.45); }
.category-card:nth-child(6n+2) { border-color: rgba(173,216,230,0.45); }
.category-card:nth-child(6n+3) { border-color: rgba(255,218,185,0.5); }
.category-card:nth-child(6n+4) { border-color: rgba(221,160,221,0.4); }
.category-card:nth-child(6n+5) { border-color: rgba(144,238,144,0.4); }
.category-card:nth-child(6n+6) { border-color: rgba(255,215,0,0.35); }
.category-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 36px rgba(232,112,106,0.12);
}
.category-card-img {
  width: 100%; aspect-ratio: 1;
  object-fit: cover;
  background: linear-gradient(135deg, #FFF0E6, #FFE4EC, #E8F4FD);
}
.category-card-body { padding: 14px 16px; }
.category-card-name {
  font-family: 'Baloo 2', cursive;
  font-size: 16px; font-weight: 700;
  color: #4a3560; line-height: 1.2;
  margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.category-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: #b0a0b8;
}
.category-card-count {
  background: linear-gradient(135deg, #FFB6C1, #FFDAB9);
  color: #6a3a4a; padding: 3px 12px;
  border-radius: 50px; font-weight: 700; font-size: 11px;
}
.category-card-theme {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255,255,255,0.9); backdrop-filter: blur(8px);
  padding: 4px 10px; border-radius: 50px;
  font-size: 11px; font-weight: 600; color: #E8706A;
}

/* ===== CATEGORY PAGE ===== */
.category-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 30px; animation: fadeInUp 0.4s ease;
}
.back-btn {
  width: 48px; height: 48px;
  background: #fff;
  border-radius: 16px; display: flex;
  align-items: center; justify-content: center;
  font-size: 24px; transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  border: 2px solid rgba(255,200,180,0.3);
  flex-shrink: 0; color: #E8706A;
}
.back-btn:hover { transform: scale(1.05); border-color: #FFB6C1; }
.category-info { flex: 1; }
.category-page-title {
  font-family: 'Baloo 2', cursive;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800; color: #4a3560;
  line-height: 1.1;
}
.category-page-count {
  font-size: 14px; color: #a098aa;
  margin-top: 4px;
}

.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.lesson-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden; cursor: pointer;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 3px 14px rgba(0,0,0,0.05);
  position: relative;
  border: 2px solid rgba(200,180,220,0.2);
}
.lesson-card:nth-child(5n+1) { border-color: rgba(255,218,185,0.45); }
.lesson-card:nth-child(5n+2) { border-color: rgba(173,216,230,0.45); }
.lesson-card:nth-child(5n+3) { border-color: rgba(255,182,193,0.4); }
.lesson-card:nth-child(5n+4) { border-color: rgba(144,238,144,0.4); }
.lesson-card:nth-child(5n+5) { border-color: rgba(221,160,221,0.4); }
.lesson-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(232,112,106,0.1);
}
.lesson-card.completed::after {
  content: '✅'; position: absolute; top: 8px; right: 8px;
  font-size: 24px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.lesson-card-img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  background: linear-gradient(135deg, #FFF5EE, #FFE8F0, #EEF5FF);
}
.lesson-card-body { padding: 12px 14px; }
.lesson-card-name {
  font-family: 'Baloo 2', cursive;
  font-size: 14px; font-weight: 700; color: #4a3560;
  margin-bottom: 6px; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.lesson-card-stars { font-size: 14px; letter-spacing: 1px; }

/* ===== LESSON VIEWER ===== */
.lesson-viewer {
  animation: fadeInUp 0.4s ease;
  max-width: 800px; margin: 0 auto;
}
.lesson-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px;
}
.lesson-title {
  font-family: 'Baloo 2', cursive;
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800; color: #4a3560;
  flex: 1;
}
.lesson-stars-badge {
  background: linear-gradient(135deg, #FFF5EE, #FFE8F0);
  padding: 8px 16px; border-radius: 50px;
  font-size: 18px;
  border: 2px solid rgba(255,200,180,0.3);
}

/* Step display */
.step-container {
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 6px 32px rgba(0,0,0,0.06);
  border: 2.5px solid rgba(255,200,180,0.3);
  position: relative;
}
.step-image-wrapper {
  position: relative; width: 100%;
  aspect-ratio: 1; overflow: hidden;
  background: #FFFAF7;
  touch-action: pan-y;
}
.step-image {
  width: 100%; height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}
.step-image.loading { opacity: 0; }

.step-nav-btn {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 50px; height: 50px;
  background: rgba(255,255,255,0.92);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; z-index: 10;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border: 2px solid rgba(255,200,180,0.3);
  color: #E8706A;
  transition: all 0.2s;
}
.step-nav-btn:hover { transform: translateY(-50%) scale(1.1); background: #fff; border-color: #FFB6C1; }
.step-nav-btn.prev { left: 12px; }
.step-nav-btn.next { right: 12px; }
.step-nav-btn:disabled { opacity: 0.3; pointer-events: none; }

/* Progress bar */
.step-progress {
  padding: 16px 20px;
  display: flex; align-items: center; gap: 14px;
}
.step-progress-bar {
  flex: 1; height: 10px;
  background: #F5F0EB; border-radius: 10px;
  overflow: hidden;
}
.step-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FFB6C1, #E8706A, #D4619B);
  border-radius: 10px;
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.step-counter {
  font-family: 'Baloo 2', cursive;
  font-size: 16px; font-weight: 700; color: #E8706A;
  white-space: nowrap;
}

/* Step thumbnails */
.step-thumbnails {
  display: flex; gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #e8d8d0 #f5f0eb;
  -webkit-overflow-scrolling: touch;
}
.step-thumbnails::-webkit-scrollbar { height: 4px; }
.step-thumbnails::-webkit-scrollbar-track { background: #f5f0eb; border-radius: 4px; }
.step-thumbnails::-webkit-scrollbar-thumb { background: #e8d8d0; border-radius: 4px; }

.step-thumb {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 12px; overflow: hidden;
  border: 3px solid transparent;
  cursor: pointer; transition: all 0.2s;
  background: #FFF5EE;
}
.step-thumb img { width: 100%; height: 100%; object-fit: cover; }
.step-thumb.active {
  border-color: #E8706A;
  box-shadow: 0 2px 10px rgba(232,112,106,0.25);
  transform: scale(1.08);
}
.step-thumb:hover { border-color: #FFB6C1; }

/* Completion */
.lesson-complete-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(60,40,70,0.4);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  animation: fadeIn 0.3s ease;
}
.lesson-complete-modal {
  background: #fff; border-radius: 28px;
  padding: 40px; text-align: center;
  max-width: 360px; width: 90%;
  border: 3px solid rgba(255,182,193,0.4);
  box-shadow: 0 20px 60px rgba(232,112,106,0.15);
  animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.lesson-complete-emoji { font-size: 64px; margin-bottom: 16px; }
.lesson-complete-title {
  font-family: 'Baloo 2', cursive;
  font-size: 28px; font-weight: 800;
  color: #4a3560; margin-bottom: 8px;
}
.lesson-complete-text { font-size: 15px; color: #a098aa; margin-bottom: 24px; }
.lesson-complete-btn {
  padding: 14px 36px; border-radius: 50px;
  background: linear-gradient(135deg, #FFB6C1, #E8706A);
  color: #fff; font-weight: 700; font-size: 16px;
  font-family: 'Comfortaa', sans-serif;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(232,112,106,0.3);
  border: none;
}
.lesson-complete-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(232,112,106,0.4); }

/* ===== SEARCH / EXPLORE PAGE ===== */
.explore-page { animation: fadeInUp 0.4s ease; }
.search-wrapper {
  max-width: 600px; margin: 0 auto 30px;
  position: relative;
}
.search-input {
  width: 100%; padding: 16px 24px 16px 52px;
  border: 2.5px solid rgba(255,200,180,0.35);
  border-radius: 50px;
  font-family: 'Comfortaa', sans-serif;
  font-size: 16px; font-weight: 500;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  outline: none; transition: all 0.3s;
  color: #4a3560;
}
.search-input:focus {
  box-shadow: 0 6px 30px rgba(232,112,106,0.12);
  border-color: #FFB6C1;
}
.search-input::placeholder { color: #c0b0c8; }
.search-icon {
  position: absolute; left: 20px; top: 50%;
  transform: translateY(-50%);
  font-size: 20px; pointer-events: none;
}

/* ===== PROGRESS PAGE ===== */
.progress-page { animation: fadeInUp 0.4s ease; }
.progress-hero {
  text-align: center; margin-bottom: 40px;
}
.progress-hero-emoji { font-size: 64px; margin-bottom: 16px; }
.progress-hero-title {
  font-family: 'Baloo 2', cursive;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  background: linear-gradient(135deg, #E8706A, #D4619B, #8B6CC1);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.progress-stats {
  display: flex; justify-content: center; gap: 20px;
  flex-wrap: wrap; margin-top: 24px;
}
.progress-stat-card {
  background: #fff;
  border: 2.5px solid rgba(255,200,180,0.35);
  border-radius: 20px; padding: 20px 28px;
  text-align: center; min-width: 140px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.progress-stat-number {
  font-family: 'Baloo 2', cursive;
  font-size: 36px; font-weight: 800;
  background: linear-gradient(135deg, #E8706A, #D4619B);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.progress-stat-label { font-size: 13px; color: #a098aa; margin-top: 4px; }

.progress-section-title {
  font-family: 'Baloo 2', cursive;
  font-size: 22px; font-weight: 700; color: #5a4570;
  margin: 30px 0 16px;
}
.progress-empty {
  text-align: center; padding: 60px 20px;
  color: #b0a0b8;
  font-size: 16px;
}
.progress-empty-emoji { font-size: 48px; margin-bottom: 12px; }

/* ===== ADS ===== */
.ad-container {
  max-width: 728px;
  margin: 0 auto;
  padding: 0;
  text-align: center;
  overflow: hidden;
}
.ad-in-grid {
  grid-column: 1 / -1;
  max-width: 728px;
  margin: 0 auto;
  padding: 0;
  text-align: center;
  overflow: hidden;
}
.ad-container.ad-filled { margin: 24px auto; }
.ad-in-grid.ad-filled { margin: 12px auto; }

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

/* ===== LOADING ===== */
.skeleton {
  background: linear-gradient(90deg, #f5ece6 25%, #fff5ee 50%, #f5ece6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.5); }
  60% { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.fade-enter { animation: fadeInUp 0.35s ease forwards; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav { display: none; }
  .menu-toggle { display: flex; flex-direction: column; justify-content: space-between; }
  .bottom-nav { display: flex; }
  .main { padding-bottom: 90px; }
  .hero { padding: 20px 10px 30px; }
  .hero-stats { gap: 12px; }
  .hero-stat { padding: 12px 20px; }
  .hero-stat-number { font-size: 24px; }
  .categories-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .category-card-body { padding: 10px 12px; }
  .category-card-name { font-size: 14px; }
  .category-card-theme { display: none; }
  .lessons-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .step-nav-btn { width: 40px; height: 40px; font-size: 18px; }
  .step-nav-btn.prev { left: 6px; }
  .step-nav-btn.next { right: 6px; }
  .step-thumb { width: 48px; height: 48px; }
  .lesson-complete-modal { padding: 30px; }
}

@media (max-width: 480px) {
  .header { height: 56px; }
  .main { padding-top: 72px; }
  .logo { font-size: 20px; }
  .logo-d, .logo-o1, .logo-o2 { width: 24px; height: 24px; font-size: 17px; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .lessons-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .lesson-card-body { padding: 8px 10px; }
  .lesson-card-name { font-size: 13px; }
  .theme-chip { padding: 8px 16px; font-size: 13px; }
  .back-btn { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; }
}

@media (min-width: 1024px) {
  .categories-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .step-container { border-radius: 28px; }
}

/* ===== SCROLLBAR GLOBAL ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(232,112,106,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(232,112,106,0.4); }
