/* ==========================================================================
   ASPovo Kids – Ramayana Kids' Adventure
   Original Watercolor Storybook Design System
   ========================================================================== */

:root {
  --bg-cream: #FFFBF2;
  --bg-paper: #FFFFFF;
  --ink-dark: #1E293B;
  --ink-muted: #475569;

  --saffron: #F97316;
  --saffron-dark: #EA580C;
  --gold: #FBBF24;
  --gold-soft: #FEF3C7;
  --sky: #38BDF8;
  --sky-soft: #E0F2FE;
  --mint: #10B981;
  --mint-soft: #DCFCE7;
  --pink: #FB7185;
  --pink-soft: #FFE4E6;
  --purple: #8B5CF6;
  --purple-soft: #EDE9FE;
  --teal: #0D9488;
  --teal-soft: #CCFBF1;

  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --shadow-soft: 0 12px 30px rgba(30, 41, 59, 0.08);
  --shadow-card: 0 10px 24px rgba(249, 115, 22, 0.10);

  --font-display: 'Fredoka', 'Noto Sans Devanagari', system-ui, -apple-system, sans-serif;
  --font-body: 'Nunito', 'Noto Sans Devanagari', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-dark);
  background-color: var(--bg-cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, h4, .brand-text strong, .btn {
  font-family: var(--font-display);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ==========================================================================
   Watercolor Backdrop, Stars & Clouds
   ========================================================================== */

.sky-backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(254, 240, 138, 0.55) 0%, transparent 45%),
    radial-gradient(circle at 88% 12%, rgba(186, 230, 253, 0.65) 0%, transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(254, 205, 211, 0.55) 0%, transparent 45%),
    radial-gradient(circle at 18% 85%, rgba(167, 243, 208, 0.55) 0%, transparent 45%),
    #FFFBF2;
}

.wc-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(45px);
  opacity: 0.45;
  animation: floatSlow 14s ease-in-out infinite alternate;
}

.blob-1 { width: 320px; height: 320px; background: #FDE68A; top: -60px; left: -60px; }
.blob-2 { width: 360px; height: 360px; background: #BAE6FD; top: 15%; right: -90px; animation-delay: 2s; }
.blob-3 { width: 300px; height: 300px; background: #FBCFE8; bottom: -60px; left: 20%; animation-delay: 4s; }
.blob-4 { width: 280px; height: 280px; background: #BBF7D0; bottom: 10%; right: 12%; animation-delay: 6s; }

.floating-star {
  position: absolute;
  color: #F59E0B;
  font-size: 1.5rem;
  opacity: 0.55;
  animation: twinkle 3.6s ease-in-out infinite;
}
.star-1 { top: 14%; left: 8%; }
.star-2 { top: 24%; right: 14%; color: #FB7185; animation-delay: 1s; }
.star-3 { top: 60%; left: 5%; color: #38BDF8; animation-delay: 2s; }
.star-4 { top: 75%; right: 8%; animation-delay: 0.6s; }
.star-5 { top: 42%; right: 4%; color: #10B981; animation-delay: 1.6s; }

.cloud {
  position: absolute;
  width: 140px;
  height: 48px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  animation: drift 32s linear infinite;
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.cloud::before { width: 65px; height: 65px; top: -28px; left: 22px; }
.cloud::after { width: 48px; height: 48px; top: -18px; right: 24px; }
.cloud-1 { top: 9%; left: -160px; }
.cloud-2 { top: 28%; left: -180px; animation-duration: 42s; animation-delay: 10s; transform: scale(0.8); }

#celebrationCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

@keyframes floatSlow {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(22px, 18px) scale(1.06); }
}

@keyframes twinkle {
  0%, 100% { transform: scale(0.9) rotate(0deg); opacity: 0.35; }
  50% { transform: scale(1.25) rotate(12deg); opacity: 0.85; }
}

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 340px)); }
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 251, 242, 0.90);
  backdrop-filter: blur(12px);
  border-bottom: 3px solid rgba(251, 191, 36, 0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 74px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-dark);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 1.2rem;
  color: var(--saffron-dark);
}

.brand-text small {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  background: transparent;
  border: 2px solid transparent;
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--ink-dark);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: var(--gold-soft);
}

.nav-link.active {
  background: var(--saffron);
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.28);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.unlock-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.unlock-pill.locked {
  background: var(--pink-soft);
  color: #BE123C;
}

.unlock-pill.unlocked {
  background: var(--mint-soft);
  color: #047857;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid #F59E0B;
  background: #FFFBEB;
  color: var(--ink-dark);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.lang-btn:hover {
  background: var(--gold-soft);
  transform: translateY(-1px);
}

.mobile-menu-btn {
  display: none;
  background: var(--gold-soft);
  border: 2px solid #F59E0B;
  border-radius: 12px;
  font-size: 1.35rem;
  padding: 4px 10px;
  cursor: pointer;
}

/* ==========================================================================
   Buttons & Reusable Components
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.btn:active {
  transform: translateY(1px);
}

.btn-lg {
  padding: 14px 26px;
  font-size: 1.08rem;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.9rem;
}

.btn-primary {
  background: linear-gradient(135deg, #F97316, #FB923C);
  color: #FFFFFF;
  box-shadow: 0 5px 0 #C2410C, 0 10px 20px rgba(249, 115, 22, 0.25);
}

.btn-secondary {
  background: linear-gradient(135deg, #38BDF8, #0EA5E9);
  color: #FFFFFF;
  box-shadow: 0 5px 0 #0369A1, 0 10px 18px rgba(14, 165, 233, 0.25);
}

.btn-mint {
  background: linear-gradient(135deg, #34D399, #10B981);
  color: #FFFFFF;
  box-shadow: 0 5px 0 #047857, 0 10px 18px rgba(16, 185, 129, 0.22);
}

.btn-pink {
  background: linear-gradient(135deg, #FB7185, #F43F5E);
  color: #FFFFFF;
  box-shadow: 0 5px 0 #BE123C, 0 10px 18px rgba(244, 63, 94, 0.22);
}

.btn-soft {
  background: #F1F5F9;
  color: var(--ink-dark);
  border: 2px solid #CBD5E1;
}

/* ==========================================================================
   Main Sections & Homepage
   ========================================================================== */

.main-content {
  flex: 1;
  padding-top: 28px;
  padding-bottom: 54px;
}

.page-section {
  display: none;
  animation: fadeSlideIn 0.35s ease;
}

.page-section.active {
  display: block;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-card {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(254, 249, 195, 0.72));
  border: 3px solid #FDE68A;
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-soft);
}

.hero-pill {
  display: inline-block;
  background: var(--sky-soft);
  color: #0369A1;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hero-title {
  margin: 0 0 8px;
  font-size: clamp(1.9rem, 3.6vw, 2.85rem);
  line-height: 1.15;
  color: #C2410C;
}

.hero-bilingual-sub {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--teal);
}

.hero-subtitle {
  margin: 0 0 24px;
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.storybook-svg {
  width: 100%;
  max-width: 410px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 12px 18px rgba(15, 23, 42, 0.08));
}

.unlock-feature-banner {
  margin-top: 28px;
  background: linear-gradient(135deg, #EDE9FE, #FCE7F3);
  border: 3px solid #DDD6FE;
  border-radius: var(--radius-md);
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-soft);
}

.unlock-banner-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.unlock-banner-copy h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  color: #5B21B6;
}

.unlock-banner-copy p {
  margin: 0;
  color: var(--ink-muted);
  font-weight: 600;
}

.section-heading-wrap {
  text-align: center;
  margin: 38px 0 24px;
}

.section-title {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  color: #1E3A8A;
}

.section-subtitle {
  margin: 0;
  color: var(--ink-muted);
  font-size: 1.08rem;
  font-weight: 600;
}

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* Adventure Cards Grid */
.adventure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 20px;
}

.adv-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 24px;
  border: 3px solid transparent;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.adv-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 34px rgba(30, 41, 59, 0.12);
}

.adv-emoji {
  font-size: 2.6rem;
  margin-bottom: 10px;
}

.adv-card h3 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.adv-card p {
  margin: 0 0 16px;
  color: var(--ink-muted);
  font-weight: 600;
  flex: 1;
}

.adv-cta {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

.theme-orange { background: linear-gradient(180deg, #FFF7ED, #FFFFFF); border-color: #FED7AA; }
.theme-orange .adv-cta { color: #EA580C; }

.theme-sky { background: linear-gradient(180deg, #F0F9FF, #FFFFFF); border-color: #BAE6FD; }
.theme-sky .adv-cta { color: #0284C7; }

.theme-mint { background: linear-gradient(180deg, #ECFDF5, #FFFFFF); border-color: #A7F3D0; }
.theme-mint .adv-cta { color: #059669; }

.theme-purple { background: linear-gradient(180deg, #F5F3FF, #FFFFFF); border-color: #DDD6FE; }
.theme-purple .adv-cta { color: #7C3AED; }

.theme-gold { background: linear-gradient(180deg, #FEFCE8, #FFFFFF); border-color: #FDE047; }
.theme-gold .adv-cta { color: #CA8A04; }

.theme-pink { background: linear-gradient(180deg, #FFF1F2, #FFFFFF); border-color: #FECDD3; }
.theme-pink .adv-cta { color: #E11D48; }

.theme-teal { background: linear-gradient(180deg, #F0FDFA, #FFFFFF); border-color: #99F6E4; }
.theme-teal .adv-cta { color: #0F766E; }

/* ==========================================================================
   Book Access Page
   ========================================================================== */

.book-access-card {
  max-width: 620px;
  margin: 20px auto;
  background: rgba(255, 255, 255, 0.96);
  border: 4px solid #FDE68A;
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.book-code-form {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.code-input {
  width: 100%;
  max-width: 360px;
  padding: 16px 20px;
  font-size: 1.25rem;
  font-family: var(--font-display);
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: 3px solid #FCD34D;
  border-radius: 999px;
  background: #FFFBEB;
  color: var(--ink-dark);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.code-input:focus {
  border-color: var(--saffron);
  box-shadow: 0 0 0 5px rgba(249, 115, 22, 0.16);
}

.code-feedback {
  margin-top: 18px;
  font-weight: 800;
  font-size: 1.05rem;
  min-height: 28px;
}

.code-feedback.error {
  color: #E11D48;
  background: #FFE4E6;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
}

.code-feedback.success {
  color: #047857;
  background: #DCFCE7;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
}

.unlocked-banner {
  margin-top: 22px;
  padding: 18px;
  background: var(--mint-soft);
  border-radius: var(--radius-md);
  border: 2px solid #6EE7B7;
}

.unlocked-banner p {
  margin: 0 0 12px;
  font-weight: 800;
  color: #065F46;
}

/* ==========================================================================
   Shared Game Shell
   ========================================================================== */

.game-shell {
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid #E2E8F0;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-soft);
}

.game-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 2px dashed #E2E8F0;
  margin-bottom: 18px;
}

.game-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  color: #C2410C;
}

.stats-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-pill {
  background: #FEF3C7;
  border: 2px solid #FDE68A;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 800;
  color: #92400E;
}

.game-instruction {
  background: #F0F9FF;
  border-left: 5px solid #38BDF8;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  color: #0C4A6E;
  margin: 0 0 22px;
}

.win-banner {
  margin-top: 22px;
  background: linear-gradient(135deg, #DCFCE7, #FEF9C3);
  border: 3px solid #34D399;
  border-radius: var(--radius-md);
  padding: 22px;
  text-align: center;
}

.win-banner h3 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  color: #065F46;
}

.win-banner p {
  margin: 0 0 14px;
  font-weight: 700;
}

/* ==========================================================================
   3. Ramayana Quiz
   ========================================================================== */

.progress-wrap {
  margin-bottom: 20px;
}

.progress-label {
  font-weight: 800;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.progress-track {
  width: 100%;
  height: 16px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #F97316, #FBBF24, #10B981);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.quiz-question-card {
  background: linear-gradient(135deg, #FFFBEB, #FFF7ED);
  border: 3px solid #FDE68A;
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
}

.quiz-q-main {
  margin: 0 0 8px;
  font-size: 1.45rem;
  color: var(--ink-dark);
}

.quiz-q-hi {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--teal);
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.quiz-opt-btn {
  text-align: left;
  background: #FFFFFF;
  border: 3px solid #CBD5E1;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-dark);
  cursor: pointer;
  transition: all 0.16s ease;
}

.quiz-opt-btn:hover:not(:disabled) {
  border-color: var(--saffron);
  background: #FFF7ED;
  transform: translateY(-2px);
}

.quiz-opt-btn.correct {
  background: #DCFCE7;
  border-color: #10B981;
  color: #065F46;
}

.quiz-opt-btn.wrong {
  background: #FFE4E6;
  border-color: #FB7185;
  color: #9F1239;
}

.quiz-feedback {
  margin-top: 18px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.quiz-feedback.good {
  background: #DCFCE7;
  border: 2px solid #34D399;
  color: #065F46;
}

.quiz-feedback.oops {
  background: #FEF2F2;
  border: 2px solid #FCA5A5;
  color: #991B1B;
}

.quiz-controls {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

.result-screen {
  text-align: center;
  padding: 32px 16px;
}

.result-stars {
  font-size: 3.4rem;
  margin-bottom: 10px;
}

.result-score-text {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--saffron-dark);
}

.result-encourage {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 24px;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ==========================================================================
   4. Hanuman Maze Game
   ========================================================================== */

.maze-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
}

.maze-board-wrap {
  display: flex;
  justify-content: center;
}

.maze-grid {
  display: grid;
  grid-template-columns: repeat(11, 36px);
  grid-template-rows: repeat(11, 36px);
  gap: 2px;
  background: #BAE6FD;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 4px solid #38BDF8;
  touch-action: none;
  user-select: none;
}

.maze-cell {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.maze-cell.wall {
  background: linear-gradient(135deg, #0284C7, #0369A1);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

.maze-cell.path {
  background: #FFFBEB;
}

.maze-cell.player {
  background: #FDE68A;
  animation: popIn 0.2s ease;
}

.maze-cell.goal {
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
}

.maze-grid.bump {
  animation: shake 0.24s ease;
}

.maze-controls-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.maze-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.legend-item {
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
}

.dpad {
  display: grid;
  grid-template-columns: 64px 64px 64px;
  grid-template-rows: 64px 64px 64px;
  gap: 8px;
}

.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 3; }

.dpad-btn {
  background: linear-gradient(180deg, #FEF3C7, #FDE68A);
  border: 3px solid #F59E0B;
  border-radius: 18px;
  font-size: 1.5rem;
  color: #92400E;
  cursor: pointer;
  box-shadow: 0 4px 0 #D97706;
}

.dpad-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #D97706;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes popIn {
  from { transform: scale(0.8); }
  to { transform: scale(1); }
}

/* ==========================================================================
   5. Word Search Puzzle
   ========================================================================== */

.ws-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 26px;
  align-items: start;
}

.ws-grid {
  display: grid;
  grid-template-columns: repeat(12, 36px);
  gap: 4px;
  background: #ECFDF5;
  border: 4px solid #6EE7B7;
  padding: 12px;
  border-radius: var(--radius-md);
  user-select: none;
  touch-action: none;
}

.ws-cell {
  width: 36px;
  height: 36px;
  background: #FFFFFF;
  border: 2px solid #D1FAE5;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-dark);
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}

.ws-cell.selecting {
  background: #FDE68A;
  border-color: #F59E0B;
  transform: scale(1.06);
}

.ws-cell.found-0 { background: #FED7AA; border-color: #FB923C; }
.ws-cell.found-1 { background: #BAE6FD; border-color: #38BDF8; }
.ws-cell.found-2 { background: #FBCFE8; border-color: #F472B6; }
.ws-cell.found-3 { background: #DDD6FE; border-color: #A78BFA; }
.ws-cell.found-4 { background: #A7F3D0; border-color: #10B981; }
.ws-cell.found-5 { background: #FEF08A; border-color: #EAB308; }
.ws-cell.found-6 { background: #FECDD3; border-color: #FB7185; }
.ws-cell.found-7 { background: #99F6E4; border-color: #14B8A6; }

.ws-sidebar {
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 18px;
}

.ws-sidebar h3 {
  margin: 0 0 12px;
  color: #0F766E;
}

.ws-word-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 8px;
}

.ws-word-item {
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  border-radius: 12px;
  padding: 8px 12px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.ws-word-item.found {
  background: #DCFCE7;
  border-color: #10B981;
  color: #065F46;
  text-decoration: line-through;
}

/* ==========================================================================
   6. Character Matching Game
   ========================================================================== */

.match-columns {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 22px;
}

.match-col-title {
  margin: 0 0 12px;
  color: #6D28D9;
  font-size: 1.2rem;
}

.match-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.match-card {
  width: 100%;
  text-align: left;
  background: #FFFFFF;
  border: 3px solid #DDD6FE;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.16s ease;
}

.match-card:hover:not(:disabled) {
  border-color: var(--purple);
  background: #F5F3FF;
}

.match-card.selected {
  border-color: var(--saffron);
  background: #FFF7ED;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2);
}

.match-card.matched {
  background: #DCFCE7;
  border-color: #10B981;
  color: #065F46;
  cursor: default;
}

.match-card.wrong {
  background: #FFE4E6;
  border-color: #FB7185;
  animation: shake 0.28s ease;
}

/* ==========================================================================
   7. Story Order Game
   ========================================================================== */

.story-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.story-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #FFFBEB;
  border: 3px solid #FDE68A;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  cursor: grab;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.story-item.dragging {
  opacity: 0.55;
  transform: scale(0.98);
}

.story-item.selected-swap {
  border-color: var(--saffron);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2);
}

.story-item.correct-pos {
  background: #DCFCE7;
  border-color: #10B981;
}

.story-item.wrong-pos {
  background: #FFF1F2;
  border-color: #FB7185;
}

.story-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.06rem;
}

.story-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #F59E0B;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.story-move-btns {
  display: flex;
  gap: 6px;
}

.move-btn {
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 1rem;
  cursor: pointer;
}

.move-btn:hover:not(:disabled) {
  background: #FEF3C7;
  border-color: #F59E0B;
}

.move-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.story-actions {
  margin-top: 22px;
  text-align: center;
}

/* ==========================================================================
   8. Colouring Corner
   ========================================================================== */

.colour-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.template-tab {
  background: #F8FAFC;
  border: 2px solid #CBD5E1;
  border-radius: 999px;
  padding: 9px 16px;
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
}

.template-tab.active {
  background: var(--pink);
  border-color: #E11D48;
  color: #FFFFFF;
}

.colour-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #FFF7ED;
  border: 2px solid #FED7AA;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.tool-buttons {
  display: flex;
  gap: 8px;
}

.tool-btn {
  background: #FFFFFF;
  border: 2px solid #CBD5E1;
  border-radius: 14px;
  padding: 8px 14px;
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
}

.tool-btn.active {
  background: #0EA5E9;
  border-color: #0284C7;
  color: #FFFFFF;
}

.brush-sizes {
  display: flex;
  align-items: center;
  gap: 8px;
}

.size-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #CBD5E1;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.size-dot span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-dark);
}
.size-dot.medium span { width: 14px; height: 14px; }
.size-dot.large span { width: 20px; height: 20px; }
.size-dot.active { border-color: var(--saffron); background: #FFEDD5; }

.colour-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.swatch-btn.active {
  transform: scale(1.22);
  outline: 3px solid var(--ink-dark);
}

.canvas-stage {
  position: relative;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 800 / 520;
  margin: 0 auto;
  background: #FFFFFF;
  border: 4px solid #FDBA74;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  touch-action: none;
}

.canvas-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#colourOutlineCanvas {
  pointer-events: none;
}

/* ==========================================================================
   9. Memory Match Game
   ========================================================================== */

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 680px;
  margin: 0 auto;
}

.mem-card {
  aspect-ratio: 1 / 1.05;
  perspective: 900px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.mem-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.2, 0.85, 0.3, 1.1);
}

.mem-card.flipped .mem-card-inner,
.mem-card.matched .mem-card-inner {
  transform: rotateY(180deg);
}

.mem-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.mem-front {
  background: linear-gradient(135deg, #FBBF24, #F97316);
  border: 3px solid #FFFBEB;
  color: #FFFFFF;
  font-size: 2rem;
  box-shadow: var(--shadow-soft);
}

.mem-back {
  background: #FFFFFF;
  border: 3px solid #6EE7B7;
  transform: rotateY(180deg);
  gap: 6px;
}

.mem-card.matched .mem-back {
  background: #DCFCE7;
  border-color: #10B981;
}

.mem-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-dark);
  text-align: center;
}

/* ==========================================================================
   10 & 11. Parent Corner & About Section
   ========================================================================== */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 22px;
}

.product-card {
  background: #FFFFFF;
  border: 3px solid #FDE68A;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
}

.product-cover {
  height: 165px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FEF3C7, #E0F2FE);
}

.product-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-body h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  color: #C2410C;
}

.product-body p {
  margin: 0 0 16px;
  color: var(--ink-muted);
  font-weight: 600;
  flex: 1;
}

.about-card {
  background: rgba(255, 255, 255, 0.95);
  border: 4px solid #BAE6FD;
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.about-badge {
  display: inline-block;
  background: var(--gold-soft);
  color: #B45309;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.about-lead {
  max-width: 720px;
  margin: 0 auto 30px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink-dark);
}

.about-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.pillar-box {
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 22px;
}

.pillar-box span {
  font-size: 2.3rem;
}

.pillar-box h3 {
  margin: 8px 0 6px;
  color: var(--teal);
}

.pillar-box p {
  margin: 0;
  color: var(--ink-muted);
  font-weight: 600;
}

/* ==========================================================================
   Footer & Modal
   ========================================================================== */

.site-footer {
  background: rgba(255, 255, 255, 0.88);
  border-top: 3px solid #FDE68A;
  padding: 24px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-links button {
  background: transparent;
  border: none;
  font-family: var(--font-display);
  font-weight: 600;
  color: #0F766E;
  cursor: pointer;
  padding: 4px 8px;
}

.footer-links button:hover {
  text-decoration: underline;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 500;
}

.modal-card {
  background: #FFFFFF;
  border: 4px solid #FDE68A;
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
}

.modal-emoji {
  font-size: 3rem;
  margin-bottom: 10px;
}

.modal-card h2 {
  margin: 0 0 10px;
  color: #C2410C;
}

.modal-card p {
  margin: 0 0 22px;
  color: var(--ink-muted);
  font-weight: 600;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Responsive Design (Tablet & Mobile)
   ========================================================================== */

@media (max-width: 960px) {
  .hero-card {
    grid-template-columns: 1fr;
    padding: 26px;
  }

  .maze-layout,
  .ws-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .ws-sidebar {
    width: 100%;
  }

  .match-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .mobile-menu-btn {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    background: #FFFBF2;
    border-bottom: 3px solid #FDE68A;
    padding: 14px 18px;
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav.open {
    display: flex;
  }

  .unlock-feature-banner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .game-shell {
    padding: 16px;
  }

  .maze-grid {
    grid-template-columns: repeat(11, 26px);
    grid-template-rows: repeat(11, 26px);
    padding: 6px;
  }

  .maze-cell {
    width: 26px;
    height: 26px;
    font-size: 1rem;
  }

  .ws-grid {
    grid-template-columns: repeat(12, 24px);
    gap: 2px;
    padding: 6px;
  }

  .ws-cell {
    width: 24px;
    height: 24px;
    font-size: 0.78rem;
    border-radius: 6px;
  }

  .memory-grid {
    gap: 8px;
  }

  .unlock-pill {
    display: none;
  }
}