/* NobiOba: cut-paper look. Only transform and opacity are animated, so it stays smooth on a Fire tablet. */
@font-face { font-family: 'Shantell Sans'; src: url(../fonts/shantell.woff2) format('woff2'); font-weight: 300 800; font-display: swap; }
@font-face { font-family: 'Andika'; src: url(../fonts/andika-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Andika'; src: url(../fonts/andika-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ink: #2D2A3E; --per: #E9683A; --mus: #EDB23C; --spr: #2E7D6B; --sky: #CFE8E4; --blu: #F6C9B8; --pap: #FBF3E4; --plum: #5B4A6B; --sand: #F3E7D2;
  --rb: clamp(64px, 16vmin, 80px);                 /* round buttons in the top corners */
  --opt: clamp(84px, min(26vw, 22vh), 148px);      /* answer buttons */
  --it: clamp(44px, min(15vw, 11.5vh), 92px);      /* things to count */
  --c: clamp(25px, min(7.6vw, 6.2vh), 52px);       /* ten-frame squares */
  --blob: 30% 34% 31% 35% / 35% 30% 36% 31%;
  --drop: 0 5px 0 rgba(45, 42, 62, .16);
  --display: 'Shantell Sans', 'Andika', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { background: var(--pap); color: var(--ink); font-family: 'Andika', system-ui, sans-serif; font-size: 18px; line-height: 1.35; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; touch-action: manipulation; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; border: 0; padding: 0; margin: 0; background: none; cursor: pointer; touch-action: manipulation; -webkit-appearance: none; appearance: none; }
button:focus-visible { outline: 4px solid var(--plum); outline-offset: 4px; }
svg { display: block; width: 100%; height: 100%; }
h1, h2, p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.screen { position: fixed; inset: 0; display: flex; flex-direction: column; gap: clamp(6px, 1.6vh, 14px);
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: var(--pap) url(../img/grain.png); animation: screen-in .26s ease-out both; }
.screen > * { position: relative; z-index: 1; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- top bar: home / who in the top-left, replay in the top-right ---------- */
.bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; flex: none; min-height: var(--rb); }
.bar .mid { display: flex; justify-content: center; align-items: center; min-width: 0; }
.rbtn { width: var(--rb); height: var(--rb); border-radius: var(--blob); background: var(--mus); color: var(--ink); display: grid; place-items: center; box-shadow: var(--drop); transition: transform .12s ease-out; flex: none; }
.rbtn svg { width: 54%; height: 54%; }
.rbtn:active, .opt:active, .go:active, .stop:active, .station:active, .card:active, .chip.who:active { transform: translateY(3px) scale(.97); }
.rbtn.snd { background: var(--spr); color: var(--pap); }
.rbtn.ghost { visibility: hidden; }
.ttl { font-family: var(--display); font-weight: 800; font-size: clamp(22px, 5.4vmin, 38px); line-height: 1.1; text-align: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: var(--rb); padding: 0 clamp(12px, 3vmin, 20px) 0 8px; background: var(--pap); border-radius: 999px; box-shadow: var(--drop); font-family: var(--display); font-weight: 800; font-size: clamp(20px, 5vmin, 30px); transition: transform .12s ease-out; }
.chip svg { width: calc(var(--rb) * .78); height: calc(var(--rb) * .78); flex: none; }
.chip.stars { height: calc(var(--rb) * .78); padding-left: 10px; }
.chip.stars svg { width: 30px; height: 30px; color: var(--mus); }

/* ---------- the guides ---------- */
.guide { aspect-ratio: 200 / 220; flex: none; }
.guide .mascot { overflow: visible; }
.mascot .eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.bob { animation: bob 3.4s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(-7px); } }
.nod { animation: nod .5s ease-out; }
@keyframes nod { 30% { transform: translateY(-12px) rotate(-3deg); } 60% { transform: translateY(0) rotate(2deg); } }
.wig { animation: wig .42s ease-out; }
@keyframes wig { 20% { transform: translateX(-7px) rotate(-3deg); } 50% { transform: translateX(6px) rotate(3deg); } 80% { transform: translateX(-3px); } }

/* ---------- big round "go" button ---------- */
.go { width: clamp(88px, 24vmin, 132px); height: clamp(88px, 24vmin, 132px); border-radius: var(--blob); background: var(--per); color: var(--pap); display: grid; place-items: center; box-shadow: 0 7px 0 rgba(45, 42, 62, .2); transition: transform .12s ease-out; flex: none; position: relative; }
.go svg { width: 50%; height: 50%; }
.go.pulse::after, .station.now .disc::after, .opt.glow::after { content: ''; position: absolute; inset: -9px; border: 5px solid var(--per); border-radius: inherit; animation: ring 1s ease-in-out infinite alternate; pointer-events: none; }
@keyframes ring { from { opacity: .25; transform: scale(.96); } to { opacity: 1; transform: scale(1.04); } }

/* ---------- start ---------- */
.start { align-items: center; justify-content: center; text-align: center; background-color: var(--sky); }
.hero { display: flex; flex-direction: column; align-items: center; gap: clamp(12px, 3.5vh, 30px); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand svg { width: clamp(48px, 12vmin, 76px); height: clamp(48px, 12vmin, 76px); }
.brand h1 { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 9.5vmin, 68px); letter-spacing: -.01em; }
.pair { display: flex; align-items: flex-end; gap: clamp(8px, 4vw, 40px); }
.pair .guide { height: clamp(120px, 30vh, 250px); }
.pair .g2 { animation-delay: -1.7s; }
.hint { font-size: clamp(16px, 3.6vmin, 22px); color: var(--plum); }
@media (orientation: landscape) and (max-height: 520px) { .hero { display: grid; grid-template-columns: auto auto; grid-template-areas: 'b b' 'p g' 'h h'; column-gap: 40px; row-gap: 8px; justify-items: center; align-items: center; } .brand { grid-area: b; } .pair { grid-area: p; } .hero .go { grid-area: g; } .hint { grid-area: h; } .pair .guide { height: 42vh; } }

/* ---------- who is playing ---------- */
.who { background-color: var(--sand); }
.cards { flex: 1; display: flex; align-items: center; justify-content: center; gap: clamp(14px, 5vw, 48px); min-height: 0; padding-bottom: clamp(20px, 8vh, 80px); }
.card { width: min(42vw, 300px); max-height: 100%; padding: clamp(10px, 3vmin, 24px); border-radius: 26px 32px 28px 34px; box-shadow: 0 8px 0 rgba(45, 42, 62, .16); display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .12s ease-out; }
.card.oba { background: var(--sky); transform: rotate(-1.5deg); }
.card.nobi { background: var(--blu); transform: rotate(1.5deg); }
.card .guide { width: 78%; max-height: 46vh; }
.card .nm { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 8vmin, 54px); line-height: 1.05; }
@media (orientation: landscape) { .card { flex-direction: row; width: min(44vw, 420px); justify-content: center; gap: 14px; } .card .guide { width: auto; height: min(46vh, 240px); } }

/* ---------- home ---------- */
.backdrop { position: absolute; inset: 0; z-index: 0; }
.home { padding-bottom: 0; }
.stops { flex: 1; display: flex; align-items: center; justify-content: center; gap: clamp(10px, 4vw, 44px); min-height: 0; }
.stop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: transform .12s ease-out; }
.stop .sign { width: clamp(92px, 27vmin, 190px); height: clamp(92px, 27vmin, 190px); border-radius: var(--blob); background: var(--pap); box-shadow: 0 8px 0 rgba(45, 42, 62, .2); display: grid; place-items: center; }
.stop .sign svg { width: 62%; height: 62%; }
.stop:nth-child(2) .sign { border-radius: 34% 30% 35% 31% / 31% 36% 30% 35%; margin-top: clamp(0px, 5vh, 40px); }
.lbl { display: none; font-family: var(--display); font-weight: 800; font-size: clamp(15px, 3.6vmin, 22px); background: var(--pap); border-radius: 999px; padding: 2px 14px; line-height: 1.3; }
.reads .lbl { display: block; }
.stop.asleep .sign { background: var(--sand); }
.stop.asleep .sign > svg { opacity: .38; }
.stop .zz { position: absolute; top: -10px; right: -8px; width: clamp(38px, 10vmin, 56px); height: clamp(38px, 10vmin, 56px); background: var(--plum); color: var(--pap); border-radius: 50%; padding: 8px; }
.ground { position: relative; flex: none; height: clamp(110px, 25vh, 250px); margin: 0 calc(-1 * max(14px, env(safe-area-inset-right))) 0 calc(-1 * max(14px, env(safe-area-inset-left))); overflow: hidden; pointer-events: none; }
.rail { position: absolute; left: 0; right: 0; bottom: 16%; height: 9px; background: var(--ink); border-radius: 3px; }
.rail::after { content: ''; position: absolute; left: 0; right: 0; top: 9px; height: 9px; background: repeating-linear-gradient(90deg, var(--plum) 0 12px, transparent 12px 44px); opacity: .8; }
.train { position: absolute; left: 5%; bottom: calc(16% + 7px); height: min(clamp(64px, 15vh, 150px), calc(var(--tw, 43vw) * 198 / (var(--cars, 1) * 116 + 222))); animation: arrive 2.3s cubic-bezier(.2, .7, .2, 1) both; }
.train-svg { width: auto; height: 100%; overflow: visible; }
@keyframes arrive { from { transform: translateX(-115%); } }
.train .wheel { transform-box: fill-box; transform-origin: center; animation: spin .55s linear 4; }
@keyframes spin { to { transform: rotate(360deg); } }
.train .puff { transform-box: fill-box; transform-origin: center; opacity: 0; animation: puff 2.4s ease-out 5; }
.train .puff:nth-child(2) { animation-delay: .8s; }
.train .puff:nth-child(3) { animation-delay: 1.6s; }
@keyframes puff { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 25% { opacity: .9; } 100% { opacity: 0; transform: translate(-34px, -54px) scale(1.5); } }
.ground .guide { position: absolute; right: 4%; bottom: 6%; height: 92%; }
.k-nobi .ground .guide { bottom: 12%; height: 84%; }

/* ---------- path of skills ---------- */
.path { background-color: var(--sand); }
.stations { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: safe center; justify-items: center; gap: clamp(16px, 4vh, 34px) 8px; padding: 14px 4px clamp(30px, 9vh, 90px); touch-action: pan-y; }
@media (min-width: 560px) { .stations { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.station { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: transform .12s ease-out; }
.station .disc { position: relative; width: clamp(96px, 25vmin, 160px); height: clamp(96px, 25vmin, 160px); border-radius: var(--blob); background: var(--pap); box-shadow: 0 7px 0 rgba(45, 42, 62, .18); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: clamp(34px, 9vmin, 60px); }
.station:nth-child(even) .disc { border-radius: 35% 30% 34% 31% / 30% 35% 31% 36%; }
.station .disc > svg { width: 62%; height: 62%; }
.station.done .disc { background: var(--sky); }
.station.now .disc { background: var(--mus); }
.station.locked .disc { background: var(--sand); box-shadow: 0 5px 0 rgba(45, 42, 62, .1); }
.station.locked .disc > * { opacity: .32; }
.station .tag { position: absolute; top: -8px; right: -6px; width: clamp(34px, 9vmin, 48px); height: clamp(34px, 9vmin, 48px); border-radius: 50%; padding: 7px; display: none; }
.station.done .tag { display: block; background: var(--spr); color: var(--mus); }
.station.locked .tag { display: block; background: var(--plum); color: var(--pap); }
.station.due .tag { background: var(--per); color: var(--pap); }
.station .lbl { background: none; padding: 0; text-align: center; max-width: 12ch; line-height: 1.15; }
.steps { display: flex; gap: 6px; height: 12px; }
.steps i { width: 12px; height: 12px; border-radius: 50%; background: rgba(45, 42, 62, .18); }
.steps i.on { background: var(--spr); }

/* ---------- lesson ---------- */
.lesson { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto; padding-bottom: max(clamp(12px, 3.5vh, 36px), env(safe-area-inset-bottom)); --vw: calc(100vw - 56px); }
.lesson .bar { grid-row: 1; } .lesson .ask { grid-row: 2; } .lesson .vis { grid-row: 3; } .lesson .opts { grid-row: 4; } .lesson .side { grid-row: 5; }
.pips { display: flex; gap: clamp(6px, 2vmin, 12px); align-items: center; }
.pip { width: clamp(18px, 4.6vmin, 28px); height: clamp(18px, 4.6vmin, 28px); border-radius: 50%; background: rgba(45, 42, 62, .14); display: grid; place-items: center; }
.pip svg { display: none; }
.pip.first { background: none; color: var(--mus); transform: scale(1.35); } .pip.first svg { display: block; }
.pip.later { background: var(--spr); }
.pip.cur { box-shadow: 0 0 0 3px var(--pap), 0 0 0 6px var(--per); }
.ask { font-family: var(--display); font-weight: 800; font-size: clamp(22px, 5.4vmin, 40px); line-height: 1.12; text-align: center; min-height: 0; }
.lesson:not(.reads) .ask { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.vis { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 2vh, 18px); min-height: 0; min-width: 0; }
.opts { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: clamp(10px, 3.6vw, 28px); min-width: 0; }
.side { display: flex; justify-content: space-between; align-items: flex-end; height: clamp(70px, 14vh, 150px); min-height: 0; }
.side .guide { height: 100%; }
.side .go { width: clamp(76px, 13vh, 120px); height: clamp(76px, 13vh, 120px); align-self: center; margin: 0 auto; visibility: hidden; }
.intro .side .go { visibility: visible; }
.intro .opts { pointer-events: none; }
.lesson.novis { grid-template-rows: auto auto 0 minmax(0, 1fr) auto; row-gap: 0; }
.lesson.novis .vis { display: none; }
@media (orientation: landscape) {
  .lesson { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; column-gap: clamp(12px, 3vw, 40px); --vw: calc(54vw - 50px); }
  .lesson .bar, .lesson .ask { grid-column: 1 / -1; }
  .lesson .vis { grid-column: 1; grid-row: 3 / 5; }
  .lesson .opts { grid-column: 2; grid-row: 3; align-content: center; }
  .lesson .side { grid-column: 2; grid-row: 4; height: clamp(64px, 20vh, 150px); }
  .lesson.novis { grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr) auto; }
  .lesson.novis .opts { grid-column: 1; grid-row: 3 / 5; }
  .lesson.novis .side { grid-column: 2; grid-row: 3 / 5; flex-direction: column-reverse; align-items: center; justify-content: space-between; height: auto; width: clamp(90px, 16vw, 170px); }
  .lesson.novis .side .guide { height: auto; width: 100%; }
}
/* on a wide tablet the answers sit in the middle of the screen, not the middle of what is left beside the guide */
@media (orientation: landscape) and (min-width: 1000px) {
  .lesson.novis:not(.long) { grid-template-columns: clamp(90px, 16vw, 170px) minmax(0, 1fr) auto; }
  .lesson.novis:not(.long) .opts { grid-column: 2; }
  .lesson.novis:not(.long) .side { grid-column: 3; }
}

/* answer buttons */
.opt { position: relative; width: var(--opt); height: var(--opt); border-radius: var(--blob); background: var(--mus); box-shadow: 0 7px 0 rgba(45, 42, 62, .18); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: calc(var(--opt) * .5); line-height: 1; transition: transform .14s ease-out, opacity .2s; }
.opt:nth-child(2) { border-radius: 35% 30% 34% 31% / 30% 35% 31% 36%; }
.opt:nth-child(3) { border-radius: 31% 35% 30% 34% / 34% 31% 35% 30%; }
.opt.pic { background: var(--pap); } .opt.pic svg { width: 76%; height: 76%; }
.opt.group { width: min(88vw, 440px); height: auto; min-height: var(--opt); padding: clamp(10px, 2.6vmin, 20px); background: var(--pap); border-radius: 24px 30px 26px 32px; --it: clamp(34px, min(13.5vw, 8.5vh), 64px); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.novis .opts { gap: clamp(14px, 3.5vh, 30px); }
.novis .opt.pic { --opt: clamp(92px, min(27vw, 24vh), 190px); }
@media (orientation: landscape) { .opt.group { width: min(36vw, 400px); --it: clamp(30px, min(5.6vw, 13vh), 64px); } }
.opt.group:nth-child(2) { background: var(--sky); border-radius: 30px 24px 32px 26px; }
.opt.no { opacity: .34; transform: scale(.92); pointer-events: none; }
.opt.right { background: var(--spr); color: var(--pap); animation: pop .45s ease-out; }
.opt.pic.right, .opt.group.right { background: var(--pap); box-shadow: 0 0 0 6px var(--spr), 0 7px 0 rgba(45, 42, 62, .18); color: var(--ink); }
.won .opt:not(.right) { opacity: .34; }
.cnt { display: block; font-size: clamp(26px, 6vmin, 44px); min-height: 1.1em; margin-top: 6px; }
@keyframes pop { 40% { transform: scale(1.14); } }

/* things to count: rows of five */
.vis .items { --it: clamp(40px, min(calc(var(--vw) / var(--cols) - 10px), 13.5vh), 112px); }
.items { display: grid; grid-template-columns: repeat(var(--cols), var(--it)); gap: clamp(6px, 1.6vmin, 14px) clamp(4px, 1.2vmin, 12px); justify-content: center; }
.items[hidden] { display: none; }
.items.mini { gap: 4px; } .items.mini svg { width: var(--it); height: var(--it); }
.it { position: relative; width: var(--it); height: var(--it); transition: transform .16s ease-out; }
.it b { position: absolute; right: -6%; bottom: -6%; width: 50%; height: 50%; box-shadow: 0 0 0 3px var(--pap); border-radius: 50%; background: var(--ink); color: var(--pap); font-family: var(--display); font-weight: 800; font-size: calc(var(--it) * .36); display: grid; place-items: center; opacity: 0; transform: scale(.4); transition: transform .16s ease-out, opacity .16s; }
.it.on { transform: scale(1.1); } .it.on b { opacity: 1; transform: none; }

/* ten-frames */
.frames { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(8px, 2vmin, 16px); --c: clamp(26px, min(calc(var(--vw) / 6.2), 8.5vh), 64px); }
.frames.two { --c: clamp(24px, min(calc(var(--vw) / 6.2), 6vh), 56px); }
@media (orientation: landscape) { .frames.two { --c: clamp(22px, min(calc(var(--vw) / 11.8), 9.5vh), 52px); } }
.frame { display: grid; grid-template-columns: repeat(5, var(--c)); gap: 4px; padding: 5px; background: var(--ink); border-radius: 10px; box-shadow: var(--drop); }
.cell { position: relative; width: var(--c); height: var(--c); background: var(--pap); border-radius: 16%; }
.cell::after { content: ''; position: absolute; inset: 13%; border-radius: 50%; transform: scale(0); transition: transform .2s ease-out, opacity .2s; }
.cell.a::after { background: var(--per); transform: none; }
.cell.b::after { background: var(--mus); transform: none; }
.cell.want { outline: 3px dashed var(--mus); outline-offset: -6px; }
.cell.want.b { outline: 0; }
.cell.want.count::after { background: var(--mus); transform: none; opacity: .5; }
.cell.b.count, .cell.x.gone { box-shadow: inset 0 0 0 3px var(--ink); }
.cell.x::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(45deg, transparent 45%, var(--ink) 45% 55%, transparent 55%); opacity: .7; }
.cell.x::after { opacity: .5; } .cell.x.gone::after { transform: scale(0); }
.eq { display: flex; align-items: center; justify-content: center; gap: .32em; font-family: var(--display); font-weight: 800; font-size: clamp(30px, min(9vw, 8vh), 64px); line-height: 1; }
.eq .qm { min-width: 1.25em; padding: .08em .14em; text-align: center; background: var(--pap); border-radius: 12px; box-shadow: inset 0 0 0 3px var(--mus); color: var(--per); }
.eq .qm.done { background: var(--spr); color: var(--pap); box-shadow: none; }
.vis > .eq:only-child { font-size: clamp(40px, min(13vw, 13vh), 96px); }
.blocks { width: auto; height: clamp(120px, min(34vh, 60vw), 260px); max-width: 100%; }
.rod.count, .unit.count { animation: rodp .32s ease-in-out 2 alternate; } @keyframes rodp { to { opacity: .4; } }

/* ---------- reward ---------- */
.reward { background-color: var(--sky); }
.prize { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 2.2vh, 20px); padding-bottom: clamp(12px, 6vh, 60px); text-align: center; }
.prize .who-row { display: flex; align-items: flex-end; justify-content: center; gap: 10px; }
.prize .guide { height: clamp(96px, 24vh, 210px); }
.prize .badge { width: clamp(80px, 20vh, 150px); height: clamp(80px, 20vh, 150px); animation: pop .6s ease-out .3s both; }
.strow { display: flex; gap: clamp(6px, 2vmin, 14px); }
.st { width: clamp(38px, 11vmin, 68px); height: clamp(38px, 11vmin, 68px); color: rgba(45, 42, 62, .16); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), color .2s; }
.st.lit { color: var(--mus); transform: scale(1.12) rotate(-6deg); }
.msg { font-family: var(--display); font-weight: 800; font-size: clamp(20px, 5vmin, 34px); line-height: 1.15; max-width: 22ch; }
.reward:not(.reads) .msg { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.bonus { font-family: var(--display); font-weight: 800; font-size: clamp(20px, 5vmin, 30px); color: var(--per); min-height: 1.2em; }
@media (orientation: landscape) and (max-height: 560px) { .prize { display: grid; grid-template-columns: auto auto; grid-template-areas: 'w s' 'w m' 'w g'; column-gap: 36px; justify-items: center; align-content: center; } .prize .who-row { grid-area: w; } .strow { grid-area: s; } .msg, .bonus { grid-area: m; } .prize .go { grid-area: g; } .prize .guide { height: 56vh; } }

/* ---------- words, letters, pictures, patterns, spelling ---------- */
.opt.tell, .bigpic.tell, .rc.tell { transform: scale(1.1); box-shadow: 0 0 0 6px var(--per), 0 7px 0 rgba(45, 42, 62, .18); }
.opt.word { width: auto; min-width: var(--opt); height: auto; min-height: clamp(64px, 11vh, 96px); padding: .15em .7em; font-family: 'Andika', system-ui, sans-serif; font-weight: 700; font-size: clamp(26px, 6vmin, 42px); border-radius: 20px 26px 22px 28px; }
.opt.word.letter { width: var(--opt); height: var(--opt); min-width: 0; padding: 0; font-size: calc(var(--opt) * .58); border-radius: var(--blob); }
.lesson.long .opts { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: clamp(8px, 1.6vh, 14px); width: min(100%, 600px); justify-self: center; }
.lesson.long .opt.word { width: 100%; font-size: clamp(19px, 4.4vmin, 28px); line-height: 1.2; min-height: 64px; padding: .3em .8em; }
.opt.pic .sz { display: block; width: 76%; height: 76%; } .opt.pic .sz svg { width: 100%; height: 100%; }
.opt.picked { box-shadow: 0 0 0 6px var(--plum), 0 7px 0 rgba(45, 42, 62, .18); }
.lesson.n4 .opts { display: grid; grid-template-columns: repeat(2, auto); justify-content: center; }
.lesson.n4 .opt.pic { --opt: clamp(84px, min(36vw, 17vh), 170px); }
.bigword { font-family: 'Andika', system-ui, sans-serif; font-weight: 700; font-size: clamp(34px, min(15vh, calc(var(--vw) / (var(--len, 5) * .6 + 1.2))), 120px); line-height: 1.05; background: var(--pap); border-radius: 22px 28px 24px 30px; padding: .08em .5em .14em; box-shadow: var(--drop); }
.bigword.one { font-size: clamp(72px, min(32vw, 24vh), 190px); padding: 0 .35em .06em; }
.bigpic { width: clamp(104px, min(42vw, 28vh), 240px); aspect-ratio: 1; flex: none; background: var(--pap); border-radius: var(--blob); box-shadow: var(--drop); display: grid; place-items: center; transition: transform .14s ease-out; }
.bigpic svg { width: 78%; height: 78%; }
.bigpic.small { width: clamp(76px, min(28vw, 16vh), 170px); }
.story { max-width: 34em; max-height: 100%; overflow-y: auto; background: var(--pap); border-radius: 18px 24px 20px 26px; box-shadow: var(--drop); padding: clamp(10px, 2.4vmin, 22px) clamp(14px, 3.4vmin, 28px); font-size: clamp(19px, 4.5vmin, 28px); line-height: 1.42; touch-action: pan-y; }
.row { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: clamp(4px, 1.2vmin, 12px); width: min(100%, calc(var(--n) * 104px)); }
.rc { aspect-ratio: 1; display: grid; place-items: center; border-radius: 16%; transition: transform .14s ease-out; }
.rc svg { width: 100%; height: 100%; }
.rc .n { font-family: var(--display); font-weight: 800; font-size: clamp(18px, calc(var(--vw) / var(--n) * .44), 46px); line-height: 1; }
.row.nums .rc { background: var(--pap); box-shadow: var(--drop); }
.rc.ask-cell { background: var(--pap); box-shadow: inset 0 0 0 3px var(--mus); color: var(--per); }
.rc.ask-cell svg { width: 84%; height: 84%; }
.row.nums .rc.ask-cell.done { background: var(--spr); color: var(--pap); box-shadow: none; }
.slots { display: flex; gap: clamp(4px, 1.2vmin, 12px); justify-content: center; --sl: clamp(34px, min(calc(var(--vw) / var(--n) - 6px), 11vh), 88px); }
.slot { width: var(--sl); height: calc(var(--sl) * 1.12); background: var(--pap); border-radius: 12px; box-shadow: inset 0 -5px 0 var(--ink); display: grid; place-items: center; font-family: 'Andika', system-ui, sans-serif; font-weight: 700; font-size: calc(var(--sl) * .7); line-height: 1; font-style: normal; }
.slot.in { animation: pop .3s ease-out; }
.slot.right { background: var(--spr); color: var(--pap); box-shadow: none; }
.opt.tile { --opt: clamp(64px, min(18vw, 14vh), 96px); font-family: 'Andika', system-ui, sans-serif; font-weight: 700; font-size: calc(var(--opt) * .6); border-radius: 18px 22px 20px 24px; padding-bottom: .12em; }
.opt.tile.used { opacity: .22; transform: scale(.9); pointer-events: none; }
.t-spell .opts { gap: clamp(8px, 2.4vw, 16px); }
@media (orientation: landscape) and (max-height: 500px) { .opt.tile { --opt: 62px; } .t-spell .opts { gap: 8px; align-content: center; } }
.meter { width: min(46vw, 280px); height: 16px; border-radius: 8px; background: rgba(45, 42, 62, .14); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--spr); border-radius: 8px; transform-origin: left; transform: scaleX(var(--f, 0)); transition: transform .3s ease-out; }
@media (orientation: landscape) {
  .lesson.n4 .opts { display: flex; flex-wrap: nowrap; }
  .lesson.n4 .opt.pic { --opt: clamp(84px, min(15vw, 26vh), 170px); }
  .lesson.long .side { display: none; }
  .lesson.long .opts { grid-row: 3 / 5; align-self: center; }
}

/* ---------- scores the child can see ---------- */
.prog { display: block; width: 76%; height: 12px; border-radius: 6px; background: rgba(45, 42, 62, .22); box-shadow: 0 0 0 3px var(--pap); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--spr); border-radius: 6px; transform-origin: left; transform: scaleX(var(--f, 0)); }
.cnt2 { display: none; font-family: var(--display); font-weight: 800; font-size: clamp(13px, 3vmin, 18px); background: var(--pap); border-radius: 999px; padding: 0 10px; line-height: 1.4; }
.reads .cnt2 { display: block; }
button.chip.stars { cursor: pointer; }
.score { background-color: var(--sand); }
.sum { display: flex; align-items: center; justify-content: center; gap: 12px; flex: none; }
.sum .guide { height: clamp(60px, 13vh, 110px); }
.chip.bdg svg { width: 34px; height: 34px; }
.secs { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; display: flex; flex-direction: column; gap: clamp(10px, 2vh, 16px); padding: 6px 2px clamp(24px, 6vh, 60px); width: min(100%, 760px); align-self: center; }
.sec { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; align-items: center; text-align: left; background: var(--pap); border-radius: 22px 28px 24px 30px; box-shadow: var(--drop); padding: clamp(10px, 2.4vmin, 18px); transition: transform .12s ease-out; }
.sec:active { transform: translateY(3px) scale(.99); }
.sec .sign { width: clamp(64px, 16vmin, 96px); height: clamp(64px, 16vmin, 96px); border-radius: var(--blob); background: var(--sky); display: grid; place-items: center; }
.sec .sign svg { width: 62%; height: 62%; }
.sec .info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sec .nm { display: none; font-family: var(--display); font-weight: 800; font-size: clamp(20px, 4.6vmin, 28px); line-height: 1; }
.reads .sec .nm { display: block; }
.sec .prog { width: 100%; height: 16px; border-radius: 8px; box-shadow: none; }
.sec .nums { display: flex; justify-content: space-between; align-items: center; font-family: var(--display); font-weight: 800; font-size: clamp(16px, 3.8vmin, 22px); }
.sec .stn { display: inline-flex; align-items: center; gap: 4px; } .sec .stn svg { width: 22px; height: 22px; color: var(--mus); }
.sec:not(.x) .of { visibility: hidden; } .reads .sec .of { visibility: visible; }
.bds { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.bd { width: clamp(38px, 9.5vmin, 54px); height: clamp(38px, 9.5vmin, 54px); border-radius: 50%; background: var(--sand); display: grid; place-items: center; font: 800 clamp(10px, 2.6vmin, 15px)/1 var(--display); font-style: normal; overflow: hidden; }
.bd > * { opacity: .3; } .bd svg { width: 66%; height: 66%; } .bd span { max-width: 92%; overflow: hidden; white-space: nowrap; }
.bd.on { background: var(--mus); box-shadow: 0 0 0 3px var(--spr); } .bd.on > * { opacity: 1; }
.cap { display: none; font-size: clamp(16px, 3.6vmin, 22px); color: var(--plum); }
.reads .cap { display: block; }
.steps.big { height: auto; align-items: center; gap: 8px; }
.steps.big i { width: 18px; height: 18px; } .steps.big i.cur { box-shadow: 0 0 0 3px var(--pap), 0 0 0 6px var(--per); } .steps.big i.new { animation: pop .6s ease-out .8s both; }
.steps.big span { display: none; margin-left: 6px; font-family: var(--display); font-weight: 800; font-size: clamp(15px, 3.4vmin, 20px); } .reads .steps.big span { display: inline; }

/* ---------- a quiet moment: before the starting check, after it, and when time is up ---------- */
.moment { background-color: var(--sky); }
.moment.limit { background-color: var(--blu); }
.moment .gnote { margin: 4px 0 0; font: 400 15px/1.35 Andika, sans-serif; color: var(--plum, #5B4A6B); text-align: center; max-width: 30ch; }
.moment:not(.reads):not(.limit) .msg { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.trk { grid-column: 1 / -1; justify-self: start; font-family: var(--display); font-weight: 800; font-size: clamp(20px, 5vmin, 30px); padding: 0 10px; margin-bottom: -8px; }
.trk:not(:first-child) { margin-top: 8px; }
.rbtn.gu { background: var(--plum); color: var(--pap); position: relative; }
.rbtn.gu .dot { position: absolute; top: -6px; right: -6px; min-width: 28px; height: 28px; border-radius: 14px; background: var(--per); color: var(--pap); font: 800 16px/28px var(--display); text-align: center; padding: 0 6px; font-style: normal; box-shadow: 0 0 0 3px var(--sand); }
.rbtn.gu .dot:empty { display: none; }

/* ---------- grown-ups: PIN ---------- */
.pin { background-color: var(--sand); }
.pinbox { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 2vh, 18px); text-align: center; }
.pinbox h2 { font-family: var(--display); font-weight: 800; font-size: clamp(20px, 4.6vmin, 30px); max-width: 20ch; line-height: 1.15; }
.pinbox .note { min-height: 1.4em; color: var(--per); font-weight: 700; }
.dots { display: flex; gap: 14px; min-height: 30px; align-items: center; font: 800 30px/1 var(--display); }
.dots i { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 3px var(--ink); } .dots i.on { background: var(--ink); }
.pad { display: grid; grid-template-columns: repeat(3, auto); gap: clamp(8px, 1.6vh, 14px); }
.pad button { width: clamp(64px, min(20vw, 12vh), 88px); height: clamp(56px, min(20vw, 11vh), 80px); border-radius: 18px; background: var(--pap); box-shadow: var(--drop); font: 800 clamp(24px, 5vmin, 34px)/1 var(--display); display: grid; place-items: center; }
.pad button svg { width: 44%; height: 44%; }
.pad button:active { transform: translateY(3px); }
.pad .ok { background: var(--spr); color: var(--pap); }
.linkbtn { text-decoration: underline; color: var(--plum); min-height: 44px; padding: 0 12px; font-size: 17px; }
@media (orientation: landscape) and (max-height: 520px) { .pinbox { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 't p' 'd p' 'n p' 'f p'; column-gap: 30px; align-content: center; justify-items: center; } .pinbox h2 { grid-area: t; } .dots { grid-area: d; } .pinbox .note { grid-area: n; } .pad { grid-area: p; } .pinbox .linkbtn { grid-area: f; } .pad button { height: 60px; } }

/* ---------- grown-ups: progress, alerts, settings (a plain page: it scrolls, text can be selected) ---------- */
.grown { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; background-color: var(--sand); -webkit-user-select: text; user-select: text; touch-action: pan-y; font-size: 17px; }
.gwrap { max-width: 820px; margin: 0 auto; padding-bottom: 70px; display: flex; flex-direction: column; gap: 14px; }
.ghead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ghead h2 { font-family: var(--display); font-weight: 800; font-size: clamp(24px, 5vmin, 34px); }
.gtabs { display: flex; gap: 8px; flex-wrap: wrap; }
.gtabs button, .gbtn { min-height: 48px; padding: 0 18px; border-radius: 14px; background: var(--pap); box-shadow: var(--drop); font-weight: 700; font-size: 17px; }
.gtabs button[aria-selected=true] { background: var(--ink); color: var(--pap); }
.gbtn.warn { background: var(--blu); } .gbtn.sure { background: var(--per); color: var(--pap); } .gbtn.main { background: var(--spr); color: var(--pap); }
.gbtn:active, .gtabs button:active { transform: translateY(2px); }
.gcard { background: var(--pap); border-radius: 18px; padding: 16px 18px; box-shadow: var(--drop); }
.gcard h3 { margin: 0 0 10px; font-family: var(--display); font-weight: 800; font-size: 21px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.gcard h3 small { font: 400 15px 'Andika', sans-serif; color: var(--plum); }
.gcard h4 { margin: 14px 0 6px; font-size: 16px; color: var(--plum); text-transform: uppercase; letter-spacing: .05em; }
.gcard p { margin: 0 0 8px; } .gcard p:last-child { margin-bottom: 0; }
.alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.alert { border-left: 6px solid var(--plum); background: var(--sand); border-radius: 4px 12px 12px 4px; padding: 10px 14px; }
.alert.help { border-color: var(--per); } .alert.good { border-color: var(--spr); }
.alert .kind { font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--plum); }
.alert.help .kind { color: #B8431C; } .alert.good .kind { color: var(--spr); }
.alert .new { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 9px; background: var(--per); color: var(--pap); font-size: 13px; letter-spacing: 0; text-transform: none; }
.alert .tip { color: var(--plum); font-size: 16px; }
.gstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.gstat { background: var(--sand); border-radius: 12px; padding: 10px 12px; }
.gstat b { display: block; font: 800 26px/1.1 var(--display); } .gstat span { font-size: 15px; color: var(--plum); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 110px; margin-top: 12px; }
.week div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 3px; font-size: 13px; color: var(--plum); }
.week i { display: block; width: 70%; max-width: 44px; background: var(--spr); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.sk { border-top: 1px solid rgba(45, 42, 62, .12); }
.sk summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 3.2em; gap: 10px; align-items: center; min-height: 48px; cursor: pointer; list-style: none; }
.sk summary::-webkit-details-marker { display: none; }
.sk .nm { font-weight: 700; }
.sk .state { font-size: 14px; padding: 2px 10px; border-radius: 10px; background: var(--sand); white-space: nowrap; }
.sk.mastered .state { background: var(--sky); } .sk.stuck .state { background: var(--per); color: var(--pap); } .sk.learning .state { background: var(--mus); }
.sk .acc { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.sk .more { padding: 4px 0 14px; font-size: 16px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.stepper { display: flex; align-items: center; gap: 12px; } .stepper b { font: 800 22px var(--display); min-width: 6.5em; text-align: center; }
.stepper .gbtn { width: 52px; padding: 0; font-size: 24px; }
.gcopy { width: 100%; min-height: 150px; margin-top: 10px; font: 15px/1.4 'Andika', sans-serif; padding: 10px; border-radius: 10px; border: 2px solid var(--plum); background: #fff; color: var(--ink); }

/* ---------- grown-ups: saving online ---------- */
.ostate { padding: 8px 12px; border-radius: 12px; background: var(--sand); font-weight: 700; }
.ostate.good { background: #DDEFE6; color: #1F5548; } .ostate.warn { background: #FBE6B8; } .ostate.bad { background: var(--blu); }
.oaside { margin: 10px 0; padding: 12px 14px; border-radius: 14px; background: #FBE6B8; }
.oform { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; max-width: 460px; }
.oform .gfield { flex: none; }
.oerr { margin: 0; color: #A8351B; font-weight: 700; } .oerr:empty { margin-top: -10px; }
.omore { margin-top: 12px; border-top: 2px solid var(--sand); padding-top: 10px; }
.omore summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.gbtn:disabled { opacity: .55; }

/* ---------- the shop ---------- */
.home .shopbtn { position: absolute; z-index: 2; left: max(14px, env(safe-area-inset-left)); top: calc(max(12px, env(safe-area-inset-top)) + var(--rb) + 10px); background: var(--pap); }
.shopbtn svg { width: 60%; height: 60%; color: var(--per); }
.shopbtn.can::after { content: ''; position: absolute; inset: -7px; border: 5px solid var(--per); border-radius: inherit; animation: ring 1s ease-in-out infinite alternate; pointer-events: none; }
.scene .new { transform-box: fill-box; transform-origin: 50% 100%; animation: grow-in .9s cubic-bezier(.3, 1.5, .5, 1) .7s both; }
@keyframes grow-in { from { opacity: 0; transform: scale(0); } }
.shop { background-color: var(--sand); }
.screen.again { animation: none; }
.shop { --sh: clamp(150px, 27vh, 330px); }
.stage { position: relative; flex: none; height: var(--sh); display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 28px); }
.stage .guide { height: 100%; }
.stage .info { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 118px; text-align: center; }
.iname { font-family: var(--display); font-weight: 800; font-size: clamp(18px, 4.4vmin, 28px); line-height: 1.1; max-width: 9em; }
.iname.hint { font-weight: 600; opacity: .7; font-size: clamp(15px, 3.6vmin, 20px); }
.shop:not(.reads) .iname { display: none; }
.mini { position: relative; height: 100%; aspect-ratio: 260 / 176; max-width: 100%; border-radius: 22px 28px 24px 30px; overflow: hidden; box-shadow: var(--drop); background: var(--sky); }
.mini .train { position: absolute; left: 5%; bottom: 7%; height: 32%; }
.mini .train-svg { width: auto; height: 100%; }
.stage.world .info { position: absolute; right: max(6px, calc(50% - min(50%, var(--sh) * 0.74) + 6px)); bottom: 8px; min-width: 0; }
.stage.world .iname { background: var(--pap); border-radius: 999px; padding: 2px 12px; box-shadow: var(--drop); }
.buy, .need { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 66px; padding: 0 20px 0 14px; border-radius: 999px; font-family: var(--display); font-weight: 800; font-size: clamp(24px, 5.6vmin, 32px); line-height: 1; }
.buy { background: var(--per); color: var(--pap); box-shadow: 0 6px 0 rgba(45, 42, 62, .2); transition: transform .12s ease-out; }
.buy:active { transform: translateY(3px) scale(.97); }
.buy svg, .need svg { width: 36px; height: 36px; flex: none; color: var(--mus); }
.buy span, .need span { font-size: .56em; display: none; }
.reads .buy span, .reads .need span { display: inline; }
.buy.pulse::after { content: ''; position: absolute; inset: -8px; border: 5px solid var(--per); border-radius: inherit; animation: ring 1s ease-in-out infinite alternate; pointer-events: none; }
.need { background: rgba(45, 42, 62, .1); color: var(--ink); min-height: 56px; }
.need svg { color: rgba(45, 42, 62, .35); }
.stage.world .need { background: var(--pap); box-shadow: var(--drop); }
.spark { position: absolute; left: 50%; top: 45%; width: 30px; height: 30px; margin: -15px; color: var(--mus); pointer-events: none; opacity: 0; animation: spark .9s ease-out both; }
@keyframes spark { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(.4); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-130px) scale(1.2); } }
.chip.spent { animation: pop .5s ease-out; }
.tabs { display: flex; justify-content: center; gap: 10px; flex: none; }
.tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 20px 0 14px; border-radius: 999px; background: var(--pap); box-shadow: var(--drop); font-family: var(--display); font-weight: 800; font-size: clamp(17px, 4vmin, 22px); transition: transform .12s ease-out; }
.tabs button svg { width: 34px; height: 34px; }
.tabs button[aria-selected='true'] { background: var(--mus); }
.tabs button:active { transform: translateY(3px) scale(.97); }
.shelf { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(92px, 23vmin, 132px), 1fr)); align-content: start; gap: clamp(10px, 2.4vmin, 16px); padding: 8px 6px clamp(24px, 6vh, 50px); width: min(100%, 900px); align-self: center; }
.item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 4px; aspect-ratio: 1 / 1.16; padding: 8px 8px 9px; background: var(--pap); border-radius: 20px 26px 22px 28px; box-shadow: var(--drop); transition: transform .12s ease-out; }
.item:active { transform: translateY(3px) scale(.97); }
.item .pic { flex: 1; min-height: 0; width: 100%; display: grid; place-items: center; border-radius: 14px; overflow: hidden; }
.item .pic svg { width: 100%; height: 100%; }
.t-world .item .pic { background: var(--sky); }
.k-nobi.t-world .item .pic { background: #3F4A6E; }
.price { display: inline-flex; align-items: center; gap: 3px; padding: 1px 12px 1px 7px; border-radius: 999px; background: var(--mus); font-family: var(--display); font-weight: 800; font-size: clamp(16px, 3.8vmin, 21px); line-height: 1.35; }
.price svg { width: 20px; height: 20px; color: var(--pap); }
.item.cant .price { background: rgba(45, 42, 62, .1); } .item.cant .price svg { color: rgba(45, 42, 62, .3); }
.item .tick { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(45, 42, 62, .22); display: grid; place-items: center; flex: none; }
.item .tick svg { width: 68%; height: 68%; }
.item.on { box-shadow: 0 0 0 5px var(--spr), var(--drop); }
.item.on .tick { background: var(--spr); color: var(--pap); box-shadow: none; }
.item.sel { box-shadow: 0 0 0 5px var(--per), var(--drop); }
@media (orientation: landscape) {
  .shop { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); column-gap: clamp(12px, 2.4vw, 28px); }
  .shop .bar { grid-column: 1 / -1; }
  .shop .stage { grid-column: 1; grid-row: 2 / 4; height: auto; min-height: 0; flex-direction: column; justify-content: center; }
  .shop .stage .guide { height: min(100% - 112px, 62vh); min-height: 96px; }
  .shop .stage.world .mini { height: auto; width: 100%; max-height: 100%; }
  .shop .stage.world .info { right: 8px; bottom: calc(50% - min(50%, 38vw * 0.3) + 8px); }
  .shop .tabs { grid-column: 2; grid-row: 2; }
  .shop .shelf { grid-column: 2; grid-row: 3; width: 100%; align-self: stretch; }
}
@media (orientation: landscape) and (max-height: 500px) { .shop .stage .guide { height: calc(100% - 74px); } .shop.reads .stage .guide { height: calc(100% - 108px); } .shop .stage .info { gap: 6px; } .tabs button { min-height: 48px; } .buy { min-height: 58px; } }
@media (orientation: portrait) and (min-width: 700px) { .shop { --sh: clamp(330px, 40vh, 520px); } .shelf { grid-template-columns: repeat(5, 1fr); } }

/* ---------- this week's goal, on My progress ---------- */
.chip small { display: none; font-family: 'Andika', system-ui, sans-serif; font-weight: 700; font-size: .5em; margin-left: 2px; }
.reads .chip small { display: inline; }
.goal { width: 100%; text-align: left; transition: transform .12s ease-out; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; align-items: center; background: var(--blu); border-radius: 22px 28px 24px 30px; box-shadow: var(--drop); padding: clamp(10px, 2.4vmin, 18px); flex: none; }
.goal.met { background: var(--mus); }
.goal .sign { width: clamp(64px, 16vmin, 96px); height: clamp(64px, 16vmin, 96px); border-radius: var(--blob); background: var(--pap); color: var(--per); display: grid; place-items: center; }
.goal.met .sign { color: var(--spr); }
.goal .sign svg { width: 60%; height: 60%; }
.goal .info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.goal .nm { display: none; font-family: var(--display); font-weight: 800; font-size: clamp(18px, 4.2vmin, 26px); line-height: 1.05; }
.goal .nm small { margin-left: 10px; font-size: .78em; background: var(--pap); border-radius: 999px; padding: 0 10px; white-space: nowrap; }
.reads .goal .nm { display: block; }
.goal .prog { width: 100%; height: 16px; border-radius: 8px; box-shadow: none; background: rgba(45, 42, 62, .2); }
.goal:active { transform: translateY(3px) scale(.99); }
.goal .nums { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; font-family: var(--display); font-weight: 800; font-size: clamp(15px, 3.6vmin, 21px); }
.goal .stn { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; } .goal .stn svg { width: 22px; height: 22px; color: var(--pap); }
.goal .days { display: inline-flex; align-items: center; gap: 5px; }
.goal .days i { width: clamp(14px, 3.6vmin, 20px); height: clamp(14px, 3.6vmin, 20px); border-radius: 50%; background: rgba(45, 42, 62, .18); }
.goal .days i.on { background: var(--spr); }
.goal .days i.now { box-shadow: 0 0 0 3px var(--pap); }
.goal .days em { display: none; font-style: normal; margin-left: 6px; font-size: .86em; white-space: nowrap; }
.reads .goal .days em { display: inline; }
.badge.gift { color: var(--per); background: var(--pap); border-radius: var(--blob); padding: 0; box-shadow: var(--drop); display: grid; place-items: center; }
.badge.gift svg { width: 66%; height: 66%; }

/* ---------- grown-ups: weekly goal ---------- */
.wins { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wins li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 12px; border-radius: 12px; background: var(--sand); }
.wins li.owed { background: #FBE6B8; }
.wins em { font-style: normal; font-weight: 700; color: var(--spr); }
.ggoal { border-top: 2px solid var(--sand); margin-top: 12px; padding-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.ggoal h4 { margin: 0; min-width: 3.4em; font-size: 1.1em; }
.ggoal .stepper { margin: 0; }
.ggoal .stepper b { font-size: clamp(17px, 4.8vw, 22px); white-space: nowrap; min-width: 8.2em; }
.gfield { display: flex; flex-direction: column; gap: 4px; font-weight: 700; flex: 1 1 220px; }
.gfield input { font: inherit; font-weight: 400; color: inherit; min-height: 48px; padding: 6px 12px; border: 2px solid rgba(45, 42, 62, .3); border-radius: 12px; background: #fff; -webkit-user-select: text; user-select: text; }
.gfield input:focus-visible { outline: 4px solid var(--plum); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
