/* M0.5: distinct combat outcomes. Visual effects carry no written labels. */
.combat-figure .combat-fighter{position:relative;z-index:2}
.combat-figure .fx-afterimage{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;object-position:bottom center;opacity:0;z-index:1;filter:grayscale(1) blur(3px);pointer-events:none}
.duelist.enemy .combat-figure .fx-afterimage{transform:scaleX(-1)}
.combat-figure .fx-slash,.combat-figure .fx-shield,.combat-figure .fx-impact,.combat-figure .fx-sparks,.combat-figure .fx-rune{
 position:absolute;display:block;opacity:0;pointer-events:none;z-index:4
}
.combat-figure .fx-slash{inset:16% 1% 24%;border-top:4px solid #fff;border-right:3px solid #fff;border-radius:50%;filter:drop-shadow(0 0 6px white)}
.combat-figure .fx-shield{inset:14% 6% 21%;border:5px solid #f5f9fb;border-radius:44% 44% 52% 52%;box-shadow:0 0 18px #fff,inset 0 0 20px #ffffffab;background:radial-gradient(ellipse,#f2f7fa70,transparent 75%)}
.combat-figure .fx-shield::before{content:'';position:absolute;inset:18%;border:2px solid #ffffffac;transform:rotate(40deg);border-radius:15px}
.combat-figure .fx-impact{top:17%;left:8%;width:84%;aspect-ratio:1;border-radius:50%;border:5px solid #fff;box-shadow:0 0 20px #fff,inset 0 0 10px #fff}
.combat-figure .fx-sparks{inset:12%;background:
 radial-gradient(circle at 20% 20%,white 0 3px,transparent 4px),
 radial-gradient(circle at 82% 27%,white 0 2px,transparent 5px),
 radial-gradient(circle at 44% 52%,#fff 0 4px,transparent 6px),
 radial-gradient(circle at 14% 79%,white 0 2px,transparent 4px),
 radial-gradient(circle at 78% 77%,#dde5eb 0 3px,transparent 5px)}
.combat-figure .fx-rune{inset:17% 12% 22%;border:3px solid #dae9ff;border-radius:50%;box-shadow:0 0 17px #fff,0 0 30px #cddffd}
.combat-figure .fx-rune::before,.combat-figure .fx-rune::after{content:'';position:absolute;inset:16%;border:2px dashed #f3f7ff;border-radius:50%}
.combat-figure .fx-rune::after{inset:33%;border-style:solid}
.battle-stage .fx-magic-ray{position:absolute;z-index:3;left:24%;width:52%;top:57%;height:7px;border-radius:99px;opacity:0;pointer-events:none;transform:scaleX(.05);transform-origin:left;background:linear-gradient(90deg,transparent,#e6f2ff,#fff);box-shadow:0 0 15px #e0ecff,0 0 28px #f3f7ff}
/* Hero attacks first; enemy responds only if still able. */
.combat-fx-active.fx-attack-physical .duelist.player .combat-figure{animation:fb-hero-strike .8s ease-in-out both}
.combat-fx-active.fx-attack-physical .duelist.enemy .fx-slash{animation:fb-slash .5s ease-out .31s both}
.combat-fx-active.fx-attack-magic .duelist.player .combat-figure{animation:fb-cast .81s ease-out both}
.combat-fx-active.fx-attack-magic .fx-magic-ray{animation:fb-ray .60s ease-out .27s both}
.combat-fx-active.fx-attack-magic .duelist.enemy .fx-rune{animation:fb-rune .72s ease-out .39s both}
.combat-fx-active.fx-target-block .duelist.enemy .combat-figure{animation:fb-brace .56s ease-out .37s both}
.combat-fx-active.fx-target-block .duelist.enemy .fx-shield{animation:fb-shield .56s ease-out .37s both}
.combat-fx-active.fx-target-block .duelist.enemy .fx-sparks{animation:fb-sparks .58s ease-out .39s both}
.combat-fx-active.fx-target-hit .duelist.enemy .combat-figure{animation:fb-hit-recoil .63s ease-out .36s both}
.combat-fx-active.fx-target-crit .duelist.enemy .combat-figure{animation:fb-crit-recoil .85s ease-out .36s both}
.combat-fx-active.fx-target-hit .duelist.enemy .fx-impact{animation:fb-wave .54s ease-out .39s both}
.combat-fx-active.fx-target-crit .duelist.enemy .fx-impact{animation:fb-crit-wave .78s ease-out .39s both}
.combat-fx-active.fx-target-crit .duelist.enemy .fx-sparks{animation:fb-sparks .80s ease-out .42s both}
.combat-fx-active.fx-target-crit .battle-stage::after{content:'';position:absolute;inset:0;z-index:5;pointer-events:none;background:radial-gradient(ellipse at 80% 49%,#ffffff88,transparent 42%);animation:fb-flash .36s ease-out .42s both}
.combat-fx-active.fx-counter .duelist.enemy .combat-fighter{animation:fb-enemy-counter .65s ease-in-out .93s both}
.combat-fx-active.fx-counter .duelist.player .fx-slash{animation:fb-slash .53s ease-out 1.12s both}
.combat-fx-active.fx-return-dodge .duelist.player .combat-fighter{animation:fb-dodge .7s ease-in-out 1.10s both}
.combat-fx-active.fx-return-dodge .duelist.player .fx-afterimage{animation:fb-afterimage .67s ease-out 1.1s both}
.combat-fx-active.fx-return-block .duelist.player .combat-fighter{animation:fb-brace .63s ease-out 1.12s both}
.combat-fx-active.fx-return-block .duelist.player .fx-shield{animation:fb-shield .6s ease-out 1.16s both}
.combat-fx-active.fx-return-block .duelist.player .fx-sparks{animation:fb-sparks .61s ease-out 1.18s both}
.combat-fx-active.fx-return-hit .duelist.player .combat-fighter{animation:fb-player-recoil .61s ease-out 1.15s both}
.combat-fx-active.fx-return-crit .duelist.player .combat-fighter{animation:fb-player-critical .76s ease-out 1.15s both}
.combat-fx-active.fx-return-hit .duelist.player .fx-impact{animation:fb-wave .55s ease-out 1.2s both}
.combat-fx-active.fx-return-crit .duelist.player .fx-impact{animation:fb-crit-wave .73s ease-out 1.20s both}
.combat-fx-active.fx-return-crit .duelist.player .fx-sparks{animation:fb-sparks .7s ease-out 1.22s both}
@keyframes fb-hero-strike{0%,15%,100%{transform:translateX(0) rotate(0)}30%{transform:translateX(-7%) rotate(-5deg)}46%,54%{transform:translateX(24%) rotate(5deg)}75%{transform:translateX(-3%) rotate(-2deg)}}
@keyframes fb-cast{0%,100%{transform:translateY(0) scale(1)}30%,47%{transform:translateY(-9px) scale(1.06)}65%{transform:translateY(-4px)}}
@keyframes fb-enemy-counter{0%,100%{transform:scaleX(-1) translateX(0)}42%,55%{transform:scaleX(-1) translateX(17%) rotate(5deg)}}
@keyframes fb-hit-recoil{0%,100%{transform:translateX(0) rotate(0)}40%{transform:translateX(10%) rotate(4deg)}70%{transform:translateX(-2%)}}
@keyframes fb-crit-recoil{0%,100%{transform:translateX(0) rotate(0);filter:none}32%,44%{transform:translateX(20%) rotate(9deg);filter:brightness(1.5)}70%{transform:translateX(-4%) rotate(-3deg)}}
@keyframes fb-player-recoil{0%,100%{transform:translateX(0)}40%{transform:translateX(-12%) rotate(-4deg)}}
@keyframes fb-player-critical{0%,100%{transform:translateX(0);filter:none}35%,44%{transform:translateX(-22%) rotate(-8deg);filter:brightness(1.5)}}
@keyframes fb-brace{0%,100%{transform:scale(1)}40%{transform:scale(.95) rotate(-4deg)}}
@keyframes fb-dodge{0%,100%{transform:translateX(0);opacity:1}32%,48%{transform:translateX(-37%) rotate(-6deg);opacity:.76}75%{transform:translateX(-6%)}}
@keyframes fb-afterimage{0%,100%{opacity:0;transform:translateX(0)}38%{opacity:.55;transform:translateX(20%)}75%{opacity:.13;transform:translateX(8%)}}
@keyframes fb-slash{0%{opacity:0;transform:rotate(-55deg) scale(.2)}33%{opacity:1;transform:rotate(10deg) scale(1)}100%{opacity:0;transform:rotate(80deg) scale(1.5)}}
@keyframes fb-shield{0%{opacity:0;transform:scale(.52) rotate(-15deg)}28%,49%{opacity:.96;transform:scale(1) rotate(0)}100%{opacity:0;transform:scale(1.25) rotate(6deg)}}
@keyframes fb-wave{0%{opacity:0;transform:scale(.18)}35%{opacity:.9;transform:scale(.65)}100%{opacity:0;transform:scale(1.2)}}
@keyframes fb-crit-wave{0%{opacity:0;transform:scale(.12);border-width:10px}28%,40%{opacity:1;transform:scale(.85);border-width:6px}100%{opacity:0;transform:scale(1.7);border-width:1px}}
@keyframes fb-sparks{0%{opacity:0;transform:scale(.3)}30%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(1.8) rotate(25deg)}}
@keyframes fb-ray{0%{opacity:0;transform:scaleX(.05)}30%{opacity:1;transform:scaleX(.5)}60%{opacity:1;transform:scaleX(1)}100%{opacity:0;transform:scaleX(1)}}
@keyframes fb-rune{0%{opacity:0;transform:scale(.3) rotate(-45deg)}34%,57%{opacity:.97;transform:scale(1) rotate(0)}100%{opacity:0;transform:scale(1.4) rotate(45deg)}}
@keyframes fb-flash{0%,100%{opacity:0}40%{opacity:1}}
@media(prefers-reduced-motion:reduce){
 .battle-frame.combat-fx-active .combat-figure,
 .battle-frame.combat-fx-active .combat-fighter,
 .battle-frame.combat-fx-active .fx-slash,
 .battle-frame.combat-fx-active .fx-shield,
 .battle-frame.combat-fx-active .fx-impact,
 .battle-frame.combat-fx-active .fx-sparks,
 .battle-frame.combat-fx-active .fx-rune,
 .battle-frame.combat-fx-active .fx-afterimage,
 .battle-frame.combat-fx-active .fx-magic-ray{animation:none!important}
 .combat-fx-active.fx-target-block .duelist.enemy .fx-shield,
 .combat-fx-active.fx-return-block .duelist.player .fx-shield,
 .combat-fx-active.fx-attack-magic .duelist.enemy .fx-rune{opacity:.8}
 .combat-fx-active.fx-target-crit .duelist.enemy .fx-impact,
 .combat-fx-active.fx-return-crit .duelist.player .fx-impact{opacity:.8}
}
