:root {
  --ink: #23264a;
  --ink-soft: #5a5f86;
  --paper: #ffffff;
  --sky1: #7fd0ff;
  --sky2: #d9f4ff;
  --grass1: #8be06a;
  --grass2: #5cc24a;
  --orange: #ff8a3d;
  --purple: #7c5cff;
  --green: #22b766;
  --green-soft: #e3f9ec;
  --red: #ff5a5f;
  --red-soft: #ffe8e8;
  --gold: #ffc531;
  --gold-dark: #e09a00;
  --pink: #ff7eb3;
  --shadow: 0 6px 0 rgba(35, 38, 74, .14);
  --radius: 22px;
  --zone: #ff8a3d;
  --zone-dark: #c2551a;
  font-size: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 55%, #eafbe0 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}
h1, h2, h3, .fred { font-family: "Fredoka", "Nunito", system-ui, sans-serif; letter-spacing: .2px; }
b { color: var(--zone-dark); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
input { font: inherit; }
img { -webkit-user-drag: none; }
#app { min-height: 100vh; min-height: 100dvh; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 999; width: 100%; height: 100%; }

.screen { min-height: 100vh; min-height: 100dvh; padding: 0 16px 40px; position: relative; animation: screenIn .35s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.wrap { max-width: 860px; margin: 0 auto; }

/* ---------- chunky buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 12px 26px; border-radius: 20px;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.25rem;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 6px 0 rgba(35,38,74,.18);
  transition: transform .08s ease, box-shadow .08s ease, filter .2s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(35,38,74,.18); }
.btn img { width: 36px; height: 36px; }
.btn.primary { background: var(--green); color: #fff; box-shadow: 0 6px 0 #158a4b; }
.btn.primary:active { box-shadow: 0 2px 0 #158a4b; }
.btn.orange { background: var(--orange); color: #fff; box-shadow: 0 6px 0 #c2551a; }
.btn.purple { background: var(--purple); color: #fff; box-shadow: 0 6px 0 #5537c7; }
.btn.gold { background: var(--gold); color: #5a3b00; box-shadow: 0 6px 0 var(--gold-dark); }
.btn.zone { background: var(--zone); color: #fff; box-shadow: 0 6px 0 var(--zone-dark); }
.btn.big { min-height: 76px; font-size: 1.5rem; padding: 14px 34px; border-radius: 26px; }
.btn.small { min-height: 46px; font-size: 1rem; padding: 8px 16px; border-radius: 16px; }
.btn:disabled { filter: grayscale(.8); opacity: .55; cursor: default; }
.icon-btn {
  width: 52px; height: 52px; border-radius: 16px; display: inline-grid; place-items: center;
  background: rgba(255,255,255,.9); box-shadow: 0 4px 0 rgba(35,38,74,.15); font-size: 1.5rem;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(35,38,74,.15); }
.icon-btn img { width: 34px; height: 34px; }
.speak { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #eef1ff; flex: none; }
.speak img { width: 28px; height: 28px; }
.speak.on { animation: pulse .8s ease infinite alternate; background: #dfe5ff; }
@keyframes pulse { to { transform: scale(1.12); } }

/* ---------- title ---------- */
.title-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-top: 30px; overflow: hidden; }
.title-logo { font-family: "Fredoka"; font-weight: 700; font-size: clamp(3rem, 12vw, 5.6rem); line-height: .95; color: #fff;
  text-shadow: 0 6px 0 #e07a1d, 0 10px 18px rgba(0,0,0,.18); margin: 10px 0 6px; -webkit-text-stroke: 2px #e07a1d; }
.title-logo span { color: var(--gold); -webkit-text-stroke: 2px #c47f00; text-shadow: 0 6px 0 #c47f00, 0 10px 18px rgba(0,0,0,.18); }
.title-sub { font-family: "Fredoka"; font-size: 1.25rem; color: var(--ink); background: rgba(255,255,255,.75); padding: 8px 18px; border-radius: 99px; }
.title-pip { width: min(300px, 70vw); margin: 10px auto 0; }
.coin-rain { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.title-screen > *:not(.coin-rain) { position: relative; z-index: 1; }
.coin-rain img { position: absolute; top: -60px; width: 46px; animation: fall linear infinite; opacity: .9; }
@keyframes fall { to { transform: translateY(115vh) rotate(540deg); } }
.tap-start { margin-top: 26px; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.credit { margin-top: 26px; font-size: .78rem; color: var(--ink-soft); max-width: 520px; }

/* ---------- Pip ---------- */
.pip { display: block; overflow: visible; }
.pip .pip-all { transform-origin: 100px 150px; animation: pipIdle 2.6s ease-in-out infinite; }
@keyframes pipIdle { 50% { transform: translateY(-4px) scaleY(1.02); } }
.pip .pip-eyes { transform-origin: 100px 82px; animation: blink 4.2s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.pip .pip-mouth-open { opacity: 0; }
body.talking .pip .pip-mouth-open { animation: talk .22s infinite alternate; }
body.talking .pip .pip-mouth-closed { animation: talk2 .22s infinite alternate; }
@keyframes talk { from { opacity: 0; } to { opacity: 1; } }
@keyframes talk2 { from { opacity: 1; } to { opacity: 0; } }
.pip.happy .pip-all { animation: pipJump .6s ease 2; }
@keyframes pipJump { 40% { transform: translateY(-26px) rotate(-4deg); } 70% { transform: translateY(0) scaleY(.94); } }
.pip.sad .pip-all { animation: pipTilt 1.4s ease-in-out infinite; }
@keyframes pipTilt { 50% { transform: rotate(-5deg); } }
.pip-acc { position: absolute; pointer-events: none; }
.pip-holder { position: relative; display: inline-block; }
.pip-holder .acc-crown { width: 34%; left: 33%; top: -16%; }
.pip-holder .acc-glasses { width: 44%; left: 28%; top: 34%; opacity: .0; }

.bubble {
  position: relative; background: #fff; border-radius: 22px; padding: 14px 18px; box-shadow: var(--shadow);
  font-family: "Fredoka"; font-size: 1.15rem; line-height: 1.35; display: flex; align-items: center; gap: 12px;
}
.bubble::after { content: ""; position: absolute; left: -12px; bottom: 22px; border: 12px solid transparent; border-right-color: #fff; border-left: 0; }
.pip-row { display: flex; align-items: flex-end; gap: 10px; }
.pip-row .pip-holder { width: 110px; flex: none; }

/* ---------- profiles ---------- */
.center-col { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 30px; text-align: center; }
.h1 { font-family: "Fredoka"; font-weight: 700; font-size: clamp(1.9rem, 6vw, 2.6rem); margin: 0; color: var(--ink); }
.h2 { font-family: "Fredoka"; font-weight: 600; font-size: 1.45rem; margin: 0; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; width: 100%; max-width: 720px; }
.profile-card {
  background: #fff; border-radius: var(--radius); padding: 16px 10px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: "Fredoka"; font-size: 1.2rem; font-weight: 600;
}
.profile-card img { width: 86px; height: 86px; }
.profile-card small { font-family: "Nunito"; font-weight: 700; color: var(--ink-soft); font-size: .85rem; }
.profile-card.add { border: 3px dashed #b7c0ff; background: rgba(255,255,255,.6); color: var(--purple); }
.name-input {
  width: min(420px, 100%); font-family: "Fredoka"; font-size: 1.8rem; text-align: center; padding: 14px 18px;
  border-radius: 20px; border: 4px solid #c9d2ff; outline: none; background: #fff; color: var(--ink); user-select: text; -webkit-user-select: text;
}
.name-input:focus { border-color: var(--purple); }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; width: 100%; max-width: 760px; }
.avatar-opt { background: #fff; border-radius: 20px; padding: 10px 6px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 800; font-size: .9rem; border: 4px solid transparent; }
.avatar-opt img { width: 70px; height: 70px; }
.avatar-opt.sel { border-color: var(--green); transform: scale(1.05); background: var(--green-soft); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 10px 0; padding-top: max(10px, env(safe-area-inset-top)); }
.topbar .who { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.92); border-radius: 99px; padding: 5px 14px 5px 5px; box-shadow: 0 4px 0 rgba(35,38,74,.12); font-family: "Fredoka"; font-weight: 600; font-size: 1.05rem; max-width: 42vw; }
.topbar .who img { width: 42px; height: 42px; border-radius: 50%; background: #fff4d6; }
.topbar .who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coins { display: inline-flex; align-items: center; gap: 6px; background: #fff7d6; border-radius: 99px; padding: 6px 14px 6px 6px; font-family: "Fredoka"; font-weight: 700; font-size: 1.2rem; color: #8a5a00; box-shadow: 0 4px 0 rgba(224,154,0,.35); }
.coins img { width: 34px; height: 34px; }
.coins.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.25); } }
.spacer { flex: 1; }

/* ---------- town map ---------- */
.map-screen { padding: 0; }
.map-screen .topbar { padding-left: 16px; padding-right: 16px; }
.map { position: relative; max-width: 860px; margin: 0 auto; }
.map svg.road { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.map-hello { position: relative; z-index: 3; padding: 4px 16px 0; max-width: 620px; margin: 0 auto; }
.deco { position: absolute; pointer-events: none; z-index: 1; }
.cloud { position: absolute; z-index: 0; pointer-events: none; opacity: .95; animation: drift linear infinite; }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(110vw); } }
.stop {
  position: absolute; z-index: 2; width: 210px; margin-left: -105px; margin-top: -90px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
}
.stop .island {
  position: relative; width: 170px; height: 132px; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 72%, #a6ec84 0 52%, #5cc24a 53% 62%, rgba(0,0,0,0) 63%);
  transition: transform .15s ease;
}
.stop:active .island { transform: scale(.95); }
.stop .island .main { width: 104px; height: 104px; filter: drop-shadow(0 8px 6px rgba(0,0,0,.18)); animation: floaty 3s ease-in-out infinite; }
.stop .island .side { position: absolute; width: 50px; height: 50px; filter: drop-shadow(0 4px 3px rgba(0,0,0,.15)); }
.stop .island .side.s1 { left: 4px; bottom: 6px; }
.stop .island .side.s2 { right: 4px; bottom: 6px; }
@keyframes floaty { 50% { transform: translateY(-6px); } }
.stop .plate { background: #fff; border-radius: 16px; padding: 6px 14px 8px; box-shadow: var(--shadow); border-bottom: 5px solid var(--c, var(--orange)); min-width: 150px; }
.stop .plate .nm { font-family: "Fredoka"; font-weight: 700; font-size: 1.2rem; line-height: 1.1; }
.stop .plate .pg { font-size: .78rem; font-weight: 800; color: var(--ink-soft); }
.stars { display: inline-flex; gap: 2px; margin-top: 2px; }
.stars img { width: 22px; height: 22px; filter: grayscale(1) opacity(.35); }
.stars img.on { filter: none; }
.badge-count { position: absolute; top: 4px; right: 18px; background: var(--red); color: #fff; font-family: "Fredoka"; font-weight: 700; min-width: 34px; height: 34px; border-radius: 99px; display: grid; place-items: center; padding: 0 8px; box-shadow: 0 3px 0 #c33; animation: bob 1.4s ease-in-out infinite; }
.stop.done .island::after { content: ""; position: absolute; right: 18px; top: 2px; width: 40px; height: 40px; background: url(../img/e/check-mark-button.webp) center/contain no-repeat; }

/* ---------- zone hub ---------- */
.hub { text-align: center; }
.hub-art { position: relative; height: 210px; display: grid; place-items: center; margin-top: 4px; }
.hub-art .main { width: 170px; height: 170px; animation: floaty 3s ease-in-out infinite; filter: drop-shadow(0 12px 10px rgba(0,0,0,.18)); }
.hub-art .side { position: absolute; width: 84px; height: 84px; animation: floaty 3.4s ease-in-out infinite; }
.hub-art .side.s1 { left: calc(50% - 190px); top: 70px; }
.hub-art .side.s2 { right: calc(50% - 190px); top: 60px; animation-delay: .6s; }
.zone-title { font-family: "Fredoka"; font-weight: 700; font-size: clamp(2rem, 7vw, 3rem); color: #fff; -webkit-text-stroke: 1.5px var(--zone-dark); text-shadow: 0 5px 0 var(--zone-dark); margin: 6px 0 0; }
.zone-pages { display: inline-block; margin-top: 8px; background: rgba(255,255,255,.85); border-radius: 99px; padding: 4px 14px; font-weight: 800; color: var(--ink-soft); }
.hub-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 22px 0 10px; }
.hub-buttons .btn { min-width: 220px; }
.mastery { margin: 14px auto 0; max-width: 460px; background: rgba(255,255,255,.85); border-radius: 18px; padding: 12px 16px; font-weight: 800; }
.bar { height: 16px; background: #e6e9ff; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), #6be39b); border-radius: 99px; transition: width .6s ease; }
.hub-bubble { max-width: 620px; margin: 16px auto 0; text-align: left; }

/* ---------- lesson slides ---------- */
.lesson-top, .play-top { display: flex; align-items: center; gap: 10px; padding: 10px 0; padding-top: max(10px, env(safe-area-inset-top)); position: sticky; top: 0; z-index: 30; }
.dots { display: flex; gap: 6px; flex: 1; justify-content: center; flex-wrap: wrap; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.75); box-shadow: inset 0 0 0 2px rgba(35,38,74,.1); }
.dots i.on { background: var(--zone); }
.dots i.done { background: var(--zone-dark); opacity: .45; }
.slide { background: #fff; border-radius: 28px; box-shadow: 0 8px 0 rgba(35,38,74,.12); padding: 22px 22px 26px; max-width: 760px; margin: 6px auto 0; position: relative; animation: slideIn .4s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px) scale(.98); } to { opacity: 1; transform: none; } }
.slide .pg-tag { position: absolute; top: -12px; right: 18px; background: var(--zone); color: #fff; font-weight: 800; font-size: .8rem; border-radius: 99px; padding: 4px 12px; }
.slide h2 { font-family: "Fredoka"; font-weight: 700; font-size: clamp(1.5rem, 5vw, 2rem); margin: 0 0 8px; color: var(--zone-dark); }
.slide-imgs { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; }
.slide-imgs img { width: clamp(70px, 18vw, 120px); height: clamp(70px, 18vw, 120px); animation: popIn .5s cubic-bezier(.2,1.6,.4,1) both; filter: drop-shadow(0 8px 6px rgba(0,0,0,.12)); }
.slide-imgs img:nth-child(2) { animation-delay: .1s; } .slide-imgs img:nth-child(3) { animation-delay: .2s; } .slide-imgs img:nth-child(4) { animation-delay: .3s; }
@keyframes popIn { from { opacity: 0; transform: scale(.3) rotate(-10deg); } to { opacity: 1; transform: none; } }
.slide-text { font-size: clamp(1.15rem, 3.6vw, 1.4rem); line-height: 1.55; font-weight: 700; display: flex; gap: 10px; align-items: flex-start; }
.slide-text p { margin: 0; flex: 1; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.cards .card { background: #f6f7ff; border-radius: 18px; padding: 12px; text-align: center; font-weight: 800; font-size: 1.02rem; line-height: 1.35; border: 3px solid transparent; transition: all .25s ease; animation: popIn .45s cubic-bezier(.2,1.6,.4,1) both; }
.cards .card img { width: 64px; height: 64px; display: block; margin: 0 auto 6px; }
.cards .card.lit { border-color: var(--zone); background: #fff; transform: scale(1.04); box-shadow: 0 6px 0 rgba(35,38,74,.1); }
.fact { margin-top: 16px; background: #fff8d9; border-radius: 18px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; font-weight: 700; font-size: 1.05rem; line-height: 1.45; border: 3px solid #ffe38a; }
.fact img.bulb { width: 44px; height: 44px; flex: none; }
.fact .lbl { display: block; font-family: "Fredoka"; color: #b07800; font-size: .9rem; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; }
.formula { margin: 14px auto 4px; text-align: center; font-family: "Fredoka"; font-weight: 700; font-size: clamp(1.4rem, 5vw, 2.1rem); background: #ffe9d6; border: 4px solid var(--orange); border-radius: 22px; padding: 12px 16px; color: #8a3a00; }
.kid-line { margin-top: 14px; display: flex; align-items: center; gap: 10px; }
.kid-line img { width: 64px; height: 64px; }
.kid-line .bubble { font-style: italic; }
.stmt { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 14px; font-weight: 800; border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 3px #d9def7; }
.stmt caption { font-family: "Fredoka"; font-weight: 600; font-size: 1.05rem; padding-bottom: 8px; }
.stmt th { background: #e9ecfb; padding: 8px 6px; font-size: .9rem; }
.stmt td { background: #fff; padding: 9px 6px; text-align: center; border-top: 2px solid #eef0fb; font-size: 1.05rem; }
.stmt td:first-child { text-align: left; padding-left: 12px; }
.stmt tr.cur td { background: #fff8d9; }
.stmt td.inc { color: var(--green); } .stmt td.exp { color: var(--red); }
.stmt td.bal { color: #1b55c9; }
.stmt td .q { display: inline-block; min-width: 46px; border-bottom: 3px dashed #9aa5e8; color: #9aa5e8; }
.slide-nav { display: flex; gap: 12px; justify-content: space-between; align-items: center; max-width: 760px; margin: 18px auto 0; }

/* ---------- play ---------- */
.progress { flex: 1; height: 22px; background: rgba(255,255,255,.75); border-radius: 99px; overflow: hidden; box-shadow: inset 0 2px 0 rgba(0,0,0,.06); }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--zone), var(--gold)); border-radius: 99px; transition: width .5s ease; }
.qcard { background: #fff; border-radius: 28px; box-shadow: 0 8px 0 rgba(35,38,74,.12); padding: 20px; max-width: 780px; margin: 8px auto 0; position: relative; animation: slideIn .35s ease; }
.retry-tag { position: absolute; top: -14px; left: 18px; background: var(--purple); color: #fff; font-family: "Fredoka"; font-weight: 600; border-radius: 99px; padding: 5px 14px; display: flex; gap: 6px; align-items: center; }
.retry-tag img { width: 22px; height: 22px; }
.q-head { display: flex; gap: 14px; align-items: center; }
.q-head .qimg { width: clamp(70px, 17vw, 110px); height: clamp(70px, 17vw, 110px); flex: none; animation: popIn .5s cubic-bezier(.2,1.6,.4,1) both; }
.q-text { font-family: "Fredoka"; font-weight: 600; font-size: clamp(1.3rem, 4.4vw, 1.75rem); line-height: 1.3; flex: 1; }
.q-meta { font-size: .8rem; font-weight: 800; color: var(--ink-soft); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.q-meta .letter-test { background: #ffe9d6; color: #a1440c; border-radius: 99px; padding: 2px 10px; }
.opts { display: grid; gap: 12px; margin-top: 18px; }
.opts.pics { grid-template-columns: repeat(2, 1fr); }
.opt {
  position: relative; display: flex; align-items: center; gap: 12px; text-align: left;
  background: #f4f6ff; border-radius: 20px; padding: 14px 14px; min-height: 66px;
  font-weight: 800; font-size: clamp(1.05rem, 3.4vw, 1.25rem); line-height: 1.3;
  box-shadow: 0 5px 0 #d4d9f5; border: 3px solid transparent; transition: transform .08s, background .2s;
}
.opt:active { transform: translateY(3px); box-shadow: 0 2px 0 #d4d9f5; }
.opt .ltr { width: 38px; height: 38px; flex: none; border-radius: 12px; background: #fff; display: grid; place-items: center; font-family: "Fredoka"; font-weight: 700; color: var(--purple); box-shadow: 0 3px 0 #d4d9f5; }
.opt .oimg { width: 56px; height: 56px; flex: none; }
.opts.pics .opt { flex-direction: column; text-align: center; justify-content: center; padding: 14px 8px 16px; }
.opts.pics .opt .oimg { width: clamp(64px, 18vw, 96px); height: clamp(64px, 18vw, 96px); }
.opt .ospk { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.9); display: grid; place-items: center; }
.opt .ospk img { width: 22px; height: 22px; }
.opt .otxt { flex: 1; padding-right: 30px; }
.opts.pics .opt .otxt { padding-right: 0; }
.opt.right { background: var(--green-soft); border-color: var(--green); box-shadow: 0 5px 0 #9fe3bd; }
.opt.wrong { background: var(--red-soft); border-color: var(--red); box-shadow: 0 5px 0 #ffb8b8; animation: shake .45s ease; }
.opt.dim { opacity: .45; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.tf { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.tf .opt { flex-direction: column; justify-content: center; text-align: center; font-family: "Fredoka"; font-size: 1.6rem; min-height: 130px; }
.tf .opt img { width: 70px; height: 70px; }
.tf .opt.t { background: #e8fbf0; box-shadow: 0 5px 0 #b5ecd0; }
.tf .opt.f { background: #ffefef; box-shadow: 0 5px 0 #ffcfcf; }
.statement { background: repeating-linear-gradient(#fff 0 38px, #dfe6ff 38px 40px); border-radius: 18px; padding: 12px 18px; border-left: 6px solid #ff9db0; font-family: "Fredoka"; font-size: clamp(1.3rem, 4.4vw, 1.7rem); line-height: 40px; }

/* sorting */
.sort-stage { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.sort-card { background: #fff; border: 4px solid var(--zone); border-radius: 24px; padding: 14px 22px; display: flex; align-items: center; gap: 14px; font-family: "Fredoka"; font-weight: 600; font-size: 1.4rem; box-shadow: 0 8px 0 rgba(35,38,74,.12); animation: popIn .45s cubic-bezier(.2,1.6,.4,1) both; max-width: 100%; }
.sort-card > img { width: 80px; height: 80px; }
.sort-card.fly { animation: flyAway .45s ease forwards; }
@keyframes flyAway { to { transform: translateY(120px) scale(.2); opacity: 0; } }
.sort-card.wrong { animation: shake .45s ease; border-color: var(--red); }
.sort-count { font-weight: 800; color: var(--ink-soft); }
.bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; width: 100%; }
.bin { background: #f4f6ff; border-radius: 22px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-family: "Fredoka"; font-weight: 600; font-size: 1.05rem; box-shadow: 0 5px 0 #d4d9f5; border: 3px dashed #b9c2f0; min-height: 130px; line-height: 1.2; }
.bin:active { transform: translateY(3px); }
.bin img.bi { width: 56px; height: 56px; }
.bin .got { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; min-height: 26px; }
.bin .got img { width: 26px; height: 26px; animation: popIn .4s ease both; }
.bin.ok { animation: binOk .5s ease; border-color: var(--green); }
@keyframes binOk { 40% { transform: scale(1.06); background: var(--green-soft); } }
.hint { margin-top: 12px; background: var(--red-soft); border-radius: 16px; padding: 12px 14px; font-weight: 800; display: flex; gap: 10px; align-items: center; border: 3px solid #ffc2c2; animation: popIn .3s ease both; }
.hint img { width: 40px; height: 40px; flex: none; }

/* number pad */
.num-area { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 18px; }
.num-display { min-width: 220px; background: #fff; border: 4px solid #c9d2ff; border-radius: 20px; padding: 10px 18px; font-family: "Fredoka"; font-size: 2.3rem; font-weight: 700; text-align: center; display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.num-display .unit { font-size: 1.1rem; color: var(--ink-soft); }
.num-display .blink { display: inline-block; width: 3px; height: 1.8rem; background: var(--purple); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.num-display.wrong { border-color: var(--red); animation: shake .45s ease; }
.num-display.right { border-color: var(--green); background: var(--green-soft); }
.pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; }
.pad button { height: 64px; border-radius: 18px; background: #fff; box-shadow: 0 5px 0 #d4d9f5; font-family: "Fredoka"; font-weight: 700; font-size: 1.7rem; }
.pad button:active { transform: translateY(3px); box-shadow: 0 2px 0 #d4d9f5; }
.pad button.ok { background: var(--green); color: #fff; box-shadow: 0 5px 0 #158a4b; }
.pad button.del { background: #ffeede; box-shadow: 0 5px 0 #ffd2ad; }

/* table question */
.trow-say { margin-top: 14px; background: #f4f6ff; border-radius: 18px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-family: "Fredoka"; font-weight: 600; font-size: 1.3rem; }
.trow-say > img { width: 44px; height: 44px; flex: none; }
.kind-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.kind-btns .opt { justify-content: center; font-family: "Fredoka"; font-size: 1.3rem; }
.kind-btns .opt img { width: 46px; height: 46px; }

/* feedback sheet */
.sheet-back { position: fixed; inset: 0; background: rgba(20, 24, 60, .35); z-index: 80; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: #fff; border-radius: 30px 30px 0 0;
  padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto;
  box-shadow: 0 -10px 30px rgba(0,0,0,.18); animation: sheetUp .35s cubic-bezier(.2,1.2,.4,1);
}
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet .inner { max-width: 760px; margin: 0 auto; }
.sheet.good { border-top: 8px solid var(--green); }
.sheet.bad { border-top: 8px solid var(--orange); }
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-head .pip-holder { width: 92px; flex: none; }
.sheet-head h3 { font-family: "Fredoka"; font-size: 1.9rem; margin: 0; }
.sheet.good h3 { color: var(--green); }
.sheet.bad h3 { color: #d35d10; }
.coin-pop { font-family: "Fredoka"; font-weight: 700; color: #b07800; font-size: 1.3rem; display: inline-flex; align-items: center; gap: 4px; animation: popIn .5s ease both; }
.coin-pop img { width: 30px; height: 30px; }
.fb-box { border-radius: 18px; padding: 12px 14px; margin-top: 12px; font-weight: 700; font-size: 1.08rem; line-height: 1.45; display: flex; gap: 10px; align-items: flex-start; }
.fb-box .lbl { display: block; font-family: "Fredoka"; font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .8px; }
.fb-box.no { background: var(--red-soft); border: 3px solid #ffc2c2; }
.fb-box.no .lbl { color: #d23c41; }
.fb-box.yes { background: var(--green-soft); border: 3px solid #a6e9c4; }
.fb-box.yes .lbl { color: #148a4a; }
.fb-box.why { background: #f2f4ff; border: 3px solid #d9def7; }
.fb-box.why .lbl { color: var(--purple); }
.fb-box > img { width: 34px; height: 34px; flex: none; }
.fb-box .content { flex: 1; }
.again-note { margin-top: 12px; display: flex; gap: 8px; align-items: center; font-weight: 800; color: var(--purple); }
.again-note img { width: 30px; height: 30px; }
.sheet-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.sheet-actions .btn { flex: 1; min-width: 160px; }

/* results */
.results { text-align: center; padding-top: 24px; }
.big-stars { display: flex; justify-content: center; gap: 10px; margin: 10px 0; }
.big-stars img { width: clamp(70px, 20vw, 110px); height: clamp(70px, 20vw, 110px); filter: grayscale(1) opacity(.3); }
.big-stars img.on { filter: none; animation: starIn .6s cubic-bezier(.2,1.8,.4,1) both; }
.big-stars img.on:nth-child(2) { animation-delay: .25s; } .big-stars img.on:nth-child(3) { animation-delay: .5s; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } to { transform: none; } }
.stat-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 16px 0; }
.stat { background: #fff; border-radius: 20px; padding: 12px 18px; box-shadow: var(--shadow); min-width: 140px; }
.stat b { display: block; font-family: "Fredoka"; font-size: 2rem; color: var(--ink); }
.stat span { font-weight: 800; color: var(--ink-soft); font-size: .9rem; }
.faces { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.faces button { background: #fff; border-radius: 20px; padding: 10px; width: 108px; box-shadow: var(--shadow); font-weight: 800; font-size: .85rem; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 4px solid transparent; }
.faces button img { width: 60px; height: 60px; }
.faces button.sel { border-color: var(--green); background: var(--green-soft); }
.eval-card { background: rgba(255,255,255,.88); border-radius: 24px; padding: 16px; max-width: 620px; margin: 18px auto 0; }

/* stall */
.stall-art { max-width: 560px; margin: 0 auto; position: relative; }
.stall-art svg { width: 100%; height: auto; display: block; }
.stall-items { position: absolute; left: 12%; right: 12%; top: 50%; height: 26%; display: flex; justify-content: space-around; align-items: flex-end; }
.stall-items img { width: 15%; max-width: 70px; animation: popIn .5s ease both; }
.stall-top { position: absolute; left: 6%; right: 6%; top: 2%; display: flex; justify-content: space-between; }
.stall-top img { width: 13%; max-width: 64px; animation: floaty 3s ease-in-out infinite; }
.stall-pip { position: absolute; width: 26%; right: 3%; bottom: 4%; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.shop-item { background: #fff; border-radius: 20px; padding: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-weight: 800; }
.shop-item img { width: 64px; height: 64px; }
.shop-item .price { display: inline-flex; align-items: center; gap: 4px; font-family: "Fredoka"; color: #8a5a00; font-size: 1.1rem; }
.shop-item .price img { width: 24px; height: 24px; }
.shop-item.owned { background: var(--green-soft); }
.panel { background: rgba(255,255,255,.92); border-radius: 24px; padding: 16px; box-shadow: var(--shadow); margin-top: 18px; }
.panel h3 { font-family: "Fredoka"; margin: 0 0 6px; font-size: 1.35rem; display: flex; align-items: center; gap: 8px; }
.panel h3 img { width: 36px; height: 36px; }
.jar { display: flex; align-items: center; gap: 12px; }
.jar img { width: 60px; height: 60px; }
.jar .bar { flex: 1; height: 22px; }
.jar .bar > i { background: linear-gradient(90deg, var(--pink), var(--gold)); }

/* parents */
.parents { background: #f5f7fb; min-height: 100vh; font-family: "Nunito", system-ui, sans-serif; user-select: text; -webkit-user-select: text; }
body.parent-mode { background: #f5f7fb; }
.parents .wrap { max-width: 1040px; }
.ptop { display: flex; align-items: center; gap: 12px; padding: 16px 0; flex-wrap: wrap; }
.ptop h1 { font-family: "Fredoka"; font-size: 1.7rem; margin: 0; flex: 1; min-width: 220px; }
.ptabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ptabs button { padding: 8px 14px; border-radius: 99px; background: #fff; border: 2px solid #dfe3ee; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.ptabs button img { width: 26px; height: 26px; }
.ptabs button.on { border-color: var(--purple); background: #efeaff; }
.pcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.pcard { background: #fff; border-radius: 16px; padding: 14px 16px; border: 1px solid #e3e7f0; }
.pcard .v { font-family: "Fredoka"; font-size: 1.9rem; font-weight: 700; }
.pcard .k { color: #6a7090; font-weight: 700; font-size: .9rem; }
.psec { background: #fff; border-radius: 16px; border: 1px solid #e3e7f0; margin-top: 16px; padding: 14px 16px; }
.psec h2 { font-family: "Fredoka"; font-size: 1.25rem; margin: 0 0 10px; }
.psec .note { color: #6a7090; font-size: .9rem; margin: -4px 0 10px; }
.ptable { width: 100%; border-collapse: collapse; font-size: .95rem; }
.ptable th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: #6a7090; padding: 8px 6px; border-bottom: 2px solid #e8ebf3; }
.ptable td { padding: 9px 6px; border-bottom: 1px solid #eef0f6; vertical-align: top; }
.ptable tr.pg-row { cursor: pointer; }
.ptable tr.pg-row:hover td { background: #fafbff; }
.ptable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ptable .ok { color: #148a4a; font-weight: 800; }
.ptable .bad { color: #d23c41; font-weight: 800; }
.mini-bar { width: 110px; height: 10px; background: #f0d4d4; border-radius: 99px; overflow: hidden; display: inline-block; vertical-align: middle; }
.mini-bar i { display: block; height: 100%; background: #22b766; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 800; }
.pill.ok { background: #e3f9ec; color: #148a4a; }
.pill.bad { background: #ffe8e8; color: #d23c41; }
.pill.mid { background: #fff3d6; color: #a06a00; }
.pill.grey { background: #eef0f6; color: #6a7090; }
.detail td { background: #fafbff; }
.detail ul { margin: 4px 0; padding-left: 18px; }
.detail li { margin: 6px 0; }
.detail .ans { color: #6a7090; font-size: .88rem; }
.gate { max-width: 420px; margin: 80px auto; background: #fff; border-radius: 24px; padding: 26px; text-align: center; box-shadow: var(--shadow); }
.gate input { width: 160px; font-size: 1.6rem; text-align: center; padding: 10px; border-radius: 14px; border: 3px solid #d5dbf2; margin: 12px 0; user-select: text; -webkit-user-select: text; }
.empty { color: #6a7090; padding: 12px 0; }

/* misc */
.center { text-align: center; }
.mt { margin-top: 16px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 560px) {
  :root { font-size: 16px; }
  .opts.pics { grid-template-columns: repeat(2, 1fr); }
  .pad { grid-template-columns: repeat(3, 68px); }
  .hub-art .side.s1 { left: 4%; } .hub-art .side.s2 { right: 4%; }
  .stop { width: 170px; margin-left: -85px; }
  .stop .island { width: 140px; height: 112px; }
  .stop .island .main { width: 84px; height: 84px; }
  .stop .island .side { width: 40px; height: 40px; }
  .stop .plate { min-width: 130px; }
  .topbar .who span { display: none; }
  .topbar .who { padding-right: 5px; }
  .q-head { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
