/* Live paper-and-ink choreography. Import AFTER style.css.
   Canonical placement lives in SVG attributes; action travels, joints and cameras
   animate only their own nested groups. Removing a cinematic restores that pose.
   Timings are shared with app state gating: opening 3800, intro 3200, defeat 2800 ms. */
.battle {
  --scene-ink: var(--ink);
  --scene-paper: var(--paper);
  --scene-accent: var(--red);
  --scene-sun: var(--red);
  --opening-duration: 3.8s;
  --boss-intro-duration: 3.2s;
  --boss-defeat-duration: 2.8s;
}
.ink-landscape { color: var(--scene-ink,var(--ink)); }
.actor .paper-cut { fill: var(--scene-paper,var(--paper)); opacity: .16; }
.actor .paper-lines { fill: none; stroke: var(--scene-paper,var(--paper)); stroke-width: 1.15; opacity: .21; }
.actor .blade-edge { fill: none; stroke: var(--scene-paper,var(--paper)); stroke-width: .8; opacity: .62; }
.actor .armor-etch { stroke-width: 1.7; opacity: .23; }
.battle .joint, .battle .actor-lift, .battle .actor-lean { transform-box: view-box; }
.battle .scene-camera { transform-origin: 720px 650px; }
.battle .actor-lift { transform-origin: 70px 216px; animation: ink-breath 5.2s ease-in-out infinite; }
.battle .actor-lean { transform-origin: 70px 114px; }
.battle .hero-torso { transform-origin: 72px 105px; }
.battle .hero-head { transform-origin: 76px 50px; }
.battle .hero-hair { transform-origin: 78px 24px; animation: hair-wind 3.7s ease-in-out infinite; }
.battle .hero-sword-arm { transform-origin: 55px 66px; }
.battle .hero-forearm { transform-origin: 37px 90px; }
.battle .hero-sword { transform-origin: 2px 93px; }
.battle .hero-back-arm { transform-origin: 91px 68px; }
.battle .hero-coat { transform-origin: 67px 111px; animation: coat-wind 5.7s ease-in-out infinite; }
.battle .hero-leg-front { transform-origin: 53px 169px; }
.battle .hero-leg-rear { transform-origin: 87px 173px; }
.battle .hero-scarf { transform-origin: 81px 53px; }
.battle .scarf-tail-long { transform-origin: 84px 53px; animation: scarf-long 3.4s ease-in-out infinite; }
.battle .scarf-tail-short { transform-origin: 84px 57px; animation: scarf-short 2.8s ease-in-out infinite; }
.battle .enemy-actor .actor-lift { animation-delay: -.8s; animation-duration: 6s; }
.battle .enemy-torso { transform-origin: 70px 109px; }
.battle .enemy-head { transform-origin: 72px 60px; }
.battle .enemy-hair { transform-origin: 57px 34px; animation: hair-wind 4.2s ease-in-out infinite reverse; }
.battle .enemy-cape { transform-origin: 70px 73px; animation: cape-wind 5.5s ease-in-out infinite; }
.battle .enemy-coat { transform-origin: 66px 112px; animation: coat-wind 6.4s ease-in-out infinite reverse; }
.battle .enemy-back-arm { transform-origin: 44px 70px; }
.battle .enemy-sword-arm { transform-origin: 92px 72px; }
.battle .enemy-forearm { transform-origin: 101px 103px; }
.battle .enemy-sword { transform-origin: 138px 107px; }
.battle .enemy-leg-front { transform-origin: 88px 174px; }
.battle .enemy-leg-rear { transform-origin: 49px 172px; }
.battle .enemy-scarf .scarf-tail { transform-origin: 54px 112px; animation: scarf-long 4s ease-in-out infinite reverse; }
.battle .enemy-scarf .scarf-tail-short { transform-origin: 56px 114px; }
.guardian-mantle, .guardian-crown { display: none; }
.fighters[data-boss='true'] .guardian-mantle, .fighters[data-boss='true'] .guardian-crown { display: inline; }
.battle .mist-ribbon-one { animation: mist-drift 24s ease-in-out infinite alternate; }
.battle .mist-ribbon-two { animation: mist-drift 32s ease-in-out -8s infinite alternate-reverse; }
.battle .wind-fleck { animation: leaf-drift var(--duration,7s) ease-in-out var(--delay,0s) infinite; }

/* Override the original absolute-position strike: it would replace the SVG
   placement transform and distort the larger guardian. */
.battle[data-phase] #hero-position, .battle[data-phase] #enemy-position { animation: none; }
.battle .slash-streak, .battle .slash-echo, .battle .slash-drybrush,
.battle .impact-brush, .battle .ink-particles, .battle .defeat-petals { opacity: 0; }
.battle[data-phase='strike'] .hero-travel { animation: ink-pass 1s cubic-bezier(.55,.01,.22,1) both; }
.battle[data-phase='strike'] .hero-actor .actor-lean { animation: pass-body 1s both; }
.battle[data-phase='strike'] .hero-head { animation: pass-head 1s both; }
.battle[data-phase='strike'] .hero-sword-arm { animation: pass-arm 1s both; }
.battle[data-phase='strike'] .hero-forearm { animation: pass-forearm 1s both; }
.battle[data-phase='strike'] .hero-sword { animation: pass-blade 1s both; }
.battle[data-phase='strike'] .hero-back-arm { animation: pass-back-arm 1s both; }
.battle[data-phase='strike'] .hero-leg-front { animation: pass-front-leg 1s both; }
.battle[data-phase='strike'] .hero-leg-rear { animation: pass-rear-leg 1s both; }
.battle[data-phase='strike'] .hero-coat { animation: pass-coat 1s both; }
.battle[data-phase='strike'] .hero-scarf { animation: pass-scarf 1s both; }
.battle[data-phase='strike'] .enemy-sword-arm { animation: enemy-guard 1s both; }
.battle[data-phase='strike'] .enemy-actor .actor-lean { animation: enemy-brace 1s both; }
.battle[data-phase='strike'] .slash-streak { animation: ink-slash 1s both; }
.battle[data-phase='strike'] .slash-echo { animation: ink-slash-echo 1s both; }
.battle[data-phase='strike'] .slash-drybrush { animation: ink-slash-echo 1s .025s both; }

/* Successful ink resolves after the stillness. These clips remain the public
   split contract. No node is replaced, and armor layers remain app-owned. */
.battle .enemy-upper, .battle .enemy-lower { transform-origin: 70px 119px; }
.battle[data-phase='split'] .enemy-upper { animation: ink-split-upper 1.2s cubic-bezier(.2,.6,.25,1) forwards; }
.battle[data-phase='split'] .enemy-lower { animation: ink-split-lower 1.2s ease-out forwards; }
.battle[data-phase='split'] .armor { opacity: 0; }
.battle[data-phase='split'] .ink-particles { opacity: 1; }
.battle[data-phase='split'] .ink-particles circle { animation: ink-scatter 1.2s var(--delay,0s) ease-out both; }
.battle[data-phase='split'] .impact-brush { animation: impact-mark .5s ease-out both; }
.battle[data-phase='split'] .hero-sword-arm { animation: blade-settle .85s ease-out both; }
.battle[data-phase='split'] .hero-head { animation: head-bow 1.2s ease-in-out both; }
.battle[data-phase='armor'] .armor { animation: ink-armor-break .85s ease-out forwards; }
.battle[data-phase='armor'] .enemy-impact { animation: armor-recoil .8s ease-out both; }
.battle[data-phase='armor'] .enemy-sword-arm { animation: guard-recover .85s ease-out both; }
.battle[data-phase='armor'] .impact-brush { animation: impact-mark .55s ease-out both; }
.battle[data-phase='miss'] .enemy-travel { animation: enemy-step .65s ease-in-out both; }
.battle[data-phase='miss'] .enemy-sword-arm { animation: enemy-riposte .65s ease-in-out both; }
.battle[data-phase='miss'] .hero-impact { animation: hero-recoil .7s ease-out both; }
.battle[data-phase='miss'] .hero-back-arm { animation: hero-recover .7s ease-out both; }

/* Shot 1: cloth and hair lead the motion; the sword hand rises, the body settles,
   and the camera pulls back from the SAME live samurai to the writing battlefield. */
.battle[data-cinematic='opening'] .scene-camera { animation: opening-camera var(--opening-duration) cubic-bezier(.3,0,.2,1) both; }
.battle[data-cinematic='opening'] .hero-travel { animation: opening-arrival var(--opening-duration) both; }
.battle[data-cinematic='opening'] .hero-actor .actor-lean { animation: opening-body var(--opening-duration) both; }
.battle[data-cinematic='opening'] .hero-head { animation: opening-head var(--opening-duration) both; }
.battle[data-cinematic='opening'] .hero-sword-arm { animation: opening-arm var(--opening-duration) both; }
.battle[data-cinematic='opening'] .hero-forearm { animation: opening-forearm var(--opening-duration) both; }
.battle[data-cinematic='opening'] .hero-sword { animation: opening-blade var(--opening-duration) both; }
.battle[data-cinematic='opening'] .hero-back-arm { animation: opening-back-arm var(--opening-duration) both; }
.battle[data-cinematic='opening'] .hero-leg-front { animation: opening-front-leg var(--opening-duration) both; }
.battle[data-cinematic='opening'] .hero-leg-rear { animation: opening-rear-leg var(--opening-duration) both; }
.battle[data-cinematic='opening'] .hero-coat { animation: opening-coat var(--opening-duration) both; }
.battle[data-cinematic='opening'] .hero-scarf { animation: opening-scarf var(--opening-duration) both; }
.battle[data-cinematic='opening'] .enemy-travel { animation: opening-opponent var(--opening-duration) both; }
.battle[data-cinematic='opening'] .enemy-actor .actor-lean { animation: none; }
.battle[data-cinematic='opening'] .enemy-sword-arm { animation: opening-guard var(--opening-duration) both; }

/* Shot 2: the guardian plants its weight and raises its blade as the camera
   reveals the red sun. Last keyframes are identity, so skipping is also safe. */
.battle[data-cinematic='boss-intro'] .scene-camera { animation: guardian-camera var(--boss-intro-duration) cubic-bezier(.25,0,.2,1) both; }
.battle[data-cinematic='boss-intro'] .enemy-travel { animation: guardian-arrival var(--boss-intro-duration) both; }
.battle[data-cinematic='boss-intro'] .enemy-actor .actor-lean { animation: guardian-body var(--boss-intro-duration) both; }
.battle[data-cinematic='boss-intro'] .enemy-head { animation: guardian-head var(--boss-intro-duration) both; }
.battle[data-cinematic='boss-intro'] .enemy-sword-arm { animation: guardian-arm var(--boss-intro-duration) both; }
.battle[data-cinematic='boss-intro'] .enemy-forearm { animation: guardian-forearm var(--boss-intro-duration) both; }
.battle[data-cinematic='boss-intro'] .enemy-back-arm { animation: guardian-back-arm var(--boss-intro-duration) both; }
.battle[data-cinematic='boss-intro'] .enemy-leg-front { animation: guardian-leg var(--boss-intro-duration) both; }
.battle[data-cinematic='boss-intro'] .enemy-cape { animation: guardian-cape var(--boss-intro-duration) both; }
.battle[data-cinematic='boss-intro'] .hero-actor .actor-lean { animation: hero-brace var(--boss-intro-duration) both; }
.battle[data-cinematic='boss-intro'] .hero-sword-arm { animation: hero-ready var(--boss-intro-duration) both; }
.battle[data-cinematic='boss-intro'] .hero-travel { animation: none; }

/* Shot 3: the same clipped guardian dissolves into dry ink, while the hero
   lowers the blade. The outcome is already settled by the state machine. */
.battle[data-cinematic='boss-defeat'] .scene-camera { animation: defeat-camera var(--boss-defeat-duration) ease-in-out both; }
.battle[data-cinematic='boss-defeat'] .enemy-upper { animation: guardian-dissolve-upper var(--boss-defeat-duration) ease-out forwards; }
.battle[data-cinematic='boss-defeat'] .enemy-lower { animation: guardian-dissolve-lower var(--boss-defeat-duration) ease-out forwards; }
.battle[data-cinematic='boss-defeat'] .armor { opacity: 0; animation: none; }
.battle[data-cinematic='boss-defeat'] .enemy-head { animation: defeated-head var(--boss-defeat-duration) both; }
.battle[data-cinematic='boss-defeat'] .enemy-sword-arm { animation: defeated-arm var(--boss-defeat-duration) both; }
.battle[data-cinematic='boss-defeat'] .hero-sword-arm { animation: victory-arm var(--boss-defeat-duration) both; }
.battle[data-cinematic='boss-defeat'] .hero-head { animation: victory-bow var(--boss-defeat-duration) both; }
.battle[data-cinematic='boss-defeat'] .hero-actor .actor-lean { animation: none; }
.battle[data-cinematic='boss-defeat'] .hero-travel { animation: none; }
.battle[data-cinematic='boss-defeat'] .ink-particles { opacity: 1; }
.battle[data-cinematic='boss-defeat'] .ink-particles circle { animation: defeat-scatter var(--boss-defeat-duration) var(--delay,0s) ease-out both; }
.battle[data-cinematic='boss-defeat'] .impact-brush { animation: impact-mark .65s .15s ease-out both; }
.battle[data-cinematic='boss-defeat'] .defeat-petals { opacity: .65; }
.battle[data-cinematic='boss-defeat'] .defeat-petal { animation: defeat-leaf var(--boss-defeat-duration) ease-out both; }
.battle[data-cinematic] .strike-ink > * { animation: none; opacity: 0; }

/* Drawing and the pre-result wait are absolute stillness, not an idle loop.
   A cinematic is an explicit temporary exception, gated by the application.
   Both common pause hooks are accepted without requiring state knowledge here. */
.battle:is([data-phase='drawing'],[data-phase='waiting'],[data-phase='frozen']):not([data-cinematic]) :is(.landscape,.fighters) *,
.battle.frozen :is(.landscape,.fighters) *,
.battle[data-frozen='true'] :is(.landscape,.fighters) *,
.battle[data-paused='true'] :is(.landscape,.fighters) *,
.battle.paused :is(.landscape,.fighters) *,
body.paused .battle :is(.landscape,.fighters) * { animation-play-state: paused !important; }

@keyframes ink-breath { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-.8px) rotate(.2deg); } }
@keyframes hair-wind { 0%,100% { transform: rotate(0) skewY(0); } 50% { transform: rotate(-3deg) skewY(-2deg); } }
@keyframes coat-wind { 0%,100% { transform: skewX(0); } 50% { transform: skewX(1.5deg); } }
@keyframes cape-wind { 0%,100% { transform: skewX(0) scaleX(1); } 50% { transform: skewX(-2deg) scaleX(1.035); } }
@keyframes scarf-long { 0%,100% { transform: rotate(0) scaleY(1); } 50% { transform: rotate(-4deg) scaleY(.8) skewX(3deg); } }
@keyframes scarf-short { 0%,100% { transform: rotate(1deg); } 50% { transform: rotate(6deg) scaleY(.88); } }
@keyframes mist-drift { from { transform: translate(-48px,-10px); } to { transform: translate(48px,10px); } }
@keyframes leaf-drift { 0%,100% { transform: translate(0,0); opacity: .14; } 50% { transform: translate(var(--drift),-8px); opacity: .48; } }
@keyframes ink-pass { 0%,16% { transform: translate(-730px,0); } 28% { transform: translate(-742px,5px); } 54% { transform: translate(-330px,-8px); } 72% { transform: translate(5px,3px); } 88%,100% { transform: translate(0,0); } }
@keyframes pass-body { 0%,18% { transform: scaleX(-1) rotate(0); } 30% { transform: scaleX(-1) rotate(-13deg) translateY(5px); } 58% { transform: scaleX(-1) rotate(-24deg); } 64% { transform: scaleX(-.25) rotate(-8deg); } 76% { transform: scaleX(1) rotate(4deg); } 100% { transform: scaleX(1) rotate(0); } }
@keyframes pass-head { 0%,100% { transform: rotate(0); } 28%,65% { transform: rotate(9deg); } }
@keyframes pass-arm { 0% { transform: rotate(0); } 24% { transform: rotate(48deg); } 44% { transform: rotate(60deg); } 56% { transform: rotate(-63deg); } 72% { transform: rotate(-19deg); } 100% { transform: rotate(0); } }
@keyframes pass-forearm { 0%,100% { transform: rotate(0); } 30% { transform: rotate(30deg); } 57% { transform: rotate(-22deg); } }
@keyframes pass-blade { 0%,100% { transform: rotate(0); } 36% { transform: rotate(17deg); } 54% { transform: rotate(-12deg); } }
@keyframes pass-back-arm { 0%,100% { transform: rotate(0); } 30% { transform: rotate(-23deg); } 62% { transform: rotate(20deg); } }
@keyframes pass-front-leg { 0%,100% { transform: rotate(0); } 28% { transform: rotate(-9deg); } 49% { transform: rotate(38deg); } 69% { transform: rotate(-11deg); } }
@keyframes pass-rear-leg { 0%,100% { transform: rotate(0); } 30% { transform: rotate(13deg); } 50% { transform: rotate(-30deg); } 73% { transform: rotate(7deg); } }
@keyframes pass-coat { 0%,100% { transform: skewX(0) rotate(0); } 38%,60% { transform: skewX(14deg) rotate(-5deg); } 80% { transform: skewX(-3deg); } }
@keyframes pass-scarf { 0%,100% { transform: rotate(0) scaleX(1); } 34%,64% { transform: rotate(-11deg) scaleX(1.2) scaleY(.65); } 82% { transform: rotate(6deg) scaleX(.97); } }
@keyframes enemy-guard { 0%,100% { transform: rotate(0); } 37% { transform: rotate(-27deg); } 58% { transform: rotate(9deg); } }
@keyframes enemy-brace { 0%,100% { transform: rotate(0); } 35% { transform: rotate(-3deg); } 62% { transform: rotate(3deg); } }
@keyframes ink-slash { 0%,39% { opacity: 0; stroke-dasharray: 0 1300; stroke-width: 13; } 53% { opacity: .8; stroke-dasharray: 1100 0; stroke-width: 13; } 73% { opacity: .24; } 100% { opacity: 0; stroke-width: 1; stroke-dasharray: 1100 0; } }
@keyframes ink-slash-echo { 0%,43% { opacity: 0; stroke-dasharray: 0 1300; } 56% { opacity: .46; stroke-dasharray: 1100 0; } 92%,100% { opacity: 0; stroke-dasharray: 1100 0; } }
@keyframes ink-split-upper { 0% { opacity: 1; transform: translate(0) rotate(0); } 18% { transform: translate(-3px,-2px) rotate(-1deg); } 100% { transform: translate(-46px,-24px) rotate(-12deg); opacity: 0; } }
@keyframes ink-split-lower { 0% { opacity: 1; transform: translate(0) rotate(0); } 18% { transform: translate(2px,1px); } 100% { transform: translate(29px,26px) rotate(7deg); opacity: 0; } }
@keyframes ink-scatter { 0% { opacity: 0; transform: translate(0,0) scale(.7); } 15% { opacity: .8; } 100% { transform: translate(var(--x),var(--y)) scale(.2); opacity: 0; } }
@keyframes impact-mark { 0% { opacity: 0; transform: scale(.94); transform-origin: 300px 600px; } 20% { opacity: .48; } 100% { opacity: 0; transform: scale(1.08); transform-origin: 300px 600px; } }
@keyframes blade-settle { 0% { transform: rotate(-7deg); } 35% { transform: rotate(7deg); } 100% { transform: rotate(0); } }
@keyframes head-bow { 0%,100% { transform: rotate(0); } 45% { transform: rotate(-7deg); } }
@keyframes ink-armor-break { 0% { opacity: 1; } 20% { opacity: .4; } 38% { opacity: 1; transform: translate(0); } 100% { transform: translate(-20px,20px) rotate(-8deg); opacity: 0; } }
@keyframes armor-recoil { 0%,100% { transform: translate(0); } 17% { transform: translate(-6px,0) rotate(-2deg); } 32% { transform: translate(3px,0); } }
@keyframes guard-recover { 0%,100% { transform: rotate(0); } 22% { transform: rotate(21deg); } 68% { transform: rotate(-7deg); } }
@keyframes enemy-step { 0%,100% { transform: translate(0); } 48% { transform: translate(20px,0); } }
@keyframes enemy-riposte { 0%,100% { transform: rotate(0); } 24% { transform: rotate(-18deg); } 54% { transform: rotate(24deg); } }
@keyframes hero-recoil { 0%,100% { transform: translate(0); } 47% { transform: translate(10px,3px) rotate(2deg); } }
@keyframes hero-recover { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-18deg); } }

@keyframes opening-camera { 0%,21% { transform: translate(-300px,-47px) scale(1.44); } 56% { transform: translate(-116px,-12px) scale(1.17); } 88%,100% { transform: translate(0,0) scale(1); } }
@keyframes opening-arrival { 0% { transform: translate(51px,0); } 36% { transform: translate(12px,1px); } 56%,100% { transform: translate(0,0); } }
@keyframes opening-body { 0%,16% { transform: rotate(5deg) translateY(4px); } 40% { transform: rotate(-3deg); } 70%,100% { transform: rotate(0) translateY(0); } }
@keyframes opening-head { 0%,24% { transform: rotate(-12deg); } 48% { transform: rotate(4deg); } 74%,100% { transform: rotate(0); } }
@keyframes opening-arm { 0%,18% { transform: rotate(-30deg); } 38% { transform: rotate(21deg); } 54% { transform: rotate(5deg); } 75%,100% { transform: rotate(0); } }
@keyframes opening-forearm { 0%,20% { transform: rotate(-32deg); } 40% { transform: rotate(8deg); } 74%,100% { transform: rotate(0); } }
@keyframes opening-blade { 0%,20% { transform: rotate(-26deg); } 39% { transform: rotate(7deg); } 76%,100% { transform: rotate(0); } }
@keyframes opening-back-arm { 0%,26% { transform: rotate(-17deg); } 48% { transform: rotate(10deg); } 76%,100% { transform: rotate(0); } }
@keyframes opening-front-leg { 0% { transform: rotate(15deg); } 32% { transform: rotate(-5deg); } 50%,100% { transform: rotate(0); } }
@keyframes opening-rear-leg { 0% { transform: rotate(-12deg); } 28% { transform: rotate(6deg); } 52%,100% { transform: rotate(0); } }
@keyframes opening-coat { 0% { transform: skewX(7deg); } 43% { transform: skewX(-4deg); } 78%,100% { transform: skewX(0); } }
@keyframes opening-scarf { 0% { transform: rotate(-9deg) scaleX(1.15); } 40% { transform: rotate(6deg) scaleX(.97); } 75%,100% { transform: rotate(0) scaleX(1); } }
@keyframes opening-opponent { 0%,12% { opacity: .3; transform: translate(-23px,0); } 60%,100% { opacity: 1; transform: translate(0,0); } }
@keyframes opening-guard { 0%,38% { transform: rotate(12deg); } 70%,100% { transform: rotate(0); } }
@keyframes guardian-camera { 0%,24% { transform: translate(200px,35px) scale(1.28); } 49% { transform: translate(150px,21px) scale(1.2); } 91%,100% { transform: translate(0,0) scale(1); } }
@keyframes guardian-arrival { 0% { transform: translate(-19px,-6px); opacity: .5; } 24% { transform: translate(-4px,-1px); opacity: 1; } 38% { transform: translate(0,3px); } 54%,100% { transform: translate(0,0); opacity: 1; } }
@keyframes guardian-body { 0% { transform: rotate(-5deg); } 37% { transform: rotate(3deg); } 72%,100% { transform: rotate(0); } }
@keyframes guardian-head { 0%,20% { transform: rotate(13deg); } 48% { transform: rotate(-5deg); } 78%,100% { transform: rotate(0); } }
@keyframes guardian-arm { 0%,15% { transform: rotate(30deg); } 40% { transform: rotate(-36deg); } 59% { transform: rotate(-18deg); } 86%,100% { transform: rotate(0); } }
@keyframes guardian-forearm { 0% { transform: rotate(22deg); } 43% { transform: rotate(-13deg); } 86%,100% { transform: rotate(0); } }
@keyframes guardian-back-arm { 0% { transform: rotate(13deg); } 45% { transform: rotate(-12deg); } 80%,100% { transform: rotate(0); } }
@keyframes guardian-leg { 0% { transform: rotate(-11deg); } 32% { transform: rotate(4deg); } 52%,100% { transform: rotate(0); } }
@keyframes guardian-cape { 0% { transform: skewX(-9deg) scaleX(.9); } 36% { transform: skewX(8deg) scaleX(1.06); } 73% { transform: skewX(-2deg); } 100% { transform: skewX(0) scaleX(1); } }
@keyframes hero-brace { 0%,100% { transform: rotate(0); } 37% { transform: rotate(4deg) translateY(2px); } }
@keyframes hero-ready { 0%,100% { transform: rotate(0); } 40% { transform: rotate(12deg); } }
@keyframes defeat-camera { 0%,100% { transform: scale(1); } 20%,58% { transform: translate(15px,6px) scale(1.025); } }
@keyframes guardian-dissolve-upper { 0% { transform: translate(0) rotate(0); opacity: 1; } 15% { transform: translate(-3px,1px) rotate(-2deg); opacity: 1; } 61%,100% { transform: translate(-47px,-21px) rotate(-12deg); opacity: 0; } }
@keyframes guardian-dissolve-lower { 0% { transform: translate(0) rotate(0); opacity: 1; } 15% { transform: translate(2px,3px); opacity: 1; } 69%,100% { transform: translate(24px,34px) rotate(6deg); opacity: 0; } }
@keyframes defeated-head { 0% { transform: rotate(0); } 40%,100% { transform: rotate(15deg); } }
@keyframes defeated-arm { 0% { transform: rotate(0); } 43%,100% { transform: rotate(26deg); } }
@keyframes victory-arm { 0% { transform: rotate(-4deg); } 26% { transform: rotate(-12deg); } 50%,72% { transform: rotate(-30deg); } 100% { transform: rotate(0); } }
@keyframes victory-bow { 0%,100% { transform: rotate(0); } 45%,73% { transform: rotate(-9deg); } }
@keyframes defeat-scatter { 0%,8% { opacity: 0; transform: translate(0,0); } 18% { opacity: .75; } 74%,100% { opacity: 0; transform: translate(var(--x),var(--y)) scale(.1); } }
@keyframes defeat-leaf { 0%,22% { opacity: 0; transform: translate(-14px,10px); } 44% { opacity: .5; } 100% { opacity: 0; transform: translate(var(--drift),-28px); } }

/* Accessibility: no tiny fast loops, large camera pans, or flashing substitute.
   Outcome feedback stays visible and the state machine owns the shortened wait. */
.reduced-motion .battle :is(.landscape,.fighters) * {
  animation: none !important;
  transition: none !important;
}
.reduced-motion .battle[data-phase='split'] :is(.enemy-upper,.enemy-lower),
.reduced-motion .battle[data-cinematic='boss-defeat'] :is(.enemy-upper,.enemy-lower) { opacity: 0; }
.reduced-motion .battle[data-phase='armor'] .armor { opacity: 0; }
.reduced-motion .battle :is(.slash-streak,.slash-echo,.slash-drybrush,.ink-particles,.impact-brush,.defeat-petals) { opacity: 0 !important; }
@media (prefers-reduced-motion: reduce) {
  .battle :is(.landscape,.fighters) * { animation: none !important; transition: none !important; }
  .battle[data-phase='split'] :is(.enemy-upper,.enemy-lower),
  .battle[data-cinematic='boss-defeat'] :is(.enemy-upper,.enemy-lower) { opacity: 0; }
  .battle[data-phase='armor'] .armor { opacity: 0; }
  .battle :is(.slash-streak,.slash-echo,.slash-drybrush,.ink-particles,.impact-brush,.defeat-petals) { opacity: 0 !important; }
}

/* Earned world: the home landscape remains a preview. The game alone begins
   with paper, sun and grounding ink; app-owned flags restore these layers. */
.battle .world-mountains, .battle .world-river, .battle .world-trees { visibility: hidden; }
.battle[data-world-mountains='true'] .world-mountains,
.battle[data-world-river='true'] .world-river,
.battle[data-world-trees='true'] .world-trees { visibility: visible; }
.battle.restore-mountains[data-world-mountains='true'] .world-mountains { animation: mountain-ink-restore 1.6s ease-out both; transform-origin: 720px 650px; }
.battle.restore-river[data-world-river='true'] .world-river { animation: river-ink-restore 1.6s ease-out both; transform-origin: 770px 850px; }
.battle.restore-trees[data-world-trees='true'] .world-trees { animation: tree-ink-restore 1.4s ease-out both; transform-origin: 720px 690px; }
@keyframes mountain-ink-restore { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes river-ink-restore { from { opacity: 0; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0); } }
@keyframes tree-ink-restore { from { opacity: 0; transform: scaleY(.94); } to { opacity: 1; transform: scaleY(1); } }

/* Portrait: a native-ratio art viewport, wider than the screen, keeps ink
   anatomy proportionate. Both actors move inward onto the same painted ground,
   whose line (y 812 of 900) still lands at 94.5% of the battle height. */
@media (max-width: 760px) and (min-height: 551px) {
  .battle .fighters { width: 190%; height: auto; aspect-ratio: 1440 / 900; left: -45%; top: auto; bottom: calc(5.5dvh - 11.6vw); }
  .battle #hero-position { transform: translate(820px,498px) scale(1.4); }
  .battle .ink-particles, .battle .impact-brush { translate: 178px 0; }
  .battle #enemy-position { transform: translate(380px,498px) scale(1.4); }
  .battle .fighters[data-boss='true'] #enemy-position { transform: translate(350px,423px) scale(1.75); }
  .battle[data-phase='strike']:not([data-cinematic]) .hero-travel { animation-name: ink-pass-portrait; }
  .battle[data-cinematic='opening'] .actor-camera { animation-name: opening-camera-portrait; }
  .battle[data-cinematic='boss-intro'] .actor-camera { animation-name: guardian-camera-portrait; }
}
@keyframes ink-pass-portrait { 0%,16% { transform: translate(-362px,0); } 28% { transform: translate(-368px,5px); } 54% { transform: translate(-164px,-8px); } 72% { transform: translate(3px,3px); } 88%,100% { transform: translate(0,0); } }
@keyframes opening-camera-portrait { 0%,21% { transform: translate(-65px,-18px) scale(1.16); } 56% { transform: translate(-20px,-5px) scale(1.06); } 88%,100% { transform: translate(0,0) scale(1); } }
@keyframes guardian-camera-portrait { 0%,24% { transform: translate(32px,10px) scale(1.12); } 49% { transform: translate(17px,4px) scale(1.07); } 91%,100% { transform: translate(0,0) scale(1); } }

/* Reference-led ink pass: layered armor, torn fabric and hairline pigment wear.
   The actor silhouette remains legible at phone scale; red belongs to the ribbon. */
.actor .ink-wash { fill: var(--scene-paper,var(--paper)); opacity: .125; }
.actor .soft-wash { opacity: .09; }
.actor .pigment-wear { fill: var(--scene-paper,var(--paper)); opacity: .2; }
.actor .garment-lines { stroke-width: .64; opacity: .21; }
.actor .armor-skirt { stroke-width: .78; opacity: .27; }
.actor .armor-etch { stroke-width: .64; opacity: .32; }
.actor .helmet-lines { stroke-width: .7; opacity: .3; }
.actor .ribbon-wear { fill: var(--scene-paper,var(--paper)); opacity: .63; }
.battle .hero-head { transform-origin: 79px 50px; }
.battle .hero-hair { transform-origin: 75px 25px; }
.battle .hero-sword-arm { transform-origin: 92px 69px; }
.battle .hero-forearm { transform-origin: 99px 105px; }
.battle .hero-sword { transform-origin: 117px 125px; }
.battle .hero-back-arm { transform-origin: 59px 69px; }
.battle .hero-leg-front { transform-origin: 91px 170px; }
.battle .hero-leg-rear { transform-origin: 60px 171px; }
.battle .hero-scarf { transform-origin: 73px 50px; }
.battle .hero-scarf .scarf-tail-long { transform-origin: 73px 49px; animation-duration: 3.8s; }
.battle .hero-scarf .scarf-tail-short { transform-origin: 71px 53px; animation-duration: 3.1s; animation-delay: -.8s; }
.battle .hero-coat { transform-origin: 77px 110px; }
.battle .hero-actor .actor-lift { transform-origin: 77px 216px; }

/* Horn variation never changes the primary target or its two split halves. */
.helmet-horns:not(.horn-crescent) { display: none; }
.fighters[data-enemy-variant='antler'] #enemy-position:not(.combat-enemy) .horn-crescent,
.fighters[data-enemy-variant='blade'] #enemy-position:not(.combat-enemy) .horn-crescent { display: none; }
.fighters[data-enemy-variant='antler'] #enemy-position:not(.combat-enemy) .horn-antler,
.fighters[data-enemy-variant='blade'] #enemy-position:not(.combat-enemy) .horn-blade { display: inline; }
.incoming-position .helmet-horns { display: none; }
.incoming-position[data-enemy-variant='antler'] .horn-antler,
.incoming-position[data-enemy-variant='blade'] .horn-blade { display: inline; }
.fighters[data-boss='true'] .incoming-position :is(.guardian-mantle,.guardian-crown) { display: none; }
.battle .incoming-attackers { opacity: .62; }
.battle .incoming-position { visibility: hidden; }
.battle[data-wave='2'] .incoming-one,
.battle[data-wave='3'] :is(.incoming-one,.incoming-two) { visibility: visible; }
.battle .incoming-two { opacity: .61; }
.battle .incoming-position .actor-lift { animation-duration: 4.2s; }
.battle .incoming-position .actor-lean { transform-origin: 70px 115px; }
.battle[data-cinematic] .incoming-attackers { visibility: hidden; }
.battle[data-cinematic] .incoming-position { visibility: hidden; }

/* Mist, petals and rain are separate, deterministic environmental layers. */
.battle .weather-petals { opacity: .14; }
.battle[data-scene='petals'] .weather-petals { opacity: .74; }
.battle .weather-rain { visibility: hidden; }
.battle[data-scene='rain'] .weather-rain { visibility: visible; }
.battle .rain-thread { animation: rain-fall var(--duration,2.1s) linear var(--delay,0s) infinite; }

/* Walking uses the very same joints. Scenery drifts slowly behind the hero;
   footsteps alternate and the ribbon remains anchored to the collar. */
.battle[data-phase='walking']:not([data-cinematic]) .hero-travel { animation: journey-step-forward 1.35s ease-in-out both; }
.battle[data-phase='walking']:not([data-cinematic]) .hero-actor .actor-lift { animation: walking-weight .56s ease-in-out infinite; }
.battle[data-phase='walking']:not([data-cinematic]) .hero-actor .actor-lean { animation: walking-lean 1.12s ease-in-out infinite; }
.battle[data-phase='walking']:not([data-cinematic]) .hero-leg-front { animation: walking-front .56s ease-in-out infinite; }
.battle[data-phase='walking']:not([data-cinematic]) .hero-leg-rear { animation: walking-rear .56s ease-in-out infinite; }
.battle[data-phase='walking']:not([data-cinematic]) .hero-sword-arm { animation: walking-sword 1.12s ease-in-out infinite; }
.battle[data-phase='walking']:not([data-cinematic]) .hero-back-arm { animation: walking-arm 1.12s ease-in-out infinite; }
.battle[data-phase='walking']:not([data-cinematic]) .hero-coat { animation: walking-cloth .56s ease-in-out infinite; }
.battle[data-phase='walking']:not([data-cinematic]) .hero-scarf .scarf-tail-long { animation: traveling-ribbon 1.12s ease-in-out infinite; }
.battle[data-phase='walking']:not([data-cinematic]) .pigment-field { animation: journey-far 2.1s linear both; }
.battle[data-phase='walking']:not([data-cinematic]) .pigment-valley { animation: journey-near 2.1s linear both; }
.battle[data-phase='walking']:not([data-cinematic]) .ground-pigment { animation: journey-ground 2.1s linear both; }
.battle[data-phase='walking']:not([data-cinematic]) #enemy-position .enemy-travel { animation: enemy-approach 1.35s ease-out both; }
.battle[data-phase='walking']:not([data-cinematic]) .enemy-leg-front { animation: walking-front .72s ease-in-out infinite reverse; }
.battle[data-phase='walking']:not([data-cinematic]) .enemy-leg-rear { animation: walking-rear .72s ease-in-out infinite reverse; }
.battle[data-phase='walking']:not([data-cinematic]) .incoming-travel { animation: incoming-approach 1.35s ease-out both; }
.battle[data-phase='walking']:not([data-cinematic]) .incoming-two .incoming-travel { animation-delay: .1s; }
.battle[data-phase='strike'] .incoming-position .actor-lean { animation: incoming-brace 1s ease-out both; }
.battle[data-phase='strike'] .incoming-position .enemy-sword-arm { animation: incoming-guard 1s ease-out both; }

@keyframes rain-fall { from { transform: translate(13px,-36px); } to { transform: translate(-13px,36px); } }
@keyframes walking-weight { 0%,50%,100% { transform: translateY(0); } 25%,75% { transform: translateY(-2px); } }
@keyframes walking-lean { 0%,100% { transform: rotate(1.5deg); } 50% { transform: rotate(2.8deg); } }
@keyframes walking-front { 0%,100% { transform: rotate(-12deg); } 50% { transform: rotate(13deg); } }
@keyframes walking-rear { 0%,100% { transform: rotate(13deg); } 50% { transform: rotate(-12deg); } }
@keyframes walking-sword { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg); } }
@keyframes walking-arm { 0%,100% { transform: rotate(8deg); } 50% { transform: rotate(-9deg); } }
@keyframes walking-cloth { 0%,100% { transform: skewX(-1deg); } 50% { transform: skewX(3deg); } }
@keyframes traveling-ribbon { 0%,100% { transform: rotate(1deg) scaleY(.93); } 50% { transform: rotate(7deg) scaleY(.72) scaleX(1.025); } }
@keyframes journey-step-forward { from { transform: translate(-20px,0); } to { transform: translate(0,0); } }
@keyframes journey-far { from { transform: translateX(5px); } to { transform: translateX(-6px); } }
@keyframes journey-near { from { transform: translateX(10px); } to { transform: translateX(-12px); } }
@keyframes journey-ground { from { transform: translateX(20px); } to { transform: translateX(-30px); } }
@keyframes enemy-approach { from { opacity: .25; transform: translate(-46px,0); } to { opacity: 1; transform: translate(0,0); } }
@keyframes incoming-approach { from { opacity: .1; transform: translate(-35px,0); } to { opacity: 1; transform: translate(0,0); } }
@keyframes incoming-brace { 0%,100% { transform: rotate(0); } 48% { transform: rotate(-5deg); } }
@keyframes incoming-guard { 0%,100% { transform: rotate(0); } 48% { transform: rotate(-17deg); } }

/* The hero now faces right, as in the approved post-strike composition. */
@keyframes pass-body { 0%,18% { transform: rotate(0); } 30% { transform: rotate(10deg) translateY(4px); } 58% { transform: rotate(17deg); } 76% { transform: rotate(-3deg); } 100% { transform: rotate(0); } }
@keyframes pass-arm { 0% { transform: rotate(0); } 24% { transform: rotate(-68deg); } 44% { transform: rotate(-95deg); } 56% { transform: rotate(35deg); } 72% { transform: rotate(10deg); } 100% { transform: rotate(0); } }
@keyframes pass-forearm { 0%,100% { transform: rotate(0); } 30% { transform: rotate(-27deg); } 57% { transform: rotate(16deg); } }
@keyframes pass-scarf { 0%,100% { transform: rotate(0) scaleX(1); } 34%,64% { transform: rotate(12deg) scaleX(1.12) scaleY(.67); } 82% { transform: rotate(-4deg) scaleX(.98); } }

/* All aspect ratios keep native anatomy, rather than stretching the artboard.
   Portrait coordinates retain the established visible strip and ground line. */
.battle .fighters { aspect-ratio: 1440 / 900; }
@media (max-width: 760px) and (min-height: 551px) {
 .battle .incoming-one { transform: translate(255px,605px) scale(.82); }
 .battle .incoming-two { transform: translate(320px,638px) scale(.66); }
 .battle .incoming-attackers { opacity: .43; }
 .battle .fighters[data-boss='true'] .incoming-one { transform: translate(236px,605px) scale(.82); }
}

/* These final rules cover the added loops as well as the original choreography. */
.battle:is([data-phase='drawing'],[data-phase='waiting'],[data-phase='frozen']):not([data-cinematic]) :is(.landscape,.fighters) *,
.battle:is(.frozen,.paused,[data-frozen='true'],[data-paused='true']) :is(.landscape,.fighters) *,
body.paused .battle :is(.landscape,.fighters) * { animation-play-state: paused !important; }
.reduced-motion .battle :is(.landscape,.fighters) * { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { .battle :is(.landscape,.fighters) * { animation: none !important; transition: none !important; } }

/* Original pigment is clipped on individual joints. Vector anatomy remains
   beneath it as seam coverage during motion, never replacing the source file. */
.actor .reference-pigment { pointer-events: none; }
.actor .reference-pigment image { image-rendering: auto; }
.battle .enemy-sword-arm { transform-origin: 63px 71px; }
.battle .enemy-forearm { transform-origin: 58px 106px; }
.battle .enemy-sword { transform-origin: 43px 121px; }
/* Keep the hand-traced source silhouettes clean: the vectors remain available
   as an explicit fallback, while each source fragment follows its joint. */
.reference-actor path, .reference-actor circle, .reference-actor ellipse { visibility: hidden; }
.reference-actor .guardian-mantle path, .reference-actor .guardian-crown path { visibility: inherit; }
.battle .mist-banks { opacity: .26; }
.battle[data-scene='mist'] .mist-banks { opacity: .38; }
.battle[data-scene='petals'] .mist-banks { opacity: .2; }
.reference-actor .horn-antler path, .reference-actor .horn-blade path { visibility: inherit; }

.battle .hero-hair { transform-origin: 85px 27px; }

.battle[data-wave="3"] .incoming-one, .battle[data-wave="3"] .incoming-two { visibility: visible; }
/* Landscape, valley and ground sample only hard-clipped clean regions of the approved
   pigment; their filters turn its paper transparent, so they composite normally with
   no blending. Day and night are separate light passes over the same painting (art.mjs);
   actors keep their black reference pigment at night, with no inversion. */
.battle .fighters { overflow: visible; }
.battle .lit-night { display: none; }
body[data-light='night'] .battle .lit-day { display: none; }
body[data-light='night'] .battle .lit-night { display: inline; }
body[data-light='night'] .battle .pigment-valley { opacity: .62; }
body[data-light='night'] .battle .mist-banks { opacity: .34; }

/* Paper wind has a visual clock only. Combat/capture state remains frozen. */
body:not(.paused) .battle:is([data-phase='drawing'],[data-phase='waiting']):not([data-cinematic]):not([data-paused='true']):not(.paused):not(.frozen):not([data-frozen='true']) .fighters :is(.hero-hair,.hero-scarf .scarf-tail) { animation-play-state: running !important; }
body.paused .battle .fighters :is(.hero-hair,.hero-scarf .scarf-tail) { animation-play-state: paused !important; }
.battle .combat-enemy[data-selected='false'] :is(.enemy-upper,.enemy-lower,.enemy-impact) { animation: none !important; }

/* Horn identity belongs to its opponent, independently of current selection. */
.battle .combat-enemy .helmet-horns { display:none; }
.battle .combat-enemy[data-enemy-variant='crescent'] .horn-crescent,
.battle .combat-enemy[data-enemy-variant='antler'] .horn-antler,
.battle .combat-enemy[data-enemy-variant='blade'] .horn-blade { display:inline; }

/* Visual clocks only: the inner breath is anchored at the feet. Writing keeps
   the complete combat pose still; only hair, ribbon and atmosphere stay alive. */
@keyframes ink-breath {
  0%,100% { transform: scaleY(1) rotate(0); }
  44% { transform: scaleY(1.006) rotate(.12deg); }
  72% { transform: scaleY(1.002) rotate(-.04deg); }
}
@keyframes hair-wind {
  0%,100% { transform: rotate(-.3deg) skewY(0); }
  28% { transform: rotate(-1.3deg) skewY(-.6deg); }
  58% { transform: rotate(-3.2deg) skewY(-1.7deg); }
  82% { transform: rotate(-1.1deg) skewY(-.4deg); }
}
@keyframes scarf-long {
  0%,100% { transform: rotate(0) scaleY(1) skewX(0); }
  28% { transform: rotate(-1.8deg) scaleY(.94) skewX(1deg); }
  56% { transform: rotate(-4.2deg) scaleY(.83) skewX(2.5deg); }
  82% { transform: rotate(-1.5deg) scaleY(.96) skewX(.4deg); }
}
@keyframes scarf-short {
  0%,100% { transform: rotate(.8deg) scaleY(1); }
  38% { transform: rotate(5.4deg) scaleY(.9); }
  72% { transform: rotate(2deg) scaleY(.96); }
}
body:not(.paused) .battle:is([data-phase='drawing'],[data-phase='waiting'],[data-phase='frozen']):not([data-cinematic]):not(.paused):not([data-paused='true']) .fighters :is(.hero-hair,.enemy-hair,.hero-scarf .scarf-tail,.enemy-scarf .scarf-tail),
body:not(.paused) .battle:is([data-phase='drawing'],[data-phase='waiting'],[data-phase='frozen']):not([data-cinematic]):not(.paused):not([data-paused='true']) .landscape :is(.mist-banks,.mist-ribbon,.wind-fleck,.rain-thread) { animation-play-state:running !important; }
body.paused .battle :is(.landscape,.fighters) *,
.battle:is(.paused,[data-paused='true']) :is(.landscape,.fighters) * { animation-play-state:paused !important; }

/* A full, uncut painting at rest avoids the raster antialias join between two
   clipped copies. Only the confirmed-result phase exposes the two split caps. */
.battle .enemy-upper { clip-path:none; transform-origin:70px 89px; }
.battle .enemy-lower { visibility:hidden; transform-origin:70px 89px; }
.battle .torso-cut-flash { opacity:0; pointer-events:none; }
.battle .actor-camera > .impact-brush { opacity:0 !important; animation:none !important; }
.battle[data-phase='split'] .ink-particles { opacity:0; }
.battle[data-phase='split'] #enemy-position .enemy-upper { clip-path:url(#enemy-top); }
.battle[data-phase='split'] #enemy-position .enemy-lower { visibility:visible; }
.battle:is([data-phase='split'],[data-phase='armor']) #enemy-position .torso-cut-flash { animation:torso-cut-once .34s ease-out both; }
.battle[data-phase='split'] #enemy-position :is(.enemy-upper,.enemy-lower) .actor-lift { animation-play-state:paused !important; }
.battle .combat-enemy[data-selected='false'] .enemy-upper { clip-path:none; }
.battle .combat-enemy[data-selected='false'] :is(.enemy-lower,.torso-cut-flash) { visibility:hidden; }
@keyframes torso-cut-once {
  0% { opacity:0; stroke-dasharray:86; stroke-dashoffset:86; }
  16% { opacity:.95; stroke-dasharray:86; stroke-dashoffset:58; }
  42% { opacity:.9; stroke-dasharray:86; stroke-dashoffset:0; }
  100% { opacity:0; stroke-dasharray:86; stroke-dashoffset:-4; }
}

/* Fatal miss only (data-fatal marks the last life's committed miss). The existing riposte lands, the same
   cut flash crosses the hero's lower chest, then the halves part and fade as ink before Defeat
   (app FATAL_CUT_MS). Every other state keeps one uncut hero: .hero-cut is display:none in the markup.
   Both copies drop idle motion so the two halves stay one pose at the seam. */
.battle[data-fatal] #hero-position .hero-cut { display:inline; }
.battle[data-fatal] #hero-position .hero-upper { clip-path:url(#hero-top); }
.battle[data-fatal] #hero-position :is(.hero-upper,.hero-lower) { transform-origin:79px 83px; }
.battle[data-fatal] #hero-position :is(.hero-upper,.hero-lower) * { animation:none; }
.battle[data-fatal] #hero-position .hero-impact { animation:none; }
.battle[data-fatal] #hero-position .torso-cut-flash { animation:torso-cut-once .34s .3s ease-out both; }
.battle[data-fatal] #hero-position .hero-upper { animation:hero-fall-upper 1.6s .4s cubic-bezier(.3,.1,.3,1) both; }
.battle[data-fatal] #hero-position .hero-lower { animation:hero-fall-lower 1.6s .4s ease-in both; }
@keyframes hero-fall-upper { 0% { transform:translate(0) rotate(0); opacity:1; } 14% { transform:translate(3px,.3px) rotate(.6deg); opacity:1; } 55% { opacity:.75; } 100% { transform:translate(17px,13px) rotate(9deg); opacity:0; } }
@keyframes hero-fall-lower { 0% { transform:translate(0); opacity:1; } 20% { transform:translate(-1px,.5px); opacity:1; } 100% { transform:translate(-3px,6px); opacity:0; } }
/* Reduced motion: no flash, one restrained parted state until Defeat. */
.reduced-motion .battle[data-fatal] #hero-position .hero-upper { transform:translate(8px,5px) rotate(4deg); opacity:.45; }
.reduced-motion .battle[data-fatal] #hero-position .hero-lower { opacity:.6; }
/* Defeat's black scene settles in once; reduced motion shows it at once. */
.battle[data-result='defeat'] .defeat-overlay { animation:defeat-fall-in .6s ease-out both; }
@keyframes defeat-fall-in { from { opacity:0; } to { opacity:1; } }
.reduced-motion .battle[data-result='defeat'] .defeat-overlay { animation:none; }
@media (prefers-reduced-motion: reduce) {
  .battle[data-fatal] #hero-position .hero-upper { transform:translate(8px,5px) rotate(4deg); opacity:.45; }
  .battle[data-fatal] #hero-position .hero-lower { opacity:.6; }
  .battle[data-result='defeat'] .defeat-overlay { animation:none; }
}

/* Visible mist density has its own visual clock; painted terrain stays fixed. */
.battle .mist-banks { animation:mist-density 16s ease-in-out infinite; }
@keyframes mist-density { 0%,100% { opacity:.26; } 50% { opacity:.44; } }
