/* ============ 增加微动画体验 (animations.css) ============ */

/* 怪物/UI 受击抖动 */
.cardshake {
  animation: cardshake 0.3s cubic-bezier(.36,.07,.19,.97) both;
}
.cardshake-crit {
  animation: cardshake-crit 0.45s cubic-bezier(.36,.07,.19,.97) both;
  filter: brightness(1.3) drop-shadow(0 0 8px rgba(200,50,50,0.4));
}

@keyframes cardshake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes cardshake-crit {
  10%, 90% { transform: translate3d(-2px, -1px, 0) scale(0.98); }
  20%, 80% { transform: translate3d(3px, 2px, 0) scale(1.01); }
  30%, 50%, 70% { transform: translate3d(-6px, -3px, 0) scale(0.96); }
  40%, 60% { transform: translate3d(6px, 3px, 0) scale(1.04); }
}

/* 刀光剑影 (绝对定位覆盖在 card 上) */
.fx-slash-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
  border-radius: inherit;
}

.fx-slash {
  position: absolute;
  top: 50%; left: 50%;
  width: 150%; height: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 50%, rgba(255,255,255,0) 100%);
  box-shadow: 0 0 10px rgba(255,255,255,0.8);
  transform: translate(-50%, -50%) rotate(25deg) scaleX(0);
  opacity: 0;
  animation: slash-anim 0.25s ease-out forwards;
}

.fx-slash-skill {
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, #7ec8ff 50%, rgba(0,0,0,0) 100%);
  box-shadow: 0 0 10px #7ec8ff, 0 0 20px #7ec8ff;
  animation: slash-skill-anim 0.3s ease-out forwards;
}

@keyframes slash-anim {
  0% { transform: translate(-50%, -50%) rotate(25deg) scaleX(0); opacity: 1; }
  50% { transform: translate(-50%, -50%) rotate(25deg) scaleX(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(25deg) scaleX(1.2) scaleY(0.1); opacity: 0; }
}
@keyframes slash-skill-anim {
  0% { transform: translate(-50%, -50%) rotate(-35deg) scaleX(0); opacity: 1; }
  50% { transform: translate(-50%, -50%) rotate(-35deg) scaleX(1.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(-35deg) scaleX(1.5) scaleY(0.1); opacity: 0; }
}

/* 全屏屏幕闪爆 (挂在 body 或 fxLayer 上) */
.screen-flash {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: white;
  z-index: 99999;
  pointer-events: none;
  animation: screen-flash-anim 0.4s ease-out forwards;
}

@keyframes screen-flash-anim {
  0% { opacity: 0.8; }
  100% { opacity: 0; }
}

/* 传说爆率光环加强 */
.fx-legend {
  animation: legend-pulse 2s infinite alternate;
  position: relative;
  overflow: hidden;
}
.fx-legend::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 200vw; height: 100px;
  background: linear-gradient(90deg, rgba(255,138,60,0) 0%, rgba(255,138,60,0.3) 50%, rgba(255,138,60,0) 100%);
  transform: translate(-50%, -50%) rotate(15deg);
  pointer-events: none;
  animation: legend-ray 3s linear infinite;
  z-index: -1;
}

@keyframes legend-pulse {
  0% { box-shadow: 0 0 20px rgba(255,138,60,0.5), inset 0 0 20px rgba(255,138,60,0.5); }
  100% { box-shadow: 0 0 50px rgba(255,138,60,1), inset 0 0 40px rgba(255,138,60,0.8); }
}
@keyframes legend-ray {
  0% { transform: translate(-50%, -50%) rotate(0deg); opacity: 0.5; }
  50% { opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(180deg); opacity: 0.5; }
}

@keyframes monsterPopIn {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes monsterFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* 怪物立绘框 */
.monster-image {
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: monsterPopIn 0.4s ease-out, monsterFloat 3s ease-in-out infinite 0.4s;
}
.monster-image svg,
.monster-image i.ra {
  line-height: 1;
  display: inline-block;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,0.8));
  transition: all 0.3s ease;
}
.monster-image svg.boss,
.monster-image i.ra.boss {
  filter: drop-shadow(0 0 15px rgba(255, 64, 64, 0.6)) drop-shadow(0 8px 10px rgba(0,0,0,0.9));
}
