/* ============================================================================
   英语小精灵 · 战斗动效样式
   对齐 Views/PixelFxSheet.cs（精灵表逐帧）/ ElementFx.cs（飞行体、命中爆发）
   / ActionAnim.cs（速度线、震屏）/ BattleWindow.cs（伤害飘字）
   ============================================================================ */

/* 立绘居中原本靠 transform:translateX(-50%)，会与 WAAPI 动作变换抢 transform。
   改由 left 计算居中，位移/旋转/缩放动画才能自由叠加。 */
.fighter-art .sprite { transform: none; left: calc(50% - 85px); }
.fighter-art.enemy .sprite { transform: none; left: calc(50% - 75px); }

/* 第 217 批起桌面版删除代码呼吸/眨眼：动作只来自帧图 */
.sprite-breathe { animation: none; }

/* 受击：白覆盖层(0→170/255) + Squash(1.18,.82 → 1,1) 260ms，帧循环不中断。
   用独立的 scale / rotate 属性，避免与动作 WAAPI 的 transform 抢同一个属性。 */
.sprite-hit {
  animation: sprite-hit .26s cubic-bezier(.2,.9,.3,1.3);
  filter: brightness(1.85) drop-shadow(0 0 10px #fff);
}
@keyframes sprite-hit {
  0%   { scale: 1.18 .82 }
  100% { scale: 1 1 }
}

/* 倒地：Squash(1,1 → 1.4,.1) + 旋转 -18° + 650ms 淡出（MonsterSprite.PlayDeath） */
.sprite-faint { animation: sprite-faint .65s cubic-bezier(.3,.2,.7,1) forwards; }
@keyframes sprite-faint {
  0%   { scale: 1 1; rotate: 0deg; opacity: 1 }
  100% { scale: 1.4 .1; rotate: -18deg; opacity: 0 }
}

/* ---- 出招播报 / 技能提示（BattleWindow.ShowCastBanner / EnemySkillLine）---- */
/* BattleWindow.ShowCastBanner：两行播报，摆在名牌区下方 / 题区上方的空白带（Canvas.Top=238） */
.fx-banner {
  position: absolute; left: 50%; top: 30.5%; transform: translateX(-50%);
  padding: 5px 24px 7px; border-radius: 18px; text-align: center;
  background: rgba(11,108,122,.91); border: 1.5px solid #7DD3FC;
  color: #fff; white-space: nowrap;
  pointer-events: none; z-index: 9500;
}
.fx-banner.monster { background: rgba(153,43,43,.91); border-color: #FFA4A4; }
.fx-banner .fb-head { font-size: 15px; font-weight: 600; opacity: .94; line-height: 1.2; }
.fx-banner .fb-skill { font-size: 26px; font-weight: 900; line-height: 1.25; }
.fx-skillnote {
  position: absolute; left: 50%; top: 25.5%; transform: translateX(-50%);
  color: #FFE9A8; font-size: 15px; font-weight: 900; white-space: nowrap;
  text-shadow: 0 2px 0 rgba(60,30,0,.65), 0 0 10px rgba(255,120,0,.75);
  pointer-events: none; z-index: 9550;
}

/* ---- 命中冲击：空心环 + 6 颗粒子 + 落地尘土（ActionAnim.SpawnImpact / SpawnSmear）---- */
.fx-ring {
  position: absolute; border-radius: 50%; border: 5px solid currentColor;
  transform: translate(-50%,-50%); pointer-events: none; z-index: 68;
  box-shadow: 0 0 18px currentColor;
}
.fx-particle {
  position: absolute; width: 8px; height: 8px; border-radius: 50%;
  transform: translate(-50%,-50%); pointer-events: none; z-index: 69;
}
.fx-dust {
  position: absolute; height: 10px; border-radius: 50%;
  filter: blur(3px); opacity: .55; pointer-events: none; z-index: 52;
}

/* ---- pixelfx 精灵表播放器 ---- */
.fx-sheet {
  position: absolute;
  background-repeat: no-repeat;
  pointer-events: none;
  image-rendering: auto;
  will-change: background-position;
}
.fx-sheet-fly { position: relative; left: 0 !important; top: 0 !important; }

/* 飞行体外框：动画从这里飞到命中点 */
.fx-projectile {
  position: absolute;
  pointer-events: none;
  z-index: 60;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.fx-projectile .fx-sheet-fly { transform-origin: 50% 50%; }

/* 拖尾粒子 */
.fx-mote {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 55;
  transform: translate(-50%, -50%);
  filter: blur(1px);
}

/* 命中斩击弧光 */
.fx-slash {
  position: absolute;
  display: block;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .95);
  border-bottom-color: rgba(140, 230, 255, .15);
  border-right-color: rgba(140, 230, 255, .45);
  box-shadow: 0 0 14px rgba(255, 255, 255, .85);
  pointer-events: none;
  z-index: 70;
}

/* 迸散星点 */
.fx-spark {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 25%, #FFE38A 60%, transparent 75%);
  pointer-events: none;
  z-index: 72;
}

/* 伤害飘字（无底色，贴目标立绘右上角） */
.fx-dmg {
  position: absolute;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 30px;
  font-weight: 900;
  color: #FF3B5C;
  -webkit-text-stroke: 1px #fff;
  text-shadow: 0 3px 0 rgba(20, 40, 70, .35), 0 0 12px rgba(255, 255, 255, .8);
  white-space: nowrap;
  pointer-events: none;
  z-index: 9700;
}
.fx-dmg.crit { font-size: 42px; color: #FFB000; text-shadow: 0 0 16px #FFE27A, 0 3px 0 #A55C00; }
.fx-dmg.heal { color: #22C88A; }

/* 速度线（ActionAnim.SpawnSmear） */
.fx-smear {
  position: absolute;
  height: 3px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 50;
  opacity: .8;
  filter: blur(.5px);
}

/* 全屏白闪 */
.fx-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  pointer-events: none;
  z-index: 9999;
}

/* 兼容旧光球 / 飘字 */
.fx-bolt { position: absolute; width: 54px; height: 54px; border-radius: 50%; }
.fx-float { position: absolute; font-weight: 800; font-size: 22px; color: #fff; }

/* 尊重系统「减少动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  .sprite-breathe, .sprite-hit { animation-duration: .01ms; }
  .fx-sheet { will-change: auto; }
}
