/* ===== BINGO BATTLE ROYALE - EPIC ANIMATIONS CSS ===== */
/* Phase 6: Game Show Polish */

/* ==========================================
   SCREEN SHAKE EFFECTS
   ========================================== */
@keyframes shakeLight {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-3px); }
  40%, 80% { transform: translateX(3px); }
}

@keyframes shakeMedium {
  0%, 100% { transform: translateX(0) translateY(0); }
  10%, 50%, 90% { transform: translateX(-5px) translateY(2px); }
  30%, 70% { transform: translateX(5px) translateY(-2px); }
}

@keyframes shakeHeavy {
  0%, 100% { transform: translateX(0) translateY(0) rotate(0); }
  10%, 50%, 90% { transform: translateX(-8px) translateY(4px) rotate(-1deg); }
  30%, 70% { transform: translateX(8px) translateY(-4px) rotate(1deg); }
}

@keyframes shakeEpic {
  0%, 100% { transform: translateX(0) translateY(0) rotate(0) scale(1); }
  10% { transform: translateX(-10px) translateY(5px) rotate(-2deg) scale(1.01); }
  30% { transform: translateX(10px) translateY(-5px) rotate(2deg) scale(0.99); }
  50% { transform: translateX(-8px) translateY(3px) rotate(-1deg) scale(1.01); }
  70% { transform: translateX(8px) translateY(-3px) rotate(1deg) scale(0.99); }
  90% { transform: translateX(-5px) translateY(2px) rotate(0) scale(1); }
}

body.shake-light { animation: shakeLight 0.3s ease-out; }
body.shake-medium { animation: shakeMedium 0.4s ease-out; }
body.shake-heavy { animation: shakeHeavy 0.5s ease-out; }
body.shake-epic { animation: shakeEpic 0.7s ease-out; }

/* Sound pulse indicator */
.soundPulse {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-size: 24px;
  opacity: 0;
  animation: soundPulse 0.5s ease-out forwards;
  z-index: 99999;
  pointer-events: none;
}

@keyframes soundPulse {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* ==========================================
   BINGO BALL ANIMATION
   ========================================== */
.animatedBall {
  position: fixed;
  top: 50%;
  left: -200px;
  width: 140px;
  height: 140px;
  z-index: 10000;
  transform: translateY(-50%);
  pointer-events: none;
}

.animatedBall .ballInner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #f0f0f0 40%, #d0d0d0 100%);
  box-shadow: 
    0 8px 30px rgba(0, 0, 0, 0.4),
    inset 0 -15px 30px rgba(0, 0, 0, 0.2),
    inset 0 10px 20px rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.animatedBall .ballInner::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 20%;
  width: 25%;
  height: 20%;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  filter: blur(5px);
}

.animatedBall .ballLetter {
  font-size: 24px;
  font-weight: 950;
  color: #14121a;
  line-height: 1;
}

.animatedBall .ballNumber {
  font-size: 52px;
  font-weight: 950;
  color: #14121a;
  line-height: 1;
}

/* Ball color stripes */
.animatedBall.ball-blue .ballInner {
  background: radial-gradient(circle at 30% 30%, #6699ff 0%, #2f7bff 40%, #1a5fd4 100%);
}
.animatedBall.ball-blue .ballLetter,
.animatedBall.ball-blue .ballNumber { color: #ffffff; }

.animatedBall.ball-red .ballInner {
  background: radial-gradient(circle at 30% 30%, #ff7777 0%, #ff3b3b 40%, #cc2222 100%);
}
.animatedBall.ball-red .ballLetter,
.animatedBall.ball-red .ballNumber { color: #ffffff; }

.animatedBall.ball-white .ballInner {
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #f0f0f0 40%, #d0d0d0 100%);
}

.animatedBall.ball-green .ballInner {
  background: radial-gradient(circle at 30% 30%, #66dd88 0%, #19c37d 40%, #15a066 100%);
}
.animatedBall.ball-green .ballLetter,
.animatedBall.ball-green .ballNumber { color: #ffffff; }

.animatedBall.ball-gold .ballInner {
  background: radial-gradient(circle at 30% 30%, #f6d27a 0%, #d6b25e 40%, #b8972e 100%);
}
.animatedBall.ball-gold .ballLetter,
.animatedBall.ball-gold .ballNumber { color: #14121a; }

/* Ball roll animation */
@keyframes ballRoll {
  0% {
    left: -200px;
    transform: translateY(-50%) rotate(-720deg) scale(0.5);
    opacity: 0;
  }
  20% {
    opacity: 1;
    transform: translateY(-50%) rotate(-360deg) scale(1);
  }
  40% {
    left: 50%;
    transform: translateX(-50%) translateY(-50%) rotate(0deg) scale(1.2);
  }
  50% {
    left: 50%;
    transform: translateX(-50%) translateY(-50%) rotate(0deg) scale(1.15);
  }
  100% {
    left: 50%;
    transform: translateX(-50%) translateY(-50%) rotate(0deg) scale(1);
  }
}

.animatedBall.rolling {
  animation: ballRoll 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animatedBall.fadeOut {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

/* Compact ball flash for players */
.compactBallFlash {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  padding: 12px 24px;
  background: linear-gradient(135deg, #f6d27a, #d6b25e);
  border-radius: 50px;
  font-size: 28px;
  font-weight: 950;
  color: #14121a;
  box-shadow: 0 8px 30px rgba(214, 178, 94, 0.5);
  z-index: 10000;
  animation: compactFlash 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes compactFlash {
  0% { transform: translateX(-50%) translateY(-100%); }
  15%, 85% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(-50%) translateY(-100%); opacity: 0; }
}

/* ==========================================
   WHEEL SPIN ANIMATION
   ========================================== */
.wheelOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(20, 18, 26, 0.95), rgba(0, 0, 0, 0.98));
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.wheelOverlay.fadeOut {
  animation: fadeOut 0.5s ease-out forwards;
}

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

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

.wheelContainer {
  text-align: center;
}

.wheelTitle {
  font-size: 32px;
  font-weight: 950;
  color: var(--gold, #d6b25e);
  margin-bottom: 30px;
  text-shadow: 0 0 40px rgba(214, 178, 94, 0.5);
  animation: titlePulse 1s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { text-shadow: 0 0 40px rgba(214, 178, 94, 0.5); transform: scale(1); }
  50% { text-shadow: 0 0 80px rgba(214, 178, 94, 0.8); transform: scale(1.02); }
}

.wheelFrame {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 0 auto 30px;
}

.wheelPointer {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 40px;
  color: var(--gold, #d6b25e);
  z-index: 10;
  filter: drop-shadow(0 0 10px rgba(214, 178, 94, 0.8));
  animation: pointerBounce 0.5s ease-in-out infinite;
}

@keyframes pointerBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(5px); }
}

.wheelDisc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  border: 8px solid var(--gold, #d6b25e);
  box-shadow: 
    0 0 40px rgba(214, 178, 94, 0.4),
    inset 0 0 40px rgba(0, 0, 0, 0.3);
}

.wheelSliceLabel {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 50%;
  transform-origin: bottom center;
  display: flex;
  justify-content: center;
  padding-top: 20px;
}

.wheelSliceLabel span {
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.wheelResult {
  opacity: 0;
  transform: scale(0.5) translateY(20px);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wheelResult.show {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.resultLabel {
  font-size: 14px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 8px;
}

.resultValue {
  font-size: 48px;
  font-weight: 950;
  text-shadow: 0 0 40px currentColor;
}

/* ==========================================
   VICTORY CELEBRATION
   ========================================== */
.victoryOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(214, 178, 94, 0.15), rgba(0, 0, 0, 0.98));
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.victoryOverlay.show {
  opacity: 1;
}

.victoryOverlay.fadeOut {
  opacity: 0;
}

.victoryContent {
  text-align: center;
  position: relative;
  z-index: 2;
  animation: victoryBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes victoryBounce {
  0% { transform: scale(0) rotate(-10deg); opacity: 0; }
  60% { transform: scale(1.1) rotate(3deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.victoryConfetti {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.confettiPiece {
  position: absolute;
  top: -20px;
  left: var(--x);
  width: 12px;
  height: 18px;
  animation: confettiFall var(--duration, 3s) linear var(--delay, 0s) forwards;
  transform: rotate(var(--rotation, 0deg));
}

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

.victoryTrophy {
  font-size: 120px;
  margin-bottom: 20px;
  animation: trophyBounce 1s ease-in-out infinite;
  filter: drop-shadow(0 0 40px rgba(214, 178, 94, 0.8));
}

@keyframes trophyBounce {
  0%, 100% { transform: scale(1) rotate(-5deg); }
  25% { transform: scale(1.1) rotate(0deg); }
  50% { transform: scale(1) rotate(5deg); }
  75% { transform: scale(1.1) rotate(0deg); }
}

.victoryTitle {
  font-size: 100px;
  font-weight: 950;
  color: var(--gold, #d6b25e);
  text-shadow: 
    0 0 60px rgba(214, 178, 94, 0.8),
    0 4px 0 #b8972e,
    0 8px 0 #8a6f1e;
  letter-spacing: 15px;
  margin-bottom: 10px;
  animation: titleFlash 0.5s ease-in-out infinite alternate;
}

@keyframes titleFlash {
  from { text-shadow: 0 0 60px rgba(214, 178, 94, 0.8), 0 4px 0 #b8972e, 0 8px 0 #8a6f1e; }
  to { text-shadow: 0 0 100px rgba(214, 178, 94, 1), 0 4px 0 #d6b25e, 0 8px 0 #b8972e; }
}

.victoryWinner {
  font-size: 56px;
  font-weight: 950;
  color: var(--white, #f2f2f2);
  margin: 20px 0 10px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.victoryCard {
  font-size: 24px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 15px;
}

.victoryTagline {
  font-size: 20px;
  font-style: italic;
  color: var(--gold, #d6b25e);
  opacity: 0.9;
  margin-bottom: 30px;
}

.victoryClose {
  padding: 18px 50px;
  font-size: 20px;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(25, 195, 125, 0.3), rgba(25, 195, 125, 0.1));
  border: 3px solid rgba(25, 195, 125, 0.6);
  border-radius: 50px;
  color: #88ffcc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.victoryClose:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(25, 195, 125, 0.4);
  background: linear-gradient(135deg, rgba(25, 195, 125, 0.4), rgba(25, 195, 125, 0.2));
}

/* ==========================================
   CRY WOLF EFFECT
   ========================================== */
.cryWolfOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(139, 0, 0, 0.9), rgba(50, 0, 0, 0.98));
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.cryWolfOverlay.show {
  opacity: 1;
}

.cryWolfOverlay.fadeOut {
  opacity: 0;
}

.cryWolfContent {
  text-align: center;
  animation: cryWolfShake 0.5s ease-out;
}

@keyframes cryWolfShake {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-20px) rotate(-3deg); }
  40% { transform: translateX(20px) rotate(3deg); }
  60% { transform: translateX(-15px) rotate(-2deg); }
  80% { transform: translateX(15px) rotate(2deg); }
}

.cryWolfIcon {
  font-size: 100px;
  margin-bottom: 20px;
  animation: wolfHowl 1s ease-in-out infinite;
}

@keyframes wolfHowl {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2) rotate(-10deg); }
}

.cryWolfTitle {
  font-size: 72px;
  font-weight: 950;
  color: #ff4444;
  text-shadow: 0 0 60px rgba(255, 0, 0, 0.8);
  margin-bottom: 20px;
}

.cryWolfName {
  font-size: 36px;
  font-weight: 900;
  color: var(--white, #f2f2f2);
  margin-bottom: 10px;
}

.cryWolfCard {
  font-size: 24px;
  font-weight: 800;
  color: #ff8888;
  margin-bottom: 20px;
}

.cryWolfSub {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
}

/* ==========================================
   SPIN MOMENT ALERT
   ========================================== */
.spinMomentAlert {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 200, 0, 0.3), rgba(255, 100, 0, 0.3));
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: flashIn 0.2s ease-out, flashPulse 0.5s ease-in-out 0.2s infinite;
  pointer-events: none;
}

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

@keyframes flashPulse {
  0%, 100% { background: linear-gradient(135deg, rgba(255, 200, 0, 0.3), rgba(255, 100, 0, 0.3)); }
  50% { background: linear-gradient(135deg, rgba(255, 200, 0, 0.5), rgba(255, 100, 0, 0.5)); }
}

.spinMomentAlert.fadeOut {
  animation: fadeOut 0.5s ease-out forwards;
}

.spinMomentContent {
  display: flex;
  align-items: center;
  gap: 20px;
  animation: spinMomentPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.spinMomentIcon {
  font-size: 60px;
  animation: iconZap 0.3s ease-in-out infinite alternate;
}

@keyframes iconZap {
  from { transform: scale(1) rotate(-10deg); }
  to { transform: scale(1.2) rotate(10deg); }
}

.spinMomentText {
  font-size: 56px;
  font-weight: 950;
  color: var(--white, #f2f2f2);
  text-shadow: 0 0 40px rgba(255, 200, 0, 1);
  letter-spacing: 5px;
}

/* ==========================================
   ELIMINATION FLASH
   ========================================== */
.eliminationFlash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(139, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: elimFlash 0.1s ease-out;
  pointer-events: none;
}

@keyframes elimFlash {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0.9; }
}

.eliminationFlash.fadeOut {
  animation: fadeOut 0.5s ease-out forwards;
}

.eliminationContent {
  text-align: center;
  animation: elimPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes elimPop {
  0% { transform: scale(0.5) rotate(-5deg); }
  100% { transform: scale(1) rotate(0); }
}

.eliminationIcon {
  font-size: 80px;
  display: block;
  margin-bottom: 20px;
}

.eliminationText {
  font-size: 42px;
  font-weight: 950;
  color: #ff6666;
  text-shadow: 0 0 30px rgba(255, 0, 0, 0.8);
}

/* ==========================================
   HALFTIME ALERT
   ========================================== */
.halftimeAlert {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 100, 0, 0.5), rgba(255, 50, 0, 0.5));
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: halftimeFlash 0.5s ease-out;
}

@keyframes halftimeFlash {
  0%, 100% { background: linear-gradient(135deg, rgba(255, 100, 0, 0.5), rgba(255, 50, 0, 0.5)); }
  25%, 75% { background: linear-gradient(135deg, rgba(255, 150, 0, 0.7), rgba(255, 100, 0, 0.7)); }
}

.halftimeAlert.fadeOut {
  animation: fadeOut 0.5s ease-out forwards;
}

.halftimeContent {
  text-align: center;
  animation: halftimeBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes halftimeBounce {
  0% { transform: scale(0) rotate(-10deg); }
  100% { transform: scale(1) rotate(0); }
}

.halftimeIcon {
  font-size: 100px;
  margin-bottom: 20px;
  animation: fireFlicker 0.3s ease-in-out infinite alternate;
}

@keyframes fireFlicker {
  from { transform: scale(1); filter: brightness(1); }
  to { transform: scale(1.1); filter: brightness(1.3); }
}

.halftimeTitle {
  font-size: 80px;
  font-weight: 950;
  color: var(--white, #f2f2f2);
  text-shadow: 0 0 60px rgba(255, 100, 0, 1);
  margin-bottom: 20px;
}

.halftimeSub {
  font-size: 28px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
   ========================================== */
@media (max-width: 600px) {
  .victoryTitle { font-size: 60px; letter-spacing: 8px; }
  .victoryWinner { font-size: 36px; }
  .victoryTrophy { font-size: 80px; }
  
  .cryWolfTitle { font-size: 48px; }
  .cryWolfIcon { font-size: 70px; }
  
  .wheelFrame { width: 260px; height: 260px; }
  .wheelTitle { font-size: 24px; }
  .resultValue { font-size: 36px; }
  
  .spinMomentText { font-size: 36px; }
  .spinMomentIcon { font-size: 40px; }
  
  .halftimeTitle { font-size: 56px; }
  .halftimeSub { font-size: 20px; }
  
  .animatedBall { width: 100px; height: 100px; }
  .animatedBall .ballNumber { font-size: 36px; }
  .animatedBall .ballLetter { font-size: 18px; }
}
