/* One clear next action; decorative motion never moves the controls. */
.child-hud { padding: 16px 24px; }
.child-hud .round-button, .dialog-close, .play-top>.round-button { min-width: 44px; min-height: 44px; }
.child-hud .grownup-button { width: auto; padding: 0 13px; gap: 7px; }
.grownup-button span { font-size: .75rem; font-weight: 700; }
button:hover:not(:disabled) { transform: scale(1.035); }
button:active:not(:disabled) { transform: scale(.975); }
.child-home { min-height: calc(100svh - 80px); max-width: 640px; margin: auto; padding: 20px 20px 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.home-message { text-align: center; padding: 17px 35px; border-radius: 28px; color: var(--glass-ink); background: var(--glass-reading); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.home-message h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.home-message p { margin-top: 6px; font-size: 1.05rem; font-weight: 600; }
.home-pet { position: relative; margin: 14px 0 4px; }
.home-pet .pip { width: 220px; height: 245px; }
.home-pet .emoji-pet { font-size: 11rem; min-height: 225px; }
.home-sprout { position: absolute; bottom: 6px; right: -9px; font-size: 3.9rem; filter: drop-shadow(0 4px 4px #214b4344); transform: rotate(12deg); }
.home-play { min-height: 76px; min-width: 250px; border-radius: 26px; font-size: 2.2rem; gap: 18px; box-shadow: inset 0 2px 4px #fff, 0 6px 0 #99764399, 0 14px 28px #173f4340; }
.home-play>span { font-size: 1.6rem; }
.home-garden { min-height: 49px; margin-top: 23px; padding: 10px 24px; font-size: 1rem; border-radius: 18px; }
.home-garden>span { font-size: 1.4rem; }
.home-secondary { display: flex; justify-content: center; gap: 12px; margin-top: 23px; width: 100%; }
.home-secondary>.soft-button { flex-direction: column; gap: 4px; width: 142px; min-height: 70px; padding: 9px 12px; margin: 0; font-size: .9rem; border-radius: 18px; }
.home-topic>span { font: 500 1.3rem 'Fredoka',sans-serif; color: #6b4c94; }
.topic-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.topic-card { display: flex; flex-direction: column; align-items: center; gap: 7px; min-height: 117px; padding: 13px 8px; border-radius: 22px; background: var(--glass-surface); border: 1px solid white; box-shadow: var(--glass-shadow); }
.topic-card>b { display: grid; place-items: center; width: 55px; height: 55px; border-radius: 17px; background: color-mix(in srgb,var(--topic-color) 48%,white); color: #304448; font: 500 2rem 'Fredoka',sans-serif; }
.topic-card>strong { font: 500 1.1rem 'Fredoka',sans-serif; }

/* A first visit starts with five visible grade choices. */
.grade-welcome { min-height: calc(100svh - 80px); display: grid; align-items: center; padding: 24px 20px 40px; }
.grade-welcome-card { width: 100%; max-width: 760px; margin: auto; padding: 28px 36px; text-align: center; background: #fffdf4; border: 2px solid #fff; border-radius: 32px; color: #304b43; box-shadow: var(--glass-shadow); }
.grade-welcome-pet { display: flex; justify-content: center; }
.grade-welcome-pet .pip { width: 105px; height: 116px; }
.grade-welcome-pet .emoji-pet { font-size: 5rem; }
.grade-welcome-card h1 { margin: 8px 0 10px; font-size: clamp(1.8rem,4vw,2.5rem); }
.grade-welcome-card>p { font-size: 1.05rem; line-height: 1.5; }
.grade-picker { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin: 28px 0 24px; }
.grade-card { min-height: 128px; padding: 16px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 22px; border: 2px solid #bbd6ca; background: #e6f3eb; color: #305747; box-shadow: 0 4px 0 #c6dacf; }
.grade-card strong { font: 500 2.8rem 'Fredoka',sans-serif; line-height: 1.2; }
.grade-card sup { font-size: 1rem; vertical-align: super; }
.grade-card>span { font-size: 1rem; font-weight: 600; margin-top: 4px; }
.grade-card:hover { background: #fff0bb; border-color: #a78436; }
.grade-card:focus-visible { outline: 3px solid #754b9d; outline-offset: 4px; }
.grade-welcome-card .grade-welcome-note { font-size: .85rem; color: #536c60; }
@media(max-width:600px) {
  .grade-welcome { min-height: calc(100svh - 68px); padding: 12px 14px 28px; }
  .grade-welcome-card { padding: 20px; border-radius: 26px; }
  .grade-welcome-pet .pip { width: 80px; height: 88px; }
  .grade-welcome-card h1 { font-size: 1.8rem; }
  .grade-picker { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; max-width: 360px; margin: 22px auto; }
  .grade-card { min-height: 94px; padding: 10px; }
  .grade-card strong { font-size: 2.2rem; }
  .grade-card:last-child { grid-column: 1 / -1; width: calc(50% - 6px); justify-self: center; }
}

/* Keep the successful target in place as its number becomes the next action. */
.kid-play .answer-target.answer-dismissed { pointer-events: none; animation: answer-dissolve .4s ease-in forwards; }
.kid-play .answer-target.answer-dismissed.tried { --answer-opacity: .3; }
.kid-play .answer-target.answer-continue { border-color: #fff9c9; }
.kid-play .answer-target.answer-transforming { animation: answer-soft-pop .5s ease-out; }
.answer-next { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; color: #305e4b; opacity: 0; z-index: 4; }
.answer-next>strong { font: 500 clamp(1.25rem,4.8vw,1.9rem) 'Fredoka',sans-serif; }
.answer-next>span { font: 500 1.55rem 'Fredoka',sans-serif; line-height: 1.1; }
.answer-continue .answer-number { opacity: 0; }
.answer-transforming .answer-number { animation: answer-number-out .28s ease-in both; }
.answer-transforming .answer-next { animation: answer-next-in .3s .26s ease-out forwards; }
.next-ready .answer-next { opacity: 1; }
.kid-play .game-feedback.sr-only { min-height: 0; margin: -1px; padding: 0; border: 0; }
@keyframes answer-dissolve { from { opacity: var(--answer-opacity,1); transform: scale(1); } to { opacity: 0; transform: scale(.65); visibility: hidden; } }
@keyframes answer-soft-pop { 0%,100% { transform: scale(1); } 42% { transform: scale(1.09); } }
@keyframes answer-number-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-12px) scale(.8); } }
@keyframes answer-next-in { from { opacity: 0; transform: translateY(10px) scale(.8); } to { opacity: 1; transform: translateY(0) scale(1); } }
body[data-motion=off] .kid-play .answer-dismissed { opacity: 0; visibility: hidden; }
body[data-motion=off] .answer-continue .answer-number { opacity: 0; }
body[data-motion=off] .answer-continue .answer-next { opacity: 1; }
@media (prefers-reduced-motion:reduce) {
  .kid-play .answer-dismissed { opacity: 0; visibility: hidden; }
  .answer-continue .answer-number { opacity: 0; }
  .answer-continue .answer-next { opacity: 1; }
}

/* Three spacious targets and a short, stable five-puzzle trail. */
.kid-play { max-width: 900px; }
.play-title h1 { margin: 0; }
.kid-play .trail-progress { gap: 7px; padding: 10px 13px; }
.kid-play .trail-progress i { width: 18px; height: 18px; line-height: 18px; font-size: .9rem; }
.kid-play .question-plaque { width: 100%; padding: 14px 20px; }
.kid-play .question-instruction { font-size: 1rem; }
.kid-play .question-equation { font-size: clamp(2.5rem, 6vw, 3.6rem); }
.kid-play .answer-arena { height: 225px; }
.kid-play .answer-row { display: grid; grid-template-columns: repeat(3, 130px); gap: 34px; align-content: center; justify-content: center; padding: 22px 10px; }
.kid-play .answer-target { top: 0; width: 130px; height: 130px; animation: none; }
.kid-play .answer-target:hover:not(:disabled) { transform: scale(1.045); }
.kid-play .answer-number { font-size: 3rem; }
.kid-play .bridge-arena { height: 240px; }
.kid-play .bridge-arena .answer-row { align-content: start; padding-top: 24px; }
.kid-play .bridge-target { height: 98px; }
.kid-play .bridge-arena .arena-scenery { inset: 45px 0 0; }
.kid-play .hop-trail { bottom: 20px; }
.kid-play .game-feedback { max-width: 540px; min-height: 64px; margin-top: 0; padding: 10px 16px; justify-content: space-evenly; }
.kid-play .game-feedback .gold-button { margin-top: 0; min-height: 44px; }
.kid-play .quiet-feedback { min-height: 0; height: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.kid-tools { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; margin: 17px auto 0; }
.kid-tools .soft-button { min-height: 46px; font-size: .95rem; padding: 10px 16px; }
.voice-note { display: block; text-align: center; font-size: .85rem; color: var(--glass-ink); }
.voice-note:not(:empty) { margin: 12px auto; padding: 8px 12px; max-width: 400px; background: var(--glass-reading); border-radius: 12px; }
.sr-only, .arena-hint.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Count, cross out, arrange, or share the same quantities as the equation. */
.picture-help { margin: 10px auto 0; max-width: 430px; }
.picture-help p { font-size: .9rem; font-weight: 600; margin-top: 12px; }
.picture-help .counter { width: 18px; height: 18px; flex: 0 0 18px; }
.picture-join { display: flex; gap: 15px; justify-content: center; align-items: center; }
.picture-join>span { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 150px; }
.picture-join>b { font-size: 1.4rem; }
.picture-take { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; max-width: 270px; margin: auto; }
.picture-help .crossed { background: #f5dcdd; box-shadow: none; border: 1px solid #cf8188; color: #ac3e4e; font-style: normal; line-height: 15px; font-weight: 700; font-size: 1.1rem; }
.picture-rows { display: grid; grid-template-columns: repeat(var(--columns),18px); justify-content: center; gap: 7px; }
.picture-share { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.picture-group { min-width: 48px; min-height: 37px; max-width: 100px; padding: 8px; border-radius: 8px 8px 16px 16px; background: #ebd5b980; border: 1px solid #c5aa8799; display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.picture-group .counter { width: 13px; height: 13px; flex-basis: 13px; }
.picture-zero { font: 500 1.5rem 'Fredoka',sans-serif; }

.kid-reward { min-height: calc(100svh - 80px); }
.kid-reward .reward-card { min-width: 340px; }
.reward-five { color: #9b7113; letter-spacing: 7px; font-size: 2rem; }
.kid-reward .seed-prize { font: 500 2rem 'Fredoka',sans-serif; color: #3e674c; margin: 22px 0; }
.kid-reward .rest-note { font-size: .85rem!important; }

/* Planting takes one choice. The patch and purchase steps are automatic. */
.kid-garden { max-width: 760px; }
.kid-garden .garden-heading h1 { margin: 0 0 6px; }
.kid-garden .garden-heading p { font-size: 1rem; }
.kid-garden .garden-bed { display: grid; grid-template-columns: repeat(4,1fr); margin: 24px auto 0; gap: 18px; padding: 22px; }
.kid-garden .garden-plot { height: 110px; cursor: default; display: flex; align-items: center; justify-content: center; }
.kid-garden .empty-soil { font-size: 2rem; opacity: .55; }
.kid-garden .garden-message { min-height: 26px; margin: 18px 0 6px; }
.garden-actions { display: flex; justify-content: center; gap: 14px; }
.garden-actions>button { min-width: 130px; min-height: 52px; font-size: 1.2rem; }
.garden-friends { min-height: 44px; margin-top: 13px; color: #28483e; background: var(--glass-surface); border: 1px solid var(--glass-edge); border-radius: 14px; }
.plant-choices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 20px 0; }
.plant-choice { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 8px; border-radius: 19px; background: var(--glass-surface); border: 1px solid white; box-shadow: var(--glass-shadow); }
.plant-choice>span { font-size: 2.6rem; }
.plant-choice strong { font-size: .85rem; line-height: 1.4; }
.plant-choice small { font-weight: 700; font-size: .95rem; }
.plant-choice:disabled, .friend-card:disabled { opacity: .55; }
.friend-catalog { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.friend-card>small { font-size: .85rem; }
.friend-avatar { display: grid; place-items: center; width: 72px; height: 72px; }
.friend-avatar img { width: 100%; height: 100%; object-fit: contain; }
.lesson-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lesson-picker>button { flex-direction: column; font-size: .95rem; }
.lesson-picker b { font-size: 2rem; }
dialog .difficulty-label { font-size: .9rem; }
dialog select { width: 100%; min-height: 46px; }
dialog .setting-description { line-height: 1.6; }
.dialog-close { right: 10px; top: 10px; }
.learn-scene .trail-progress { display: none; }
.learning-workbench .kid-tools { margin-top: 18px; }

.kid-long .trail-progress { flex-wrap: wrap; max-width: 55%; }
.kid-long .long-answers { grid-template-columns: repeat(3,1fr); }
.kid-long .long-answer { padding: 12px 4px; }
.kid-long .step-wheel b { height: 40px; width: 40px; font-size: 1.6rem; }
.kid-long .step-instruction { text-align: center; }
.kid-long .step-instruction p { font: 500 1.4rem 'Fredoka',sans-serif; }
.kid-long .kid-tools { gap: 8px; }
.kid-long .kid-tools .soft-button { font-size: .85rem; padding: 9px 12px; }

@media (max-width:600px) {
  .child-hud { padding: 12px; }
  .child-hud .game-logo { font-size: 1.35rem; gap: 6px; }
  .child-hud .game-logo img { height: 30px; width: 30px; }
  .grownup-button span { display: none; }
  .child-hud .grownup-button { padding: 0; width: 44px; }
  .child-home { min-height: calc(100svh - 68px); padding: 15px 16px 30px; }
  .home-message { padding: 15px 28px; }
  .home-pet .pip { width: 190px; height: 210px; }
  .home-pet .emoji-pet { font-size: 9rem; min-height: 200px; }
  .home-play { min-height: 70px; min-width: 230px; }
  .topic-picker { gap: 12px; }
  .topic-card { min-height: 100px; padding: 10px 6px; }
  .topic-card>b { width: 48px; height: 48px; font-size: 1.8rem; }
  .topic-card>strong { font-size: 1rem; }
  .kid-play .play-top { gap: 9px; padding: 8px; margin-bottom: 14px; flex-wrap: nowrap; }
  .kid-play .trail-progress { gap: 5px; padding: 8px; }
  .kid-play .trail-progress i { width: 14px; height: 14px; font-size: .75rem; line-height: 14px; }
  .kid-play .question-equation { gap: 12px; }
  .kid-play .question-equation>b { min-width: 45px; padding: 0 10px; }
  .kid-play .wide-equation, .learn-scene .question-equation { font-size: clamp(1.6rem,7vw,2.3rem); gap: 8px; }
  .kid-play .answer-arena { height: 170px; width: 100%; }
  .kid-play .answer-row { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; padding: 20px 5px; }
  .kid-play .answer-target { width: 100%; height: auto; aspect-ratio: 1; max-width: 110px; justify-self: center; }
  .kid-play .answer-number { font-size: clamp(1.8rem,7vw,2.7rem); }
  .kid-play .bridge-arena { height: 205px; }
  .kid-play .bridge-arena .answer-row { padding-top: 20px; }
  .kid-play .bridge-target { aspect-ratio: 1.2; }
  .kid-play .hop-trail { height: 42px; bottom: 20px; }
  .kid-play .game-feedback strong { font-size: 1.05rem; }
  .kid-tools { margin-top: 13px; gap: 9px; }
  .kid-tools .soft-button { font-size: .9rem; padding: 10px 12px; }
  .picture-help .counter { width: 15px; height: 15px; flex-basis: 15px; }
  .picture-rows { grid-template-columns: repeat(var(--columns),15px); gap: 5px; }
  .picture-join>span { gap: 5px; max-width: 120px; }
  .picture-group .counter { width: 12px; height: 12px; flex-basis: 12px; }
  .picture-help .crossed { line-height: 12px; font-size: 1rem; }
  .picture-help p { font-size: .85rem; }
  .kid-reward { padding-top: 65px; }
  .kid-reward .reward-card { min-width: 0; padding: 22px 20px 35px; }
  .kid-reward .reward-pet { bottom: 12px; }
  .kid-reward .reward-buttons { flex-direction: column; }
  .kid-garden .garden-bed { grid-template-columns: repeat(3,1fr); padding: 15px; gap: 17px 12px; margin-top: 18px; }
  .kid-garden .garden-plot { height: 83px; }
  .kid-garden .garden-heading { padding: 12px 24px; }
  .kid-garden .garden-heading h1 { font-size: 1.9rem; }
  body[data-view=garden] .child-hud .game-logo span { display: none; }
  .plant-choices { gap: 8px; }
  .plant-choice { padding: 13px 6px; }
  .plant-choice>span { font-size: 2.2rem; }
  .plant-choice strong { font-size: .75rem; }
  .kid-long .trail-progress { max-width: 100%; }
  .kid-long .step-wheel { margin-bottom: 12px; }
  .kid-long .division-guide { padding: 16px; }
  .kid-long .division-stage { gap: 12px; }
  .kid-long .division-parchment { padding: 12px 16px; }
  .kid-long .division-svg { max-height: min(32svh,270px); }
  .kid-long .step-instruction h2 { font-size: 1.7rem; }
  .kid-long .bring-instruction { margin: 12px 0; padding: 12px; }
  .kid-long .moving-digit { display: none; }
}
@media (max-height:700px) {
  .child-home { justify-content: start; padding-top: 10px; }
  .home-pet .pip { width: 165px; height: 180px; }
  .home-pet .emoji-pet { font-size: 8rem; min-height: 175px; }
  .home-message { padding: 12px 25px; }
  .home-garden { margin-top: 19px; }
}
