/* ============ Animations / effects ============ */

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

/* Screen shake on bust */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
.shake { animation: shake 0.4s ease-in-out; }

/* Red flash on bust */
@keyframes bustFlash {
  0% { box-shadow: inset 0 0 0 0 rgba(211,47,47,0); }
  50% { box-shadow: inset 0 0 120px 20px rgba(211,47,47,0.5); }
  100% { box-shadow: inset 0 0 0 0 rgba(211,47,47,0); }
}
.bust-flash { animation: bustFlash 0.6s ease-out; }

/* Result banner slam */
@keyframes slamIn {
  0%   { transform: scale(3); opacity: 0; }
  60%  { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.result-banner {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 900;
  z-index: 50;
  animation: slamIn 0.5s ease-out;
  text-shadow: 0 4px 20px rgba(0,0,0,0.8);
  pointer-events: none;
}
.result-banner.win { color: #4caf50; }
.result-banner.blackjack { color: var(--gold); }
.result-banner.lose, .result-banner.bust { color: var(--red); }
.result-banner.push { color: var(--text-dim); }

/* Chip fly animation */
@keyframes chipFly {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--fly-x), var(--fly-y)) scale(0.4); opacity: 0; }
}

/* Confetti */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  z-index: 60;
  pointer-events: none;
  animation: confettiFall var(--confetti-duration, 3s) linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Win glow */
@keyframes winGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); }
  50%      { box-shadow: 0 0 24px 4px rgba(76,175,80,0.5); }
}
.win-glow { animation: winGlow 1s ease-in-out; }
