/* ==========================================================================
   ANAEROBIC ARCADE - animations.css
   Animações 8-Bit, Idle dos Cientistas, Tremor de Dano e Pulsação Neon
   Autores: Henrique e Daniel
   ========================================================================== */

/* Animação Idle dos Cientistas em Jaleco (Bobbing 8-Bit) */
.idle-scientist-daniel {
  animation: scientistBob 1.6s infinite ease-in-out;
}

.idle-scientist-henrique {
  animation: scientistBob 1.6s infinite ease-in-out;
  animation-delay: 0.8s;
}

@keyframes scientistBob {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* Estados dos protagonistas (controlados por data-state via game.js):
   idle = parado | celebrate = comemorando | damage = resposta errada */
[data-char] { transform-origin: 50% 100%; }
[data-char][data-state="idle"]      { animation: scientistBob 1.8s infinite ease-in-out; }
[data-char="henrique"][data-state="idle"] { animation-delay: 0.9s; }
[data-char][data-state="celebrate"] { animation: scientistJump 0.55s infinite ease-in-out; }
[data-char][data-state="damage"]    { animation: scientistHit 0.45s ease-in-out 1; filter: saturate(0.6) drop-shadow(0 0 8px rgba(255, 42, 85, 0.8)); }

@keyframes scientistJump {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes scientistHit {
  0%, 100% { transform: translateX(0) rotate(0); }
  25%      { transform: translateX(-5px) rotate(-3deg); }
  75%      { transform: translateX(5px) rotate(3deg); }
}

/* Piscar Retrô 8-bit */
.blink-fast {
  animation: retroBlink 0.8s infinite steps(2, start);
}

.blink-slow {
  animation: retroBlink 1.4s infinite steps(2, start);
}

@keyframes retroBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Pulsação do Botão Start 8-bit */
.pulse-start {
  animation: pulseNeonStart 1.5s infinite ease-in-out;
}

@keyframes pulseNeonStart {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 5px 0 #99004d, 0 8px 0 #000000, 0 0 18px rgba(255, 0, 127, 0.4);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 5px 0 #99004d, 0 8px 0 #000000, 0 0 30px rgba(255, 0, 127, 0.8);
  }
}

/* Efeito Screen Shake (Dano) */
.screen-shake {
  animation: shake 0.45s cubic-bezier(.36,.07,.19,.97) both;
}

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

/* Flutuação suave das bactérias mascotes */
.float-bacteria {
  animation: floatBact 3s infinite ease-in-out;
}

.float-bacteria:nth-child(2) {
  animation-delay: 0.6s;
}

.float-bacteria:nth-child(3) {
  animation-delay: 1.2s;
}

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

/* Transição de entrada suave das telas */
.fade-in {
  animation: fadeInScreen 0.22s ease-out forwards;
}

@keyframes fadeInScreen {
  from {
    opacity: 0;
    transform: scale(0.99);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
