:root {
  color-scheme: light;
  --ink: #173d39;
  --muted: #58756f;
  --paper: #fffdf4;
  --leaf: #3f8d45;
  --leaf-dark: #28622f;
  --lime: #a8d63f;
  --coral: #f06d4f;
  --coral-dark: #a73b29;
  --gold: #ffd24a;
  --water: #43bfc0;
  --water-dark: #147c83;
  font-family: "Avenir Next", "Nunito", "Trebuchet MS", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; min-width: 960px; min-height: 650px; overflow: hidden; }
body { margin: 0; color: var(--ink); background: #bcefdc; }
button { color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 4px solid #083f65; outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.lesson { height: 100%; padding: 14px; }
.pond { position: relative; height: 100%; min-height: 620px; overflow: hidden; isolation: isolate; border: 1px solid #7fc7b6; border-radius: 26px; background: #54c9c0 url("art/pond-world-01.webp") center/cover no-repeat; box-shadow: 0 8px 0 #75b6a7, 0 24px 55px rgba(15,70,71,.22); }
.pond::before { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(180deg,rgba(255,250,196,.12),rgba(1,91,105,.18)); }

.hud { position: absolute; z-index: 12; left: 20px; right: 20px; top: 18px; height: 70px; display: grid; grid-template-columns: 214px 1fr auto; align-items: center; gap: 18px; }
.mission-chip,.difficulty,.scores { border: 1px solid rgba(20,86,78,.18); background: rgba(255,253,244,.94); box-shadow: 0 5px 0 rgba(24,91,77,.16); backdrop-filter: blur(10px); }
.mission-chip { align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding: 10px 16px; border-radius: 16px; }
.mission-chip span,.scores span,.difficulty span { color: var(--muted); font-size: 10px; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.mission-chip strong { margin-top: 3px; font-size: 17px; }
.difficulty { justify-self: center; width: min(370px,100%); display: grid; grid-template-columns: 1fr 72px 38px; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 15px; }
.difficulty div strong { display: block; margin-top: 2px; font-size: 13px; }.difficulty > b { font-size: 22px; }
.difficulty-track { height: 9px; overflow: hidden; border-radius: 99px; background: #d8e5dc; }.difficulty-track i { display: block; width: 12%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--lime),var(--coral)); transition: width 220ms ease-out; }
.scores { height: 70px; display: flex; align-items: stretch; padding: 7px; border-radius: 16px; }
.scores > div { min-width: 70px; display: grid; place-content: center; padding: 0 10px; text-align: center; }.scores > div + div { border-left: 1px solid #d3ded8; }
.scores strong { margin-top: 2px; font-size: 23px; line-height: 1; }

.mascot-cove { position: absolute; z-index: 3; left: 22px; top: 108px; bottom: 24px; width: 220px; overflow: hidden; border: 1px solid rgba(14,97,85,.22); border-radius: 22px; background: linear-gradient(180deg,rgba(255,255,255,.22),rgba(11,113,110,.2)); box-shadow: inset 0 1px rgba(255,255,255,.45); }
.speech { position: absolute; z-index: 5; left: 12px; right: 12px; top: 14px; min-height: 82px; display: grid; place-items: center; padding: 12px 14px; border-radius: 16px 16px 16px 5px; background: rgba(255,253,244,.96); box-shadow: 0 5px 0 rgba(16,88,75,.15); font-size: 13px; font-weight: 850; line-height: 1.35; text-align: center; }
.guide { position: absolute; z-index: 4; right: -4px; top: 90px; width: 84px; transform: rotate(8deg); filter: drop-shadow(0 5px 4px rgba(16,58,60,.25)); animation: hover 2.5s ease-in-out infinite; }
.frog { position: absolute; z-index: 3; left: -9px; bottom: 48px; width: 225px; filter: drop-shadow(0 9px 5px rgba(10,57,58,.32)); transform-origin: 50% 85%; transition: transform 180ms ease-out, filter 180ms ease-out; }
.pond.is-happy .frog { animation: mascot-hop 620ms ease-out; }.pond.is-miss .frog { animation: mascot-shake 380ms ease-out; filter: saturate(.75) drop-shadow(0 9px 5px rgba(10,57,58,.32)); }
.fly-shelf { position: absolute; z-index: 5; left: 15px; right: 15px; bottom: 12px; height: 44px; display: flex; align-items: center; justify-content: center; gap: 2px; border-radius: 13px; background: rgba(10,91,91,.42); }
.fly-shelf img { width: 35px; height: 35px; object-fit: contain; animation: pop-in 300ms ease-out both; }

.game-card { position: absolute; z-index: 4; left: 260px; right: 24px; top: 108px; bottom: 24px; display: grid; grid-template-rows: auto 52px minmax(220px,1fr) 36px 78px; padding: 24px 30px 22px; overflow: hidden; border: 1px solid #ded8c7; border-radius: 22px; background: rgba(255,253,244,.96); box-shadow: 0 9px 0 rgba(29,89,70,.18), 0 22px 48px rgba(17,72,64,.19); }
.mission-copy { text-align: center; }.mission-copy span { color: var(--coral-dark); font-size: 10px; font-weight: 1000; letter-spacing: .13em; text-transform: uppercase; }
.mission-copy h1 { margin: 5px 0 4px; font-size: clamp(28px,3vw,42px); line-height: 1; letter-spacing: -.045em; }.mission-copy p { margin: 0; color: var(--muted); font-size: 14px; }
.equation { min-height: 50px; display: grid; place-items: center; color: var(--water-dark); font-size: clamp(25px,2.6vw,38px); font-weight: 1000; letter-spacing: -.02em; }.equation b { color: var(--coral-dark); }

.number-line-wrap { position: relative; min-height: 220px; align-self: stretch; margin: 0 14px; }
.number-line { position: absolute; z-index: 3; left: 4%; right: 4%; top: 50%; height: 112px; display: flex; align-items: flex-start; transform: translateY(-8px); }
.number-line::before { position: absolute; left: 0; right: 0; top: 21px; height: 7px; content: ""; border: 2px solid #174c4b; border-radius: 9px; background: #d4f2d8; box-shadow: 0 4px 0 rgba(21,67,62,.15); }
.number-line::after { position: absolute; right: -6px; top: 13px; width: 18px; height: 18px; content: ""; transform: rotate(45deg); border-top: 5px solid #174c4b; border-right: 5px solid #174c4b; }
.tick { position: relative; z-index: 5; min-width: 0; height: 92px; flex: 1; padding: 0; border: 0; background: transparent; font-weight: 950; }
.tick::before { position: absolute; left: 50%; top: 12px; width: 4px; height: 26px; content: ""; transform: translateX(-50%); border-radius: 3px; background: #174c4b; }
.tick span { position: absolute; left: 50%; top: 48px; min-width: 42px; transform: translateX(-50%); font-size: clamp(13px,1.45vw,20px); }
.tick.is-zero::before { width: 6px; height: 32px; top: 9px; background: var(--coral); }.tick.is-zero span { color: var(--coral-dark); }
.tick.is-choice:hover span,.tick.is-choice:focus-visible span { padding: 4px 8px; border-radius: 10px; color: white; background: var(--leaf); transform: translate(-50%,-4px); }
.tick.is-target span { padding: 4px 8px; border-radius: 10px; color: #513b00; background: var(--gold); }
.tick.is-start::after { position: absolute; left: 50%; top: 15px; width: 20px; height: 20px; content: ""; transform: translateX(-50%); border: 3px solid white; border-radius: 50%; background: var(--water-dark); box-shadow: 0 0 0 3px var(--water-dark); }
.jump-arcs { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; overflow: visible; }.jump-arcs path { fill: none; stroke: var(--coral); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 9 10; filter: drop-shadow(0 2px 0 rgba(255,255,255,.75)); animation: draw-arc 480ms ease-out both; }
.jump-arcs polygon { fill: var(--coral); }
.line-frog { position: absolute; z-index: 7; top: calc(50% - 80px); left: 4%; width: 73px; height: 73px; object-fit: contain; transform: translateX(-50%); filter: drop-shadow(0 5px 3px rgba(12,61,58,.3)); transition: left 520ms cubic-bezier(.22,.9,.3,1.12), transform 180ms ease-out; pointer-events: none; }
.pond.is-jumping .line-frog { animation: line-hop 540ms ease-out; }

.feedback { min-height: 34px; display: grid; place-items: center; color: var(--leaf-dark); font-size: 14px; font-weight: 900; text-align: center; }.feedback.is-error { color: var(--coral-dark); }
.action-area { min-height: 74px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.choice-grid { width: min(650px,100%); display: grid; grid-template-columns: repeat(3,1fr); gap: 11px; }
.choice,.primary { min-height: 61px; border: 2px solid #b6c9bd; border-radius: 15px; background: white; box-shadow: 0 5px 0 #d3ddd6; font-weight: 950; transition: transform 140ms ease-out, box-shadow 140ms ease-out, border-color 140ms ease-out; }
.choice { padding: 8px 12px; font-size: 23px; }.choice small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 800; }
.choice:hover,.primary:hover { transform: translateY(-2px); }.choice:active,.primary:active { transform: translateY(4px); box-shadow: 0 1px 0 #c9d5ce; }
.primary { min-width: 230px; padding: 0 24px; border-color: var(--leaf-dark); color: white; background: var(--leaf); box-shadow: 0 6px 0 var(--leaf-dark); font-size: 16px; }.primary.is-coral { border-color: var(--coral-dark); background: var(--coral); box-shadow: 0 6px 0 var(--coral-dark); }
.explain-grid .choice { font-size: 14px; }
.jump-hint { padding: 9px 15px; border-radius: 999px; color: #164e4b; background: #ddf3e4; font-size: 13px; font-weight: 900; }

.reward-burst { position: absolute; z-index: 30; left: 64%; top: 48%; width: 0; height: 0; pointer-events: none; }.reward-burst img { position: absolute; width: 120px; height: 120px; opacity: 0; transform: translate(-50%,-50%) scale(.2); object-fit: contain; }.reward-burst i { position: absolute; width: 12px; height: 12px; opacity: 0; border-radius: 4px; background: var(--gold); }
.pond.is-celebrating .reward-burst img { animation: reward-pop 760ms ease-out both; }.pond.is-celebrating .reward-burst i { animation: sparkle 700ms ease-out both; }.reward-burst i:nth-of-type(1){--x:-100px;--y:-80px}.reward-burst i:nth-of-type(2){--x:105px;--y:-65px;animation-delay:50ms}.reward-burst i:nth-of-type(3){--x:125px;--y:45px;animation-delay:100ms}.reward-burst i:nth-of-type(4){--x:-110px;--y:55px;animation-delay:140ms}.reward-burst i:nth-of-type(5){--x:5px;--y:112px;animation-delay:180ms}
.toast { position: absolute; z-index: 40; left: 62%; bottom: 38px; max-width: 68%; padding: 11px 18px; opacity: 0; transform: translate(-50%,12px); border-radius: 999px; color: white; background: var(--ink); pointer-events: none; font-size: 13px; font-weight: 900; transition: opacity 150ms ease-out, transform 150ms ease-out; }.toast.is-showing { opacity: 1; transform: translate(-50%,0); }

@keyframes hover { 50% { transform: translateY(-8px) rotate(5deg); } }
@keyframes mascot-hop { 45% { transform: translateY(-18px) rotate(-4deg) scale(1.04); } }
@keyframes mascot-shake { 25% { transform: translateX(-7px) rotate(-2deg); } 50% { transform: translateX(7px) rotate(2deg); } 75% { transform: translateX(-4px); } }
@keyframes line-hop { 45% { transform: translate(-50%,-38px) rotate(-7deg) scale(1.08); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.2) rotate(-20deg); } }
@keyframes draw-arc { from { stroke-dashoffset: 120; opacity: 0; } }
@keyframes reward-pop { 35% { opacity: 1; transform: translate(-50%,-50%) scale(1.15); } 78% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-80%) scale(.9); } }
@keyframes sparkle { 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x),var(--y)) rotate(180deg) scale(1.5); } }
@media (max-height: 735px) { .hud { top: 12px; }.mascot-cove,.game-card { top: 92px; bottom: 18px; }.game-card { grid-template-rows: auto 42px minmax(190px,1fr) 30px 68px; padding-top: 17px; padding-bottom: 16px; }.speech { min-height: 70px; }.frog { width: 198px; }.number-line-wrap { min-height: 190px; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
