/**
 * Dunia Ceria Kids - Lembaran Gaya CSS Prasekolah
 * Reka bentuk ceria, butang gula-gula yang mesra sentuhan, warna warni pastel bertenaga.
 */

:root {
  --primary-color: #FF5E7E;
  --secondary-color: #FFAE19;
  --accent-blue: #4D96FF;
  --accent-green: #6BCB77;
  --accent-purple: #9D4EDD;
  --bg-gradient: linear-gradient(135deg, #FFF6E9 0%, #E8F9FF 50%, #F3E8FF 100%);
  --card-bg: rgba(255, 255, 255, 0.95);
  --font-family: 'Quicksand', 'Nunito', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --shadow-candy: 0 10px 0 rgba(0, 0, 0, 0.08), 0 14px 25px rgba(0, 0, 0, 0.07);
  --shadow-btn: 0 6px 0 rgba(0, 0, 0, 0.15), 0 10px 20px rgba(0, 0, 0, 0.1);
  --shadow-btn-pressed: 0 2px 0 rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  min-height: 100vh;
  color: #2D3748;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Corak Latar Belakang Awan & Bintang */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  background-image: 
    radial-gradient(#FFE0B2 12%, transparent 12%),
    radial-gradient(#B3E5FC 12%, transparent 12%);
  background-size: 80px 80px;
  background-position: 0 0, 40px 40px;
  opacity: 0.35;
  z-index: 0;
}

#app-root {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1024px;
  margin: 0 auto;
  width: 100%;
  padding: 16px;
}

/* HEADER UTAMA */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-candy);
  margin-bottom: 20px;
  border: 3px solid #FFF;
  backdrop-filter: blur(8px);
}

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

.brand-logo {
  font-size: 2.2rem;
  animation: bounceSlow 3s infinite ease-in-out;
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(45deg, #FF5E7E, #FF9900);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: #718096;
}

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

/* LENCANA PROFIL PADA HEADER */
.profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFF;
  padding: 8px 16px;
  border-radius: 40px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border: 2px solid #E2E8F0;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-badge:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: #FF5E7E;
}

.profile-avatar {
  font-size: 1.8rem;
  line-height: 1;
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: 1rem;
  font-weight: 800;
  color: #1A202C;
}

.star-counter {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #D97706;
}

.star-icon {
  animation: pulseStar 2s infinite;
}

/* BUTANG IKON KECIL (AUDIO / IBU BAPA / RUMAH) */
.icon-btn {
  background: #FFF;
  border: 2px solid #E2E8F0;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.icon-btn:hover {
  transform: scale(1.1) rotate(6deg);
  border-color: #38BDF8;
}

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

.icon-btn.parent-mode {
  background: #FEF3C7;
  border-color: #F59E0B;
}

/* KAWASAN KANDUNGAN SKRIN */
.screen-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease-out;
}

/* KAD UTAMA */
.card-panel {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-candy);
  border: 4px solid #FFF;
  backdrop-filter: blur(10px);
  margin-bottom: 24px;
}

.panel-title {
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
  color: #1E293B;
  margin-bottom: 8px;
}

.panel-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  color: #64748B;
  margin-bottom: 24px;
}

/* ========================================================
   SKRIN 1: PILIH PROFIL ANAK
   ======================================================== */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.profile-card {
  background: #FFF;
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  border: 4px solid #F1F5F9;
  box-shadow: var(--shadow-btn);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-card:hover {
  transform: translateY(-6px) scale(1.03);
  border-color: #FFAE19;
  box-shadow: 0 14px 24px rgba(255, 174, 25, 0.2);
}

.profile-card.active {
  border-color: #FF5E7E;
  background: #FFF5F7;
  transform: translateY(-4px);
}

.profile-card .avatar-large {
  font-size: 4rem;
  margin-bottom: 12px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.profile-card:hover .avatar-large {
  transform: scale(1.15) rotate(-5deg);
}

.profile-card .kid-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1E293B;
  margin-bottom: 8px;
}

.profile-card .kid-stars {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FEF3C7;
  color: #B45309;
  font-weight: 800;
  font-size: 1rem;
  padding: 6px 14px;
  border-radius: 20px;
}

.btn-add-profile {
  background: #F8FAFC;
  border: 4px dashed #CBD5E1;
  box-shadow: none;
  justify-content: center;
}

.btn-add-profile:hover {
  border-color: #4D96FF;
  background: #EFF6FF;
}

.add-icon {
  font-size: 3rem;
  color: #3B82F6;
  margin-bottom: 8px;
}

/* ========================================================
   SKRIN 2: PERSEDIAAN JOM KIRA (SEMUA PADA SATU SKRIN!)
   ======================================================== */
.setup-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.setup-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: 14px;
}

.setup-section-title .step-number {
  background: #FF5E7E;
  color: #FFF;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
}

/* PILIHAN TAHAP (TUNAS, PINTAR, BIJAK) */
.levels-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.level-choice-btn {
  background: #FFF;
  border: 4px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.level-choice-btn:hover {
  transform: translateY(-4px);
}

.level-choice-btn.selected {
  border-color: #10B981;
  background: #ECFDF5;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
}

.level-choice-btn.pintar.selected {
  border-color: #0EA5E9;
  background: #F0F9FF;
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.2);
}

.level-choice-btn.bijak.selected {
  border-color: #EC4899;
  background: #FDF2F8;
  box-shadow: 0 10px 20px rgba(236, 72, 153, 0.2);
}

.level-icon {
  font-size: 2.6rem;
  margin-bottom: 8px;
}

.level-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1E293B;
  margin-bottom: 4px;
}

.level-age {
  display: inline-block;
  background: #E2E8F0;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 6px;
}

.level-desc {
  font-size: 0.82rem;
  color: #64748B;
  line-height: 1.3;
}

/* PILIHAN AKTIVITI (KAD IMBAS, KIRA, TAMBAH, TOLAK, BANDING) */
.activities-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.activity-choice-btn {
  background: #FFF;
  border: 3px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.activity-choice-btn:hover {
  transform: translateY(-3px);
  border-color: #FFAE19;
}

.activity-choice-btn.selected {
  border-color: #FF5E7E;
  background: #FFF5F7;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(255, 94, 126, 0.2);
}

.activity-choice-btn.disabled {
  opacity: 0.45;
  filter: grayscale(80%);
  pointer-events: none;
}

.activity-icon {
  font-size: 2.2rem;
  margin-bottom: 6px;
}

.activity-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1E293B;
  margin-bottom: 2px;
}

.activity-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: #718096;
}

/* PILIHAN BILANGAN SOALAN */
.counts-selector {
  display: flex;
  gap: 12px;
}

.count-choice-btn {
  flex: 1;
  background: #FFF;
  border: 3px solid #E2E8F0;
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 800;
}

.count-choice-btn.selected {
  border-color: #8B5CF6;
  background: #F5F3FF;
  color: #6D28D9;
}

.count-title {
  font-size: 1.15rem;
}

.count-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748B;
}

/* BUTANG GERGASI MULA */
.btn-launch-game {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFF;
  font-size: 1.6rem;
  font-weight: 800;
  padding: 18px 32px;
  border: none;
  border-radius: 40px;
  cursor: pointer;
  box-shadow: 0 8px 0 #047857, 0 14px 28px rgba(16, 185, 129, 0.4);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: all 0.15s ease;
  margin-top: 10px;
}

.btn-launch-game:hover {
  transform: translateY(-3px);
  box-shadow: 0 11px 0 #047857, 0 18px 32px rgba(16, 185, 129, 0.45);
}

.btn-launch-game:active {
  transform: translateY(5px);
  box-shadow: 0 3px 0 #047857, 0 6px 14px rgba(16, 185, 129, 0.3);
}

/* ========================================================
   SKRIN 3A: KAD IMBAS INTERAKTIF
   ======================================================== */
.flashcard-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.flashcard-display {
  background: #FFF;
  border-radius: var(--radius-lg);
  border: 5px solid #FBCFE8;
  padding: 32px 24px;
  width: 100%;
  max-width: 600px;
  text-align: center;
  box-shadow: var(--shadow-candy);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.card-number-badge {
  background: #FF5E7E;
  color: #FFF;
  font-size: 4rem;
  font-weight: 900;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(255, 94, 126, 0.4);
  margin-bottom: 12px;
}

.card-word-title {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #1E293B;
  margin-bottom: 8px;
}

.card-hint-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #64748B;
  margin-bottom: 20px;
}

/* GRID OBJEK INTERAKTIF */
.objects-playground {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  background: #F8FAFC;
  border-radius: var(--radius-md);
  border: 2px dashed #CBD5E1;
  width: 100%;
  min-height: 140px;
  align-items: center;
}

.interactive-object {
  position: relative;
  font-size: 3.5rem;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #FFF;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.interactive-object:hover {
  transform: scale(1.2) rotate(8deg);
}

.interactive-object:active {
  transform: scale(0.95);
}

.interactive-object.tapped {
  background: #FEF3C7;
  border: 3px solid #F59E0B;
}

.item-count-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #10B981;
  color: #FFF;
  font-size: 0.95rem;
  font-weight: 900;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  animation: popBadge 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.interactive-object.eaten {
  opacity: 0.45;
  filter: grayscale(80%);
}

.interactive-object.eaten::after {
  content: '❌';
  position: absolute;
  font-size: 1.8rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* NAVIGASI KAD IMBAS */
.flashcard-nav {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 600px;
  justify-content: space-between;
}

.nav-candy-btn {
  background: #FFF;
  border: 3px solid #E2E8F0;
  border-radius: 30px;
  padding: 14px 24px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #1E293B;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.nav-candy-btn:hover {
  border-color: #38BDF8;
  transform: translateY(-2px);
}

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

.nav-candy-btn.primary {
  background: #FF5E7E;
  color: #FFF;
  border-color: #E11D48;
}

/* ========================================================
   SKRIN 3B: KUIZ BERGAMBAR MESRA ANAK
   ======================================================== */
.quiz-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.progress-track {
  flex: 1;
  background: #E2E8F0;
  height: 18px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 2px solid #FFF;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  background: linear-gradient(90deg, #F59E0B, #10B981);
  height: 100%;
  border-radius: 12px;
  transition: width 0.4s ease;
}

.question-counter-badge {
  font-size: 1rem;
  font-weight: 800;
  background: #FFF;
  padding: 6px 14px;
  border-radius: 20px;
  border: 2px solid #CBD5E1;
  color: #334155;
  white-space: nowrap;
}

/* KAWASAN SOALAN */
.question-card {
  background: #FFF;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 4px solid #F1F5F9;
  box-shadow: var(--shadow-candy);
  margin-bottom: 24px;
  text-align: center;
}

.question-prompt-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
}

.question-text {
  font-size: 1.45rem;
  font-weight: 800;
  color: #1E293B;
  line-height: 1.3;
}

.btn-speak-question {
  background: #FEF3C7;
  border: 2px solid #F59E0B;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 8px rgba(245, 158, 11, 0.2);
  transition: transform 0.2s ease;
}

.btn-speak-question:hover {
  transform: scale(1.15);
}

/* GAMBAR TAMBAH & TOLAK KOTAK BERSEBELAHAN */
.math-equation-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.equation-group-box {
  background: #F8FAFC;
  border: 3px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}

.equation-group-box.box-a {
  border-color: #93C5FD;
  background: #EFF6FF;
}

.equation-group-box.box-b {
  border-color: #FCA5A5;
  background: #FEF2F2;
}

.equation-symbol {
  font-size: 2.6rem;
  font-weight: 900;
  color: #64748B;
}

.equation-group-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #475569;
}

/* BUTANG-BUTANG JAWAPAN */
.answers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.answer-btn {
  background: #FFF;
  border: 4px solid #E2E8F0;
  border-radius: var(--radius-lg);
  padding: 18px 12px;
  font-size: 2.2rem;
  font-weight: 900;
  color: #1E293B;
  cursor: pointer;
  box-shadow: 0 8px 0 #CBD5E1, 0 12px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.12s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.answer-btn:hover {
  transform: translateY(-3px);
  border-color: #38BDF8;
  box-shadow: 0 11px 0 #94A3B8, 0 16px 24px rgba(0, 0, 0, 0.1);
}

.answer-btn:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 #94A3B8, 0 4px 8px rgba(0, 0, 0, 0.08);
}

.answer-subword {
  font-size: 0.95rem;
  font-weight: 700;
  color: #64748B;
}

.answer-btn.correct {
  background: #10B981 !important;
  color: #FFF !important;
  border-color: #047857 !important;
  box-shadow: 0 6px 0 #065F46 !important;
  animation: answerJelly 0.5s ease;
}

.answer-btn.correct .answer-subword {
  color: #ECFDF5;
}

.answer-btn.wrong {
  background: #FEF2F2 !important;
  border-color: #F87171 !important;
  animation: shake 0.4s ease;
}

/* POPUP MAKLUM BALAS PANTAS */
.feedback-overlay {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1E293B;
  color: #FFF;
  padding: 14px 28px;
  border-radius: 40px;
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  z-index: 999;
  animation: slideUpFade 0.3s ease;
}

.feedback-overlay.praise {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.feedback-overlay.retry {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

/* ========================================================
   SKRIN 4: KEPUTUSAN & TAHNIAH
   ======================================================== */
.result-card {
  text-align: center;
  padding: 36px 20px;
}

.trophy-bounce {
  font-size: 5rem;
  display: inline-block;
  animation: bounceSlow 2s infinite ease-in-out;
  margin-bottom: 12px;
}

.result-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: #1E293B;
  margin-bottom: 6px;
}

.result-subtitle {
  font-size: 1.2rem;
  font-weight: 700;
  color: #64748B;
  margin-bottom: 24px;
}

.stars-awarded-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.awarded-star {
  font-size: 3.5rem;
  animation: popBadge 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.score-summary-pill {
  display: inline-block;
  background: #EFF6FF;
  border: 3px solid #BFDBFE;
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 1.3rem;
  font-weight: 800;
  color: #1D4ED8;
  margin-bottom: 30px;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 450px;
  margin: 0 auto;
}

.btn-result-action {
  background: #FFF;
  border: 3px solid #E2E8F0;
  border-radius: 30px;
  padding: 16px 24px;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.15s ease;
}

.btn-result-action.primary {
  background: linear-gradient(135deg, #FF5E7E 0%, #E11D48 100%);
  color: #FFF;
  border: none;
  box-shadow: 0 6px 0 #9F1239, 0 12px 20px rgba(225, 29, 72, 0.3);
}

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

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

/* ========================================================
   DASHBOARD IBU BAPA (PARENT DASHBOARD)
   ======================================================== */
.parent-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.parent-banner {
  background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
  color: #FFF;
  padding: 24px;
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.stat-box {
  background: #FFF;
  border: 2px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 900;
  color: #1E293B;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #64748B;
}

.history-table-container {
  background: #FFF;
  border-radius: var(--radius-md);
  border: 2px solid #E2E8F0;
  overflow: hidden;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th {
  background: #F8FAFC;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 800;
  color: #475569;
  border-bottom: 2px solid #E2E8F0;
}

.history-table td {
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  border-bottom: 1px solid #F1F5F9;
  color: #1E293B;
}

/* MODAL / DIALOG */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  padding: 16px;
}

.modal-card {
  background: #FFF;
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: popBadge 0.25s ease-out;
}

.modal-input {
  width: 100%;
  padding: 14px 18px;
  border: 3px solid #CBD5E1;
  border-radius: var(--radius-sm);
  font-size: 1.15rem;
  font-family: inherit;
  font-weight: 700;
  margin-top: 14px;
  margin-bottom: 18px;
  text-align: center;
  outline: none;
}

.modal-input:focus {
  border-color: #38BDF8;
}

.avatar-selector-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.avatar-pick-btn {
  font-size: 2.2rem;
  background: #F8FAFC;
  border: 3px solid #E2E8F0;
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.avatar-pick-btn.selected {
  border-color: #FF5E7E;
  background: #FFF5F7;
  transform: scale(1.1);
}

/* ANIMASI KEYFRAMES */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes popBadge {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes answerJelly {
  0% { transform: scale(0.9); }
  40% { transform: scale(1.15); }
  70% { transform: scale(0.98); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* RESPONSIF UNTUK TELEFON & TABLET KANAK-KANAK */
@media (max-width: 640px) {
  #app-root {
    padding: 10px;
  }
  .app-header {
    padding: 10px 14px;
  }
  .brand-title {
    font-size: 1.25rem;
  }
  .levels-selector {
    grid-template-columns: 1fr;
  }
  .interactive-object {
    font-size: 2.8rem;
    width: 60px;
    height: 60px;
  }
  .answer-btn {
    padding: 14px 8px;
    font-size: 1.8rem;
  }
  .question-text {
    font-size: 1.2rem;
  }
}
