/* Learning Jackets Academy (formerly Firefly Academy / Lantern Learning): a bright, single-theme kids' app. Big tap targets, rounded type, gentle motion. */
:root {
  --ink: #2B2D42; --ink-soft: #5C6178; --white: #fff;
  --sky-top: #6EC8FF; --sky-bottom: #D9F4FF;
  --coral: #FF6F61; --coral-d: #D94E41;
  --teal: #22B8A7; --teal-d: #17897C;
  --purple: #8B78FF; --purple-d: #6652E0;
  --orange: #FF9F1C; --orange-d: #D97F05;
  --pink: #FF7EAD; --pink-d: #DB5888;
  --blue: #3D9BFF; --blue-d: #1F76D6;
  --green: #3CCB6A; --green-d: #279C4E;
  --yellow: #FFD23F; --yellow-d: #E0AE0B;
  --card-shadow: 0 8px 0 rgba(0, 0, 0, .12);
  --f-head: "Fredoka", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --f-read: "Andika", "Comic Neue", "Trebuchet MS", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--f-read); color: var(--ink); background: var(--sky-bottom);
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 4px solid var(--purple); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--f-head); margin: 0; text-wrap: balance; }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 1000; overflow: hidden; }

/* ---------- Scenes ---------- */
.scene { position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden; background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom) 65%); }
.scene-night { background: linear-gradient(180deg, #1C2A5E, #3B4E8C 70%); }
.scene-castle { background: linear-gradient(180deg, #B9A8FF, #F1E9FF 65%); }
.scene-shop { background: linear-gradient(180deg, #FFC86B, #FFF1D2 65%); }
.scene-tree { background: linear-gradient(180deg, #7FD8C4, #E3FFF6 65%); }
.decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.content {
  position: relative; z-index: 1; min-height: 100%;
  display: flex; flex-direction: column; gap: clamp(10px, 2vh, 20px);
  padding: max(12px, env(safe-area-inset-top)) clamp(12px, 3vw, 32px) max(24px, env(safe-area-inset-bottom));
}
.hills { position: absolute; left: 0; bottom: 0; width: 100%; height: 26vh; }
.sun { position: absolute; top: 4vh; right: 6vw; width: 11vmin; height: 11vmin; border-radius: 50%; background: #FFE066; box-shadow: 0 0 0 1.6vmin rgba(255, 224, 102, .35), 0 0 6vmin rgba(255, 210, 63, .7); animation: glow 4s ease-in-out infinite; }
.cloud { position: absolute; background: #fff; border-radius: 100px; opacity: .92; width: 170px; height: 52px; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 72px; height: 72px; top: -36px; left: 26px; }
.cloud::after { width: 92px; height: 92px; top: -46px; right: 22px; }
.c1 { top: 10%; animation: drift 70s linear infinite; animation-delay: -10s; }
.c2 { top: 22%; width: 120px; height: 40px; animation: drift 95s linear infinite; animation-delay: -55s; }
.c3 { top: 5%; width: 140px; animation: drift 80s linear infinite; animation-delay: -35s; }
.far { position: absolute; left: 0; bottom: 14vh; width: 100%; height: 34vh; }
.water { position: absolute; left: 0; right: 0; bottom: 0; height: 12vh; background: repeating-linear-gradient(90deg, #5BB8FF 0 40px, #74C6FF 40px 80px); animation: waves 6s linear infinite; z-index: 1; }
.flowers span, .trees span { position: absolute; bottom: 2vh; font-size: clamp(26px, 5vw, 48px); z-index: 1; }
.flowers span { animation: sway 3s ease-in-out infinite; transform-origin: bottom center; }
.trees span { bottom: 6vh; font-size: clamp(40px, 8vw, 80px); }
.stars i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #FFF6C9; animation: twinkle 2.4s ease-in-out infinite; }
.moon { position: absolute; top: 6vh; right: 8vw; font-size: 12vmin; }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; gap: 12px; }
.round-btn {
  width: clamp(52px, 7vw, 68px); height: clamp(52px, 7vw, 68px); flex: none;
  border-radius: 50%; border: 0; background: #fff; box-shadow: 0 5px 0 rgba(0, 0, 0, .15);
  font-size: clamp(24px, 3.4vw, 32px); display: grid; place-items: center; cursor: pointer;
}
.round-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.title { font-family: var(--f-head); font-weight: 700; font-size: clamp(22px, 4vw, 40px); color: var(--ink); text-shadow: 0 2px 0 rgba(255, 255, 255, .85), 0 0 14px rgba(255, 255, 255, .9); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.points-pill, .timer-pill {
  background: #fff; border-radius: 999px; padding: 8px 16px; font-family: var(--f-head); font-weight: 700;
  font-size: clamp(18px, 3vw, 28px); box-shadow: 0 5px 0 rgba(0, 0, 0, .12); display: flex; gap: 6px; align-items: center; white-space: nowrap;
}
.points-pill.bump { animation: bump .5s; }

/* ---------- Buttons ---------- */
.kbtn {
  font-family: var(--f-head); font-weight: 600; font-size: clamp(20px, 3vw, 28px);
  border: 0; border-radius: 24px; padding: 14px 24px; color: #fff;
  background: var(--c, var(--coral)); box-shadow: 0 7px 0 var(--cd, var(--coral-d));
  cursor: pointer; transition: transform .08s, box-shadow .08s;
}
.kbtn:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--cd, var(--coral-d)); }
.kbtn:disabled { opacity: .4; }
.kbtn.huge { font-size: clamp(28px, 5vw, 44px); padding: 20px 44px; border-radius: 36px; }
.c-coral { --c: var(--coral); --cd: var(--coral-d); }
.c-teal { --c: var(--teal); --cd: var(--teal-d); }
.c-purple { --c: var(--purple); --cd: var(--purple-d); }
.c-orange { --c: var(--orange); --cd: var(--orange-d); }
.c-pink { --c: var(--pink); --cd: var(--pink-d); }
.c-blue { --c: var(--blue); --cd: var(--blue-d); }
.c-green { --c: var(--green); --cd: var(--green-d); }
.c-yellow { --c: var(--yellow); --cd: var(--yellow-d); color: var(--ink); }
.c-white { --c: #fff; --cd: #C9D3E3; color: var(--ink); }
.c-explore { --c: #FFE3D1; --cd: #F2B48D; }
.c-seed { --c: #EDE6FF; --cd: #C3B3F2; }
.glowbtn { animation: pulse 1.8s ease-in-out infinite; }
.row-center { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; }

.hold {
  position: relative; overflow: hidden; border: 0; border-radius: 22px; padding: 14px 22px; background: #fff;
  font-family: var(--f-head); font-weight: 600; font-size: clamp(16px, 2.4vw, 22px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .12); cursor: pointer; touch-action: none;
}
.hold .fill { position: absolute; inset: 0; width: 0; background: rgba(60, 203, 106, .4); }
.hold span { position: relative; }

/* ---------- Speech bubble ---------- */
.bubble {
  position: relative; background: #fff; border-radius: 24px; padding: 14px 20px; box-shadow: var(--card-shadow);
  font-size: clamp(19px, 2.8vw, 26px); line-height: 1.35; flex: 1; min-width: 0;
}
.bubble::before { content: ""; position: absolute; left: -12px; bottom: 22px; border: 12px solid transparent; border-right-color: #fff; border-left: 0; }
.bubble.big { font-size: clamp(22px, 3.4vw, 32px); font-family: var(--f-head); font-weight: 600; }
.hero-row, .buddy-row, .hello { display: flex; align-items: flex-end; gap: 14px; max-width: 900px; margin: 0 auto; width: 100%; }

/* ---------- Characters ---------- */
.char { display: block; height: auto; overflow: visible; }
.char-xs { width: clamp(44px, 6vw, 64px); }
.char-sm { width: clamp(60px, 9vw, 90px); }
.char-md { width: clamp(84px, 13vw, 140px); }
.char-lg { width: clamp(120px, 19vw, 210px); }
.char-xl { width: clamp(150px, 26vw, 300px); }
.char-story { width: calc(var(--s) * 1cqw); }
.char .glow, .char .eye, .char .wing, .char .tail, .char .ear, .char .arm, .char .mouth-talk, .char .tip { transform-box: fill-box; }
.char .glow { transform-origin: center; animation: glow 2.4s ease-in-out infinite; }
.char .tip { transform-origin: center; animation: glow 1.6s ease-in-out infinite; }
.char .wing-l { transform-origin: right center; animation: flapL .4s ease-in-out infinite; }
.char .wing-r { transform-origin: left center; animation: flapR .4s ease-in-out infinite; }
.char .eye { transform-origin: center; animation: blink 4.2s infinite; }
.char .tail { transform-origin: 0% 100%; animation: wag 1.4s ease-in-out infinite; }
.char .ear { transform-origin: 50% 100%; }
.bea .ear-l { animation: earL 3.2s ease-in-out infinite; }
.bea .ear-r { animation: earR 3.2s ease-in-out infinite .3s; }
.char .arm { transform-origin: 30% 90%; }
.char.waving .arm { animation: wave .7s ease-in-out infinite; }
.lumi .mouth-talk, .jax .mouth-talk { opacity: 0; transform-origin: center; }
.jax.talking .mouth { opacity: 0; }
.jax.talking .mouth-talk { opacity: 1; animation: talk .2s ease-in-out infinite alternate; }
.lumi.talking .mouth { opacity: 0; }
.lumi.talking .mouth-talk { opacity: 1; animation: talk .2s ease-in-out infinite alternate; }
.bob { animation: bob 3s ease-in-out infinite; flex: none; }
.char.happy { animation: jump .7s ease; }
.char.tilt { animation: tilt .8s ease; }
.char.dancing { animation: dance .9s ease-in-out infinite; }
.dancers .d2 .char { animation-delay: -.3s; }
.dancers .d3 .char { animation-delay: -.6s; }

/* ---------- Start & home ---------- */
.start { margin: auto; display: grid; justify-items: center; gap: 18px; text-align: center; padding-bottom: 14vh; }
/* ---------- Family-facing landing page ---------- */
.landing { width: min(100%, 1320px); margin: 0 auto; font-family: var(--f-read); }
.landing a { color: inherit; text-decoration: none; }
.land-nav { display: flex; align-items: center; gap: 28px; min-height: 74px; padding: 4px 2px 18px; }
.land-brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-head); font-size: clamp(18px, 2vw, 25px); font-weight: 700; line-height: .95; white-space: nowrap; }
.land-brand small { display: block; color: #4b5878; font-size: .53em; letter-spacing: .18em; text-transform: uppercase; margin-top: 5px; }
.land-brand-mark { display: grid; place-items: center; width: 49px; height: 49px; background: #fff; border-radius: 16px; box-shadow: 0 4px 0 rgba(43,45,66,.1); font-size: 27px; transform: rotate(-7deg); }
.land-nav nav { display: flex; gap: clamp(12px, 2vw, 28px); margin-left: auto; font-family: var(--f-head); font-weight: 600; font-size: 16px; }
.land-nav nav a { padding: 10px 2px; }
.land-nav nav a:hover, .land-nav nav a:focus-visible { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 7px; }
.land-nav-cta, .land-primary { border: 0; cursor: pointer; font-family: var(--f-head); font-weight: 700; color: var(--ink); background: var(--yellow); box-shadow: 0 6px 0 #dca812; }
.land-nav-cta { border-radius: 18px; padding: 12px 18px; font-size: 17px; white-space: nowrap; }
.land-primary { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 63px; border-radius: 21px; padding: 14px 25px; font-size: clamp(19px, 2.4vw, 24px); }
.land-nav-cta:hover, .land-primary:hover { background: #ffe06e; transform: translateY(-2px); }
.land-nav-cta:active, .land-primary:active { transform: translateY(4px); box-shadow: 0 2px 0 #dca812; }
.land-hero { display: grid; grid-template-columns: 1.07fr .93fr; align-items: center; gap: clamp(20px, 4vw, 60px); min-height: min(690px, 76vh); padding: clamp(22px, 5vw, 74px) clamp(16px, 5vw, 76px); background: #fff9ec; border-radius: 44px; box-shadow: 0 13px 0 rgba(43,45,66,.13); overflow: hidden; position: relative; }
.land-hero::before { content: ''; position: absolute; width: 250px; height: 250px; left: -135px; top: -155px; background: #ffe992; border-radius: 50%; opacity: .65; }
.land-hero-copy { position: relative; z-index: 2; }
.land-eyebrow, .land-kicker { display: inline-flex; align-items: center; gap: 9px; font-family: var(--f-head); font-size: 14px; letter-spacing: .11em; font-weight: 700; text-transform: uppercase; color: #775a15; }
.land-eyebrow { padding: 9px 14px; background: #fff0b7; border-radius: 999px; letter-spacing: .02em; text-transform: none; font-size: 16px; }
.land-hero h1 { margin: 20px 0 20px; font-size: clamp(48px, 5.4vw, 82px); line-height: .99; letter-spacing: -.035em; }
.land-hero h1 em { color: #ef775e; font-style: normal; }
.land-hero-copy > p { max-width: 530px; margin: 0; color: #49516c; font-size: clamp(18px, 1.8vw, 23px); line-height: 1.55; }
.land-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 23px; margin-top: 30px; }
.land-secondary { font-family: var(--f-head); font-size: 19px; font-weight: 600; padding: 14px 5px; border-bottom: 3px solid #ffba6d; }
.land-secondary:hover { color: #b45239; }
.land-hero-note { display: flex; align-items: center; gap: 8px; margin-top: 30px; color: #626b7c; font-size: 14px; }
.land-hero-art { position: relative; min-height: 440px; height: 100%; display: grid; place-items: center; isolation: isolate; }
.land-hero-circle { position: absolute; width: min(100%, 475px); aspect-ratio: 1; border-radius: 50%; background: #bde8fb; border: 16px solid #d9f4ff; box-shadow: inset 0 -25px 0 #a5ddf3; transform: rotate(-9deg); }
.land-hero-circle::after { content: ''; position: absolute; width: 71%; height: 22%; left: 14%; bottom: 6%; border-radius: 50%; background: #91d7a6; }
.land-jax { position: relative; z-index: 2; transform: rotate(4deg); }
.land-jax .char { width: clamp(220px, 25vw, 340px); filter: drop-shadow(0 17px 0 rgba(43,45,66,.12)); }
.land-sun { position: absolute; top: 10%; right: 13%; width: 75px; aspect-ratio: 1; background: #ffd967; border-radius: 50%; box-shadow: 0 0 0 13px rgba(255,217,103,.3); }
.land-spark { position: absolute; z-index: 2; font-family: var(--f-head); color: #ffb447; font-size: 44px; }
.spark-one { top: 5%; left: 18%; }.spark-two { right: 2%; top: 31%; color: #f6879b; }.spark-three { bottom: 8%; left: 18%; color: #5fb8c8; }
.land-ground { position: absolute; width: 76%; height: 38px; bottom: 7%; border-radius: 50%; background: rgba(54,132,118,.15); }
.land-float { position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px; background: #fff; border: 3px solid #f6dfae; border-radius: 18px; padding: 10px 15px; box-shadow: 0 8px 0 rgba(43,45,66,.1); font-family: var(--f-head); font-weight: 600; }
.land-float-top { left: -1%; top: 17%; transform: rotate(-7deg); }.land-float-top span { font-size: 27px; }
.land-float-bottom { right: -2%; bottom: 16%; transform: rotate(5deg); }.land-float-bottom > span { font-size: 32px; }.land-float-bottom small { display: block; font-family: var(--f-read); font-weight: 400; font-size: 12px; }
.land-worlds, .land-how { scroll-margin-top: 20px; padding: clamp(60px, 8vw, 110px) clamp(8px, 3vw, 35px); }
.land-section-heading { text-align: center; max-width: 650px; margin: 0 auto 38px; }
.land-section-heading h2, .land-how h2, .land-close h2 { margin: 8px 0 12px; font-size: clamp(36px, 4vw, 55px); line-height: 1.08; }
.land-section-heading p, .land-how-intro p, .land-close p { margin: 0; color: #4f5970; font-size: 18px; line-height: 1.5; }
.land-world-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.land-world { display: flex; flex-direction: column; align-items: flex-start; min-height: 365px; padding: 24px; border-radius: 30px; border: 3px solid rgba(43,45,66,.1); box-shadow: 0 8px 0 rgba(43,45,66,.1); }
.land-world-seed { background: #f5eaff; }.land-world-explore { background: #ffebd8; }.land-world-trail { background: #def6e9; }
.land-world-icon { display: grid; place-items: center; width: 112px; height: 112px; border-radius: 27px; background: rgba(255,255,255,.75); transform: rotate(-5deg); }
.land-world-icon .char { width: 95px; }
.land-world-tag { margin-top: 22px; color: #625978; font: 700 12px var(--f-head); letter-spacing: .1em; }
.land-world h3 { margin-top: 5px; font-size: clamp(25px, 2.5vw, 32px); }
.land-world p { margin: 9px 0 18px; line-height: 1.5; font-size: 16px; }
.land-world-bottom { display: flex; justify-content: space-between; width: 100%; border-top: 2px dashed rgba(43,45,66,.18); padding-top: 13px; margin-top: auto; font: 600 15px var(--f-head); }
.land-how { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; align-items: center; background: #e9f8f6; border-radius: 38px; }
.land-how-intro { padding-left: clamp(10px, 3vw, 34px); }
.land-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.land-step { position: relative; min-height: 250px; background: #fff; border-radius: 24px; padding: 23px 18px; box-shadow: 0 7px 0 rgba(43,45,66,.09); }
.land-step-num { position: absolute; right: 15px; top: 14px; color: #92a1b2; font: 700 17px var(--f-head); }.land-step-icon { font-size: 43px; }
.land-step h3 { margin: 17px 0 8px; font-size: 22px; }.land-step p { margin: 0; font-size: 14px; line-height: 1.5; color: #515b70; }
.land-close { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: clamp(70px, 8vw, 110px) clamp(8px, 3vw, 35px) 35px; padding: 35px clamp(26px, 5vw, 70px); background: #fff0c0; border-radius: 36px; overflow: hidden; }
.land-close-copy { max-width: 620px; }.land-close p { margin-bottom: 25px; }.land-close-jax .char { width: clamp(130px, 19vw, 225px); }
.land-footer { display: flex; justify-content: space-between; gap: 20px; padding: 18px clamp(8px, 3vw, 35px) 35px; color: #3c6179; font: 600 14px var(--f-head); }
@media (max-width: 950px) { .land-hero { grid-template-columns: 1fr 1fr; padding: 35px; }.land-hero-art { min-height: 380px; }.land-float-top { left: -5%; }.land-float-bottom { right: -4%; }.land-how { grid-template-columns: 1fr; gap: 25px; }.land-how-intro { text-align: center; padding: 0; max-width: 590px; margin: auto; } }
@media (max-width: 720px) { .land-nav { flex-wrap: wrap; justify-content: space-between; gap: 12px; }.land-nav nav { order: 3; width: 100%; justify-content: center; margin: 0; }.land-hero { grid-template-columns: 1fr; min-height: 0; text-align: center; padding: 42px 24px 20px; }.land-hero-copy > p { margin: auto; }.land-hero-actions, .land-hero-note { justify-content: center; }.land-hero-art { min-height: 355px; }.land-hero-circle { width: 330px; }.land-jax .char { width: 260px; }.land-float-top { left: 5%; }.land-float-bottom { right: 2%; }.land-world-grid { grid-template-columns: 1fr; max-width: 500px; margin: auto; }.land-world { min-height: 0; }.land-steps { grid-template-columns: 1fr; }.land-step { min-height: 0; }.land-close { text-align: center; justify-content: center; }.land-close-jax { display: none; } }
@media (max-width: 470px) { .land-brand { font-size: 18px; }.land-brand-mark { width: 43px; height: 43px; }.land-nav-cta { font-size: 14px; padding: 10px; }.land-nav nav { font-size: 14px; }.land-hero { border-radius: 27px; padding: 35px 17px 10px; }.land-hero h1 { font-size: clamp(44px, 12vw, 58px); }.land-hero-art { min-height: 315px; }.land-hero-circle { width: 280px; }.land-jax .char { width: 225px; }.land-float { font-size: 12px; padding: 7px 9px; }.land-float-bottom > span { font-size: 24px; }.land-float-top { top: 12%; left: 0; }.land-float-bottom { bottom: 9%; right: 0; }.land-worlds, .land-how { padding-top: 65px; padding-bottom: 65px; }.land-footer { display: grid; text-align: center; } }
@media (prefers-reduced-motion: reduce) { .landing .bob, .landing .char .wing, .landing .char .eye, .landing .char .arm, .landing .char .tip { animation: none; } }
.logo { font-size: clamp(44px, 9vw, 96px); color: #fff; text-shadow: 0 5px 0 rgba(0, 0, 0, .15); line-height: 1; }
.logo span { color: var(--yellow); }
.logo .logo-sub { display: block; font-size: .42em; letter-spacing: .12em; text-transform: uppercase; margin-top: 6px; }
.home { margin: auto 0; display: grid; gap: clamp(16px, 3vh, 28px); padding-bottom: 12vh; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 22px; max-width: 820px; margin: 0 auto; width: 100%; }
.who {
  border: 0; border-radius: 36px; padding: 18px; background: var(--c); box-shadow: 0 10px 0 var(--cd);
  display: grid; justify-items: center; gap: 4px; cursor: pointer;
}
.who:active { transform: translateY(6px); box-shadow: 0 4px 0 var(--cd); }
.who .name { font-family: var(--f-head); font-weight: 700; font-size: clamp(28px, 4.4vw, 40px); }
.who .tag { font-size: 20px; color: var(--ink-soft); }
.grownup-link { justify-self: center; border: 0; background: rgba(255, 255, 255, .75); border-radius: 999px; padding: 10px 20px; font-family: var(--f-head); font-weight: 600; font-size: 18px; cursor: pointer; }

/* ---------- Quest map ---------- */
.map { position: relative; width: 100%; max-width: 1060px; margin: 0 auto; aspect-ratio: 5 / 3; }
.trail { position: absolute; inset: 0; width: 100%; height: 100%; }
.deco { position: absolute; transform: translate(-50%, -50%); font-size: clamp(22px, 4vw, 44px); pointer-events: none; }
.node {
  position: absolute; transform: translate(-50%, -50%); width: clamp(76px, 12vw, 128px); aspect-ratio: 1;
  border-radius: 50%; background: #fff; border: 6px solid var(--nc); box-shadow: 0 7px 0 rgba(0, 0, 0, .18);
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.node .ic { font-size: clamp(34px, 6vw, 62px); line-height: 1; }
.node .label {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--f-head); font-weight: 600; font-size: clamp(13px, 1.8vw, 19px);
  background: #fff; padding: 2px 12px; border-radius: 999px; box-shadow: 0 3px 0 rgba(0, 0, 0, .12);
}
.node.next { animation: nodePulse 1.5s ease-in-out infinite; }
.node.done { background: #FFF6CC; }
.node.done::after { content: "⭐"; position: absolute; top: -14px; right: -12px; font-size: clamp(26px, 4vw, 40px); animation: pop .5s; }
.walker { position: absolute; transform: translate(-150%, -85%); pointer-events: none; animation: bob 2s ease-in-out infinite; }
@media (max-width: 720px), (max-aspect-ratio: 4/5) {
  .map { aspect-ratio: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 46px 18px; padding-bottom: 20px; }
  .map .trail, .map .deco, .map .walker { display: none; }
  .node { position: relative; left: auto !important; top: auto !important; transform: none; justify-self: center; }
  .node.next { animation-name: nodePulseFlat; }
}
@keyframes nodePulseFlat { 0%, 100% { transform: scale(1); box-shadow: 0 7px 0 rgba(0,0,0,.18), 0 0 0 0 rgba(255, 210, 63, .8); } 50% { transform: scale(1.08); box-shadow: 0 7px 0 rgba(0,0,0,.18), 0 0 0 14px rgba(255, 210, 63, 0); } }

/* ---------- Game layout ---------- */
.game { display: grid; gap: clamp(12px, 2.2vh, 22px); max-width: 900px; margin: 0 auto; width: 100%; align-content: start; }
.qcard {
  position: relative; background: #fff; border-radius: 32px; padding: clamp(14px, 3vw, 28px) clamp(56px, 8vw, 80px);
  box-shadow: 0 10px 0 rgba(0, 0, 0, .1); display: grid; justify-items: center; gap: 6px; text-align: center;
}
.qcard .speak { position: absolute; top: 12px; right: 12px; }
.qlabel { font-size: clamp(16px, 2.2vw, 20px); color: var(--ink-soft); }
.qtext { font-family: var(--f-head); font-weight: 700; font-size: clamp(46px, 10vw, 96px); line-height: 1.1; }
.qtext.reading { font-family: var(--f-read); letter-spacing: .04em; }
.qtext .em { font-size: clamp(80px, 14vw, 140px); }
.instruct { font-size: clamp(16px, 2.2vw, 20px); color: var(--ink-soft); }
.blank { display: inline-block; min-width: 1.2em; color: var(--purple); }
.blank.filled { color: var(--green); animation: pop .4s; }
.qtext.chunked .ch { padding: 0 .06em; border-radius: 10px; }
.qtext.chunked .ch:nth-child(4n+1) { color: var(--coral); }
.qtext.chunked .ch:nth-child(4n+2) { color: var(--blue); }
.qtext.chunked .ch:nth-child(4n+3) { color: var(--green-d); }
.qtext.chunked .ch:nth-child(4n+4) { color: var(--purple); }
.qtext.chunked .ch + .ch { margin-left: .18em; }
.qtext .ch.silent { opacity: .35; }

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 2vw, 20px); }
.choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice {
  border: 0; border-radius: 28px; background: #fff; font-family: var(--f-head); font-weight: 700;
  font-size: clamp(34px, 7vw, 64px); padding: clamp(10px, 2vh, 20px) 8px; min-height: clamp(84px, 14vh, 130px);
  box-shadow: 0 8px 0 rgba(0, 0, 0, .14); cursor: pointer; transition: transform .08s;
}
.choice:active { transform: translateY(5px); box-shadow: 0 3px 0 rgba(0, 0, 0, .14); }
.choice.pic { font-size: clamp(56px, 11vw, 110px); line-height: 1; }
.choice.word { font-family: var(--f-read); font-size: clamp(30px, 5.6vw, 56px); }
.choice.right { background: var(--green); color: #fff; box-shadow: 0 8px 0 var(--green-d); animation: pop .4s; }
.choice.wrong { animation: shake .45s; opacity: .4; }
.choice.reveal, .pic-card.reveal { outline: 6px dashed var(--green); outline-offset: 4px; animation: pulse 1s ease-in-out 2; }

.hint { background: #FFF8D6; border-radius: 24px; padding: 14px; display: grid; gap: 8px; justify-items: center; text-align: center; animation: pop .35s; }
.hint p { margin: 0; font-size: clamp(18px, 2.6vw, 24px); font-weight: 700; }
.objs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.grp { display: flex; flex-wrap: wrap; gap: 4px; max-width: 260px; justify-content: center; font-size: clamp(26px, 4.6vw, 40px); }
.plus { font-family: var(--f-head); font-weight: 700; font-size: clamp(30px, 5vw, 46px); color: var(--purple); }
.obj.gone { position: relative; opacity: .35; }
.obj.gone::after { content: "✖"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--coral-d); font-size: .8em; }
.b10 { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; align-items: flex-end; }
.b10-num { display: grid; justify-items: center; gap: 4px; }
.b10-num b { font-family: var(--f-head); font-size: 28px; }
.num-blocks { display: flex; gap: 4px; align-items: flex-end; flex-wrap: wrap; max-width: 300px; }
.flat { width: 56px; height: 56px; border-radius: 4px; background-color: #8B78FF; background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px); background-size: 5.6px 5.6px; }
.rod { width: 12px; height: 110px; border-radius: 3px; background: repeating-linear-gradient(#3D9BFF 0 10px, #1F76D6 10px 11px); }
.cubes { display: flex; flex-direction: column-reverse; flex-wrap: wrap; height: 110px; gap: 2px; align-content: flex-start; }
.cube { width: 11px; height: 11px; border-radius: 2px; background: var(--orange); }
.array { display: grid; gap: 6px; justify-content: center; }
.dot { width: clamp(14px, 2.4vw, 22px); aspect-ratio: 1; border-radius: 50%; background: var(--purple); }

.climb { position: relative; height: clamp(58px, 9vh, 86px); }
.climb-track { position: absolute; left: 0; right: 48px; bottom: 8px; height: 16px; background: rgba(255, 255, 255, .65); border-radius: 99px; overflow: hidden; }
.climb-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--yellow), var(--orange)); transition: width .6s; }
.climber { position: absolute; bottom: 14px; left: 0; transition: left .8s cubic-bezier(.3, 1.4, .5, 1); }
.climber .boat { font-size: clamp(36px, 6vw, 54px); display: block; animation: bob 2s ease-in-out infinite; }
.climb .goal { position: absolute; right: 0; bottom: 0; font-size: clamp(32px, 5vw, 48px); }

.summary, .card-center {
  background: #fff; border-radius: 36px; padding: clamp(18px, 4vw, 36px);
  display: grid; justify-items: center; gap: 12px; text-align: center; box-shadow: 0 10px 0 rgba(0, 0, 0, .1);
  max-width: 820px; margin: 0 auto; width: 100%; animation: popIn .45s;
}
.summary h2, .card-center h2 { font-size: clamp(28px, 5vw, 48px); }
.bigstars { font-family: var(--f-head); font-weight: 700; font-size: clamp(40px, 8vw, 72px); }
.bigstars small { font-size: .45em; color: var(--green-d); }
.big-read { font-size: clamp(20px, 3vw, 28px); margin: 0; line-height: 1.4; }
.big-emoji { font-size: clamp(48px, 9vw, 90px); }
.dance-row { display: flex; align-items: flex-end; justify-content: center; gap: 14px; flex-wrap: wrap; }
.banner { background: var(--yellow); border-radius: 18px; padding: 10px 18px; font-family: var(--f-head); font-weight: 600; font-size: clamp(16px, 2.4vw, 22px); margin: 0; }
.grownup-tip { background: #F3F0FF; border-radius: 18px; padding: 12px 16px; font-size: 17px; max-width: 620px; text-align: left; }
.sticker-won { font-size: clamp(90px, 18vw, 160px); line-height: 1; animation: stickerIn .9s cubic-bezier(.2, 1.6, .4, 1); }

/* ---------- Seedling ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 3vw, 28px); max-width: 860px; margin: 0 auto; width: 100%; }
.tile {
  border: 0; border-radius: 36px; padding: clamp(14px, 3vw, 28px); display: grid; justify-items: center; gap: 4px;
  color: #fff; background: var(--c); box-shadow: 0 10px 0 var(--cd); cursor: pointer;
  font-family: var(--f-head); font-weight: 700; font-size: clamp(24px, 4vw, 40px); text-shadow: 0 2px 0 rgba(0, 0, 0, .15);
}
.tile:active { transform: translateY(6px); box-shadow: 0 4px 0 var(--cd); }
.tile .ico { font-size: clamp(60px, 12vw, 120px); line-height: 1; animation: bob 3s ease-in-out infinite; text-shadow: none; }
.tile:nth-child(2) .ico { animation-delay: -.8s; }
.tile:nth-child(3) .ico { animation-delay: -1.6s; }
.tile:nth-child(4) .ico { animation-delay: -2.2s; }
.sun-timer {
  --p: 100; flex: none; width: clamp(70px, 10vw, 96px); aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(var(--yellow) calc(var(--p) * 1%), rgba(255, 255, 255, .55) 0);
  display: grid; place-items: center; box-shadow: 0 0 0 6px rgba(255, 210, 63, .35);
}
.sun-timer span { background: #fff; border-radius: 50%; width: 72%; aspect-ratio: 1; display: grid; place-items: center; font-family: var(--f-head); font-weight: 700; font-size: clamp(14px, 2vw, 18px); }

.alphabet { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.alphabet span { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .6); display: grid; place-items: center; font-family: var(--f-head); font-weight: 700; color: #9AA0B4; font-size: 20px; }
.alphabet span.learned { background: var(--yellow); color: var(--ink); }
.alphabet span.now { background: #fff; color: var(--coral); outline: 3px solid var(--coral); }
.stage-area { display: grid; gap: clamp(12px, 2vh, 20px); }
.letter-intro { display: flex; justify-content: center; align-items: center; gap: clamp(16px, 4vw, 40px); flex-wrap: wrap; }
.letter-tile {
  font-family: var(--f-head); font-weight: 700; font-size: clamp(90px, 18vw, 180px); line-height: 1;
  background: var(--c); color: #fff; border-radius: 40px; padding: 10px 34px; box-shadow: 0 10px 0 var(--cd); animation: popIn .5s;
}
.intro-pic { background: #fff; border-radius: 36px; padding: 14px 24px; display: grid; justify-items: center; box-shadow: var(--card-shadow); }
.intro-pic .em { font-size: clamp(90px, 16vw, 160px); line-height: 1.1; animation: bob 3s ease-in-out infinite; }
.intro-pic .lbl { font-size: 24px; font-weight: 700; }
.prompt-row { display: flex; justify-content: center; align-items: center; gap: 14px; }
.mini-tile { font-family: var(--f-head); font-weight: 700; font-size: clamp(44px, 8vw, 70px); background: var(--c); color: #fff; border-radius: 22px; padding: 2px 18px; box-shadow: 0 6px 0 var(--cd); }
.mini-pic { font-size: clamp(48px, 8vw, 72px); }
.pics { display: grid; gap: clamp(10px, 2vw, 20px); }
.pics.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pic-card { border: 0; background: #fff; border-radius: 30px; box-shadow: 0 8px 0 rgba(0, 0, 0, .12); display: grid; justify-items: center; padding: 12px 6px; cursor: pointer; }
.pic-card .em { font-size: clamp(60px, 12vw, 120px); line-height: 1.1; }
.pic-card .lbl { font-size: clamp(16px, 2.4vw, 22px); font-weight: 700; }
.pic-card.right { background: #DFFFE7; animation: pop .4s; }
.pic-card.wrong { animation: shake .45s; opacity: .45; }
.dots { display: flex; justify-content: center; gap: 10px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 255, 255, .7); }
.dots i.done { background: var(--green); }
.dots i.now { background: var(--yellow); transform: scale(1.3); }

.tray { background: #FFFDF5; border-radius: 32px; padding: 16px; display: grid; gap: 10px; justify-content: center; }
.count-obj {
  position: relative; border: 0; background: #fff; border-radius: 22px; width: 100%; max-width: 120px; justify-self: center; aspect-ratio: 1;
  font-size: clamp(40px, 9vw, 72px); box-shadow: 0 6px 0 rgba(0, 0, 0, .12); cursor: pointer; animation: popIn .4s backwards;
}
.tray.dense .count-obj { max-width: 72px; font-size: clamp(20px, 4.6vw, 44px); border-radius: 14px; }
.count-obj.counted { background: #E3FFEA; box-shadow: 0 3px 0 rgba(0, 0, 0, .12); transform: translateY(3px); }
.count-obj .n { position: absolute; top: -10px; right: -10px; background: var(--coral); color: #fff; border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; font-family: var(--f-head); font-weight: 700; font-size: 17px; animation: pop .3s; }
.tray.dense .count-obj .n { width: 24px; height: 24px; font-size: 13px; top: -8px; right: -8px; }

/* ---------- Stories ---------- */
.books { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 20px; }
.book {
  border: 0; border-radius: 18px 32px 32px 18px; background: var(--c); color: #fff; cursor: pointer;
  box-shadow: inset 12px 0 0 rgba(0, 0, 0, .15), 0 10px 0 var(--cd); padding: 22px 16px 22px 26px;
  display: grid; justify-items: center; gap: 8px; font-family: var(--f-head); font-weight: 700; font-size: clamp(20px, 2.8vw, 26px); text-align: center;
}
.book .em { font-size: clamp(64px, 10vw, 96px); animation: bob 3s ease-in-out infinite; }
.stage { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 32px; overflow: hidden; container-type: inline-size; box-shadow: 0 10px 0 rgba(0, 0, 0, .12); }
.bg-meadow { background: linear-gradient(#8ED8FF 0 62%, #7BD36B 62%); }
.bg-night { background: linear-gradient(#1D2B64 0 64%, #2E5E3E 64%); }
.bg-rain { background: linear-gradient(#9FB3C8 0 64%, #6E9E5F 64%); }
.stage .it { position: absolute; transform: translate(-50%, -50%); line-height: 1; }
.stage .em-it { display: block; font-size: calc(var(--s) * 1cqw); }
.page-no { position: absolute; right: 14px; bottom: 10px; background: rgba(255, 255, 255, .8); border-radius: 999px; padding: 2px 12px; font-family: var(--f-head); font-weight: 600; }
.a-bob { animation: bob 3s ease-in-out infinite; }
.a-wiggle { animation: wiggleEm 1.2s ease-in-out infinite; }
.a-float { animation: floaty 4s ease-in-out infinite; }
.a-bounce { animation: bounce 1s ease-in-out infinite; }
.a-pop { animation: popBig 1.2s ease-out; }
.a-fall { animation: fall 1.6s linear infinite; }
.story-text { background: #fff; border-radius: 28px; padding: 16px 22px; font-size: clamp(24px, 3.8vw, 38px); line-height: 1.55; box-shadow: var(--card-shadow); }
.story-text .w { border-radius: 8px; padding: 0 2px; transition: background .1s; }
.story-text .w.on { background: var(--yellow); }
.ask-row { display: flex; align-items: flex-end; gap: 12px; animation: popIn .4s; }
.bubble.ask { background: #FFF4C2; font-family: var(--f-head); font-weight: 600; }
.bubble.ask::before { border-right-color: #FFF4C2; }
.story-nav { display: flex; justify-content: space-between; gap: 12px; }
.story-nav .kbtn { min-width: 90px; }

/* ---------- Wiggle ---------- */
.ring-wrap { display: flex; justify-content: center; }
.ring { --p: 100; width: clamp(90px, 14vw, 130px); aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--pink) calc(var(--p) * 1%), rgba(255, 255, 255, .6) 0); display: grid; place-items: center; }
.ring .secs { width: 74%; aspect-ratio: 1; border-radius: 50%; background: #fff; display: grid; place-items: center; font-family: var(--f-head); font-weight: 700; font-size: clamp(22px, 3.4vw, 32px); }
.move-card { background: #fff; border-radius: 36px; padding: 18px; display: grid; justify-items: center; gap: 6px; box-shadow: var(--card-shadow); }
.move-card.pop-in { animation: popIn .45s; }
.move-card .em { font-size: clamp(90px, 16vw, 160px); line-height: 1.1; animation: wiggleEm 1s ease-in-out infinite; }
.move-card .txt { font-family: var(--f-head); font-weight: 700; font-size: clamp(28px, 5vw, 48px); text-align: center; }
.dancers { display: flex; justify-content: center; align-items: flex-end; gap: clamp(8px, 3vw, 40px); }

/* ---------- Tutor ---------- */
.tutor-layout { display: grid; grid-template-columns: minmax(150px, 30%) 1fr; gap: 16px; max-width: 1100px; margin: 0 auto; width: 100%; }
.lumi-stage { display: grid; justify-items: center; align-content: center; gap: 8px; }
.mode-note { background: #fff; border-radius: 999px; padding: 4px 14px; font-family: var(--f-head); font-weight: 600; }
.chat { background: #fff; border-radius: 32px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 60vh; }
.log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px; max-height: 56vh; }
.msg { max-width: 86%; padding: 12px 16px; border-radius: 22px; font-size: clamp(20px, 2.8vw, 26px); line-height: 1.4; animation: popIn .3s; }
.msg.lumi { background: #FFF4C2; align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.kid { background: var(--blue); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.msg.typing { display: flex; gap: 6px; }
.msg.typing i { width: 10px; height: 10px; border-radius: 50%; background: var(--orange); animation: bounce .9s ease-in-out infinite; }
.msg.typing i:nth-child(2) { animation-delay: .15s; }
.msg.typing i:nth-child(3) { animation-delay: .3s; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { border: 0; border-radius: 999px; padding: 10px 16px; background: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); font-family: var(--f-head); font-weight: 600; font-size: clamp(15px, 2.2vw, 20px); cursor: pointer; }
.chip-btn.done { background: #DFFFE7; }
.inrow { display: flex; gap: 8px; }
.inrow input { flex: 1; min-width: 0; font-size: clamp(22px, 3vw, 28px); padding: 12px 16px; border-radius: 20px; border: 3px solid #D9DEEA; font-family: var(--f-read); }
@media (max-width: 720px) {
  .tutor-layout { grid-template-columns: 1fr; }
  .lumi-stage .char-xl { width: 120px; }
}

/* ---------- Challenges, rewards, stickers ---------- */
.challenge-now { background: #fff; border-radius: 32px; padding: 18px; display: grid; justify-items: center; gap: 10px; text-align: center; box-shadow: var(--card-shadow); }
.challenge-now .em { font-size: clamp(70px, 12vw, 120px); animation: bob 3s ease-in-out infinite; }
.challenge-now .txt { font-family: var(--f-head); font-weight: 700; font-size: clamp(22px, 3.6vw, 34px); }
.section-title { color: var(--ink); font-size: clamp(20px, 3vw, 28px); }
.challenge-grid, .reward-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.ch-card, .reward {
  position: relative; border: 0; background: #fff; border-radius: 26px; padding: 14px; cursor: pointer;
  display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 18px; box-shadow: 0 6px 0 rgba(0, 0, 0, .12);
}
.ch-card .em, .reward .em { font-size: clamp(44px, 7vw, 64px); }
.ch-card.on { outline: 5px solid var(--orange); }
.ch-card .badge { position: absolute; top: -8px; right: -6px; font-size: 32px; }
.reward .lbl { font-family: var(--f-head); font-weight: 600; font-size: 20px; }
.reward .cost { font-family: var(--f-head); font-weight: 700; font-size: 22px; }
.reward .meter { width: 100%; height: 12px; border-radius: 99px; background: #EEF1F7; overflow: hidden; }
.reward .meter i { display: block; height: 100%; background: var(--yellow); }
.reward.can { box-shadow: 0 6px 0 var(--green-d); outline: 4px solid var(--green); }
.waiting { background: #fff; border-radius: 20px; padding: 12px 16px; font-size: 20px; }
.sticker-book { background: #fff; border-radius: 32px; padding: 20px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; max-width: 900px; margin: 0 auto; width: 100%; }
.sticker-book span { font-size: clamp(48px, 8vw, 72px); animation: popIn .4s backwards; }

/* ---------- Grown-up area ---------- */
.parent { position: fixed; inset: 0; overflow-y: auto; background: #F4F6FB; font-family: var(--f-read); -webkit-user-select: text; user-select: text; }
.p-wrap { max-width: 1120px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 60px; display: grid; gap: 16px; }
.p-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.p-head h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1; margin: 3px 0 7px; }
.p-head-kicker { color: #80620c; font: 700 12px var(--f-head); letter-spacing: .1em; }
.p-navigation { display: grid; gap: 10px; padding: 10px; background: #fff; border: 1px solid #e1e5ef; border-radius: 20px; box-shadow: 0 5px 0 rgba(43,45,66,.06); }
.p-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.p-group { min-height: 51px; border: 0; border-radius: 14px; background: #f0f3f8; color: #414961; cursor: pointer; font: 700 clamp(16px, 2vw, 20px) var(--f-head); }
.p-group.on { background: #fff0b9; color: #5f4907; box-shadow: inset 0 0 0 2px #e8c25d; }
.p-group:hover:not(.on) { background: #e5edfa; }
.p-tabs { display: flex; gap: 7px; flex-wrap: wrap; border-top: 1px solid #edf0f5; padding: 10px 2px 2px; }
.p-tab { min-height: 42px; border: 1px solid #D5DAE6; background: #fff; border-radius: 12px; padding: 8px 15px; cursor: pointer; font-size: 15px; }
.p-tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.p-page-head h2 { font-size: clamp(25px, 3vw, 32px); }
.p-page-head p { margin: 2px 0 0; color: var(--ink-soft); font-size: 15px; }
.p-back { border: 0; padding: 0; background: transparent; color: #53607a; font: 700 15px var(--f-read); cursor: pointer; }
.p-back:hover { color: var(--ink); text-decoration: underline; }
.p-body { display: grid; gap: 16px; min-width: 0; }
.p-hub-intro h3 { margin: 0 0 4px; font-size: 23px; }
.p-hub-intro p { margin: 0; color: var(--ink-soft); }
.p-hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.p-hub-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; width: 100%; min-height: 104px; text-align: left; border: 1px solid #dbe1ed; border-radius: 18px; padding: 16px; background: #fff; box-shadow: 0 4px 0 rgba(43,45,66,.06); cursor: pointer; color: var(--ink); font: inherit; }
.p-hub-card:hover { border-color: #e2bd49; background: #fffdf5; transform: translateY(-1px); }
.p-hub-card:active { transform: translateY(2px); box-shadow: none; }
.p-hub-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #fff1c2; font-size: 25px; }
.p-hub-card b, .p-hub-card small { display: block; }
.p-hub-card b { font: 700 19px var(--f-head); }
.p-hub-card small { margin-top: 3px; color: var(--ink-soft); line-height: 1.25; }
.p-hub-card em { color: #5f4907; font-style: normal; font-weight: 700; white-space: nowrap; }
.p-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.p-overview > div { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; background: #fff; border: 1px solid #e1e5ef; border-radius: 16px; padding: 14px 18px; }
.p-overview-icon { grid-row: span 2; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: #fff1c2; font-size: 25px; }
.p-overview b { font: 700 28px var(--f-head); line-height: 1; }.p-overview div > span:last-child { color: var(--ink-soft); font-size: 13px; }
.p-shortcuts { display: flex; flex-wrap: wrap; gap: 9px; }
.p-shortcut { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 45px; border: 1px solid #cad8e8; border-radius: 12px; padding: 9px 14px; background: #e9f4ff; cursor: pointer; font: 600 14px var(--f-head); }
.p-shortcut:hover { background: #d8ecff; }
.p-section-title { font-size: 21px; margin: 5px 0 -5px; }
.p-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 14px; align-items: start; }
.p-grid.wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
.p-card { background: #fff; border: 1px solid #E1E5EF; border-radius: 16px; padding: 16px; display: grid; gap: 10px; min-width: 0; }
.p-card h3 { font-size: 20px; }
.p-card h3 small { font-family: var(--f-read); font-weight: 400; color: var(--ink-soft); font-size: 14px; }
.p-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 15px; }
.p-row b { text-align: right; }
.p-row.sub { color: var(--ink-soft); font-size: 14px; margin-top: -6px; }
.p-sub { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-top: 6px; }
.p-muted { color: var(--ink-soft); font-size: 14px; margin: 0; }
.quest-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.p-chip { background: #EEF1F7; border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.p-chip.ok { background: #DDF6E5; color: #1F7A40; }
.p-flag { background: #FFE9E4; color: #8E2F21; border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.p-btn { border: 0; border-radius: 10px; padding: 9px 14px; background: var(--ink); color: #fff; cursor: pointer; font-size: 14px; }
.p-btn:not(.small) { min-height: 44px; }
.p-btn.small { padding: 6px 10px; font-size: 13px; }
.p-btn.ghost { background: #EEF1F7; color: var(--ink); }
.p-btn.danger { background: #C0392B; }
.p-btn.big { padding: 12px 22px; font-size: 16px; }
.p-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.sprout-form { display: flex; gap: 8px; }
.sprout-form input, .p-field input, .p-field select { font-size: 16px; padding: 8px 10px; border-radius: 8px; border: 1px solid #CBD2E1; font-family: inherit; min-width: 0; }
.sprout-form input { flex: 1; }
.p-field { display: grid; gap: 4px; font-size: 14px; }
.p-check { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.p-save { display: flex; gap: 12px; align-items: center; }
.saved { color: #1F7A40; font-weight: 700; }
.confirm-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
.p-scroll { overflow-x: auto; }
.p-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.p-table th, .p-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #EEF1F7; white-space: nowrap; }
.p-log { border-top: 1px solid #EEF1F7; padding: 10px 0; }
.p-log summary { cursor: pointer; }
.p-note { white-space: pre-wrap; margin-top: 6px; font-size: 15px; background: #F7F8FC; border-radius: 10px; padding: 8px 10px; }
.p-transcript { font-size: 14px; padding: 6px 4px; }
.pin-screen { display: grid; place-items: center; }
.pin-box { background: #fff; border-radius: 24px; padding: 28px; display: grid; justify-items: center; gap: 14px; text-align: center; box-shadow: 0 10px 30px rgba(20, 30, 60, .12); margin: 16px; }
.pin-box p { margin: 0; max-width: 300px; }
.pin-dots { display: flex; gap: 14px; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); }
.pin-dots i.on { background: var(--ink); }
.pin-dots.shake { animation: shake .45s; }
.pin-message { min-height: 19px; color: #a5372b; font-weight: 700; font-size: 14px; }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; }
.key { height: 76px; border-radius: 20px; border: 0; background: #EEF1F7; font-family: var(--f-head); font-weight: 600; font-size: 28px; cursor: pointer; }
.key:active { background: #DDE2EE; }
.key.ghost { background: transparent; }
@media (max-width: 640px) {
  .p-wrap { padding: max(13px, env(safe-area-inset-top)) 12px 50px; gap: 14px; }
  .p-head { align-items: flex-start; }
  .p-head .exit { margin-left: auto; }
  .p-navigation { padding: 8px; }
  .p-group { min-height: 52px; font-size: 15px; padding: 7px 4px; }
  .p-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-tab { padding: 9px 7px; }
  .p-hub-grid { grid-template-columns: 1fr; }
  .p-hub-card { min-height: 86px; padding: 12px; gap: 10px; }
  .p-hub-card b { font-size: 18px; }
  .p-hub-card em { font-size: 13px; }
  .p-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .p-overview > div { display: flex; flex-direction: column; gap: 4px; text-align: center; padding: 10px 5px; }
  .p-overview-icon { width: 40px; height: 40px; font-size: 21px; }
  .p-overview b { font-size: 24px; }
  .p-shortcuts { display: grid; grid-template-columns: 1fr; }
  .p-shortcut { width: 100%; }
}

/* ---------- Confetti ---------- */
.confetto { position: fixed; width: 10px; height: 14px; border-radius: 3px; pointer-events: none; animation: confetti 1.4s cubic-bezier(.2, .7, .4, 1) forwards; }
.confetto.star-c { width: auto; height: auto; font-size: 22px; }

/* ---------- Keyframes ---------- */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes flapL { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-16deg); } }
@keyframes flapR { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(16deg); } }
@keyframes glow { 0%, 100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes wag { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(14deg); } }
@keyframes wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-40deg); } }
@keyframes earL { 0%, 80%, 100% { transform: rotate(0); } 88% { transform: rotate(-12deg); } }
@keyframes earR { 0%, 80%, 100% { transform: rotate(0); } 88% { transform: rotate(12deg); } }
@keyframes talk { from { transform: scaleY(.3); } to { transform: scaleY(1); } }
@keyframes jump { 0% { transform: translateY(0); } 30% { transform: translateY(-28px) scale(1.05, .95); } 60% { transform: translateY(0) scale(1.08, .9); } 100% { transform: translateY(0); } }
@keyframes tilt { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-8deg); } 60% { transform: rotate(6deg); } }
@keyframes dance { 0%, 100% { transform: rotate(-8deg) translateY(0); } 25% { transform: rotate(0) translateY(-14px); } 50% { transform: rotate(8deg) translateY(0); } 75% { transform: rotate(0) translateY(-14px); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes popBig { 0% { transform: scale(.3); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes stickerIn { 0% { transform: scale(0) rotate(-30deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes nodePulse { 0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 7px 0 rgba(0,0,0,.18), 0 0 0 0 rgba(255, 210, 63, .8); } 50% { transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 7px 0 rgba(0,0,0,.18), 0 0 0 14px rgba(255, 210, 63, 0); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes drift { from { left: -240px; } to { left: 110%; } }
@keyframes waves { from { background-position: 0 0; } to { background-position: 80px 0; } }
@keyframes sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes twinkle { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes wiggleEm { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes fall { from { transform: translateY(-20px); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(40px); opacity: 0; } }
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  50% { transform: translate(var(--dx), var(--dy)) rotate(calc(var(--r) / 2)); opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) + 220px)) rotate(var(--r)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}

@media (max-width: 560px) {
  .choices.three, .pics.three { gap: 8px; }
  .qcard { padding: 14px 56px 14px 14px; }
  .bubble::before { display: none; }
}

/* ===================== Grades 3–5 (Trailblazer) ===================== */
.c-trail { --c: #D7F3EF; --cd: #8FCFC6; }
.who-grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); max-width: 1000px; }

/* Goal panel on the map */
.goal-panel { background: #fff; border-radius: 24px; padding: 12px 18px; box-shadow: var(--card-shadow); max-width: 900px; margin: 0 auto; width: 100%; display: grid; gap: 8px; font-size: clamp(17px, 2.4vw, 22px); }
.goal-panel b { font-family: var(--f-head); font-weight: 600; }
.goal-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.goal-btn { flex: 1; min-width: 120px; border: 0; border-radius: 18px; padding: 10px; background: #F1FBF9; box-shadow: 0 5px 0 #BFE6DF; font-family: var(--f-head); font-weight: 600; font-size: clamp(17px, 2.4vw, 22px); cursor: pointer; display: grid; gap: 2px; }
.goal-btn small { font-size: 15px; color: var(--ink-soft); }
.goal-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #BFE6DF; }
.goal-meter { height: 16px; border-radius: 99px; background: #EEF1F7; overflow: hidden; }
.goal-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), var(--green)); transition: width .6s; }
.goal-done { font-family: var(--f-head); font-weight: 600; color: var(--green-d); }

/* Math: fractions, number lines, partial products */
.frac { display: inline-grid; vertical-align: middle; text-align: center; line-height: 1; margin: 0 .08em; }
.frac > span:first-child { border-bottom: .07em solid currentColor; padding: 0 .12em .06em; }
.frac > span:last-child { padding-top: .06em; }
.qtext .frac { font-size: .8em; }
.choice .frac { font-size: .85em; }
.qtext.wordy { font-family: var(--f-read); font-weight: 700; font-size: clamp(22px, 3.4vw, 32px); line-height: 1.4; text-align: left; }
.choice.long { font-size: clamp(26px, 5vw, 46px); }
.fbar { display: grid; gap: 3px; width: min(100%, 420px); height: 30px; }
.fbar i { background: #fff; border: 2px solid var(--purple); border-radius: 4px; }
.fbar i.on { background: var(--purple); }
.numline { position: relative; width: min(100%, 420px); height: 46px; display: flex; justify-content: space-between; align-items: flex-end; font-family: var(--f-head); font-weight: 700; font-size: 20px; border-bottom: 4px solid var(--ink); }
.numline i { position: absolute; bottom: -10px; left: var(--p); width: 16px; height: 16px; border-radius: 50%; background: var(--coral); transform: translateX(-50%); }
.partials { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.partials span { background: #fff; border-radius: 12px; padding: 6px 12px; font-family: var(--f-head); font-weight: 600; font-size: clamp(18px, 2.6vw, 24px); }
.steps { font-family: var(--f-head); }
pre.column { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: clamp(24px, 4vw, 34px); margin: 0; background: #fff; border-radius: 12px; padding: 8px 18px; line-height: 1.3; }

/* Reading Quest */
.passage { background: #fff; border-radius: 28px; padding: clamp(16px, 3vw, 28px); box-shadow: var(--card-shadow); display: grid; gap: 12px; -webkit-user-select: text; user-select: text; }
.passage header { display: flex; align-items: center; gap: 12px; }
.passage header .em { font-size: clamp(40px, 6vw, 56px); }
.passage header h2 { flex: 1; font-size: clamp(22px, 3.4vw, 32px); }
.passage p { margin: 0; font-size: clamp(19px, 2.6vw, 24px); line-height: 1.65; max-width: 70ch; }
.passage-peek { border-radius: 28px; }
.passage-peek > summary { cursor: pointer; font-family: var(--f-head); font-weight: 600; font-size: 18px; background: rgba(255, 255, 255, .85); border-radius: 18px; padding: 10px 16px; margin-bottom: 8px; }
.passage-peek > summary small { color: var(--ink-soft); font-weight: 500; }
.qcard.rq { justify-items: start; text-align: left; padding: 18px 24px; }
.rq-q { font-family: var(--f-head); font-weight: 600; font-size: clamp(22px, 3.4vw, 32px); line-height: 1.3; }
.answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.answer-btn { border: 0; border-radius: 22px; background: #fff; text-align: left; padding: 16px 20px; font-family: var(--f-read); font-weight: 700; font-size: clamp(18px, 2.6vw, 24px); box-shadow: 0 7px 0 rgba(0, 0, 0, .12); cursor: pointer; line-height: 1.35; }
.answer-btn:active { transform: translateY(4px); box-shadow: 0 3px 0 rgba(0, 0, 0, .12); }
.answer-btn.right { background: var(--green); color: #fff; box-shadow: 0 7px 0 var(--green-d); animation: pop .4s; }
.answer-btn.wrong { animation: shake .45s; opacity: .4; }
.answer-btn.reveal { outline: 5px dashed var(--green); outline-offset: 3px; }

/* Writing Studio */
.center-note { text-align: center; font-size: clamp(17px, 2.4vw, 21px); margin: 0; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.type-card { border: 0; border-radius: 30px; padding: 20px; background: var(--c); color: #fff; box-shadow: 0 9px 0 var(--cd); display: grid; justify-items: center; gap: 6px; text-align: center; cursor: pointer; }
.type-card .em { font-size: clamp(54px, 9vw, 80px); animation: bob 3s ease-in-out infinite; }
.type-card b { font-family: var(--f-head); font-size: clamp(24px, 3.4vw, 32px); }
.type-card small { font-size: 16px; line-height: 1.35; }
.type-card:active { transform: translateY(5px); box-shadow: 0 4px 0 var(--cd); }
.prompt-list { display: grid; gap: 12px; }
.prompt-card { border: 0; border-radius: 22px; background: #fff; padding: 16px 20px; text-align: left; font-size: clamp(18px, 2.6vw, 24px); font-weight: 700; box-shadow: 0 6px 0 rgba(0, 0, 0, .12); cursor: pointer; }
.own-prompt { display: grid; gap: 6px; background: #fff; border-radius: 22px; padding: 14px 18px; font-size: 18px; }
.own-prompt input, .plan-box input { font: inherit; font-size: 20px; padding: 10px 12px; border-radius: 14px; border: 3px solid #D9DEEA; min-width: 0; }
.use-own { justify-self: center; }
.prompt-banner { background: #fff; border-radius: 20px; padding: 12px 18px; font-family: var(--f-head); font-weight: 600; font-size: clamp(18px, 2.6vw, 24px); box-shadow: var(--card-shadow); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.plan-box { display: grid; gap: 6px; background: #fff; border-radius: 20px; padding: 12px 16px; box-shadow: 0 5px 0 rgba(0, 0, 0, .1); }
.plan-box span { font-family: var(--f-head); font-weight: 600; font-size: 19px; color: var(--purple-d); }
.write-layout { display: grid; grid-template-columns: minmax(200px, 30%) 1fr; gap: 16px; }
.plan-side { background: #fff; border-radius: 22px; padding: 14px 16px; display: grid; gap: 8px; align-content: start; font-size: 16px; }
.plan-side p { margin: 0; }
.plan-side small { display: block; color: var(--purple-d); font-weight: 700; }
.fb-side { background: #FFF8D6; border-radius: 16px; padding: 10px 12px; display: grid; gap: 4px; }
.draft-col { display: grid; gap: 10px; align-content: start; }
.draft { width: 100%; min-height: 42vh; resize: vertical; border-radius: 22px; border: 3px solid #D9DEEA; padding: 16px 18px; font-family: var(--f-read); font-size: clamp(19px, 2.6vw, 24px); line-height: 1.6; background: #fff; }
.draft:focus { outline: none; border-color: var(--purple); }
.meter-row { display: flex; align-items: center; gap: 10px; }
.meter-row .meter { flex: 1; height: 14px; border-radius: 99px; background: #fff; overflow: hidden; }
.meter-row .meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), var(--green)); transition: width .3s; }
.wc { font-family: var(--f-head); font-weight: 600; white-space: nowrap; }
.checks { list-style: none; margin: 0; padding: 12px 16px; background: #fff; border-radius: 18px; display: grid; gap: 4px; font-size: 17px; }
.checks li.ok { color: var(--green-d); }
.feedback-card { background: #fff; border-radius: 32px; padding: clamp(16px, 3vw, 30px); display: grid; gap: 12px; justify-items: center; box-shadow: var(--card-shadow); animation: popIn .45s; }
.fb-lines { display: grid; gap: 10px; width: 100%; }
.fb { margin: 0; border-radius: 18px; padding: 12px 16px; font-size: clamp(18px, 2.6vw, 23px); line-height: 1.4; }
.fb.glow { background: #FFF6CC; }
.fb.grow { background: #DFF7E7; }
.fb.try { background: #ECE6FF; }
.folio-list { display: grid; gap: 12px; }
.folio-item { background: #fff; border-radius: 22px; padding: 14px 18px; box-shadow: 0 5px 0 rgba(0, 0, 0, .1); font-size: 18px; }
.folio-item summary { cursor: pointer; }
.folio-prompt { color: var(--ink-soft); font-size: 16px; margin-top: 4px; }
.folio-text { white-space: pre-wrap; line-height: 1.6; margin-top: 10px; -webkit-user-select: text; user-select: text; }
@media (max-width: 720px) {
  .write-layout { grid-template-columns: 1fr; }
}

/* ===================== Science Lab ===================== */
.scene-lab { background: linear-gradient(180deg, #8FE3D3, #E9FFFA 65%); }
.bg-lab { background: radial-gradient(circle at 50% 35%, #FFFFFF 0 30%, #E3F6F2 60%), #E3F6F2; }
.bg-space { background: radial-gradient(circle at 20% 30%, #3B4E8C, #141A3A 70%); }
.lab-progress { background: #fff; border-radius: 22px; padding: 12px 18px; display: grid; gap: 8px; box-shadow: var(--card-shadow); font-family: var(--f-head); font-size: clamp(17px, 2.4vw, 21px); }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.lesson-card { border: 0; border-radius: 26px; padding: 16px 12px; background: var(--c); color: #fff; box-shadow: 0 8px 0 var(--cd); display: grid; justify-items: center; gap: 6px; text-align: center; cursor: pointer; font-family: var(--f-head); }
.lesson-card.c-yellow { color: var(--ink); }
.lesson-card .em { font-size: clamp(46px, 8vw, 70px); }
.lesson-card b { font-size: clamp(18px, 2.6vw, 22px); }
.lesson-card .badges { font-size: 15px; background: rgba(255, 255, 255, .3); border-radius: 999px; padding: 2px 10px; }
.lesson-card.next { animation: pulse 1.6s ease-in-out infinite; outline: 5px solid var(--yellow); outline-offset: 3px; }
.lesson-card:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--cd); }
.steps-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.step-btn { border: 0; border-radius: 16px; padding: 8px 6px; background: rgba(255, 255, 255, .7); font-family: var(--f-head); font-weight: 600; font-size: clamp(14px, 2vw, 18px); cursor: pointer; display: flex; gap: 6px; justify-content: center; align-items: center; }
.step-btn span { width: 26px; height: 26px; border-radius: 50%; background: #EEF1F7; display: grid; place-items: center; }
.step-btn.past span { background: var(--green); color: #fff; }
.step-btn.on { background: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.step-btn.on span { background: var(--teal); color: #fff; }
.wonder-card, .experiment, .vocab-box { background: #fff; border-radius: 32px; padding: clamp(16px, 3vw, 30px); display: grid; gap: 12px; box-shadow: var(--card-shadow); animation: popIn .4s; }
.wonder-card { justify-items: center; text-align: center; }
.wonder-card h2 { font-size: clamp(24px, 4vw, 38px); }
.predict-opts { display: grid; gap: 10px; width: 100%; }
.answer-btn.dim { opacity: .45; }
.why { background: #FFF8D6; border-radius: 20px; padding: 14px 18px; display: grid; gap: 10px; justify-items: center; font-size: clamp(18px, 2.6vw, 23px); animation: popIn .35s; }
.why p { margin: 0; }
.vocab-box h2 { text-align: center; }
.vocab-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.vocab-card { border: 0; border-radius: 20px; padding: 14px; background: #ECFAF7; display: grid; gap: 4px; text-align: left; cursor: pointer; font-size: 18px; }
.vocab-card b { font-family: var(--f-head); font-size: 24px; color: var(--teal-d); }
.experiment h2 { text-align: center; font-size: clamp(24px, 4vw, 36px); }
.safety { background: #FFE9E4; color: #8E2F21; border-radius: 16px; padding: 10px 14px; font-size: 17px; }
.exp-cols { display: grid; grid-template-columns: minmax(200px, 35%) 1fr; gap: 16px; }
.exp-cols h3 { font-size: 20px; margin-bottom: 6px; }
.materials { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mat { border: 0; background: #F4F6FB; border-radius: 12px; padding: 8px 12px; width: 100%; text-align: left; font-size: 17px; cursor: pointer; }
.mat.got { background: #DFF7E7; }
.exp-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; font-size: clamp(17px, 2.4vw, 21px); line-height: 1.45; }
.wonder-q { background: #ECE6FF; border-radius: 16px; padding: 10px 14px; font-size: 18px; }
.journal { display: grid; gap: 8px; width: 100%; max-width: 620px; text-align: left; }
.journal label { display: grid; gap: 6px; font-size: 18px; }
.journal textarea { font-family: var(--f-read); font-size: 20px; border-radius: 16px; border: 3px solid #D9DEEA; padding: 10px 12px; resize: vertical; }
.genre { font-family: var(--f-read); font-size: .55em; background: #ECE6FF; color: var(--purple-d); border-radius: 999px; padding: 2px 10px; vertical-align: middle; }
@media (max-width: 720px) {
  .exp-cols { grid-template-columns: 1fr; }
  .step-btn { flex-direction: column; gap: 2px; }
}

/* ===================== History Hall ===================== */
.scene-hall { background: linear-gradient(180deg, #F2C98B, #FFF4E0 65%); }
.bg-old { background: radial-gradient(circle at 50% 40%, #FFF6E3 0 40%, #F1DDB4 100%); box-shadow: inset 0 0 40px rgba(150, 100, 40, .25), 0 10px 0 rgba(0, 0, 0, .12); }
.c-brown { --c: #C97B2D; --cd: #9A5A1C; }

/* ===================== Course Shelf ===================== */
.wide-tile { grid-column: 1 / -1; grid-template-columns: auto auto; align-items: center; justify-content: center; gap: 16px; }
.wide-tile .ico { font-size: clamp(48px, 8vw, 80px); }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.course-card { border: 0; border-radius: 28px; padding: 14px; background: var(--c); color: #fff; box-shadow: 0 9px 0 var(--cd); display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; text-align: left; cursor: pointer; font-family: var(--f-head); }
.course-card:active { transform: translateY(5px); box-shadow: 0 4px 0 var(--cd); }
.course-card .cover { width: 96px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .2); transform: rotate(-3deg); }
.ccard-body { display: grid; gap: 6px; min-width: 0; }
.ccard-body b { font-size: clamp(19px, 2.6vw, 24px); }
.trail-name { font-size: 15px; opacity: .9; }
.ccard-meter { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.ccard-meter i { display: block; height: 100%; background: var(--yellow); }
.ccard-prog { font-size: 16px; }
.trail-card { background: #fff; border-radius: 32px; padding: clamp(14px, 3vw, 26px); display: grid; gap: 16px; box-shadow: var(--card-shadow); }
.trail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--f-head); font-weight: 600; font-size: clamp(18px, 2.6vw, 24px); }
.trail-count { color: var(--ink-soft); font-size: .8em; }
.course-meter { position: relative; height: 16px; border-radius: 99px; background: #EEF1F7; margin: 10px 14px 6px; }
.course-meter i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--yellow), var(--green)); }
.course-meter b { position: absolute; top: 50%; transform: translate(-50%, -50%); font-size: 22px; }
.stones { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; align-items: end; padding-top: 40px; }
.stone { position: relative; display: grid; justify-items: center; gap: 2px; }
.stone > span { width: 100%; max-width: 74px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: #EEF1F7; font-family: var(--f-head); font-weight: 700; font-size: clamp(16px, 2.6vw, 24px); box-shadow: 0 5px 0 rgba(0, 0, 0, .12); }
.stone:nth-child(even) { transform: translateY(-14px); }
.stone small { font-size: 12px; color: var(--ink-soft); }
.stone.done > span { background: var(--green); color: #fff; }
.stone.now > span { background: var(--yellow); outline: 4px solid var(--orange); animation: pulse 1.5s ease-in-out infinite; }
.stone.milestone:not(.done) > span { background: #FFE9F2; }
.stone-buddy { position: absolute; bottom: 100%; animation: bob 2s ease-in-out infinite; }
.book-row { display: flex; gap: 14px; overflow-x: auto; padding: 6px 2px 14px; }
.book-row.big { flex-wrap: wrap; justify-content: center; }
.book-tile { flex: none; width: 130px; display: grid; gap: 4px; justify-items: center; text-align: center; text-decoration: none; color: var(--ink); background: #fff; border-radius: 18px; padding: 10px; box-shadow: 0 6px 0 rgba(0, 0, 0, .1); font-size: 14px; font-weight: 700; }
.book-tile img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; background: #F4F6FB; }
.book-tile small { color: var(--ink-soft); font-weight: 400; }
.game.wide { max-width: 1200px; }
.viewer-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: #fff; border-radius: 18px; padding: 10px 14px; box-shadow: 0 4px 0 rgba(0, 0, 0, .08); }
.vb-title { font-family: var(--f-head); font-weight: 600; flex: 1; min-width: 160px; }
.vb-page { display: flex; gap: 6px; align-items: center; font-size: 17px; }
.vb-page input, .next-page input, .set-lesson { width: 80px; font-size: 18px; padding: 6px 8px; border-radius: 10px; border: 2px solid #D9DEEA; font-family: inherit; }
.set-lesson { width: 64px; font-size: 15px; }
.kbtn.small { font-size: 17px; padding: 8px 14px; border-radius: 14px; box-shadow: 0 4px 0 var(--cd, #C9D3E3); text-decoration: none; }
.viewer { background: #fff; border-radius: 22px; overflow: hidden; box-shadow: var(--card-shadow); }
.viewer iframe { display: block; width: 100%; height: 72vh; border: 0; }
.tap-open { display: grid; justify-items: center; gap: 10px; padding: 24px; text-decoration: none; color: var(--ink); font-family: var(--f-head); font-size: 22px; }
.tap-open img { width: min(240px, 60%); border-radius: 12px; box-shadow: 0 8px 0 rgba(0, 0, 0, .12); }
.done-card { display: grid; gap: 8px; }
.next-page { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; font-size: 18px; }
.assign { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 12px; }
@media (max-width: 720px) {
  .stones { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .course-card { grid-template-columns: 72px 1fr; }
  .course-card .cover { width: 72px; }
}

/* Original digital course and daily path. */
.course-game { text-align: center; }
.course-trail { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin: 24px auto; max-width: 800px; }
.course-trail .kbtn { white-space: normal; min-height: 84px; }
.course-trail button:disabled { opacity: .55; cursor: default; }
.course-picture { font-size: clamp(48px,9vw,96px); margin: 24px 0; }
.course-step { font-weight: bold; color: #36506b; }
.course-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; max-width: 650px; margin: 20px auto; }
.course-options > div { display: flex; flex-direction: column; gap: 8px; }
.course-options .answer { width: 100%; min-height: 100px; display: flex; flex-direction: column; align-items: center; white-space: normal; }
.course-option-icon { font-size: 42px; }
.course-hear { min-height: 48px; border: 2px solid #6cb7cf; border-radius: 16px; background: #fff; color: #16465c; font: inherit; cursor: pointer; }
.course-feedback, .trace-feedback { min-height: 2em; font-size: 22px; }
.course-feedback:not(:empty), .trace-feedback:not(:empty) { background: rgba(255, 255, 255, .92); border-radius: 16px; padding: 8px 14px; width: fit-content; max-width: 100%; margin-inline: auto; box-sizing: border-box; }
.course-game > .kbtn { margin: 8px; }
.letter-canvas { display: block; margin: 18px auto; width: min(100%,400px); height: auto; border: 3px solid #75bfd4; background: white; border-radius: 22px; touch-action: none; }
.daily-list { max-width: 700px; margin: 24px auto; display: grid; gap: 14px; }
.daily-item { padding: 20px; border: 3px solid #b9d9ea; border-radius: 20px; background: #fff; font-size: 24px; }
.daily-item.done { background: #e9f9de; border-color: #93ca76; }
@media (max-width: 480px) { .course-trail { grid-template-columns: 1fr; } .course-options { gap: 10px; } .course-options .answer { padding: 12px; } }
.teach-row { display: flex; justify-content: center; align-items: flex-end; gap: clamp(12px, 4vw, 40px); }
.teach-row .course-picture { margin: 12px 0; }
.course-options .answer.right { --c: var(--green); --cd: var(--green-d); color: #fff; animation: pop .4s; }
.course-options .answer.tilt { animation: shake .45s; opacity: .45; }
.unit-block { max-width: 820px; margin: 0 auto 10px; }
.unit-title { font-size: clamp(20px, 3vw, 26px); text-align: left; margin: 16px 4px 0; }
.unit-title small { font-family: var(--f-read); font-weight: 400; font-size: .7em; color: var(--ink-soft); }
.unit-block.locked { opacity: .6; }
.unit-block .course-trail { margin-top: 10px; }
.unit-done { background: var(--yellow); border-radius: 18px; padding: 10px 16px; }
.bubble.read-sentence { font-family: var(--f-read); font-weight: 700; font-size: clamp(30px, 5vw, 46px); letter-spacing: .03em; text-align: center; }
.bubble.read-word { font-family: var(--f-read); font-weight: 700; font-size: clamp(44px, 8vw, 72px); letter-spacing: .05em; text-align: center; }
.bubble.read-story { font-family: var(--f-read); font-weight: 700; font-size: clamp(24px, 3.6vw, 34px); line-height: 1.5; }
.bubble.read-story { white-space: pre-line; }

/* Word Explorers: spelling tiles, text answers, story recall */
.spell-slots { display: flex; justify-content: center; gap: 10px; margin: 18px auto; flex-wrap: wrap; }
.spell-slots .slot { width: clamp(46px, 9vw, 64px); height: clamp(56px, 10vw, 76px); border-bottom: 5px solid var(--purple); background: #fff; border-radius: 12px 12px 4px 4px; display: grid; place-items: center; font-family: var(--f-read); font-weight: 700; font-size: clamp(30px, 6vw, 44px); }
.spell-slots .slot.filled { background: #F3F0FF; }
.spell-slots.right .slot { background: #DFFFE7; border-color: var(--green); }
.spell-slots.tilt { animation: shake .45s; }
.spell-tiles { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; max-width: 560px; margin: 0 auto 14px; }
.tile-btn { width: clamp(52px, 10vw, 70px); aspect-ratio: 1; border: 0; border-radius: 16px; background: var(--yellow); box-shadow: 0 6px 0 var(--yellow-d); font-family: var(--f-read); font-weight: 700; font-size: clamp(28px, 5vw, 40px); cursor: pointer; }
.spell-slots.words .slot { width: auto; min-width: 70px; padding: 0 12px; font-size: clamp(22px, 4.5vw, 32px); }
.spell-slots.steps { flex-direction: column; align-items: center; counter-reset: step; }
.spell-slots.steps .slot { width: min(520px, 100%); justify-items: start; grid-template-columns: auto 1fr; gap: 10px; text-align: left; box-sizing: border-box; }
.spell-slots.steps .slot::before { counter-increment: step; content: counter(step) "."; color: var(--purple); }
.spell-tiles.words .tile-btn { width: auto; aspect-ratio: auto; min-height: 56px; padding: 0 16px; font-size: clamp(22px, 4.5vw, 32px); }
.write-model { font-family: var(--f-read); font-weight: 700; font-size: clamp(28px, 5vw, 42px); text-align: center; margin: 10px auto; background: #fff; border-radius: 16px; padding: 8px 16px; width: fit-content; max-width: 100%; }
.bubble.pre { white-space: pre-line; text-align: left; }
textarea.write-input { font-size: clamp(20px, 3.6vw, 28px); line-height: 1.4; resize: vertical; }
.write-input { display: block; width: min(560px, 100%); margin: 16px auto; padding: 12px 16px; font-family: var(--f-read); font-weight: 700; font-size: clamp(26px, 5vw, 38px); border: 4px solid var(--purple); border-radius: 16px; background: #fff; box-sizing: border-box; }
.write-input:focus { outline: 4px solid var(--yellow); }
.write-input.right { border-color: var(--green); background: #DFFFE7; }
.write-input.tilt { animation: shake .45s; }
.tile-btn:disabled { opacity: .25; box-shadow: none; transform: translateY(4px); }
.course-options .answer.text-answer .course-option-icon { font-family: var(--f-read); font-weight: 700; font-size: clamp(20px, 3.2vw, 28px); line-height: 1.3; }
.story-again { max-width: 760px; margin: 0 auto 10px; background: #fff; border-radius: 18px; padding: 8px 14px; text-align: left; }
.story-again summary { cursor: pointer; font-family: var(--f-head); font-weight: 600; font-size: 18px; }
.story-again p { font-size: clamp(18px, 2.6vw, 22px); line-height: 1.5; }

/* ---------- Math 2 manipulatives (math-visuals.js) ---------- */
.mv { display: flex; justify-content: center; margin: 8px auto 12px; max-width: 100%; }
.mv-svg { width: min(640px, 100%); height: auto; background: #fff; border-radius: 18px; padding: 6px; box-sizing: border-box; }
.mv-clock-wrap .mv-svg, .mv-shape-wrap .mv-svg, .mv-fraction-wrap .mv-svg { width: min(220px, 60vw); }
.mv-line { stroke: #2B2D42; stroke-width: 3; } .mv-line.thin { stroke-width: 2; }
.mv-num { font: 700 18px var(--f-read, sans-serif); text-anchor: middle; fill: #2B2D42; } .mv-num.small { font-size: 15px; } .mv-num.end { text-anchor: end; }
.mv-hop { fill: none; stroke: #FF6F61; stroke-width: 4; stroke-dasharray: 2 0; } .mv-hop-end { fill: #FF6F61; } .mv-mark { fill: #8B78FF; }
.mv-blocks { --u: clamp(7px, 1.5vw, 11px); display: flex; flex-wrap: wrap; gap: calc(var(--u) * 2); align-items: flex-end; justify-content: center; background: #fff; border-radius: 18px; padding: 12px; }
.mv-group { display: flex; gap: calc(var(--u) * .5); align-items: flex-end; flex-wrap: wrap; max-width: calc(var(--u) * 46); }
.mv-group.ones { display: grid; grid-template-columns: repeat(5, var(--u)); gap: 3px; }
.b-hund { width: calc(var(--u) * 10); height: calc(var(--u) * 10); background: #3D9BFF; border: 2px solid #1E6FD0; background-image: linear-gradient(#1E6FD0 1px, transparent 1px), linear-gradient(90deg, #1E6FD0 1px, transparent 1px); background-size: var(--u) var(--u); }
.b-ten { width: var(--u); height: calc(var(--u) * 10); background: #3CCB6A; border: 2px solid #23964A; background-image: linear-gradient(#23964A 1px, transparent 1px); background-size: 100% var(--u); }
.b-one { width: var(--u); height: var(--u); background: #FF9F1C; border: 2px solid #C77400; display: inline-block; }
.block-build { min-height: 90px; display: grid; place-items: center; }
.block-build.tilt { animation: shake .45s; }
.mv-pairs { display: flex; gap: 14px; background: #fff; border-radius: 18px; padding: 12px 18px; font-size: 30px; line-height: 1.25; }
.mv-pairs span { text-align: center; }
.mv-grid { display: grid; grid-template-columns: repeat(var(--cols), auto); gap: 6px; background: #fff; border-radius: 18px; padding: 12px; font-size: clamp(26px, 5vw, 36px); }
.mv-coins { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; background: #fff; border-radius: 18px; padding: 12px; }
.coin { width: calc(var(--r) * 2); height: calc(var(--r) * 2); border-radius: 50%; display: grid; place-content: center; text-align: center; line-height: 1; box-shadow: inset 0 0 0 4px rgba(0,0,0,.12); }
.coin b { font: 800 15px var(--f-read, sans-serif); } .coin small { font-size: 9px; text-transform: uppercase; }
.coin.silver { background: radial-gradient(circle at 35% 30%, #fff, #c9ced6 60%, #9aa1ab); color: #2B2D42; }
.coin.copper { background: radial-gradient(circle at 35% 30%, #ffd2a8, #c97b2d 60%, #8e4f16); color: #fff; }
.bill { background: #9BD99B; border: 3px solid #3f8f3f; border-radius: 8px; padding: 14px 26px; font: 800 24px var(--f-read, sans-serif); color: #1f5e1f; }
.mv-face { fill: #fff; stroke: #2B2D42; stroke-width: 5; } .mv-tick { stroke: #2B2D42; stroke-width: 2; }
.mv-clocknum { font: 700 19px var(--f-read, sans-serif); text-anchor: middle; fill: #2B2D42; }
.mv-hour { stroke: #2B2D42; stroke-width: 8; stroke-linecap: round; } .mv-minute { stroke: #FF6F61; stroke-width: 5; stroke-linecap: round; } .mv-pin { fill: #2B2D42; }
.mv-ruler { fill: #FFE7A3; stroke: #C99A1C; stroke-width: 2; } .mv-object { stroke: rgba(0,0,0,.25); stroke-width: 2; }
.mv-picgraph { background: #fff; border-radius: 18px; padding: 12px 16px; display: grid; gap: 6px; font-size: 18px; }
.mv-picgraph div { display: grid; grid-template-columns: 90px 1fr; align-items: center; } .mv-picgraph .pics { font-size: 28px; letter-spacing: 4px; } .mv-picgraph small { color: #666; }
.mv-gridline { stroke: #ddd; stroke-width: 1; }
.mv-bar.b0 { fill: #3D9BFF; } .mv-bar.b1 { fill: #FF9F1C; } .mv-bar.b2 { fill: #3CCB6A; } .mv-bar.b3 { fill: #8B78FF; }
.mv-shape { fill: #8B78FF; stroke: #5A45D6; stroke-width: 4; }
.mv-fill { fill: #FF9F1C; stroke: #2B2D42; stroke-width: 3; } .mv-empty { fill: #fff; stroke: #2B2D42; stroke-width: 3; }
.block-btns .kbtn { min-width: 90px; }
.block-build .mv-blocks { --u: clamp(9px, 2vw, 14px); }

/* Math K visuals */
.mv-tenframe { display: grid; grid-template-columns: repeat(5, clamp(44px, 9vw, 60px)); grid-auto-rows: clamp(44px, 9vw, 60px); background: #2B2D42; gap: 4px; padding: 4px; border-radius: 10px; }
.mv-tenframe span { background: #fff; display: grid; place-items: center; font-size: clamp(26px, 5vw, 36px); border-radius: 4px; }
.mv-groups { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: center; background: #fff; border-radius: 18px; padding: 12px 16px; }
.mv-groups.vs { flex-direction: column; align-items: flex-start; }
.mv-set { display: inline-flex; flex-wrap: wrap; gap: 8px; font-size: clamp(32px, 6vw, 46px); max-width: 100%; }
.mv-set .gone { position: relative; } .mv-set .gone i { font-style: normal; opacity: .3; filter: grayscale(1); }
.mv-set .gone::after { content: '✖'; position: absolute; inset: 0; display: grid; place-items: center; color: #E63946; font-size: 1em; font-weight: 900; text-shadow: 0 0 3px #fff; }
.mv-plus { font: 800 40px var(--f-head, sans-serif); color: #FF6F61; }
.mv-blank { display: inline-grid; place-items: center; width: 1.2em; height: 1.2em; border: 4px dashed #8B78FF; border-radius: 12px; color: #8B78FF; font-weight: 800; }
.counter-pool, .counter-basket { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 70px; padding: 10px; border-radius: 18px; }
.counter-pool { background: rgba(255,255,255,.75); }
.counter-basket { background: #FFE7A3; border: 4px dashed #C99A1C; position: relative; }
.counter-basket::before { content: '🧺'; position: absolute; left: 10px; top: 6px; font-size: 26px; opacity: .6; }
.counter { font-size: clamp(34px, 6.5vw, 48px); background: none; border: 0; cursor: pointer; padding: 2px; line-height: 1; }

/* Profiles: any number of children */
.who-grid.many { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); max-width: min(1100px, calc(100vw - 32px)); gap: 16px; }
.who-grid.many .who .name { font-size: clamp(22px, 3.4vw, 30px); }
.who-grid.many .who .char-lg { width: 88px; height: 88px; }
.p-profile { border-top: 1px solid #EEF1F7; padding: 10px 0; }
.p-profile > summary { cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 18px; }
.p-avatar .char-xs { width: 40px; height: 40px; }
.profile-edit { display: grid; gap: 6px; margin: 10px 0; }
.p-unit > summary { cursor: pointer; }
.p-card.notice { border: 3px solid #FFB020; }
.profiles-message:empty { display: none; }
.profiles-message { background: #EAF7EE; border-radius: 10px; padding: 8px 12px; }
.who-grid.many .who { padding: 14px 10px; }
.who-grid.many .who .tag { font-size: 16px; }

/* Growth tab: charts and the 1-minute reading check */
.g-chart { width: min(100%, 420px); height: auto; display: block; margin: 6px 0; }
.g-line { fill: none; stroke: #2E7D5B; stroke-width: 3; } .g-dot { fill: #2E7D5B; }
.g-target { stroke: #E3A21A; stroke-width: 2; stroke-dasharray: 6 5; }
.g-label { font-size: 11px; fill: #566577; text-anchor: middle; } .g-label.end { text-anchor: end; }
.p-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.fluency-run { border: 2px solid #E3A21A; border-radius: 14px; padding: 12px; margin: 8px 0; display: grid; gap: 10px; }
.fl-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; position: sticky; top: 0; background: #fff; padding: 4px 0; z-index: 1; }
.fl-time { font-size: 28px; font-variant-numeric: tabular-nums; min-width: 70px; }
.fl-text { font-size: clamp(20px, 3.2vw, 26px); line-height: 2; font-family: var(--f-read, sans-serif); }
.fl-w { cursor: pointer; border-radius: 6px; padding: 1px 2px; }
.fl-w.err { background: #F9E1DB; color: #B3412E; text-decoration: line-through; }
.fl-w.last { outline: 3px solid #2E7D5B; } .fl-w.past { opacity: .35; }

.weekly-text { border-top: 1px solid #EEF1F7; padding-top: 10px; display: grid; gap: 6px; }
.weekly-text h4 { margin: 8px 0 0; }

/* Story Buddy */
.sb-grownup { font-size: 15px; color: var(--ink-soft, #566577); text-align: center; }
.sb-themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; max-width: 640px; margin: 0 auto; width: 100%; }
.sb-theme, .sb-choice { display: grid; place-items: center; gap: 4px; border: 0; border-radius: 22px; background: #fff; box-shadow: 0 6px 0 #D7E0E8; padding: 14px 8px; font-family: var(--f-head, sans-serif); font-weight: 700; font-size: 20px; cursor: pointer; }
.sb-theme span, .sb-choice span { font-size: clamp(48px, 10vw, 68px); line-height: 1.1; }
.sb-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 640px; margin: 0 auto; width: 100%; }
.sb-choice.right { background: #DFFFE7; box-shadow: 0 6px 0 #3CCB6A; } .sb-choice.tilt { animation: shake .45s; opacity: .45; }
.sb-scene { font-size: clamp(64px, 14vw, 110px); text-align: center; letter-spacing: 8px; line-height: 1.2; }
.sb-text { text-align: center; max-width: 720px; margin: 0 auto; }
.sb-dots { animation: pulse 1.2s infinite alternate; }
@keyframes pulse { from { opacity: .3; } to { opacity: 1; } }

/* Workshops */
.ws-hero { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; background: #fff; border-radius: 22px; padding: 14px 18px; max-width: 760px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.ws-icon { font-size: clamp(56px, 12vw, 84px); }
.ws-area { font-size: 15px; color: var(--ink-soft, #566577); }
.ws-job { background: #FFF1C2; border-radius: 20px; padding: 14px 18px; max-width: 760px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.ws-grownup { background: rgba(255,255,255,.85); border-radius: 16px; padding: 10px 16px; max-width: 760px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.ws-grownup summary { cursor: pointer; font-weight: 700; }
.ws-safety { background: #F9E1DB; border-radius: 10px; padding: 6px 10px; }
.ws-done { text-align: center; }

.explain-box { background: #EAF7EE; border-radius: 18px; padding: 12px 16px; display: grid; gap: 6px; max-width: 760px; margin: 0 auto; width: 100%; box-sizing: border-box; }

.theme-banner { background: #FFF1C2; border-radius: 14px; padding: 8px 14px; text-align: center; font-size: 18px; }
.theme-tag { font-size: 12px; background: #FFF1C2; color: #6B4700; border-radius: 999px; padding: 1px 8px; }

.mv-x { font: 800 22px var(--f-head, sans-serif); text-anchor: middle; fill: #2763A6; }
.mv-place { display: flex; gap: 6px; justify-content: center; align-items: center; background: #fff; border-radius: 18px; padding: 12px 20px; font-size: clamp(54px, 11vw, 80px); line-height: 1; }
.mv-place.above, .mv-place.below { flex-direction: column; }
.mv-in { position: relative; display: inline-block; } .mv-in .outer { font-size: 1.6em; } .mv-in .inner { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); font-size: .55em; }

/* Brain break (guessing guard) */
.brain-break .break-timer { font-size: clamp(2.4rem, 9vw, 4rem); font-weight: 800; text-align: center; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.25); margin: 8px 0; }
.brain-break .grownup-unlock { margin-top: 16px; background: rgba(255,255,255,.85); border-radius: 14px; padding: 8px 12px; color: #333; }
.brain-break .grownup-unlock summary { cursor: pointer; font-weight: 700; }
.brain-break .unlock-form .pin { width: 7em; text-align: center; letter-spacing: .3em; }
.p-card.alerts { border-left: 6px solid #ff8a3d; }
.p-card.alerts .alert-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,.08); }

/* Level Check */
.level-check .lc-areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; max-width: 760px; margin: 12px auto; }
.level-check .lc-area { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 120px; }
.level-check .lc-area small { font-size: 15px; opacity: .8; }
.level-check .lc-note { text-align: center; background: rgba(255,255,255,.85); border-radius: 12px; padding: 6px 12px; width: fit-content; margin: 8px auto; }
.level-check .idk { margin-top: 10px; }
.lc-ready { background: #f4fbef; border-radius: 10px; padding: 8px 10px; }

/* Welcome setup ("Build your hive") */
.welcome { max-width: 760px; margin: 0 auto; padding: 12px 16px 40px; display: grid; gap: 14px; }
.welcome .logo { text-align: center; }
.wl-hero { display: flex; align-items: center; gap: 12px; justify-content: center; }
.wl-hero.big { margin-top: 12px; }
.wl-hello { text-align: center; max-width: 560px; margin: 0 auto; }
.wl-small { text-align: center; font-size: 15px; color: #2b2d42; background: rgba(255,255,255,.8); border-radius: 12px; padding: 6px 12px; width: fit-content; max-width: 100%; margin: 0 auto; }
.wl-dots { display: flex; gap: 8px; justify-content: center; }
.wl-dots span { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.7); border: 2px solid #f5b700; }
.wl-dots span.done { background: #f5b700; }
.wl-dots span.now { background: #ffd23f; transform: scale(1.3); box-shadow: 0 0 0 4px rgba(255,210,63,.35); }
.wl-card { background: #fff; border-radius: 24px; padding: 18px 20px; box-shadow: 0 8px 0 rgba(0,0,0,.08); color: #2b2d42; font-size: 18px; }
.wl-card h2 { margin: 0 0 10px; font-size: 26px; }
.wl-perks { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.wl-perks li { background: #fff8db; border-radius: 12px; padding: 8px 12px; }
.wl-field { display: grid; gap: 6px; margin: 10px 0; font-weight: 700; }
.wl-field small { font-weight: 400; color: #555; }
.wl-field input, .wl-field select, .wl-pins input { font: inherit; font-size: 20px; padding: 10px 12px; border: 3px solid #ffd23f; border-radius: 14px; }
.wl-ideas { display: flex; flex-wrap: wrap; gap: 8px; }
.wl-chip { border: 2px dashed #f5b700; background: #fffbea; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 15px; cursor: pointer; }
.wl-pins { display: flex; gap: 16px; flex-wrap: wrap; }
.wl-pins label { display: grid; gap: 6px; font-weight: 700; }
.wl-pins input { width: 7em; text-align: center; letter-spacing: .4em; }
.wl-msg:not(:empty) { color: #b3261e; font-weight: 700; }
.wl-actions { gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.wl-age { display: flex; align-items: center; gap: 14px; }
.wl-age b { font-size: 32px; min-width: 2ch; text-align: center; }
.wl-buddies { display: flex; flex-wrap: wrap; gap: 8px; }
.wl-buddy { display: grid; justify-items: center; background: #f4f8ff; border: 3px solid transparent; border-radius: 18px; padding: 6px 8px; cursor: pointer; font: inherit; }
.wl-buddy.on, .wl-level.on { border-color: #f5b700; background: #fff3c4; box-shadow: 0 0 0 3px rgba(245,183,0,.25); }
.wl-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.wl-level { display: grid; gap: 2px; text-align: left; background: #f6f6f6; border: 3px solid transparent; border-radius: 16px; padding: 10px; cursor: pointer; font: inherit; }
.wl-level span { font-size: 26px; }
.wl-level small { font-weight: 400; font-size: 14px; color: #555; }
.wl-setting { margin: 18px 0; }
.wl-setting > b { display: block; margin-bottom: 8px; }
.wl-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 8px; }
.wl-choice { display: grid; gap: 2px; min-height: 78px; padding: 10px; border: 3px solid #e4e8ef; border-radius: 14px; background: #fafbfe; cursor: pointer; }
.wl-choice:has(input:checked) { border-color: #f5b700; background: #fff3c4; box-shadow: 0 0 0 3px rgba(245,183,0,.18); }
.wl-choice input { position: absolute; opacity: 0; pointer-events: none; }
.wl-choice b { font: 700 17px var(--f-head); }
.wl-choice small, .wl-hint { color: #5b6375; font-size: 13px; line-height: 1.25; }
.wl-kids, .wl-team { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.wl-kid { display: flex; align-items: center; gap: 8px; background: #fff8db; border-radius: 16px; padding: 6px 10px; }
.wl-kid.big { flex-direction: column; padding: 10px 16px; text-align: center; }
.wl-kid small { display: block; color: #555; }
.wl-remove { border: 0; background: transparent; font-size: 18px; cursor: pointer; color: #999; }
@media (max-width: 520px) { .wl-card { padding: 14px; font-size: 16px; } .wl-hero .char-lg { width: 90px; } }

/* Year report: print only the report itself */
.report-subject { border-top: 1px solid #e3e3e3; padding-top: 10px; margin-top: 12px; }
.report-subject h4 { margin: 0 0 6px; }
.report-notes { min-height: 3.5em; border: 1px dashed #bbb; border-radius: 8px; padding: 8px; background: #fffef6; }
.report-notes:empty::before { content: attr(data-placeholder); color: #999; }
@media print {
  body * { visibility: hidden !important; }
  .print-report, .print-report * { visibility: visible !important; }
  .print-report { position: absolute; left: 0; top: 0; width: 100%; color: #000; background: #fff; }
  .report-notes { border: none; background: none; }
  .report-notes:empty::before { content: ''; }
}

/* Hint ladder: after two misses, the right answer glows so the child can see it modeled */
.answer.show-me { outline: 4px solid #2bb673; outline-offset: 3px; animation: showMePulse 1.2s ease-in-out infinite; }
@keyframes showMePulse { 50% { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .answer.show-me { animation: none; } }

/* Keep grid children inside the screen rather than sizing columns from long text. */
.home, .game, .tutor-layout, .welcome, .p-wrap { min-width: 0; }
.home > *, .game > *, .tutor-layout > *, .welcome > *, .p-wrap > * { min-width: 0; max-width: 100%; }
.land-hero-copy, .land-hero-art, .p-hub-card > *, .p-field { min-width: 0; }
.content { padding-left: max(clamp(12px, 3vw, 32px), env(safe-area-inset-left)); padding-right: max(clamp(12px, 3vw, 32px), env(safe-area-inset-right)); }
.p-wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-bottom: max(60px, env(safe-area-inset-bottom)); }
.pin-screen { display: flex; flex-direction: column; }
.pin-box { width: min(360px, calc(100% - 24px)); margin: auto 12px; align-self: center; flex: none; }
.keypad { width: 100%; max-width: 252px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.p-scroll { min-width: 0; max-width: 100%; }
.p-field input, .p-field select, .wl-field input, .wl-field select { width: 100%; max-width: 100%; min-width: 0; }
.wl-pins label, .wl-pins input { max-width: 100%; min-width: 0; }
.p-note, .p-muted, .p-hub-card, .msg { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .tutor-layout, .write-layout, .exp-cols { grid-template-columns: minmax(0, 1fr); }
  .topbar { flex-wrap: wrap; }
  .title { flex-basis: 120px; }
  .node .label { white-space: normal; text-align: center; width: max-content; max-width: calc((100vw - 72px) / 2); }
  .map { row-gap: 62px; padding-bottom: 44px; }
  .teach-row { flex-wrap: wrap; }
  .course-picture { max-width: 100%; overflow-wrap: anywhere; }
  .p-row, .p-save { flex-wrap: wrap; }
  .p-grid2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
  .level-check .lc-areas { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); width: 100%; }
  .sb-themes { grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); }
  .land-hero-circle { max-width: 100%; }
  .spell-slots.words .slot { max-width: 100%; height: auto; min-height: 56px; padding-block: 8px; overflow-wrap: anywhere; }
  .spell-tiles.words .tile-btn { max-width: 100%; overflow-wrap: anywhere; padding-block: 8px; }
}
@media (max-width: 480px) {
  .hello, .buddy-row, .hero-row { flex-direction: column; align-items: center; }
  .hello .bubble, .buddy-row .bubble, .hero-row .bubble { width: 100%; flex: auto; }
  .course-options { grid-template-columns: 1fr; }
  .inrow { flex-wrap: wrap; }
  .inrow input { flex-basis: 100%; width: 100%; }
  .inrow .send { width: 100%; }
  .pin-box { padding: 20px; }
  .land-hero h1 { font-size: clamp(38px, 11.5vw, 55px); }
  .land-brand { white-space: normal; min-width: 0; }
  .land-brand-mark { flex: none; }
  .land-hero-art { min-width: 0; }
  .land-jax .char { max-width: 100%; }
  .p-hub-card { grid-template-columns: auto minmax(0, 1fr); }
  .p-hub-card em { grid-column: 2; white-space: normal; }
  .steps-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Parent orientation: one readable topic at a time, with a reusable quick reference. */
.orientation-intro, .orientation-entry { background: #fff9e6; }
.orientation-entry { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.orientation-intro p, .orientation-chapter p { margin: 0; line-height: 1.6; }
.orientation-intro progress { width: 100%; height: 12px; accent-color: #c99717; }
.orientation-topics summary, .orientation-reference summary { cursor: pointer; font-weight: 700; }
.orientation-topics nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.orientation-topic { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 10px; border: 1px solid #dbe1ed; border-radius: 12px; background: #f5f7fb; text-align: left; cursor: pointer; }
.orientation-topic.on { background: #fff0b9; border-color: #d4ad3b; }
.orientation-topic small { color: #58657a; }
.orientation-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: #725810; }
.orientation-chapter { gap: 20px; padding: clamp(16px, 3vw, 30px); font-size: 17px; }
.orientation-chapter > h3 { font-size: clamp(24px, 3vw, 32px); }
.orientation-chapter h4 { font: 700 20px var(--f-head); margin: 0 0 10px; }
.orientation-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.orientation-roles section { background: #f2f7fd; border-radius: 16px; padding: 16px; }
.orientation-roles section:last-child { background: #f0f8ee; }
.orientation-roles .p-list { font-size: 16px; gap: 10px; line-height: 1.5; }
.orientation-steps { display: grid; gap: 12px; margin: 0; padding-left: 24px; line-height: 1.6; }
.orientation-remember, .orientation-demo { background: #fff8dc; border-radius: 14px; padding: 16px; }
.orientation-demo { display: grid; gap: 12px; }
.orientation-demo-buttons, .orientation-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.orientation-actions { justify-content: space-between; }
.orientation-actions button, .orientation-hear, .orientation-tool, .orientation-return { min-height: 48px; }
.orientation-demo-buttons button { min-height: 48px; min-width: 48px; }
.orientation-checks { min-width: 0; margin: 0; padding: 16px; border: 1px solid #dbe1ed; border-radius: 14px; }
.orientation-checks legend { font-weight: 700; padding: 0 6px; }
.orientation-checks label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; line-height: 1.5; cursor: pointer; }
.orientation-checks input { flex: none; width: 22px; height: 22px; margin: 2px 0; accent-color: #527e28; }
.orientation-reference dt { font-weight: 700; margin-top: 16px; }
.orientation-reference dd { margin: 4px 0 0; line-height: 1.5; }
@media (max-width: 640px) {
  .orientation-entry, .orientation-roles, .orientation-topics nav { grid-template-columns: minmax(0, 1fr); }
  .orientation-actions button { flex: 1 1 120px; }
}
