/* ============================================================
   MathRival AI - Gaya ceria ramah anak SD
   Palet: pink cerah (#FF6B9D), oranye (#FFA94D), kuning (#FFD43B),
   hijau (#51CF66), biru (#4DABF7), ungu lembut (#B197FC)
   ============================================================ */

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

:root {
  --pink: #FF6B9D;
  --pink-dark: #E64980;
  --orange: #FFA94D;
  --orange-dark: #F76707;
  --yellow: #FFD43B;
  --green: #51CF66;
  --green-dark: #2F9E44;
  --blue: #4DABF7;
  --blue-dark: #1C7ED6;
  --purple: #B197FC;
  --purple-dark: #7048E8;
  --red: #FF8787;
  --ink: #343A40;
  --ink-soft: #495057;
  --cream: #FFF9EC;
  --white: #FFFFFF;
  --radius: 22px;
  --shadow: 0 8px 0 rgba(0, 0, 0, 0.08);
  --font: "Comic Sans MS", "Comic Sans", "Baloo 2", "Fredoka", "Segoe UI", system-ui, sans-serif;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: linear-gradient(160deg, #FFF3E0 0%, #FFE0EC 45%, #E7F5FF 100%);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ====== LAYAR ====== */
.fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background: transparent;
}
.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: 40px;
  animation: fadeUp 0.35s ease;
}
.screen.active {
  display: block;
}

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

@keyframes bounceIn {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

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

/* ====== AWAN DEKORASI ====== */
.cloud {
  position: fixed;
  background: var(--white);
  border-radius: 60px;
  opacity: 0.75;
  z-index: 0;
  pointer-events: none;
}
.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: var(--white);
  border-radius: 50%;
}
.cloud::before {
  width: 55px; height: 55px; top: -22px; left: 18px;
}
.cloud::after {
  width: 38px; height: 38px; top: -12px; left: 62px;
}
.cloud-1 { width: 130px; height: 40px; top: 8%; left: -30px; animation: floaty 7s ease-in-out infinite; }
.cloud-2 { width: 100px; height: 32px; top: 18%; right: -20px; animation: floaty 9s ease-in-out infinite 1s; }
.cloud-3 { width: 80px; height: 26px; top: 40%; left: -15px; animation: floaty 8s ease-in-out infinite 2s; }

/* ====== HEADER BERANDA ====== */
.home-header {
  text-align: center;
  padding: 26px 16px 8px;
  position: relative;
  z-index: 1;
}
.logo-badge {
  font-size: 3.4rem;
  display: inline-block;
  animation: floaty 3s ease-in-out infinite;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,0.08));
}
.app-title {
  font-size: 2.7rem;
  font-weight: 900;
  color: var(--pink-dark);
  letter-spacing: 1px;
  text-shadow: 3px 3px 0 rgba(255, 255, 255, 0.9);
  margin-top: 4px;
}
.ai-chip {
  background: linear-gradient(135deg, var(--blue), var(--purple-dark));
  color: var(--white);
  font-size: 0.55em;
  padding: 4px 12px;
  border-radius: 40px;
  vertical-align: middle;
  box-shadow: 0 3px 0 rgba(0,0,0,0.15);
  letter-spacing: 1px;
}
.tagline {
  color: var(--ink-soft);
  font-size: 1.1rem;
  margin-top: 8px;
  font-weight: 700;
}

/* ====== KARTU ====== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin: 14px 14px;
  box-shadow: var(--shadow);
  border: 3px solid rgba(0,0,0,0.04);
  position: relative;
  z-index: 1;
}
.mini-card {
  padding: 14px 16px;
}
.section-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 12px;
}

/* ====== KARTU PROFIL ====== */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  border: none;
}
.avatar {
  font-size: 2.9rem;
  width: 64px;
  height: 64px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 rgba(0,0,0,0.12);
}
.player-name {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--ink);
}
.rank-badge {
  display: inline-block;
  background: var(--white);
  border-radius: 30px;
  padding: 3px 12px;
  font-weight: 900;
  font-size: 0.9rem;
  margin-top: 3px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.1);
}
.stats-line {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 5px;
  font-weight: 600;
}

/* ====== GRID KELAS ====== */
.class-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.class-btn {
  border: none;
  border-radius: 18px;
  padding: 14px 6px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--white);
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(0,0,0,0.15);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.class-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}
.class-btn .class-emoji { font-size: 1.5rem; }
.class-btn .class-xp { font-size: 0.68rem; opacity: 0.92; font-weight: 700; }
.class-1 { background: var(--green); }
.class-2 { background: var(--blue); }
.class-3 { background: var(--purple); }
.class-4 { background: var(--orange); }
.class-5 { background: var(--pink); }
.class-6 { background: var(--red); }

/* ====== BAR GELAR ====== */
.rank-current {
  font-weight: 900;
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.rank-next {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 700;
  margin-top: 6px;
}
.rank-bar {
  height: 16px;
  background: #F1F3F5;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(0,0,0,0.06);
}
.rank-bar-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--yellow), var(--orange), var(--pink));
  transition: width 0.6s ease;
  width: 0%;
}

/* ====== STATISTIK ====== */
.progress-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.stat {
  text-align: center;
  background: #FFF4E6;
  border-radius: 14px;
  padding: 10px 4px;
}
.stat-num {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--pink-dark);
}
.stat-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* ====== TOMBOL ====== */
.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 900;
  border: none;
  border-radius: 40px;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.2s;
  box-shadow: 0 5px 0 rgba(0,0,0,0.15);
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}
.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--orange));
  color: var(--white);
}
.btn-ghost {
  background: #FFF0F6;
  color: var(--pink-dark);
  box-shadow: 0 4px 0 rgba(233, 30, 99, 0.18);
}
.btn-danger {
  background: var(--red);
  color: var(--white);
}
.btn-big {
  display: block;
  width: calc(100% - 28px);
  margin: 16px 14px;
  font-size: 1.15rem;
  padding: 16px;
}
.btn-download[hidden] {
  display: none;
}
.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: calc(100% - 28px);
  margin: 8px 14px 26px;
  background: linear-gradient(135deg, var(--blue), var(--purple-dark));
  color: var(--white);
  font-size: 1.05rem;
  padding: 15px;
  animation: pop 0.8s ease infinite alternate;
}
.btn-full {
  display: block;
  width: calc(100% - 28px);
  margin: 14px auto;
}
.settings-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.settings-row .btn { font-size: 0.85rem; padding: 10px 6px; }

/* ====== TOPBAR ====== */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 14px 6px;
  position: sticky;
  top: 0;
  background: linear-gradient(160deg, rgba(255,243,224,0.95), rgba(231,245,255,0.95));
  backdrop-filter: blur(6px);
  z-index: 20;
}
.topbar-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--pink-dark);
  flex: 1;
}
.btn-icon {
  border: none;
  background: var(--white);
  font-size: 1.4rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,0.12);
  flex-shrink: 0;
}
.btn-icon:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,0.12); }
.screen-main { position: relative; z-index: 1; }

/* ====== PILIH MODE ====== */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 14px;
}
.mode-card {
  border: none;
  border-radius: var(--radius);
  padding: 20px 14px;
  font-family: inherit;
  color: var(--white);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease;
}
.mode-card:active { transform: translateY(4px); }
.mode-emoji { font-size: 2.2rem; display: block; margin-bottom: 6px; }
.mode-name { font-size: 1.05rem; font-weight: 900; display: block; }
.mode-desc { font-size: 0.78rem; opacity: 0.95; display: block; margin-top: 3px; font-weight: 600; }
.mode-latihan { background: linear-gradient(135deg, var(--green), var(--blue)); }
.mode-cepat { background: linear-gradient(135deg, var(--yellow), var(--orange)); color: var(--ink); }
.mode-tantangan { background: linear-gradient(135deg, var(--pink), var(--purple-dark)); }
.mode-pecahan { background: linear-gradient(135deg, var(--orange), var(--red)); }
.mode-bangun { background: linear-gradient(135deg, var(--blue), var(--purple)); }
.mode-jam { background: linear-gradient(135deg, var(--green), var(--teal, #009688)); }
.mode-uang { background: linear-gradient(135deg, var(--gold, #f59e0b), var(--brown, #b45309)); color: var(--ink); }
.mode-kpkfpb { background: linear-gradient(135deg, var(--purple), var(--pink)); }
.mode-ukur { background: linear-gradient(135deg, var(--teal, #009688), var(--green)); }
.mode-luas { background: linear-gradient(135deg, var(--indigo, #4f46e5), var(--blue)); }
.mode-volume { background: linear-gradient(135deg, var(--purple-dark, #7c3aed), var(--teal, #0d9488)); }
.mode-ukur2 { background: linear-gradient(135deg, var(--blue), var(--cyan, #06b6d4)); color: var(--ink); }
.mode-harian { background: linear-gradient(135deg, var(--red), var(--orange)); }
.daily-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--purple-dark, #6d28d9);
  font-size: 0.72rem;
  font-weight: 900;
}
.mode-cepat .mode-desc { color: var(--ink); }

/* ====== LAYAR PERMAINAN ====== */
.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 4px;
  gap: 8px;
}
.game-info { display: flex; gap: 6px; flex: 1; justify-content: center; flex-wrap: wrap; }
.chip {
  background: var(--white);
  border-radius: 30px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 900;
  box-shadow: 0 3px 0 rgba(0,0,0,0.1);
}
.game-score {
  background: var(--white);
  border-radius: 30px;
  padding: 5px 12px;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 3px 0 rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 4px;
}
.game-body {
  padding: 8px 14px;
  position: relative;
  z-index: 1;
}

.game-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.hud-item {
  background: var(--white);
  border-radius: 14px;
  text-align: center;
  padding: 8px 2px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
.hud-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--ink-soft);
}
.hud-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--pink-dark);
  margin-top: 2px;
}

/* ====== TIMER ====== */
.timer-wrap {
  position: relative;
  height: 26px;
  background: rgba(255,255,255,0.7);
  border-radius: 30px;
  overflow: hidden;
  border: 2px solid var(--white);
  margin-bottom: 14px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
.timer-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
  border-radius: 30px;
  width: 100%;
  transition: width 0.2s linear;
}
.timer-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--ink);
  text-shadow: 0 1px 0 var(--white);
}

/* ====== KARTU SOAL ====== */
.question-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 26px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border: 4px solid var(--yellow);
}
.question-card.pop { animation: pop 0.3s ease; }
.question-category {
  display: inline-block;
  background: #E7F5FF;
  color: var(--blue-dark);
  border-radius: 30px;
  padding: 4px 14px;
  font-size: 0.82rem;
  font-weight: 900;
  margin-bottom: 10px;
}
.question-text {
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.25;
  word-break: break-word;
}
.question-visual {
  margin-top: 10px;
  font-size: 1.6rem;
  letter-spacing: 4px;
  line-height: 1.4;
  user-select: none;
}

/* ====== AREA JAWABAN ====== */
.answer-area {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
.answer-area.mc-2 { grid-template-columns: 1fr 1fr; }
.answer-area.mc-4 { grid-template-columns: 1fr 1fr; }
.answer-area.number-input { grid-template-columns: 1fr auto; align-items: center; }
.answer-btn {
  border: none;
  border-radius: 20px;
  font-family: inherit;
  font-size: 1.8rem;
  font-weight: 900;
  padding: 18px 8px;
  cursor: pointer;
  background: #FFF0F6;
  color: var(--ink);
  box-shadow: 0 5px 0 rgba(0,0,0,0.12);
  transition: transform 0.1s ease;
}
.answer-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,0.12); }
.answer-btn.correct {
  background: var(--green);
  color: var(--white);
  animation: pop 0.4s ease;
}
.answer-btn.wrong {
  background: var(--red);
  color: var(--white);
  animation: wiggle 0.4s ease;
}
.answer-btn:disabled { opacity: 0.75; }
.answer-input {
  border: 4px solid var(--pink);
  border-radius: 20px;
  font-family: inherit;
  font-size: 2.2rem;
  font-weight: 900;
  text-align: center;
  padding: 14px;
  width: 100%;
  color: var(--ink);
  outline: none;
  background: var(--white);
}
.answer-input:focus { border-color: var(--purple-dark); }
.answer-submit {
  border: none;
  border-radius: 20px;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 900;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  color: var(--white);
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(0,0,0,0.15);
  white-space: nowrap;
}
.answer-submit:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,0.15); }

/* ====== FEEDBACK ====== */
.feedback-area {
  min-height: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 900;
  border-radius: 18px;
  padding: 12px;
}
.feedback-area.good {
  background: #EBFBEE;
  color: var(--green-dark);
  animation: bounceIn 0.4s ease;
}
.feedback-area.encourage {
  background: #FFF4E6;
  color: var(--orange-dark);
  animation: bounceIn 0.4s ease;
}
.feedback-area.idle { background: transparent; }
.feedback-emoji { font-size: 2rem; display: block; margin-bottom: 2px; }

/* ====== LAYAR HASIL ====== */
.result-main { text-align: center; padding-top: 30px; }
.result-emojis { font-size: 4rem; animation: bounceIn 0.6s ease; }
.result-title { font-size: 2rem; font-weight: 900; color: var(--pink-dark); margin-top: 8px; }
.result-sub { font-size: 1.05rem; color: var(--ink-soft); margin-top: 6px; font-weight: 700; }
.result-stars { font-size: 2rem; margin: 12px 0; letter-spacing: 6px; }
.result-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 14px;
  box-shadow: var(--shadow);
  text-align: left;
}
.result-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 2px dashed #F1F3F5;
  font-weight: 800;
  font-size: 1rem;
}
.result-row:last-child { border-bottom: none; }
.result-row span:last-child { color: var(--pink-dark); font-weight: 900; }
.result-rankup {
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  border-radius: 18px;
  padding: 14px;
  margin: 0 14px;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--ink);
  box-shadow: var(--shadow);
  animation: bounceIn 0.5s ease;
}
.result-buttons { margin-top: 18px; display: grid; gap: 10px; padding: 0 14px; }

/* ====== TAB & PAPAN JUARA ====== */
.tabs {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
}
.tab {
  border: none;
  border-radius: 30px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 900;
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
.tab.active {
  background: linear-gradient(135deg, var(--pink), var(--orange));
  color: var(--white);
}
.rank-tiers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px 14px 4px;
}
.tier {
  background: var(--white);
  border-radius: 14px;
  padding: 8px 2px;
  text-align: center;
  box-shadow: 0 3px 0 rgba(0,0,0,0.07);
  opacity: 0.45;
  transition: opacity 0.3s;
}
.tier.achieved { opacity: 1; box-shadow: 0 4px 0 rgba(0,0,0,0.12); }
.tier-emoji { font-size: 1.4rem; display: block; }
.tier-name { font-size: 0.62rem; font-weight: 900; color: var(--ink-soft); display: block; margin-top: 2px; }
.tier.achieved .tier-name { color: var(--pink-dark); }

.leaderboard {
  background: var(--white);
  border-radius: var(--radius);
  margin: 10px 14px;
  padding: 8px 14px;
  box-shadow: var(--shadow);
  max-height: 52vh;
  overflow-y: auto;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 4px;
  border-bottom: 2px dashed #F1F3F5;
}
.lb-row:last-child { border-bottom: none; }
.lb-rank {
  font-size: 1.3rem;
  font-weight: 900;
  width: 38px;
  text-align: center;
  flex-shrink: 0;
}
.lb-avatar { font-size: 1.5rem; flex-shrink: 0; }
.lb-name {
  flex: 1;
  font-weight: 900;
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-score {
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--pink-dark);
  flex-shrink: 0;
}
.lb-row.me {
  background: #FFF4E6;
  border-radius: 12px;
  padding-left: 8px;
  padding-right: 8px;
}
.lb-empty { text-align: center; padding: 24px 10px; color: var(--ink-soft); font-weight: 700; }
.lb-medal { font-size: 1.3rem; }

/* ====== PROGRES ====== */
.class-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 2px dashed #F1F3F5;
}
.class-summary-item:last-child { border-bottom: none; }
.cs-emoji { font-size: 1.5rem; flex-shrink: 0; }
.cs-info { flex: 1; }
.cs-name { font-weight: 900; font-size: 0.95rem; }
.cs-bar { height: 10px; background: #F1F3F5; border-radius: 10px; overflow: hidden; margin-top: 5px; }
.cs-bar-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--blue)); border-radius: 10px; }
.cs-stats { font-size: 0.75rem; color: var(--ink-soft); font-weight: 700; margin-top: 3px; }

.history-item {
  padding: 10px 0;
  border-bottom: 2px dashed #F1F3F5;
}
.history-item:last-child { border-bottom: none; }
.history-top { display: flex; justify-content: space-between; font-weight: 900; font-size: 0.95rem; }
.history-sub { font-size: 0.78rem; color: var(--ink-soft); font-weight: 700; margin-top: 3px; }
.history-empty { text-align: center; padding: 20px; color: var(--ink-soft); font-weight: 700; }

.mastered-chip {
  display: inline-block;
  background: #EBFBEE;
  color: var(--green-dark);
  border-radius: 30px;
  padding: 6px 14px;
  margin: 4px;
  font-weight: 900;
  font-size: 0.85rem;
  box-shadow: 0 3px 0 rgba(0,0,0,0.07);
}
.mastered-empty { color: var(--ink-soft); font-weight: 700; text-align: center; padding: 14px; }

/* ====== PENGATURAN ====== */
.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.input-row input[type="text"],
.input-row select {
  flex: 1;
  border: 3px solid #F1F3F5;
  border-radius: 14px;
  padding: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  color: var(--ink);
}
.input-row input[type="text"]:focus { border-color: var(--pink); }
.input-row select { background: var(--white); }
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.avatar-opt {
  border: 4px solid transparent;
  background: #FFF4E6;
  border-radius: 16px;
  font-size: 2rem;
  padding: 8px 0;
  cursor: pointer;
  transition: transform 0.12s;
}
.avatar-opt.selected {
  border-color: var(--pink);
  background: #FFF0F6;
  transform: scale(1.06);
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
  padding: 8px 0;
}
.switch-row input { display: none; }
.switch {
  width: 52px;
  height: 30px;
  background: #CED4DA;
  border-radius: 30px;
  position: relative;
  cursor: pointer;
  transition: background 0.25s;
  flex-shrink: 0;
}
.switch::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  background: var(--white);
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: left 0.25s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.switch-row input:checked + .switch {
  background: var(--green);
}
.switch-row input:checked + .switch::after { left: 25px; }
.hint-text { font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; margin-bottom: 10px; }

/* ====== BANTUAN ====== */
.help-list {
  padding-left: 20px;
  display: grid;
  gap: 8px;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.5;
}
.help-text { font-size: 0.95rem; font-weight: 600; line-height: 1.55; color: var(--ink-soft); }

/* ====== TENTANG ====== */
.about-card { text-align: center; padding: 28px 18px; }
.about-logo { font-size: 3.6rem; animation: floaty 3s ease-in-out infinite; }
.about-name { font-size: 2rem; font-weight: 900; color: var(--pink-dark); margin-top: 8px; }
.about-desc { margin-top: 12px; font-size: 0.98rem; font-weight: 600; line-height: 1.6; color: var(--ink-soft); }
.about-features { margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.about-features span {
  background: #E7F5FF;
  color: var(--blue-dark);
  border-radius: 30px;
  padding: 6px 14px;
  font-weight: 900;
  font-size: 0.85rem;
}
.about-footer { margin-top: 18px; font-size: 0.85rem; color: var(--ink-soft); font-weight: 700; line-height: 1.6; }

/* ====== MODAL ====== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay[hidden] {
  display: none;
}
.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 20px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 14px 40px rgba(0,0,0,0.2);
  animation: bounceIn 0.3s ease;
}
.modal-title { font-size: 1.3rem; font-weight: 900; color: var(--pink-dark); }
.modal-text { margin-top: 8px; font-size: 0.95rem; font-weight: 600; color: var(--ink-soft); }
.modal-buttons { margin-top: 18px; display: flex; gap: 10px; justify-content: center; }
.modal-buttons .btn { flex: 1; }

/* ====== TOAST ====== */
.toast[hidden] {
  display: none;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--white);
  border-radius: 30px;
  padding: 12px 22px;
  font-weight: 800;
  font-size: 0.95rem;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  animation: bounceIn 0.3s ease;
  max-width: 90vw;
  text-align: center;
}

/* ====== MUSIK LATAR ====== */
.music-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.music-btn {
  background: var(--card, #fff);
  border: 2px solid var(--pink, #FF6B9D);
  color: var(--text, #5B4B8A);
  border-radius: 24px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
.music-btn:hover { transform: scale(1.06); }
.music-btn.music-on {
  background: var(--pink, #FF6B9D);
  color: #fff;
}
.music-bar input[type="range"] {
  width: 110px;
  accent-color: var(--pink, #FF6B9D);
  cursor: pointer;
}
.music-row { display: flex; gap: 10px; align-items: center; }
.music-mood-label {
  font-weight: 700;
  margin: 8px 0 6px;
  font-size: 0.9rem;
  color: var(--text, #5B4B8A);
}
.music-mood-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.music-mood-chip {
  border: 2px solid #E5D9F2;
  background: #fff;
  border-radius: 14px;
  padding: 8px 4px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}
.music-mood-chip.active {
  border-color: var(--pink, #FF6B9D);
  background: #FFE3EE;
}
.music-mood-chip:hover { transform: scale(1.05); }
.music-vol-label { font-size: 0.85rem; font-weight: 700; color: var(--text, #5B4B8A); }
.music-volume {
  width: 100%;
  accent-color: var(--pink, #FF6B9D);
  cursor: pointer;
}

/* ====== RESPONSIF ====== */
@media (min-width: 768px) {
  html { font-size: 18px; }
  .home-main,
  .screen-main {
    max-width: 640px;
    margin: 0 auto;
  }
  .class-grid { grid-template-columns: repeat(3, 1fr); }
  .answer-area.mc-4 { grid-template-columns: repeat(4, 1fr); }
  .mode-grid { grid-template-columns: repeat(3, 1fr); }
  .btn-big, .btn-download, .btn-full {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }
  .question-text { font-size: 3rem; }
}

@media (min-width: 1024px) {
  .home-main, .screen-main { max-width: 720px; }
  .btn-big, .btn-download, .btn-full { max-width: 720px; }
}

/* Aksesibilitas: kurangi gerakan bila diminta */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}