/* Motion stays inside the SVG rig, so race size and equipment never jump. */
.knight-art{--attack-duration:560ms;--attack-step:18px;--attack-lean:7deg}
.knight-race,.knight-motion,.knight-cloak,.knight-legs,.knight-upper,.knight-head,.knight-shield-arm,.knight-weapon-arm{transform-box:view-box}
.knight-race{transform-origin:130px 415px}.knight-motion{transform-origin:130px 380px}.knight-cloak{transform-origin:130px 125px}.knight-legs{transform-origin:130px 280px}.knight-upper{transform-origin:130px 254px}.knight-head{transform-origin:130px 122px}.knight-shield-arm{transform-origin:178px 150px}.knight-weapon-arm{transform-origin:68px 157px}
body[data-race=hobbit] #battle-knight{transform:none}.battle-figure .knight-art[data-race=human] .knight-race{transform:scale(1)}.battle-figure .knight-art[data-race=dunedain] .knight-race{transform:scale(1.02,1.02)}.battle-figure .knight-art[data-race=elf] .knight-race{transform:scale(.94,1.04)}.battle-figure .knight-art[data-race=hobbit] .knight-race{transform:scale(.84,.8)}.battle-figure .knight-art[data-race=dwarf] .knight-race{transform:scale(1.12,.9)}
.knight-bow-rig,.knight-swing-arc,.knight-axe-arc{opacity:0;pointer-events:none}.knight-bow-draw-upper,.knight-bow-draw-forearm,.knight-bow-string-upper,.knight-bow-string-lower{transform-box:view-box;transform-origin:0 0}.knight-bow-draw-upper{transform:rotate(25.7deg)}.knight-bow-draw-forearm{transform:rotate(-28.4deg)}
/* Explicit combat motion takes precedence over the background's global motion rules. */
.knight-art.is-attacking .knight-motion{animation:knightAttackStep var(--attack-duration) ease-in-out both!important}.knight-art.is-attacking .knight-upper{animation:knightAttackLean var(--attack-duration) ease-in-out both!important}.knight-art.is-attacking .knight-cloak{animation:knightAttackCloak var(--attack-duration) ease-in-out both!important}.knight-art.is-attacking .knight-head{animation:knightAttackHead var(--attack-duration) ease-in-out both!important}.knight-art.is-attacking .knight-shield-arm{animation:knightAttackGuard var(--attack-duration) ease-in-out both!important}
.knight-art.is-attacking[data-weapon=sword] .knight-weapon-arm{animation:knightSwordSlash var(--attack-duration) cubic-bezier(.2,.7,.25,1) both!important}.knight-art.is-attacking[data-weapon=sword] .knight-swing-arc{animation:knightSwordArc var(--attack-duration) ease-out both!important}
.knight-art.is-attacking[data-weapon=axe]{--attack-lean:12deg}.knight-art.is-attacking[data-weapon=axe] .knight-weapon-arm{animation:knightAxeCleave var(--attack-duration) cubic-bezier(.3,.05,.2,1) both!important}.knight-art.is-attacking[data-weapon=axe] .knight-axe-arc{animation:knightAxeArc var(--attack-duration) ease-out both!important}.knight-art.is-attacking[data-weapon=axe] .knight-legs{animation:knightAxeBrace var(--attack-duration) ease-in-out both!important}
.knight-art.is-attacking[data-weapon=bow]{--attack-lean:-3deg}.knight-art.is-attacking[data-weapon=bow] .knight-weapon-arm{opacity:0}.knight-art.is-attacking[data-weapon=bow] .knight-bow-rig{opacity:1}.knight-art.is-attacking[data-weapon=bow] .knight-shield-arm{animation:knightBowLowerShield var(--attack-duration) ease-in-out both!important}.knight-art.is-attacking[data-weapon=bow] .knight-bow-draw-upper{animation:knightBowDrawUpper var(--attack-duration) ease-in-out both!important}.knight-art.is-attacking[data-weapon=bow] .knight-bow-draw-forearm{animation:knightBowDrawForearm var(--attack-duration) ease-in-out both!important}.knight-art.is-attacking[data-weapon=bow] .knight-bow-string-upper{animation:knightBowStringUpper var(--attack-duration) ease-in-out both!important}.knight-art.is-attacking[data-weapon=bow] .knight-bow-string-lower{animation:knightBowStringLower var(--attack-duration) ease-in-out both!important}.knight-art.is-attacking[data-weapon=bow] .knight-nocked-arrow{animation:knightBowNock var(--attack-duration) ease-in-out both!important}
#battle-knight .knight-art.attack-paused *{animation-play-state:paused!important}
.combat-fx-layer{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:5}.combat-projectile,.combat-impact{position:absolute;left:0;top:0;pointer-events:none;will-change:transform,opacity;overflow:visible}.combat-projectile{width:64px;height:24px;transform-origin:50% 50%;color:#f2dfa2;filter:drop-shadow(0 0 3px #f2dfa299)}.combat-projectile[data-weapon=sword]{width:40px;height:62px;color:#f5e4b0}.combat-projectile[data-weapon=axe]{width:50px;height:70px;color:#efbf78}.combat-impact{width:52px;height:52px;color:#f8e3a6;filter:drop-shadow(0 0 5px #f3cb7788)}.combat-impact[data-weapon=axe]{width:64px;height:64px;color:#efb574}.battle-enemy.defeated.pending-impact{animation:none;opacity:1}.battle-enemy.defeated.combat-fall{animation:none;pointer-events:none}.battle-knight.striking{animation:none}.sword-trail{display:none}
@keyframes knightAttackStep{0%,100%{transform:translate(0,0)}20%{transform:translate(-4px,1px)}48%,66%{transform:translate(var(--attack-step),-2px)}82%{transform:translate(7px,0)}}
@keyframes knightAttackLean{0%,100%{transform:rotate(0)}22%{transform:rotate(-4deg)}48%,66%{transform:rotate(var(--attack-lean))}82%{transform:rotate(2deg)}}
@keyframes knightAttackCloak{0%,100%{transform:rotate(0)}22%{transform:rotate(4deg)}50%{transform:rotate(-7deg)}76%{transform:rotate(-3deg)}}
@keyframes knightAttackHead{0%,100%{transform:rotate(0)}30%,65%{transform:rotate(-4deg)}}
@keyframes knightAttackGuard{0%,100%{transform:rotate(0)}25%,65%{transform:translate(-4px,-8px) rotate(-12deg)}}
@keyframes knightSwordSlash{0%,100%{transform:rotate(0)}20%,28%{transform:rotate(-148deg)}47%{transform:rotate(-64deg)}62%{transform:rotate(-40deg)}80%{transform:rotate(-14deg)}}
@keyframes knightSwordArc{0%,29%,68%,100%{opacity:0;stroke-dasharray:0 420}34%{opacity:.3;stroke-dasharray:65 420}48%{opacity:.9;stroke-dasharray:310 420}63%{opacity:0;stroke-dasharray:370 420}}
@keyframes knightAxeCleave{0%,100%{transform:rotate(0)}28%,42%{transform:rotate(-160deg)}61%{transform:rotate(-50deg)}73%{transform:rotate(-22deg)}88%{transform:rotate(-7deg)}}
@keyframes knightAxeArc{0%,44%,82%,100%{opacity:0;stroke-dasharray:0 480}51%{opacity:.35;stroke-dasharray:75 480}64%{opacity:.85;stroke-dasharray:340 480}78%{opacity:0;stroke-dasharray:400 480}}
@keyframes knightAxeBrace{0%,100%{transform:translateY(0)}27%,43%{transform:translateY(4px) rotate(-2deg)}63%{transform:translateY(2px) rotate(2deg)}}
@keyframes knightBowLowerShield{0%,100%{transform:rotate(0)}15%,88%{transform:translate(-12px,32px) rotate(15deg)}}
@keyframes knightBowDrawUpper{0%,100%{transform:rotate(25.7deg)}44%,59%{transform:rotate(79deg)}64%,78%{transform:rotate(83deg)}90%{transform:rotate(64deg)}}
@keyframes knightBowDrawForearm{0%,100%{transform:rotate(-28.4deg)}44%,59%{transform:rotate(-116.8deg)}64%,78%{transform:rotate(-120deg)}90%{transform:rotate(-100deg)}}
@keyframes knightBowStringUpper{0%,12%,66%,100%{transform:skewX(0)}44%,59%{transform:skewX(-39.4deg)}62%{transform:skewX(5deg)}}
@keyframes knightBowStringLower{0%,12%,66%,100%{transform:skewX(0)}44%,59%{transform:skewX(39.4deg)}62%{transform:skewX(-5deg)}}
@keyframes knightBowNock{0%,12%{transform:translateX(0);opacity:1}44%,59%{transform:translateX(-64px);opacity:1}60%,100%{transform:translateX(-64px);opacity:0}}
body[data-attack-animations=off] .combat-fx-layer{display:none}
