/* Screen transitions */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideUp {
  from { transform: translateY(30%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(30%); opacity: 0; }
}

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

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

.screen-enter-fade { animation: fadeIn 0.4s ease-out forwards; }
.screen-exit-fade { animation: fadeOut 0.3s ease-in forwards; }
.screen-enter-slide { animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.screen-exit-slide { animation: slideDown 0.4s ease-in forwards; }
.screen-enter-scale { animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.screen-exit-scale { animation: scaleOut 0.3s ease-in forwards; }

/* Logo animation */
@keyframes logoAppear {
  0% {
    transform: scale(0.5) translateY(20px);
    opacity: 0;
    filter: blur(10px) drop-shadow(0 0 0 transparent);
  }
  60% {
    transform: scale(1.05) translateY(-5px);
    opacity: 1;
    filter: blur(0) drop-shadow(0 0 40px rgba(79, 195, 247, 0.6));
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
    filter: drop-shadow(0 0 30px rgba(79, 195, 247, 0.4));
  }
}

.logo-animate {
  animation: logoAppear 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Timer pulse */
@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Combo flare */
@keyframes comboFlare {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); text-shadow: 0 0 20px rgba(255, 171, 0, 0.8); }
  100% { transform: scale(1); }
}

.hud-combo.active {
  animation: comboFlare 0.3s ease-out;
}

/* Shake (for errors) */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.shake {
  animation: shake 0.3s ease-out;
}

/* Score counter pulse */
@keyframes scorePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Glow pulse for buttons and elements */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(79, 195, 247, 0.2); }
  50% { box-shadow: 0 0 20px rgba(79, 195, 247, 0.4), 0 0 40px rgba(79, 195, 247, 0.1); }
}

/* Floating animation for ambient elements */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Ripple effect on button click */
@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Success/failure flash for results screen */
@keyframes successGlow {
  0% { background: rgba(0, 230, 118, 0.3); }
  100% { background: transparent; }
}

@keyframes failureGlow {
  0% { background: rgba(255, 23, 68, 0.3); }
  100% { background: transparent; }
}

/* Connection confirmed flash */
@keyframes connectionFlash {
  0% { opacity: 1; filter: brightness(2); }
  100% { opacity: 1; filter: brightness(1); }
}
