/* World controls: decorations never intercept map input. */
.scene:not(.battle){cursor:crosshair;user-select:none;touch-action:pan-y}
.scene:not(.battle) .scene-bg,.scene-tip,.coord{pointer-events:none}
.scene-controls,.mini-compass{z-index:15}
.player,.pet-follower{transition:none;will-change:left,top}
.player .actor-body,.pet-follower .actor-body{display:grid;place-items:center;transform-origin:50% 85%;transition:transform .12s}
.player[data-facing="left"] .actor-body,.pet-follower[data-facing="left"] .actor-body{transform:scaleX(-1)}
.player.walking .sprite{animation:world-stride .22s ease-in-out infinite alternate}
.pet-follower.walking .sprite,.pet-follower.walking .monster{animation:pet-stride .2s ease-in-out infinite alternate}
.player.walking .ring{animation:walking-shadow .22s ease-in-out infinite alternate}
.world-path{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:3;opacity:.55}
.world-path path{stroke:#fff5bb;stroke-width:2;stroke-dasharray:3 9;vector-effect:non-scaling-stroke;fill:none}
.world-target{position:absolute;width:40px;height:17px;border:2px solid #ffef9c;box-shadow:0 0 14px #fff3a480,inset 0 0 7px #fff2a455;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;z-index:6;animation:destination-pulse 1s infinite}
.world-target:before,.world-target:after{content:'';position:absolute;inset:-7px 15px;border-top:4px solid #fff7c5;border-bottom:4px solid #fff7c5}
.world-target:after{inset:4px -7px;border:0;border-left:4px solid #fff7c5;border-right:4px solid #fff7c5}
.world-target span{position:absolute;inset:4px 14px;background:#fff6be;border-radius:50%}
.npc:focus-visible{outline-color:#fff1ac}.npc{cursor:pointer}
.npc:active{transform:translate(-50%,-100%)}
/* Battle actors stay at their formation position until their own action. */
.battle-unit{will-change:transform;transition:opacity .25s,filter .25s}
.battle-unit:active{transform:translate(-50%,-100%)}
.unit-art{display:grid;place-items:center;transform-origin:50% 85%;position:relative}
.battle-unit:not(.fallen) .unit-art{animation:combat-breathe 2.4s ease-in-out infinite}
.battle-unit.active-turn:after{content:'';position:absolute;width:75px;height:22px;bottom:8px;left:50%;transform:translateX(-50%);border:2px solid #fff0a5;border-radius:50%;box-shadow:0 0 18px #ffe88799;z-index:-1}
.battle-unit.active-turn .unit-art{animation:none}
.battle-unit.fallen .unit-art{transform:rotate(-9deg) translateY(5px);animation:none}
.battle .target-hint{z-index:12;pointer-events:none}
.battle .battle-actions{z-index:40}.battle .scene-controls{z-index:45}
.battle-fx{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:30}
.action-banner{position:absolute;top:108px;left:50%;transform:translate(-50%,-8px);background:#1d3f38e8;color:#ffedb7;border:1px solid #e8d69c80;border-radius:30px;padding:9px 23px;box-shadow:0 3px 15px #173a3730;font-size:13px;letter-spacing:2px;opacity:0;transition:opacity .12s,transform .12s;z-index:32;pointer-events:none;white-space:nowrap}
.action-banner.visible{opacity:1;transform:translate(-50%,0)}
.combat-fx{position:absolute;pointer-events:none;transform:translate(-50%,-50%)}
.fx-slash{width:130px;height:130px;animation:blade-cut var(--fx-time) ease-out both;filter:drop-shadow(0 0 10px #ffe29a)}
.fx-slash svg{width:100%;height:100%;overflow:visible}
.fx-slash path:first-child{fill:#fff3bc;stroke:#fff;stroke-width:2;opacity:.95}
.fx-slash path:last-child{fill:none;stroke:#eab76a;stroke-width:8;stroke-linecap:round}
.fx-slash.enemy-slash{filter:drop-shadow(0 0 11px #f28574)}
.fx-slash.enemy-slash path:first-child{fill:#ffd9ca}.fx-slash.enemy-slash path:last-child{stroke:#de8167}
.fx-impact{width:12px;height:12px;animation:impact-pulse var(--fx-time) both}
.fx-impact:before{content:'';position:absolute;inset:-10px;background:#fffbe0;border-radius:50%;box-shadow:0 0 22px 12px #fff0a9}
.fx-impact i{position:absolute;left:5px;top:5px;width:4px;height:24px;border-radius:50%;background:#ffecac;box-shadow:0 0 7px white;transform:rotate(var(--a)) translateY(-25px);transform-origin:50% 0;animation:spark-fly var(--fx-time) ease-out both}
.fx-charge{width:65px;height:24px;border:2px solid #c5f3ec;border-radius:50%;box-shadow:0 0 24px #afffe3,inset 0 0 20px #b9ffd7;animation:magic-charge var(--fx-time) both}
.fx-orb{width:22px;height:22px;border-radius:50%;background:radial-gradient(circle,#fff 5%,#c7e7ff 35%,#71c2ef 65%,transparent 75%);box-shadow:0 0 18px 7px #9ddcff99}
.fx-orb.healing{background:radial-gradient(circle,#fff 5%,#dcffd8 35%,#9bdba3 65%,transparent 75%);box-shadow:0 0 18px 7px #b5efa899}
.fx-heal{width:100px;height:100px;border:2px solid #d1ffc1;border-radius:50%;box-shadow:0 0 28px #b8fcba,inset 0 0 25px #c5ffbd88;animation:healing-bloom var(--fx-time) ease-out both;background:radial-gradient(circle,#ebffe170,transparent 70%);color:#eaffce;text-align:center}
.fx-heal span{font:65px serif;line-height:95px;text-shadow:0 0 12px #7eba77}
.fx-heal i{position:absolute;inset:10px;border:1px dashed #efffe8;border-radius:50%}
.fx-seal{width:105px;height:105px;border:3px double #ffe3a0;border-radius:50%;background:#537b7d55;box-shadow:0 0 28px #efdb9788,inset 0 0 20px #ecd99288;display:grid;place-items:center;animation:seal-arrive var(--fx-time) both}
.fx-seal span{font:50px "SimSun",serif;color:#fff2c6;text-shadow:0 0 12px #b6954f}
.fx-shield{width:90px;height:105px;filter:drop-shadow(0 0 12px #b6f6f4);animation:shield-arrive var(--fx-time) both}
.fx-shield svg{width:100%;height:100%;fill:#c1f5e64d;stroke:#d5fff1;stroke-width:4;stroke-linejoin:round}
.battle .damage-pop{font-size:30px;top:33%;text-shadow:0 2px 2px #745238,0 0 4px #613d1d;z-index:35;animation:combat-number .9s ease-out both}
.battle .damage-pop.heal{text-shadow:0 2px 2px #386744,0 0 6px #285d40}
@keyframes world-stride{from{transform:translateY(0) rotate(-2deg)}to{transform:translateY(-7px) rotate(2deg)}}
@keyframes pet-stride{from{transform:translateY(1px) rotate(-3deg)}to{transform:translateY(-6px) rotate(3deg)}}
@keyframes walking-shadow{from{opacity:.8;scale:1}to{opacity:.45;scale:.85}}
@keyframes destination-pulse{50%{opacity:.6;scale:.85}}
@keyframes combat-breathe{50%{transform:translateY(-3px)}}
@keyframes blade-cut{0%{opacity:0;transform:translate(-50%,-50%) scale(.4) rotate(-35deg)}25%{opacity:1;transform:translate(-50%,-50%) scale(1.15) rotate(0)}100%{opacity:0;transform:translate(-50%,-50%) scale(1.4) rotate(20deg)}}
@keyframes impact-pulse{0%{opacity:0;scale:.3}25%{opacity:1;scale:1}100%{opacity:0;scale:1.8}}
@keyframes spark-fly{from{opacity:1;transform:rotate(var(--a)) translateY(-10px) scaleY(.5)}to{opacity:0;transform:rotate(var(--a)) translateY(-65px) scaleY(.8)}}
@keyframes magic-charge{0%{opacity:0;transform:translate(-50%,-50%) scale(.4)}50%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(1.8)}}
@keyframes healing-bloom{0%{opacity:0;transform:translate(-50%,-40%) scale(.4)}30%{opacity:1}100%{opacity:0;transform:translate(-50%,-70%) scale(1.2)}}
@keyframes seal-arrive{0%{opacity:0;transform:translate(-50%,-50%) scale(1.6) rotate(-40deg)}30%,65%{opacity:1;transform:translate(-50%,-50%) scale(1) rotate(0)}100%{opacity:0;transform:translate(-50%,-50%) scale(.9)}}
@keyframes shield-arrive{0%{opacity:0;transform:translate(-50%,-50%) scale(.6)}30%,65%{opacity:1;transform:translate(-50%,-50%) scale(1)}100%{opacity:0;transform:translate(-50%,-50%) scale(1.15)}}
@keyframes combat-number{0%{opacity:0;transform:translate(-50%,10px) scale(.6)}20%{opacity:1;transform:translate(-50%,-10px) scale(1.2)}45%{opacity:1;transform:translate(-50%,-20px) scale(1)}100%{opacity:0;transform:translate(-50%,-75px) scale(.9)}}
@media(max-width:700px){.action-banner{top:83px;padding:7px 13px;font-size:10px;letter-spacing:1px}.fx-slash{width:95px;height:95px}.battle .damage-pop{font-size:23px}.fx-seal{width:80px;height:80px}.fx-seal span{font-size:35px}.fx-shield{width:70px;height:80px}}
@media(prefers-reduced-motion:reduce){.player.walking .sprite,.pet-follower.walking .sprite,.pet-follower.walking .monster,.battle-unit .unit-art,.world-target{animation:none!important}}
