:root {
  --bg: #FFF7E8;
  --ink: #2B2140;
  --muted: #6F6585;
  --card: #FFFFFF;
  --line: #EBDDC6;
  --purple: #6C4AB6;
  --purple-d: #4E3291;
  --purple-l: #F1ECFF;
  --good: #16A05F;
  --good-l: #E2F6EA;
  --warn: #C46A00;
  --warn-l: #FFF0D2;
  --bad: #D9442A;
  --bad-l: #FFE4DD;
  --star: #FFB81F;
  --w: #6C4AB6;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: "Nunito", "Baloo 2", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) 16px max(10px, env(safe-area-inset-bottom));
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; font-weight: 900; }
h2 { font-size: 22px; font-weight: 900; }
h3 { font-size: 18px; font-weight: 800; }
.small { font-size: 15px; color: var(--muted); }
[hidden] { display: none !important; }

.screen { flex: 1; display: flex; flex-direction: column; gap: 14px; }

/* ---------- buttons ---------- */
.btn {
  border: 0;
  border-radius: 18px;
  padding: 14px 20px;
  background: var(--purple);
  color: #fff;
  font-weight: 900;
  font-size: 20px;
  box-shadow: 0 5px 0 var(--purple-d);
  transition: transform .06s, box-shadow .06s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--purple-d); }
.btn.big { font-size: 24px; padding: 18px 24px; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: 0 4px 0 var(--line); border: 2px solid var(--line); }
.btn.ghost:active { box-shadow: 0 1px 0 var(--line); }
.btn.green { background: var(--good); box-shadow: 0 5px 0 #0C7442; }
.btn.danger { background: var(--bad); box-shadow: 0 5px 0 #A52E19; }
.btn.small { font-size: 16px; padding: 10px 14px; border-radius: 14px; }
.link { background: none; border: 0; color: var(--purple); text-decoration: underline; font-weight: 800; padding: 6px; }

/* ---------- header, pills, nav ---------- */
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hi { font-size: 28px; font-weight: 900; }
.sub { color: var(--muted); font-size: 16px; }
.starpill { background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 900; font-size: 20px; white-space: nowrap; }
.starpill.sm { font-size: 17px; padding: 4px 12px; }
.nav { display: flex; gap: 8px; margin-top: 16px; position: sticky; bottom: 0; background: var(--bg); padding-top: 8px; }
.nav button { flex: 1; border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 8px 4px; font-size: 22px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.nav button span { font-size: 13px; font-weight: 800; color: var(--muted); }
.nav button.on { border-color: var(--purple); background: var(--purple-l); }
.nav button.on span { color: var(--purple); }

/* ---------- home ---------- */
.quest {
  display: block; width: 100%; text-align: left; border: 0; border-radius: 24px; padding: 18px 20px;
  background: var(--purple); color: #fff; box-shadow: 0 6px 0 var(--purple-d); position: relative; overflow: hidden;
}
.quest::after { content: "🗺️"; position: absolute; right: 14px; top: 10px; font-size: 54px; opacity: .9; }
.quest .qt { font-size: 26px; font-weight: 900; }
.quest .qs { font-size: 16px; opacity: .9; }
.quest .qgo { display: inline-block; margin-top: 12px; background: var(--star); color: #4A2E00; border-radius: 999px; padding: 8px 18px; font-weight: 900; font-size: 20px; }
.quest.done { background: var(--good-l); color: #0B5E37; box-shadow: none; border: 2px solid #A9E3C3; }
.quest.done::after { content: "🏆"; }
.worlds { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wtile { border: 0; border-radius: 22px; padding: 14px; text-align: left; background: var(--w); color: #fff; box-shadow: 0 5px 0 rgba(0,0,0,.18); min-height: 128px; display: flex; flex-direction: column; justify-content: space-between; }
.wtile:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.wicon { font-size: 38px; }
.wname { font-size: 20px; font-weight: 900; }
.wsub { font-size: 14px; opacity: .92; }
.wbar { height: 8px; background: rgba(255,255,255,.35); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.wbar i { display: block; height: 100%; background: #fff; border-radius: 99px; }
.wtile.soon { background: #ECE6DA; color: var(--muted); box-shadow: none; }

/* ---------- world path ---------- */
.whead { display: flex; align-items: center; gap: 12px; }
.back { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 22px; flex: none; }
.wtitle { font-size: 26px; font-weight: 900; color: var(--w); }
.stones { display: flex; flex-direction: column; gap: 10px; }
.stone { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border-radius: 18px; padding: 10px 12px; border: 2px solid var(--line); background: #fff; }
.stone:nth-child(even) { margin-left: 22px; width: calc(100% - 22px); }
.stone .snum { width: 38px; height: 38px; border-radius: 50%; background: var(--w); color: #fff; display: grid; place-items: center; font-weight: 900; flex: none; }
.stone .sname { flex: 1; font-weight: 800; font-size: 17px; }
.stone .sbadge { font-size: 18px; white-space: nowrap; }
.stone.l { background: #F3EEE4; color: #9C93AC; }
.stone.l .snum { background: #CFC6B8; }
.stone.m { border-color: #F5D27A; background: #FFF8E1; }
.stepdots i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #E3DCEF; margin-left: 3px; }
.stepdots i.on { background: var(--w); }
.band { font-size: 12px; font-weight: 900; border-radius: 6px; padding: 1px 6px; background: var(--purple-l); color: var(--purple); margin-left: 6px; }

/* ---------- game ---------- */
.game { gap: 12px; user-select: none; -webkit-user-select: none; }
.gtop { display: flex; align-items: center; gap: 10px; }
.xbtn { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 20px; flex: none; }
.dots { flex: 1; display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: #E7DFD1; }
.dots i.done { background: var(--w); }
.dots i.now { background: var(--star); transform: scale(1.25); }
.rlabel { text-align: center; color: var(--w); font-weight: 900; font-size: 15px; letter-spacing: .02em; }
.prompt { display: flex; gap: 10px; align-items: flex-start; background: #fff; border-radius: 20px; padding: 12px 14px; border: 2px solid var(--line); }
.prompt p { font-size: 21px; font-weight: 800; flex: 1; padding-top: 4px; }
.spk { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--purple-l); font-size: 20px; flex: none; }
.visual { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.visual:empty { display: none; }
.hintbox { background: var(--warn-l); border: 2px dashed #F1C27A; border-radius: 18px; padding: 10px 14px; font-size: 18px; color: #6A4300; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.answer { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gact { display: flex; gap: 10px; justify-content: center; margin-top: auto; padding-top: 4px; }
.gact .btn { flex: 1; max-width: 240px; }
.feedback { position: sticky; bottom: 0; border-radius: 20px; padding: 12px 16px; font-size: 20px; font-weight: 900; display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; animation: pop .25s ease-out; }
.feedback.good { background: var(--good-l); color: #0B5E37; border: 2px solid #9EDDBB; }
.feedback.warn { background: var(--warn-l); color: #6A4300; border: 2px solid #F1C27A; }
.feedback.reveal { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.feedback.neutral { background: var(--purple-l); color: var(--purple); border: 2px solid #D5C8FA; }
.feedback .fx { font-size: 16px; font-weight: 700; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.shake { animation: shake .3s; }

/* multiple choice */
.mc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.opt { background: #fff; border: 3px solid var(--line); border-radius: 20px; padding: 14px 8px; font-size: 30px; font-weight: 900; box-shadow: 0 5px 0 var(--line); min-height: 72px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.opt:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--line); }
.mc.emoji .opt { font-size: 44px; }
.mc.words .opt { font-size: 22px; }
.opt.off { opacity: .35; pointer-events: none; }
.opt.right { border-color: var(--good); background: var(--good-l); box-shadow: 0 5px 0 #9EDDBB; }
.opt .money { transform: scale(.9); }

/* keypad */
.numdisp { min-width: 140px; text-align: center; font-size: 44px; font-weight: 900; background: #fff; border: 3px solid var(--w); border-radius: 18px; padding: 4px 20px; }
.numdisp.right { border-color: var(--good); background: var(--good-l); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 340px; }
.key { height: 60px; border-radius: 16px; border: 2px solid var(--line); background: #fff; font-size: 28px; font-weight: 900; box-shadow: 0 4px 0 var(--line); }
.key:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.key.ok { background: var(--good); color: #fff; border-color: var(--good); box-shadow: 0 4px 0 #0C7442; }
.key.fn { background: #F6F1E8; }

/* objects, frames, blocks */
.objs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; max-width: 100%; }
.grp { display: inline-flex; gap: 2px; }
.obj { font-size: 34px; line-height: 1.1; position: relative; display: inline-flex; flex-direction: column; align-items: center; }
.obj b { font-size: 13px; color: var(--muted); }
.objs.tap .obj { cursor: pointer; }
.obj.done { opacity: .3; transform: scale(.88); }
.obj.gone { opacity: .35; }
.obj.gone::after { content: "✕"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--bad); font-size: 30px; font-weight: 900; }
.objs.scatter { position: relative; width: 100%; height: 240px; background: #fff; border-radius: 18px; border: 2px solid var(--line); }
.objs.scatter .obj { position: absolute; }
.tf { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; width: 250px; background: #fff; padding: 6px; border-radius: 14px; border: 3px solid #CDBEF2; }
.tf i { aspect-ratio: 1; border-radius: 10px; background: #F7F3FF; position: relative; }
.tf i.on::after, .tf i.on2::after, .tf i.mine::after { content: ""; position: absolute; inset: 18%; border-radius: 50%; background: #E2563B; }
.tf i.on2::after { background: #3B82E2; }
.tf i.mine::after { background: #16A05F; }
.tf.tap i:not(.on) { cursor: pointer; }
.tf.flash.hidden i::after { display: none; }
.b10 { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; justify-content: center; }
.b10 .flat { width: 62px; height: 62px; background-color: #FFC35A; border: 2px solid #C98A1A; border-radius: 4px; background-image: linear-gradient(#C98A1A 1px, transparent 1px), linear-gradient(90deg, #C98A1A 1px, transparent 1px); background-size: 6px 6px; }
.b10 .rod { width: 13px; height: 62px; background-color: #5B9BFF; border: 2px solid #2F6BD1; border-radius: 3px; background-image: linear-gradient(#2F6BD1 1px, transparent 1px); background-size: 100% 6px; }
.b10 .cubes { display: flex; flex-direction: column-reverse; flex-wrap: wrap; height: 66px; gap: 2px; align-content: flex-start; }
.b10 .cube { width: 13px; height: 13px; background: #34C27A; border: 2px solid #148A4F; border-radius: 3px; }

/* money */
.money { display: inline-grid; place-items: center; font-weight: 900; color: #3A2A00; flex: none; }
.money.coin { width: 56px; height: 56px; border-radius: 50%; border: 3px solid rgba(0,0,0,.18); font-size: 13px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.08); }
.money.note { width: 96px; height: 52px; border-radius: 8px; border: 3px solid rgba(0,0,0,.15); font-size: 16px; }
.money.m1 { background: #E6C29A; }
.money.m2 { background: #D9DEE5; }
.money.m5 { background: #F3D16E; }
.money.coin.m10 { background: #F3D16E; border: 6px solid #CDD3DB; }
.money.note.m10 { background: #7CC98A; }
.money.m20 { background: #F6AE63; }
.money.m50 { background: #B796E3; }
.money.m100 { background: #EC8B83; }
.moneyrow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.bigmoney { transform: scale(1.6); margin: 18px; }

/* number paths, equations, cards */
.path { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pstone { min-width: 56px; height: 56px; border-radius: 16px; background: #fff; border: 3px solid var(--w); display: grid; place-items: center; font-size: 24px; font-weight: 900; padding: 0 6px; }
.pstone.ask { background: #FFF3C4; border-style: dashed; border-color: #E0A800; }
.eq { font-size: 40px; font-weight: 900; letter-spacing: .02em; text-align: center; }
.q { display: inline-block; min-width: 46px; border-bottom: 5px solid var(--w); color: var(--w); text-align: center; }
.card { background: #fff; border-radius: 18px; border: 2px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.pair { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.big { font-size: 46px; font-weight: 900; }
.num { font-size: 26px; font-weight: 900; }
.op { font-size: 34px; font-weight: 900; color: var(--w); }
.croc { font-size: 50px; line-height: 1; }
.mirror { flex-wrap: nowrap; gap: 6px; }
.mirror .objs { gap: 4px; }
.mirror .grp { gap: 0; }
.mirror .obj { font-size: 24px; }
.mirror .mirrorbar { width: 6px; align-self: stretch; background: #9CC6F0; border-radius: 4px; flex: none; }
.shopitem { display: flex; flex-direction: column; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 8px 12px; }
.shopitem .big { font-size: 48px; line-height: 1.1; }
.tag { background: var(--star); color: #4A2E00; border-radius: 10px; padding: 2px 10px; font-weight: 900; font-size: 18px; transform: rotate(-3deg); }
.itemsrow { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.groups { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.basket { background: #FCE6C6; border: 3px solid #C68A4A; border-radius: 12px 12px 30px 30px; padding: 8px 10px 12px; }
.basket .obj { font-size: 24px; }
.balance { display: flex; flex-direction: column; align-items: center; width: 100%; }
.balance .pans { display: flex; justify-content: space-between; width: 100%; max-width: 360px; gap: 10px; }
.balance .pan { flex: 1; background: #fff; border: 3px solid #8E7BC9; border-radius: 12px 12px 40px 40px; padding: 14px 6px; text-align: center; font-size: 28px; font-weight: 900; }
.balance .beam { width: 90%; max-width: 340px; height: 8px; background: #8E7BC9; border-radius: 4px; margin-top: 4px; }
.balance .stand { width: 0; height: 0; border-left: 26px solid transparent; border-right: 26px solid transparent; border-bottom: 40px solid #8E7BC9; }
.pie { width: 170px; height: 170px; }
.pie .sh { fill: #E59A2E; stroke: #9C5E12; stroke-width: 2; }
.pie .pl { fill: #FCE3B2; stroke: #9C5E12; stroke-width: 2; }
.hc { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; width: 100%; max-width: 360px; }
.hc i { font-style: normal; font-size: 12px; font-weight: 800; text-align: center; padding: 4px 0; background: #fff; border-radius: 4px; }
.hc i.hl { background: var(--w); color: #fff; }
.mline { width: 300px; max-width: 100%; }
.mline .ax, .mline .tk { stroke: var(--purple); stroke-width: 3; }
.mline .tk { stroke-width: 2; }
.mline text { font-size: 16px; font-weight: 800; fill: var(--ink); }
.mline .mk { fill: #F0782A; }
.mline .mkt { fill: #C95A12; }
.tri { width: 280px; max-width: 100%; }
.tri .edge { stroke: #CDBEF2; stroke-width: 5; fill: none; }
.tri circle.full { fill: #fff; stroke: var(--purple); stroke-width: 3; }
.tri circle.blank { fill: #F5F0FF; stroke: #9C8AD0; stroke-width: 3; stroke-dasharray: 5 4; }
.tri circle.ask { fill: #FFE27A; stroke: #D69E00; stroke-width: 4; }
.tri text { font-size: 22px; font-weight: 900; fill: var(--ink); }
.machine { display: flex; flex-direction: column; gap: 6px; }
.mrow { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 900; }
.mrow .min, .mrow .mout { min-width: 54px; text-align: center; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 4px 8px; }
.mrow .mbox { background: var(--purple-l); border-radius: 10px; padding: 2px 8px; }
.mrow .marrow { color: var(--muted); }
.clues { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px 10px 36px; margin: 0; font-size: 18px; width: 100%; }
.clues li { margin: 4px 0; }
.petrow { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.kid { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 4px 10px; font-size: 16px; }
.pet { font-size: 34px; }

/* coins activity */
.tray { width: 100%; min-height: 84px; border: 3px dashed #CDBEF2; border-radius: 18px; background: #fff; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; padding: 8px; }
.trayhint { color: var(--muted); font-size: 15px; }
.tcoin, .pbtn { border: 0; background: none; padding: 0; }
.tcoin .money.coin { width: 48px; height: 48px; font-size: 12px; }
.tcoin .money.note { width: 80px; height: 44px; font-size: 14px; }
.traytotal { font-size: 22px; font-weight: 900; color: var(--purple); }
.palette { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pbtn:active { transform: scale(.92); }

/* build activity */
.target { font-size: 48px; font-weight: 900; color: var(--w); }
.builder { display: flex; gap: 10px; justify-content: center; width: 100%; }
.bcol { flex: 1; max-width: 160px; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bvis { min-height: 74px; display: flex; align-items: flex-end; }
.bctl { display: flex; align-items: center; gap: 8px; }
.bctl button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--w); color: #fff; font-size: 26px; font-weight: 900; }
.bctl b { font-size: 26px; min-width: 24px; text-align: center; }
.blabel { color: var(--muted); font-size: 15px; font-weight: 800; }
.bcol { min-width: 0; }
.builder.three { gap: 8px; }
.builder.three .bcol { padding: 8px 4px; }
.builder.three .bctl { gap: 4px; }
.builder.three .bctl button { width: 34px; height: 34px; font-size: 22px; }
.builder.three .bctl b { font-size: 22px; min-width: 18px; }
.builder.three .b10 .flat { width: 42px; height: 42px; background-size: 4.2px 4.2px; }
.builder.three .b10 .rod { height: 42px; background-size: 100% 4.2px; }
.builder.three .b10 .cubes { height: 46px; }
.bsum { font-size: 22px; font-weight: 900; color: var(--muted); }

/* number line */
.nline { width: 100%; max-width: 420px; touch-action: manipulation; }
.nline .ax { stroke: var(--purple); stroke-width: 4; }
.nline .tk { stroke: var(--purple); stroke-width: 2; }
.nline text { font-size: 14px; font-weight: 800; fill: var(--ink); }
.nline .flagpole { stroke: #444; stroke-width: 3; }
.nline .flag { fill: #E2563B; }
.nline .flag.ok { fill: var(--good); }

/* order activity */
.slots { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.slot { min-width: 64px; height: 60px; border-radius: 16px; border: 3px dashed #CDBEF2; background: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 900; }
.slot.full { border-style: solid; border-color: var(--w); }
.pool { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pnum { min-width: 72px; height: 64px; border-radius: 18px; border: 3px solid var(--line); background: #fff; font-size: 28px; font-weight: 900; box-shadow: 0 4px 0 var(--line); }
.pnum.used { opacity: .25; pointer-events: none; }

/* sudoku */
.sgrid { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; max-width: 300px; border: 4px solid var(--ink); border-radius: 12px; overflow: hidden; background: #fff; }
.sc { aspect-ratio: 1; border: 1px solid #D8CFC0; background: #fff; font-size: 30px; font-weight: 900; padding: 0; }
.sc:nth-child(4n+2) { border-right: 3px solid var(--ink); }
.sc:nth-child(n+5):nth-child(-n+8) { border-bottom: 3px solid var(--ink); }
.sc.given { background: #F2EEFA; color: var(--ink); }
.sc.sel { background: #FFF3C4; box-shadow: inset 0 0 0 3px #E0A800; }
.sc.bad { background: var(--bad-l); }
.sc.fill { color: var(--w); }
.spal { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.sp { width: 60px; height: 60px; border-radius: 16px; border: 3px solid var(--line); background: #fff; font-size: 30px; font-weight: 900; box-shadow: 0 4px 0 var(--line); }

/* banners and overlays */
.banner { align-items: center; justify-content: center; text-align: center; gap: 16px; }
.banner .bnum { color: var(--muted); font-weight: 900; }
.banner .bicon { font-size: 80px; }
.banner .btitle { font-size: 32px; font-weight: 900; color: var(--w); }
.overlay { position: fixed; inset: 0; background: rgba(43,33,64,.55); display: grid; place-items: center; z-index: 50; padding: 20px; }
.ocard { background: #fff; border-radius: 26px; padding: 22px; max-width: 400px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 12px; animation: pop .25s ease-out; }
.ocard .oicon { font-size: 64px; }
.obtns { display: flex; gap: 10px; justify-content: center; }
.obtns .btn { flex: 1; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 16px; font-weight: 800; z-index: 60; max-width: 90vw; text-align: center; animation: pop .2s ease-out; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 55; overflow: hidden; }
.confetti span { position: absolute; top: -40px; font-size: 28px; animation: fall 1.8s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(360deg); } }

/* summary, welcome, limit */
.center { align-items: center; text-align: center; justify-content: center; }
.bigstars { font-size: 56px; font-weight: 900; color: #B07800; }
.list { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.li { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; text-align: left; }
.logo { font-size: 80px; }
.field { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; font-weight: 800; }
input[type=text], input[type=password], select { font: inherit; font-size: 20px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus { outline: 3px solid #CDBEF2; }

/* city */
.city { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; background: #7DC65A; padding: 6px; border-radius: 18px; border: 3px solid #5DA43E; }
.tile { aspect-ratio: 1; border: 0; border-radius: 8px; background: #98D776; font-size: 30px; padding: 0; display: grid; place-items: center; }
.tile:nth-child(odd) { background: #92D16F; }
.tile.moving { background: #FFF3C4; box-shadow: inset 0 0 0 3px #E0A800; }
.city.holding .tile:empty { box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }
.shopbar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x proximity; }
.sitem { flex: none; width: 76px; border-radius: 16px; border: 2px solid var(--line); background: #fff; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; scroll-snap-align: start; }
.sitem .se { font-size: 32px; }
.sitem .sp2 { font-size: 13px; font-weight: 900; }
.sitem.locked { opacity: .45; }
.sitem.held { border-color: #E0A800; background: #FFF3C4; }
.cityhint { text-align: center; color: var(--muted); font-size: 15px; min-height: 20px; }
.holdbar { display: flex; gap: 8px; justify-content: center; }

/* parent */
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 10px 12px; }
.metric .ml { font-size: 13px; color: var(--muted); font-weight: 800; }
.metric .mv { font-size: 24px; font-weight: 900; }
.panel { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.panel h3 { display: flex; align-items: center; gap: 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row label { font-weight: 800; }
.row select { width: auto; min-width: 120px; font-size: 17px; padding: 8px 10px; }
.status { border-radius: 12px; padding: 10px 12px; font-weight: 800; font-size: 16px; }
.status.ok { background: var(--good-l); color: #0B5E37; }
.status.amber { background: var(--warn-l); color: #6A4300; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.btnrow .btn { flex: 1 1 140px; }
details { border-top: 2px solid #F3EADB; padding-top: 8px; }
summary { font-weight: 900; cursor: pointer; padding: 4px 0; }
.sk { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; padding: 4px 0; border-bottom: 1px solid #F3EADB; }
.sk span:last-child { color: var(--muted); white-space: nowrap; }
.pinpad { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pindots { display: flex; gap: 14px; }
.pindots i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--purple); }
.pindots i.on { background: var(--purple); }
.switch { width: 58px; height: 34px; border-radius: 99px; border: 0; background: #D9D1C4; position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--good); }
.switch.on::after { left: 28px; }

@media (min-width: 700px) {
  #app { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::after { animation: none !important; transition: none !important; }
}
