:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #14b8a6;
  --primary-soft: #f0fdfa;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-soft: #fffbeb;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --success: #15803d;
  --success-bg: #dcfce7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --radius: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: 92px;
  overflow-x: hidden;
}

/* ACCESSIBILITY SKIP LINK & FOCUS */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  z-index: 2000;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

button:focus-visible,
input:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* TOPBAR NAVIGATION */
.topbar {
  position: sticky;
  top: 0;
  z-index: 150;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

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

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand strong {
  font-size: 18px;
  color: var(--primary);
  letter-spacing: -0.3px;
}

.badge-pill-demo {
  background: #fef3c7;
  color: #b45309;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #fde68a;
}

.brand small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

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

.tab-pill {
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  min-height: 40px;
}

.tab-pill:hover {
  border-color: var(--primary);
}

.tab-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.tab-pill.highlight {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-dark);
}

.tab-pill.parent-pill {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.checkout-btn {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

/* MAIN VIEW CONTAINERS */
.view-section {
  display: none;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 16px;
}

.view-section.active {
  display: block;
}

/* LANDING PAGE */
.hero {
  text-align: center;
  padding: 32px 20px;
  background: linear-gradient(135deg, #f0fdfa 0%, #fffbeb 100%);
  border-radius: 26px;
  border: 2px solid #99f6e4;
  margin-bottom: 32px;
  box-shadow: 0 10px 30px rgba(15, 118, 110, 0.06);
}

.hero-top-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.badge-urgent {
  display: inline-block;
  background: #fef3c7;
  color: #b45309;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #fde68a;
}

.badge-safe {
  display: inline-block;
  background: #dcfce7;
  color: #15803d;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #bbf7d0;
}

.hero-logo {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.18);
  display: block;
  margin: 0 auto 14px;
}

.hero h1 {
  font-size: clamp(24px, 3.8vw, 40px);
  line-height: 1.22;
  margin-bottom: 14px;
}

.grad-text {
  color: var(--primary);
}

.hero-sub {
  max-width: 740px;
  margin: 0 auto 22px;
  color: var(--muted);
  font-size: 16px;
}

.quick-launch-card {
  background: #ffffff;
  border: 2px solid #ccfbf1;
  border-radius: 20px;
  padding: 18px;
  max-width: 760px;
  margin: 0 auto 24px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.quick-launch-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.quick-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.quick-input-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.quick-input-group input {
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  min-width: 210px;
}

.btn-save-name {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.hero-cta-group {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-primary-lg {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.22);
  transition: transform 0.15s;
}

.btn-primary-lg:active {
  transform: scale(0.98);
}

.btn-secondary-lg {
  background: #eff6ff;
  color: #1d4ed8;
  border: 2px solid #bfdbfe;
  padding: 13px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-outline-lg {
  background: #fff;
  color: var(--text);
  border: 2px solid var(--border);
  padding: 13px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.trust-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}

.trust-metrics div {
  background: #fff;
  padding: 14px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.trust-metrics strong {
  display: block;
  font-size: 19px;
  color: var(--primary);
  margin-bottom: 2px;
}

.trust-metrics span {
  font-size: 12px;
  color: var(--muted);
}

/* SECTION HEADERS & CURRICULUM GRID */
.section-title-box {
  text-align: center;
  margin-bottom: 20px;
}

.section-title-box h2 {
  font-size: clamp(20px, 3vw, 28px);
  color: var(--text);
  margin-bottom: 6px;
}

.section-title-box p {
  color: var(--muted);
  font-size: 15px;
}

.curriculum-preview {
  margin-bottom: 36px;
}

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

.feature-card {
  background: #fff;
  padding: 22px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: #99f6e4;
  transform: translateY(-2px);
}

.parent-feature-card {
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
  border-color: #bfdbfe;
}

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

.f-icon {
  font-size: 34px;
}

.f-age {
  font-size: 12px;
  font-weight: 700;
  background: #f1f5f9;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
}

.feature-card h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

.btn-jump-mod {
  align-self: flex-start;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1.5px solid #99f6e4;
  padding: 9px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.btn-jump-mod.secondary {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

/* COMPARISON TABLE */
.comparison-section {
  margin-bottom: 36px;
}

.table-responsive {
  overflow-x: auto;
  background: #fff;
  border-radius: 18px;
  border: 2px solid var(--border);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.compare-table th,
.compare-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-size: 14px;
}

.compare-table th:first-child,
.compare-table td:first-child {
  text-align: left;
  font-weight: 600;
}

.compare-table thead th {
  background: #f8fafc;
  font-weight: 800;
  color: var(--text);
}

.compare-table tbody td:nth-child(2) {
  background: #f0fdfa;
  color: var(--primary);
  font-weight: 800;
  font-size: 16px;
}

/* PRICING / DEMO CARD */
.pricing-box {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.pricing-card {
  background: #fff;
  border: 3px solid var(--primary);
  border-radius: 24px;
  padding: 30px 24px;
  max-width: 540px;
  width: 100%;
  text-align: center;
}

.promo-ribbon {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.price-tag {
  margin: 14px 0;
}

.price-tag .strike {
  text-decoration: line-through;
  color: #94a3b8;
  font-size: 18px;
  margin-right: 8px;
}

.price-tag strong {
  font-size: 36px;
  color: var(--primary);
}

.price-note {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.benefit-list {
  list-style: none;
  text-align: left;
  margin: 18px 0;
}

.benefit-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
  font-weight: 500;
}

.pricing-cta-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.full-w {
  width: 100%;
}

.btn-buy {
  width: 100%;
  background: #f1f5f9;
  color: var(--text);
  border: 2px solid var(--border);
  padding: 13px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================
   KID APP INTERFACE (VIEW 2)
   ========================================== */
.kid-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: #fff;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 2px solid #bae6fd;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.06);
}

.kid-greeting-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0f9ff;
  padding: 6px 12px;
  border-radius: 14px;
  border: 1px solid #bae6fd;
}

.kid-avatar {
  font-size: 22px;
}

.kid-greeting-pill small {
  display: block;
  font-size: 11px;
  color: #0369a1;
  line-height: 1.1;
}

.kid-greeting-pill strong {
  font-size: 14px;
  color: var(--text);
}

.btn-edit-kid {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.star-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  background: #fef3c7;
  padding: 6px 14px;
  border-radius: 999px;
  color: #b45309;
  border: 1px solid #fde68a;
}

.level-badge {
  background: #fff;
  color: #92400e;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.timer-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  background: #f8fafc;
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.audio-controls-bar {
  display: flex;
  gap: 6px;
}

.btn-small,
.btn-sound-test,
.btn-sound-toggle {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 6px 11px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  min-height: 36px;
}

.btn-sound-toggle.muted {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* PROGRESS STRIP */
.progress-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.progress-item {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 8px 10px;
  text-align: center;
}

.progress-item span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.progress-item strong {
  font-size: 14px;
  color: var(--primary);
}

/* KID MODULE TABS */
.kid-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.kid-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 10px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  min-height: 52px;
}

.tab-emoji {
  font-size: 20px;
}

.kid-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.22);
}

/* MODULE CONTAINER & TOOLBARS */
.kid-module {
  display: none;
  background: #fff;
  padding: 24px 20px;
  border-radius: 24px;
  border: 2px solid var(--border);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.kid-module.active {
  display: block;
}

.module-header {
  text-align: center;
  margin-bottom: 18px;
}

.module-header h2 {
  font-size: clamp(20px, 3vw, 26px);
  margin-bottom: 4px;
}

.module-header p {
  font-size: 14px;
  color: var(--muted);
}

.sub-toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.toolbar-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.pill-filter {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 38px;
}

.pill-filter.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 1. HIJAIYAH GRID */
.hijaiyah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.hijaiyah-card {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
  border: 2px solid #99f6e4;
  border-radius: 18px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
  user-select: none;
  min-height: 106px;
}

.hijaiyah-card:hover {
  border-color: var(--primary);
}

.hijaiyah-card:active,
.hijaiyah-card.playing {
  transform: scale(1.06);
  border-color: var(--accent);
  background: #fef3c7;
}

.hijaiyah-card.learned {
  border-color: #22c55e;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.learned-check {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 12px;
  background: #dcfce7;
  color: #15803d;
  border-radius: 999px;
  padding: 1px 6px;
  font-weight: 800;
}

.arabic-char {
  font-size: 40px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.25;
}

.latin-read {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-top: 4px;
}

.letter-name-sub {
  font-size: 11px;
  color: var(--muted);
}

/* QUIZ BOXES */
.quiz-box {
  background: var(--accent-soft);
  border: 2px dashed var(--accent);
  border-radius: 20px;
  padding: 20px 16px;
  text-align: center;
}

.quiz-header {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.btn-quiz-play {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.quiz-prompt {
  font-size: 16px;
  margin-bottom: 12px;
}

.quiz-options,
.math-choices {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.quiz-opt-btn {
  min-width: 84px;
  min-height: 60px;
  padding: 12px 18px;
  font-size: 26px;
  font-weight: 800;
  background: #fff;
  color: var(--text);
  border: 2.5px solid var(--primary);
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.12s, background 0.12s;
}

.quiz-opt-btn:active {
  transform: scale(0.95);
}

.quiz-opt-btn.correct {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.quiz-opt-btn.wrong {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

.quiz-feedback {
  font-weight: 700;
  font-size: 15px;
  min-height: 24px;
  margin-top: 8px;
}

/* 2. WORD CARDS & WORD BUILDER */
.word-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.word-card {
  position: relative;
  background: #f8fafc;
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  transition: border-color 0.15s;
}

.word-card.learned {
  border-color: #22c55e;
  background: #f0fdf4;
}

.word-emoji {
  font-size: 52px;
  cursor: pointer;
  background: #fff;
  width: 82px;
  height: 82px;
  line-height: 82px;
  border-radius: 50%;
  margin: 0 auto 10px;
  border: 2px solid var(--border);
  transition: transform 0.15s;
}

.word-emoji:active {
  transform: scale(1.1);
}

.syllables {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
}

.syl-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  min-width: 64px;
}

.syl-btn.alt {
  background: #0284c7;
}

.btn-read-whole {
  margin-top: 6px;
  width: 100%;
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.word-builder-box {
  background: #f0fdfa;
  border-color: var(--primary);
}

.wb-emoji {
  font-size: 56px;
  margin-bottom: 4px;
}

.wb-hint {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.wb-slots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.wb-slot {
  width: 96px;
  height: 54px;
  border: 2.5px dashed var(--primary);
  background: #fff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.wb-slot.filled {
  border-style: solid;
  background: #ccfbf1;
}

.wb-plus {
  font-size: 22px;
  font-weight: 800;
  color: var(--muted);
}

.wb-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

/* 3. CANVAS TRACING */
.tracing-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.trace-char-btn {
  padding: 8px 14px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  min-height: 40px;
}

.trace-char-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.trace-char-btn.done {
  border-color: #22c55e;
  background: #f0fdf4;
  color: #15803d;
}

.trace-char-btn.active.done {
  background: var(--primary);
  color: #fff;
}

.trace-toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.brush-colors,
.brush-sizes {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--border);
  cursor: pointer;
}

.color-dot.active {
  box-shadow: 0 0 0 3px var(--text);
  transform: scale(1.1);
}

.size-btn {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.size-btn.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.canvas-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

#traceCanvas {
  background: #fffef0;
  border: 3px dashed var(--primary);
  border-radius: 22px;
  touch-action: none;
  cursor: crosshair;
  max-width: 100%;
  height: auto;
}

.trace-meter-wrap {
  max-width: 340px;
  margin: 0 auto 12px;
}

.trace-meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.trace-meter-bar {
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.trace-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #14b8a6, #22c55e);
  transition: width 0.2s;
}

.tracing-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.btn-clear,
.btn-sound-guide,
.btn-done-trace,
.btn-prev-story,
.btn-listen-story,
.btn-stop-story,
.btn-next-story,
.btn-claim-moral {
  padding: 11px 18px;
  border-radius: 12px;
  border: none;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
}

.btn-clear {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-sound-guide {
  background: #e0f2fe;
  color: #0369a1;
}

.btn-done-trace,
.btn-claim-moral {
  background: var(--accent);
  color: #fff;
}

/* 4. MATH STAGE */
.math-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.streak-badge {
  background: #fef3c7;
  color: #b45309;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
}

.btn-count-helper {
  background: #e0f2fe;
  color: #0369a1;
  border: 1.5px solid #bae6fd;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.math-visual-box {
  font-size: clamp(32px, 5vw, 44px);
  text-align: center;
  padding: 22px 16px;
  background: #f0fdf4;
  border: 2px solid #bbf7d0;
  border-radius: 20px;
  margin-bottom: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 108px;
}

.math-item-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 12px;
  transition: transform 0.2s, background 0.2s;
}

.math-item-chip.counting-now {
  transform: scale(1.25);
  background: #fef08a;
}

.math-plus-sign {
  font-size: 32px;
  font-weight: 900;
  color: var(--primary);
  margin: 0 8px;
}

.math-question-text {
  text-align: center;
  font-size: 19px;
  font-weight: 800;
}

/* 5. SIROH MODULE */
.episode-pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.ep-pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ep-pill.active {
  background: #0f172a;
  color: #fde047;
  border-color: #0f172a;
}

.ep-pill.done {
  border-color: #22c55e;
  background: #f0fdf4;
  color: #15803d;
}

.ep-pill.active.done {
  background: #0f172a;
  color: #fde047;
}

.siroh-player {
  max-width: 740px;
  margin: 0 auto;
  text-align: center;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  padding: 28px 22px;
  border-radius: 24px;
}

.sacred-light {
  width: 84px;
  height: 84px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #fde047 0%, #ca8a04 80%);
  color: #0f172a;
  font-size: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(250, 204, 21, 0.45);
}

.chapter-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.14);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  margin-bottom: 10px;
}

.siroh-story-text {
  font-size: 16.5px;
  line-height: 1.75;
  margin: 14px 0 20px;
  color: #e2e8f0;
}

.siroh-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.btn-prev-story,
.btn-next-story {
  background: #dbeafe;
  color: #1d4ed8;
}

.btn-listen-story {
  background: var(--primary-light);
  color: #0f172a;
}

.btn-stop-story {
  background: #334155;
  color: #f8fafc;
}

.siroh-quiz-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 18px;
}

.siroh-quiz-card h4 {
  color: #fde047;
  font-size: 15px;
  margin-bottom: 6px;
}

.siroh-quiz-q {
  font-size: 15px;
  margin-bottom: 12px;
}

.siroh-quiz-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
}

.siroh-opt-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.siroh-opt-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.siroh-opt-btn.correct {
  background: #15803d;
  border-color: #4ade80;
}

.siroh-opt-btn.wrong {
  background: #991b1b;
  border-color: #f87171;
}

.siroh-moral-box {
  background: rgba(255, 255, 255, 0.09);
  padding: 16px;
  border-radius: 16px;
}

.siroh-moral-box p {
  margin: 8px 0 14px;
  color: #fde047;
  font-weight: 600;
}

/* ==========================================
   MODALS (PARENT, TIME-UP GATE, DEMO CHECKOUT)
   ========================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(4px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: #fff;
  border-radius: 24px;
  max-width: 460px;
  width: 100%;
  padding: 24px;
  position: relative;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  text-align: center;
  max-height: 92vh;
  overflow-y: auto;
}

.parent-modal-card {
  max-width: 520px;
  text-align: left;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: #f1f5f9;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-weight: 800;
  cursor: pointer;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin-bottom: 16px;
}

.modal-logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.qris-badge {
  display: inline-block;
  background: #dcfce7;
  color: #15803d;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.parent-badge {
  background: #dbeafe;
  color: #1d4ed8;
}

.demo-badge {
  background: #fef3c7;
  color: #b45309;
}

/* PARENT MODAL ELEMENTS */
.parent-form-group {
  margin-bottom: 16px;
}

.parent-form-group label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}

.parent-name-row {
  display: flex;
  gap: 8px;
}

.parent-name-row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-size: 14px;
}

.timer-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.preset-btn {
  flex: 1;
  min-width: 76px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #f8fafc;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.preset-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.preset-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.parent-gate-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  padding: 8px 12px;
  border-radius: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.parent-gate-inline input {
  width: 78px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.parent-hint {
  font-size: 12px;
  color: var(--muted);
}

.parent-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.p-stat-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}

.p-stat-card span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.p-stat-card strong {
  font-size: 16px;
  color: var(--primary);
}

.parent-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-reset-progress {
  width: 100%;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

/* TIME UP MODAL (PARENT GATE) */
.timeup-card {
  border: 3px solid var(--accent);
}

.timeup-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.timeup-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 8px 0 16px;
}

.parent-gate-box {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

.parent-gate-box p {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  margin: 6px 0 10px;
}

.parent-gate-input-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.parent-gate-input-row input {
  width: 110px;
  padding: 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-size: 16px;
  text-align: center;
  font-weight: 700;
}

/* DEMO CHECKOUT ELEMENTS */
.order-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 14px;
  text-align: left;
  margin-bottom: 12px;
}

.order-summary small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.order-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}

.qris-box {
  border: 2px dashed var(--primary);
  background: #f0fdfa;
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
}

.demo-notice-box {
  border-color: #f59e0b;
  background: #fffbeb;
  text-align: left;
}

.qris-top-bar {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 8px;
  color: #b45309;
}

.demo-notice-text {
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
  margin-bottom: 8px;
}

.qris-Merchant {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.btn-confirm-pay {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.btn-disabled-pay {
  background: #cbd5e1;
  color: #475569;
  cursor: not-allowed;
  margin-bottom: 8px;
}

.btn-try-demo {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.pay-status-msg {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

/* TOAST NOTIFICATION */
.app-toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  z-index: 1200;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================
   MOBILE-FIRST RESPONSIVE BREAKPOINTS
   ========================================== */
/* ARENA THEMES: calm patterns keep question cards readable. */
.theme-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.theme-picker-label { font-size: 13px; font-weight: 800; margin-right: 4px; }
.theme-choice {
  min-height: 40px;
  padding: 7px 12px;
  border: 2px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  color: #17324d;
  cursor: pointer;
}
.theme-choice[data-game-theme="ceria"] { background: #ffe4e6; }
.theme-choice[data-game-theme="langit"] { background: #dbeafe; }
.theme-choice[data-game-theme="hutan"] { background: #dcfce7; }
.theme-choice[data-game-theme="laut"] { background: #cffafe; }
.theme-choice.active { border-color: #0f766e; box-shadow: 0 0 0 2px #fff inset; }
.theme-choice:focus-visible { outline: 3px solid #0f766e; outline-offset: 2px; }

html[data-game-theme="ceria"] {
  --arena-bg: #fff8ed;
  --arena-pattern: radial-gradient(circle at 12% 22%, #ffd7c2 0 10px, transparent 11px), radial-gradient(circle at 83% 68%, #ffd9e8 0 15px, transparent 16px), linear-gradient(135deg, #fff8ed, #fff0f5);
  --arena-quiz: #fff2d9;
  --arena-border: #f59e0b;
}
html[data-game-theme="langit"] {
  --arena-bg: #eff8ff;
  --arena-pattern: radial-gradient(ellipse at 18% 24%, #fff 0 27px, transparent 28px), radial-gradient(ellipse at 74% 72%, #fff 0 36px, transparent 37px), linear-gradient(145deg, #dbeafe, #f0f9ff);
  --arena-quiz: #e0f2fe;
  --arena-border: #38bdf8;
}
html[data-game-theme="hutan"] {
  --arena-bg: #f0fdf4;
  --arena-pattern: radial-gradient(ellipse at 14% 28%, #bbf7d0 0 18px, transparent 19px), radial-gradient(ellipse at 85% 72%, #d9f99d 0 24px, transparent 25px), linear-gradient(145deg, #ecfccb, #f0fdf4);
  --arena-quiz: #ecfccb;
  --arena-border: #65a30d;
}
html[data-game-theme="laut"] {
  --arena-bg: #ecfeff;
  --arena-pattern: radial-gradient(circle at 18% 25%, #a5f3fc 0 8px, transparent 9px), radial-gradient(circle at 80% 72%, #bae6fd 0 16px, transparent 17px), linear-gradient(145deg, #cffafe, #eff6ff);
  --arena-quiz: #d9f8ff;
  --arena-border: #0891b2;
}
html[data-game-theme] .kid-module {
  background-color: var(--arena-bg);
  background-image: var(--arena-pattern);
  background-size: 280px 220px, 320px 250px, auto;
}
html[data-game-theme] .quiz-box {
  background: var(--arena-quiz);
  border-color: var(--arena-border);
}
html[data-game-theme] .math-visual-box {
  background: var(--arena-quiz);
  border-color: var(--arena-border);
}

@media (max-width: 768px) {
  .topbar {
    padding: 10px 12px;
    gap: 8px;
  }

  .brand {
    width: 100%;
  }

  .brand small {
    display: block;
    font-size: 11px;
  }

  .nav-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    width: 100%;
  }

  .tab-pill {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
  }

  .hero {
    padding: 22px 14px;
  }

  .quick-input-group {
    width: 100%;
  }

  .quick-input-group input {
    min-width: 0;
    width: 100%;
  }

  .progress-strip { grid-template-columns: repeat(3, 1fr); }

  /* Bottom Sticky Navigation Bar for Kids on Mobile */
  .kid-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    border-top: 2px solid var(--border);
    padding: 6px 8px;
    z-index: 200;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  }

  .kid-tab {
    flex: 0 0 min(18vw, 94px);
    flex-direction: column;
    gap: 2px;
    padding: 6px 4px;
    border-radius: 12px;
    font-size: 11px;
    min-height: 54px;
  }

  .kid-tab.active {
    transform: none;
  }

  .tab-emoji {
    font-size: 18px;
  }

  .hijaiyah-grid {
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 8px;
  }

  .arabic-char {
    font-size: 34px;
  }

  .parent-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Child-first play surface and coloring studio */
#view-app {
  padding: 18px clamp(12px, 3vw, 34px) 120px;
  background: radial-gradient(circle at 8% 8%, #fff3ce 0 70px, transparent 71px),
    radial-gradient(circle at 94% 28%, #daf6ff 0 110px, transparent 111px),
    linear-gradient(180deg, #fff9ed, #f0fbff 58%, #f7f5ff);
  min-height: 100vh;
}
#view-app .kid-statusbar,
#view-app .progress-strip,
#view-app .theme-picker,
#view-app .kid-tabs { max-width: 1220px; margin-left: auto; margin-right: auto; }
#view-app .kid-module { max-width: 1220px; margin-left: auto; margin-right: auto; }
#view-app .kid-module { scroll-margin-top: 82px; }
#view-app .kid-welcome { max-width: 1220px; margin: 0 auto 20px; }
.kid-welcome { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); align-items: center; gap: 20px; padding: clamp(18px, 3vw, 32px); border: 2px solid #ffd78d; border-radius: 28px; background: radial-gradient(circle at 93% 16%, #ffb4ca 0 25px, transparent 26px), radial-gradient(circle at 5% 93%, #b7edcf 0 40px, transparent 41px), linear-gradient(120deg, #fff0cb, #fff9e8 50%, #e7f9ff); box-shadow: 0 8px 0 #f6e1b7; }
.kid-welcome-eyebrow { display: inline-block; padding: 5px 11px; border-radius: 99px; color: #965420; background: #fff; font-size: 11px; font-weight: 900; letter-spacing: .05em; }
.kid-welcome h1 { margin: 9px 0 5px; color: #14536a; font-size: clamp(25px, 3.1vw, 38px); line-height: 1.1; letter-spacing: -.035em; }
.kid-welcome p { color: #496477; font-size: 14px; font-weight: 600; }
.kid-launcher { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.kid-launcher button { min-height: 100px; padding: 9px; border: 2px solid #d4e8e9; border-radius: 19px; background: #fff; box-shadow: 0 4px 0 #cbe7e6; color: #21485b; cursor: pointer; transition: transform .16s, box-shadow .16s; }
.kid-launcher button:nth-child(2), .kid-launcher button:nth-child(5) { background: #f0f6ff; border-color: #d2ddf5; }
.kid-launcher button:nth-child(3), .kid-launcher button:nth-child(6) { background: #fff0f5; border-color: #f2d1df; }
.kid-launcher button:hover { transform: translateY(-3px); box-shadow: 0 7px 0 #cbe7e6; }
.kid-launcher button span, .kid-launcher button strong, .kid-launcher button small { display: block; text-align: center; }
.kid-launcher button span { font-size: 29px; line-height: 1.1; }
.kid-launcher button strong { margin-top: 4px; font-size: 13px; font-weight: 900; }
.kid-launcher button small { margin-top: 2px; font-size: 10px; color: #5e7180; }
#view-app .kid-tab { border-color: #cde7df; box-shadow: 0 4px 0 #d9ebe7; }
#view-app .kid-tab.active { background: #0a756e; box-shadow: 0 5px 0 #07534f; }
#view-app .kid-tab:hover, #view-app .coloring-template:hover { transform: translateY(-3px); }
#view-app .kid-module { border-color: #cce6df; box-shadow: 0 12px 30px rgba(35, 87, 95, .1); }
#view-app .module-header h2 { color: #174656; font-weight: 900; letter-spacing: -.03em; }
#view-app button { touch-action: manipulation; }
.coloring-module { background-image: radial-gradient(#ffe1a6 1.5px, transparent 1.5px), linear-gradient(155deg, #fffef9, #f5fbff) !important; background-size: 22px 22px, auto !important; }
.coloring-kicker { display: inline-block; margin-bottom: 7px; padding: 6px 14px; border-radius: 99px; color: #865214; background: #ffedb5; font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.coloring-step { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.coloring-step span { padding: 7px 12px; border-radius: 999px; background: #eef9ff; color: #19566f; border: 1px solid #b8e2f4; font-size: 12px; font-weight: 800; }
.coloring-templates { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.coloring-template { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 82px; padding: 8px; background: #fff; border: 2px solid #d8e8ee; border-radius: 18px; color: #173b51; cursor: pointer; transition: transform .15s, border-color .15s; }
.coloring-template.active { border-color: #0f766e; background: #ddf8ee; box-shadow: inset 0 0 0 2px #fff; }
.coloring-template-emoji { font-size: 31px; }
.coloring-template strong, .coloring-template small { display: block; text-align: left; line-height: 1.2; }
.coloring-template strong { font-size: 12px; font-weight: 900; }
.coloring-template small { color: #52717c; font-size: 10px; margin-top: 4px; }
.coloring-studio { padding: clamp(12px, 2vw, 22px); background: #fff; border: 2px solid #d7e7ee; border-radius: 26px; box-shadow: 0 8px 0 #dceef2; }
.coloring-toolbar { display: grid; gap: 14px; margin-bottom: 16px; }
.coloring-palette { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.coloring-swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #adc4d1, 0 3px 0 #cedde4; cursor: pointer; }
.coloring-swatch.active { box-shadow: 0 0 0 3px #1b5c70, 0 4px 0 #abcad5; transform: scale(1.08); }
.coloring-tools { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; }
.coloring-tool, .coloring-actions button { min-height: 46px; padding: 9px 14px; border: 2px solid #cee3eb; border-radius: 14px; background: #f5fbfe; color: #23485c; font-size: 13px; font-weight: 800; cursor: pointer; }
.coloring-tool.active { background: #d7f5e7; border-color: #0f766e; color: #084c47; }
.coloring-size { display: flex; align-items: center; gap: 7px; color: #335d69; font-size: 12px; font-weight: 800; }
.coloring-size input { width: 105px; accent-color: #0f766e; }
.coloring-board-wrap { max-width: 800px; margin: auto; padding: 9px; border: 3px dashed #9bd7e5; border-radius: 22px; background: #edfbff; }
.coloring-board { position: relative; width: 100%; aspect-ratio: 10 / 7; overflow: hidden; border-radius: 14px; background: #fff; box-shadow: 0 3px 10px #cce6ef; }
.coloring-board svg, .coloring-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.coloring-board svg [data-fill] { cursor: pointer; }
.coloring-board svg [data-fill]:focus-visible { outline: none; filter: drop-shadow(0 0 6px #ff9d3b); }
.coloring-board canvas { pointer-events: none; touch-action: none; }
.coloring-board[data-tool="brush"] canvas, .coloring-board[data-tool="eraser"] canvas { pointer-events: auto; cursor: crosshair; }
.coloring-hint { margin: 15px auto 12px; text-align: center; color: #22516b; font-size: 14px; font-weight: 800; }
.coloring-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; }
.coloring-actions button:disabled { opacity: .45; cursor: not-allowed; }
.coloring-actions .coloring-save { background: #ef8b33; color: #fff; border-color: #cf6514; box-shadow: 0 4px 0 #b6500d; }
.coloring-privacy { color: #57717a; font-size: 11px; text-align: center; margin-top: 15px; }
@media (min-width: 769px) and (max-width: 1060px) {
  .kid-welcome { grid-template-columns: 1fr; }
  .coloring-templates { grid-template-columns: repeat(3, 1fr); }
  #view-app .kid-tabs { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  #view-app { padding: 12px 10px 108px; }
  .kid-welcome { grid-template-columns: 1fr; gap: 16px; padding: 17px; }
  .kid-welcome h1 { font-size: 26px; }
  .kid-launcher { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .kid-launcher button { min-height: 92px; padding: 6px 3px; }
  .kid-launcher button span { font-size: 24px; }
  .kid-launcher button strong { font-size: 11px; }
  .kid-launcher button small { font-size: 9px; }
  .brand small { display: none; }
  #btnOpenParentDash, .nav-actions .checkout-btn { display: none; }
  #view-app .kid-tabs { max-width: none; }
  #view-app .kid-tab { flex-basis: 82px; }
  .coloring-templates { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .coloring-template { min-height: 86px; flex-direction: column; gap: 0; }
  .coloring-template strong, .coloring-template small { text-align: center; }
  .coloring-template-emoji { font-size: 26px; }
  .coloring-board-wrap { padding: 4px; }
  .coloring-tools .coloring-size { width: 100%; justify-content: center; }
  .coloring-actions button { flex: 1 1 42%; }
  .coloring-actions .coloring-save { flex-basis: 100%; }
}
@media (max-width: 380px) {
  .progress-strip { grid-template-columns: repeat(2, 1fr); }
  .coloring-template strong { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  #view-app .kid-tab:hover, #view-app .coloring-template:hover, .kid-launcher button:hover { transform: none; }
}
