/* WonderSpark Kids Learning App Stylesheet */

:root {
  --primary: #ff6b6b;
  --primary-hover: #ff5252;
  --secondary: #4dabf7;
  --secondary-hover: #339af0;
  --accent-yellow: #ffd43b;
  --accent-green: #51cf66;
  --accent-purple: #cc5de8;
  --accent-orange: #ff922b;
  --accent-teal: #20c997;
  --bg-gradient: linear-gradient(135deg, #f0f7ff 0%, #fff5f5 50%, #f3f0ff 100%);
  --surface: #ffffff;
  --surface-alt: #f8f9fa;
  --text-main: #212529;
  --text-muted: #6c757d;
  --border-light: #e9ecef;
  --border-playful: #dee2e6;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.12);
  --shadow-bouncy: 0 8px 0 rgba(0, 0, 0, 0.08);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-full: 9999px;
  --font-display: 'Fredoka', cursive, sans-serif;
  --font-body: 'Quicksand', -apple-system, sans-serif;
}

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

body {
  background: #0f172a;
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  overflow-x: hidden;
}

/* Simulator Bar */
.simulator-bar {
  width: 100%;
  background: #1e293b;
  color: #f8fafc;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid #334155;
  z-index: 100;
  flex-wrap: wrap;
  gap: 8px;
}

.sim-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sim-btn {
  background: #334155;
  color: #cbd5e1;
  border: none;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.sim-btn:hover {
  background: #475569;
  color: #fff;
}

.sim-btn.active {
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.sim-trial-badge {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  animation: pulseTrial 2s infinite ease-in-out;
}

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

/* Device Shell Containers */
.app-container {
  width: 100%;
  min-height: calc(100vh - 45px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
  background: radial-gradient(circle at top, #1e293b 0%, #0f172a 100%);
}

.app-container.mode-web {
  padding: 0;
  max-width: 100%;
}

.app-container.mode-web .app-viewport {
  max-width: 1280px;
  width: 100%;
  min-height: 100vh;
  border-radius: 0;
  box-shadow: none;
}

/* Phone Mockup Frame */
.device-mockup {
  position: relative;
  background: #000;
  border-radius: 46px;
  padding: 12px;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.7), 0 0 0 4px #475569;
  display: flex;
  flex-direction: column;
  margin: 10px auto;
  transition: all 0.3s ease;
}

.device-mockup.iphone {
  width: 395px;
  height: 840px;
}

.device-mockup.pixel {
  width: 412px;
  height: 860px;
  border-radius: 40px;
}

.device-mockup.ipad {
  width: 820px;
  height: 900px;
  border-radius: 36px;
}

.device-notch {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 24px;
  background: #000;
  border-radius: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
}

.device-notch::after {
  content: '';
  width: 10px;
  height: 10px;
  background: #1e293b;
  border-radius: 50%;
}

.device-home-indicator {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  z-index: 50;
}

/* App Viewport inside device or web */
.app-viewport {
  background: var(--bg-gradient);
  width: 100%;
  height: 100%;
  border-radius: 36px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  scroll-behavior: smooth;
}

.app-container.mode-web .app-viewport {
  border-radius: 0;
  min-height: 100vh;
}

/* Top App Bar */
.top-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #eef2f6;
  position: sticky;
  top: 0;
  z-index: 30;
  gap: 12px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #ff6b6b, #ffd43b);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 10px rgba(255, 107, 107, 0.35);
  transform: rotate(-3deg);
  transition: transform 0.2s;
}

.brand-icon:hover {
  transform: rotate(4deg) scale(1.08);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #ff6b6b, #4dabf7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.brand-text span {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* User & Stats Cluster */
.header-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  padding: 6px 14px 6px 8px;
  border-radius: var(--radius-full);
  border: 2px solid #e2e8f0;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.profile-pill:hover {
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.child-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.child-info-mini {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}

.child-name-mini {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.child-tier-mini {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fff;
  border-radius: var(--radius-full);
  border: 2px solid #fed7aa;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #ea580c;
  box-shadow: var(--shadow-sm);
}

.stat-badge.xp-badge {
  border-color: #c7d2fe;
  color: #4f46e5;
}

.header-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}

.header-action-btn:hover {
  background: #f1f5f9;
  transform: scale(1.05);
}

.parent-lock-btn {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  transition: all 0.2s;
}

.parent-lock-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

/* Navigation Tabs */
.nav-tab-bar {
  background: #ffffff;
  border-bottom: 2px solid #e9ecef;
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding: 8px 16px;
  gap: 8px;
  scrollbar-width: none;
  position: sticky;
  top: 72px;
  z-index: 25;
}

.nav-tab-bar::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background: #f8f9fa;
  color: #495057;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-tab:hover {
  background: #edf2f7;
  transform: translateY(-1px);
}

.nav-tab.active {
  background: #fff;
  color: #ff5252;
  border-color: #ff6b6b;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
  transform: scale(1.03);
}

.nav-tab.active[data-tab="games"] {
  border-color: #339af0;
  color: #1971c2;
  box-shadow: 0 4px 12px rgba(51, 154, 240, 0.2);
}

.nav-tab.active[data-tab="art"] {
  border-color: #cc5de8;
  color: #9c36b5;
  box-shadow: 0 4px 12px rgba(204, 93, 232, 0.2);
}

.nav-tab.active[data-tab="facts"] {
  border-color: #ffd43b;
  color: #e67700;
  box-shadow: 0 4px 12px rgba(255, 212, 59, 0.3);
}

.nav-tab.active[data-tab="gk"] {
  border-color: #20c997;
  color: #099268;
  box-shadow: 0 4px 12px rgba(32, 201, 151, 0.2);
}

.nav-tab.active[data-tab="fun"] {
  border-color: #ff922b;
  color: #d9480f;
  box-shadow: 0 4px 12px rgba(255, 146, 43, 0.2);
}

/* Content Area */
.app-content {
  flex: 1;
  padding: 20px;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}

/* AI Sparky Companion Bubble */
.sparky-card {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.sparky-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 250px;
  height: 250px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.sparky-avatar {
  font-size: 48px;
  background: rgba(255, 255, 255, 0.2);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 3px solid rgba(255, 255, 255, 0.4);
  animation: floatOwl 3s ease-in-out infinite;
}

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

.sparky-speech {
  flex: 1;
}

.sparky-badge {
  background: rgba(255, 255, 255, 0.25);
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.sparky-text {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 12px;
}

.sparky-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sparky-btn {
  background: #ffffff;
  color: #6366f1;
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.sparky-btn:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

/* Daily Quest Map */
.quest-banner {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  border: 2px solid #e2e8f0;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

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

.quest-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quest-progress-text {
  font-size: 13px;
  font-weight: 700;
  color: #3b82f6;
  background: #eff6ff;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

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

.quest-step {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.quest-step.completed {
  background: #f0fdf4;
  border-color: #86efac;
  border-style: solid;
}

.quest-step-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.quest-step-info h4 {
  font-family: var(--font-display);
  font-size: 14px;
  color: #1e293b;
  margin-bottom: 2px;
}

.quest-step-info p {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

/* Learning Portal Cards Grid */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.portal-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 22px;
  border: 2px solid #eef2f6;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.portal-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.portal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
}

.portal-card.card-spelling::before { background: linear-gradient(90deg, #ff6b6b, #ffa94d); }
.portal-card.card-games::before { background: linear-gradient(90deg, #4dabf7, #38d9a9); }
.portal-card.card-art::before { background: linear-gradient(90deg, #da77f2, #ff6b6b); }
.portal-card.card-facts::before { background: linear-gradient(90deg, #ffd43b, #ff922b); }
.portal-card.card-gk::before { background: linear-gradient(90deg, #20c997, #4dabf7); }
.portal-card.card-fun::before { background: linear-gradient(90deg, #ff922b, #f06595); }

.portal-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.portal-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: #f8fafc;
  box-shadow: var(--shadow-sm);
}

.portal-card-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-spelling { background: #ffe3e3; color: #c92a2a; }
.tag-games { background: #e7f5ff; color: #1864ab; }
.tag-art { background: #f3d9fa; color: #862e9c; }
.tag-facts { background: #fff3bf; color: #e67700; }
.tag-gk { background: #e6fcf5; color: #087f5b; }
.tag-fun { background: #ffe8cc; color: #d9480f; }

.portal-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.portal-card p {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.portal-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
}

.portal-xp-gain {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #6366f1;
}

.portal-play-btn {
  background: #f1f5f9;
  color: #1e293b;
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.portal-card:hover .portal-play-btn {
  background: #1e293b;
  color: #ffffff;
}

/* ========================================================
   SPELLING MODULE
   ======================================================== */
.module-container {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 2px solid #eef2f6;
  box-shadow: var(--shadow-sm);
}

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

.module-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.module-icon-large {
  font-size: 36px;
  background: #fff0f6;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-title-wrap h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
}

.module-title-wrap p {
  font-size: 13px;
  color: #64748b;
}

.tier-selector {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-full);
  gap: 4px;
}

.tier-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.tier-btn.active {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Spelling Board */
.spelling-board {
  background: linear-gradient(135deg, #fff5f5 0%, #fef3c7 100%);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  border: 2px solid #fed7aa;
  position: relative;
  box-shadow: 0 8px 20px rgba(251, 146, 60, 0.1);
  margin-bottom: 24px;
}

.spelling-emoji {
  font-size: 80px;
  display: inline-block;
  margin-bottom: 12px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
  animation: gentleBounce 2s infinite ease-in-out;
}

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

.spelling-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.audio-speak-btn {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 10px 22px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
  transition: all 0.2s;
}

.audio-speak-btn:hover {
  transform: scale(1.05);
}

.audio-speak-btn:active {
  transform: scale(0.97);
}

.phonics-hint-pill {
  background: #ffffff;
  color: #ea580c;
  border: 2px solid #fdba74;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.spelling-clue-text {
  font-size: 15px;
  font-weight: 600;
  color: #7c2d12;
  margin-bottom: 24px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Slots for target word */
.spelling-slots-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.spelling-slot {
  width: 52px;
  height: 60px;
  border: 3px dashed #fdba74;
  border-radius: 14px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: #c2410c;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: all 0.2s;
}

.spelling-slot.filled {
  border-style: solid;
  border-color: #f97316;
  background: #fff7ed;
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.2);
}

/* Scrambled letter tiles */
.letter-tiles-pool {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.letter-tile {
  width: 54px;
  height: 58px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-bottom: 5px solid #cbd5e1;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.letter-tile:hover {
  transform: translateY(-4px);
  border-bottom-width: 6px;
  border-color: #93c5fd;
  color: #2563eb;
}

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

.letter-tile.disabled {
  opacity: 0.3;
  pointer-events: none;
  border-bottom-width: 2px;
}

.spelling-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.action-pill-btn {
  background: #ffffff;
  color: #475569;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-full);
  padding: 8px 18px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.action-pill-btn:hover {
  border-color: #94a3b8;
  color: #1e293b;
}

.action-pill-btn.submit-spelling {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.action-pill-btn.submit-spelling:hover {
  transform: scale(1.05);
}

/* ========================================================
   GAMES MODULE
   ======================================================== */
.game-selector-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.game-tab {
  background: #f1f5f9;
  border: none;
  border-radius: var(--radius-full);
  padding: 10px 20px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.game-tab.active {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Math Star Dash */
.math-arena {
  background: radial-gradient(circle at center, #1e1b4b 0%, #0f172a 100%);
  border-radius: var(--radius-md);
  padding: 30px 20px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.math-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.timer-pill {
  background: #ef4444;
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
}

.score-pill {
  background: #f59e0b;
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.math-equation-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 24px;
  max-width: 400px;
  margin: 0 auto 30px;
}

.math-equation-card h2 {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  color: #ffd43b;
  letter-spacing: 2px;
}

.math-balloons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 420px;
  margin: 0 auto;
}

.math-balloon-btn {
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  color: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 18px 24px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 0 #be185d, 0 12px 20px rgba(236, 72, 153, 0.4);
  transition: all 0.15s ease;
}

.math-balloon-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 11px 0 #be185d, 0 16px 24px rgba(236, 72, 153, 0.5);
}

.math-balloon-btn:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 #be185d;
}

.math-balloon-btn:nth-child(2) {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 8px 0 #1d4ed8, 0 12px 20px rgba(59, 130, 246, 0.4);
}

.math-balloon-btn:nth-child(3) {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 8px 0 #047857, 0 12px 20px rgba(16, 185, 129, 0.4);
}

.math-balloon-btn:nth-child(4) {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  box-shadow: 0 8px 0 #6d28d9, 0 12px 20px rgba(139, 92, 246, 0.4);
}

/* Memory Match Arena */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
}

.memory-card {
  aspect-ratio: 1;
  background: #ffffff;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  cursor: pointer;
  border: 3px solid #e2e8f0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
  user-select: none;
}

.memory-card.hidden {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-color: #6366f1;
  color: transparent;
}

.memory-card.hidden::after {
  content: '✨';
  color: #fff;
  font-size: 24px;
}

.memory-card.matched {
  background: #dcfce7;
  border-color: #86efac;
  cursor: default;
  transform: scale(0.95);
  opacity: 0.85;
}

/* ========================================================
   ART & CRAFT MODULE
   ======================================================== */
.canvas-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 16px;
  border: 2px solid #e2e8f0;
}

.art-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tool-btn {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

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

.palette-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform 0.15s;
}

.color-dot.active {
  transform: scale(1.3);
  box-shadow: 0 0 0 2px #0f172a;
}

.drawing-canvas {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  cursor: crosshair;
  touch-action: none;
  max-width: 100%;
}

.stamp-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.stamp-btn {
  font-size: 24px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.stamp-btn.active {
  background: #fef08a;
  border-color: #eab308;
  transform: scale(1.15);
}

/* Craft Projects List */
.crafts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.craft-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.craft-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.craft-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.craft-icon {
  font-size: 32px;
  background: #f0fdf4;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.craft-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}

.craft-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
}

.craft-pill {
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  color: #475569;
}

.craft-steps-list {
  padding-left: 18px;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 12px;
}

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

/* ========================================================
   INTERESTING FACTS MODULE
   ======================================================== */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.fact-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 2px solid #eef2f6;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s;
}

.fact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

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

.fact-badge {
  background: #eff6ff;
  color: #2563eb;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.fact-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
  line-height: 1.3;
}

.fact-card p {
  font-size: 14px;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 14px;
}

.fact-fun-detail {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: #92400e;
  font-weight: 600;
  margin-bottom: 16px;
}

.fact-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ========================================================
   EVERYDAY FUN & JOKES
   ======================================================== */
.fun-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.fun-tab-btn {
  background: #f1f5f9;
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 18px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}

.fun-tab-btn.active {
  background: #f97316;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.joke-card {
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
  border: 2px solid #fed7aa;
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  margin-bottom: 18px;
}

.joke-setup {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #9a3412;
  margin-bottom: 16px;
}

.joke-punchline {
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 18px;
  font-weight: 700;
  color: #15803d;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  display: inline-block;
  margin-top: 10px;
}

/* Mindful Calming Bubble */
.mindful-box {
  background: linear-gradient(135deg, #e0f2fe 0%, #ede9fe 100%);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  margin-top: 20px;
}

.breath-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, #38bdf8 0%, #818cf8 100%);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.5);
  animation: breatheCycle 8s infinite ease-in-out;
}

@keyframes breatheCycle {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.45); opacity: 1; box-shadow: 0 0 50px rgba(129, 140, 248, 0.8); }
}

/* ========================================================
   MODALS (Parent Gate, Dashboard, Subscription, Confetti)
   ======================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

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

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 2px solid #e2e8f0;
  padding: 24px;
  position: relative;
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from { transform: translateY(20px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #64748b;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Parent Gate Challenge */
.gate-box {
  text-align: center;
  padding: 12px;
}

.gate-lock-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.gate-question {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  margin: 16px 0;
  background: #f1f5f9;
  padding: 14px;
  border-radius: var(--radius-sm);
}

.gate-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 280px;
  margin: 16px auto;
}

.keypad-btn {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  height: 50px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s;
}

.keypad-btn:hover {
  background: #e2e8f0;
}

/* Parent Dashboard UI */
.parent-dash-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 16px;
}

.parent-dash-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
}

.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.dash-stat-tile {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.dash-stat-val {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #4f46e5;
}

.dash-stat-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

/* Progress bar */
.skill-bar-row {
  margin-bottom: 12px;
}

.skill-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.skill-bar-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s ease;
}

/* Subscription Pricing Table */
.sub-plan-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.sub-plan-card.selected {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.2);
}

.currency-select-box {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid #cbd5e1;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  background: #ffffff;
}

/* Privacy Badge Footer */
.safety-guarantee-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 12px;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

/* Celebration Confetti */
.celebrate-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.level-up-banner {
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  color: #fff;
  padding: 24px 48px;
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  animation: popCelebrate 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
}

@keyframes popCelebrate {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .top-header {
    padding: 10px 14px;
  }
  .brand-text h1 {
    font-size: 18px;
  }
  .sparky-card {
    flex-direction: column;
    text-align: center;
  }
  .sparky-avatar {
    margin: 0 auto;
  }
  .sparky-actions {
    justify-content: center;
  }
  .spelling-emoji {
    font-size: 60px;
  }
  .spelling-slot {
    width: 44px;
    height: 52px;
    font-size: 24px;
  }
  .letter-tile {
    width: 46px;
    height: 50px;
    font-size: 22px;
  }
  .memory-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
