.rescue-game{max-width:1180px;margin:52px auto 34px;padding:0 28px;color:#334b3b;--rescue-green:#4f8558;--rescue-moss:#75975d;--rescue-cream:#fffaf0;font-family:inherit}
.rescue-intro{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0 0 20px}.rescue-kicker{display:block;color:#66835f;font-size:10px;font-weight:800;letter-spacing:1.8px}.rescue-intro h2{margin:8px 0 5px;font-size:clamp(25px,4vw,36px);letter-spacing:-1px;color:#344b3b}.rescue-intro p{margin:0;color:#758272;font-size:14px}.rescue-collection{display:grid;grid-template-columns:auto auto;align-items:center;gap:1px 9px;padding:11px 16px;background:#f3f0df;border:1px solid #e7e2cc;border-radius:18px;color:inherit;font:inherit;text-align:left;cursor:pointer;transition:transform .16s,box-shadow .16s}.rescue-collection:hover{transform:translateY(-2px);box-shadow:0 5px 14px #37503920}.rescue-collection>span{grid-row:span 2;font-size:28px}.rescue-collection strong{font-size:19px}.rescue-collection small{font-size:10px;color:#79836e}
.rescue-stage{position:relative;overflow:hidden;border:1px solid #d6dfc8;border-radius:24px;background:#c7e7d4;box-shadow:0 17px 45px #37503918}.rescue-gamebar{position:absolute;z-index:2;top:12px;left:16px;right:16px;display:flex;justify-content:space-between;align-items:center;pointer-events:none}.rescue-stage-label,.rescue-stats{display:flex;align-items:center;gap:12px;padding:9px 13px;border:1px solid #ffffffa8;border-radius:14px;background:#fffaf0e8;color:#425d48;box-shadow:0 3px 12px #3b603518;font-size:13px;font-weight:750}.rescue-stats{pointer-events:auto}.rescue-stats span{white-space:nowrap}.rescue-sound{border:0;background:transparent;font-size:18px;cursor:pointer;line-height:1}.rescue-canvas{display:block;width:100%;height:auto;aspect-ratio:16/9;touch-action:none}.rescue-controls{display:none;position:absolute;inset:auto 14px 14px;align-items:center;gap:8px}.rescue-controls button{width:52px;height:48px;border:1px solid #ffffffb0;border-radius:16px;background:#fffaf0e8;color:#476149;font-size:22px;box-shadow:0 3px 12px #37503922;touch-action:none}.rescue-controls span{margin-left:5px;padding:7px 10px;border-radius:12px;background:#fffaf0c9;color:#55705a;font-size:10px}.rescue-controls .rescue-jump{margin-left:auto;width:auto;padding:0 17px;background:#fff0c9;font-size:15px;font-weight:800}.rescue-bottom{display:flex;justify-content:space-between;gap:12px;padding:13px 4px;color:#788476;font-size:11px}.rescue-bottom>span:first-child{white-space:nowrap;color:#71834f}
.rescue-modal{position:absolute;z-index:3;inset:0;display:grid;place-items:center;padding:18px;background:#29473755;backdrop-filter:blur(4px)}.rescue-modal[hidden]{display:none}.rescue-card{width:min(490px,100%);max-height:100%;overflow:auto;padding:26px 28px 21px;text-align:center;border:1px solid #ffffffbd;border-radius:25px;background:#fffaf0;box-shadow:0 15px 55px #1b302642;animation:rescue-pop .28s ease-out}.rescue-card-icon{font-size:55px;line-height:1.2}.rescue-card h3{margin:7px 0;font-size:25px;color:#405940}.rescue-card p{margin:8px auto 15px;max-width:340px;color:#778071;font-size:13px;line-height:1.5}.rescue-levels{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin:18px 0}.rescue-levels button{height:43px;border:1px solid #dce5d2;border-radius:13px;background:#edf4e5;color:#557c52;font-size:15px;font-weight:800;cursor:pointer}.rescue-levels button:disabled{background:#f4f1e9;color:#c3c1b4;cursor:default}.rescue-primary,.rescue-secondary{min-height:46px;border:0;border-radius:15px;cursor:pointer;font:750 14px inherit}.rescue-primary{display:flex;align-items:center;justify-content:center;gap:13px;width:100%;padding:0 18px;background:#588862;color:white;box-shadow:0 5px 0 #416e4b}.rescue-primary span{font-size:20px}.rescue-secondary{margin-top:8px;padding:0 14px;background:transparent;color:#6f7d6c}.rescue-card>small{display:block;margin-top:15px;color:#9a9b88;font-size:10px}.rescue-equation{display:flex;justify-content:center;align-items:center;min-height:75px;margin:13px 0;padding:8px;border-radius:18px;background:#edf4e5;color:#426348;font-size:28px;font-weight:850;letter-spacing:1px}.rescue-question .rescue-equation{font-size:clamp(23px,5vw,36px)}.rescue-answers{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.rescue-answers button{height:53px;border:1px solid #d5e2cf;border-radius:15px;background:#fff;color:#50724e;font-size:22px;font-weight:850;cursor:pointer}.rescue-answers button:hover,.rescue-levels button:not(:disabled):hover{background:#e9f3df;transform:translateY(-1px)}.rescue-win .rescue-celebrate{font-size:57px;animation:rescue-celebrate 1.5s ease-in-out infinite}.rescue-rating{margin:12px;font-size:30px;letter-spacing:5px}.rescue-win>strong{display:block;margin:8px;color:#58935c;font-size:21px}.rescue-bottom b{color:#54734d}
.rescue-friends{width:min(620px,100%);padding:22px}.rescue-friends-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px;margin:14px 0}.rescue-friend{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:8px 3px;border:1px solid #dae5d0;border-radius:15px;background:#f3f7e9;color:#405940;cursor:pointer}.rescue-friend canvas{width:64px;height:68px}.rescue-friend strong{max-width:100%;font-size:11px;line-height:1.15;text-align:center;overflow-wrap:anywhere}.rescue-friend small{font-size:10px;color:#74816a}.rescue-friend.is-waiting{background:#f2efe8;color:#a29c8c;cursor:default}.rescue-friend.is-waiting canvas{filter:grayscale(1);opacity:.3}.rescue-tip{position:absolute;z-index:2;top:62px;left:50%;display:flex;align-items:center;gap:12px;max-width:min(440px,calc(100% - 24px));transform:translateX(-50%);padding:10px 13px 10px 16px;border:1px solid #fff;border-radius:15px;background:#fff9e9;color:#475e43;box-shadow:0 5px 18px #203d2b33;font-size:13px;font-weight:750}.rescue-tip[hidden]{display:none}.rescue-tip button{flex:0 0 28px;width:28px;height:28px;border:0;border-radius:50%;background:#e8efdc;color:#476149;font-size:19px;line-height:1;cursor:pointer}
@keyframes rescue-pop{from{opacity:0;transform:translateY(10px) scale(.97)}to{opacity:1;transform:none}}@keyframes rescue-celebrate{50%{transform:translateY(-8px) rotate(4deg)}}
@media(max-width:700px){.rescue-game{margin:34px auto;padding:0 14px}.rescue-intro{align-items:flex-start}.rescue-intro p{font-size:12px}.rescue-collection{padding:8px 10px}.rescue-collection small{max-width:80px}.rescue-stage{border-radius:18px}.rescue-canvas{min-height:250px;object-fit:cover}.rescue-stage-label,.rescue-stats{gap:7px;padding:7px 9px;font-size:11px}.rescue-gamebar{top:8px;left:8px;right:8px}.rescue-bottom{font-size:10px}}
.rescue-controls,.rescue-controls button{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
@media(any-pointer:coarse){.rescue-controls{display:flex}.rescue-canvas{touch-action:none}.rescue-bottom>span:last-child{display:none}}
@media(max-width:560px){.rescue-card{padding:18px 16px;border-radius:20px}.rescue-card h3{font-size:21px}.rescue-card p{font-size:12px}.rescue-levels{gap:6px}.rescue-levels button{height:38px}.rescue-bottom{display:block}.rescue-bottom span{display:block;margin:3px}}
@media(max-width:560px){.rescue-friends{padding:16px 11px}.rescue-friends-grid{gap:5px}.rescue-friend{padding:6px 1px;border-radius:11px}.rescue-friend canvas{width:48px;height:53px}.rescue-friend strong,.rescue-friend small{font-size:9px}.rescue-tip{top:56px;font-size:11px}}
@media(prefers-reduced-motion:reduce){.rescue-card,.rescue-win .rescue-celebrate{animation:none}}
.rescue-primary,.rescue-secondary{font-family:inherit}
.rescue-game[data-active-level="0"] .rescue-stage{border-color:#91b77d;background:#b5dfc4;box-shadow:0 18px 44px #254c3730}
.rescue-game[data-active-level="0"] .rescue-card{border:2px solid #b5d2a3;background:linear-gradient(155deg,#fffdf1,#edf7e6);box-shadow:0 16px 50px #203d2b55}
.rescue-game[data-active-level="0"] .rescue-question .rescue-kicker{display:inline-flex;padding:6px 11px;border:1px solid #dfc888;border-radius:999px;background:#fff1c8;color:#78613c}
.rescue-game[data-active-level="0"] .rescue-question .rescue-equation{border:1px solid #d9e7bc;background:linear-gradient(135deg,#f2f7d8,#e4f2d5);color:#426348;box-shadow:inset 0 2px 6px #6c9a3b16}
.rescue-game[data-active-level="0"] .rescue-question .rescue-answers button{border:2px solid #c9dcb8;background:#fffef5;color:#52764e;box-shadow:0 3px 0 #deebd4}
.rescue-game[data-active-level="0"] .rescue-question .rescue-answers button:hover{border-color:#86b66e;background:#f0f8e7}
@media(max-width:700px){.rescue-canvas{min-height:0;object-fit:fill}.rescue-controls span{display:none}.rescue-controls button{width:48px;height:48px;flex:0 0 auto}.rescue-controls .rescue-jump{min-width:92px}}
@media(max-height:480px) and (orientation:landscape){.rescue-game[data-active-level="0"] .rescue-controls button{height:42px;width:44px}.rescue-game[data-active-level="0"] .rescue-controls .rescue-jump{min-width:92px}.rescue-game[data-active-level="0"] .rescue-controls{inset:auto 10px 9px}}
@media(max-height:480px) and (orientation:landscape){.rescue-game{margin:16px auto}.rescue-intro{margin-bottom:9px}.rescue-intro h2{margin-top:3px;font-size:23px}.rescue-stage{border-radius:14px}.rescue-controls{inset:auto 8px 8px}.rescue-controls button{width:46px;height:46px}}
.rescue-music,.rescue-sound{display:grid;place-items:center;width:34px;height:34px;padding:0;border:0;border-radius:10px;background:transparent;color:inherit;font:inherit;font-size:18px;line-height:1;cursor:pointer;touch-action:manipulation}.rescue-music:hover,.rescue-sound:hover{background:#e8efd9}.rescue-music:focus-visible,.rescue-sound:focus-visible,.rescue-controls button:focus-visible,.rescue-answers button:focus-visible,.rescue-primary:focus-visible{outline:3px solid #cf984f;outline-offset:2px}

.rescue-card-icon{display:block;width:82px;height:86px;object-fit:contain;margin:0 auto 6px}.rescue-animal-preview{display:block;width:96px;height:98px;margin:0 auto 5px;overflow:visible}.rescue-win .rescue-animal-preview{animation:rescue-celebrate 1.5s ease-in-out infinite}
.rescue-question .rescue-firefly-count{display:grid;grid-template-columns:repeat(5,44px);justify-content:center;gap:5px 10px;min-height:75px;background:#edf4df;letter-spacing:0}
.rescue-firefly{display:block;width:44px;height:44px}.rescue-firefly svg{display:block;width:100%;height:100%}
.rescue-firefly-glow{animation:rescue-firefly-light 2.4s ease-in-out infinite}
@keyframes rescue-firefly-light{50%{opacity:.8}}
@media(prefers-reduced-motion:reduce){.rescue-firefly-glow{animation:none}}
@media(max-height:480px) and (orientation:landscape){
  .rescue-question{padding:12px 18px}.rescue-question h3{font-size:22px;margin:5px 0}
  .rescue-question .rescue-equation{margin:8px 0;min-height:64px}
  .rescue-question p{margin:6px auto 10px}.rescue-question>small{margin-top:8px}
}

/* Both device orientations use the same physics, with a fitted camera viewport. */
.rescue-menu .game-orientation-choices{margin:0 0 16px}
.rescue-stage.game-orientation-portrait:not(.landscape-game-screen){width:min(100%,480px);height:min(80svh,640px);min-height:420px;margin-inline:auto}
.rescue-stage.game-orientation-portrait:not(.landscape-game-screen) .rescue-canvas{height:100%;aspect-ratio:auto}
.rescue-stage:is(.is-fullscreen,.is-expanded){position:fixed;inset:0;z-index:1000;width:100%;max-width:none;height:100dvh;min-height:0;border-radius:0;margin:0}
.rescue-stage:is(.is-fullscreen,.is-expanded) .rescue-canvas{width:100%;height:100%;aspect-ratio:auto}
.rescue-exit-screen{display:none;min-width:44px;min-height:44px;border:0;border-radius:10px;background:#edf4df;color:#425d48;font-size:22px;cursor:pointer}
.rescue-stage:is(.is-fullscreen,.is-expanded) .rescue-exit-screen{display:block}
@media(any-pointer:coarse){
  .rescue-stage{height:100svh;display:grid;place-items:center;border-radius:12px}
  .rescue-canvas{width:100%;height:100%;min-height:0;aspect-ratio:auto;object-fit:fill}
}
@media(any-pointer:coarse) and (orientation:portrait){
  .rescue-stage{height:min(70svh,600px);min-height:420px}
  .rescue-gamebar{gap:6px;flex-wrap:wrap;align-items:flex-start}
  .rescue-stage-label{padding:6px 8px;font-size:11px}
  .rescue-stats{gap:6px;padding:5px 8px;font-size:11px}
  .rescue-controls{inset:auto 8px 12px}.rescue-controls span{display:none}
  .rescue-controls button{width:52px;height:52px;flex:0 0 auto}
  .rescue-controls .rescue-jump{min-width:92px}
  .rescue-tip{top:88px;max-width:calc(100% - 16px);font-size:11px}
  .rescue-intro{gap:10px}.rescue-intro h2{font-size:24px}
  .rescue-modal{padding:12px}.rescue-card{padding:18px 14px}
  .rescue-question .rescue-firefly-count{grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
  .rescue-question .rescue-firefly{width:100%;max-width:38px;height:auto;aspect-ratio:1;justify-self:center}
}

.rescue-canvas{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.rescue-gesture-hint{display:none;position:absolute;bottom:78px;left:50%;transform:translateX(-50%);width:max-content;max-width:90%;padding:5px 10px;border-radius:12px;background:#fffaf0d9;color:#425d48;font-size:11px;text-align:center;pointer-events:none;user-select:none}
@media(any-pointer:coarse){.rescue-gesture-hint{display:block}.rescue-stage:has(.rescue-modal:not([hidden])) .rescue-gesture-hint{display:none}}

.rescue-gesture-hint[hidden]{display:none!important}
.rescue-controls{pointer-events:none}.rescue-controls button{pointer-events:auto}
.rescue-stage-label{touch-action:none;user-select:none;-webkit-user-select:none}

.rescue-controls span[hidden],.rescue-bottom>span[hidden]{display:none!important}
.rescue-enter-screen{display:grid;place-items:center;min-width:44px;min-height:44px;border:0;border-radius:10px;background:#edf4df;color:#425d48;font-size:22px;cursor:pointer;touch-action:manipulation}
.rescue-stage:is(.is-fullscreen,.is-expanded) .rescue-enter-screen{display:none}

.rescue-enter-screen{display:flex;align-items:center;justify-content:center;gap:5px;padding:0 8px}.rescue-enter-screen span{font-size:11px;font-weight:750}
.rescue-menu-fullscreen{display:block;width:100%;border:1px solid #d5e2cf;background:#edf4df}
.rescue-stage:is(.is-fullscreen,.is-expanded) .rescue-menu-fullscreen{display:none}
@media(max-width:420px){.rescue-gamebar{flex-wrap:wrap;gap:5px}.rescue-gamebar .rescue-stage-label{max-width:100%;font-size:10px}.rescue-gamebar .rescue-stats{margin-left:auto;gap:5px;padding:5px 7px}}

.rescue-save-status{position:absolute;z-index:20;inset:auto 12px 70px;padding:12px 16px;border-radius:14px;background:#fff8e8;color:#244833;box-shadow:0 4px 20px #173b3333;display:flex;align-items:center;gap:12px;justify-content:center;font-size:14px}.rescue-save-status[hidden]{display:none}.rescue-save-status button{border:0;border-radius:12px;padding:8px 12px;background:#286348;color:white}
