/* ==========================================================================
   Fire 协议卡牌焚烧特效 (Fire: Burn / Discard / Delete)
   动画时长: 1.2s 单次播放
   ========================================================================== */

/* 处于焚烧状态的卡牌宿主容器 */
.card-burning {
  position: relative;
  pointer-events: none;
  overflow: visible !important;
  animation: cardCharAndDissolve 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 卡牌本体炭化、黑化、上浮解体动画 */
@keyframes cardCharAndDissolve {
  0% {
    filter: brightness(1) drop-shadow(0 0 0 rgba(255, 107, 0, 0));
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  25% {
    filter: brightness(1.4) drop-shadow(0 0 15px rgba(255, 107, 0, 0.8));
    transform: scale(1.02) translateY(-2px);
  }
  60% {
    filter: brightness(0.4) contrast(1.8) drop-shadow(0 -10px 25px rgba(255, 208, 0, 0.9));
    opacity: 0.85;
  }
  85% {
    filter: brightness(0.1) contrast(2) drop-shadow(0 -20px 30px rgba(196, 30, 0, 0.5));
    transform: scale(0.96) translateY(-8px);
    opacity: 0.35;
  }
  100% {
    filter: brightness(0) blur(4px);
    transform: scale(0.92) translateY(-16px);
    opacity: 0;
  }
}

/* 火焰与火星容器（覆盖在卡牌之上） */
.fire-burn-overlay {
  position: absolute;
  inset: -10px;
  pointer-events: none;
  z-index: 20;
}

/* 底层自下而上的火舌波浪层 */
.fire-burn-flame {
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(
    0deg,
    rgba(255, 208, 0, 0.95) 0%,
    rgba(255, 107, 0, 0.8) 40%,
    rgba(196, 30, 0, 0.4) 75%,
    rgba(26, 26, 26, 0) 100%
  );
  filter: blur(4px);
  mix-blend-mode: screen;
  transform-origin: bottom center;
  animation: flameSurge 1.2s ease-out forwards;
}

@keyframes flameSurge {
  0% {
    transform: scaleY(0);
    opacity: 0;
  }
  30% {
    transform: scaleY(0.7) skewX(-2deg);
    opacity: 1;
  }
  70% {
    transform: scaleY(1.1) skewX(2deg);
    opacity: 0.85;
  }
  100% {
    transform: scaleY(1.3) translateY(-20px);
    opacity: 0;
  }
}

/* 飞散上升的火星粒子 (Sparks) */
.fire-burn-sparks {
  position: absolute;
  inset: 0;
}

.fire-spark {
  position: absolute;
  bottom: 10%;
  width: 4px;
  height: 4px;
  background-color: #ffd000;
  border-radius: 50%;
  box-shadow: 0 0 6px #ff6b00, 0 0 10px #c41e00;
  opacity: 0;
  animation: sparkFly 1s ease-out forwards;
}

/* 错落的火星粒子位置与时间差 */
.fire-spark:nth-child(1) { left: 20%; animation-delay: 0.1s; --tx: -15px; --ty: -110px; }
.fire-spark:nth-child(2) { left: 45%; animation-delay: 0.2s; --tx: 8px;   --ty: -140px; width: 6px; height: 6px; }
.fire-spark:nth-child(3) { left: 70%; animation-delay: 0.15s; --tx: 20px;  --ty: -100px; }
.fire-spark:nth-child(4) { left: 35%; animation-delay: 0.35s; --tx: -25px; --ty: -130px; }
.fire-spark:nth-child(5) { left: 80%; animation-delay: 0.25s; --tx: 10px;  --ty: -90px; }

@keyframes sparkFly {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  60% {
    opacity: 1;
    transform: translate(var(--tx), calc(var(--ty) * 0.6)) scale(1.2);
  }
  100% {
    transform: translate(calc(var(--tx) * 1.5), var(--ty)) scale(0.2);
    opacity: 0;
  }
}