/* Battle enemies: goblin, orc and ogre use new 9-frame sheets (e_goblin9 / e_orc9 / e_ogre9.webp).
   Every sheet is 9 columns x 5 rows of 141 x 134 px cells. Rows: 0 idle, 1 hop (move), 2 attack, 3 hurt, 4 death.
   Loaded after style.min.css. The slime and the old 7-frame animations are unchanged. */
.spr:is(.goblin,.orc,.ogre){--ar:.9504;--h:calc(var(--w)*.9504);background-size:calc(var(--w)*9) calc(var(--h)*5)}
.spr.goblin{--w:min(180px,50vw);background-image:url(e_goblin9.webp)}
.spr.orc{--w:min(190px,52vw);background-image:url(e_orc9.webp)}
.spr.ogre{--w:min(275px,64vw);background-image:url(e_ogre9.webp)}
.bt-stage.boss .spr.goblin{--w:min(235px,62vw)}
.bt-stage.boss .spr.orc{--w:min(235px,62vw)}
.bt-stage.boss .spr.ogre{--w:min(275px,64vw)}

.spr:is(.goblin,.orc,.ogre).idle{animation:sprIdle9 1.2s steps(1,end) infinite}
.spr:is(.goblin,.orc,.ogre).hop{animation:sprIdle9 .8s steps(1,end) both}
.spr:is(.goblin,.orc,.ogre).attack{animation:sprIdle9 .75s steps(1,end) both,lunge .75s ease-in-out both}
.spr:is(.goblin,.orc,.ogre).hurt{animation:sprHurt8 .5s steps(1,end) both}
.spr:is(.goblin,.orc,.ogre).death{animation:sprIdle9 1.1s steps(1,end) both}
.spr:is(.goblin,.orc,.ogre).death.d4{animation:sprIdle9 1.2s steps(1,end) both}

/* hurt row: only the first 8 frames play (the 9th is a fade-out frame that would linger) */
@keyframes sprHurt8{0%{background-position-x:0}12.5%{background-position-x:calc(var(--w)*-1)}25%{background-position-x:calc(var(--w)*-2)}37.5%{background-position-x:calc(var(--w)*-3)}50%{background-position-x:calc(var(--w)*-4)}62.5%{background-position-x:calc(var(--w)*-5)}75%{background-position-x:calc(var(--w)*-6)}87.5%,to{background-position-x:calc(var(--w)*-7)}}
html[data-fx=off] .spr:is(.goblin,.orc,.ogre){animation:none!important}
