/* Survivor Arena - Keyframe Animations */

/* ============================================================
   19. KEYFRAME ANIMATIONS
   ============================================================ */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes particleDrift {
  0% {
    background-position:
      0 0, 0 0, 0 0, 0 0, 0 0;
  }
  100% {
    background-position:
      200px 300px, -250px 200px, 300px -250px, -180px 280px, 220px -180px;
  }
}

@keyframes titlePulse {
  0%, 100% {
    text-shadow:
      0 0 10px var(--primary-glow),
      0 0 30px var(--primary-dim),
      0 0 60px rgba(0, 240, 255, 0.15),
      0 2px 4px rgba(0, 0, 0, 0.5);
  }
  50% {
    text-shadow:
      0 0 14px var(--primary-glow),
      0 0 40px var(--primary-dim),
      0 0 80px rgba(0, 240, 255, 0.2),
      0 2px 4px rgba(0, 0, 0, 0.5);
  }
}

/* Health bar - low HP pulsing glow */
@keyframes healthLowPulse {
  0%, 100% {
    opacity: 1;
    filter: brightness(1);
  }
  50% {
    opacity: 0.75;
    filter: brightness(1.3);
  }
}

/* Health container - critical HP glow */
@keyframes healthContainerPulse {
  0%, 100% {
    box-shadow:
      0 0 16px rgba(255, 51, 68, 0.25),
      0 0 32px rgba(255, 51, 68, 0.1),
      0 2px 12px rgba(0, 0, 0, 0.5),
      inset 0 0 8px rgba(255, 51, 68, 0.1);
  }
  50% {
    box-shadow:
      0 0 24px rgba(255, 51, 68, 0.4),
      0 0 48px rgba(255, 51, 68, 0.15),
      0 2px 12px rgba(0, 0, 0, 0.5),
      inset 0 0 12px rgba(255, 51, 68, 0.15);
  }
}

/* Damage flash on health bar */
@keyframes damageFlash {
  0% {
    filter: brightness(2) saturate(0.5);
  }
  50% {
    filter: brightness(1.5) saturate(0.8);
  }
  100% {
    filter: brightness(1) saturate(1);
  }
}

/* Shimmer on health bar */
@keyframes healthShimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

/* XP gradient flow animation */
@keyframes xpGradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* XP level up flash */
@keyframes xpLevelUpFlash {
  0% {
    filter: brightness(1);
    box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.5);
  }
  30% {
    filter: brightness(2);
    box-shadow: 0 0 20px 6px rgba(0, 240, 255, 0.4);
  }
  100% {
    filter: brightness(1);
    box-shadow: 0 0 0 0 rgba(0, 240, 255, 0);
  }
}

/* XP container flash on level up */
@keyframes xpContainerFlash {
  0% {
    border-color: rgba(0, 240, 255, 0.6);
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.35);
  }
  100% {
    border-color: rgba(0, 240, 255, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  }
}

@keyframes xpPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 16px 4px rgba(0, 240, 255, 0.3);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 240, 255, 0);
  }
}

/* Gold counter bump */
@keyframes goldBump {
  0% { transform: scale(1); }
  30% { transform: scale(1.2); border-color: rgba(255, 215, 0, 0.6); }
  100% { transform: scale(1); }
}

/* Kill counter bump */
@keyframes killBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Legendary weapon glow */
@keyframes legendaryWeaponGlow {
  0%, 100% {
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 22px rgba(255, 215, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.4);
  }
}

@keyframes levelupCardEntrance {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes deathFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes deathRedPulse {
  0%, 100% {
    background:
      radial-gradient(ellipse at center, rgba(180, 0, 20, 0.2) 0%, transparent 70%),
      rgba(0, 0, 0, 0.85);
  }
  50% {
    background:
      radial-gradient(ellipse at center, rgba(200, 0, 25, 0.28) 0%, transparent 70%),
      rgba(0, 0, 0, 0.85);
  }
}

@keyframes deathContainerEntrance {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes legendaryShimmer {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes leaderboardSlideIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes damageFloat {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(0.7);
  }
}

@keyframes notificationSlideIn {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0); }
  50% { box-shadow: 0 0 20px 4px rgba(0, 240, 255, 0.15); }
}

/* HUD show/hide fade */
@keyframes hudFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hudFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-6px); }
}

/* Kill milestone (every 50 kills) - bigger pulse + glow */
@keyframes killMilestone {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
  30% { transform: scale(1.35); box-shadow: 0 0 24px rgba(255, 215, 0, 0.5); }
  60% { transform: scale(1.1); box-shadow: 0 0 12px rgba(255, 215, 0, 0.3); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

/* Timer warning (30s before zone shrink) */
@keyframes timerWarning {
  0%, 100% { color: var(--text-primary); border-color: rgba(255, 200, 0, 0.3); }
  50% { color: #ffcc00; border-color: rgba(255, 200, 0, 0.6); }
}

/* Timer danger (zone is shrinking) */
@keyframes timerDanger {
  0%, 100% {
    color: var(--health-low);
    border-color: rgba(255, 51, 68, 0.4);
    box-shadow: 0 0 12px rgba(255, 51, 68, 0.2), 0 4px 16px rgba(0, 0, 0, 0.4);
  }
  50% {
    color: #ff6677;
    border-color: rgba(255, 51, 68, 0.7);
    box-shadow: 0 0 20px rgba(255, 51, 68, 0.35), 0 4px 16px rgba(0, 0, 0, 0.4);
  }
}
