[hidden]{ display:none !important; }
#play:focus{ outline:none; }   /* fokus dipindah ke sini saat main, tanpa garis fokus */
:root{
  --bg:#DDF6E3; --card:#FFFDF7; --text:#1B2A6B; --muted:#3F5A92;
  --accent:#7BD88F; --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:min(86vw, 360px); aspect-ratio:360/200; margin-top:8px; }
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 ---------- */
/* padding-bottom hanya dibaca game.js untuk tahu tinggi safe area bawah */
#play{ position:fixed; inset:0; background:var(--bg); display:none; touch-action:none; padding-bottom:env(safe-area-inset-bottom,0px); }
#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%);
  top:calc(env(safe-area-inset-top,0px) + 80px);
  width:min(92vw, 520px); background:var(--card); color:var(--text);
  border-radius:24px; padding:8px 16px; text-align:center; font-size:1.2rem; 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(--water); }
.btn:active{ transform:translateY(4px); box-shadow:0 1px 0 rgba(27,42,107,.25); }

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