:root {
  color-scheme: light;
  --ink: #173a3d;
  --muted: #61746f;
  --paper: #fffaf0;
  --teal: #16877d;
  --teal-dark: #0d514e;
  --coral: #ef6b4b;
  --coral-dark: #a63b2b;
  --gold: #f7c84e;
  --sand: #e6a952;
  --leaf: #4d7d4d;
  font-family: ui-rounded, "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; min-width: 1000px; height: 100%; min-height: 680px; margin: 0; overflow: hidden; }
body { color: var(--ink); background: #e3b85f; }
button { color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 4px solid #123f72; 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; }

.game { position: relative; width: 100%; height: 100%; padding: 18px; overflow: hidden; isolation: isolate; }
.world { position: absolute; z-index: -4; inset: 0; background: #d8b15e url("./art/savanna-backdrop-01.webp") center / cover no-repeat; transform: scale(1.025); }
.world::after { position: absolute; inset: 0; content: ""; background: linear-gradient(180deg, rgba(12,62,64,.14), transparent 22%, rgba(72,42,17,.22)); }

.safari-hud { position: relative; z-index: 20; height: 72px; display: grid; grid-template-columns: 235px 1fr auto; align-items: center; gap: 20px; }
.expedition-badge, .difficulty, .scoreboard { border: 1px solid rgba(19,56,58,.16); background: rgba(255,250,240,.94); box-shadow: 0 7px 0 rgba(71,73,42,.18), 0 16px 28px rgba(48,44,24,.12); backdrop-filter: blur(10px); }
.expedition-badge { height: 68px; display: grid; align-content: center; padding: 10px 17px; border-radius: 17px 17px 17px 6px; }
.expedition-badge span, .difficulty span, .scoreboard span, .radio-copy span { color: var(--muted); font-size: 10px; font-weight: 1000; letter-spacing: .12em; text-transform: uppercase; }
.expedition-badge strong { margin-top: 3px; font-size: 18px; letter-spacing: -.02em; }
.difficulty { justify-self: center; width: min(390px, 100%); padding: 11px 16px 10px; border-radius: 16px; }
.difficulty > div { display: flex; align-items: center; justify-content: space-between; }
.difficulty > div b { display: grid; place-items: center; width: 31px; height: 24px; border-radius: 8px; color: white; background: var(--teal); font-size: 12px; }
.difficulty > i { display: block; height: 8px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: #d9e0d5; }
.difficulty > i b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--coral)); transition: width 260ms ease-out; }
.scoreboard { height: 68px; display: flex; padding: 7px; border-radius: 17px 17px 6px 17px; }
.scoreboard > div { min-width: 82px; display: grid; place-content: center; padding: 0 14px; text-align: center; }
.scoreboard > div + div { border-left: 1px solid #ddd8c8; }
.scoreboard strong { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 2px; font-size: 23px; line-height: 1; }
.scoreboard strong i { font-style: normal; }.scoreboard strong b { color: #e09218; font-size: 16px; }

.ranger-card { position: absolute; z-index: 6; left: 22px; top: 108px; bottom: 26px; width: 228px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 18px 16px 20px; border: 1px solid rgba(16,62,61,.18); border-radius: 25px 9px 25px 25px; background: linear-gradient(rgba(248,219,130,.23),rgba(27,104,86,.74)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 15px 35px rgba(36,50,28,.18); overflow: hidden; }
.ranger { width: 258px; max-height: 350px; object-fit: contain; margin: auto -20px -6px; filter: drop-shadow(0 13px 8px rgba(47,43,24,.25)); transform-origin: 55% 80%; }
.radio-copy { position: relative; width: 100%; min-height: 114px; padding: 15px 14px 13px; border: 2px solid #d9aa44; border-radius: 17px 17px 5px 17px; background: #fff7d8; box-shadow: 0 7px 0 rgba(70,67,33,.18); }
.radio-copy::before { position: absolute; left: 21px; top: -11px; width: 18px; height: 18px; content: ""; transform: rotate(45deg); border-left: 2px solid #d9aa44; border-top: 2px solid #d9aa44; background: #fff7d8; }
.radio-copy p { margin: 7px 0 0; font-size: 13px; font-weight: 800; line-height: 1.35; }
.badge-row { display: flex; gap: 7px; margin-top: 15px; }
.badge-row i { width: 35px; height: 35px; display: grid; place-items: center; transform: rotate(-3deg); border: 2px solid rgba(255,255,255,.7); border-radius: 50%; color: white; background: var(--teal-dark); box-shadow: 0 3px 0 rgba(10,44,43,.3); font-size: 13px; font-style: normal; font-weight: 1000; }
.badge-row i:nth-child(2n) { transform: rotate(4deg); background: var(--coral-dark); }

.mission-card { position: absolute; z-index: 5; left: 270px; right: 22px; top: 108px; bottom: 26px; display: grid; grid-template-rows: auto minmax(270px,1fr) 58px 25px 90px; min-width: 0; min-height: 0; padding: 22px 30px 24px; overflow: hidden; border: 1px solid rgba(84,62,27,.18); border-radius: 9px 28px 28px 28px; background: rgba(255,250,240,.95); box-shadow: 0 10px 0 rgba(77,78,39,.2), 0 28px 56px rgba(48,44,24,.22); backdrop-filter: blur(8px); }
.mission-copy { text-align: center; }
.eyebrow { margin: 0 0 4px; color: var(--coral-dark); font-size: 11px; font-weight: 1000; letter-spacing: .14em; text-transform: uppercase; }
.mission-copy h1 { margin: 0; font-size: clamp(30px,3.2vw,46px); line-height: 1; letter-spacing: -.045em; }
.mission-copy > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 15px; font-weight: 650; }

.trail-stage { position: relative; min-height: 270px; margin: 8px -8px 0; overflow: hidden; border: 1px solid rgba(91,104,64,.26); border-radius: 23px; background: linear-gradient(180deg, rgba(184,220,199,.68), rgba(236,192,99,.62)); box-shadow: inset 0 0 38px rgba(73,92,49,.12); }
.trail-stage::after { position: absolute; inset: 0; content: ""; pointer-events: none; background: radial-gradient(circle at 20% 10%,rgba(255,255,255,.44),transparent 20%), linear-gradient(90deg,transparent 68%,rgba(61,111,71,.12)); }
.trail-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.river { fill: none; stroke: rgba(57,121,122,.58); stroke-width: 116; stroke-linecap: round; filter: drop-shadow(0 7px 0 rgba(31,77,71,.14)); }
.jump-line { fill: none; stroke: rgba(255,250,218,.82); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 4 14; }
.stones { position: absolute; z-index: 4; inset: 0; }
.stone { position: absolute; left: var(--x); top: var(--y); width: 94px; height: 64px; display: grid; place-items: center; transform: translate(-50%,-50%) rotate(-2deg); border: 0; border-radius: 48% 55% 45% 51%; color: #4f2e18; background: linear-gradient(145deg,#ffe4a0,#c98639); box-shadow: inset 0 6px 8px rgba(255,255,255,.36), inset 0 -7px 8px rgba(104,56,22,.2), 0 8px 0 #8e5b2d, 0 13px 18px rgba(42,55,37,.23); animation: stone-pop 320ms cubic-bezier(.2,.85,.25,1.2) both; animation-delay: var(--delay); }
.stone:nth-child(2n) { transform: translate(-50%,-50%) rotate(3deg); }
.stone span { display: grid; place-items: center; width: 53px; height: 42px; border-radius: 50%; background: rgba(255,249,221,.73); font-size: 24px; font-weight: 1000; letter-spacing: -.04em; }
.stone.is-mystery { border: 3px dashed rgba(255,255,255,.75); background: rgba(22,121,113,.74); box-shadow: 0 7px 0 #0d665e, 0 13px 18px rgba(42,55,37,.23); color: white; }
.stone.is-mystery span { background: rgba(10,73,70,.28); }
.stone.can-hop { animation: stone-pop 320ms ease-out both, ready-pulse 1100ms ease-in-out 380ms infinite; }
.stone.can-hop:hover { filter: brightness(1.12); }
.stone.can-hop:active { transform: translate(-50%,-43%) scale(.96); box-shadow: 0 2px 0 #0d665e; }
.skipper { position: absolute; z-index: 8; left: var(--x); top: var(--y); width: 132px; height: 132px; object-fit: contain; pointer-events: none; transform: translate(-50%,-83%); transform-origin: 50% 85%; filter: drop-shadow(0 9px 5px rgba(45,47,28,.23)); transition: left 520ms cubic-bezier(.15,.8,.2,1), top 520ms cubic-bezier(.15,.8,.2,1); }
.prop-flourish { position: absolute; z-index: 2; right: -15px; bottom: -54px; width: 270px; opacity: .85; pointer-events: none; filter: drop-shadow(0 9px 5px rgba(45,47,28,.15)); }
.jump-label { position: absolute; z-index: 10; left: 50%; top: 15px; transform: translateX(-50%) rotate(-1deg); padding: 7px 13px; border: 2px solid rgba(15,83,77,.28); border-radius: 9px; color: var(--teal-dark); background: rgba(239,250,224,.91); box-shadow: 0 4px 0 rgba(34,75,57,.13); font-size: 12px; font-weight: 1000; letter-spacing: .05em; }
.trail-stage.is-pointing .jump-line { animation: dash 700ms linear infinite; stroke: white; stroke-width: 8; }
.trail-stage.is-pointing .stone { animation: point 520ms ease-out 2; }

.equation-strip { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 8px; font-size: 18px; font-weight: 900; }
.equation-strip b, .equation-strip strong { min-width: 43px; height: 41px; display: grid; place-items: center; border: 2px solid #dcc99f; border-radius: 12px; background: white; box-shadow: 0 4px 0 #e2d7be; }
.equation-strip strong { color: white; border-color: var(--teal-dark); background: var(--teal); box-shadow: 0 4px 0 var(--teal-dark); }
.equation-strip i { color: #8d8c78; font-style: normal; }
.equation-strip span { margin-left: 12px; padding: 7px 11px; border-radius: 999px; color: #6d470b; background: #ffe9a4; font-size: 12px; }
.feedback { min-height: 25px; display: grid; place-items: center; color: var(--teal-dark); font-size: 13px; font-weight: 900; text-align: center; }
.feedback.is-error { color: var(--coral-dark); }
.action-area { min-height: 90px; display: flex; align-items: center; justify-content: center; }
.choices { width: min(620px,100%); display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.number-choice, .explain-choices button, .primary { border: 2px solid #d6d8c9; border-radius: 17px; background: white; box-shadow: 0 6px 0 #d8d5c4; font-weight: 1000; transition: transform 140ms ease-out, box-shadow 140ms ease-out, border-color 140ms ease-out; }
.number-choice { min-height: 70px; font-size: 28px; }
.number-choice:hover, .explain-choices button:hover { transform: translateY(-3px); border-color: var(--teal); box-shadow: 0 9px 0 #bdd6cc; }
.number-choice:active, .explain-choices button:active { transform: translateY(4px); box-shadow: 0 2px 0 #bdd6cc; }
.number-choice small { display: block; color: var(--muted); font-size: 10px; }
.primary { min-width: 240px; min-height: 58px; padding: 10px 24px; color: white; border-color: var(--teal-dark); background: var(--teal); box-shadow: 0 6px 0 var(--teal-dark); font-size: 16px; }
.primary:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--teal-dark); }
.primary:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--teal-dark); }
.primary.is-coral { border-color: var(--coral-dark); background: var(--coral); box-shadow: 0 6px 0 var(--coral-dark); }
.action-hint { margin: 0; padding: 10px 17px; border-radius: 999px; color: var(--teal-dark); background: #e2f3df; font-size: 13px; font-weight: 900; animation: hint-pulse 1.3s ease-in-out infinite; }
.explain-choices { width: min(780px,100%); display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.explain-choices button { min-height: 74px; padding: 9px 13px; }
.explain-choices b, .explain-choices small { display: block; }.explain-choices b { font-size: 13px; }.explain-choices small { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 750; }

.celebration { position: absolute; z-index: 40; left: 65%; top: 48%; pointer-events: none; }
.celebration i { position: absolute; width: 15px; height: 15px; opacity: 0; border-radius: 3px; background: var(--gold); }
.celebration i:nth-child(2n) { border-radius: 50%; background: var(--coral); }.celebration i:nth-child(3n) { background: var(--teal); }
.is-celebrating .celebration i { animation: burst 760ms ease-out both; }
.celebration i:nth-child(1){--x:-150px;--y:-80px}.celebration i:nth-child(2){--x:-95px;--y:-155px;animation-delay:40ms}.celebration i:nth-child(3){--x:5px;--y:-175px;animation-delay:80ms}.celebration i:nth-child(4){--x:115px;--y:-135px;animation-delay:120ms}.celebration i:nth-child(5){--x:150px;--y:-30px;animation-delay:160ms}.celebration i:nth-child(6){--x:110px;--y:100px;animation-delay:200ms}.celebration i:nth-child(7){--x:-15px;--y:130px;animation-delay:240ms}.celebration i:nth-child(8){--x:-130px;--y:75px;animation-delay:280ms}
.is-hopping .skipper { animation: hero-hop 620ms cubic-bezier(.2,.75,.25,1); }
.is-level-up .ranger { animation: jeep-bounce 680ms ease-out; }
.is-miss .mission-card { animation: gentle-shake 320ms ease-out; }
.toast { position: absolute; z-index: 50; left: calc(270px + (100% - 292px) / 2); bottom: 39px; max-width: 520px; padding: 10px 17px; opacity: 0; transform: translate(-50%,12px); border-radius: 999px; color: white; background: var(--ink); pointer-events: none; box-shadow: 0 7px 22px rgba(16,37,34,.2); 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 stone-pop { from { opacity: 0; transform: translate(-50%,-40%) scale(.7); } }
@keyframes ready-pulse { 50% { filter: brightness(1.13); box-shadow: 0 7px 0 #0d665e,0 0 0 10px rgba(247,200,78,.34),0 13px 18px rgba(42,55,37,.23); } }
@keyframes hint-pulse { 50% { transform: scale(1.03); } }
@keyframes point { 50% { filter: brightness(1.16); transform: translate(-50%,-54%) scale(1.07); } }
@keyframes dash { to { stroke-dashoffset: -36; } }
@keyframes hero-hop { 0% { transform: translate(-50%,-83%) rotate(0); } 42% { transform: translate(-50%,-128%) rotate(7deg) scale(1.08); } 75% { transform: translate(-50%,-80%) rotate(-4deg); } }
@keyframes jeep-bounce { 30% { transform: translateY(-14px) rotate(-3deg); } 58% { transform: translateY(3px) rotate(2deg); } }
@keyframes gentle-shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@keyframes burst { 0% { opacity: 0; transform: translate(0,0) rotate(0) scale(.2); } 35% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x),var(--y)) rotate(220deg) scale(1.25); } }

@media (max-height: 760px) {
  .safari-hud { height: 62px; }.expedition-badge,.scoreboard { height: 58px; }.ranger-card,.mission-card { top: 91px; bottom: 18px; }
  .mission-card { grid-template-rows: auto minmax(240px,1fr) 52px 22px 78px; padding-top: 17px; padding-bottom: 17px; }.mission-copy h1 { font-size: 31px; }.mission-copy > p:last-child { margin-top: 5px; font-size: 13px; }
  .ranger { max-height: 260px; }.trail-stage { min-height: 235px; }.number-choice { min-height: 60px; }.action-area { min-height: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
