/* Baloo 2 (SIL OFL 1.1, lihat assets/fonts/OFL.txt), disimpan sendiri supaya tidak menunggu Google Fonts.
   Satu file variable font subset latin untuk semua ketebalan. */
@font-face{
  font-family:"Baloo 2"; font-style:normal; font-weight:400 800; font-display:swap;
  src:url("../fonts/baloo2-latin-v23.woff2") format("woff2");
  unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
[hidden]{ display:none !important; }
#play:focus{ outline:none; }   /* fokus dipindah ke sini saat main, tanpa garis fokus */
:root{
  --bg:#BFEFFA; --card:#FFFDF7; --text:#1B2A6B; --muted:#3F5A92;
  --accent:#47C9E5; --sun:#FFD23F; --water:#47C9E5; --btn-ink:#1B2A6B;
}
@media (prefers-color-scheme: dark){
  :root{ --bg:#103A62; --card:#1B4D7E; --text:#FFFDF7; --muted:#BFE3F5; }
}
*,*::before,*::after{ box-sizing:border-box; }
html{ height:100%; }
body{
  margin:0; height:100%; background:var(--bg); color:var(--text);
  font-family:"Baloo 2","Trebuchet MS","Segoe UI Rounded",system-ui,sans-serif;
  -webkit-tap-highlight-color:transparent; overflow:hidden;
}
button{ font:inherit; cursor:pointer; }
button:focus-visible, a:focus-visible{ outline:4px solid var(--sun); outline-offset:3px; }

/* ---------- Home ---------- */
#home{
  height:100%; overflow-y:auto; display:flex; flex-direction:column; align-items:center; text-align:center;
  padding:calc(env(safe-area-inset-top,0px) + 24px) 20px calc(env(safe-area-inset-bottom,0px) + 24px);
}
.mascot{ width:clamp(220px, 70vw, 300px); aspect-ratio:3/2; margin-top:8px; flex:none; }
.win-car{ display:block; width:200px; height:140px; margin:-8px auto 0; }
h1{
  font-size:clamp(2.6rem, 11vw, 4rem); line-height:.95; margin:8px 0 8px; font-weight:800;
  text-shadow:0 4px 0 rgba(255,255,255,.65);
}
@media (prefers-color-scheme: dark){ :root h1{ text-shadow:0 4px 0 rgba(0,0,0,.25); } }
.lead{ font-size:1.25rem; line-height:1.35; color:var(--muted); max-width:22em; margin:0 0 22px; font-weight:500; }
.stars{
  margin-top:22px; background:var(--card); border-radius:999px; padding:8px 20px;
  font-size:1.2rem; font-weight:700; box-shadow:0 4px 0 rgba(27,42,107,.15);
}
.back{ margin:auto 0 0; padding-top:24px; font-size:1.05rem; }
.back a, .credit a{ color:var(--text); font-weight:700; }
.credit{ margin:6px 0 0; font-size:.9rem; color:var(--muted); }

/* ---------- Play ---------- */
#play{ position:fixed; inset:0; background:var(--bg); display:none; touch-action:none; }
#play.on{ display:block; }
#stage{ position:absolute; inset:0; width:100%; height:100%; display:block; }
.hud{
  position:absolute; left:0; right:0; top:0; display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:calc(env(safe-area-inset-top,0px) + 12px) calc(env(safe-area-inset-right,0px) + 14px) 0 calc(env(safe-area-inset-left,0px) + 14px); pointer-events:none;
}
.hud > *{ pointer-events:auto; }
.round{
  width:56px; height:56px; border-radius:50%; border:0; background:var(--card); color:var(--text);
  font-size:1.7rem; box-shadow:0 4px 0 rgba(0,0,0,.2); display:grid; place-items:center;
}
.round.spacer{ visibility:hidden; }   /* penyeimbang HUD supaya penghitung tetap di tengah */
.counter{
  background:var(--card); color:var(--text); border-radius:999px; padding:6px 18px;
  font-size:1.35rem; font-weight:800; box-shadow:0 4px 0 rgba(0,0,0,.2); white-space:nowrap;
}
.tip{
  position:absolute; left:50%; transform:translateX(-50%);
  bottom:calc(env(safe-area-inset-bottom,0px) + 22px);
  width:min(92vw, 520px); background:var(--card); color:var(--text);
  border-radius:24px; padding:12px 18px; text-align:center; font-size:1.3rem; font-weight:700; line-height:1.25;
  box-shadow:0 5px 0 rgba(0,0,0,.2); pointer-events:none;
}
.tip:empty{ display:none; }

.sheet{
  position:absolute; inset:0; display:none; align-items:center; justify-content:center; padding:24px;
  background:rgba(14,45,77,.55);
}
.sheet.on{ display:flex; }
.panel{
  background:var(--card); color:var(--text); border-radius:32px; padding:26px 22px 22px; text-align:center;
  width:min(100%, 400px); box-shadow:0 10px 0 rgba(0,0,0,.2);
}
.panel .big{ font-size:4rem; line-height:1; }
.panel h2{ font-size:2.2rem; line-height:1.05; margin:8px 0 6px; font-weight:800; }
.panel p{ font-size:1.15rem; margin:0 0 18px; color:var(--muted); line-height:1.35; }
.btn{
  display:block; width:100%; border:0; border-radius:20px; padding:12px; margin-top:10px;
  font-size:1.35rem; font-weight:800; color:var(--btn-ink); background:var(--accent);
  box-shadow:0 5px 0 rgba(27,42,107,.25);
}
.btn.big{ width:auto; min-width:220px; padding:14px 40px; font-size:1.8rem; border-radius:999px; }
.btn.alt{ background:var(--sun); }
.btn:active{ transform:translateY(4px); box-shadow:0 1px 0 rgba(27,42,107,.25); }

/* ---------- Pertanyaan & pilihan jawaban ---------- */
.ask{
  position:absolute; left:50%; transform:translateX(-50%);
  top:calc(env(safe-area-inset-top,0px) + 80px); width:min(92vw, 460px);
  background:var(--card); color:var(--text); border-radius:24px; padding:10px 16px; text-align:center;
  font-size:clamp(1.3rem, 6vw, 1.7rem); font-weight:700; line-height:1.2; box-shadow:0 5px 0 rgba(0,0,0,.2);
  pointer-events:none; transition:opacity .25s, transform .25s;
}
.ask:empty{ opacity:0; transform:translate(-50%, -10px); }
.ask b{ font-weight:800; }
.ask .ok{ color:#2E8A3E; }
@media (prefers-color-scheme: dark){ .ask .ok{ color:#8EF0A0; } }
.choices{
  position:absolute; left:0; right:0; bottom:0; display:flex; justify-content:center; gap:clamp(10px, 4vw, 22px);
  padding:14px calc(env(safe-area-inset-right,0px) + 14px) calc(env(safe-area-inset-bottom,0px) + 18px) calc(env(safe-area-inset-left,0px) + 14px);
  transition:opacity .25s, transform .25s;
}
.choices.off{ opacity:0; transform:translateY(30px); pointer-events:none; }
.choice{
  width:clamp(88px, 27vw, 128px); aspect-ratio:1; border:0; border-radius:28px; padding:12px;
  background:var(--card); box-shadow:0 6px 0 rgba(27,42,107,.25); display:grid; place-items:center;
  transition:transform .15s, opacity .2s;
}
.choice svg{ width:100%; height:100%; overflow:visible; }
.choice:active{ transform:translateY(4px); box-shadow:0 2px 0 rgba(27,42,107,.25); }
.choice.wrong{ filter:grayscale(1); opacity:.4; animation:shake .4s; }   /* abu-abu, bukan transparan: warna yang pudar bisa terlihat seperti warna lain */
.choice.right{ animation:pop .45s; box-shadow:0 0 0 6px #7BD88F, 0 6px 0 rgba(27,42,107,.25); }
.choice.hint{ animation:wiggle 1s ease-in-out infinite; }
@keyframes shake{ 20%,60%{ transform:translateX(-8px); } 40%,80%{ transform:translateX(8px); } }
@keyframes pop{ 40%{ transform:scale(1.15); } }
@keyframes wiggle{ 0%,100%{ transform:rotate(0) scale(1); } 25%{ transform:rotate(-6deg) scale(1.06); } 75%{ transform:rotate(6deg) scale(1.06); } }

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{ animation:none !important; transition:none !important; }
}
