/* A warning in the landscape, with no countdown and no permanent rune loss. */
.encounter-scene{position:absolute;inset:0;z-index:9;pointer-events:none;overflow:hidden}.encounter-scene[hidden],.encounter-notice[hidden],.fetch-runes[hidden]{display:none!important}
.encounter-npc{position:absolute;right:15%;bottom:25%;height:clamp(140px,25vh,245px);width:230px;max-width:26vw;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 6px 6px #001f2b55);transform-origin:50% 90%}
[data-kind=bat] .encounter-npc{right:12%;bottom:38%;height:clamp(170px,30vh,290px);width:390px;max-width:35vw;transform-origin:50% 50%}
.encounter-scene[data-phase=warning][data-kind=goblin] .encounter-npc{animation:goblinPeek 4s ease-in-out infinite alternate}.encounter-scene[data-phase=warning][data-kind=bat] .encounter-npc{animation:batCircle 3.2s ease-in-out infinite alternate}
.encounter-notice{position:absolute;right:34px;top:156px;z-index:15;width:300px;box-sizing:border-box;padding:15px 17px;border:1px solid #d5af6c88;border-radius:14px;background:linear-gradient(140deg,#173f43ef,#102e38ed);box-shadow:0 8px 24px #041c3133;pointer-events:auto;color:#f1e4c5}
.encounter-heading{display:flex;gap:8px;align-items:center}.encounter-heading>span{border:1px solid #d0ad70;border-radius:50%;width:22px;height:22px;flex-shrink:0;text-align:center;color:#f5d48b;font:17px Georgia,serif}.encounter-heading strong{font:17px/1.2 Georgia,serif;font-weight:400;flex:1}.encounter-heading button{font-family:inherit;font-size:10px;line-height:1.3;color:#d9d9bb;background:none;border:0;border-bottom:1px solid #bcbb9555;padding:8px 0;min-height:44px;max-width:58px}
.encounter-notice p{font-size:12px;line-height:1.55;margin:9px 0 0}.fetch-runes{display:block;width:100%;margin-top:12px;min-height:44px;padding:10px 12px;border-radius:8px;border:1px solid #dbc089;background:#e2c58c;color:#163840;font:inherit;font-size:12px;font-weight:600}.fetch-runes:focus-visible,.encounter-notice button:focus-visible{outline:3px solid #fce4ab;outline-offset:3px}
.encounter-notice[data-phase=stolen]{border-color:#edc171;box-shadow:0 0 0 3px #e3b86a15}.encounter-notice[data-phase=clear]{border-color:#acc69a}
.at-title .encounter-scene,.at-title .encounter-notice,.encounter-notice[data-traveling=true],#world[data-traveling=true] .encounter-scene{visibility:hidden}
body[data-encounter-phase=stolen] #spellSlots,body[data-encounter-phase=chasing] #spellSlots{opacity:.25;filter:grayscale(.7)}
.encounter-loot{position:absolute;right:20%;bottom:34%;display:none;gap:4px}.encounter-loot img{width:26px;height:34px;object-fit:contain;filter:drop-shadow(0 0 9px #efd99588);rotate:12deg}.encounter-loot img:nth-child(2){rotate:-15deg}
.encounter-scene[data-phase=stolen] .encounter-loot{display:flex;animation:stonesSnatched .9s ease-out both}.encounter-scene[data-phase=stolen] .encounter-npc{animation:creatureSnatch .9s ease-in-out both}
.encounter-fetch-cat{position:absolute;left:39%;bottom:21%;width:230px;height:220px;object-fit:contain;display:none}.encounter-scene[data-phase=chasing] .encounter-fetch-cat{display:block;animation:fetchStones 1.9s ease-in-out both}.encounter-scene[data-phase=chasing] .encounter-npc{animation:tricksterRun 1.9s ease-in-out both}body[data-encounter-phase=chasing][data-encounter-helper=abby] .abby-actor{opacity:0}.encounter-scene[data-phase=clear] .encounter-npc{animation:tricksterLeave 1.5s ease-in forwards}
@keyframes goblinPeek{to{translate:12px -6px;rotate:3deg}}@keyframes batCircle{to{translate:-35px 19px;scale:1 .94}}@keyframes creatureSnatch{40%{translate:-25vw 18vh;rotate:-12deg}100%{translate:0 0;rotate:0deg}}@keyframes stonesSnatched{from{translate:-32vw 34vh;opacity:0}40%{opacity:1}to{translate:0 0;opacity:1}}@keyframes tricksterRun{to{translate:45vw -4vh;opacity:0}}@keyframes fetchStones{0%{translate:0 0}55%{translate:32vw -3vh}70%{translate:32vw -3vh;scale:-1 1}100%{translate:0 0;scale:-1 1}}@keyframes tricksterLeave{to{translate:30vw -8vh;opacity:0}}
.reduce-motion .encounter-scene *{animation:none!important;transition:none!important}.reduce-motion .encounter-scene[data-phase=clear] .encounter-npc{display:none}
@media(prefers-reduced-motion:reduce){.encounter-scene *{animation:none!important;transition:none!important}.encounter-scene[data-phase=clear] .encounter-npc{display:none}}
@media(max-width:760px){.encounter-notice{top:225px;right:18px;width:230px;padding:11px 13px}.encounter-heading strong{font-size:15px}.encounter-notice p{font-size:11px;line-height:1.45}.encounter-npc{right:13%;bottom:37%;height:160px;max-width:32vw;width:140px}[data-kind=bat] .encounter-npc{right:7%;bottom:40%;max-width:45vw;height:170px;width:210px}.encounter-loot{right:18%;bottom:44%}.encounter-fetch-cat{width:170px;height:165px;bottom:31%;left:25%}}
/* Wild Paths: characters and terrain obstacles retain separate silhouettes. */
.encounter-npc{z-index:2}.encounter-npc[hidden],.encounter-hazard[hidden]{display:none!important}
.encounter-hazard{position:absolute;z-index:0;right:7%;bottom:21%;width:clamp(280px,37vw,540px);height:190px;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 7px 8px #03182055);transform-origin:50% 90%}
.encounter-scene[data-phase=warning] .encounter-hazard{animation:hazardStir 5s ease-in-out infinite alternate}.encounter-scene[data-phase=clear] .encounter-hazard{animation:hazardSettle 1.5s ease-out forwards}
[data-kind=witch] .encounter-npc{height:clamp(170px,30vh,290px);width:300px;right:12%;bottom:32%;max-width:31vw}.encounter-scene[data-phase=warning][data-kind=witch] .encounter-npc{animation:batCircle 4.8s ease-in-out infinite alternate}
[data-kind=monster] .encounter-npc{height:clamp(190px,31vh,300px);width:320px;right:12%;max-width:31vw}
[data-kind=crocodile] .encounter-npc{height:clamp(135px,19vh,190px);width:410px;right:9%;bottom:26%;max-width:36vw}.encounter-scene[data-phase=warning][data-kind=crocodile] .encounter-npc{animation:goblinPeek 5.5s ease-in-out infinite alternate}
.encounter-scene[data-hazard=swamp] .encounter-loot{filter:drop-shadow(0 0 15px #a8e0a8)}.encounter-loot{z-index:3}
.encounter-scene[data-mode=sink][data-phase=stolen] .encounter-loot{animation:stonesSink 1.1s ease-in-out both}.encounter-scene[data-mode=stick][data-phase=stolen] .encounter-loot{animation:stonesStick .8s ease-in-out both}.encounter-scene[data-mode=fog][data-phase=stolen] .encounter-loot{animation:stonesFog 1.2s ease-in-out both}
.encounter-scene[data-mode=hex][data-phase=stolen] .encounter-loot{bottom:48%;animation:stonesHex 2.2s ease-in-out infinite alternate;filter:drop-shadow(0 0 16px #c9a5f4)}
.encounter-scene[data-phase=stolen]:not([data-mode=snatch]):not([data-mode=reeds]) .encounter-npc{animation:none}
.encounter-magic{display:none;position:absolute;right:11%;bottom:22%;width:400px;height:290px;border-radius:50%;background:radial-gradient(ellipse,#fff2b08a,transparent 65%);z-index:4;pointer-events:none}
.encounter-scene[data-phase=chasing] .encounter-magic{display:block;animation:rescueLight 1.9s ease-out both}.encounter-scene[data-helper=luma] .encounter-magic{background:radial-gradient(ellipse,#d3c4ffb0,#b0e6cb55 30%,transparent 65%)}
.encounter-scene[data-helper=mei] .encounter-fetch-cat,.encounter-scene[data-helper=luma] .encounter-fetch-cat{display:none!important}.encounter-scene[data-helper=mei][data-phase=chasing] .encounter-npc,.encounter-scene[data-helper=luma][data-phase=chasing] .encounter-npc{animation:spellUnravel 1.9s ease-out both}
@keyframes hazardStir{to{scale:1.025 1.04;filter:brightness(1.08)}}@keyframes hazardSettle{to{opacity:.12;scale:1 .35}}@keyframes stonesSink{from{translate:-25vw 20vh}50%{translate:0 0;opacity:1}to{translate:0 45px;opacity:.3;scale:.7}}@keyframes stonesStick{from{translate:-25vw 20vh}70%{translate:0 10px;rotate:12deg}to{translate:0 15px;rotate:-8deg}}@keyframes stonesFog{from{translate:-25vw 20vh}to{translate:0 0;opacity:.35;filter:blur(2px)}}@keyframes stonesHex{to{rotate:12deg;translate:-14px -25px}}@keyframes rescueLight{0%{opacity:0;scale:.4}50%{opacity:1;scale:1.2}100%{opacity:0;scale:1.5}}@keyframes spellUnravel{to{opacity:.25;translate:15vw -4vh}}
.reduce-motion .encounter-scene[data-phase=clear] .encounter-hazard{opacity:.12;scale:1 .35}
@media(prefers-reduced-motion:reduce){.encounter-scene[data-phase=clear] .encounter-hazard{opacity:.12;scale:1 .35}}
@media(max-width:760px){.encounter-hazard{width:52vw;min-width:190px;height:110px;right:2%;bottom:32%}[data-kind=witch] .encounter-npc{height:175px;width:190px;max-width:40vw;right:8%;bottom:38%}[data-kind=monster] .encounter-npc{height:180px;width:190px;max-width:40vw;right:6%;bottom:34%}[data-kind=crocodile] .encounter-npc{height:110px;width:230px;max-width:49vw;right:2%;bottom:36%}.encounter-magic{right:0;width:230px;height:190px;bottom:31%}.encounter-notice p{line-height:1.4}}

/* Terrain lives below the actors in native world coordinates, so it cannot cover their bodies. */
.panoramic #worldSpace .encounter-hazard{right:auto;bottom:auto;max-width:none;z-index:4;transform-origin:50% 90%}
.encounter-hazard[data-phase=warning]{animation:hazardStir 5s ease-in-out infinite alternate}.encounter-hazard[data-phase=clear]{animation:hazardSettle 1.5s ease-out forwards}
.at-title .encounter-hazard,#world[data-traveling=true] .encounter-hazard{visibility:hidden}
.reduce-motion .encounter-hazard{animation:none!important;transition:none!important}.reduce-motion .encounter-hazard[data-phase=clear]{opacity:.12;scale:1 .35}
@media(prefers-reduced-motion:reduce){.encounter-hazard{animation:none!important;transition:none!important}.encounter-hazard[data-phase=clear]{opacity:.12;scale:1 .35}}

/* QA 1.10.1: readable warnings, discoverable motion control and clear phone silhouettes. */
.encounter-notice{width:350px}
.encounter-heading button{font-size:12px;min-width:46px;max-width:54px;margin-left:2px}
#encounterMotionButton[aria-pressed=true]{color:#fff0bc;border-bottom-color:#fff0bc}
.encounter-notice p{font-size:13px;line-height:1.5}
@media(max-width:760px){
 .encounter-notice{top:210px;left:14px;right:14px;width:auto;padding:9px 11px}
 .encounter-heading{gap:6px}.encounter-heading strong{font-size:16px}.encounter-heading button{font-size:12px;min-height:44px}
 .encounter-notice p{font-size:12px;line-height:1.45;margin-top:5px}
 .fetch-runes{font-size:13px;margin-top:8px}
 body[data-encounter-phase=stolen] .companion-dialogue,body[data-encounter-phase=chasing] .companion-dialogue{visibility:hidden}
 .encounter-npc{max-width:49vw!important;right:5%!important}
}

.encounter-npc{transition:none}
body[data-encounter-phase=stolen] .encounter-npc,body[data-encounter-phase=chasing] .encounter-npc{transition:top .35s ease-out}

/* Frame animation supplies movement; extra idle transforms caused drift into text. */
.encounter-scene[data-phase=warning] .encounter-npc{animation:none!important;translate:none;rotate:0deg;scale:1}
.encounter-hazard[data-phase=warning]{animation:none}
@media(max-height:750px) and (min-width:761px){
 .encounter-notice{top:84px}
 body:not([data-encounter-phase=quiet]) .location-badge{top:65px}
}
/* Staged Trails: existing frames move through a bounded approach lane. */
.staged-encounters .encounter-scene .encounter-npc{animation:none!important;transition:none!important;transform-origin:50% 80%}
.staged-encounters .encounter-fetch-cat{display:none!important}
.staged-encounters[data-encounter-phase=chasing] .abby-actor{opacity:1!important}
.staged-encounters .encounter-scene[data-phase=chasing] .encounter-loot{display:flex;animation:none;translate:none;rotate:0deg;filter:none}
.staged-encounters .encounter-scene[data-phase=chasing] .encounter-magic{animation-duration:2.8s}
.staged-encounters .departure-hazard{visibility:visible!important;animation:none!important;scale:1!important;transition:none!important}
.staged-encounters #world[data-traveling=true] .encounter-hazard{visibility:visible}
.staged-encounters.at-title .departure-hazard{visibility:hidden!important}
.staged-encounters.at-title #encounterNPC,.staged-encounters #world[data-traveling=true] #encounterNPC{visibility:hidden!important}
@media(max-width:760px){
 .staged-encounters .encounter-notice{top:196px}
 .staged-encounters[data-encounter-phase=stolen] .encounter-notice,.staged-encounters[data-encounter-phase=chasing] .encounter-notice{top:78px}
 .staged-encounters[data-encounter-phase=stolen] .quest-tracker,.staged-encounters[data-encounter-phase=chasing] .quest-tracker,.staged-encounters[data-encounter-phase=stolen] .location-badge,.staged-encounters[data-encounter-phase=chasing] .location-badge{visibility:hidden}
}

/* Each trail has a distinct cast; low crawlers and floating spellcasters retain clear silhouettes. */
[data-kind=wraith] .encounter-npc,[data-kind=raven] .encounter-npc{right:12%;max-width:31vw}
[data-kind=scarab] .encounter-npc,[data-kind=spider] .encounter-npc{right:9%;max-width:36vw}
@media(max-width:760px){[data-kind=wraith] .encounter-npc,[data-kind=raven] .encounter-npc{max-width:40vw}[data-kind=scarab] .encounter-npc,[data-kind=spider] .encounter-npc{max-width:49vw}}
