@font-face { font-family: 'Fredoka'; font-weight: 500; font-display: swap; src: url(../fonts/fredoka-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url(../fonts/fredoka-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 400; font-display: swap; src: url(../fonts/nunito-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 600; font-display: swap; src: url(../fonts/nunito-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 700; font-display: swap; src: url(../fonts/nunito-latin-700-normal.woff2) format('woff2'); }

:root {
  /* notebook paper + crayon box. Single light look on purpose (a bright classroom). */
  --bg: #f3f7ff;
  --rule: #dfe8fb;
  --paper: #ffffff;
  --ink: #1d2a4d;
  --ink2: #34426b;
  --muted: #5d6a8a;
  --line: #d6e0f3;
  --soft: #eef3fc;
  --c1: #ff5d4f;   /* tomato: brand */
  --c2: #36b3ff;   /* sky */
  --c3: #ffc531;   /* sunflower: stars */
  --c4: #6fdcab;   /* mint */
  --c5: #9b7bff;   /* grape */
  --c6: #ff8fb1;   /* bubblegum */
  --good: #18a46b;
  --good-bg: #e2f8ee;
  --bad: #e5484d;
  --bad-bg: #ffecea;
  --warn-bg: #fff4cf;
  --shadow: 0 4px 0 rgba(29, 42, 77, .9);
  --lift: 0 10px 24px -12px rgba(29, 42, 77, .35);
  --display: 'Fredoka', 'Baloo 2', ui-rounded, 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 20px;
  --gap: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font: 400 17px/1.55 var(--body); color: var(--ink);
  background-color: var(--bg);
  background-image: repeating-linear-gradient(to bottom, transparent 0 39px, var(--rule) 39px 40px);
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--c2); outline-offset: 3px; border-radius: 12px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--c1); font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 3px; }
[hidden] { display: none !important; }
svg.ui { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; vertical-align: -0.18em; }
svg.ui.big { width: 44px; height: 44px; color: var(--c2); }
img.pe { width: 1.6em; height: 1.6em; display: inline-block; vertical-align: middle; user-select: none; -webkit-user-drag: none; }
.center { text-align: center; }
.small { font-size: 15px; }
.grow { flex: 1; min-width: 0; }

#app { min-height: 100%; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 940px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 20px 48px; display: flex; flex-direction: column; gap: 22px; }

/* top bar */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 2px solid var(--line); }
.bar .in { max-width: 940px; margin: 0 auto; display: flex; align-items: center; gap: 10px; min-height: 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; font-size: 21px; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand b { color: var(--c1); font-weight: 600; }
.demo { background: var(--c5); color: #fff; text-align: center; font-weight: 700; font-size: 14px; padding: 6px max(16px, env(safe-area-inset-left, 0px)); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 999px; border: 2.5px solid var(--ink); background: var(--c1); color: #fff; font-family: var(--display); font-weight: 500; font-size: 19px; box-shadow: var(--shadow); text-decoration: none; transition: transform .08s, box-shadow .08s; white-space: nowrap; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.alt { background: var(--paper); color: var(--ink); }
.btn.sm { min-height: 42px; font-size: 16px; padding: 0 16px; box-shadow: 0 3px 0 var(--ink); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.iconbtn { width: 46px; height: 46px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--paper); display: grid; place-items: center; font-size: 22px; box-shadow: 0 3px 0 var(--ink); padding: 0; flex: none; color: var(--ink); }
.iconbtn:active { transform: translateY(2px); box-shadow: none; }
.iconbtn.clue { background: var(--c3); }
.iconbtn.clue.nudge { animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-14deg) scale(1.1); } 30% { transform: rotate(12deg) scale(1.1); } 45% { transform: rotate(0); } }
.chipbtn { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 6px 14px; font: 500 15px var(--display); box-shadow: 0 2px 0 var(--ink); }
.link { background: none; border: 0; color: var(--muted); font-weight: 700; text-decoration: underline; padding: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 2px solid var(--line); border-radius: 999px; padding: 3px 12px; font: 500 15px var(--display); background: var(--paper); color: var(--ink2); }
.chip.soon { opacity: .55; border-style: dashed; }
.eyebrow { font: 600 13px var(--body); letter-spacing: 1.2px; text-transform: uppercase; color: var(--c1); }

/* welcome */
.hero { display: grid; gap: 28px; align-items: center; padding-top: 8px; }
@media (min-width: 780px) { .hero { grid-template-columns: 1.15fr .85fr; } }
.hero-copy { display: flex; flex-direction: column; gap: 14px; }
.hero h1 { font-size: clamp(38px, 7.5vw, 60px); }
.hero h1 em { font-style: normal; color: var(--c1); }
.lead { font-size: 19px; color: var(--ink2); max-width: 36ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.sub { color: var(--muted); }
.hero-art { position: relative; display: grid; justify-items: center; gap: 0; }
.slate { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 24px; box-shadow: var(--lift), 0 5px 0 var(--ink); padding: 18px; width: min(340px, 100%); transform: rotate(-1.5deg); margin-top: -18px; }
.slate .q { font: 600 36px var(--display); text-align: center; }
.slate .row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.slate .row span { border: 2px solid var(--line); border-radius: 14px; text-align: center; font: 600 24px var(--display); padding: 8px 0; }
.slate .row span.ok { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.feats { display: grid; gap: var(--gap); }
@media (min-width: 640px) { .feats { grid-template-columns: repeat(3, 1fr); } }
.feat { background: var(--paper); border: 2px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.feat h3 { font-size: 20px; }
.feat p { color: var(--muted); font-size: 16px; }
img.pe.fi { width: 44px; height: 44px; }
.grades-strip { display: flex; flex-wrap: wrap; gap: 8px; }

/* mascot */
.mascot-wrap { width: 120px; height: 120px; }
.mascot-wrap.big { width: 170px; height: 170px; }
.mascot { width: 100%; height: 100%; overflow: visible; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.talking .mouth { animation: talk .22s ease-in-out infinite alternate; transform-origin: 60px 82px; }
@keyframes talk { to { transform: scaleY(1.9); } }
.talking .mascot { animation-duration: 1s; }

/* section heads */
.sh { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sh h2 { font-size: 28px; }
.sh a { display: inline-flex; gap: 6px; align-items: center; }

/* kid picker */
.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: var(--gap); }
.kid { background: var(--paper); border: 2.5px solid var(--ink); border-radius: 24px; box-shadow: var(--shadow); padding: 20px 12px; text-align: center; display: grid; gap: 6px; justify-items: center; color: inherit; text-decoration: none; }
.kid:active { transform: translateY(3px); box-shadow: none; }
.av { width: 64px; height: 64px; font-size: 52px; line-height: 64px; text-align: center; }
img.pe.av { width: 64px; height: 64px; }
img.pe.av.lg, .av.lg { width: 60px; height: 60px; }
.kid b { font: 600 21px var(--display); }
.kid small { color: var(--muted); font-weight: 700; }
.kid.add { border-style: dashed; box-shadow: none; color: var(--muted); align-content: center; }
.kid .plus { width: 56px; height: 56px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-size: 28px; }

/* forms */
.card { background: var(--paper); border: 2px solid var(--line); border-radius: 24px; padding: 22px; box-shadow: var(--lift); }
.form { display: grid; gap: 16px; max-width: 480px; width: 100%; margin: 0 auto; }
.form label { display: grid; gap: 6px; font-weight: 700; }
.form .field { display: grid; gap: 8px; }
.form input, .form select, #gFind, .ownerform input { min-height: 52px; border: 2px solid var(--line); border-radius: 14px; padding: 0 14px; background: var(--paper); font-size: 18px; width: 100%; }
.form input:focus, #gFind:focus, .ownerform input:focus { border-color: var(--c2); outline: none; }
.avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.avatars button { aspect-ratio: 1; border-radius: 16px; border: 2px solid var(--line); background: var(--paper); padding: 6px; display: grid; place-items: center; }
.avatars button img.pe { width: 100%; height: 100%; }
.avatars button[aria-pressed='true'] { border: 3px solid var(--ink); background: #fff6d8; }
.gradepick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.gradepick button { min-height: 50px; border-radius: 14px; border: 2px solid var(--line); background: var(--paper); font: 500 16px var(--display); display: grid; place-items: center; line-height: 1.1; }
.gradepick button small { font: 600 11px var(--body); color: var(--muted); }
.gradepick button[aria-pressed='true'] { border: 3px solid var(--ink); background: #dff1ff; }
.gradepick button[disabled] { opacity: .45; }
.msg { padding: 12px 14px; border-radius: 14px; font-weight: 600; }
.msg.err { background: var(--bad-bg); color: #a3262b; }
.msg.ok { background: var(--good-bg); color: #116b47; }

/* kid home */
.kidhead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.kidhead .who { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.kidhead h1 { font-size: 30px; }
.tally { margin-left: auto; display: flex; gap: 8px; }
.tally span { display: inline-flex; align-items: center; gap: 6px; background: var(--paper); border: 2px solid var(--line); border-radius: 999px; padding: 6px 14px; font: 600 18px var(--display); }
.tally span:first-child svg { color: #f5a300; }
.tally span:last-child svg { color: var(--c1); }
.upnext { display: flex; align-items: center; gap: 16px; background: var(--tile); border: 2.5px solid var(--ink); border-radius: 26px; padding: 16px 18px; box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.upnext:active { transform: translateY(3px); box-shadow: none; }
.upnext img.tileic { width: 64px; height: 64px; }
.upnext div { flex: 1; display: grid; gap: 2px; min-width: 0; }
.upnext small { font: 700 13px var(--body); text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.upnext b { font: 600 24px var(--display); }
.playbtn { width: 58px; height: 58px; border-radius: 50%; background: var(--c1); color: #fff; display: grid; place-items: center; font-size: 26px; border: 2.5px solid var(--ink); flex: none; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tab { min-height: 62px; border-radius: 20px; border: 2.5px solid var(--line); background: var(--paper); font: 600 22px var(--display); display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink2); }
.tab img.tabic { width: 32px; height: 32px; }
.tab[aria-selected='true'] { border-color: var(--ink); box-shadow: var(--shadow); color: var(--ink); }
.tab[aria-selected='true'].math { background: #dff1ff; }
.tab[aria-selected='true'].english { background: #e2f8ee; }
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--gap); }
.skill { position: relative; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 22px; padding: 16px 12px 14px; display: grid; justify-items: center; gap: 8px; text-align: center; box-shadow: var(--shadow); align-content: start; color: inherit; text-decoration: none; }
.skill:active { transform: translateY(3px); box-shadow: none; }
.icwrap { width: 78px; height: 78px; border-radius: 50%; background: var(--tile); display: grid; place-items: center; }
img.pe.tileic { width: 52px; height: 52px; }
.skill b { font: 500 17px/1.2 var(--display); }
.stars { display: inline-flex; gap: 2px; color: var(--line); }
.stars i { font-style: normal; display: inline-flex; }
.stars svg.ui { width: 20px; height: 20px; }
.stars i.on { color: #f7b500; }
.skill.locked { background: #f7f8fc; border-color: #b8c2d9; box-shadow: 0 4px 0 #b8c2d9; }
.skill.locked .icwrap { filter: grayscale(1); opacity: .55; }
.lock { position: absolute; top: 10px; right: 10px; color: var(--muted); }
.free { position: absolute; top: 10px; left: 10px; background: var(--c4); border-radius: 999px; font: 600 11px var(--display); padding: 2px 8px; text-transform: uppercase; letter-spacing: .6px; }
.upsell { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: #fff6d8; border: 2.5px solid var(--ink); border-radius: 22px; padding: 16px 18px; }
.upsell p { font-weight: 700; flex: 1 1 200px; }

/* play */
.play { flex: 1; display: flex; flex-direction: column; max-width: 780px; width: 100%; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 12px 22px; }
.playtop { display: flex; align-items: center; gap: 10px; }
.progress { flex: 1; height: 18px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--paper); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--c4), #4fd1a0); width: 0; transition: width .3s; }
.modetag { flex: 1; font: 600 16px var(--display); color: var(--ink2); display: flex; align-items: center; gap: 6px; }
.timer { flex: 1; position: relative; height: 34px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--paper); overflow: hidden; }
.timer i { position: absolute; inset: 0 auto 0 0; width: 100%; background: var(--c3); transition: width 1s linear; }
.timer span { position: relative; display: block; text-align: center; font: 600 18px/29px var(--display); }
.score { display: inline-flex; align-items: center; gap: 6px; font: 600 20px var(--display); }
.score svg { color: #f7b500; }
.qa { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding-block: 16px; }
.prompt { font: 600 clamp(24px, 6vw, 36px)/1.2 var(--display); text-align: center; text-wrap: balance; }
.prompt.long { font-size: clamp(20px, 4.6vw, 25px); line-height: 1.3; }
.prompt.xl { font-size: clamp(42px, 12vw, 66px); }
.visual { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.body { display: flex; flex-direction: column; gap: 14px; }
.objs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 540px; }
.objs img.pe { width: 46px; height: 46px; }
.objs.big img.pe { width: 60px; height: 60px; }
.objs.mini img.pe, .mini img.pe { width: 28px; height: 28px; }
.objs.small img.pe, .small img.pe { width: 34px; height: 34px; }
.objs .gone { opacity: .25; position: relative; }
.objs .gone::after { content: ''; position: absolute; left: -2px; right: -2px; top: 50%; height: 4px; background: var(--bad); transform: rotate(-35deg); border-radius: 2px; }
.objs .q, .seq .q { color: var(--c1); font: 600 40px var(--display); }
.pattern { align-items: center; }
.pattern .dot { width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--ink); }
.scatter { display: grid; grid-template-columns: repeat(4, 54px); grid-auto-rows: 54px; gap: 4px; }
.scatter span { display: grid; place-items: center; }
.scatter span:nth-child(odd) { transform: translateY(8px); }
.scatter img.pe { width: 46px; height: 46px; }
.dice { display: grid; grid-template-columns: repeat(3, 52px); grid-auto-rows: 52px; gap: 4px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 20px; padding: 8px; }
.dice span { display: grid; place-items: center; }
.dice img.pe { width: 42px; height: 42px; }
.dice.mini { grid-template-columns: repeat(3, 26px); grid-auto-rows: 26px; padding: 4px; border-radius: 12px; }
.dice.mini img.pe { width: 22px; height: 22px; }
.eq { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.eq b { font: 600 40px var(--display); }
.eq .objs { max-width: 230px; }
.seq { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.seq b { min-width: 70px; height: 70px; display: grid; place-items: center; border: 2.5px solid var(--ink); border-radius: 18px; background: var(--paper); font: 600 32px var(--display); padding: 0 10px; }
img.pe.hero { width: 120px; height: 120px; }
img.pe.mid { width: 56px; height: 56px; }
img.pe.big { width: 60px; height: 60px; }
img.pe.sz.s1 { width: 36px; height: 36px; }
img.pe.sz.s2 { width: 60px; height: 60px; }
img.pe.sz.s3 { width: 90px; height: 90px; }
.cap { text-align: center; font: 600 26px var(--display); }
.pic { width: 190px; height: auto; max-width: 100%; }
.pic.wide { width: 310px; }
.pic.grid { width: 270px; }
.pic.clock { width: 210px; }
.shape { width: 76px; height: 76px; }
.coins { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 380px; }
.coin { width: 58px; height: 58px; }
.frames { display: grid; gap: 8px; }
.tenframe { display: grid; grid-template-columns: repeat(5, 48px); grid-auto-rows: 48px; border: 2.5px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--paper); }
.tenframe span { border: 1px solid var(--line); display: grid; place-items: center; }
.tenframe img.pe { width: 36px; height: 36px; }
.frames.small .tenframe { grid-template-columns: repeat(5, 30px); grid-auto-rows: 30px; }
.frames.small .tenframe img.pe { width: 22px; height: 22px; }
.b10 { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 540px; }
.b10 .hund { width: 92px; height: 92px; background: var(--c5); border: 2px solid var(--ink); background-image: linear-gradient(var(--ink) 1px, transparent 1px), linear-gradient(90deg, var(--ink) 1px, transparent 1px); background-size: 9.2px 9.2px; }
.b10 .rod { width: 12px; height: 112px; background: var(--c2); border: 2px solid var(--ink); background-image: linear-gradient(var(--ink) 1px, transparent 1px); background-size: 100% 11.2px; }
.b10 .ones { display: grid; grid-template-columns: repeat(3, 14px); gap: 3px; margin-left: 6px; }
.b10 .cube { width: 14px; height: 14px; background: var(--c3); border: 2px solid var(--ink); }
.passage { background: var(--paper); border: 2px solid var(--line); border-left: 6px solid var(--c6); border-radius: 16px; padding: 16px 18px; max-width: 64ch; font-size: 18px; line-height: 1.65; text-align: left; }
.passage h3 { font-size: 20px; margin-bottom: 6px; }
.sentence { font: 600 22px/1.4 var(--display); text-align: center; max-width: 34ch; }
.sentence mark { background: var(--c3); border-radius: 6px; padding: 0 4px; }
.chart { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; max-width: 360px; width: 100%; }
.chart span { border: 2px solid var(--line); border-radius: 10px; background: var(--paper); text-align: center; font: 600 20px/44px var(--display); }
.chart span.q { border-color: var(--c1); color: var(--c1); }
.plates { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 560px; }
.plate { background: var(--paper); border: 2.5px solid var(--line); border-radius: 50%; width: 104px; height: 104px; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 2px; padding: 10px; }
.plate img.pe { width: 24px; height: 24px; }
.array { display: grid; grid-template-columns: repeat(var(--c), 40px); gap: 6px; }
.array img.pe { width: 36px; height: 36px; }
.measure { display: grid; gap: 6px; justify-items: start; max-width: 100%; overflow-x: auto; padding-bottom: 4px; }
.measure .mbar { height: 44px; width: calc(var(--n) * 26px); background: var(--soft); border: 2px dashed var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.measure .mbar img.pe { width: 36px; height: 36px; }
.measure .cubes { display: flex; }
.measure .cubes i { width: 26px; height: 26px; background: var(--c3); border: 2px solid var(--ink); margin-right: -2px; }
.measure.sm .mbar { height: 34px; width: calc(var(--n) * 18px); }
.measure.sm .cubes i { width: 18px; height: 18px; }
.measure.sm img.pe { width: 26px; height: 26px; }

/* choices */
.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.choices.n3 { grid-template-columns: repeat(3, 1fr); }
.choices.n5 { grid-template-columns: repeat(5, 1fr); }
.choices.one { grid-template-columns: 1fr; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choice { min-height: 76px; border: 2.5px solid var(--ink); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); font: 500 22px/1.2 var(--display); padding: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; transition: opacity .2s; }
.choice.big { font-size: clamp(26px, 7vw, 38px); min-height: 88px; }
.choice.txt { font: 700 18px/1.35 var(--body); text-align: left; align-items: flex-start; }
.choice small { font: 600 16px var(--body); color: var(--muted); }
.choice:active { transform: translateY(3px); box-shadow: none; }
.choice.right, .tile.right { background: var(--good-bg); border-color: var(--good); color: #0e6a43; box-shadow: 0 4px 0 var(--good); }
.choice.wrong { background: var(--bad-bg); border-color: var(--bad); color: #a3262b; box-shadow: none; opacity: .7; }
.choice.out, .tick.out { opacity: .2; pointer-events: none; transform: scale(.94); }
.swatch { width: 58px; height: 58px; border-radius: 50%; border: 2.5px solid var(--ink); display: block; }
.swatch.sm { width: 28px; height: 28px; }
.num { font: 600 34px var(--display); }
.wd { font: 700 18px var(--body); }
.wd.sm { font-size: 14px; line-height: 1.25; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pop { animation: pop .35s; }
@keyframes pop { 50% { transform: scale(1.08); } }

/* keypad */
.answerbox { margin: 0 auto; min-width: 200px; min-height: 78px; border: 2.5px solid var(--ink); border-radius: 20px; background: var(--paper); font: 600 42px var(--display); display: flex; align-items: center; justify-content: center; padding: 0 18px; gap: 8px; }
.answerbox .unit { font-size: 18px; color: var(--muted); }
.answerbox.right { border-color: var(--good); background: var(--good-bg); }
.answerbox.wrong { border-color: var(--bad); background: var(--bad-bg); }
.caret { width: 3px; height: 40px; background: var(--c1); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 430px; width: 100%; margin: 0 auto; }
.key { min-height: 62px; border: 2.5px solid var(--ink); border-radius: 18px; background: var(--paper); font: 600 28px var(--display); box-shadow: 0 3px 0 var(--ink); display: grid; place-items: center; }
.key:active { transform: translateY(3px); box-shadow: none; }
.key.go { background: var(--c4); grid-row: span 2; }
.key.fn { background: var(--soft); font-size: 22px; }

/* build */
.slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 72px; padding: 8px; }
.slot { width: 58px; height: 58px; border: 2.5px dashed var(--line); border-radius: 14px; }
.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tile { min-width: 58px; min-height: 58px; padding: 0 14px; border: 2.5px solid var(--ink); border-radius: 14px; background: #fff3c4; font: 600 28px var(--display); box-shadow: 0 3px 0 var(--ink); }
.tile.w { font: 700 19px var(--body); background: var(--paper); }
.tile.used { visibility: hidden; }

/* match */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; max-width: 440px; width: 100%; margin: 0 auto; }
.match .col { display: grid; gap: 12px; }
.match .tile { width: 100%; min-height: 64px; background: var(--paper); }
.match .tile.sel { background: #dff1ff; border-color: var(--c2); }
.match .tile.hint { box-shadow: 0 0 0 4px var(--c3); }
.match .tile.done { background: var(--good-bg); border-color: var(--good); color: #0e6a43; box-shadow: none; }

/* pop the balloons */
.sky { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 10px; max-width: 520px; width: 100%; margin: 0 auto; padding: 10px 0 18px; }
.balloon { --bc: var(--c1); position: relative; aspect-ratio: 4 / 5; border: 0; background: none; padding: 0; animation: float 3s ease-in-out infinite; animation-delay: var(--d); }
.balloon::before { content: ''; position: absolute; inset: 0 0 12% 0; border-radius: 50% 50% 46% 46%; background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .55) 0 12%, transparent 13%), var(--bc); border: 2.5px solid var(--ink); }
.balloon::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 2px; height: 14%; background: var(--ink); }
.balloon span { position: relative; display: grid; place-items: center; height: 88%; font: 600 clamp(18px, 5vw, 28px) var(--display); color: var(--ink); padding: 0 6px; line-height: 1.05; word-break: break-word; }
.balloon span img.pe, .balloon span .shape { width: 70%; height: auto; }
.balloon.c1 { --bc: #ff8a7f; } .balloon.c2 { --bc: #7fcfff; } .balloon.c3 { --bc: #ffd866; } .balloon.c4 { --bc: #95e8c3; } .balloon.c5 { --bc: #c3b1ff; } .balloon.c6 { --bc: #ffb3cb; }
.balloon.popped { animation: popped .35s forwards; pointer-events: none; }
.balloon.hint { animation: wiggle .5s 3; }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes popped { 40% { transform: scale(1.25); opacity: .9; } 100% { transform: scale(.2); opacity: 0; } }
@keyframes wiggle { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.hint-line { text-align: center; color: var(--muted); font-weight: 700; }

/* memory */
.memory { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 460px; width: 100%; margin: 0 auto; }
.memory.n8 { grid-template-columns: repeat(4, 1fr); }
.card { position: relative; }
.memory .card { aspect-ratio: 1; border: 2.5px solid var(--ink); border-radius: 18px; background: var(--c5); box-shadow: 0 4px 0 var(--ink); padding: 6px; display: grid; place-items: center; color: #fff; transition: transform .25s; }
.memory .card .face { display: none; text-align: center; }
.memory .card .back svg { width: 38px; height: 38px; color: #fff; opacity: .85; }
.memory .card.up { background: var(--paper); color: var(--ink); transform: rotateY(360deg); }
.memory .card.up .face { display: grid; place-items: center; gap: 4px; }
.memory .card.up .back { display: none; }
.memory .card.done { background: var(--good-bg); border-color: var(--good); box-shadow: none; }
.memory .face img.pe { width: 46px; height: 46px; }
.memory .face .dice.mini, .memory .face .objs { transform: scale(.9); }

/* sort */
.sortbox { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.sortitem { min-width: 150px; min-height: 110px; border: 2.5px solid var(--ink); border-radius: 22px; background: var(--paper); box-shadow: var(--lift), 0 4px 0 var(--ink); display: grid; place-items: center; padding: 12px 18px; font: 600 26px var(--display); text-align: center; }
.sortitem small { font: 600 16px var(--body); color: var(--muted); }
.bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; width: 100%; }
.bin { min-height: 110px; border: 2.5px solid var(--ink); border-radius: 0 0 26px 26px; border-top-width: 6px; background: linear-gradient(#fff, #f2f6ff); box-shadow: 0 4px 0 var(--ink); display: grid; place-items: center; gap: 4px; padding: 10px; font: 500 18px var(--display); }
.bin b { font: 600 18px var(--display); }
.bin .count { font: 700 13px var(--body); color: var(--muted); }
.bin .count::after { content: ' in here'; }
.bin.hint { box-shadow: 0 0 0 5px var(--c3), 0 4px 0 var(--ink); }

/* number line */
.numline { position: relative; width: 100%; max-width: 640px; margin: 0 auto; padding-top: 52px; }
.nl-track { position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); border-top: 4px solid var(--ink); }
.tick { position: relative; background: none; border: 0; padding: 14px 0 6px; display: grid; justify-items: center; gap: 6px; min-height: 64px; }
.tick i { position: absolute; top: -12px; width: 4px; height: 20px; background: var(--ink); border-radius: 2px; }
.tick span { font: 600 clamp(15px, 3.6vw, 20px) var(--display); min-width: 34px; min-height: 34px; display: grid; place-items: center; border-radius: 12px; border: 2px solid transparent; }
.tick:hover span, .tick:focus-visible span { border-color: var(--line); }
.tick:empty span, .tick span:empty { min-width: 26px; }
.tick span:empty::after { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--soft); border: 2px solid var(--line); }
.tick.right span { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.tick.wrong span { background: var(--bad-bg); border-color: var(--bad); }
.frog { position: absolute; top: 4px; left: calc((var(--p) + .5) / var(--n, 11) * 100%); transform: translateX(-50%); transition: left .5s cubic-bezier(.3, 1.6, .5, 1); }
.numline .frog img.pe { width: 44px; height: 44px; }

/* set the clock */
.clockset { display: grid; gap: 14px; justify-items: center; }
.clockbtns { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }
.clockbtns > div { display: flex; align-items: center; gap: 8px; }
.clockbtns small { font: 700 15px var(--body); color: var(--muted); }
.clockbtns .key { width: 56px; min-height: 52px; }
.digital { font: 600 30px var(--display); background: var(--ink); color: #9dffcf; border-radius: 12px; padding: 4px 16px; font-variant-numeric: tabular-nums; }

/* shade */
.shade { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 6px; max-width: 460px; width: 100%; margin: 0 auto; }
.shade .sh { aspect-ratio: 1; border: 2.5px solid var(--ink); background: var(--paper); border-radius: 10px; padding: 0; }
.shade.bar { gap: 0; border: 2.5px solid var(--ink); border-radius: 12px; overflow: hidden; }
.shade.bar .sh { aspect-ratio: auto; height: 70px; border: 0; border-right: 2.5px solid var(--ink); border-radius: 0; }
.shade.bar .sh:last-child { border-right: 0; }
.shade.frame { max-width: 320px; gap: 4px; }
.shade .sh.on { background: var(--c2); }
.shade.frame .sh.on { background: var(--c1); }
.shade.objects { max-width: 420px; gap: 10px; }
.shade .sh.obj { aspect-ratio: 1; display: grid; place-items: center; position: relative; border-radius: 18px; border-color: var(--line); }
.shade .sh.obj img.pe { width: 70%; height: 70%; }
.shade .sh.obj.on { background: #dff1ff; border-color: var(--c2); }
.shade .sh.obj b { position: absolute; top: 4px; right: 6px; font: 600 16px var(--display); color: var(--c2); }

/* tracing */
.tracepad { width: 100%; max-width: 560px; margin: 0 auto; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 24px; box-shadow: var(--lift); padding: 6px; }
svg.trace { width: 100%; height: auto; max-height: 46vh; touch-action: none; display: block; }
.trace .rules line { stroke: #9fb6e6; stroke-width: 1.2; }
.trace .rules .mid { stroke-dasharray: 4 4; }
.trace .rules .desc { stroke: #d5def2; }
.trace .g { fill: none; stroke: #cfd9ee; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 0.1 6; }
.trace .g.now { stroke: #9fb6e6; }
.trace .traced { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.trace .user { fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.trace .user.fade { opacity: 0; transition: opacity .3s; }
.trace .start { fill: var(--good); stroke: #fff; stroke-width: 2; }
.trace .num { fill: #fff; font: 600 7px var(--display); text-anchor: middle; pointer-events: none; }
.trace .arrow { fill: none; stroke: var(--c1); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.trace .demo-stroke { fill: none; stroke: var(--c5); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.tracetools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: center; }
.inks, .sizes { display: flex; gap: 6px; background: var(--paper); border: 2px solid var(--line); border-radius: 999px; padding: 5px; }
.ink-dot { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .15); padding: 0; }
.ink-dot.rainbow { background: conic-gradient(#ff5d4f, #ffc531, #6fdcab, #36b3ff, #9b7bff, #ff5d4f); }
.ink-dot[aria-pressed='true'], .size[aria-pressed='true'] { outline: 3px solid var(--ink); outline-offset: 1px; }
.size { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--soft); display: grid; place-items: center; padding: 0; }
.size i { border-radius: 50%; background: var(--ink); display: block; }

/* clue + feedback */
.cluebox { background: var(--warn-bg); border: 2px solid #f2d36b; border-radius: 16px; padding: 12px 16px; font-weight: 600; display: flex; gap: 8px; align-items: flex-start; flex-direction: column; }
.cluebox svg.ui { color: #c48a00; }
.cluebox ol { margin: 4px 0 0; padding-left: 22px; font-weight: 600; }
.feedback { min-height: 32px; text-align: center; font: 600 22px var(--display); }
.feedback.ok { color: var(--good); }
.feedback.no { color: var(--bad); }
.next { display: flex; justify-content: center; }

/* intro + learn */
.intro-screen .introbox { flex: 1; display: grid; gap: 18px; align-content: center; justify-items: center; padding-block: 14px; }
.bubble { position: relative; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 24px; padding: 16px 20px; max-width: 520px; box-shadow: var(--lift); display: grid; gap: 8px; justify-items: start; }
.bubble::before { content: ''; position: absolute; top: -12px; left: 50%; width: 20px; height: 20px; background: var(--paper); border-left: 2.5px solid var(--ink); border-top: 2.5px solid var(--ink); transform: translateX(-50%) rotate(45deg); }
.bubble b { font: 600 24px var(--display); }
.bubble p { font-size: 18px; color: var(--ink2); }
.modes { display: grid; gap: 12px; width: 100%; max-width: 520px; }
.mode { display: flex; align-items: center; gap: 14px; text-align: left; border: 2.5px solid var(--ink); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); padding: 14px 18px; }
.mode:active { transform: translateY(3px); box-shadow: none; }
.mode > svg.ui { width: 34px; height: 34px; color: var(--c2); }
.mode span { display: grid; }
.mode b { font: 600 21px var(--display); }
.mode small { color: var(--muted); font-weight: 600; }
.mode.go { background: var(--c1); color: #fff; }
.mode.go > svg.ui { color: #fff; }
.mode.go small { color: #ffe6e3; }
.learn .steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: s; }
.learn .steps li { counter-increment: s; background: var(--paper); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px 12px 52px; position: relative; font-weight: 600; font-size: 18px; }
.learn .steps li::before { content: counter(s); position: absolute; left: 12px; top: 10px; width: 28px; height: 28px; border-radius: 50%; background: var(--c2); color: #fff; font: 600 16px/28px var(--display); text-align: center; }
.learn .steps li.answer { background: var(--good-bg); border-color: var(--good); }
.learn .steps li.answer::before { content: '✓'; background: var(--good); }

/* results */
.done { text-align: center; display: grid; gap: 14px; justify-items: center; padding-block: 24px; }
.done h1 { font-size: 40px; }
.resline { font-size: 20px; }
.bigstars { display: flex; gap: 6px; }
.bigstars i { color: var(--line); display: inline-flex; }
.bigstars svg.ui { width: 68px; height: 68px; }
.bigstars i.on { color: #f7b500; animation: starin .5s both; }
.bigstars i:nth-child(2) { animation-delay: .2s; }
.bigstars i:nth-child(3) { animation-delay: .4s; }
@keyframes starin { from { transform: scale(0) rotate(-90deg); } to { transform: none; } }
.bigscore { display: flex; align-items: center; gap: 10px; font: 600 64px var(--display); }
.bigscore svg.ui { width: 60px; height: 60px; color: #f7b500; }
.done .row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* parent area */
.ptabs { display: flex; gap: 6px; background: var(--paper); border: 2px solid var(--line); border-radius: 18px; padding: 6px; overflow-x: auto; }
.ptabs button { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; border-radius: 12px; padding: 10px 12px; font: 500 16px var(--display); color: var(--muted); min-height: 46px; }
.ptabs button[aria-selected='true'] { background: var(--ink); color: #fff; }
.stack { display: grid; gap: 14px; }
.kidcard summary { list-style: none; display: flex; align-items: center; gap: 14px; cursor: pointer; }
.kidcard summary::-webkit-details-marker { display: none; }
.kidcard .chev { transition: transform .2s; color: var(--muted); }
.kidcard[open] .chev { transform: rotate(90deg); }
.kidcard img.pe.av { width: 52px; height: 52px; }
.subj { margin-top: 18px; display: grid; gap: 8px; }
.subjhead { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.subjhead span { color: var(--muted); font-weight: 600; }
.meter { height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--c4); }
.rows { display: grid; gap: 6px; }
.rrow { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 12px; background: var(--soft); }
.rrow.dim { opacity: .6; grid-template-columns: 30px 1fr auto; }
.rrow img.pe.ri { width: 26px; height: 26px; }
.rrow small { color: var(--muted); font-weight: 600; }
.rrow .stars svg.ui { width: 16px; height: 16px; }
@media (max-width: 480px) { .rrow { grid-template-columns: 26px 1fr auto; } .rrow small { grid-column: 2 / -1; } }
.kidrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.kidrow img.pe.av { width: 52px; height: 52px; }
.kidrow .confirm { width: 100%; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.setting { display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 6px 0; cursor: pointer; }
.setting div { display: grid; }
.setting small { color: var(--muted); }
.switch { appearance: none; width: 56px; height: 32px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch:checked { background: var(--good); }
.switch:checked::after { left: 28px; }
.row2 { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700; background: var(--soft); }
.pill.on { background: var(--good-bg); color: #116b47; }
.pill.off { background: var(--bad-bg); color: #a3262b; }
.pill.temp { background: var(--warn-bg); color: #7a5a00; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats div { background: var(--soft); border-radius: 16px; padding: 12px; text-align: center; display: grid; }
.stats b { font: 600 30px var(--display); }
.stats small { color: var(--muted); font-weight: 700; }
.ownerform { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.ownerform label { display: grid; gap: 6px; font-weight: 700; flex: 1 1 240px; }
.ownerform label:nth-child(2) { flex: 0 1 100px; }
.ownerform .btn { min-height: 52px; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.scroll { overflow-x: auto; }
.empty { text-align: center; display: grid; gap: 10px; justify-items: center; }

/* paywall */
.price { display: grid; gap: var(--gap); }
@media (min-width: 640px) { .price { grid-template-columns: 1fr 1fr; } }
.plan { position: relative; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 24px; padding: 22px; box-shadow: var(--shadow); display: grid; gap: 10px; align-content: start; }
.plan .amt { font: 600 40px var(--display); }
.plan .amt small { font-size: 18px; color: var(--muted); }
.plan ul { padding-left: 20px; margin: 0; display: grid; gap: 4px; }
.plan.pop { background: #fff6d8; }
.ribbon { position: absolute; top: -14px; right: 18px; background: var(--c1); color: #fff; border: 2.5px solid var(--ink); border-radius: 999px; font: 600 14px var(--display); padding: 3px 12px; }
.gate { text-align: center; display: grid; gap: 14px; justify-items: center; max-width: 440px; margin: 0 auto; width: 100%; }
.gate .q { font: 600 44px var(--display); }
.gate .choices { width: 100%; }
.foot { text-align: center; color: var(--muted); font-size: 14px; padding: 8px 16px 32px; }
.spin { display: grid; place-items: center; min-height: 60vh; font: 600 22px var(--display); color: var(--muted); }

@media (max-width: 440px) {
  .choices.n5 { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .choices.n5 .choice { min-height: 64px; font-size: 26px; padding: 6px; }
  .choices.n3 .choice.big { font-size: 26px; }
  .key { min-height: 56px; }
  img.pe.hero { width: 96px; height: 96px; }
  .skills { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .icwrap { width: 66px; height: 66px; }
  img.pe.tileic { width: 44px; height: 44px; }
  .tally span { font-size: 16px; padding: 5px 10px; }
  .sky { grid-template-columns: repeat(4, 1fr); gap: 10px 6px; }
  .scatter { grid-template-columns: repeat(4, 46px); grid-auto-rows: 46px; }
  .scatter img.pe { width: 38px; height: 38px; }
  .tenframe { grid-template-columns: repeat(5, 40px); grid-auto-rows: 40px; }
  .tenframe img.pe { width: 30px; height: 30px; }
  .ptabs button { flex-direction: column; gap: 2px; padding: 8px 6px; font-size: 12px; flex: 1 1 0; min-width: 0; }
  .bar .btn.sm { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- curriculum activities ---------- */
.ribbon { display: block; height: 22px; width: calc(var(--len) * 9%); max-width: 100%; background: var(--c); border: 2.5px solid var(--ink); border-radius: 12px; justify-self: start; }
.choice .ribbon { align-self: flex-start; }
.tower { display: flex; flex-direction: column-reverse; align-items: center; justify-content: flex-start; min-height: 150px; }
.tower i { width: 34px; height: 16px; background: var(--c); border: 2px solid var(--ink); border-radius: 4px; margin-top: -2px; }
.measure.k { display: flex; align-items: center; gap: 8px; }
.measure.k .cubes, .cubes { display: flex; }
.cubes i { width: 26px; height: 26px; background: var(--c, var(--c3)); border: 2px solid var(--ink); margin-right: -2px; }
.counters { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 300px; }
.counters i { width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid var(--ink); }
.counters i.r { background: var(--c1); } .counters i.y { background: var(--c3); }
.scene3 { display: grid; grid-template-columns: repeat(3, 54px); grid-auto-rows: 54px; place-items: center; }
.scene3 img.pe.mid { width: 46px; height: 46px; }
.scene3 .sc-place img.pe.mid { width: 54px; height: 54px; }
.choice .scene3 { grid-template-columns: repeat(3, 40px); grid-auto-rows: 40px; }
.choice .scene3 img.pe.mid { width: 34px; height: 34px; }
.choice .scene3 .sc-place img.pe.mid { width: 40px; height: 40px; }
.balance { position: relative; width: 240px; height: 120px; }
.balance .beam { position: absolute; left: 10px; right: 10px; top: 40px; height: 6px; background: var(--ink); border-radius: 3px; transform: rotate(var(--tilt)); display: flex; justify-content: space-between; }
.balance .pan { margin-top: -54px; width: 70px; height: 54px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 5px solid var(--c2); border-radius: 0 0 30px 30px; transform: rotate(calc(var(--tilt) * -1)); }
.balance .post { position: absolute; left: 50%; top: 40px; width: 8px; height: 74px; margin-left: -4px; background: var(--ink); border-radius: 4px; }
.balance .post::after { content: ''; position: absolute; bottom: -4px; left: -26px; width: 60px; height: 8px; background: var(--ink); border-radius: 4px; }
.picgraph { display: grid; gap: 6px; background: var(--paper); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; min-width: 240px; max-width: 100%; }
.pg-title { font: 600 16px var(--display); text-align: center; }
.pg-row { display: grid; grid-template-columns: minmax(48px, auto) 1fr; align-items: center; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 4px; }
.pg-label { font: 600 15px var(--body); display: flex; align-items: center; gap: 4px; }
.pg-pics { display: flex; flex-wrap: wrap; gap: 3px; }
.pg-half { width: 17px; overflow: hidden; display: inline-flex; }
.pg-key { text-align: right; color: var(--muted); font-weight: 600; }
.pic.graph { width: 320px; }
.shape.solid { width: 84px; height: 84px; }
.shape.lines { width: 120px; height: 120px; }
.visual .shape { width: 120px; height: 120px; }
.seq { align-items: center; }
.seq b.arrow { min-width: 0; height: auto; border: 0; background: none; padding: 0; color: var(--muted); font-size: 24px; }
.intable { border-collapse: collapse; font: 600 20px var(--display); }
.intable th, .intable td { border: 2px solid var(--ink); padding: 6px 18px; text-align: center; }
.intable th { background: var(--soft); }
.passage figure { margin: 10px 0 0; text-align: center; }
.passage figcaption { font-size: 15px; color: var(--muted); font-style: italic; }

/* ---------- sizes that suit young eyes ---------- */
@font-face { font-family: 'Lexend'; font-weight: 400; font-display: swap; src: url(../fonts/lexend-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Lexend'; font-weight: 500; font-display: swap; src: url(../fonts/lexend-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Lexend'; font-weight: 600; font-display: swap; src: url(../fonts/lexend-latin-600-normal.woff2) format('woff2'); }
.pic { width: 230px; }
.pic.wide { width: min(100%, 540px); }
.pic.graph { width: min(100%, 560px); }
.pic.grid { width: min(100%, 330px); }
.pic.clock { width: 250px; }
.visual .shape { width: 160px; height: 160px; }
.choice .shape { width: 96px; height: 96px; }
.choice .shape.solid { width: 100px; height: 100px; }
.visual .shape.lines { width: 170px; height: 170px; }
.coin { width: 66px; height: 66px; }
.coins { max-width: 460px; gap: 8px; }
.pg-pics img.pe.small { width: 40px; height: 40px; }
.picgraph { min-width: min(100%, 320px); padding: 14px 18px; }
.pg-label { font-size: 17px; }
.passage { font-size: 19px; }
.sentence { font-size: 24px; }
.intable { font-size: 24px; }
.intable th, .intable td { padding: 8px 22px; }
.scene3 { grid-template-columns: repeat(3, 66px); grid-auto-rows: 66px; }
.scene3 img.pe.mid { width: 56px; height: 56px; }
.scene3 .sc-place img.pe.mid { width: 64px; height: 64px; }
.choice .scene3 { grid-template-columns: repeat(3, 46px); grid-auto-rows: 46px; }
.choice .scene3 img.pe.mid { width: 40px; height: 40px; }
.choice .scene3 .sc-place img.pe.mid { width: 46px; height: 46px; }
.ribbon { height: 28px; }
.tower i { width: 42px; height: 20px; }
.cubes i { width: 30px; height: 30px; }
.counters i { width: 36px; height: 36px; }
.balance { transform: scale(1.15); margin: 10px 0; }

/* Pre-K to Grade 1: everything bigger and easier to tap */
[data-band='little'] .prompt { font-size: clamp(28px, 7vw, 40px); }
[data-band='little'] .prompt.long { font-size: clamp(22px, 5.4vw, 28px); }
[data-band='little'] .choice { min-height: 96px; }
[data-band='little'] .choice img.pe.big { width: 76px; height: 76px; }
[data-band='little'] img.pe.hero { width: 150px; height: 150px; }
[data-band='little'] .objs img.pe { width: 54px; height: 54px; }
[data-band='little'] .objs.small img.pe, [data-band='little'] .small img.pe { width: 42px; height: 42px; }
[data-band='little'] .pg-pics img.pe.small { width: 48px; height: 48px; }
[data-band='little'] .passage { font-size: 22px; line-height: 1.6; }
[data-band='little'] .choice small { font-size: 18px; }
[data-band='middle'] .passage { font-size: 20px; }
[data-band='middle'] .choice.txt { font-size: 19px; }

/* ---------- Grade 4 and up: a calmer, more grown-up look ---------- */
[data-band='big'] {
  --display: 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bg: #f4f6fa;
  --line: #dde3ee;
  --accent: #2f5bd3;
  --shadow: 0 1px 2px rgba(20, 30, 60, .08), 0 8px 18px -12px rgba(20, 30, 60, .35);
  --lift: 0 12px 28px -16px rgba(20, 30, 60, .4);
}
[data-band='big'] body { background-image: none; font-size: 16px; letter-spacing: -.005em; }
[data-band='big'] h1, [data-band='big'] h2, [data-band='big'] h3 { font-weight: 600; letter-spacing: -.01em; }
[data-band='big'] .btn { border: 0; background: var(--accent); box-shadow: var(--shadow); font-weight: 500; border-radius: 12px; }
[data-band='big'] .btn.alt { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
[data-band='big'] .btn:active, [data-band='big'] .choice:active, [data-band='big'] .key:active, [data-band='big'] .skill:active { transform: none; }
[data-band='big'] .choice, [data-band='big'] .mode, [data-band='big'] .key, [data-band='big'] .tile, [data-band='big'] .tab, [data-band='big'] .bin, [data-band='big'] .card {
  border: 1.5px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
[data-band='big'] .choice { font-weight: 500; font-size: 22px; min-height: 64px; }
[data-band='big'] .choice.big { font-size: clamp(22px, 5.5vw, 30px); min-height: 72px; }
[data-band='big'] .choice.txt { font: 400 17px/1.45 var(--body); }
[data-band='big'] .choice.right { border-color: var(--good); }
[data-band='big'] .choice.wrong { border-color: var(--bad); }
[data-band='big'] .key { font-weight: 500; font-size: 24px; min-height: 58px; }
[data-band='big'] .key.go { background: var(--accent); color: #fff; border-color: var(--accent); }
[data-band='big'] .tile { background: var(--paper); font-weight: 500; }
[data-band='big'] .prompt { font-weight: 600; font-size: clamp(22px, 5vw, 30px); }
[data-band='big'] .prompt.long { font-weight: 500; font-size: clamp(18px, 4.2vw, 22px); }
[data-band='big'] .prompt.xl { font-size: clamp(36px, 10vw, 54px); }
[data-band='big'] .passage { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; font-size: 18px; line-height: 1.7; }
[data-band='big'] .sentence { font: 500 21px/1.5 var(--body); }
[data-band='big'] .answerbox { border-width: 1.5px; border-radius: 14px; }
/* kid home */
[data-band='big'] .kidhead h1 { font-size: 26px; }
[data-band='big'] .upnext { background: var(--paper); border: 1px solid var(--line); border-left: 6px solid var(--acc); border-radius: 16px; }
[data-band='big'] .upnext b { font-weight: 600; font-size: 21px; }
[data-band='big'] .upnext .playbtn { background: var(--accent); }
[data-band='big'] .tab { border: 1.5px solid var(--line); border-radius: 12px; font-size: 18px; min-height: 52px; font-weight: 500; }
[data-band='big'] .tab[aria-selected='true'] { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); background: var(--paper) !important; }
[data-band='big'] .skills { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
[data-band='big'] .skill { grid-template-columns: 46px 1fr; justify-items: start; text-align: left; align-items: center; column-gap: 14px; row-gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-left: 5px solid var(--acc); border-radius: 14px; box-shadow: 0 1px 2px rgba(20, 30, 60, .06); }
[data-band='big'] .skill .icwrap { grid-row: span 2; width: 46px; height: 46px; border-radius: 12px; }
[data-band='big'] .skill img.pe.tileic { width: 30px; height: 30px; }
[data-band='big'] .skill b { font: 500 16px/1.3 var(--display); }
[data-band='big'] .skill .stars svg.ui { width: 15px; height: 15px; }
[data-band='big'] .skill .lock { top: 50%; transform: translateY(-50%); right: 14px; }
[data-band='big'] .skill .free { position: static; grid-column: 2; order: 3; }
[data-band='big'] .skill.locked { box-shadow: none; border-left-color: #c3cad8; }
[data-band='big'] .upsell { border: 1px solid #ecd9a0; border-radius: 16px; }
/* activity intro: a clean card instead of the cartoon bubble */
[data-band='big'] .intro-screen .mascot-wrap { display: none; }
[data-band='big'] .bubble { border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 20px 22px; }
[data-band='big'] .bubble::before { display: none; }
[data-band='big'] .bubble b { font-size: 24px; font-weight: 600; }
[data-band='big'] .bubble p { font-size: 17px; }
[data-band='big'] .mode.go { background: var(--accent); border-color: var(--accent); }
[data-band='big'] .mode b { font-weight: 500; font-size: 19px; }
[data-band='big'] .bigstars svg.ui { width: 52px; height: 52px; }
[data-band='big'] .done h1 { font-size: 32px; }
[data-band='big'] .progress, [data-band='big'] .timer { border: 1.5px solid var(--line); }
[data-band='big'] .playbtn { border: 0; }
.brand { font-family: 'Fredoka', 'Baloo 2', ui-rounded, system-ui, sans-serif; white-space: nowrap; }
.passage p + p { margin-top: 12px; }

/* Grade 12 matrices: 2 × 2 grid with bracket sides */
.mats { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 22px; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.mat { display: inline-grid; grid-template-columns: repeat(2, minmax(2.4em, auto)); gap: 4px 10px; padding: 6px 12px; margin-left: 6px; border-left: 2px solid currentColor; border-right: 2px solid currentColor; border-radius: 6px; vertical-align: middle; }
.mat i { font-style: normal; text-align: center; }
.mats .mx { display: inline-flex; align-items: center; white-space: nowrap; }

/* =====================================================================
   v3 layout: no notebook lines, tighter spacing, three looks by age.
   little = Pre-K–1 (playful), middle = 2–3 (friendly), big = 4–12 (study app)
   ===================================================================== */
body { background-image: none; background-color: var(--bg); }
html:not([data-band='big']) body {
  background:
    radial-gradient(900px 420px at 0% -10%, #fff1cf 0, transparent 60%),
    radial-gradient(800px 420px at 100% 0%, #dff0ff 0, transparent 60%),
    radial-gradient(700px 500px at 50% 110%, #e9fbf2 0, transparent 60%), #f7f9ff;
  background-attachment: fixed;
}
.wrap { gap: 14px; padding-block: 14px 28px; }
.bar .in { min-height: 58px; }
.foot { padding-bottom: 20px; font-size: 13px; }
@media (max-width: 420px) { .brand { font-size: 19px; } .brand svg { width: 32px; height: 32px; } .bar .btn.sm { padding: 0 12px; } }

/* ---------- kid home (Pre-K to Grade 3) ---------- */
.kidhero { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 14px; padding: 14px 16px; border-radius: 24px;
  background: linear-gradient(135deg, #fff 0%, #fff8e6 100%); border: 2px solid #f3e3b5; box-shadow: 0 10px 24px -18px rgba(120, 80, 0, .5); position: relative; overflow: hidden; }
.kidhero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, #ffe08a 0, transparent 70%); opacity: .55; pointer-events: none; }
.kidhero .mascot-wrap { width: 78px; height: 78px; grid-row: span 2; }
.kidhero h1 { font-size: clamp(24px, 6vw, 30px); }
.kh-text { display: grid; gap: 4px; min-width: 0; }
.kh-text p { color: var(--ink2); font-weight: 600; }
.goal { display: flex; align-items: center; gap: 4px; }
.goal i { display: inline-flex; color: #e7dcc0; }
.goal i svg.ui { width: 24px; height: 24px; }
.goal i.on { color: #f7b500; animation: starin .5s both; }
.goal small { margin-left: 6px; font: 600 14px var(--display); color: var(--muted); }
.kidhero .tally { grid-column: 1 / -1; margin: 6px 0 0; flex-wrap: wrap; position: relative; z-index: 1; }
.kidhero .tally span { padding: 4px 12px; font-size: 16px; border-width: 1.5px; }
.gchip { background: #eef3ff !important; color: var(--ink2); }
@media (min-width: 640px) {
  .kidhero { grid-template-columns: auto 1fr auto; }
  .kidhero .tally { grid-column: auto; margin: 0; align-self: start; }
}
.home .upnext { padding: 12px 14px; gap: 14px; border-radius: 22px; }
.home .upnext .icwrap { width: 60px; height: 60px; border-radius: 18px; background: #fff; display: grid; place-items: center; flex: none; }
.home .upnext img.tileic { width: 44px; height: 44px; }
.home .upnext b { font-size: 22px; }
.playbtn { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 93, 79, .45); } 50% { box-shadow: 0 0 0 10px rgba(255, 93, 79, 0); } }
.home .tabs { gap: 10px; }
.home .tab { min-height: 54px; font-size: 20px; border-radius: 18px; }
html:not([data-band='big']) .skills { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 12px; }
html:not([data-band='big']) .skill {
  background: var(--tile); border: 0; border-radius: 22px; padding: 14px 10px 12px; gap: 6px;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--acc) 40%, #fff), 0 12px 20px -16px var(--acc);
  animation: tilein .45s cubic-bezier(.2, .9, .3, 1.3) both; transition: transform .15s;
}
.skill:nth-child(2) { animation-delay: .04s; } .skill:nth-child(3) { animation-delay: .08s; } .skill:nth-child(4) { animation-delay: .12s; }
.skill:nth-child(5) { animation-delay: .16s; } .skill:nth-child(6) { animation-delay: .2s; } .skill:nth-child(n+7) { animation-delay: .24s; }
@keyframes tilein { from { opacity: 0; transform: translateY(14px) scale(.94); } }
html:not([data-band='big']) .skill .icwrap { width: 74px; height: 74px; background: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .05); transition: transform .2s; }
html:not([data-band='big']) .skill b { font-size: 17px; }
html:not([data-band='big']) .skill:active { transform: translateY(4px) scale(.98); box-shadow: 0 1px 0 color-mix(in srgb, var(--acc) 40%, #fff); }
@media (hover: hover) {
  html:not([data-band='big']) .skill:hover { transform: translateY(-3px); }
  html:not([data-band='big']) .skill:hover .icwrap { transform: rotate(-8deg) scale(1.06); }
}
.skill.gold::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .7) 45%, transparent 60%) -200% 0 / 200% 100% no-repeat; animation: shine 3.5s ease-in-out infinite; }
@keyframes shine { 60%, 100% { background-position: 200% 0; } }
html:not([data-band='big']) .skill.locked { background: #f1f3f8; box-shadow: 0 4px 0 #d9dee9; }
.skill .stars svg.ui { width: 18px; height: 18px; }
.home .upsell { border: 2px solid #f0d58a; box-shadow: none; padding: 12px 16px; }
[data-band='little'] .skill .icwrap { width: 84px; height: 84px; }
[data-band='little'] .skill img.pe.tileic { width: 60px; height: 60px; }
[data-band='little'] .skill b { font-size: 18px; }
/* Grades 2–3: same friendly layout, a little calmer */
[data-band='middle'] .kidhero { background: linear-gradient(135deg, #fff 0%, #eef6ff 100%); border-color: #d7e6fb; }
[data-band='middle'] .kidhero::after { background: radial-gradient(circle, #bfe0ff 0, transparent 70%); }
[data-band='middle'] .skill { background: #fff !important; border: 2px solid color-mix(in srgb, var(--acc) 22%, #fff) !important; }
[data-band='middle'] .skill .icwrap { background: var(--tile) !important; width: 64px !important; height: 64px !important; }
[data-band='middle'] .skill img.pe.tileic { width: 44px; height: 44px; }
[data-band='middle'] .home .upnext, [data-band='middle'] .upnext { border-width: 2px; }

/* intro + results for little ones */
.bubble .ibadge img.pe { width: 52px; height: 52px; }
.intro-screen .introbox { gap: 14px; }
.done.fun { padding-block: 10px; gap: 10px; }
.done.fun .mascot-wrap { width: 96px; height: 96px; animation: hop 1s ease-in-out 2; }
@keyframes hop { 30% { transform: translateY(-14px) rotate(-4deg); } 60% { transform: translateY(0) rotate(3deg); } }
.goalline { display: inline-flex; align-items: center; gap: 6px; background: #fff6d8; border-radius: 999px; padding: 6px 14px; font: 600 16px var(--display); }
.goalline svg { color: #f7b500; }
.done .row { margin-top: 4px; }

/* hint label only on the study look */
.iconbtn .lbl { display: none; }
.pmeta { flex: 1; display: grid; gap: 4px; min-width: 0; }
.qcount { display: none; }

/* ---------- Grades 4–12: study app ---------- */
[data-band='big'] { --ink: #172036; --ink2: #364257; --muted: #69748a; --navy: #14213f; }
[data-band='big'] .bar { background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--line); }
[data-band='big'] .bar .btn.sm, [data-band='big'] .iconbtn { box-shadow: none; border: 1px solid var(--line); }
[data-band='big'] .brand { font-family: var(--display); font-size: 19px; }
.study .sic { width: 44px; height: 44px; border-radius: 12px; background: var(--tile, #eef2fb); display: grid; place-items: center; flex: none; }
.study .sic img.pe { width: 28px; height: 28px; }
.meter { display: inline-flex; gap: 3px; vertical-align: 1px; }
.meter i { width: 14px; height: 5px; border-radius: 3px; background: #dfe4ee; }
.meter.l1 i:nth-child(1) { background: #f0a92b; }
.meter.l2 i:nth-child(-n+2) { background: #3b82f6; }
.meter.l3 i { background: #16a34a; }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: radial-gradient(closest-side, var(--ringbg, #1d2e5c) 76%, transparent 78% 100%), conic-gradient(#7dd3a8 calc(var(--p) * 1%), rgba(255, 255, 255, .18) 0); }
.ring b { font: 600 16px var(--display); }
.ring.xl { width: 136px; height: 136px; --ringbg: #fff; background: radial-gradient(closest-side, #fff 80%, transparent 82% 100%), conic-gradient(var(--accent) calc(var(--p) * 1%), #e6ebf4 0); }
.ring.xl b { font-size: 32px; color: var(--ink); }

.dash { display: grid; gap: 16px; align-items: start; }
.dside { display: grid; gap: 12px; }
@media (min-width: 900px) {
  .study.wrap { max-width: 1180px; }
  .dash { grid-template-columns: 340px 1fr; gap: 22px; }
  .dside { position: sticky; top: 76px; }
}
.dhero { background: linear-gradient(140deg, #14213f 0%, #22396f 55%, #2f5bd3 130%); color: #fff; border-radius: 20px; padding: 16px; display: grid; gap: 14px; box-shadow: 0 18px 34px -24px rgba(20, 33, 63, .9); }
.dh-top { display: flex; align-items: center; gap: 12px; }
.dh-top img.pe.av, .dh-top .av { width: 44px; height: 44px; background: rgba(255, 255, 255, .12); border-radius: 50%; padding: 4px; }
.dh-top div { flex: 1; min-width: 0; }
.dh-top small { color: #b9c6e6; font-size: 13px; }
.dh-top h1 { font-size: 22px; color: #fff; }
.dhero .gchip { background: rgba(255, 255, 255, .14) !important; color: #fff; border: 0; border-radius: 999px; padding: 4px 10px; font: 500 13px var(--display); }
.dstats { display: grid; grid-template-columns: auto repeat(3, 1fr); gap: 10px; align-items: center; }
.dstats > div { display: grid; justify-items: center; gap: 4px; text-align: center; }
.dstats > div:first-child { grid-row: span 1; }
.dstats b { font: 600 22px var(--display); color: #fff; }
.dstats b em { font-style: normal; font-size: 14px; color: #9fb0d8; }
.dstats small { font-size: 11.5px; color: #b9c6e6; line-height: 1.2; }
.continue { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; color: inherit; text-decoration: none; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.continue .st { flex: 1; display: grid; gap: 2px; min-width: 0; }
.continue small { font-size: 12px; color: var(--muted); font-weight: 500; }
.continue b { font: 600 17px/1.25 var(--display); }
.lvl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.cbtn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; border-radius: 999px; padding: 9px 14px; font: 500 14px var(--display); white-space: nowrap; }
@media (hover: hover) { .continue:hover, .srow:hover { transform: translateY(-1px); } .continue:hover { box-shadow: 0 14px 26px -18px rgba(20, 30, 60, .5); } }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #e7ebf3; border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 9px; min-height: 40px; font: 500 15px var(--display); color: var(--ink2); }
.seg button[aria-selected='true'] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 30, 60, .15); }
.study .dmain { display: flex !important; flex-direction: column; gap: 18px; }
.unit header { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 10px; margin-bottom: 8px; }
.unit h2 { font-size: 17px; font-weight: 600; }
.unit header > span:not(.ubar) { font-size: 13px; color: var(--muted); }
.ubar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: #e3e8f1; overflow: hidden; }
.ubar i { display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, #16a34a); border-radius: 4px; }
.rows { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: grid; }
@media (min-width: 1180px) { .rows { grid-template-columns: 1fr 1fr; } .rows .srow:nth-child(2) { border-top: 0; } .rows .srow:nth-child(even) { border-left: 1px solid #edf0f6; } }
.srow { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid #edf0f6; color: inherit; text-decoration: none; transition: background .15s, transform .15s; }
.srow:first-child { border-top: 0; }
@media (hover: hover) { .srow:hover { background: #f7f9fd; } }
.srow .st { flex: 1; display: grid; gap: 3px; min-width: 0; }
.srow b { font: 500 15.5px/1.3 var(--display); }
.srow small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.srow .go { color: #a3adc2; display: inline-flex; }
.srow.locked { opacity: .72; }
.srow.locked .sic { filter: grayscale(1); }
.study .upsell { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.study .upsell p { font-weight: 500; }

/* study: activity intro */
.intro-screen.study { gap: 16px; padding-top: 10px; max-width: 680px; }
.intro-screen.study .playtop .iconbtn { width: 40px; height: 40px; }
.crumb { font-size: 13px; color: var(--muted); font-weight: 500; }
.ahead { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.ahead .sic { width: 56px; height: 56px; border-radius: 14px; }
.ahead .sic img.pe { width: 36px; height: 36px; }
.ahead div { display: grid; gap: 6px; }
.ahead h1 { font-size: clamp(22px, 5vw, 28px); }
.ahead p { color: var(--ink2); font-size: 15.5px; line-height: 1.55; }
.study .modes { max-width: none; gap: 10px; }
.study .mode { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: none; background: #fff; transition: transform .15s, box-shadow .15s; }
.study .mode > svg.ui:first-child { width: 26px; height: 26px; color: var(--accent); }
.study .mode > svg.ui:last-child { width: 18px; height: 18px; margin-left: auto; color: #a3adc2; }
.study .mode span { flex: 1; }
.study .mode b { font: 600 17px var(--display); }
.study .mode small { font-weight: 400; font-size: 13.5px; }
.study .mode.go { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 14px 26px -18px rgba(47, 91, 211, .9); }
.study .mode.go > svg.ui { color: #fff !important; }
.study .mode.go small { color: #dbe5ff; }
@media (hover: hover) { .study .mode:hover { transform: translateY(-1px); box-shadow: 0 12px 22px -18px rgba(20, 30, 60, .6); } }
.listen { justify-self: center; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; font-weight: 500; font-size: 14px; }

/* study: question screen */
.play.study .playtop { gap: 12px; }
.play.study .qcount { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.play.study .qcount b { color: var(--ink); }
.play.study .progress { height: 6px; border: 0; background: #e3e8f1; }
.play.study .progress i { background: var(--accent); }
.play.study .iconbtn { width: 40px; height: 40px; }
.play.study .iconbtn.clue { width: auto; padding: 0 14px 0 10px; gap: 6px; display: inline-flex; border-radius: 999px; background: #fff7dd; border: 1px solid #f2d27a; color: #8a5a00; font: 500 14px var(--display); }
.play.study .iconbtn.clue .lbl { display: inline; }
.play.study .qa { gap: 16px; justify-content: flex-start; padding-top: 22px; }

/* study: results */
.done.study { gap: 12px; padding-block: 16px; max-width: 560px; margin: 0 auto; width: 100%; }
.done.study h1 { font-size: 28px; }
.done.study .resline { font-size: 16px; color: var(--ink2); }
.lvlcard { display: grid; gap: 4px; justify-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 18px; width: 100%; }
.lvlcard small { color: var(--muted); font-size: 13px; }
.lvlcard em { font-style: normal; font-size: 13.5px; color: var(--accent); font-weight: 500; }
.done.study .row .btn { min-height: 46px; font-size: 16px; }
.done.study .bigscore svg.ui { color: var(--accent); }
/* softer chrome everywhere */
.bar .iconbtn, .bar .btn.sm { border: 2px solid var(--line); box-shadow: none; }
.home .upnext { border: 2px solid color-mix(in srgb, var(--acc) 35%, #fff); box-shadow: 0 5px 0 color-mix(in srgb, var(--acc) 35%, #fff), 0 14px 24px -18px var(--acc); }
.home .tab { border: 2px solid var(--line); box-shadow: none; }
.home .tab[aria-selected='true'] { border-color: transparent; box-shadow: 0 4px 0 #b9d3f2; }
.home .tab[aria-selected='true'].english { box-shadow: 0 4px 0 #a9dfc4; }
[data-band='big'] .bar .in { max-width: 1180px; }
.kid { border: 2px solid var(--line); box-shadow: 0 5px 0 #dbe4f3, 0 14px 24px -20px rgba(29, 42, 77, .5); transition: transform .15s; }
@media (hover: hover) { .kid:hover { transform: translateY(-3px); } }
.kid.add { box-shadow: none; }
.card { border: 1.5px solid var(--line); }

/* =====================================================================
   v4: consistent spacing, native-app play screen, scale-up on tablets,
   and a Grades 4–12 look that belongs to the same family as the rest.
   ===================================================================== */
:root { --sp: 16px; }
@media (min-width: 700px) { :root { --sp: 20px; } }
@media (min-width: 1100px) { :root { --sp: 24px; } }
.wrap { gap: var(--sp); padding-block: var(--sp) calc(var(--sp) * 2); }
html:not([data-band='big']) .skills { gap: var(--sp); }
.home .tabs { gap: var(--sp); }
.dash { gap: var(--sp); }
.dside { gap: var(--sp); }
.study .dmain { gap: calc(var(--sp) + 6px); }
@media (min-width: 700px) {
  html:not([data-band='big']) .skills { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
  .kidhero { padding: 20px 22px; }
  .kidhero .mascot-wrap { width: 96px; height: 96px; }
}

/* ---- play screen: full height, question in the middle, actions within thumb reach ---- */
.play { min-height: 100vh; min-height: 100dvh; padding-bottom: 0; }
.playtop { min-height: 44px; }
.qa { padding-block: 12px 18px; }
.pbar { position: sticky; bottom: 0; z-index: 4; display: flex; align-items: center; gap: 10px;
  margin: 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg) 70%, transparent); }
.pbar .iconbtn { width: 56px; height: 56px; font-size: 26px; border: 2px solid var(--line); box-shadow: 0 3px 0 #d5deee; }
.pbar .iconbtn.clue { width: auto; padding: 0 18px 0 14px; gap: 8px; display: inline-flex; border-radius: 999px; background: #fff3c4; border-color: #f2d36b; box-shadow: 0 3px 0 #e8c35a; color: #7a5200; }
.pbar .iconbtn.clue .lbl { display: inline; font: 600 18px var(--display); }
.pbar .iconbtn.exit { color: var(--muted); }
.pbar .iconbtn[hidden] { display: none; }
.keyidea { background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 0 16px; margin-bottom: 6px; }
.keyidea summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 12px 0; font: 600 15px var(--display); color: var(--ink2); }
.keyidea summary::-webkit-details-marker { display: none; }
.keyidea summary svg { color: #e0a400; }
.keyidea p { padding-bottom: 14px; color: var(--ink2); font-size: 15.5px; line-height: 1.6; }

/* Tablets and computers: the activity grows to use the screen instead of sitting small in the middle */
@media (min-width: 700px) {
  .play { max-width: 980px; }
  .qa { zoom: 1.22; }
  .pbar .iconbtn { width: 62px; height: 62px; }
}
@media (min-width: 700px) and (min-height: 1000px) { .qa { zoom: 1.38; } }
@media (min-width: 1100px) and (max-height: 900px) { .qa { zoom: 1.15; } }
@media (max-height: 700px) and (min-width: 700px) { .qa { zoom: 1; } }
@media (min-width: 700px) { .intro-screen .introbox, .intro-screen.study .ahead, .intro-screen.study .modes, .done { zoom: 1.12; } }

/* ---- Grades 4–12: same family as the rest of the app, more grown-up ---- */
[data-band='big'] {
  --display: 'Fredoka', 'Lexend', system-ui, sans-serif;
  --body: 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --accent: #ef5444;
  --bg: #f6f8fd;
}
[data-band='big'] body {
  background:
    radial-gradient(900px 420px at 0% -10%, #fff3dc 0, transparent 60%),
    radial-gradient(800px 420px at 100% 0%, #e6f1ff 0, transparent 60%), #f6f8fd;
  background-attachment: fixed;
}
[data-band='big'] h1, [data-band='big'] h2, [data-band='big'] .srow b, [data-band='big'] .continue b, [data-band='big'] .study .mode b { font-family: var(--display); font-weight: 500; letter-spacing: 0; }
.dhero { background: linear-gradient(135deg, #fff 0%, #fff8ea 60%, #eef5ff 100%); color: var(--ink); border: 2px solid #f1e3bf; box-shadow: 0 10px 24px -18px rgba(120, 80, 0, .45); }
.dh-top small { color: var(--muted); }
.dh-top h1 { color: var(--ink); font-size: 26px; }
.dh-top img.pe.av, .dh-top .av { background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }
.dhero .gchip { background: #eef3ff !important; color: var(--ink2); }
.dstats b { color: var(--ink); }
.dstats b em { color: var(--muted); }
.dstats small { color: var(--muted); }
.dstats > div { background: #fff; border-radius: 14px; padding: 8px 4px; border: 1px solid #f0e7d2; }
.dstats > div:first-child { background: transparent; border: 0; padding: 0; }
.ring { background: radial-gradient(closest-side, #fff 74%, transparent 76% 100%), conic-gradient(var(--accent) calc(var(--p) * 1%), #f1e6d0 0); }
.ring b { color: var(--ink); }
.ring.xl { background: radial-gradient(closest-side, #fff 80%, transparent 82% 100%), conic-gradient(var(--accent) calc(var(--p) * 1%), #ece3cf 0); }
.continue { border: 2px solid color-mix(in srgb, var(--acc) 30%, #fff); box-shadow: 0 5px 0 color-mix(in srgb, var(--acc) 28%, #fff), 0 14px 24px -20px var(--acc); border-radius: 18px; }
.continue .sic, .srow .sic { background: var(--tile); }
.cbtn { background: var(--accent); }
.seg { background: #fff; border: 2px solid var(--line); border-radius: 16px; }
.seg button { min-height: 44px; font: 500 16px var(--display); border-radius: 12px; }
.seg button[aria-selected='true'] { background: #eef5ff; color: var(--ink); box-shadow: inset 0 0 0 2px #bcd6f6; }
.rows { border: 2px solid var(--line); border-radius: 18px; box-shadow: 0 4px 0 #e3e9f4; }
.srow { padding: 13px 16px; }
.srow b { font-size: 16.5px; }
.srow .sic { border-radius: 14px; width: 46px; height: 46px; }
.srow .sic img.pe { width: 30px; height: 30px; }
.unit h2 { font-size: 19px; }
.ubar i { background: linear-gradient(90deg, #ffb340, var(--accent)); }
.meter.l2 i:nth-child(-n+2) { background: #2f80ed; }
[data-band='big'] .btn { background: var(--accent); border-radius: 999px; }
[data-band='big'] .btn.alt { background: #fff; border: 2px solid var(--line); }
.ahead, .lvlcard, .study .mode, .keyidea { border-width: 2px; }
.ahead { border-radius: 20px; }
.study .mode { border-radius: 18px; border: 2px solid var(--line); box-shadow: 0 4px 0 #e3e9f4; }
.study .mode.go { background: var(--accent); border-color: var(--accent); box-shadow: 0 5px 0 #c63b2d; }
.study .mode.go small { color: #ffe1dc; }
.study .mode > svg.ui:first-child { color: var(--accent); }
.play.study .progress { height: 10px; border-radius: 999px; }
.play.study .progress i { background: linear-gradient(90deg, #ffb340, var(--accent)); }
.play.study .qcount { font-size: 14px; }
[data-band='big'] .choice { border: 2px solid var(--line); box-shadow: 0 4px 0 #e3e9f4; border-radius: 16px; }
[data-band='big'] .key { border: 2px solid var(--line); box-shadow: 0 3px 0 #e3e9f4; border-radius: 14px; }
[data-band='big'] .key.go { background: var(--accent); border-color: var(--accent); box-shadow: 0 4px 0 #c63b2d; }
[data-band='big'] .choice.right { box-shadow: 0 4px 0 var(--good); }
[data-band='big'] .answerbox { border: 2px solid var(--line); }
.lvlcard em { color: var(--accent); }
.play.study .qa { justify-content: center; padding-top: 12px; }
.play.study .pbar .iconbtn { width: 52px; height: 52px; }
.play.study .pbar .iconbtn.clue { width: auto; height: 52px; padding: 0 18px 0 14px; font-size: 22px; }
.play.study .pbar .iconbtn.clue .lbl { font: 500 17px var(--display); }
.progress { border: 0; height: 14px; background: #e3e9f4; }
.progress i { background: linear-gradient(90deg, #6fdcab, #2fc58a); border-radius: 999px; }
.pmeta .progress { margin-top: 2px; }
@media (min-width: 700px) { .play.study .qcount { font-size: 15px; } .playtop { padding-top: 8px; } }
