/* Eazy Math — sticker-book style: flat bright, thick white outlines, rounded. */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Baloo 2", "Comic Sans MS", system-ui, sans-serif;
  background: linear-gradient(180deg, #aee3ff 0%, #d8f3ff 40%, #fff6d9 100%);
  background-attachment: fixed;
  color: #2b3a55;
  min-height: 100vh;
}

body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: radial-gradient(#ffffff 2.2px, transparent 2.6px);
  background-size: 34px 34px;
}

#app { max-width: 520px; margin: 0 auto; padding: 10px 14px 40px; position: relative; }

.hidden { display: none !important; }

/* ---------- Top bar ---------- */
#topbar { display: flex; align-items: center; gap: 10px; padding: 4px 0 10px; }
#btn-home { margin-left: auto; }
.round-btn {
  width: 52px; height: 52px; border-radius: 50%; border: 4px solid #fff;
  background: #ffb020; box-shadow: 0 4px 0 rgba(0,0,0,0.12);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none; flex: 0 0 auto;
}
.round-btn svg { width: 30px; height: 30px; }
.round-btn:active { transform: scale(0.94); }
#btn-sound { background: #4f9dff; }
#btn-sound.off { background: #b9c6d8; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 3px solid #ffd93b; border-radius: 999px;
  padding: 4px 14px 4px 6px; font-weight: 800; font-size: 18px; color: #8a6d00;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
.chip svg { width: 30px; height: 30px; }

/* ---------- Cards ---------- */
.card {
  background: #fff; border: 4px solid #fff; border-radius: 26px;
  box-shadow: 0 6px 0 rgba(43,58,85,0.10), 0 12px 24px rgba(43,58,85,0.08);
  padding: 18px; margin-bottom: 16px;
}
.card-title { margin: 0 0 10px; font-size: 22px; font-weight: 800; }

/* ---------- Hero ---------- */
.hero { display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, #fff 60%, #fff3c9); }
.mascot { width: 108px; flex: 0 0 auto; animation: bob 2.6s ease-in-out infinite; }
.mascot.small { width: 84px; margin: 0 auto; }
.mascot svg { width: 100%; height: auto; display: block; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-7px) rotate(1.5deg); } }
.brand { margin: 0; letter-spacing: 3px; font-weight: 800; font-size: 13px; color: #ff8a3c; }
.hero h1 { margin: 0; font-size: 42px; line-height: 1; font-weight: 800; }
.hero h1 .accent { color: #ff5a8a; }
.tagline { margin: 4px 0 8px; font-size: 18px; font-weight: 700; color: #4f9dff; }
.sticker-line { margin: 0; font-weight: 800; font-size: 17px; color: #8a6d00; display: flex; align-items: center; gap: 6px; }
.sticker-ico { display: inline-block; width: 24px; height: 24px; }
.sticker-ico svg { width: 100%; height: 100%; }

/* ---------- Daily missions ---------- */
.daily-badge { font-size: 14px; background: #e8f7e4; color: #2e7d32; border-radius: 999px; padding: 2px 10px; vertical-align: middle; }
#daily-list { list-style: none; margin: 0; padding: 0; }
#daily-list li {
  display: flex; align-items: center; gap: 10px;
  background: #f6faff; border: 3px dashed #cfe6ff; border-radius: 16px;
  padding: 10px 12px; margin-bottom: 8px; font-weight: 700; font-size: 17px;
}
#daily-list li.done { background: #e8f7e4; border-color: #a5d6a7; color: #2e7d32; }
#daily-list .tick {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  border: 3px solid #cfe6ff; background: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-size: 16px; color: #2e7d32;
}
#daily-list li.done .tick { background: #7ac74f; border-color: #7ac74f; color: #fff; }
#daily-list .prog { margin-left: auto; font-size: 14px; color: #7a8aa0; font-weight: 800; }
.daily-note { margin: 6px 0 0; font-size: 14.5px; color: #7a8aa0; font-weight: 600; }

/* ---------- Path map: stepping stones ---------- */
.path-title { padding: 0 4px; }
#stones { display: flex; flex-direction: column; gap: 14px; }
.stone {
  display: flex; align-items: center; gap: 14px; text-align: left;
  border: 4px solid #fff; border-radius: 24px; padding: 14px 16px;
  box-shadow: 0 6px 0 rgba(43,58,85,0.12); cursor: pointer;
  font-family: inherit; width: 100%; background: #fff; color: #2b3a55;
}
.stone:nth-child(odd) { margin-right: 26px; }
.stone:nth-child(even) { margin-left: 26px; }
.stone .num {
  width: 56px; height: 56px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 27px; font-weight: 800; color: #fff; border: 4px solid #fff;
  box-shadow: 0 3px 0 rgba(0,0,0,0.12);
}
.stone.lvl1 { background: #e8f9ee; } .stone.lvl1 .num { background: #7ac74f; }
.stone.lvl2 { background: #e9f4ff; } .stone.lvl2 .num { background: #4f9dff; }
.stone.lvl3 { background: #fff6da; } .stone.lvl3 .num { background: #ffb020; }
.stone.lvl4 { background: #ffeef5; } .stone.lvl4 .num { background: #ff5a8a; }
.stone.lvl5 { background: #f1eaff; } .stone.lvl5 .num { background: #9b6bff; }
.stone .stone-text { flex: 1 1 auto; min-width: 0; }
.stone .stone-name { font-size: 21px; font-weight: 800; line-height: 1.1; }
.stone .stone-sub { font-size: 14px; font-weight: 600; color: #7a8aa0; }
.stone .stars { margin-left: auto; font-size: 20px; letter-spacing: 2px; flex: 0 0 auto; }
.stone .stars .on { color: #ffb020; } .stone .stars .off { color: #dfe7f0; }
.stone.locked { filter: grayscale(0.55); opacity: 0.75; }
.stone .lock-badge { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; background: #8fa3bd; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.stone .lock-badge svg { width: 24px; height: 24px; }
.stone:active { transform: scale(0.98); }
.free-tag { font-size: 12px; background: #7ac74f; color: #fff; border-radius: 999px; padding: 1px 9px; font-weight: 800; vertical-align: middle; }

/* ---------- Game screen ---------- */
.q-progress { display: flex; gap: 6px; justify-content: center; margin: 4px 0 12px; flex-wrap: wrap; }
.q-progress .dot { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid #cfe6ff; }
.q-progress .dot.done { background: #7ac74f; border-color: #7ac74f; }
.q-progress .dot.now { background: #ffb020; border-color: #ffb020; transform: scale(1.2); }
.q-card { padding: 20px 16px 22px; }
.q-head { display: flex; align-items: flex-start; gap: 10px; }
.q-text { flex: 1; margin: 0; font-size: 24px; font-weight: 800; line-height: 1.25; }
.speak-btn {
  width: 56px; height: 56px; border-radius: 50%; border: 4px solid #fff; flex: 0 0 auto;
  background: #ff8a3c; box-shadow: 0 4px 0 rgba(0,0,0,0.12); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.speak-btn svg { width: 32px; height: 32px; }
.speak-btn:active { transform: scale(0.92); }

.q-visual { min-height: 128px; display: flex; align-items: center; justify-content: center; padding: 14px 4px 6px; }
.obj { display: inline-block; position: relative; width: 52px; height: 52px; margin: 3px; transition: transform 0.25s, opacity 0.4s, filter 0.25s; }
.obj.gone::after { content: "✕"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #ff4040; font-size: 36px; font-weight: 800; text-shadow: 0 2px 0 #fff; }
.obj svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 0 rgba(43,58,85,0.15)); }
.obj.hl { transform: scale(1.3) rotate(-4deg); }
.obj.hl svg { filter: drop-shadow(0 0 10px #ffd93b); }
.obj.gone { opacity: 0.22; transform: scale(0.8) rotate(14deg); filter: grayscale(1); }
.obj.fly { transform: translateY(-46px) scale(0.6) rotate(30deg); opacity: 0; }
.objects-wrap { display: flex; flex-wrap: wrap; justify-content: center; max-width: 340px; }
.groups-wrap { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.group-box { background: #f6faff; border: 3px dashed #cfe6ff; border-radius: 18px; padding: 8px; display: flex; flex-wrap: wrap; justify-content: center; max-width: 168px; }
.group-box.b { background: #fff6da; border-color: #ffe1a1; }
.op-sign { font-size: 40px; font-weight: 800; color: #ff5a8a; padding: 0 2px; }
.hear-big { font-size: 76px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* Stepping stones for sequences */
.stones-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.step-stone {
  width: 58px; height: 58px; border-radius: 50% 46% 52% 48%;
  background: #bfe3ff; border: 4px solid #fff; box-shadow: 0 4px 0 rgba(43,58,85,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: #2b3a55;
}
.step-stone.missing { background: #ffd93b; color: #8a6d00; animation: pulse 1.2s ease-in-out infinite; }
.step-stone.hl { transform: scale(1.22); background: #7ac74f; color: #fff; }

/* Ten frame (kotak 10) */
.tenframe { display: grid; grid-template-columns: repeat(5, 52px); gap: 5px; background: #fff; border: 4px solid #4f9dff; border-radius: 16px; padding: 8px; }
.tenframe .cell { width: 52px; height: 52px; border-radius: 12px; background: #eef5ff; display: flex; align-items: center; justify-content: center; }
.tenframe .cell .obj { width: 44px; height: 44px; margin: 0; }
.tenframe .cell.b .obj svg { filter: drop-shadow(0 2px 0 rgba(43,58,85,0.15)) hue-rotate(140deg); }

/* Compare */
.compare-wrap { display: flex; gap: 12px; justify-content: center; width: 100%; }
.compare-side { flex: 1; max-width: 168px; }
.compare-side .group-box { max-width: none; }

/* Options */
.q-options { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.opt-btn {
  min-width: 76px; min-height: 76px; padding: 8px 14px;
  font-family: inherit; font-size: 34px; font-weight: 800; color: #2b3a55;
  background: #fff; border: 4px solid #4f9dff; border-radius: 22px;
  box-shadow: 0 5px 0 #4f9dff; cursor: pointer;
}
.opt-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #4f9dff; }
.opt-btn.picked-good { background: #7ac74f; border-color: #7ac74f; box-shadow: 0 5px 0 #5da33c; color: #fff; }
.opt-btn.shake { animation: shake 0.45s; border-color: #ff8a8a; }
.opt-btn:disabled { opacity: 0.9; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }

.hint-btn {
  display: block; margin: 18px auto 0; font-family: inherit;
  font-size: 19px; font-weight: 800; color: #fff;
  background: #9b6bff; border: 4px solid #fff; border-radius: 999px;
  padding: 12px 26px; box-shadow: 0 5px 0 rgba(43,58,85,0.15); cursor: pointer;
  min-height: 56px;
}
.hint-btn:active { transform: scale(0.96); }
.hint-btn:disabled { opacity: 0.55; }
.q-feedback { text-align: center; font-size: 21px; font-weight: 800; min-height: 28px; margin: 12px 0 0; color: #2e7d32; }

/* ---------- Done / locked ---------- */
.done-card { text-align: center; padding-top: 26px; }
.done-card h2 { font-size: 32px; margin: 8px 0 2px; }
.done-stars { font-size: 52px; letter-spacing: 6px; margin: 6px 0; }
.done-stars .on { color: #ffb020; display: inline-block; animation: starpop 0.5s backwards; }
.done-stars .on:nth-child(2) { animation-delay: 0.18s; }
.done-stars .on:nth-child(3) { animation-delay: 0.36s; }
.done-stars .off { color: #dfe7f0; }
@keyframes starpop { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }
.done-sticker { font-weight: 800; color: #8a6d00; font-size: 18px; }
.big-btn {
  display: block; width: 100%; margin-top: 12px; font-family: inherit;
  font-size: 21px; font-weight: 800; color: #fff; background: #ff5a8a;
  border: 4px solid #fff; border-radius: 999px; padding: 14px;
  box-shadow: 0 5px 0 rgba(43,58,85,0.15); cursor: pointer; min-height: 60px;
}
.big-btn.secondary { background: #4f9dff; }
.big-btn:active { transform: scale(0.98); }
.lock-ico { width: 84px; height: 84px; margin: 0 auto; background: #8fa3bd; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.lock-ico svg { width: 52px; height: 52px; }

/* ---------- Confetti & toast ---------- */
#confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.confetti-bit { position: absolute; top: -16px; width: 12px; height: 16px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #2b3a55; color: #fff; font-weight: 800; font-size: 17px;
  border: 3px solid #fff; border-radius: 999px; padding: 12px 22px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25); z-index: 70; text-align: center;
  max-width: 88vw; animation: toastin 0.3s ease-out;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 380px) {
  .hero h1 { font-size: 36px; }
  .obj { width: 44px; height: 44px; }
  .tenframe { grid-template-columns: repeat(5, 44px); }
  .tenframe .cell { width: 44px; height: 44px; }
  .opt-btn { min-width: 66px; min-height: 66px; font-size: 30px; }
}
