/* ============================================
   ANIMATIONS - All Game Animations
   ============================================ */

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

@keyframes loading {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

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

@keyframes breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) scale(1.2);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

@keyframes flash {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 10px var(--accent-gold);
  }
  50% {
    box-shadow: 0 0 30px var(--accent-gold), 0 0 50px var(--accent-gold);
  }
}

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

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

@keyframes slideIn {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

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

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

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes scaleOut {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0);
    opacity: 0;
  }
}

@keyframes rainbow {
  0% {
    color: #FF0000;
  }
  16% {
    color: #FF7F00;
  }
  33% {
    color: #FFFF00;
  }
  50% {
    color: #00FF00;
  }
  66% {
    color: #0000FF;
  }
  83% {
    color: #4B0082;
  }
  100% {
    color: #9400D3;
  }
}

/* Animation Classes */
.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-shake {
  animation: shake 0.5s;
}

.animate-flash {
  animation: flash 0.3s;
}

.animate-glow {
  animation: glow 2s infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

.animate-slide-in {
  animation: slideIn 0.3s ease-out;
}

.animate-slide-out {
  animation: slideOut 0.3s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-fade-out {
  animation: fadeOut 0.3s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.3s ease-out;
}

.animate-scale-out {
  animation: scaleOut 0.3s ease-out;
}

.animate-rainbow {
  animation: rainbow 3s linear infinite;
}

/* Screen Effects */
.screen-shake {
  animation: shake 0.5s;
}

.screen-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 215, 0, 0.3);
  pointer-events: none;
  z-index: 4000;
  animation: flash 0.3s;
}

.screen-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
  pointer-events: none;
  z-index: 4000;
  animation: glow 2s infinite;
}

/* Particle Effects */
.particle {
  position: absolute;
  pointer-events: none;
  font-size: 1.5rem;
  animation: floatUp 2s ease-out forwards;
}

.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent-gold);
  border-radius: 50%;
  pointer-events: none;
  animation: sparkle 1s ease-out forwards;
}

@keyframes sparkle {
  0% {
    opacity: 1;
    transform: scale(0) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1) rotate(180deg);
  }
  100% {
    opacity: 0;
    transform: scale(0) rotate(360deg);
  }
}

/* Celebration Animations */
.celebration-tier-1 {
  animation: scaleIn 0.5s ease-out;
}

.celebration-tier-2 {
  animation: scaleIn 0.5s ease-out, glow 1s infinite;
}

.celebration-tier-3 {
  animation: scaleIn 0.5s ease-out, glow 2s infinite, pulse 2s infinite;
}

.celebration-tier-4 {
  animation: scaleIn 0.5s ease-out, glow 2s infinite, pulse 2s infinite, shake 0.5s;
}

.celebration-tier-5 {
  animation: scaleIn 0.5s ease-out, glow 2s infinite, pulse 2s infinite, shake 0.5s, rainbow 3s linear infinite;
}

/* Combat Animations */
.attack-animation {
  animation: slideIn 0.3s ease-out;
}

.hit-animation {
  animation: shake 0.2s, flash 0.2s;
}

.critical-hit {
  animation: scaleIn 0.3s ease-out, glow 0.5s infinite, shake 0.3s;
}

.defeat-animation {
  animation: scaleOut 1s ease-out, fadeOut 1s ease-out;
}

.victory-animation {
  animation: scaleIn 1s ease-out, glow 2s infinite, bounce 1s infinite;
}

/* UI Animations */
.button-press {
  animation: scaleIn 0.1s ease-out;
}

.panel-open {
  animation: scaleIn 0.3s ease-out;
}

.panel-close {
  animation: scaleOut 0.3s ease-out;
}

/* Progress Bar Animation */
.progress-animate {
  animation: loading 1s ease-out;
}

/* Health Bar Damage Animation */
.damage-flash {
  animation: flash 0.3s;
}

/* Level Up Animation */
.level-up {
  animation: scaleIn 0.5s ease-out, glow 2s infinite, bounce 1s infinite;
}

/* Achievement Unlock Animation */
.achievement-unlock {
  animation: scaleIn 0.5s ease-out, glow 2s infinite, pulse 2s infinite;
}

/* Meditation Breathing Animation */
.breathing-in {
  animation: breathe 4s ease-in-out infinite;
}

.breathing-out {
  animation: breathe 4s ease-in-out infinite reverse;
}

