:root {
  color-scheme: dark;
  --deep: #063b36;
  --deepest: #032c2a;
  --cream: #fff8dd;
  --lime: #bde64b;
  --sun: #ffd558;
  --coral: #ff7767;
  --aqua: #5fe1cf;
  --ink: #f9fff1;
  --muted: #b7d8ca;
  --band-top: 25%;
  font-family: "Avenir Next", "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: 1000px; min-height: 650px; overflow: hidden; }
body { margin: 0; color: var(--ink); background: var(--deepest); }
button { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
:focus-visible { outline: 4px solid var(--sun); 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%; min-height: 650px;
  overflow: hidden; isolation: isolate;
  background:
    radial-gradient(circle at 50% 5%, rgba(255,213,88,.18), transparent 28%),
    linear-gradient(145deg, #0b5547, var(--deep) 48%, var(--deepest));
}
.game::before { position: absolute; inset: 0; content: ""; opacity: .13; pointer-events: none; background-image: radial-gradient(circle, #d7f2a4 0 1px, transparent 1.4px); background-size: 31px 31px; }
.leaf-frame i { position: absolute; z-index: 1; width: 250px; height: 430px; border-radius: 100% 0 100% 0; background: #0c5b48; box-shadow: inset 0 0 0 2px rgba(189,230,75,.11); opacity: .7; }
.leaf-frame i:nth-child(1) { left: -150px; top: -210px; transform: rotate(24deg); }
.leaf-frame i:nth-child(2) { right: -165px; top: -235px; transform: rotate(73deg); }
.leaf-frame i:nth-child(3) { left: -160px; bottom: -270px; transform: rotate(82deg); }
.leaf-frame i:nth-child(4) { right: -145px; bottom: -285px; transform: rotate(5deg); }

.mission {
  position: absolute; z-index: 30; top: 22px; left: 28px; width: 355px; min-height: 112px;
  padding: 16px 20px 17px; border: 1px solid rgba(255,255,255,.16); border-radius: 22px;
  background: rgba(3,44,42,.91); box-shadow: 0 13px 30px rgba(0,20,18,.28); backdrop-filter: blur(12px);
}
.mission > span, .animal-dock > span, .success > span, .finish > span { color: var(--sun); font-size: 11px; font-weight: 950; letter-spacing: .14em; text-transform: uppercase; }
.mission h1 { margin: 4px 0 3px; font-size: 27px; line-height: 1.06; letter-spacing: -.035em; }
.mission p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 650; }

.mute { position: absolute; z-index: 50; top: 24px; right: 24px; display: grid; width: 48px; height: 48px; padding: 0; place-items: center; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; background: rgba(3,42,38,.9); box-shadow: 0 5px 0 #01221f; }
.mute svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sound-off { display: none; }.mute[aria-pressed="true"] .sound-on { display: none; }.mute[aria-pressed="true"] .sound-off { display: block; }

.layer-readout { position: absolute; z-index: 20; left: 28px; top: 158px; width: 292px; padding: 19px 20px 18px; border-radius: 23px; background: rgba(5,56,49,.84); border: 1px solid rgba(189,230,75,.22); box-shadow: 0 16px 38px rgba(0,20,18,.22); transition: border-color .16s ease, transform .16s ease; }
.layer-readout.is-popping { transform: translateY(-3px); border-color: var(--lime); }
.layer-readout > span { color: var(--aqua); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.layer-readout h2 { margin: 4px 0 9px; color: var(--cream); font-size: 31px; line-height: 1; letter-spacing: -.04em; }
.layer-readout p { min-height: 42px; margin: 12px 0 13px; color: #d9eee5; font-size: 14px; line-height: 1.45; }
.light-meter { display: flex; gap: 5px; height: 9px; }
.light-meter i { flex: 1; border-radius: 999px; background: rgba(255,255,255,.12); box-shadow: inset 0 1px 2px rgba(0,0,0,.25); }
.light-meter i.is-lit { background: var(--sun); box-shadow: 0 0 10px rgba(255,213,88,.28); }
.needs { display: flex; flex-wrap: wrap; gap: 6px; }
.needs span, .clue-tags span { padding: 5px 8px; border: 1px solid rgba(189,230,75,.24); border-radius: 999px; color: #dff6a2; background: rgba(189,230,75,.07); font-size: 11px; font-weight: 850; }

.forest-shell { position: absolute; z-index: 10; left: 50%; top: 50%; width: 560px; height: min(748px, calc(100vh - 34px)); transform: translate(-50%,-50%); }
.forest-stage { position: absolute; inset: 0 70px 0 0; overflow: hidden; border: 4px solid #b1d856; border-radius: 32px; background: #0d4e43; box-shadow: 0 22px 55px rgba(0,18,16,.4), 0 0 0 9px rgba(3,44,42,.72), inset 0 0 0 1px rgba(255,255,255,.24); }
.forest-stage > img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; pointer-events: none; }
.forest-stage::after { position: absolute; inset: 0; content: ""; pointer-events: none; box-shadow: inset 0 0 42px rgba(0,25,22,.32); }
.layer-lines { position: absolute; inset: 0; pointer-events: none; }
.layer-lines i { position: absolute; left: 0; right: 0; height: 1px; background: rgba(255,248,221,.24); box-shadow: 0 1px rgba(0,20,18,.18); }
.layer-lines i:nth-child(1) { top: 25%; }.layer-lines i:nth-child(2) { top: 50%; }.layer-lines i:nth-child(3) { top: 75%; }
.band-focus { position: absolute; z-index: 3; left: 0; right: 0; top: var(--band-top); height: 25%; border: 3px solid rgba(255,213,88,.92); border-left: 0; border-right: 0; background: linear-gradient(90deg, rgba(255,213,88,.12), transparent 60%); box-shadow: 0 0 28px rgba(255,213,88,.16); pointer-events: none; transition: top .18s ease-out; }
.band-focus.is-pointed { background: linear-gradient(90deg, rgba(255,213,88,.3), rgba(255,248,221,.08)); box-shadow: inset 0 0 0 4px rgba(255,213,88,.32), 0 0 34px rgba(255,213,88,.32); }
.sun-wash { position: absolute; z-index: 2; inset: 0; pointer-events: none; background: linear-gradient(rgba(255,225,108,.12), transparent 38%, rgba(1,26,27,.1) 62%, rgba(1,20,23,.38)); }
.drop-label { position: absolute; z-index: 9; left: 50%; top: calc(var(--band-top) + 12.5%); padding: 7px 12px; border-radius: 999px; color: #163329; background: var(--cream); box-shadow: 0 8px 22px rgba(0,0,0,.25); font-size: 12px; font-weight: 950; opacity: 0; transform: translate(-50%,-50%) scale(.9); transition: opacity .12s ease, transform .12s ease; }
.forest-stage.is-drag-over .drop-label { opacity: 1; transform: translate(-50%,-50%) scale(1); }

.slider-rail { position: absolute; right: 0; top: 22px; bottom: 22px; width: 57px; border-radius: 29px; background: #032e2c; box-shadow: inset 0 0 0 3px rgba(189,230,75,.12), 0 12px 28px rgba(0,0,0,.24); }
.rail-glow { position: absolute; left: 25px; top: 26px; bottom: 26px; width: 7px; border-radius: 99px; background: linear-gradient(var(--sun), #5ebf7b 47%, #2d7e72 72%, #153f42); }
.rail-dots { position: absolute; inset: 33px 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; pointer-events: none; }
.rail-dots i { width: 9px; height: 9px; border: 2px solid rgba(255,255,255,.65); border-radius: 50%; background: #0a4740; }
.leaf-handle { position: absolute; z-index: 4; left: -11px; top: calc(var(--handle-y, 33.33%) - 39px); width: 80px; height: 80px; display: grid; padding: 0; place-items: center; border: 0; background: transparent; filter: drop-shadow(0 8px 8px rgba(0,0,0,.35)); touch-action: none; transition: top .14s ease-out, scale .14s ease; }
.leaf-handle svg { width: 64px; height: 78px; overflow: visible; }
.leaf-handle path:first-child { fill: var(--lime); stroke: #f1ff9e; stroke-width: 3; }.leaf-handle path:last-child { fill: none; stroke: #49791e; stroke-width: 4; stroke-linecap: round; }
.leaf-handle:hover, .leaf-handle:focus-visible { scale: 1.07; }.leaf-handle.is-dragging { scale: 1.13; transition: none; cursor: grabbing; }

.animal-dock { position: absolute; z-index: 25; right: 28px; top: 108px; width: 300px; min-height: 520px; padding: 21px 22px 20px; border: 1px solid rgba(255,255,255,.17); border-radius: 28px; background: rgba(4,47,43,.9); box-shadow: 0 20px 45px rgba(0,20,18,.3); text-align: center; backdrop-filter: blur(12px); }
.animal-dock h2 { margin: 5px 0 4px; font-size: 30px; line-height: 1; letter-spacing: -.04em; }
.animal-dock > p { margin: 0 auto 9px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.clue-tags { min-height: 29px; display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; }
.animal-token { position: relative; width: 235px; height: 285px; margin: 8px auto 6px; padding: 6px 10px 38px; border: 1px dashed rgba(189,230,75,.38); border-radius: 24px; background: rgba(189,230,75,.055); touch-action: none; user-select: none; transition: transform .14s ease, background .14s ease; }
.animal-token:hover, .animal-token:focus-visible { transform: translateY(-3px); background: rgba(189,230,75,.1); }
.animal-token.is-dragging { position: fixed; z-index: 100; width: 160px; height: 160px; margin: 0; padding: 0; border: 0; background: transparent; pointer-events: none; transform: translate(-50%,-50%) scale(1.06); filter: drop-shadow(0 15px 12px rgba(0,0,0,.35)); }
.animal-token img { display: block; width: 100%; height: 235px; object-fit: contain; pointer-events: none; }.animal-token.is-dragging img { height: 100%; }
.animal-token > span { position: absolute; left: 50%; bottom: 12px; width: 150px; min-height: 30px; padding: 6px 10px; border-radius: 999px; color: #17382f; background: var(--lime); font-size: 12px; font-weight: 950; transform: translateX(-50%); }.animal-token.is-dragging > span { display: none; }
.dock-note { font-size: 12px !important; }
.animal-dock.is-shaking { animation: dock-shake .28s ease; }

.settled { position: absolute; z-index: 6; inset: 0; pointer-events: none; }
.settled img { position: absolute; width: 112px; height: 112px; object-fit: contain; filter: drop-shadow(0 7px 6px rgba(0,0,0,.34)); animation: animal-settle .45s cubic-bezier(.2,.9,.25,1.3) both; }
.settled img[data-animal="jaguar"] { width: 142px; }.settled img[data-animal="butterfly"] { width: 88px; }
.settled img.is-pointed { filter: drop-shadow(0 0 14px var(--sun)) drop-shadow(0 7px 6px rgba(0,0,0,.34)); animation: animal-pulse .6s ease 2; }

.rain { position: absolute; z-index: 5; inset: 0; opacity: 0; pointer-events: none; background: repeating-linear-gradient(104deg, transparent 0 22px, rgba(158,235,255,.48) 23px 25px, transparent 26px 47px); background-size: 130px 130px; transform: translateY(-130px); }
.game.is-storming .rain { opacity: .72; animation: rainfall .65s linear infinite; }
.game.is-storming .sun-wash { background: linear-gradient(rgba(121,188,185,.26), rgba(2,29,31,.18) 45%, rgba(1,20,23,.4)); }
.bromeliad { position: absolute; z-index: 7; right: 44px; top: 59%; width: 68px; height: 48px; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.bromeliad i { position: absolute; inset: 0; border-radius: 50% 50% 65% 65%; background: radial-gradient(ellipse at 50% 25%, #65e6eb 0 18%, #285e57 20% 23%, transparent 25%), conic-gradient(from 15deg, #ed6a69, #ffc35d, #d94c75, #ffae54, #ed6a69); clip-path: polygon(0 80%,18% 30%,36% 72%,50% 0,64% 72%,83% 28%,100% 80%,50% 100%); }
.bromeliad b { position: absolute; left: 26px; top: 10px; width: 18px; height: 16px; border-radius: 50%; background: #78d957; box-shadow: 0 0 0 3px #ff9a45; transform: scale(0); }
.bromeliad.is-revealed { opacity: 1; }.bromeliad.is-revealed b { animation: frog-peek .7s .25s cubic-bezier(.2,.9,.25,1.4) forwards; }

.toast { position: absolute; z-index: 90; left: 50%; bottom: 25px; max-width: 440px; padding: 10px 16px; border-radius: 999px; color: #14372e; background: var(--cream); box-shadow: 0 13px 35px rgba(0,0,0,.34); font-size: 13px; font-weight: 900; opacity: 0; transform: translate(-50%,10px); pointer-events: none; transition: .16s ease; }
.toast.is-showing { opacity: 1; transform: translate(-50%,0); }
.confetti { position: absolute; z-index: 95; inset: 0; overflow: hidden; pointer-events: none; }.confetti i { position: absolute; top: -25px; width: 10px; height: 18px; border-radius: 3px; animation: confetti-fall 1.25s ease-in forwards; }

.success, .finish { position: absolute; z-index: 110; left: 50%; top: 50%; width: 450px; padding: 29px 34px 30px; border: 1px solid rgba(255,255,255,.22); border-radius: 30px; background: rgba(3,43,40,.97); box-shadow: 0 30px 90px rgba(0,0,0,.6), inset 0 1px rgba(255,255,255,.08); text-align: center; transform: translate(-50%,-50%); backdrop-filter: blur(18px); }
.success::before, .finish::before { position: fixed; z-index: -1; inset: -100vh -100vw; content: ""; background: rgba(0,25,23,.56); }
.success h2, .finish h2 { margin: 5px 0 8px; color: var(--cream); font-size: 34px; line-height: 1.07; letter-spacing: -.045em; }
.success p, .finish p { margin: 0 auto 22px; max-width: 360px; color: var(--muted); line-height: 1.45; }
.success button, .finish button { min-width: 205px; min-height: 52px; padding: 12px 20px; border: 0; border-radius: 16px; color: #12362d; background: var(--sun); box-shadow: 0 6px 0 #a87817; font-weight: 950; }
.success button:hover, .finish button:hover { transform: translateY(-2px); }
.success-animal { width: 74px; height: 74px; display: grid; margin: -4px auto 13px; place-items: center; border-radius: 50%; color: #17372e; background: var(--lime); box-shadow: 0 0 0 10px rgba(189,230,75,.1), 0 0 42px rgba(189,230,75,.28); font-size: 36px; font-weight: 950; animation: success-pop .45s cubic-bezier(.2,.9,.25,1.3) both; }
.success-animal::before { content: "✓"; }
.finish-stack { width: 72px; height: 72px; display: grid; margin: -4px auto 14px; grid-template-rows: repeat(4,1fr); gap: 3px; }.finish-stack i { border-radius: 5px; }.finish-stack i:nth-child(1) { background: #ffe06b; }.finish-stack i:nth-child(2) { background: #80cc58; }.finish-stack i:nth-child(3) { background: #3e9c77; }.finish-stack i:nth-child(4) { background: #164d45; }

@keyframes dock-shake { 25% { transform: translateX(-8px); } 60% { transform: translateX(7px); } }
@keyframes animal-settle { from { opacity: .2; transform: scale(.35) rotate(-12deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes animal-pulse { 50% { transform: scale(1.12); } }
@keyframes rainfall { to { background-position: 30px 130px; } }
@keyframes frog-peek { to { transform: scale(1); } }
@keyframes success-pop { from { transform: scale(.4) rotate(-15deg); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes confetti-fall { to { transform: translate(var(--drift),108vh) rotate(520deg); opacity: .2; } }

@media (max-height: 745px) {
  .forest-shell { height: calc(100vh - 20px); }
  .mission { top: 14px; }.layer-readout { top: 139px; }
  .animal-dock { top: 82px; min-height: 500px; }.animal-token { height: 264px; }.animal-token img { height: 215px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
