:root { color-scheme: light; --ink: #4b352e; --muted: #695552; --berry: #963b5e; --border: #ebdcd1; font-family: ui-rounded, "Avenir Next", system-ui, sans-serif; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 12% 0, #ffeadc, transparent 40rem), #fff8ed; }
.shell { width: min(1050px, calc(100% - 34px)); margin-inline: auto; }
.top { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
button { font: inherit; font-weight: 800; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid #8856c3; outline-offset: 3px; }
.brand { display: inline-flex; align-items: center; gap: 8px; border: 0; padding: 0; background: none; color: inherit; font-size: 1.11rem; }
.brand span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: #ffdce4; }
.eyebrow, .field-label, .stats span, .timer span { color: var(--berry); font-size: .69rem; font-weight: 850; letter-spacing: .095em; }
.sound-button { padding: 6px 9px; border-radius: 9px; border: 1px solid var(--border); color: var(--berry); background: #fffdf9; font-size: .8rem; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.game-menu { position: relative; z-index: 3; }
.game-menu summary { cursor: pointer; padding: 6px 8px; border: 1px solid var(--border); border-radius: 9px; background: #fffdf9; color: var(--berry); font-size: .8rem; font-weight: 800; white-space: nowrap; }
.game-menu summary:focus-visible { outline: 3px solid #8856c3; outline-offset: 3px; }
.game-menu-panel { position: absolute; top: calc(100% + 5px); right: 0; padding: 6px; background: #fffdf9; border: 1px solid var(--border); border-radius: 11px; box-shadow: 0 5px 18px #46273520; white-space: nowrap; }
.game-menu-panel button { font-size: .86rem; }
.intro { padding: 24px 0 20px; }
.intro p { margin: 0; max-width: 66ch; color: var(--muted); line-height: 1.5; }
.intro p.eyebrow { color: var(--berry); }
h1 { margin: 4px 0 7px; font-size: clamp(2.1rem, 5.7vw, 3.65rem); line-height: 1.02; letter-spacing: -.055em; font-weight: 900; }
h1 em { color: var(--berry); font-style: normal; }
.map-grid, .mission-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 15px; }
.planet-card, .field, .panel, .finale { border-radius: 21px; }
.planet-card { display: grid; justify-items: center; align-content: center; color: #ffefd9; background: radial-gradient(circle at 50% 48%, #594370, #332741 75%); padding: 13px; min-height: 335px; overflow: hidden; box-shadow: inset 0 0 0 1px #5c456b; }
.planet-progress { width: min(91%, 325px); display: flex; gap: 9px; align-items: center; font-size: .78rem; font-weight: 800; }
progress { flex: 1; min-width: 0; height: 7px; accent-color: #83a95c; }
.planet { display: block; width: min(100%, 420px); }
.region { fill: #94919c; stroke: #736e7c; stroke-width: 1.2; transition: fill .65s; }
.region:nth-child(even) { fill: #aaa5ad; }
.region.done { fill: var(--grass, #b7d893); stroke: #829858; }
.region[data-region="1"] { --grass: #d1e59a; }.region[data-region="2"] { --grass: #a4d39b; }.region[data-region="3"] { --grass: #b5dfb5; }.region[data-region="4"] { --grass: #d9eaaa; }
.region[data-region="5"] { --grass: #a7cda0; }.region[data-region="6"] { --grass: #dce899; }.region[data-region="7"] { --grass: #add6ba; }
.blooms { opacity: 0; fill: #a63963; font-size: 24px; transition: opacity .55s; }.blooms.done { opacity: 1; }.blooms text:nth-child(2) { fill: #a5632c; }
.map-numbers { fill: #fff; stroke: #4d3b55; stroke-width: 4px; paint-order: stroke; font-size: 20px; font-weight: 900; text-anchor: middle; }
.planet .star { fill: #ffdc91; font-size: 22px; }.map-pup { opacity: 0; transition: opacity .4s; }.planet-card.has-puppy .map-pup { opacity: 1; }
#map-caption { margin: 0; text-align: center; font-size: .85rem; }
.choose { margin: 0 0 8px; font-size: 1.08rem; }
.levels { display: grid; gap: 7px; }
.level { width: 100%; display: grid; grid-template-columns: 41px 1fr auto; align-items: center; gap: 9px; text-align: left; padding: 7px 9px; border: 1px solid var(--border); border-radius: 12px; background: #fffdf9; color: var(--ink); min-height: 56px; }
.level:hover { border-color: #ad6582; background: #fff0ed; }
.level.done { background: #f0f6e4; border-color: #caddb3; }
.level-icon { width: 38px; height: 38px; display: grid; place-items: center; background: #f7ece8; border-radius: 9px; font-size: 1.25rem; }
.level.done .level-icon { background: #e1eed1; }
.level strong, .level small { display: block; }.level small { margin-top: 2px; color: var(--muted); font-size: .73rem; }
.level-mark { color: var(--berry); font-size: .83rem; }
.finale { margin-top: 14px; padding: 18px; text-align: center; background: #edf6df; border: 1px solid #ccdcb5; }.finale h2 { margin: 5px 0; }.finale p { margin: 0; }
.link-button { border: 0; background: transparent; padding: 0; margin: 0 0 9px; color: var(--berry); font-size: .88rem; }
.replay-opening { margin: 9px 0 0; }
#confirm-dialog { width: min(420px, calc(100% - 32px)); color: var(--ink); border: 1px solid var(--border); border-radius: 17px; padding: 18px; background: #fff8ed; }
#confirm-dialog::backdrop { background: #33274199; }
#confirm-dialog h2 { margin: 0; }
.opening { width: min(100%, 800px); margin: 19px auto 0; }
.opening h1 { font-size: clamp(1.7rem, 4vw, 2.45rem); margin: 0; }
#opening-title:focus { outline: none; }
.opening p { color: var(--muted); margin: 0; line-height: 1.4; }
.opening video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 12px; background: #31243f; }
.opening-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.mission-grid { grid-template-columns: minmax(0, 2fr) minmax(255px, 1fr); }
.field { min-height: 335px; overflow: hidden; position: relative; isolation: isolate; color: #454337; background: radial-gradient(ellipse at 50% 54%, var(--field-light, #f7ebc8), var(--field-dark, #d4ccce)); }
.field::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle, #745f652c 1px, transparent 1.6px) 0 0 / 24px 22px, radial-gradient(circle, #fff9ee8c 1.7px, transparent 2.4px) 8px 6px / 45px 41px; }
.field.clear { background: radial-gradient(ellipse, #fff2ba, #b5d698); }
.field-label { position: absolute; top: 12px; left: 13px; padding: 5px 9px; color: #5b4a53; background: #fff9ed; border: 1px solid #9e7b7b50; border-radius: 8px; z-index: 2; }
.trail { position: absolute; left: 50%; top: 53%; width: 65%; height: 56%; transform: translate(-50%, -50%); border: 2px dashed #8a7a6e4d; border-radius: 50%; }
.scenery { position: absolute; font-size: clamp(1.5rem, 4vw, 3rem); filter: grayscale(.65); }.scenery-a { left: 12%; top: 64%; }.scenery-b { right: 13%; top: 17%; }.field.clear .scenery { filter: none; }
.rescue-zone { width: min(54%, 245px); position: absolute; left: 50%; top: 53%; transform: translate(-50%, -50%); display: flex; align-items: end; }
.mia { width: 38%; z-index: 1; filter: drop-shadow(0 3px 1px #70583c32); }
.pen { width: 65%; min-width: 0; position: relative; padding-bottom: 9px; margin-left: -2%; }
.pen-puppies, .safe-puppies { display: flex; justify-content: center; }.pen-puppies { position: relative; z-index: 1; min-height: 32px; }.pen-puppies svg, .safe-puppies svg { width: 23%; margin: 0 -1.5%; }.pup-1, .pup-4 { --coat: #fff0d7; --ear: #be8e69; --collar: #8bccae; }.pup-2 { --coat: #c99e85; --ear: #967462; --collar: #b8a0ed; }.pup-3 { --collar: #f0b751; }
.safe-puppies { position: absolute; top: 103%; inset-inline: -7%; }.safe-puppies svg { width: 18%; }.safe-puppies svg:last-child { animation: pup-hop .35s ease-out; }
.fence { position: absolute; bottom: 0; inset-inline: 0; height: 35%; background: repeating-linear-gradient(90deg, #955d43 0 3px, transparent 3px 15px), linear-gradient(transparent 0 38%, #a0674b 38% 56%, transparent 56% 74%, #a0674b 74% 98%); z-index: 2; }
.field.clear .fence { visibility: hidden; }
.catcher, .sparkle { position: absolute; left: var(--x, 86%); top: var(--y, 31%); transform: translate(-50%, -50%); }
.catcher { width: clamp(51px, 7vw, 76px); }.catcher svg { display: block; width: 100%; }
.bubble { position: absolute; top: 89%; left: 50%; transform: translateX(-50%); padding: 3px 8px; border-radius: 10px; border: 1px solid #bb9483; background: #fffdf3; font-size: .93rem; font-weight: 850; white-space: nowrap; }
.key-cave .bubble { background: #eee3ff; border: 2px solid #9f75ba; color: #5b347a; box-shadow: 0 0 16px #f3e7ff; font-size: 1.1rem; }
.key-crystal { display: none; text-align: center; font-size: clamp(2.2rem, 6vw, 3.8rem); filter: drop-shadow(0 0 8px #fff5ff); }
.key-cave .catcher svg { display: none; }.key-cave .key-crystal { display: block; }
.arcade-field .rescue-zone { top: 33%; }
.arcade-field .catcher { visibility: hidden; }
.arcade-field .scenery-a { top: 30%; }
.arcade-board { position: absolute; inset: auto 8% 15%; display: flex; justify-content: center; gap: clamp(5px, 2vw, 22px); z-index: 2; }
.arcade-target { position: relative; display: grid; place-items: center; min-width: 0; width: min(30%, 105px); height: clamp(68px, 10vw, 102px); border: 2px solid #70518e; border-radius: 18px; background: #ffefd7; color: #3e274c; box-shadow: 0 5px 0 #6b577967; }
.arcade-target span { color: #955d7c; line-height: 1; font-size: clamp(1.25rem, 3vw, 2rem); }
.arcade-target strong { font-size: clamp(1.4rem, 4vw, 2.25rem); }
.arcade-target:not(:disabled):hover { background: #fff8ef; transform: translateY(-3px); }
[data-game="blast"] .arcade-target { border-radius: 48% 37% 45% 39%; background: #e8d9f4; }
[data-game="blast"] .arcade-target:not(:disabled) span { animation: comet-glow 1.8s ease-in-out infinite alternate; }
[data-game="gate"] .arcade-target { border-radius: 48% 48% 8px 8px; background: #d9edf1; border-color: #547a93; }
.arcade-target.blasted { animation: comet-pop .34s ease-out both; pointer-events: none; }
.arcade-target.blasted::after { content: '✦'; position: absolute; inset: 0; display: grid; place-items: center; color: #92567e; font-size: 3rem; }
.arcade-target.solved { background: #d9edb9; animation: comet-glow .46s ease-out; }
[data-game="gate"] .arcade-target.solved span { animation: launch-rocket .55s ease-in both; }
@media (prefers-reduced-motion: reduce) { .arcade-target.blasted { visibility: hidden; } }
@keyframes comet-pop { 35% { transform: scale(1.14); background: #ffdf83; opacity: 1; } 100% { transform: scale(.4); opacity: 0; visibility: hidden; } }
@keyframes comet-glow { to { transform: translateY(-5px); } }
@keyframes launch-rocket { to { transform: translateY(-54px) scale(.45); opacity: 0; } }
.catcher.leaving { animation: retreat .48s ease-in both; }.catcher.leaving .bubble { visibility: hidden; }
.sparkle { opacity: 0; color: var(--berry); font-size: 2rem; pointer-events: none; }.sparkle.show { animation: sparkle .55s ease-out both; }
.timer { position: absolute; inset: auto 13px 12px; display: flex; align-items: center; gap: 8px; }.timer span { color: #5e4545; font-size: .59rem; }
.panel { border: 1px solid var(--border); background: #fffdfb; padding: 14px; display: grid; align-content: start; gap: 10px; box-shadow: 0 5px 21px #4627350b; }
.stats { display: flex; justify-content: space-between; gap: 6px; }.stats span, .stats strong { display: block; }.stats strong { font-size: 1.17rem; }.stats div:last-child { text-align: right; }
.task { background: #fff0ed; border: 1px solid #f0dcd7; border-radius: 13px; padding: 11px; }
.prompt { margin: 4px 0 7px; font-size: clamp(1.72rem, 4.5vw, 2.25rem); font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }.prompt .typed { color: #24734c; }.prompt .next { color: var(--berry); border-bottom: 3px solid #d782a0; }
#math-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.number-pad { display: none; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
#answer { width: 100%; min-width: 0; background: #fffdfa; border: 2px solid #d2a0ae; border-radius: 8px; padding: 5px 7px; font: inherit; font-size: 1.15rem; font-weight: 800; color: var(--ink); }
#feedback { margin: 8px 0 0; color: var(--muted); font-size: .87rem; line-height: 1.35; min-height: 2.35em; }
.primary, .secondary { border: 0; border-radius: 9px; padding: 9px 10px; }.primary { color: white; background: var(--berry); }.primary:not(:disabled):hover { background: #81304f; }.secondary { color: #82344f; background: #f9e7ed; }
:disabled { opacity: .62; cursor: default; }.practice { text-align: center; color: var(--muted); font-size: .84rem; }.practice input { accent-color: var(--berry); }
.typing-help { margin-top: 12px; }.help-head, .guide { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 7px; }.help-head h2 { margin: 0; font-size: 1.09rem; }#finger-hint { font-size: .86rem; font-weight: 800; }.typing-help p { margin: 0; color: var(--muted); font-size: .85rem; }
.key-row { display: flex; gap: 3px; margin-bottom: 3px; }.key-row:nth-child(2) { margin-left: 6px; }.key-row:nth-child(3) { margin-left: 12px; }
.key { display: grid; place-items: center; width: min(36px, 6.65vw); height: 28px; border-radius: 6px; background: var(--finger); border: 1px solid #4b355044; font-weight: 850; font-size: .8rem; }.key.active { outline: 2px solid #7446a1; outline-offset: 1px; }.key.anchor { text-decoration: underline; text-underline-offset: 3px; }
.key { padding: 0; color: var(--ink); touch-action: manipulation; }
.key:disabled { opacity: 1; }
@media (any-pointer: coarse) {
  .number-pad { display: grid; }
  .number-pad button { min-height: 44px; font-size: 1.13rem; }
  .number-pad button:last-child { grid-column: span 2; }
  .key { width: min(51px, 7vw); height: 44px; font-size: .93rem; }
  .level, .opening-actions button, #math-form > button, .top-actions > button, .game-menu summary { min-height: 44px; }
  button, summary { touch-action: manipulation; }
}
.hands { width: min(220px, 100%); }.hands use { fill: #ede5f1; stroke: #87758b; stroke-width: 1.5; stroke-linejoin: round; }.hands use.active { fill: var(--finger); stroke: #68448d; stroke-width: 3.4; paint-order: stroke fill; }.hands text { fill: var(--muted); font-size: 11px; text-anchor: middle; font-weight: 800; }
.art-library, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.storage-note, footer { color: var(--muted); font-size: .82rem; }footer { padding: 14px 0 20px; }
@keyframes retreat { to { opacity: 0; transform: translate(-50%, -50%) translate(var(--run-x, 75px), -18px) rotate(9deg); } }
@keyframes sparkle { 15% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -145%) scale(1.7); } }
@keyframes pup-hop { from { transform: translateY(-12px); opacity: 0; } }
@media (max-width: 660px) { .shell { width: calc(100% - 22px); }.top { min-height: 54px; }.intro { padding: 17px 0 13px; }.map-grid, .mission-grid { grid-template-columns: 1fr; gap: 10px; }.planet-card { min-height: 0; }.field { min-height: 270px; }.panel { padding: 11px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; } }
