/* ==========================================================================
   Kids Learning Academy — Child-Friendly Responsive Stylesheet
   ========================================================================== */


:root {
  --bg-sky: #eef8ff;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #475569;


  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --secondary: #8b5cf6;
  --secondary-dark: #7c3aed;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --success: #10b981;
  --success-dark: #059669;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --pink: #ec4899;


  --border-soft: #e2e8f0;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-pill: 999px;


  --shadow-card: 0 10px 28px rgba(30, 64, 175, 0.08);
  --shadow-btn: 0 4px 0 rgba(15, 23, 42, 0.14);


  --font-display: 'Fredoka', 'Nunito', system-ui, -apple-system, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-rtl: 'Noto Naskh Arabic', 'Segoe UI', Tahoma, sans-serif;
}


*,
*::before,
*::after {
  box-sizing: border-box;
}


html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-body);
  background: linear-gradient(180deg, #dff2ff 0%, #fef9e7 55%, #f0fdf4 100%);
  color: var(--text-main);
  -webkit-tap-highlight-color: transparent;
}


[dir="rtl"] .rtl-text,
.rtl-text {
  font-family: var(--font-rtl);
  direction: rtl;
}


.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}


.float-shape {
  position: absolute;
  font-size: 2.5rem;
  opacity: 0.14;
  animation: floatSlow 9s ease-in-out infinite;
}
.shape-1 { top: 8%; left: 4%; animation-delay: 0s; }
.shape-2 { top: 18%; right: 6%; animation-delay: 2s; }
.shape-3 { bottom: 14%; left: 7%; animation-delay: 4s; }
.shape-4 { bottom: 10%; right: 5%; animation-delay: 1s; }


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


/* ==================== HEADER & NAVIGATION ==================== */
.app-header {
  position: relative;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid #dbeafe;
  padding: 12px 18px 14px;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.08);
}


.header-inner {
  max-width: 1340px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}


.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}


.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  display: grid;
  place-items: center;
  font-size: 1.85rem;
  box-shadow: 0 5px 0 #d97706;
}


.brand-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
  color: #1d4ed8;
  line-height: 1.1;
}


.brand-tagline {
  margin: 2px 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 700;
}


.header-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}


.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}


.pill-btn:active {
  transform: translateY(2px);
}


.sound-btn {
  background: #e0f2fe;
  color: #0369a1;
  box-shadow: 0 4px 0 #bae6fd;
}


.sound-btn.muted {
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: 0 4px 0 #fecaca;
}


.stars-pill {
  background: linear-gradient(135deg, #fef08a, #fde047);
  color: #854d0e;
  box-shadow: 0 4px 0 #eab308;
}


.stars-pill .divider {
  opacity: 0.4;
}


/* Global Age, Language & Class Bar */
.controls-bar {
  max-width: 1340px;
  margin: 12px auto 0;
  padding: 10px 14px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}


.control-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}


.control-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: #334155;
}


.age-pills,
.lang-pills,
.level-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}


.age-pill,
.lang-pill,
.level-pill {
  border: 2px solid transparent;
  background: #ffffff;
  color: #334155;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.06);
  transition: all 0.15s ease;
}


.age-pill:hover,
.lang-pill:hover,
.level-pill:hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
}


.age-pill.active {
  background: #0ea5e9;
  color: #ffffff;
  box-shadow: 0 3px 0 #0284c7;
}


.lang-pill.active {
  background: var(--secondary);
  color: #ffffff;
  box-shadow: 0 3px 0 var(--secondary-dark);
}


.level-pill.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 3px 0 var(--primary-dark);
}


.level-select-input {
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 2px solid #cbd5e1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
}


.sr-only-mobile {
  display: none;
}


/* Scrollable Multi-Academy Pill Navigation */
.academy-nav-scroll {
  max-width: 1340px;
  margin: 12px auto 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
}


.academy-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  background: #f1f5f9;
  color: #334155;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 #cbd5e1;
  transition: all 0.15s ease;
  white-space: nowrap;
}


.academy-tab:hover {
  transform: translateY(-2px);
  background: #ffffff;
}


.academy-tab.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 4px 0 #1e40af;
}


.tab-icon {
  font-size: 1.25rem;
}


/* ==================== MAIN CONTAINER & PANELS ==================== */
.main-container {
  position: relative;
  z-index: 5;
  max-width: 1340px;
  margin: 18px auto 42px;
  padding: 0 16px;
}


.academy-panel {
  display: none;
  animation: fadeIn 0.25s ease;
}


.academy-panel.active {
  display: block;
}


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


.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}


.panel-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  color: #0f172a;
}


.panel-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-weight: 600;
}


.script-tabs,
.drawing-mode-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}


.script-btn {
  padding: 10px 16px;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: #334155;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 0 #cbd5e1;
  transition: all 0.15s ease;
}


.script-btn.active {
  background: #f59e0b;
  color: #ffffff;
  border-color: #d97706;
  box-shadow: 0 3px 0 #b45309;
}


/* ==================== DASHBOARD HUB ==================== */
.dashboard-hero {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #ec4899 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 22px;
}


.dashboard-hero h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}


.dashboard-hero p {
  margin: 0;
  font-size: 1.02rem;
  opacity: 0.94;
  font-weight: 600;
}


.hero-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}


.hero-stat-chip {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(255, 255, 255, 0.35);
  padding: 10px 16px;
  border-radius: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}


.dashboard-widgets-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}


.dash-widget-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  border: 3px solid #e0f2fe;
}


.dash-widget-card h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.25rem;
}


.daily-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  margin-bottom: 9px;
  font-weight: 700;
}


.daily-task-item.done {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}


.score-pill {
  background: #eff6ff;
  color: #1d4ed8;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 0.85rem;
}


.academies-grid-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin: 0 0 14px;
  color: #0f172a;
}


.academies-launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}


.academy-launcher-card {
  position: relative;
  background: #ffffff;
  border: 3px solid #e2e8f0;
  border-radius: 22px;
  padding: 18px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
}


.academy-launcher-card:hover {
  transform: translateY(-4px);
  border-color: #60a5fa;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.14);
}


.launcher-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}


.launcher-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.85rem;
}


.launcher-status {
  font-size: 0.78rem;
  font-weight: 800;
  background: #f1f5f9;
  color: #475569;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}


.launcher-status.completed {
  background: #fef08a;
  color: #854d0e;
}


.launcher-title {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
  color: #0f172a;
}


.launcher-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.35;
}


/* ==================== UNIFIED HUB (3-MODE ACADEMY STAGE) ==================== */
.hub-stage-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  border: 3px solid #dbeafe;
}


.hub-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f1f5f9;
  margin-bottom: 18px;
}


.hub-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}


.hub-big-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #eff6ff;
  display: grid;
  place-items: center;
  font-size: 2rem;
}


.mode-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 20px;
}


.mode-btn {
  padding: 11px 20px;
  border: none;
  border-radius: 15px;
  background: transparent;
  color: #475569;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}


.mode-btn.active[data-mode="learn"] {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 3px 0 #1d4ed8;
}


.mode-btn.active[data-mode="practice"] {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 3px 0 #047857;
}


.mode-btn.active[data-mode="test"] {
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 3px 0 #b45309;
}


/* Interactive Academy Cards & Widgets */
.learn-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}


.learn-item-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 3px solid #e2e8f0;
  border-radius: 20px;
  padding: 18px;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}


.learn-item-card:hover {
  transform: translateY(-3px);
  border-color: #60a5fa;
}


.learn-item-emoji {
  font-size: 3rem;
  margin-bottom: 8px;
}


.learn-item-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
}


.learn-item-sub {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 800;
  margin-bottom: 8px;
}


.learn-item-desc {
  font-size: 0.95rem;
  color: #475569;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.4;
}


/* Practice & Interactive Mini-Games */
.practice-box {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 22px;
  padding: 20px;
}


.tile-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 16px 0;
}


.letter-tile {
  min-width: 56px;
  height: 56px;
  padding: 0 14px;
  border: 3px solid #cbd5e1;
  border-radius: 16px;
  background: #ffffff;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 #cbd5e1;
  transition: transform 0.1s ease;
}


.letter-tile:active {
  transform: translateY(2px);
}


.letter-tile.used {
  opacity: 0.35;
  pointer-events: none;
}


.answer-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  min-height: 62px;
  margin: 14px 0;
}


.answer-slot {
  min-width: 56px;
  height: 56px;
  padding: 0 14px;
  border: 3px dashed #3b82f6;
  border-radius: 16px;
  background: #eff6ff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: #1d4ed8;
}


/* Math Keypad & Multiplication Table */
.math-keypad {
  display: grid;
  grid-template-columns: repeat(5, minmax(52px, 72px));
  gap: 10px;
  justify-content: center;
  margin: 16px auto;
}


.math-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 8px;
  margin-top: 14px;
}


.math-table-cell {
  background: #ffffff;
  border: 2px solid #dbeafe;
  border-radius: 12px;
  padding: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  text-align: center;
  color: #1e3a8a;
}


/* Solar System Interactive Banner */
.solar-orbit-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 16px;
  background: radial-gradient(circle at left, #1e1b4b, #0f172a);
  border-radius: 20px;
  color: #ffffff;
  margin-bottom: 18px;
}


.planet-btn {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: var(--font-display);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}


.planet-btn:hover,
.planet-btn.active {
  transform: scale(1.06);
  border-color: #facc15;
  background: rgba(255, 255, 255, 0.18);
}


/* Memory Game Grid */
.memory-grid {
  display: grid;
  gap: 12px;
  max-width: 520px;
  margin: 16px auto;
}


.memory-card {
  aspect-ratio: 1;
  border: 3px solid #cbd5e1;
  border-radius: 18px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #ffffff;
  font-size: 2.2rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 0 #4f46e5;
  transition: transform 0.18s ease, background 0.18s ease;
}


.memory-card.flipped,
.memory-card.matched {
  background: #ffffff;
  color: #0f172a;
  border-color: #10b981;
  box-shadow: 0 4px 0 #059669;
}


/* Interactive Coloring SVG Canvas */
.coloring-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 18px;
  align-items: start;
}


.coloring-svg-stage {
  background: #ffffff;
  border: 3px dashed #cbd5e1;
  border-radius: 22px;
  padding: 14px;
  display: grid;
  place-items: center;
}


.coloring-svg-stage svg {
  width: 100%;
  max-width: 380px;
  height: auto;
}


.coloring-region {
  cursor: pointer;
  transition: opacity 0.12s ease;
}


.coloring-region:hover {
  opacity: 0.88;
}


/* Virtual Keyboard (Computer Academy) */
.virtual-keyboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 680px;
  margin: 16px auto;
  background: #e2e8f0;
  padding: 14px;
  border-radius: 18px;
}


.kb-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}


.kb-key {
  min-width: 42px;
  height: 44px;
  padding: 0 10px;
  border: none;
  border-radius: 10px;
  background: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 3px 0 #94a3b8;
  cursor: pointer;
}


.kb-key:active,
.kb-key.pressed {
  background: #3b82f6;
  color: #ffffff;
  transform: translateY(2px);
}


.kb-key-wide {
  min-width: 130px;
}


/* ==================== PRESERVED WORKSPACE LAYOUT ==================== */
.workspace-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}


.lesson-sidebar {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  border: 3px solid #e0f2fe;
  max-height: 760px;
  overflow-y: auto;
}


.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}


.sidebar-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}


.mini-badge {
  background: #dbeafe;
  color: #1d4ed8;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}


.lesson-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 8px;
}


.lesson-chips-grid.wide-chips {
  grid-template-columns: 1fr;
}


.lesson-chip {
  position: relative;
  padding: 12px 8px;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}


.lesson-chip.rtl-chip {
  font-family: var(--font-rtl);
  font-size: 1.4rem;
}


.lesson-chip:hover {
  border-color: #60a5fa;
  background: #eff6ff;
}


.lesson-chip.active {
  background: #3b82f6;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 4px 0 #1d4ed8;
}


.lesson-chip.done::after {
  content: "⭐";
  position: absolute;
  top: -6px;
  right: -4px;
  font-size: 0.85rem;
}


.drawing-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}


.drawing-card-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-display);
  transition: all 0.15s ease;
}


.drawing-card-btn:hover {
  border-color: #f472b6;
  background: #fdf2f8;
}


.drawing-card-btn.active {
  background: #ec4899;
  color: #ffffff;
  border-color: #db2777;
  box-shadow: 0 4px 0 #be185d;
}


.drawing-card-btn .d-emoji {
  font-size: 1.8rem;
}


.drawing-card-btn .d-title {
  font-size: 1.02rem;
  font-weight: 700;
  display: block;
}


.drawing-card-btn .d-steps {
  font-size: 0.8rem;
  opacity: 0.85;
}


/* ==================== CANVAS STAGE CARD ==================== */
.canvas-stage-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  border: 3px solid #e0e7ff;
}


.prompt-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: linear-gradient(135deg, #eff6ff, #f5f3ff);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}


.prompt-info {
  display: flex;
  align-items: center;
  gap: 14px;
}


.prompt-emoji {
  font-size: 2.3rem;
  background: #ffffff;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}


.prompt-main {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-weight: 700;
  color: #1e293b;
}


.prompt-sub {
  font-size: 0.95rem;
  color: #475569;
  font-weight: 700;
}


.prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}


.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}


.action-btn:active {
  transform: translateY(2px);
}


.primary-action {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 0 var(--primary-dark);
}


.secondary-action {
  background: #f1f5f9;
  color: #334155;
  box-shadow: 0 4px 0 #cbd5e1;
}


.audio-action {
  background: #fef3c7;
  color: #92400e;
  box-shadow: 0 4px 0 #fcd34d;
}


.success-action {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 0 var(--success-dark);
}


.neutral-action {
  background: #e2e8f0;
  color: #334155;
  box-shadow: 0 4px 0 #94a3b8;
}


.canvas-wrapper {
  position: relative;
  width: 100%;
  height: 390px;
  background: #ffffff;
  border: 3px dashed #cbd5e1;
  border-radius: 20px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}


.guide-canvas,
.draw-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}


.guide-canvas {
  pointer-events: none;
  z-index: 1;
}


.draw-canvas {
  z-index: 2;
  cursor: crosshair;
  touch-action: none;
}


.feedback-toast {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: rgba(16, 185, 129, 0.95);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
  pointer-events: none;
}


.feedback-toast.warning {
  background: rgba(245, 158, 11, 0.95);
}


.feedback-toast.hidden {
  display: none;
}


.writing-check-bar {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}


.coverage-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #334155;
}


.meter-track {
  width: 140px;
  height: 14px;
  background: #e2e8f0;
  border-radius: var(--radius-pill);
  overflow: hidden;
}


.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: var(--radius-pill);
  transition: width 0.25s ease;
}


.nav-step-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}


.stepper-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}


.steps-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}


.step-pill {
  padding: 7px 14px;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-pill);
  background: #f8fafc;
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
}


.step-pill.active {
  background: #8b5cf6;
  color: #ffffff;
  border-color: #7c3aed;
}


.stepper-controls {
  display: flex;
  gap: 8px;
}


.toolbox-bar {
  margin-top: 14px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}


.tool-section {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}


.tool-label {
  font-family: var(--font-display);
  font-weight: 600;
  color: #475569;
  font-size: 0.9rem;
}


.tool-btn {
  padding: 8px 12px;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}


.tool-btn.active {
  background: #1e293b;
  color: #ffffff;
  border-color: #0f172a;
}


.danger-tool {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}


.size-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
}


.size-btn.active {
  border-color: #3b82f6;
  background: #eff6ff;
}


.dot {
  display: block;
  border-radius: 50%;
  background: #1e293b;
}
.dot-sm { width: 7px; height: 7px; }
.dot-md { width: 14px; height: 14px; }
.dot-lg { width: 22px; height: 22px; }


.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 2px #cbd5e1;
  cursor: pointer;
  transition: transform 0.12s ease;
}


.color-swatch:hover {
  transform: scale(1.1);
}


.color-swatch.active {
  transform: scale(1.16);
  box-shadow: 0 0 0 3px #1e293b;
}


/* ==================== READING ACADEMY ==================== */
.reading-workspace {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  border: 3px solid #d1fae5;
}


.reading-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}


.reading-card {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 3px solid #e2e8f0;
  border-radius: 22px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}


.reading-card:hover {
  transform: translateY(-4px);
  border-color: #34d399;
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.12);
}


.reading-card.speaking {
  border-color: #f59e0b;
  background: #fffbeb;
  transform: scale(1.03);
}


.reading-card.learned::before {
  content: "⭐ Learned";
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  background: #fef08a;
  color: #854d0e;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}


.reading-emoji {
  font-size: 3rem;
  margin-bottom: 6px;
}


.reading-main-text {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}


.reading-phonetic {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 8px;
}


.reading-example {
  font-size: 0.96rem;
  color: #475569;
  font-weight: 700;
}


.sentences-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}


.sentence-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 20px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
}


.sentence-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}


.sentence-words-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}


.word-tap-chip {
  padding: 6px 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}


.word-tap-chip:hover,
.word-tap-chip.highlight {
  background: #fef08a;
  border-color: #eab308;
  transform: translateY(-2px);
}


.quiz-box {
  max-width: 740px;
  margin: 0 auto;
  text-align: center;
  padding: 14px;
}


.quiz-prompt-card {
  background: linear-gradient(135deg, #ecfdf5, #eff6ff);
  border: 3px solid #a7f3d0;
  border-radius: 22px;
  padding: 22px;
  margin-bottom: 20px;
}


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


.quiz-option-btn {
  padding: 18px 14px;
  border: 3px solid #cbd5e1;
  border-radius: 20px;
  background: #ffffff;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 0 #cbd5e1;
  transition: all 0.15s ease;
}


.quiz-option-btn:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
}


.quiz-option-btn.correct {
  background: #10b981;
  color: #fff;
  border-color: #059669;
  box-shadow: 0 5px 0 #047857;
}


.quiz-option-btn.wrong {
  background: #ef4444;
  color: #fff;
  border-color: #dc2626;
}


/* ==================== MODAL & CONFETTI ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
}


.modal-overlay.hidden {
  display: none;
}


.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}


.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}


.modal-header h2 {
  margin: 0;
  font-family: var(--font-display);
}


.close-modal-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  font-size: 1.1rem;
  cursor: pointer;
}


.progress-stat-row {
  margin-bottom: 14px;
}


.progress-stat-label {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  margin-bottom: 6px;
}


.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 16px;
}


.badge-card {
  padding: 12px 8px;
  border-radius: 16px;
  text-align: center;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  opacity: 0.48;
}


.badge-card.unlocked {
  opacity: 1;
  background: #fef9c3;
  border-color: #facc15;
}


.modal-footer {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}


.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 200;
}


.confetti-piece {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  animation: confettiFall 1.8s ease-out forwards;
}


@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(540deg); opacity: 0; }
}


.app-footer {
  text-align: center;
  padding: 18px;
  color: var(--text-muted);
  font-size: 0.92rem;
}


/* ==================== RESPONSIVE BREAKPOINTS ==================== */
@media (max-width: 960px) {
  .workspace-grid,
  .coloring-layout {
    grid-template-columns: 1fr;
  }


  .lesson-sidebar {
    max-height: 220px;
  }


  .canvas-wrapper {
    height: 340px;
  }
}


@media (max-width: 640px) {
  .hide-sm {
    display: none;
  }


  .canvas-wrapper {
    height: 280px;
  }


  .prompt-banner {
    padding: 10px 12px;
  }


  .math-keypad {
    grid-template-columns: repeat(5, 1fr);
  }
}
/* Story World */
.storyworld-wrap{max-width:1200px;margin:0 auto;padding:16px}.storyworld-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}.storyworld-head h2{margin:0}.story-count{background:#eef2ff;padding:8px 12px;border-radius:20px;font-weight:800}.storyworld-grid{display:grid;grid-template-columns:minmax(220px,320px) 1fr;gap:18px;align-items:start}.story-list{max-height:72vh;overflow:auto;background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:8px}.story-choice{display:flex;width:100%;gap:10px;align-items:center;text-align:left;border:0;border-radius:12px;background:#fff;padding:10px;cursor:pointer;color:inherit}.story-choice.selected{background:#eef2ff;outline:2px solid #818cf8}.story-choice>span:first-child{font-size:25px}.story-choice small{display:block;color:#64748b;margin-top:3px}.story-reader{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:20px;min-width:0}.story-title{display:flex;gap:14px;align-items:center}.story-title>span{font-size:42px}.story-title h3{margin:4px 0;font-size:1.5rem}.story-title small{color:#64748b}.story-scene{margin:18px 0;padding:20px;border-radius:16px;background:linear-gradient(135deg,#eff6ff,#f5f3ff)}.scene-art{text-align:center;font-size:54px}.scene-progress{text-align:center;color:#64748b;font-size:.85rem;font-weight:800}.story-scene p,.story-language p{font-size:1.08rem;line-height:1.8}.scene-controls,.story-actions{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}.story-language{border-top:1px solid #e5e7eb;padding-top:12px}.story-language h4{margin-bottom:5px}.translation-note{color:#64748b;font-style:italic}.story-quiz{margin-top:20px;padding:16px;border-radius:14px;background:#f8fafc}.story-quiz button{margin:5px}.story-quiz #storyFeedback{font-weight:800;min-height:24px}@media(max-width:760px){.storyworld-grid{grid-template-columns:1fr}.story-list{max-height:250px}.story-reader{padding:14px}.storyworld-wrap{padding:8px}}
