/* =====================================================================  DELLY MEOW MEOW: STYLES  */
@font-face { font-family: 'DMMInfant'; src: url('assets/InterInfant.woff') format('woff'); font-display: swap; }
@font-face { font-family: 'DMMRound'; src: url('assets/InterInfant.woff') format('woff'); font-display: swap; }
:root {
  --ink: #2d2a3a; --soft: #6b6880; --card: #fffaf0; --line: #eadfca; --primary: #ff7a45; --primaryDk: #e05a26;
  --maths: #f5a623; --phonics: #2fa79d; --story: #9b6ad6; --good: #2e9d4a; --bad: #e8463c; --sun: #ffd34d;
  --ui: 'DMMRound', ui-rounded, 'SF Pro Rounded', 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --read: 'DMMInfant', 'DMMRound', ui-rounded, system-ui, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #7dc35e; color: var(--ink); font-family: var(--ui); overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { font-family: inherit; color: inherit; cursor: pointer; }
#world { position: fixed; inset: 0; touch-action: none; display: block; }

/* ---------- HUD */
.hud { position: fixed; top: calc(8px + var(--sat)); left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; z-index: 5; }
.hud-l, .hud-r { display: flex; gap: 6px; flex-wrap: wrap; pointer-events: auto; }
.pill { display: flex; align-items: center; gap: 6px; background: rgba(255, 250, 240, .95); border-radius: 999px; padding: 6px 12px 6px 7px; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); font-size: 17px; }
.pill b { font-weight: 800; letter-spacing: .01em; }
.coin-ic { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3a8, #f5c12e 55%, #c99a1a); box-shadow: inset 0 0 0 2px #d9a823; }
.yog-ic { width: 20px; height: 22px; background: linear-gradient(#fff 0 30%, #ff7eb6 30% 70%, #fff 70%); clip-path: polygon(8% 12%, 92% 12%, 80% 100%, 20% 100%); border-top: 4px solid #e8e9ef; border-radius: 3px; }
.fare { font-size: 14px; padding: 6px 12px; color: var(--soft); }
.fare.ok { color: var(--good); background: #eaf8ec; }
.hb { pointer-events: auto; border: 0; background: rgba(255, 250, 240, .95); border-radius: 14px; min-width: 46px; height: 46px; font-size: 20px; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 10px; }
.hb span { font-size: 15px; font-weight: 800; }
.hb:active { transform: translateY(1px); box-shadow: none; }
.quest { position: fixed; left: 50%; transform: translateX(-50%); top: calc(64px + var(--sat)); max-width: min(92vw, 520px); background: rgba(45, 42, 58, .78); color: #fff; padding: 7px 14px; border-radius: 14px; font-size: 14px; line-height: 1.3; text-align: center; pointer-events: none; z-index: 4; }
.progress { position: fixed; left: calc(8px + var(--sal)); bottom: calc(8px + var(--sab)); display: flex; flex-direction: column; gap: 4px; pointer-events: none; z-index: 4; }
.pg { display: flex; align-items: center; gap: 8px; background: rgba(255, 250, 240, .9); border-radius: 10px; padding: 3px 9px; font-size: 12px; font-weight: 800; }
.pg i { display: flex; gap: 3px; }
.pg em { width: 10px; height: 10px; border-radius: 50%; background: #ddd5c4; }
.pg.maths em.on { background: var(--maths); } .pg.phonics em.on { background: var(--phonics); } .pg.story em.on { background: var(--story); }
.pg.full { outline: 2px solid var(--good); }
#toast { position: fixed; left: 50%; bottom: calc(18px + var(--sab)); transform: translate(-50%, 30px); opacity: 0; transition: .3s; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 16px; font-size: 15px; max-width: min(92vw, 520px); text-align: center; z-index: 30; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.rotate-tip { display: none; }

/* ---------- modals */
#layer { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.modal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: calc(10px + var(--sat)) 10px calc(10px + var(--sab)); background: rgba(30, 25, 50, .38); opacity: 0; transition: opacity .18s; pointer-events: auto; }
.modal.in { opacity: 1; }
.card { width: 100%; max-width: 580px; max-height: 100%; overflow: auto; background: var(--card); border-radius: 24px; padding: 16px 18px 18px; box-shadow: 0 8px 0 rgba(0, 0, 0, .12), 0 20px 50px rgba(0, 0, 0, .25); transform: translateY(14px) scale(.98); transition: transform .2s; -webkit-user-select: text; user-select: text; }
.modal.in .card { transform: none; }
.card h2, .card h3 { margin: 4px 0 8px; } .card h3 { font-size: 22px; } .card h4 { margin: 16px 0 4px; }
.card.shake { animation: shake .35s; }
.card.good { box-shadow: 0 0 0 5px var(--good), 0 20px 50px rgba(0, 0, 0, .25); }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.small { font-size: 13px; color: var(--soft); line-height: 1.4; }
.btn { border: 0; border-radius: 16px; padding: 12px 18px; font-size: 18px; font-weight: 800; background: #efe6d4; box-shadow: 0 3px 0 #d6c9ad; min-height: 50px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 3px 0 var(--primaryDk); }
.btn.small { font-size: 14px; min-height: 38px; padding: 8px 12px; }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn:disabled { opacity: .5; }
.btn.holding { background: var(--sun); }
.dbtns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.say, .x { border: 0; background: #efe6d4; border-radius: 12px; width: 42px; height: 42px; font-size: 18px; flex: none; }
.x { background: transparent; color: var(--soft); }

/* talking box: sits at the bottom so the world stays visible */
.modal.talk { align-items: flex-end; background: rgba(30, 25, 50, .15); }
.dlg .who { display: flex; align-items: center; gap: 10px; }
.dlg .who b { font-size: 18px; flex: 1; }
.face { font-size: 30px; width: 48px; height: 48px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 2px var(--line); flex: none; }
.dtext { font-family: var(--read); font-size: 21px; line-height: 1.45; margin: 10px 2px 0; }

/* ---------- questions */
.qhead { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.chip { border-radius: 999px; padding: 6px 12px; color: #fff; font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.maths { background: var(--maths); } .chip.phonics { background: var(--phonics); } .chip.story { background: var(--story); }
.pips { display: flex; gap: 4px; flex: 1; }
.pips em { width: 11px; height: 11px; border-radius: 50%; background: #ddd5c4; }
.pips em.on { background: var(--good); } .pips em.now { background: var(--sun); box-shadow: 0 0 0 2px #e0b62a; }
.scene { display: flex; justify-content: center; margin: 4px 0 6px; }
.scene:empty { display: none; }
.emo { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.grp { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 250px; background: #fff; border-radius: 16px; padding: 8px 10px; box-shadow: inset 0 0 0 2px var(--line); position: relative; }
.grp span { font-size: 34px; line-height: 1.15; }
.grp.many span { font-size: 26px; }
.grp.box { padding: 4px 6px; } .grp.box span { font-size: 20px; }
.grp.huge span { font-size: 72px; }
.grp span.gone { opacity: .35; position: relative; }
.grp span.gone::after { content: ''; position: absolute; left: 6%; right: 6%; top: 50%; height: 4px; background: var(--bad); border-radius: 2px; transform: rotate(-35deg); }
.grp .tag { position: absolute; bottom: -10px; right: -6px; background: var(--sun); font-style: normal; font-weight: 800; font-size: 14px; border-radius: 8px; padding: 2px 6px; }
.plus { font-size: 30px; color: var(--soft); }
.woodsign { background: linear-gradient(#d9a46a, #c48a4f); border-radius: 12px; padding: 12px 26px; box-shadow: inset 0 0 0 3px #8a5a33, 0 6px 0 #8a5a33; position: relative; margin-bottom: 18px; }
.woodsign::after { content: ''; position: absolute; left: 50%; bottom: -24px; width: 10px; height: 20px; background: #8a5a33; transform: translateX(-50%); }
.woodsign span { font-family: var(--read); font-size: 38px; font-weight: 700; color: #fffbe9; text-shadow: 0 2px 0 #7a4a23; letter-spacing: .02em; }
.seq { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.seq span { min-width: 50px; text-align: center; background: #fff; border-radius: 12px; padding: 8px 12px; font-size: 26px; font-weight: 800; box-shadow: inset 0 0 0 2px var(--line); }
.seq span.gap { background: #fff6d6; box-shadow: inset 0 0 0 3px var(--sun); }
.seq span.op { background: none; box-shadow: none; min-width: 0; padding: 8px 2px; }
.page { position: relative; background: #fff; border-radius: 6px 16px 16px 6px; padding: 16px 52px 16px 20px; box-shadow: inset 6px 0 0 #e9ddff, inset 0 0 0 2px #e6dcf5; width: 100%; }
.page p { margin: 0; font-family: var(--read); font-size: 24px; line-height: 1.5; }
.page .blank { display: inline-block; min-width: 70px; border-bottom: 3px solid var(--story); text-align: center; color: var(--story); }
.page .mini { position: absolute; right: 8px; top: 8px; border: 0; background: #f2ebff; border-radius: 10px; width: 38px; height: 38px; font-size: 17px; }
.page.peek { text-align: center; padding: 12px; }
.ask { font-size: 21px; font-weight: 700; line-height: 1.35; margin: 10px 2px 12px; text-align: center; }
.answers.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answers.choice.long { grid-template-columns: 1fr; }
.opt { border: 0; background: #fff; border-radius: 16px; padding: 14px 10px; font-size: 22px; font-weight: 700; box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 var(--line); min-height: 60px; font-family: var(--read); }
.answers.long .opt { font-size: 18px; text-align: left; padding: 12px 16px; }
.answers.big .opt { font-size: 46px; min-height: 90px; }
.answers.signs .opt { background: linear-gradient(#fff3dc, #ffe6bb); box-shadow: inset 0 0 0 2px #d9a46a, 0 3px 0 #d9a46a; }
.opt:active { transform: translateY(2px); }
.opt.right { background: #dff5e3 !important; box-shadow: inset 0 0 0 3px var(--good) !important; }
.opt.wrong { background: #fde3e1 !important; box-shadow: inset 0 0 0 3px var(--bad) !important; opacity: .7; }
.answers.lock { pointer-events: none; }
.fb .hint, .fb .why, .fb .yay { margin-top: 12px; border-radius: 14px; padding: 10px 14px; font-size: 17px; line-height: 1.4; }
.fb .hint { background: #fff6d6; }
.fb .why { background: #eef4ff; } .fb .why .btn { margin-top: 10px; }
.fb .yay { background: #dff5e3; color: var(--good); font-weight: 800; font-size: 22px; text-align: center; }
.answers.num { display: grid; grid-template-columns: 1fr; gap: 10px; justify-items: center; }
.display { display: flex; align-items: center; gap: 6px; background: #fff; min-width: 200px; justify-content: center; border-radius: 14px; padding: 8px 16px; box-shadow: inset 0 0 0 3px var(--maths); font-size: 34px; font-weight: 800; min-height: 60px; }
.display i { font-style: normal; color: var(--soft); font-size: 26px; }
.pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 8px; }
.pad button { border: 0; background: #fff; border-radius: 14px; height: 56px; font-size: 26px; font-weight: 800; box-shadow: 0 3px 0 var(--line), inset 0 0 0 2px var(--line); }
.pad button:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px var(--line); }
.answers.num .go { width: 232px; }
.answers.order .line { min-height: 58px; background: #fff; border-radius: 14px; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; box-shadow: inset 0 0 0 2px var(--line); margin-bottom: 10px; align-items: center; }
.answers.order .pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 8px; }
.chip-w { border: 0; background: #f2ebff; border-radius: 12px; padding: 10px 14px; font-family: var(--read); font-size: 22px; font-weight: 700; box-shadow: 0 3px 0 #d9ccf3; }
.chip-w.on { background: #9b6ad6; color: #fff; box-shadow: none; }
.chip-w:disabled { opacity: .25; }
.ph { color: var(--soft); font-size: 15px; padding: 0 6px; }
.fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .8em; line-height: 1; margin: 0 2px; }
.fr span:first-child { border-bottom: 2px solid currentColor; padding: 0 2px 1px; }

/* ---------- paying with coins */
.payhead, .shophead { display: flex; align-items: center; gap: 10px; }
.payhead h3, .shophead h3 { flex: 1; margin: 0; }
.shophead p { margin: 2px 0 0; color: var(--soft); }
.shophead > div { flex: 1; }
.tray { min-height: 76px; background: #f3ead6; border-radius: 16px; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .08); }
.total { text-align: center; margin: 8px 0; font-size: 18px; }
.coins { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.coinb { border: 0; width: 62px; height: 62px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; color: #4a3a1a; box-shadow: 0 3px 0 rgba(0, 0, 0, .2), inset 0 0 0 3px rgba(0, 0, 0, .12); flex: none; }
.coinb span { text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.coinb.c1, .coinb.c2 { background: radial-gradient(circle at 35% 30%, #f6b98a, #c87a45 60%, #a35b2c); width: 50px; height: 50px; }
.coinb.c2 { width: 58px; height: 58px; }
.coinb.c5, .coinb.c10 { background: radial-gradient(circle at 35% 30%, #fff, #c9ccd4 60%, #9aa0a8); width: 48px; height: 48px; }
.coinb.c10 { width: 60px; height: 60px; }
.coinb.c20, .coinb.c50 { background: radial-gradient(circle at 35% 30%, #fff, #c9ccd4 60%, #9aa0a8); border-radius: 0; clip-path: polygon(50% 0, 89% 19%, 98% 61%, 72% 95%, 28% 95%, 2% 61%, 11% 19%); }
.coinb.c20 { width: 56px; height: 56px; } .coinb.c50 { width: 66px; height: 66px; }
.coinb.c100 { background: radial-gradient(circle at 35% 30%, #fff6b0, #e3b52a 60%, #b8901c); width: 58px; height: 58px; }
.coinb.c200 { background: radial-gradient(circle, #e3b52a 0 42%, #c9ccd4 43%); width: 66px; height: 66px; }
.tray .coinb { transform: scale(.85); }

/* ---------- shop */
.have { text-align: center; font-size: 17px; margin: 12px 0; }
.shelf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; background: linear-gradient(#fff 0 85%, #e2c99c 85%); border-radius: 16px; padding: 10px; }
.yogb { border: 0; background: #fff; border-radius: 16px; padding: 8px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 var(--line); }
.yogb canvas { width: 60px; height: 60px; }
.yogb b { font-size: 15px; }
.price { background: var(--sun); border-radius: 8px; padding: 2px 8px; font-weight: 800; font-size: 17px; }
@media (max-width: 460px) { .shelf { grid-template-columns: 1fr 1fr; } }

/* ---------- level complete */
.done { text-align: center; }
.done h2 { font-size: 30px; }
.busride { position: relative; height: 70px; overflow: hidden; border-radius: 14px; background: linear-gradient(#bfe6ff 0 60%, #7dc35e 60%); }
.busride .road { position: absolute; left: 0; right: 0; bottom: 8px; height: 14px; background: #5d6370; }
.busride .busimg { position: absolute; bottom: 10px; font-size: 44px; animation: drive 3s linear infinite; transform: scaleX(-1); }
@keyframes drive { from { left: -60px; } to { left: 100%; } }
.piggy { font-size: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.stats div { background: #fff; border-radius: 14px; padding: 10px 4px; box-shadow: inset 0 0 0 2px var(--line); }
.stats b { display: block; font-size: 22px; } .stats span { font-size: 12px; color: var(--soft); }
@media (max-width: 460px) { .stats { grid-template-columns: 1fr 1fr; } }

/* ---------- menu, grown-ups */
.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu .btn { font-size: 16px; }
.row { display: flex; gap: 10px; align-items: center; font-weight: 700; flex-wrap: wrap; }
select, textarea, input[type=text] { font: inherit; font-size: 16px; border-radius: 12px; border: 2px solid var(--line); padding: 8px 10px; background: #fff; }
textarea { width: 100%; margin-top: 8px; font-size: 12px; font-family: ui-monospace, monospace; }

/* ---------- mini-games */
.mini { position: fixed; inset: 0; z-index: 40; background: #222; touch-action: none; }
.mini canvas { position: absolute; inset: 0; display: block; }
.mbar { position: absolute; top: calc(8px + var(--sat)); left: 50%; transform: translateX(-50%); display: flex; gap: 14px; align-items: center; background: rgba(255, 250, 240, .95); border-radius: 999px; padding: 8px 18px; font-size: 18px; box-shadow: 0 3px 0 rgba(0, 0, 0, .15); white-space: nowrap; }
.mbar .ms { font-weight: 800; color: var(--primaryDk); }
.mcard { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 440px); background: var(--card); border-radius: 24px; padding: 20px; text-align: center; box-shadow: 0 8px 0 rgba(0, 0, 0, .15), 0 20px 50px rgba(0, 0, 0, .3); }
.mcard p { font-size: 18px; line-height: 1.45; }
.mcard .dbtns { justify-content: center; }

@media (max-height: 560px) {
  .card { padding: 10px 14px; border-radius: 18px; }
  .ask { font-size: 18px; margin: 6px 2px 8px; }
  .grp span { font-size: 26px; } .grp.huge span { font-size: 48px; }
  .woodsign span { font-size: 28px; } .page p { font-size: 20px; }
  .pad { grid-template-columns: repeat(6, 54px); } .pad button { height: 46px; font-size: 22px; }
  .opt { min-height: 48px; padding: 8px; font-size: 19px; } .answers.big .opt { font-size: 36px; min-height: 64px; }
  .quest { top: calc(60px + var(--sat)); font-size: 13px; }
}
@media (max-width: 520px) { .page p { font-size: 19px; } .page { padding: 12px 46px 12px 14px; } .ask { font-size: 18px; } .answers.long .opt { font-size: 16px; padding: 10px 12px; min-height: 48px; } .hb span { display: none; } .fare { display: none; } .pill { font-size: 15px; } }

/* ---------- cafe orders job */
.cafeui { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 8px 8px calc(8px + var(--sab)); pointer-events: none; align-items: center; }
.cafeui[hidden] { display: none; }
.cafeui > * { pointer-events: auto; }
.cbubble { position: absolute; top: calc(70px + var(--sat)); left: 50%; transform: translateX(-50%); width: min(94vw, 430px); background: #fff; border-radius: 20px; padding: 12px 16px; font-family: var(--read); font-size: 22px; line-height: 1.35; text-align: center; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); font-weight: 700; }
.cbubble::after { content: ''; position: absolute; left: 50%; bottom: -12px; margin-left: -12px; border: 12px solid transparent; border-bottom: 0; border-top-color: #fff; }
.cplate { width: min(96vw, 560px); display: flex; gap: 8px; align-items: center; background: rgba(255, 250, 240, .96); border-radius: 18px; padding: 8px 10px; box-shadow: 0 3px 0 rgba(0, 0, 0, .12); }
.chips { flex: 1; min-height: 52px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pchip { border: 0; background: #fff; font-size: 28px; border-radius: 12px; width: 44px; height: 44px; box-shadow: inset 0 0 0 2px var(--line); }
.cmenu { width: min(96vw, 560px); display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.citem { border: 0; background: #fff; border-radius: 16px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 var(--line); }
.citem span { font-size: 32px; line-height: 1.1; } .citem b { font-size: 14px; font-family: var(--read); }
.citem:active { transform: translateY(2px); }
@media (max-height: 560px) { .cbubble { font-size: 18px; padding: 8px 12px; } .citem span { font-size: 24px; } .pchip { width: 36px; height: 36px; font-size: 22px; } }

/* ---------- scratchpad (maths questions) */
.penbtn { border: 0; background: #fff1c2; border-radius: 12px; width: 42px; height: 42px; flex: none; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 2px #f2dc8a; }
.penbtn.on { background: #ffc83a; box-shadow: inset 0 0 0 2px #e0a81a, 0 2px 0 #c9921a; }
.scrib { margin: 0 0 10px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); overflow: hidden; }
.scrib .scrcv { display: block; width: 100%; height: clamp(120px, 24vh, 230px); touch-action: none; cursor: crosshair; background-color: #fffdf6; background-image: repeating-linear-gradient(transparent 0 31px, #e6ecf7 31px 32px); }
.scrbar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: #f6efe0; border-top: 2px solid var(--line); flex-wrap: wrap; }
.scrbar .sb { border: 0; background: #fff; border-radius: 12px; min-height: 40px; padding: 4px 10px; font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; gap: 5px; box-shadow: inset 0 0 0 2px var(--line); }
.scrbar .sb.on { background: #ffe9a8; box-shadow: inset 0 0 0 2px #e0a81a; }
.scrbar .scols { display: flex; gap: 6px; margin: 0 4px; }
.scrbar .scd { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); display: block; }
.scrbar .scd.on { box-shadow: 0 0 0 3px var(--ink); }
.scrbar .sb:last-child { margin-left: auto; }
@media (max-width: 520px) { .scrbar .sb span { display: none; } .scrbar .sb:last-child span { display: inline; } }

/* icon-only buttons: centre the picture */
.say, .x, .penbtn { display: flex; align-items: center; justify-content: center; padding: 0; line-height: 1; }
.say .icw, .say img.ic, .mini img.ic, button > .icw > img.ic:only-child { display: block; vertical-align: middle; }
.say img.ic { width: 26px; height: 26px; }

/* One-Minute Maths (mathsdash) number pad */
.mdui { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 8px 8px calc(10px + var(--sab)); pointer-events: none; }
.mdui[hidden] { display: none; }
.mdui > * { pointer-events: auto; }
.mdui.side { top: 0; left: auto; right: 0; width: 40%; align-items: center; }
.kp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(92vw, 330px); background: rgba(255,250,240,.92); padding: 10px; border-radius: 22px; box-shadow: 0 6px 0 rgba(0,0,0,.12), inset 0 0 0 2px var(--line); }
.kb { border: 0; background: #fff; border-radius: 16px; font: 800 30px var(--read, DMMRound), ui-rounded, sans-serif; height: clamp(48px, 8.4vh, 66px); color: #3b2b4a; box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--line); touch-action: manipulation; }
.kb:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--line), 0 1px 0 var(--line); }
.kb.go { background: #2e9d4a; color: #fff; box-shadow: 0 4px 0 #1f6e33; }
.kb.del { background: #ffe3e0; color: #c9392e; }
.chs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: min(94vw, 440px); background: rgba(255,250,240,.92); padding: 10px; border-radius: 22px; box-shadow: 0 6px 0 rgba(0,0,0,.12); }
.chb { border: 0; background: #fff; border-radius: 18px; font: 800 40px var(--read, DMMRound), ui-rounded, sans-serif; height: 78px; color: #3b2b4a; box-shadow: inset 0 0 0 2px var(--line), 0 5px 0 var(--line); touch-action: manipulation; }
.chb:active { transform: translateY(3px); }
@media (max-height: 640px) { .kb { height: 44px; font-size: 24px; } .kp { gap: 6px; padding: 8px; } }
