/* BelajarLand styles. Fonts: Fredoka (titles) + Baloo 2 (text) only, bundled for offline use. */
@font-face{font-family:'Fredoka';font-style:normal;font-weight:500;font-display:swap;src:url(../assets/fonts/fredoka-latin-500-normal.woff2) format('woff2')}
@font-face{font-family:'Fredoka';font-style:normal;font-weight:600;font-display:swap;src:url(../assets/fonts/fredoka-latin-600-normal.woff2) format('woff2')}
@font-face{font-family:'Fredoka';font-style:normal;font-weight:700;font-display:swap;src:url(../assets/fonts/fredoka-latin-700-normal.woff2) format('woff2')}
@font-face{font-family:'Baloo 2';font-style:normal;font-weight:600;font-display:swap;src:url(../assets/fonts/baloo-2-latin-600-normal.woff2) format('woff2')}
@font-face{font-family:'Baloo 2';font-style:normal;font-weight:700;font-display:swap;src:url(../assets/fonts/baloo-2-latin-700-normal.woff2) format('woff2')}
@font-face{font-family:'Baloo 2';font-style:normal;font-weight:800;font-display:swap;src:url(../assets/fonts/baloo-2-latin-800-normal.woff2) format('woff2')}
@font-face{font-family:'Baloo Bhaijaan 2';font-style:normal;font-weight:700;font-display:swap;src:url(../assets/fonts/baloo-bhaijaan-2-arabic-700-normal.woff2) format('woff2')}
@font-face{font-family:'Baloo Bhaijaan 2';font-style:normal;font-weight:800;font-display:swap;src:url(../assets/fonts/baloo-bhaijaan-2-arabic-800-normal.woff2) format('woff2')}

:root {
  --ink: #2E3A59; --ink2: #5B6478; --mut: #7A8499;
  --cream: #FFF8EA; --cream-e: #E8D7B2;
  --y: #FFC93C; --y-d: #D6970F; --g: #5BC27A; --g-d: #379455;
  --b: #4FA8E8; --b-d: #2B7DBE; --r: #F2604B; --r-d: #C24431;
  --p: #A98BE8; --p-d: #7B5FC4; --pk: #F58FAE; --pk-d: #CB5E80;
  --o: #FF9F4A; --o-d: #D2722A; --t: #2FB5A6; --t-d: #1F8A7E;
  --edge: #CBD3DF;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #BFE0F7 url(../assets/img/sky_blue.webp) center/cover; }
body { font-family: 'Baloo 2', system-ui, sans-serif; color: var(--ink); user-select: none; -webkit-user-select: none; touch-action: manipulation; overscroll-behavior: none; }
body.garden { background: #F9D9CF url(../assets/img/sky_peach.webp) center/cover; }
#stage { box-shadow: 0 0 60px rgba(46,58,89,.18); }
body.parentbg { background: #E9EDF5; }
#stage { position: fixed; top: 0; transform-origin: 0 0; overflow: hidden; }
#stage > .scr { position: absolute; inset: 0; overflow: hidden; }
img { -webkit-user-drag: none; user-select: none; pointer-events: none; }
button, a, input { font-family: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
a { color: inherit; }
.lbl, h1, h2, h3 { font-family: 'Fredoka', 'Baloo 2', sans-serif; font-weight: 700; margin: 0; }
.jawi { font-family: 'Baloo Bhaijaan 2', 'Noto Naskh Arabic', serif; font-weight: 800; direction: rtl; }
.abs { position: absolute; }
.fill { position: absolute; inset: 0; }
.bgimg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }
.hidden { display: none !important; }

/* ---------- buttons ---------- */
.btn { position: relative; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; height: 62px; border-radius: 22px;
  font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 24px; color: #fff; background: var(--c, var(--g));
  box-shadow: 0 6px 0 var(--cd, var(--g-d)), 0 12px 16px rgba(46,58,89,.16); text-decoration: none; transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--cd, var(--g-d)); }
.btn.white { --c: #fff; --cd: var(--edge); color: var(--ink); }
.btn.yellow { --c: var(--y); --cd: var(--y-d); color: var(--ink); }
.btn.blue { --c: var(--b); --cd: var(--b-d); }
.btn.pink { --c: var(--pk); --cd: var(--pk-d); }
.btn.navy { --c: #2E3A59; --cd: #1C2540; }
.btn.small { height: 48px; font-size: 18px; border-radius: 16px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.rbtn { width: 52px; height: 52px; border-radius: 50%; background: #fff; box-shadow: 0 5px 0 var(--edge); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rbtn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--edge); }
.rbtn.y { background: var(--y); box-shadow: 0 5px 0 var(--y-d); }
.linkbtn { font-weight: 800; font-size: 16px; color: var(--b-d); text-decoration: underline; padding: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; border-radius: 999px; padding: 3px 14px; box-shadow: 0 4px 0 var(--edge); font-family: 'Fredoka', sans-serif; font-weight: 700; }

/* ---------- forms (parents) ---------- */
.card { background: #fff; border-radius: 24px; box-shadow: 0 5px 0 #E6E9F0, 0 10px 18px rgba(46,58,89,.07); padding: 16px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-weight: 800; font-size: 14px; color: var(--ink2); margin: 0 0 4px 4px; }
.input { width: 100%; height: 52px; border-radius: 16px; border: 2px solid #E3E7EF; background: #F8F9FC; padding: 0 14px; font-size: 18px; font-weight: 700; color: var(--ink); outline: none; user-select: text; -webkit-user-select: text; }
.input:focus { border-color: var(--b); background: #fff; }
.pw { position: relative; }
.pw button { position: absolute; right: 8px; top: 8px; height: 36px; padding: 0 10px; border-radius: 10px; background: #EEF1F7; font-weight: 800; font-size: 13px; color: var(--ink2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 42px; padding: 0 14px; border-radius: 999px; background: #EEF1F7; font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 16px; color: var(--ink2); }
.chip.on { background: var(--ink); color: #fff; box-shadow: 0 3px 0 #1C2540; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 700; color: var(--ink2); line-height: 1.35; }
.check input { width: 24px; height: 24px; flex-shrink: 0; accent-color: var(--g); margin-top: 1px; }
.err { color: var(--r-d); font-weight: 800; font-size: 14px; min-height: 20px; margin: 4px 4px 8px; }
.note { font-size: 14px; font-weight: 700; color: var(--mut); line-height: 1.4; }

/* ---------- top bar in games ---------- */
.gtop { position: absolute; left: 16px; right: 16px; top: calc(16px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 12px; z-index: 20; }
.face { position: relative; width: 54px; height: 54px; border-radius: 50%; background: #DDF1FF; box-shadow: 0 0 0 4px #fff, 0 6px 0 4px var(--edge); flex-shrink: 0; }
.face img { position: absolute; }
.bar { flex-grow: 1; height: 22px; border-radius: 11px; background: rgba(255,255,255,.92); box-shadow: inset 0 3px 0 rgba(0,0,0,.06), 0 4px 0 var(--edge); padding: 3px; position: relative; }
.bar i { display: block; height: 100%; border-radius: 8px; background: var(--acc, var(--y)); box-shadow: inset 0 -4px 0 var(--accd, var(--y-d)), inset 0 3px 0 rgba(255,255,255,.4); transition: width .5s; }
.bar img { position: absolute; right: -8px; top: -9px; width: 34px; }
.qpill { position: absolute; left: 0; right: 0; top: calc(86px + env(safe-area-inset-top)); display: flex; justify-content: center; z-index: 19; padding: 0 12px; }
.qpill > span { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 999px; padding: 5px 18px 5px 5px; box-shadow: 0 5px 0 var(--edge), 0 10px 14px rgba(46,58,89,.12); max-width: 100%; }
.qpill .spk { width: 40px; height: 40px; border-radius: 50%; background: var(--acc, var(--y)); box-shadow: 0 3px 0 var(--accd, var(--y-d)); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qpill .q { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 20px; line-height: 1.1; }
.garea { position: absolute; left: 0; right: 0; top: calc(146px + env(safe-area-inset-top)); bottom: 0; }

/* ---------- bubbles ---------- */
.bub { width: 92px; height: 92px; border-radius: 50%; background: #fff; color: var(--ink); font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 46px;
  box-shadow: inset 0 -7px 0 #DCE5EC, 0 8px 12px rgba(46,58,89,.18); display: flex; align-items: center; justify-content: center; transition: transform .1s; }
.bub:active { transform: scale(.93); }
.bub.good { background: var(--g); color: #fff; box-shadow: inset 0 -7px 0 var(--g-d), 0 0 0 6px #fff, 0 10px 14px rgba(46,58,89,.25); transform: translateY(-4px); }
.bub.bad { animation: shake .4s; background: #FFE3DE; }
.tray { position: absolute; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); border-radius: 32px; background: var(--cream); box-shadow: 0 8px 0 var(--cream-e), 0 18px 26px rgba(46,58,89,.18); }

/* ---------- overlays ---------- */
.overlay { position: absolute; inset: 0; background: rgba(46,58,89,.5); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadein .2s; }
.sheet { width: 100%; background: #fff; border-radius: 28px; padding: 22px; box-shadow: 0 10px 0 #D8DDE8; animation: popin .25s; }
.toast { position: absolute; left: 20px; right: 20px; bottom: 40px; background: var(--ink); color: #fff; border-radius: 18px; padding: 12px 16px; font-weight: 800; text-align: center; z-index: 90; transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translateY(10px); }

/* ---------- animations ---------- */
@keyframes breathe { 0%,100% { transform: scale(1,1) } 50% { transform: scale(1.015,1.03) } }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
@keyframes hop { 0%,100% { transform: translateY(0) } 40% { transform: translateY(-14px) } }
@keyframes wiggle { 0%,100% { transform: rotate(-5deg) } 50% { transform: rotate(5deg) } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes drift { 0%,100% { transform: translateX(0) } 50% { transform: translateX(18px) } }
@keyframes pulse { 0%,100% { transform: scale(1) } 50% { transform: scale(1.07) } }
@keyframes ring { 0% { transform: scale(1); opacity: .8 } 100% { transform: scale(1.5); opacity: 0 } }
@keyframes shake { 0%,100% { transform: translateX(0) } 20%,60% { transform: translateX(-8px) } 40%,80% { transform: translateX(8px) } }
@keyframes popin { 0% { transform: scale(.6); opacity: 0 } 70% { transform: scale(1.06) } 100% { transform: scale(1); opacity: 1 } }
@keyframes fadein { from { opacity: 0 } }
@keyframes floatup { 0% { transform: translateY(0); opacity: 0 } 15% { opacity: 1 } 100% { transform: translateY(-90px); opacity: 0 } }
@keyframes twinkle { 0%,100% { transform: scale(.4); opacity: 0 } 50% { transform: scale(1); opacity: 1 } }
@keyframes rays { to { transform: translate(-50%,-50%) rotate(360deg) } }
@keyframes dropin { 0% { transform: translateY(-40px) scale(.8); opacity: 0 } 100% { transform: none; opacity: 1 } }
@keyframes confetti { 0% { transform: translate(0,0) rotate(0); opacity: 1 } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--dr)); opacity: 0 } }
.breathe { animation: breathe 3.2s ease-in-out infinite; transform-origin: 50% 100%; }
.bob { animation: bob 1.8s ease-in-out infinite; }
.hop { animation: hop 1s ease-in-out infinite; transform-origin: 50% 100%; }
.wiggle { animation: wiggle 1.4s ease-in-out infinite; }
.spin { animation: spin 60s linear infinite; }
.drift { animation: drift 9s ease-in-out infinite; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
.ring { animation: ring 1.6s ease-out infinite; }
.popin { animation: popin .35s both; }
.twinkle { animation: twinkle 1.6s ease-in-out infinite; }
.shake { animation: shake .4s; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
