/**
 * Animations
 * Bouncy, playful animations
 */

/* === Fade In === */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* === Slide In === */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Bounce === */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* === Shake === */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* === Task Complete Animation === */
@keyframes taskComplete {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.task-item.just-completed {
  animation: taskComplete 0.3s ease;
}

/* === Player Join Animation === */
.player-item {
  animation: slideInUp 0.3s ease;
}

/* === Confetti === */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--color-success);
  position: absolute;
  animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotateZ(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotateZ(720deg);
    opacity: 0;
  }
}

/* === Screen Transitions === */
.screen {
  animation: fadeIn 0.3s ease;
}

/* === Button Hover Effects === */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

/* === Loading States === */
.loading-dots {
  display: inline-block;
}

.loading-dots::after {
  content: '';
  animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
  0%, 20% {
    content: '.';
  }
  40% {
    content: '..';
  }
  60%, 100% {
    content: '...';
  }
}

/* === Role Reveal === */
.role-name {
  animation: fadeInScale 0.5s ease;
}

/* === Emergency Button Pulse === */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.8);
  }
}

.btn-emergency {
  animation: pulse-glow 2s infinite;
}

/* === Notification Banner === */
@keyframes slideInFromTop {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.notification {
  animation: slideInFromTop 0.3s ease;
}

/* === Death Cross Activation === */
@keyframes deathCrossActivate {
  0% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.2) rotate(-10deg);
  }
  50% {
    transform: scale(1.3) rotate(10deg);
  }
  75% {
    transform: scale(1.2) rotate(-5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.btn-death-cross.activated {
  animation: deathCrossActivate 0.5s ease;
}
