/* Layered perspective gives the static character renders a lively, readable attack. */
.arena-battlefield{perspective:950px;transform-style:preserve-3d;isolation:isolate}
.arena-battlefield.attacking{animation:battleCamera 1.15s cubic-bezier(.2,.7,.2,1) both}
.arena-battlefield.attacking::before{animation:groundGlow 1.1s ease-out both}
.arena-combatants,.arena-fighter,.arena-character{transform-style:preserve-3d}
.arena-character.wizard.casting{animation:none}
.arena-character.wizard.casting img{transform-origin:50% 85%;animation:heroPowerStrike 1.15s cubic-bezier(.19,.72,.27,1) both;will-change:transform,filter}
.arena-battlefield.ultimate-attack .arena-character.wizard.casting img{animation:heroUltimateStrike 1.4s cubic-bezier(.2,.7,.2,1) both}
.arena-character.enemy.taking-hit{animation:monsterImpact 1.05s cubic-bezier(.24,.8,.25,1) both}
.arena-character.enemy.taking-hit img{animation:monsterSquash 1.05s ease-out both}
.arena-battlefield.attacking .arena-ground{animation:groundImpact 1.05s ease-out both}
.arena-impact{position:absolute;z-index:3;left:73%;top:49%;width:18px;height:18px;border:3px solid var(--attack-core);border-radius:50%;box-shadow:0 0 20px 8px var(--attack-outer),inset 0 0 16px var(--attack-ring);pointer-events:none;opacity:0;animation:impactRing 1.05s ease-out both}
.arena-impact::before,.arena-impact::after{content:"";position:absolute;inset:-40px;border:3px dashed var(--attack-ring);border-radius:50%;animation:impactRing 1.05s ease-out both}
.arena-impact::after{inset:-75px;animation-delay:.08s}
.arena-battlefield.attacking .arena-vfx::after{content:"";position:absolute;left:68%;top:33%;width:125px;height:125px;border-radius:50%;background:conic-gradient(from 10deg,transparent 0 8%,var(--attack-core) 10% 13%,transparent 15% 24%,var(--attack-ring) 27% 30%,transparent 32% 45%,var(--attack-outer) 48% 51%,transparent 53% 70%,var(--attack-core) 73% 76%,transparent 78%);filter:drop-shadow(0 0 14px var(--attack-outer));opacity:0;animation:impactSpark 1.05s ease-out both}
.arena-battlefield.attacking .arena-vfx::before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 76% 50%,var(--attack-ring),transparent 31%);mix-blend-mode:screen;opacity:0;animation:impactFlash 1.05s ease-out both}
.arena-vfx span:nth-child(2),.arena-vfx span:nth-child(3){animation-delay:.12s}
.arena-vfx.projectile span:nth-child(2),.arena-vfx.projectile span:nth-child(3),.arena-vfx.spirit_bomb span:nth-child(2),.arena-vfx.spirit_bomb span:nth-child(3){top:46%;left:30%;width:18px;height:18px;border-radius:50%;background:var(--attack-ring);box-shadow:0 0 22px var(--attack-core);animation:powerTrail .8s ease-in both}
.arena-vfx.projectile span:nth-child(3),.arena-vfx.spirit_bomb span:nth-child(3){top:37%;animation-delay:.2s}
.arena-vfx.beam span:first-child,.arena-vfx.spiral_beam span:first-child{animation-duration:1.05s}
.arena-battlefield.ultimate-attack .arena-vfx span:first-child{filter:drop-shadow(0 0 35px var(--attack-core));scale:1.25}
.battle-stage .fighter-sprite img{display:block;width:115px;height:128px;object-fit:contain;margin:auto;filter:drop-shadow(0 10px 5px rgba(10,5,35,.55))}
.battle-stage .monster-fighter .fighter-sprite img{width:115px;height:128px}
.battle-stage:has(.battle-flash.burst) .hero-fighter .fighter-sprite{animation:miniHeroStrike .8s ease-out both}
.battle-stage:has(.battle-flash.burst) .monster-fighter .fighter-sprite{animation:miniMonsterHit .8s ease-out both}
@keyframes heroPowerStrike{0%{transform:translate3d(0,0,0) rotateY(-8deg) scale(1);filter:brightness(1)}18%{transform:translate3d(-12px,-15px,30px) rotateY(-22deg) rotateZ(-6deg) scale(1.06)}42%{transform:translate3d(50px,-42px,110px) rotateY(10deg) rotateZ(6deg) scale(1.33);filter:brightness(1.55) drop-shadow(0 0 25px var(--attack-core))}60%{transform:translate3d(93px,-14px,130px) rotateY(25deg) rotateZ(10deg) scale(1.42)}100%{transform:translate3d(0,0,0) rotateY(0) scale(1);filter:brightness(1)}}
@keyframes heroUltimateStrike{0%{transform:translate3d(0,0,0) scale(1)}18%{transform:translate3d(0,-33px,80px) rotateY(-26deg) scale(1.22);filter:brightness(1.6)}40%{transform:translate3d(18px,-62px,145px) rotateY(18deg) scale(1.55);filter:brightness(2) drop-shadow(0 0 40px var(--attack-core))}67%{transform:translate3d(105px,-18px,170px) rotateY(32deg) scale(1.62)}100%{transform:translate3d(0,0,0) scale(1);filter:brightness(1)}}
@keyframes monsterImpact{0%,36%{transform:translate3d(0,0,0) rotateY(0)}49%{transform:translate3d(19px,-19px,42px) rotateY(-18deg) rotateZ(9deg)}62%{transform:translate3d(-14px,6px,10px) rotateY(16deg) rotateZ(-7deg)}80%{transform:translate3d(8px,-5px,0) rotateZ(3deg)}100%{transform:translate3d(0,0,0)}}
@keyframes monsterSquash{0%,38%{transform:scale(1);filter:brightness(1)}52%{transform:scale(1.18,.82);filter:brightness(1.8)}68%{transform:scale(.9,1.13)}100%{transform:scale(1);filter:brightness(1)}}
@keyframes battleCamera{0%,35%,100%{transform:translate(0,0)}47%{transform:translate(-5px,3px)}52%{transform:translate(6px,-4px)}58%{transform:translate(-3px,2px)}}
@keyframes groundGlow{0%,35%,100%{filter:brightness(1)}53%{filter:brightness(1.9)}}
@keyframes groundImpact{0%,40%,100%{filter:brightness(1)}55%{filter:brightness(2)}}
@keyframes impactRing{0%,37%{opacity:0;transform:translate(-50%,-50%) scale(.15)}48%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(2.4)}}
@keyframes impactSpark{0%,37%{opacity:0;transform:scale(.2) rotate(0)}49%{opacity:1}100%{opacity:0;transform:scale(1.6) rotate(95deg)}}
@keyframes impactFlash{0%,39%,100%{opacity:0}48%{opacity:.55}60%{opacity:0}}
@keyframes powerTrail{0%{opacity:0;transform:translate(0,0) scale(.3)}30%{opacity:1}100%{opacity:0;transform:translate(900%,-50%) scale(1.5)}}
@keyframes miniHeroStrike{0%,100%{transform:translateX(0) scale(1)}45%{transform:translate(25px,-17px) scale(1.2)}}
@keyframes miniMonsterHit{0%,40%,100%{transform:translateX(0) rotate(0)}52%{transform:translateX(15px) rotate(10deg)}67%{transform:translateX(-7px) rotate(-6deg)}}
@media(max-width:600px){.battle-stage .fighter-sprite img,.battle-stage .monster-fighter .fighter-sprite img{width:82px;height:86px}.arena-impact{left:72%;top:44%}.arena-battlefield.attacking .arena-vfx::after{width:80px;height:80px}}
@media(prefers-reduced-motion:reduce){.arena-battlefield.attacking,.arena-character.wizard.casting img,.arena-battlefield.ultimate-attack .arena-character.wizard.casting img,.arena-character.enemy.taking-hit,.arena-character.enemy.taking-hit img,.arena-impact,.arena-impact::before,.arena-impact::after,.arena-battlefield.attacking .arena-vfx::before,.arena-battlefield.attacking .arena-vfx::after,.battle-stage:has(.battle-flash.burst) .fighter-sprite{animation:none!important}}
.arena-chapters{display:flex;gap:6px;overflow-x:auto;padding:3px 1px 10px;scrollbar-width:thin}
.arena-chapter{flex:none;border:1px solid #dacbea;border-radius:9px;background:#faf6ff;color:#7658ad;padding:7px 9px;font-size:11px;font-weight:900;cursor:pointer}
.arena-chapter.active{background:#7651c9;border-color:#7651c9;color:#fff}
.arena-stage-list{flex-wrap:nowrap;overflow-x:auto;padding:1px 1px 4px}
.arena-stage-button{flex:1;min-width:35px}
@media(max-width:600px){.arena-stage-button{flex:none;min-width:33px}.arena-chapter{font-size:10px;padding:6px 7px}}
