/* ==========================================================================
   Decision Arcade - Animations & Visual FX
   ========================================================================== */

/* Neon Pulsing */
@keyframes neonPulseCyan {
  0%, 100% {
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4), inset 0 0 10px rgba(0, 240, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.8), inset 0 0 20px rgba(0, 240, 255, 0.4);
  }
}

@keyframes neonPulseMagenta {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.4), inset 0 0 10px rgba(255, 0, 127, 0.2);
  }
  50% {
    box-shadow: 0 0 35px rgba(255, 0, 127, 0.85), inset 0 0 25px rgba(255, 0, 127, 0.5);
  }
}

/* Screen Shake (for pops, impacts, eliminations) */
.screen-shake-sm {
  animation: shakeSmall 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.screen-shake-lg {
  animation: shakeLarge 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeSmall {
  10%, 90% { transform: translate3d(-1px, 1px, 0); }
  20%, 80% { transform: translate3d(2px, -2px, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 2px, 0); }
  40%, 60% { transform: translate3d(3px, -1px, 0); }
}

@keyframes shakeLarge {
  10%, 90% { transform: translate3d(-4px, 3px, 0) rotate(-1deg); }
  20%, 80% { transform: translate3d(5px, -4px, 0) rotate(1deg); }
  30%, 50%, 70% { transform: translate3d(-6px, 5px, 0) rotate(-1.5deg); }
  40%, 60% { transform: translate3d(6px, -3px, 0) rotate(1.5deg); }
}

/* Flash effect */
.screen-flash-white {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  pointer-events: none;
  z-index: 50;
  animation: flashFade 0.6s ease-out forwards;
}

@keyframes flashFade {
  0% { opacity: 0.9; }
  100% { opacity: 0; }
}

/* Tension Vignette (dark red edges closing in during suspense) */
.tension-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
  opacity: 0;
  background: radial-gradient(circle at center, transparent 40%, rgba(255, 0, 80, 0.45) 100%);
  transition: opacity 0.4s ease;
}

.tension-vignette.active {
  opacity: 1;
}

/* Confetti Cannon Container */
.confetti-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 45;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 14px;
  opacity: 0.9;
  border-radius: 2px;
  animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-50px) rotate(0deg) scale(0.6);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(720deg) scale(1);
    opacity: 0;
  }
}

/* 3D Coin Flip Perspectives */
.coin-3d-wrapper {
  perspective: 1200px;
  width: 180px;
  height: 180px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coin-3d-disc {
  width: 165px;
  height: 165px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.05s linear;
  cursor: grab;
}

.coin-3d-disc:active {
  cursor: grabbing;
}

.coin-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.3);
  border: 4px solid #f6d365;
  font-family: var(--font-display);
}

.coin-front {
  background: radial-gradient(circle at 35% 35%, #ffd700, #ff8c00, #b8860b);
  transform: rotateY(0deg);
}

.coin-back {
  background: radial-gradient(circle at 35% 35%, #00ffff, #0088ff, #002288);
  border-color: #00f0ff;
  transform: rotateY(180deg);
}

.coin-face.has-photo {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.coin-face.has-photo .coin-label {
  background: rgba(10, 14, 28, 0.78);
  padding: 3px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  margin-top: auto;
  margin-bottom: 12px;
  font-size: 0.8rem;
  letter-spacing: 0.8px;
}

/* Rubber Squash & Stretch (for Balloon) */
@keyframes balloonIdle {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.02, 0.98); }
}

@keyframes balloonPumpWobble {
  0% { transform: scale(1.15, 0.88); }
  35% { transform: scale(0.92, 1.12); }
  70% { transform: scale(1.05, 0.96); }
  100% { transform: scale(1, 1); }
}

.balloon-pump-anim {
  animation: balloonPumpWobble 0.35s ease-out;
}

/* Stress Tremble during Critical Overcharge */
@keyframes stressTremble {
  0% { transform: scale(var(--b-scale, 2.2)) translate(0, 0) rotate(0deg); }
  25% { transform: scale(var(--b-scale, 2.2)) translate(-2px, 1.5px) rotate(-1deg); }
  50% { transform: scale(var(--b-scale, 2.2)) translate(1.5px, -1.5px) rotate(1deg); }
  75% { transform: scale(var(--b-scale, 2.2)) translate(-1.5px, -1px) rotate(-0.5deg); }
  100% { transform: scale(var(--b-scale, 2.2)) translate(1.5px, 1px) rotate(0.5deg); }
}

.balloon-stress-wobble {
  animation: stressTremble 0.08s infinite alternate !important;
}

/* Critical Meter Overcharge Pulse */
@keyframes criticalMeterPulse {
  0% {
    background: linear-gradient(90deg, #ff0055, #ff3300);
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.7);
  }
  100% {
    background: linear-gradient(90deg, #ff0000, #ffe600);
    box-shadow: 0 0 28px rgba(255, 0, 0, 1), inset 0 0 8px #ffffff;
  }
}

.doom-meter-critical {
  animation: criticalMeterPulse 0.28s ease-in-out infinite alternate !important;
}
