/* Dengar & Pikir — gaya tampilan.
   Prinsip: tombol besar (min 56px), kontras tinggi, font ramah disleksia (Lexend), warna ceria
   biru (Dengar) & oranye (Pikir) seperti kartu fisiknya. Responsif HP → iPad → PC. */

:root {
  --bg: #fff8ec;
  --bg-dot: #ffe9c7;
  --card: #ffffff;
  --ink: #28324a;
  --muted: #6b7590;
  --line: #efe3cc;
  --blue: #2f80ed;
  --blue-d: #1d5fb8;
  --blue-l: #e6f0ff;
  --orange: #ff8a3d;
  --orange-d: #d9661d;
  --orange-l: #fff0e4;
  --yellow: #ffd23f;
  --green: #20b26b;
  --green-d: #178a52;
  --green-l: #e3f8ec;
  --red: #e2445c;
  --red-l: #fde8ec;
  --purple: #7b6cf6;
  --radius: 22px;
  --shadow: 0 6px 0 var(--line);
  --font: 'Lexend', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Baloo 2', 'Lexend', system-ui, sans-serif;
  --emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Android Emoji', sans-serif;
  --gutter: clamp(16px, 4vw, 32px);
  --maxw: 1080px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: clamp(16px, 1.1vw + 12px, 19px);
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dot) 2px, transparent 2.5px);
  background-size: 28px 28px;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}
#app { outline: none; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .4em; letter-spacing: .2px; }
h1 { font-size: clamp(1.6rem, 3.2vw + .8rem, 2.4rem); }
h2 { font-size: clamp(1.3rem, 2vw + .7rem, 1.8rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 .8em; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; border-radius: 12px; }
small { color: var(--muted); }

/* ---------- splash ---------- */
#splash {
  position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center;
  background: var(--bg); font-family: var(--font-head); font-size: 1.6rem; font-weight: 800; color: var(--blue);
}
#splash img { animation: bob 1.4s ease-in-out infinite; }

/* ---------- layout ---------- */
.screen {
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) calc(var(--gutter) + env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) calc(var(--gutter) + env(safe-area-inset-left));
  animation: fadeUp .28s ease-out;
}
.screen.center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.center { text-align: center; }
.spacer { flex: 1; }
.page-title { text-align: center; margin-top: .2em; }
.sub { color: var(--muted); text-align: center; margin-top: -.2em; }
.foot-note { color: var(--muted); text-align: center; font-size: .9rem; margin-top: 18px; }

.topbar { display: flex; align-items: center; gap: 10px; min-height: 64px; margin-bottom: 8px; width: 100%; }
.bar-title { margin: 0; font-size: 1.4rem; }
.icon-btn {
  width: 52px; height: 52px; flex: none; display: grid; place-items: center;
  border: 0; border-radius: 16px; background: var(--card); box-shadow: 0 4px 0 var(--line);
  font-size: 1.4rem; font-family: var(--emoji), var(--font); transition: transform .1s;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.who { display: flex; align-items: center; gap: 10px; border: 0; background: var(--card); padding: 6px 16px 6px 6px; border-radius: 999px; box-shadow: 0 4px 0 var(--line); font-weight: 600; min-height: 52px; max-width: 55vw; }
.who-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.star-pill { border: 0; background: #fff6d6; color: #8a6400; font-weight: 700; border-radius: 999px; padding: 0 16px; min-height: 52px; box-shadow: 0 4px 0 #f3e2a6; font-family: var(--font), var(--emoji); }

.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: var(--blue-l); font-family: var(--emoji); flex: none; line-height: 1; }
.avatar.sm { width: 40px; height: 40px; font-size: 1.5rem; }
.avatar.lg { width: 84px; height: 84px; font-size: 3rem; }
.avatar.xl { width: 112px; height: 112px; font-size: 4rem; background: #fff; box-shadow: 0 6px 0 var(--line); }

.card { background: var(--card); border-radius: var(--radius); padding: clamp(16px, 3vw, 28px); box-shadow: var(--shadow); margin: 0 0 18px; width: 100%; }

/* ---------- buttons ---------- */
.btn {
  --c: var(--blue); --cd: var(--blue-d);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 22px; border: 0; border-radius: 16px;
  background: var(--c); color: #fff; font-weight: 600; font-size: 1.02rem; font-family: var(--font), var(--emoji);
  box-shadow: 0 5px 0 var(--cd); transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--cd); }
.btn:disabled { filter: grayscale(.6) opacity(.55); }
.btn.secondary { --c: #fff; --cd: var(--line); color: var(--ink); border: 2px solid var(--line); }
.btn.ghost { --c: transparent; --cd: transparent; color: var(--muted); box-shadow: none; }
.btn.danger { --c: var(--red); --cd: #b32f44; }
.btn.big { min-height: 60px; font-size: 1.15rem; padding: 12px 28px; border-radius: 18px; }
.btn.huge { min-height: 68px; font-size: 1.35rem; padding: 14px 48px; border-radius: 22px; font-family: var(--font-head); font-weight: 800; }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: .9rem; border-radius: 12px; box-shadow: 0 3px 0 var(--cd); }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 12px; min-height: 44px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }
.actions.col { flex-direction: column; align-items: stretch; max-width: 360px; margin-left: auto; margin-right: auto; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }

/* ---------- welcome ---------- */
.welcome { min-height: 100dvh; justify-content: center; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 560px; }
.brand { font-size: clamp(2.6rem, 8vw, 4rem); font-weight: 800; margin: 0; display: flex; gap: .2em; align-items: baseline; flex-wrap: wrap; justify-content: center; }
.b-dengar { color: var(--blue); text-shadow: 0 4px 0 #cfe1fb; }
.b-pikir { color: var(--orange); text-shadow: 0 4px 0 #ffd9bd; }
.amp { color: var(--green); font-size: .7em; }
.tagline { font-size: 1.1rem; color: var(--muted); margin-bottom: 10px; }
.feature-list { list-style: none; padding: 0; margin: 4px 0 22px; text-align: left; display: grid; gap: 8px; }
.feature-list li { background: var(--card); padding: 10px 16px; border-radius: 16px; box-shadow: 0 4px 0 var(--line); font-family: var(--font), var(--emoji); }

/* ---------- profiles ---------- */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; width: 100%; max-width: 760px; margin-top: 12px; }
.profile-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 10px; border: 0; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); transition: transform .12s; }
.profile-card:hover { transform: translateY(-3px); }
.profile-card:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--line); }
.profile-card.add { background: transparent; border: 3px dashed #e3d3b4; box-shadow: none; }
.profile-card.add .avatar { background: #fff; }
.p-name { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; word-break: break-word; }
.p-age { color: var(--muted); font-size: .9rem; }

/* ---------- forms ---------- */
.form label { display: block; font-weight: 600; margin: 16px 0 8px; }
.input { width: 100%; min-height: 52px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 14px; font: inherit; background: #fffdf8; color: var(--ink); }
.input.big { font-size: 1.25rem; min-height: 60px; }
.input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px var(--blue-l); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
input[type=range] { width: 100%; accent-color: var(--blue); height: 36px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.chip { min-width: 56px; min-height: 52px; padding: 6px 16px; border-radius: 16px; border: 2px solid var(--line); background: #fff; font-weight: 600; font-family: var(--font), var(--emoji); }
.chip.on { background: var(--blue); color: #fff; border-color: var(--blue-d); box-shadow: 0 4px 0 var(--blue-d); }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 10px; margin-bottom: 20px; }
.av { aspect-ratio: 1; border-radius: 18px; border: 3px solid transparent; background: var(--blue-l); font-size: 2rem; font-family: var(--emoji); }
.av.on { border-color: var(--blue); background: #fff; transform: scale(1.06); box-shadow: 0 4px 0 var(--blue-d); }
.profile-form .card { max-width: 640px; margin: 0 auto; }
.hint { color: var(--muted); font-size: .95rem; text-align: center; }
.form .hint { text-align: left; }
.error { color: var(--red); font-weight: 600; min-height: 1.2em; }
.warn { background: #fff6d6; border-radius: 14px; padding: 12px 14px; font-size: .92rem; margin-bottom: 8px; }

.toggle { display: flex !important; align-items: flex-start; gap: 14px; cursor: pointer; font-weight: 400 !important; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { flex: none; width: 56px; height: 32px; border-radius: 99px; background: #d9d2c3; position: relative; transition: background .2s; margin-top: 2px; }
.toggle .track i { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 3px rgba(0, 0, 0, .15); }
.toggle input:checked + .track { background: var(--green); }
.toggle input:checked + .track i { transform: translateX(24px); }
.toggle input:focus-visible + .track { outline: 4px solid var(--yellow); outline-offset: 2px; }
.tg-text { display: flex; flex-direction: column; }

/* ---------- home ---------- */
.greet { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 8px 0 18px; text-align: left; }
.greet h1 { margin: 0; word-break: break-word; }
.greet p { margin: 0; color: var(--muted); }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 3vw, 28px); }
.mode-card {
  --c: var(--blue); --cd: var(--blue-d); --cl: #5aa0ff;
  position: relative; overflow: hidden; border: 0; color: #fff; text-align: left;
  display: flex; flex-direction: column; gap: 4px; padding: clamp(18px, 3vw, 32px);
  min-height: clamp(220px, 42vh, 460px); border-radius: 30px;
  background: linear-gradient(160deg, var(--cl), var(--c)); box-shadow: 0 8px 0 var(--cd);
  transition: transform .12s, box-shadow .12s;
}
.mode-card.m-logic { --c: var(--orange); --cd: var(--orange-d); --cl: #ffb26b; }
.mode-card::after { content: ''; position: absolute; right: -40px; bottom: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.mode-card:hover { transform: translateY(-3px); }
.mode-card:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--cd); }
.mode-emo { font-size: clamp(3.2rem, 8vw, 5rem); font-family: var(--emoji); line-height: 1.1; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .12)); }
.mode-name { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.9rem, 4.5vw, 2.8rem); line-height: 1; margin-top: auto; }
.mode-desc { font-size: clamp(.92rem, 1.5vw, 1.05rem); opacity: .95; }
.mode-meta { display: inline-block; align-self: flex-start; margin-top: 8px; background: rgba(255, 255, 255, .22); padding: 4px 12px; border-radius: 99px; font-size: .85rem; font-weight: 600; }
.sticker-strip { width: 100%; margin-top: 22px; display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 0; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); text-align: left; }
.ss-icons { font-family: var(--emoji); font-size: 1.6rem; letter-spacing: 2px; white-space: nowrap; }
.ss-text { font-size: .95rem; color: var(--muted); font-family: var(--font), var(--emoji); }

/* ---------- levels ---------- */
.level-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; margin-top: 10px; }
.level-card {
  --lv: var(--blue);
  position: relative; border: 0; text-align: left; display: flex; flex-direction: column; gap: 4px;
  padding: 18px 20px 16px; border-radius: var(--radius); background: var(--card);
  box-shadow: 0 6px 0 var(--line); border-left: 10px solid var(--lv); transition: transform .12s;
}
.level-card:hover { transform: translateY(-2px); }
.level-card:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--line); }
.level-card.rec { box-shadow: 0 6px 0 var(--lv), 0 0 0 3px var(--lv) inset; }
.rec-badge { position: absolute; top: 12px; right: 12px; background: var(--lv); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.lv-stars { font-family: var(--emoji); font-size: 1.15rem; letter-spacing: 1px; }
.lv-name { font-family: var(--font-head); font-weight: 800; font-size: 1.4rem; line-height: 1.1; }
.lv-age { font-weight: 600; color: var(--lv); filter: brightness(.85); }
.lv-desc { color: var(--muted); font-size: .9rem; }
.lv-progress { height: 10px; border-radius: 99px; background: #f2ebdd; overflow: hidden; margin-top: 6px; }
.lv-progress i { display: block; height: 100%; background: var(--lv); border-radius: 99px; }
.lv-meta { font-size: .85rem; color: var(--muted); }
.best { color: #e0a800; letter-spacing: 1px; white-space: nowrap; }

/* ---------- game ---------- */
.screen.play { padding-top: calc(env(safe-area-inset-top) + 4px); }
.game { display: flex; flex-direction: column; min-height: calc(100dvh - 40px); }
.g-top { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.g-progress { flex: 1; height: 16px; background: #f1e6d1; border-radius: 99px; overflow: hidden; }
.g-progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green), #5ad49a); transition: width .4s ease; }
.mode-logic .g-progress i { background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.lvl-chip { background: var(--card); border-radius: 99px; padding: 8px 14px; font-family: var(--emoji); font-size: .95rem; box-shadow: 0 4px 0 var(--line); white-space: nowrap; }
.g-stage { flex: 1; display: flex; flex-direction: column; padding-top: 8px; }
.g-stage > .card { animation: popIn .3s ease-out; max-width: 920px; margin-left: auto; margin-right: auto; }
.kicker { color: var(--muted); font-weight: 600; font-size: .9rem; text-transform: uppercase; letter-spacing: .6px; margin-bottom: .2em; }
.mode-listening .kicker { color: var(--blue); }
.mode-logic .kicker { color: var(--orange-d); }

.listen-card { text-align: center; }
.listen-card .title, .story-done .title { color: var(--blue-d); }
.listen-owl { position: relative; display: inline-block; margin: 6px auto; }
.waves { position: absolute; inset: 0; pointer-events: none; }
.waves i { position: absolute; left: 50%; top: 50%; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%; border: 4px solid var(--blue); opacity: 0; }
.listen-owl.on .waves i { animation: wave 1.8s ease-out infinite; }
.listen-owl.on .waves i:nth-child(2) { animation-delay: .6s; }
.listen-owl.on .waves i:nth-child(3) { animation-delay: 1.2s; }
.listen-owl.on .owl svg { animation: bob 1.2s ease-in-out infinite; }
.story-text { font-size: clamp(1.1rem, 1.4vw + .7rem, 1.45rem); line-height: 1.7; background: var(--blue-l); border-radius: 18px; padding: 16px 20px; text-align: left; max-width: 760px; margin: 10px auto; word-spacing: .08em; }
.score-line { font-weight: 600; font-family: var(--font), var(--emoji); }
.story-done { text-align: center; }

.q-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.question { flex: 1; font-size: clamp(1.35rem, 2.2vw + .8rem, 2.1rem); margin: 0; }
.icon-btn.speak { background: var(--blue-l); box-shadow: 0 4px 0 #c7dcfb; }
.mode-logic .icon-btn.speak { background: var(--orange-l); box-shadow: 0 4px 0 #ffd6b8; }
.under { text-align: center; margin-top: 8px; }

.options { display: grid; gap: clamp(10px, 2vw, 18px); }
.options.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.options.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opt {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: clamp(96px, 16vw, 150px); padding: 14px 10px; border-radius: 20px;
  border: 3px solid var(--line); background: #fffdf8; box-shadow: 0 5px 0 var(--line);
  transition: transform .1s, background .2s, border-color .2s; text-align: center;
}
.opt:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.opt:hover:not(:disabled) { border-color: #d9c7a3; }
.opt-key { position: absolute; top: 6px; left: 10px; font-size: .75rem; color: #c9b998; font-weight: 600; }
.opt-emo { font-family: var(--emoji); font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.1; }
.opt-emo.solo { font-size: clamp(2.8rem, 7vw, 4.4rem); }
.opt-text { font-weight: 600; font-size: clamp(1rem, 1vw + .75rem, 1.25rem); line-height: 1.25; overflow-wrap: anywhere; }
.options.big .opt-text { font-size: clamp(1.15rem, 1.4vw + .8rem, 1.6rem); }
.opt.reading { border-color: var(--blue); background: var(--blue-l); transform: scale(1.03); }
.opt.right { border-color: var(--green); background: var(--green-l); box-shadow: 0 5px 0 var(--green-d); animation: bounce .5s; }
.opt.wrong { border-color: var(--red); background: var(--red-l); animation: shake .4s; opacity: .7; }
.opt.reveal { border-color: var(--green); background: var(--green-l); animation: pulse 1.2s ease-in-out 3; }
.opt:disabled:not(.right):not(.reveal):not(.wrong) { opacity: .55; }

.sequence { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 4px 0 20px; }
.seq-item { display: grid; place-items: center; min-width: 64px; min-height: 64px; padding: 6px 12px; border-radius: 16px; background: var(--orange-l); font-family: var(--font-head), var(--emoji); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; line-height: 1; }
.seq-item.hole { border: 3px dashed var(--orange); background: #fff; color: var(--orange); animation: pulse 1.6s ease-in-out infinite; }
.seq-item.hole.filled { border-style: solid; border-color: var(--green); background: var(--green-l); color: var(--ink); animation: bounce .5s; }

.slots { list-style: none; padding: 0; margin: 4px 0 16px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.slot { width: 100%; min-height: 84px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 18px; border: 3px dashed #e3d3b4; background: #fffdf8; text-align: left; }
.slot:not(.empty) { border-style: solid; border-color: var(--orange); background: var(--orange-l); }
.slot.right { border-color: var(--green); background: var(--green-l); }
.slot.wrong { border-color: var(--red); background: var(--red-l); animation: shake .4s; }
.slot.reveal { border-color: var(--green); background: var(--green-l); }
.num { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff; font-family: var(--font-head); font-size: 1.1rem; }
.ph { color: #cdbd9c; font-size: 1.5rem; }
.pool { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; min-height: 60px; }
.pool-item { border: 3px solid var(--line); background: #fff; border-radius: 18px; padding: 8px 14px; min-height: 64px; box-shadow: 0 5px 0 var(--line); animation: popIn .25s; }
.pool-item:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.tile { display: flex; align-items: center; gap: 8px; }
.tile-emo { font-family: var(--emoji); font-size: 2rem; line-height: 1; }
.tile-text { font-weight: 600; font-size: 1rem; line-height: 1.2; }

.feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; justify-content: space-between; margin-top: 18px; padding: 14px 18px; border-radius: 18px; animation: slideUp .3s ease-out; }
.feedback.good { background: var(--green-l); border: 3px solid #b6ead0; }
.feedback.soft { background: #fff6d6; border: 3px solid #f6e3a2; }
.fb-text { flex: 1 1 260px; }
.fb-text strong { font-family: var(--font-head), var(--emoji); font-size: 1.35rem; }
.fb-text p { margin: 4px 0 0; }

/* ---------- result ---------- */
.result-card { max-width: 520px; text-align: center; margin-top: 12px; }
.stars-row { display: flex; justify-content: center; gap: 8px; margin: 4px 0 8px; }
.big-star { font-size: clamp(3.4rem, 12vw, 4.6rem); color: #eadfc8; line-height: 1; transform: scale(0); animation: starIn .5s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.big-star.on { color: var(--yellow); text-shadow: 0 4px 0 #e0a800; }
.big-star:nth-child(2) { transform: scale(0) translateY(-10px); font-size: clamp(4rem, 14vw, 5.4rem); }
.score { font-size: 1.3rem; font-weight: 600; }
.new-sticker { display: inline-flex; align-items: center; gap: 12px; background: #fff6d6; padding: 10px 20px; border-radius: 99px; font-weight: 700; margin: 6px 0; }
.sticker-pop { font-family: var(--emoji); font-size: 2.6rem; animation: bounce 1s 1s; }

/* ---------- stickers ---------- */
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 12px; margin-top: 12px; }
.sticker { aspect-ratio: 1; display: grid; place-items: center; border-radius: 20px; background: #f3ecdf; font-family: var(--emoji); font-size: 1.4rem; color: #c9bba0; }
.sticker.got { background: var(--card); box-shadow: var(--shadow); font-size: 2.6rem; animation: popIn .3s; }

/* ---------- parent ---------- */
.gate-card { max-width: 460px; }
.gate-q { font-family: var(--font-head); font-size: 2.6rem; font-weight: 800; color: var(--blue); }
.gate-card .opt { min-height: 72px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin: 0 calc(-1 * var(--gutter)) 6px; padding-left: var(--gutter); padding-right: var(--gutter); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 0; background: var(--card); border-radius: 99px; padding: 10px 16px; min-height: 46px; font-weight: 600; box-shadow: 0 3px 0 var(--line); white-space: nowrap; font-family: var(--font), var(--emoji); }
.tab.on { background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-d); }
.parent-body { display: block; }
.parent-body .card h3 { margin-bottom: .6em; }
.parent-body .card h4 { margin: 1em 0 .2em; }
.parent-body .card ul, .parent-body .card ol { padding-left: 1.2em; margin: 0 0 .6em; }
.parent-body .card li { margin-bottom: .35em; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border-radius: 18px; padding: 14px 16px; box-shadow: 0 4px 0 var(--line); display: flex; flex-direction: column; }
.stat-label { font-size: .85rem; color: var(--muted); font-weight: 600; font-family: var(--font), var(--emoji); }
.stat-value { font-family: var(--font-head); font-size: 2rem; font-weight: 800; line-height: 1.1; }
.stat-sub { font-size: .8rem; color: var(--muted); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 0 18px; }
.tips { background: #fffbea; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }
.tbl td { font-family: var(--font), var(--emoji); }
.levels-tbl td:nth-child(3), .levels-tbl td:nth-child(4) { min-width: 180px; }
.child-list { list-style: none; padding: 0 !important; }
.child-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cl-name { flex: 1; font-weight: 600; min-width: 120px; }

/* ---------- modal, toast, misc ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(40, 50, 74, .45); animation: fade .2s; }
.modal-wrap.out { opacity: 0; transition: opacity .2s; }
.modal { background: var(--card); border-radius: 26px; padding: 26px; max-width: 440px; width: 100%; box-shadow: 0 10px 0 rgba(0, 0, 0, .08); animation: popIn .25s; }
.modal p { color: var(--muted); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px; }
#toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; text-align: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); animation: slideUp .25s; font-family: var(--font), var(--emoji); }
.toast.out { opacity: 0; transform: translateY(10px); transition: all .3s; }
.update-bar { position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 70; background: var(--card); padding: 10px 14px; border-radius: 16px; box-shadow: 0 6px 20px rgba(0, 0, 0, .15); display: flex; gap: 10px; align-items: center; width: max-content; max-width: 92vw; }
.offline-pill { position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); background: var(--ink); color: #fff; padding: 6px 12px; border-radius: 99px; font-size: .8rem; display: none; z-index: 30; font-family: var(--font), var(--emoji); }
body.offline .offline-pill { display: block; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 45; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; }
.owl { display: inline-block; line-height: 0; }
.owl svg { overflow: visible; }
.owl .owl-eyes { animation: blink 4s infinite; transform-origin: 60px 54px; }

/* ---------- animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes bounce { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.08); } 70% { transform: scale(.97); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes wave { 0% { transform: scale(.7); opacity: .6; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes starIn { to { transform: scale(1); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); } }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card { min-height: 170px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
  .mode-card .mode-emo { font-size: 3.4rem; }
  .mode-card .mode-name { margin-top: 0; }
  .mode-card .mode-desc { flex-basis: 100%; }
  .mode-card .mode-meta { flex: 0 0 auto; margin-top: 4px; }
  .greet .owl svg { width: 72px; height: 72px; }
  .options.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .options.cols-3 .opt { min-height: 104px; padding: 10px 4px; }
  .options.cols-3 .opt-text { font-size: .95rem; }
  .lvl-chip { font-size: .75rem; padding: 6px 10px; }
  .icon-btn { width: 48px; height: 48px; }
  .who { padding-right: 12px; }
  .star-pill { padding: 0 12px; }
  .q-row .question { font-size: 1.35rem; }
  .slot { min-height: 70px; }
  .tile-emo { font-size: 1.6rem; }
  .tile-text { font-size: .92rem; }
  .feedback .btn { width: 100%; }
  .modal-actions .btn { flex: 1; }
}
@media (max-width: 380px) {
  .options.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .opt-emo { font-size: 2rem; }
  .who-name { display: none; }
}
/* Tablet/PC landscape: jawaban 4 kolom jika muat */
@media (min-width: 900px) {
  .options.cols-2.big { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pool-item { padding: 10px 18px; }
}
/* Layar pendek landscape (HP miring) */
@media (max-height: 520px) and (orientation: landscape) {
  .listen-owl .owl svg { width: 90px; height: 90px; }
  .waves i { width: 90px; height: 90px; margin: -45px 0 0 -45px; }
  .opt { min-height: 80px; }
  .options.cols-2 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mode-card { min-height: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .big-star { transform: none; }
}
@media print {
  body { background: #fff; }
  .topbar, .tabs, .btn { display: none !important; }
}
/* Mode tenang (pengaturan orang tua) */
body.calm *, body.calm *::before, body.calm *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
body.calm .big-star { transform: none; }
.question.long { font-family: var(--font); font-weight: 600; font-size: clamp(1.05rem, .9vw + .85rem, 1.35rem); line-height: 1.55; }
@media (min-width: 561px) {
  .mode-emo { font-size: clamp(3.6rem, 9vh, 6rem); }
  .mode-name { font-size: clamp(2rem, 6vh, 3.2rem); }
  .greet { margin: 16px 0 26px; }
}
@media (min-width: 760px) { .tabs { flex-wrap: wrap; overflow: visible; } }
@media (hover: none) { .opt-key { display: none; } }
.sound-help { text-align: left; background: #fff6d6; border-radius: 16px; padding: 12px 16px; max-width: 620px; margin: 10px auto 0; font-size: .95rem; }
.sound-help ul { margin: 6px 0 10px; padding-left: 1.2em; }
.test-result { margin-top: 10px; font-size: .95rem; }
[hidden] { display: none !important; }
.sub.left { text-align: left; margin-top: 0; }
.miss { margin-top: 10px; font-size: .9rem; } .miss summary { cursor: pointer; font-weight: 600; }

/* ===================== v2: banyak mata pelajaran ===================== */
:root { --font-ar: 'Noto Naskh Arabic', 'Geeza Pro', 'Arabic Typesetting', serif; }
.ar { font-family: var(--font-ar), var(--font); }
.mode-grid.single { grid-template-columns: 1fr; }
.subject-group { margin-top: 22px; }
.group-title { font-size: 1.25rem; margin: 0 0 10px 4px; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 150px), 1fr)); gap: 12px; }
.subject-tile {
  --c: var(--blue);
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 14px 14px 12px; min-height: 120px; border: 0; border-radius: 22px; text-align: left;
  background: var(--card); box-shadow: 0 5px 0 var(--line); border-top: 6px solid var(--c);
  transition: transform .12s;
}
.subject-tile:hover { transform: translateY(-2px); }
.subject-tile:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.st-emo { font-family: var(--emoji); font-size: 2.3rem; line-height: 1.1; }
.st-emo.ar { font-family: var(--font-ar); font-weight: 700; color: var(--c); font-size: 2.2rem; }
.st-name { font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; line-height: 1.1; }
.st-bar { width: 100%; height: 7px; border-radius: 99px; background: #f2ebdd; overflow: hidden; margin-top: auto; }
.st-bar i { display: block; height: 100%; background: var(--c); border-radius: 99px; }
.st-meta { font-size: .78rem; color: var(--muted); font-family: var(--font), var(--emoji); }
.level-card:disabled { opacity: .45; }

.game { --subj: var(--blue); }
.game .kicker { color: var(--subj); }
.visual { margin: 6px auto 16px; padding: 14px 18px; border-radius: 18px; background: #f7f3ea; text-align: center; white-space: pre-line;
  font-family: var(--emoji), var(--font-head); font-size: clamp(1.6rem, 4.5vw, 2.4rem); line-height: 1.35; max-width: 100%; overflow-wrap: anywhere; }
.visual.big { font-family: var(--font-head), var(--emoji); font-size: clamp(3rem, 12vw, 5.5rem); font-weight: 800; letter-spacing: .06em; line-height: 1.1; }
.visual.ar { font-family: var(--font-ar), var(--emoji); font-size: clamp(2rem, 6vw, 3rem); line-height: 1.8; }
.visual.big.ar { font-size: clamp(3.4rem, 14vw, 6rem); }
.audio-big { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 4px auto 18px; width: 128px; height: 128px; border-radius: 50%; border: 0;
  background: radial-gradient(circle at 35% 30%, #ffffff55, transparent 45%), var(--subj); color: #fff; box-shadow: 0 7px 0 rgba(0,0,0,.18); justify-content: center; animation: pulse 2s ease-in-out infinite; }
.audio-big span { font-size: 3rem; font-family: var(--emoji); line-height: 1; }
.audio-big small { color: #fff; font-weight: 600; font-size: .78rem; }
.audio-again { display: flex; margin: -8px auto 14px; }
.robot-grid { display: grid; gap: 6px; max-width: 420px; margin: 4px auto 18px; padding: 10px; background: #eef2f7; border-radius: 18px; }
.robot-grid .cell { aspect-ratio: 1; display: grid; place-items: center; background: #fff; border-radius: 12px; font-family: var(--emoji); font-size: clamp(1.4rem, 6vw, 2.2rem); box-shadow: inset 0 -3px 0 #e2e8f0; }
.robot-grid .cell.empty { background: #fff; }
.passage { background: #fffaf0; border: 2px solid #f3e3c3; border-radius: 18px; padding: 12px 16px 14px; margin: 0 0 16px; }
.passage-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.passage p { margin: 0; font-size: clamp(1.05rem, .9vw + .85rem, 1.3rem); line-height: 1.75; word-spacing: .06em; }
.options.cols-1 { grid-template-columns: 1fr; }
.options.cols-1 .opt { min-height: 64px; flex-direction: row; justify-content: flex-start; text-align: left; padding: 12px 16px 12px 34px; gap: 12px; }
.options.cols-1 .opt-emo { font-size: 1.8rem; }
.opt.ar .opt-text, .opt-text.ar { font-family: var(--font-ar); font-size: clamp(1.4rem, 3.5vw, 2rem); line-height: 1.6; }
.options.cols-1 .opt.ar { justify-content: flex-end; }
.opt-tr { display: block; font-size: .8rem; color: var(--muted); font-style: italic; }
.question.ar, .question .ar { font-family: var(--font-ar), var(--font-head); }
.fb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.icon-btn.small { width: 40px; height: 40px; font-size: 1.1rem; border-radius: 12px; }
.why { margin-top: 8px; background: #ffffffb3; border-radius: 14px; padding: 8px 12px; }
.why-tag { display: inline-block; font-size: .75rem; font-weight: 700; color: #fff; background: var(--subj); border-radius: 99px; padding: 2px 10px; margin-bottom: 4px; }
.why p { margin: 0; line-height: 1.6; }
.why p.ar { font-family: var(--font), var(--font-ar); }
.task-box { background: #f4f8ff; border-radius: 18px; padding: 12px 16px; margin-bottom: 12px; }
.task-steps { margin: 0; padding-left: 0; list-style: none; counter-reset: step; display: grid; gap: 8px; }
.task-steps li { counter-increment: step; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 8px 12px; font-weight: 500; }
.task-steps li::before { content: counter(step); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--subj); color: #fff; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; }
.timer-wrap { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin: 8px 0; }
.timer { --p: 0; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--subj) calc(var(--p) * 360deg), #e9e3d6 0); }
.timer::before { content: ''; grid-area: 1 / 1; width: 88px; height: 88px; border-radius: 50%; background: var(--card); }
.timer-face { grid-area: 1 / 1; font-family: var(--font-head); font-weight: 800; font-size: 1.8rem; }
.timer.done { animation: bounce .6s 2; }
.chips.small .chip { min-height: 38px; min-width: 0; padding: 4px 10px; font-size: .85rem; border-radius: 12px; }
.subject-toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.chk { display: flex !important; align-items: center; gap: 10px; margin: 0 !important; padding: 8px 10px; border-radius: 12px; background: #fbf7ef; font-weight: 500 !important; font-family: var(--font), var(--emoji); }
.chk input { width: 22px; height: 22px; accent-color: var(--green); }
.tbl tr.muted td { color: #b3ab9a; }
.pool-item.reading, .opt.reading { outline: 3px solid var(--subj); }
@media (max-width: 560px) {
  .subject-tile { min-height: 108px; padding: 12px; }
  .st-emo { font-size: 2rem; }
  .st-name { font-size: 1.05rem; }
  .audio-big { width: 108px; height: 108px; }
  .robot-grid { gap: 4px; padding: 8px; }
}
@media (max-width: 560px) {
  .mode-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .mode-card { min-height: 150px; flex-direction: column; align-items: flex-start; padding: 16px; border-radius: 24px; }
  .mode-card .mode-emo { font-size: 2.6rem; }
  .mode-card .mode-name { font-size: 1.7rem; margin-top: auto; }
  .mode-card .mode-desc { display: none; }
  .mode-card .mode-meta { font-size: .72rem; padding: 3px 8px; }
}
.opt-emo.multi, .opt-emo.solo.multi { font-size: clamp(1.3rem, 3.6vw, 1.9rem); line-height: 1.3; overflow-wrap: anywhere; word-break: break-all; max-width: 100%; }
.robot-grid { width: fit-content; max-width: 100%; }
.robot-grid .cell { width: clamp(44px, 13vw, 64px); height: clamp(44px, 13vw, 64px); aspect-ratio: auto; font-size: clamp(1.5rem, 6vw, 2.1rem); }
.seq-item { max-width: 100%; overflow-wrap: anywhere; }
.opt { min-width: 0; }
.daily-card { width: 100%; margin-top: 18px; display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 0; border-radius: 22px; text-align: left;
  background: linear-gradient(120deg, #fff4cc, #ffe2b8); box-shadow: 0 5px 0 #f1cf8a; }
.daily-card:active { transform: translateY(4px); box-shadow: 0 1px 0 #f1cf8a; }
.daily-card.done { background: linear-gradient(120deg, #e3f8ec, #d4f3e3); box-shadow: 0 5px 0 #b6ead0; }
.daily-emo { font-size: 2.4rem; font-family: var(--emoji); }
.daily-text { flex: 1; display: flex; flex-direction: column; }
.daily-text b { font-family: var(--font-head); font-size: 1.25rem; }
.daily-text small { color: #7a5b1c; }
.daily-go { font-size: 1.6rem; color: #b7791f; font-weight: 800; }
