/* ==========================================================================
   KASHAFA MATH - CALISTUNG KASHAFA
   Gaya Visual: Ceria, Ramah Anak SD, Modern, Colorful, PWA Responsive
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@600;700;800;900&display=swap');

:root {
  --primary-blue: #38b6ff;
  --primary-dark: #0288d1;
  --sky-gradient: linear-gradient(180deg, #62c7ff 0%, #b3e5fc 50%, #e1f5fe 100%);
  --grass-green: #4caf50;
  --grass-light: #81c784;
  
  /* Warna Operasi Matematika */
  --op-tambah: #28a745;
  --op-tambah-shadow: #1e7e34;
  --op-kurang: #fd7e14;
  --op-kurang-shadow: #d35400;
  --op-kali: #e83e8c;
  --op-kali-shadow: #b21f66;
  --op-bagi: #7952b3;
  --op-bagi-shadow: #553098;
  --op-admin: #4a6572;
  --op-admin-shadow: #344955;
  
  --font-fun: 'Fredoka', 'Nunito', 'Segoe UI', cursive, sans-serif;
  --font-text: 'Nunito', 'Fredoka', 'Segoe UI', sans-serif;
}

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

html, body {
  width: 100%;
  min-height: 100%;
  font-family: var(--font-fun);
  background-color: #8ed6ff;
  color: #2c3e50;
  overflow-x: hidden;
}

/* ==========================================================================
   BACKGROUND WORLD (Langit, Awan, Matahari, Bukit Rumput & Bunga)
   ========================================================================== */
.world-bg {
  min-height: 100vh;
  width: 100%;
  background: var(--sky-gradient);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding-bottom: 50px;
}

/* Elemen Langit */
.sun-shape {
  position: absolute;
  top: 20px;
  right: 25px;
  width: 75px;
  height: 75px;
  background: radial-gradient(circle, #fff176 0%, #fbc02d 80%);
  border-radius: 50%;
  box-shadow: 0 0 35px #fff59d;
  animation: sunGlow 3s ease-in-out infinite alternate;
  z-index: 1;
}

@keyframes sunGlow {
  0% { transform: scale(1); filter: drop-shadow(0 0 10px #ffee58); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 25px #fdd835); }
}

.cloud-item {
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.04);
  z-index: 1;
  pointer-events: none;
}

.cloud-item::before, .cloud-item::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud-1 {
  top: 40px;
  left: 20px;
  width: 110px;
  height: 38px;
  animation: floatCloud 22s linear infinite alternate;
}
.cloud-1::before { width: 45px; height: 45px; top: -20px; left: 18px; }
.cloud-1::after { width: 32px; height: 32px; top: -14px; right: 20px; }

.cloud-2 {
  top: 130px;
  right: 40px;
  width: 140px;
  height: 44px;
  animation: floatCloud 28s linear infinite alternate-reverse;
}
.cloud-2::before { width: 55px; height: 55px; top: -26px; left: 25px; }
.cloud-2::after { width: 40px; height: 40px; top: -18px; right: 25px; }

@keyframes floatCloud {
  0% { transform: translateX(0); }
  100% { transform: translateX(40px); }
}

/* Meadow Footer */
.meadow-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 55px;
  background: linear-gradient(180deg, #66bb6a 0%, #43a047 100%);
  border-top: 4px solid #81c784;
  border-radius: 30px 30px 0 0;
  z-index: 1;
  pointer-events: none;
}
.meadow-footer::before {
  content: '🌸 🌼 🌺 🌿 🍀 🌸 🌼 🌺 🌿 🍀 🌸 🌼 🌺';
  display: block;
  font-size: 16px;
  letter-spacing: 12px;
  text-align: center;
  position: relative;
  top: -12px;
}

/* ==========================================================================
   APP CONTAINER (RESPONSIVE PHONE/TABLET VIEWPORT)
   ========================================================================== */
.app-container {
  width: 100%;
  max-width: 460px;
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 70px 16px;
}

/* ==========================================================================
   BRANDING & LOGO (Math Ceria)
   ========================================================================== */
.brand-header {
  text-align: center;
  margin-bottom: 12px;
}

.math-ceria-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 800;
  color: #ff5722;
  text-shadow: 2px 3px 0 #ffffff, 4px 5px 0 rgba(0,0,0,0.15);
  line-height: 1.1;
  position: relative;
}

.math-ceria-title .letter-cap {
  color: #ff3d00;
  position: relative;
}
.math-ceria-title .letter-cap::before {
  content: '🎓';
  position: absolute;
  top: -24px;
  left: -12px;
  font-size: 30px;
  transform: rotate(-15deg);
}

.math-ceria-title .word-ceria {
  color: #00b0ff;
  margin-left: 8px;
}

.sub-tagline {
  font-size: 17px;
  font-weight: 700;
  color: #0277bd;
  margin-top: 4px;
}

.sub-tagline-fun {
  font-size: 15px;
  color: #37474f;
  margin-top: 2px;
  font-weight: 600;
}

/* Ribbon Banner */
.ribbon-banner {
  display: inline-block;
  background: linear-gradient(135deg, #ffd54f 0%, #ffb300 100%);
  color: #bf360c;
  padding: 6px 24px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(255, 179, 0, 0.4);
  border: 2px solid #ffffff;
  margin: 8px 0;
}

/* ==========================================================================
   3D TACTILE BUTTONS (Sangat Menyenangkan & Ramah Sentuhan Anak)
   ========================================================================== */
.btn-game {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 64px;
  padding: 12px 24px;
  font-family: var(--font-fun);
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  text-decoration: none;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  user-select: none;
}

.btn-game .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  font-size: 26px;
  font-weight: 900;
  margin-right: 18px;
  flex-shrink: 0;
}

.btn-game .btn-label {
  flex-grow: 1;
  text-align: left;
  letter-spacing: 0.5px;
}

/* Operasi Tambah (Hijau) */
.btn-op-tambah {
  background: linear-gradient(180deg, #34d058 0%, #28a745 100%);
  box-shadow: 0 6px 0 var(--op-tambah-shadow), 0 10px 18px rgba(40, 167, 69, 0.35);
}
.btn-op-tambah:active, .btn-op-tambah:focus-visible {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--op-tambah-shadow), 0 5px 10px rgba(40, 167, 69, 0.3);
}

/* Operasi Kurang (Orange) */
.btn-op-kurang {
  background: linear-gradient(180deg, #ff9800 0%, #f57c00 100%);
  box-shadow: 0 6px 0 var(--op-kurang-shadow), 0 10px 18px rgba(245, 124, 0, 0.35);
}
.btn-op-kurang:active, .btn-op-kurang:focus-visible {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--op-kurang-shadow), 0 5px 10px rgba(245, 124, 0, 0.3);
}

/* Operasi Kali (Pink/Merah) */
.btn-op-kali {
  background: linear-gradient(180deg, #ff4081 0%, #e91e63 100%);
  box-shadow: 0 6px 0 var(--op-kali-shadow), 0 10px 18px rgba(233, 30, 99, 0.35);
}
.btn-op-kali:active, .btn-op-kali:focus-visible {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--op-kali-shadow), 0 5px 10px rgba(233, 30, 99, 0.3);
}

/* Operasi Bagi (Ungu) */
.btn-op-bagi {
  background: linear-gradient(180deg, #9c27b0 0%, #7b1fa2 100%);
  box-shadow: 0 6px 0 var(--op-bagi-shadow), 0 10px 18px rgba(123, 31, 162, 0.35);
}
.btn-op-bagi:active, .btn-op-bagi:focus-visible {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--op-bagi-shadow), 0 5px 10px rgba(123, 31, 162, 0.3);
}

/* Admin Button (Slate/Biru - Panjang Penuh Menyesuaikan Tombol Lainnya) */
.btn-op-admin {
  background: linear-gradient(180deg, #607d8b 0%, #455a64 100%);
  box-shadow: 0 6px 0 var(--op-admin-shadow), 0 10px 18px rgba(69, 90, 100, 0.35);
  width: 100%;
  max-width: 100%;
}
.btn-op-admin:active, .btn-op-admin:focus-visible {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--op-admin-shadow), 0 5px 10px rgba(69, 90, 100, 0.3);
}

/* Range Peringkat Button (Cyan / Biru Ceria Berbintang) */
.btn-op-range {
  background: linear-gradient(180deg, #00b4d8 0%, #0077b6 100%);
  box-shadow: 0 6px 0 #023e8a, 0 10px 18px rgba(0, 119, 182, 0.35);
  color: #ffffff;
}
.btn-op-range:active, .btn-op-range:focus-visible {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #023e8a, 0 5px 10px rgba(0, 119, 182, 0.3);
}
.btn-op-range .btn-icon {
  background: rgba(255, 255, 255, 0.28);
}

/* Hover Lift Effect */
@media (hover: hover) {
  .btn-game:hover {
    filter: brightness(1.05);
  }
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
.card-fun {
  background: #ffffff;
  border-radius: 26px;
  padding: 24px 20px;
  box-shadow: 0 14px 28px rgba(0, 114, 255, 0.12), 0 6px 12px rgba(0, 0, 0, 0.05);
  border: 3px solid #e1f5fe;
  position: relative;
  margin-bottom: 18px;
}

/* Header Bar Navigasi */
.quiz-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 16px;
}

.btn-nav-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #ffffff;
  color: #0288d1;
  border-radius: 50%;
  font-size: 22px;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  border: 2px solid #b3e5fc;
  transition: transform 0.15s;
}
.btn-nav-back:active { transform: scale(0.92); }

.quiz-header-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}
.badge-tambah { background: var(--op-tambah); }
.badge-kurang { background: var(--op-kurang); }
.badge-kali { background: var(--op-kali); }
.badge-bagi { background: var(--op-bagi); }

/* Live Timer Pill */
.timer-pill {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  color: #e65100;
  font-weight: 800;
  font-size: 18px;
  padding: 6px 14px;
  border-radius: 50px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border: 2px solid #ffe0b2;
}
.timer-pill.timer-urgent {
  background: #ffebee;
  color: #d32f2f;
  border-color: #ffcdd2;
  animation: pulseUrgent 1s infinite alternate;
}
@keyframes pulseUrgent {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); }
}

/* ==========================================================================
   SOAL MATEMATIKA (TYPOGRAPHY BESAR & JELAS)
   ========================================================================== */
.question-formula-box {
  background: linear-gradient(135deg, #f0faff 0%, #ffffff 100%);
  border: 3px dashed #81d4fa;
  border-radius: 24px;
  padding: 24px 16px;
  text-align: center;
  margin: 16px 0;
}

.question-formula {
  font-size: 52px;
  font-weight: 900;
  color: #1a237e;
  letter-spacing: 2px;
  line-height: 1.2;
}

/* Input Jawaban */
.input-jawaban-wrapper {
  margin: 18px 0;
}

.input-jawaban {
  width: 100%;
  height: 64px;
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  border: 3px solid #81d4fa;
  border-radius: 20px;
  outline: none;
  background: #ffffff;
  color: #0d47a1;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-jawaban:focus {
  border-color: #0288d1;
  box-shadow: 0 0 0 6px rgba(2, 136, 209, 0.2);
}

/* Tombol Aksi Kuis (Jawab / Mulai) */
.btn-action-primary {
  display: block;
  width: 100%;
  height: 62px;
  background: linear-gradient(180deg, #ff9800 0%, #f57c00 100%);
  box-shadow: 0 6px 0 #d35400, 0 10px 18px rgba(245, 124, 0, 0.35);
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
  text-align: center;
  line-height: 62px;
  text-decoration: none;
}
.btn-action-primary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #d35400;
}

.btn-action-success {
  background: linear-gradient(180deg, #34d058 0%, #28a745 100%);
  box-shadow: 0 6px 0 #1e7e34, 0 10px 18px rgba(40, 167, 69, 0.35);
}
.btn-action-success:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #1e7e34;
}

.btn-action-blue {
  background: linear-gradient(180deg, #29b6f6 0%, #0288d1 100%);
  box-shadow: 0 6px 0 #01579b, 0 10px 18px rgba(2, 136, 209, 0.35);
}
.btn-action-blue:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #01579b;
}

/* Progress Bar */
.progress-container {
  width: 100%;
  height: 14px;
  background: #e0f2fe;
  border-radius: 50px;
  overflow: hidden;
  margin: 12px 0;
  border: 1px solid #b3e5fc;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
  border-radius: 50px;
  transition: width 0.3s ease;
}

/* ==========================================================================
   HASIL / SKOR & PREDIKAT (Panel 5 & 11)
   ========================================================================== */
.trophy-container {
  margin: 12px auto;
  text-align: center;
  font-size: 72px;
  animation: bounceTrophy 1.2s ease infinite alternate;
}
@keyframes bounceTrophy {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

.score-display-box {
  background: linear-gradient(135deg, #e1f5fe 0%, #ffffff 100%);
  border-radius: 24px;
  padding: 16px;
  text-align: center;
  border: 3px solid #81d4fa;
  margin: 12px 0;
}
.score-number {
  font-size: 64px;
  font-weight: 900;
  color: #0288d1;
  line-height: 1;
}
.score-label {
  font-size: 16px;
  font-weight: 800;
  color: #546e7a;
  letter-spacing: 2px;
}

/* Rincian Skor */
.score-detail-list {
  background: #f8fafc;
  border-radius: 18px;
  padding: 14px 18px;
  margin: 14px 0;
  border: 1px solid #e2e8f0;
}
.score-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
  padding: 6px 0;
}
.score-detail-row:not(:last-child) {
  border-bottom: 1px dashed #cbd5e1;
}

/* Predikat Badges */
.predicate-badge-card {
  padding: 14px 18px;
  border-radius: 20px;
  text-align: center;
  margin: 16px 0;
  border: 2px solid;
}
.predikat-luar-biasa {
  background: #fffde7;
  border-color: #ffd54f;
  color: #f57f17;
}
.predikat-sangat-baik {
  background: #e3f2fd;
  border-color: #90caf9;
  color: #1565c0;
}
.predikat-baik {
  background: #e8f5e9;
  border-color: #a5d6a7;
  color: #2e7d32;
}
.predikat-cukup {
  background: #fff3e0;
  border-color: #ffcc80;
  color: #e65100;
}
.predikat-perlu-latihan {
  background: #ffebee;
  border-color: #ef9a9a;
  color: #c62828;
}

/* ==========================================================================
   ADMIN STYLES (Panel 6, 7, 8, 9)
   ========================================================================== */
.admin-card-nav {
  display: flex;
  align-items: center;
  padding: 18px 20px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  border: 2px solid #e2e8f0;
  text-decoration: none;
  color: #2d3748;
  margin-bottom: 14px;
  transition: transform 0.15s, border-color 0.15s;
}
.admin-card-nav:hover {
  transform: translateY(-2px);
  border-color: #38b6ff;
}
.admin-icon-bubble {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #e0f2fe;
  color: #0288d1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-right: 16px;
  flex-shrink: 0;
}

/* Stepper Waktu */
.stepper-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 24px 0;
}
.btn-stepper {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #38b6ff;
  color: #ffffff;
  font-size: 32px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(56, 182, 255, 0.4);
  transition: transform 0.1s;
}
.btn-stepper:active { transform: scale(0.92); }

.stepper-value-box {
  width: 90px;
  height: 70px;
  background: #f0f9ff;
  border: 3px solid #81d4fa;
  border-radius: 20px;
  font-size: 38px;
  font-weight: 900;
  color: #01579b;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* PWA Install Banner */
.pwa-install-banner {
  background: #ffffff;
  border-radius: 20px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 2px solid #81d4fa;
  box-shadow: 0 6px 14px rgba(0, 114, 255, 0.1);
  margin-top: 14px;
}
.btn-pwa-install {
  background: linear-gradient(135deg, #0288d1 0%, #00b0ff 100%);
  color: #ffffff;
  border: none;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 50px;
  cursor: pointer;
}

/* ==========================================================================
   REVISI: MENU LIHAT PERINGKAT, MODE PILIHAN & EXTRA LARGE FORMULA
   ========================================================================== */

/* Tombol Lihat Peringkat di Menu Utama (Kuning Keemasan) */
.btn-op-peringkat {
  background: linear-gradient(180deg, #ffca28 0%, #ffb300 100%);
  color: #4e342e;
  box-shadow: 0 6px 0 #ff8f00, 0 10px 18px rgba(255, 179, 0, 0.35);
  font-size: 22px;
}
.btn-op-peringkat:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #ff8f00;
}
.btn-op-peringkat .btn-icon {
  background: rgba(255, 255, 255, 0.55);
}

/* Tombol Mode Kuis: ISI JAWABAN & PILIHAN GANDA */
.btn-mode-isian {
  background: linear-gradient(180deg, #00b4d8 0%, #0077b6 100%);
  box-shadow: 0 6px 0 #023e8a, 0 10px 18px rgba(0, 119, 182, 0.35);
}
.btn-mode-isian:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #023e8a;
}

.btn-mode-pg {
  background: linear-gradient(180deg, #9d4edd 0%, #7b2cbf 100%);
  box-shadow: 0 6px 0 #5a189a, 0 10px 18px rgba(123, 44, 191, 0.35);
}
.btn-mode-pg:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #5a189a;
}

/* ==========================================================================
   EXTRA LARGE TYPOGRAPHY UNTUK "ISI JAWABAN" (Permintaan Khusus User)
   ========================================================================== */
.formula-box-extra-large {
  padding: 30px 18px !important;
  background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%) !important;
  border: 4px dashed #0288d1 !important;
  border-radius: 28px !important;
}

.formula-text-extra-large {
  font-size: 68px !important;
  font-weight: 900 !important;
  color: #0d47a1 !important;
  letter-spacing: 3px !important;
  line-height: 1.15 !important;
  text-shadow: 2px 3px 0 rgba(255, 255, 255, 0.8), 3px 4px 6px rgba(0, 0, 0, 0.08);
}

@media (min-width: 480px) {
  .formula-text-extra-large {
    font-size: 80px !important;
  }
}

.input-jawaban-extra-large {
  height: 82px !important;
  font-size: 48px !important;
  font-weight: 900 !important;
  letter-spacing: 3px !important;
  color: #01579b !important;
  border: 4px solid #29b6f6 !important;
  border-radius: 24px !important;
  background: #fbfdff !important;
  box-shadow: 0 6px 14px rgba(41, 182, 246, 0.15);
}
.input-jawaban-extra-large:focus {
  border-color: #0288d1 !important;
  box-shadow: 0 0 0 8px rgba(2, 136, 209, 0.25) !important;
}

/* ==========================================================================
   GRID PILIHAN GANDA (4 Opsi: A, B, C, D)
   ========================================================================== */
.options-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
  margin-top: 18px;
}

.btn-option-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 18px;
  border-radius: 22px;
  border: none;
  color: #ffffff;
  font-family: var(--font-fun);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  min-height: 74px;
  user-select: none;
}
.btn-option-card:active {
  transform: translateY(4px);
}

.btn-option-card .option-letter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.35);
  font-size: 22px;
  font-weight: 900;
  margin-right: 12px;
  flex-shrink: 0;
}

.btn-option-card .option-value-text {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 1px;
}

/* Warna Kartu Opsi */
.btn-opt-blue {
  background: linear-gradient(180deg, #42a5f5 0%, #1e88e5 100%);
  box-shadow: 0 6px 0 #1565c0, 0 8px 14px rgba(30, 136, 229, 0.3);
}
.btn-opt-blue:active { box-shadow: 0 2px 0 #1565c0; }

.btn-opt-green {
  background: linear-gradient(180deg, #66bb6a 0%, #43a047 100%);
  box-shadow: 0 6px 0 #2e7d32, 0 8px 14px rgba(67, 160, 71, 0.3);
}
.btn-opt-green:active { box-shadow: 0 2px 0 #2e7d32; }

.btn-opt-orange {
  background: linear-gradient(180deg, #ffa726 0%, #fb8c00 100%);
  box-shadow: 0 6px 0 #ef6c00, 0 8px 14px rgba(251, 140, 0, 0.3);
}
.btn-opt-orange:active { box-shadow: 0 2px 0 #ef6c00; }

.btn-opt-purple {
  background: linear-gradient(180deg, #ab47bc 0%, #8e24aa 100%);
  box-shadow: 0 6px 0 #6a1b9a, 0 8px 14px rgba(142, 36, 170, 0.3);
}
.btn-opt-purple:active { box-shadow: 0 2px 0 #6a1b9a; }

.selected-opt {
  transform: scale(0.96);
  filter: brightness(1.2);
  outline: 4px solid #ffffff;
}

/* ==========================================================================
   TOMBOL MENU: LIHAT PERINGKAT (Kuning Emas / Amber Ceria Di Atas Admin)
   ========================================================================== */
.btn-op-peringkat {
  background: linear-gradient(180deg, #ffb300 0%, #fb8c00 100%);
  box-shadow: 0 6px 0 #e65100, 0 10px 18px rgba(251, 140, 0, 0.35);
  color: #ffffff;
}
.btn-op-peringkat:active, .btn-op-peringkat:focus-visible {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #e65100, 0 5px 10px rgba(251, 140, 0, 0.3);
}
.btn-op-peringkat .btn-icon {
  background: rgba(255, 255, 255, 0.28);
}

/* ==========================================================================
   BANNER PASANG PWA (Diposisikan Setelah Bagi / Nomor 4)
   ========================================================================== */
.pwa-install-banner {
  margin-top: 14px;
  margin-bottom: 22px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 2px dashed #4fc3f7;
  border-radius: 24px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 24px rgba(2, 136, 209, 0.12);
  width: 100%;
}

.pwa-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #e1f5fe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-install-banner .btn-pwa-install {
  background: linear-gradient(180deg, #00b0ff 0%, #0072ff 100%);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 10px 22px;
  font-family: var(--font-fun);
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 114, 255, 0.35);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  flex-shrink: 0;
}

.pwa-install-banner .btn-pwa-install:active {
  transform: translateY(2px);
  box-shadow: 0 2px 4px rgba(0, 114, 255, 0.2);
}

/* ==========================================================================
   MODE ISI JAWABAN (FONT EKSTRA BESAR RAMAH ANAK SD)
   ========================================================================== */
.formula-box-extra-large {
  background: linear-gradient(135deg, #e0f7fa 0%, #ffffff 100%) !important;
  border: 4px dashed #0288d1 !important;
  padding: 34px 16px !important;
  border-radius: 28px !important;
  box-shadow: 0 10px 24px rgba(2, 136, 209, 0.15);
}

.formula-text-extra-large {
  font-size: 68px !important;
  font-weight: 900 !important;
  color: #0d47a1 !important;
  letter-spacing: 3px !important;
  line-height: 1.15 !important;
  text-shadow: 2px 2px 0 #ffffff, 4px 4px 0 rgba(2, 136, 209, 0.2) !important;
}

.input-jawaban-extra-large {
  height: 86px !important;
  font-size: 52px !important;
  font-weight: 900 !important;
  border: 4px solid #0288d1 !important;
  border-radius: 24px !important;
  color: #0d47a1 !important;
  background-color: #f0f9ff !important;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.08) !important;
  letter-spacing: 2px;
}

.input-jawaban-extra-large:focus {
  border-color: #ff9800 !important;
  box-shadow: 0 0 0 8px rgba(255, 152, 0, 0.25), inset 0 2px 6px rgba(0, 0, 0, 0.05) !important;
  background-color: #ffffff !important;
  color: #e65100 !important;
}

@media (max-width: 420px) {
  .formula-text-extra-large {
    font-size: 52px !important;
  }
  .input-jawaban-extra-large {
    height: 76px !important;
    font-size: 40px !important;
  }
}

/* Modal Z-Index, Dialog Centering, and Backdrop Handling */
.modal-backdrop {
  z-index: 1040 !important;
}
.modal {
  z-index: 1050 !important;
}
#modalRangePeringkat, #modalLeaderboard, #modalExitConfirm {
  z-index: 1060 !important;
}
#modalRangePeringkat .modal-dialog, #modalLeaderboard .modal-dialog, #modalExitConfirm .modal-dialog {
  z-index: 1065 !important;
  position: relative;
  pointer-events: auto !important;
  max-width: 440px;
  margin: 1.75rem auto;
}
#modalRangePeringkat .modal-content, #modalLeaderboard .modal-content, #modalExitConfirm .modal-content {
  pointer-events: auto !important;
  border-radius: 26px !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25) !important;
}
#modalRangePeringkat .btn-close, #modalLeaderboard .btn-close, #modalExitConfirm .btn-close {
  cursor: pointer !important;
  pointer-events: auto !important;
  opacity: 0.8;
  transition: opacity 0.15s, transform 0.15s;
}
#modalRangePeringkat .btn-close:hover, #modalLeaderboard .btn-close:hover, #modalExitConfirm .btn-close:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   WELCOME SCREEN FULLSCREEN (LOADING AWAL LAYAR PENUH 100VW x 100VH)
   ========================================================================== */
.welcome-screen-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  background: var(--sky-gradient);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  overflow: hidden;
  box-sizing: border-box;
}

/* Background elements for fullscreen welcome screen */
.welcome-screen-fullscreen .sun-shape {
  position: absolute;
  top: 35px;
  right: 50px;
  width: 90px;
  height: 90px;
}

.welcome-screen-fullscreen .cloud-1 {
  top: 60px;
  left: 40px;
  transform: scale(1.2);
}

.welcome-screen-fullscreen .cloud-2 {
  top: 160px;
  right: 80px;
  transform: scale(1.15);
}

.welcome-screen-fullscreen .welcome-meadow {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(180deg, #66bb6a 0%, #43a047 100%);
  border-top: 4px solid #81c784;
  border-radius: 32px 32px 0 0;
  z-index: 1;
  pointer-events: none;
}

.welcome-screen-fullscreen .welcome-meadow::before {
  content: '🌸 🌼 🌺 🌿 🍀 🌸 🌼 🌺 🌿 🍀 🌸 🌼 🌺 🌿 🍀 🌸 🌼 🌺 🌿 🍀 🌸 🌼 🌺';
  display: block;
  font-size: 16px;
  letter-spacing: 12px;
  text-align: center;
  position: relative;
  top: -12px;
}

.welcome-screen-fullscreen .welcome-content {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 500px;
  width: 100%;
}

.welcome-screen-fullscreen .brand-header {
  transform: scale(1.15);
  margin-bottom: 20px;
}

.welcome-screen-fullscreen .illustration-kids-box {
  max-width: 380px !important;
  width: 90% !important;
  margin: 18px 0 !important;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.1));
}

@media (max-width: 480px) {
  .welcome-screen-fullscreen .brand-header {
    transform: scale(1);
    margin-bottom: 12px;
  }
  .welcome-screen-fullscreen .illustration-kids-box {
    max-width: 290px !important;
    margin: 10px 0 !important;
  }
  .welcome-screen-fullscreen .sun-shape {
    top: 20px;
    right: 20px;
    width: 65px;
    height: 65px;
  }
}

/* ==========================================================================
   PEMISAH MENU UTAMA (JARAK LEGA & JELAS ANTARA MENU 1,2,3,4 DAN 5,6,7)
   ========================================================================== */
.menu-group-box {
  width: 100%;
  position: relative;
}

.menu-section-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 10px;
  margin-bottom: 14px;
}

.menu-section-header .section-badge {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 6px 16px;
  border-radius: 50px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
}

.badge-games {
  background: linear-gradient(135deg, #0288d1 0%, #00b0ff 100%);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(2, 136, 209, 0.25);
  border: 1.5px solid #ffffff;
}

.badge-utilities {
  background: linear-gradient(135deg, #f57f17 0%, #ffb300 100%);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(245, 127, 23, 0.25);
  border: 1.5px solid #ffffff;
}

/* Nomor Urut Bulat di Tombol Menu (1, 2, 3, 4 & 5, 6, 7) */
.btn-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.16);
  color: #ffffff;
  font-family: var(--font-fun);
  font-size: 15px;
  font-weight: 900;
  border-radius: 50%;
  margin-right: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Pembatas & Jarak Antara Menu 1-4 dan Menu 5-7 */
.menu-group-spacer {
  margin-top: 34px;
  margin-bottom: 28px;
  position: relative;
  text-align: center;
  width: 100%;
}

.menu-divider-line {
  height: 3px;
  background: linear-gradient(90deg, transparent, #29b6f6 20%, #29b6f6 80%, transparent);
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  z-index: 1;
}

.menu-divider-pill {
  position: relative;
  z-index: 2;
  background: #ffffff;
  color: #0277bd;
  font-family: var(--font-fun);
  font-size: 13.5px;
  font-weight: 800;
  padding: 7px 20px;
  border-radius: 50px;
  border: 2px solid #81d4fa;
  box-shadow: 0 4px 14px rgba(2, 136, 209, 0.18);
  display: inline-block;
  letter-spacing: 0.5px;
}

