/* Win Animation Tiers */

/* Tier 1: Three of a Kind - Yellow glow */
.card.win-tier-1 {
  animation: yellowGlow 1s ease-in-out;
}

@keyframes yellowGlow {
  0%, 100% {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 255, 0, 0.8);
  }
}

/* Tier 2: Straight/Flush - Yellow glow + pulse */
.card.win-tier-2 {
  animation: yellowPulse 1.5s ease-in-out;
}

@keyframes yellowPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }
  25%, 75% {
    transform: scale(1.05);
    box-shadow: 0 0 35px rgba(255, 255, 0, 0.9);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 40px rgba(255, 255, 0, 1);
  }
}

/* Tier 3: Full House/Four of a Kind - Gold glow + pulse + bounce */
.card.win-tier-3 {
  animation: goldBounce 2s ease-in-out;
}

@keyframes goldBounce {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }
  15%, 35%, 55%, 75% {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.9);
  }
  25%, 45%, 65%, 85% {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.8);
  }
  50% {
    transform: translateY(-20px) scale(1.1);
    box-shadow: 0 0 50px rgba(255, 215, 0, 1);
  }
}

/* Tier 4: Straight Flush/Five of a Kind - Gold + sparkle */
.card.win-tier-4 {
  animation: goldSparkle 2.5s ease-in-out;
  position: relative;
}

@keyframes goldSparkle {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }
  25% {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 0 50px rgba(255, 215, 0, 1);
  }
  50% {
    transform: scale(1.15) rotate(-2deg);
    box-shadow: 0 0 60px rgba(255, 215, 0, 1), 0 0 80px rgba(255, 215, 0, 0.5);
  }
  75% {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 0 50px rgba(255, 215, 0, 1);
  }
}

/* Tier 5: Wild Royal/Four Deuces - Rainbow glow */
.card.win-tier-5 {
  animation: rainbowGlow 3s ease-in-out;
}

@keyframes rainbowGlow {
  0%, 100% {
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.8);
    transform: scale(1) rotate(0deg);
  }
  16% {
    box-shadow: 0 0 40px rgba(255, 127, 0, 0.8);
    transform: scale(1.1) rotate(5deg);
  }
  33% {
    box-shadow: 0 0 40px rgba(255, 255, 0, 0.8);
    transform: scale(1.15) rotate(-5deg);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 255, 0, 0.8);
    transform: scale(1.2) rotate(5deg);
  }
  66% {
    box-shadow: 0 0 40px rgba(0, 0, 255, 0.8);
    transform: scale(1.15) rotate(-5deg);
  }
  83% {
    box-shadow: 0 0 40px rgba(139, 0, 255, 0.8);
    transform: scale(1.1) rotate(5deg);
  }
}

/* Tier 6: Natural Royal - All effects + screen flash */
.card.win-tier-6 {
  animation: epicWin 4s ease-in-out;
}

@keyframes epicWin {
  0%, 100% {
    box-shadow: 0 0 50px rgba(255, 215, 0, 1);
    transform: scale(1) rotate(0deg);
  }
  10%, 30%, 50%, 70%, 90% {
    box-shadow: 0 0 80px rgba(255, 215, 0, 1), 0 0 120px rgba(255, 255, 255, 0.8);
    transform: scale(1.2) rotate(10deg) translateY(-30px);
  }
  20%, 40%, 60%, 80% {
    box-shadow: 0 0 60px rgba(255, 0, 0, 1), 0 0 100px rgba(255, 255, 0, 0.8);
    transform: scale(1.15) rotate(-10deg) translateY(-20px);
  }
  50% {
    box-shadow: 0 0 100px rgba(255, 215, 0, 1), 0 0 150px rgba(255, 255, 255, 1);
    transform: scale(1.3) rotate(0deg) translateY(-40px);
  }
}

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  opacity: 0;
  animation: confettiFall 3s ease-in forwards;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

/* Screen Flash */
.screen-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 998;
}

.screen-flash.flash {
  animation: flashScreen 0.5s ease-out;
}

@keyframes flashScreen {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
  }
}

/* Utility Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

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

/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card.win-tier-1,
  .card.win-tier-2,
  .card.win-tier-3,
  .card.win-tier-4,
  .card.win-tier-5,
  .card.win-tier-6 {
    animation: simpleGlow 0.5s ease-in-out;
  }

  @keyframes simpleGlow {
    0%, 100% {
      box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }
    50% {
      box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    }
  }

  .confetti {
    display: none;
  }

  .screen-flash.flash {
    animation: none;
  }
}
