/* ============================================================
   AAT – Animations CSS
   ============================================================ */

/* --- Curseur clignotant ------------------------------------ */
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
.cursor {
  display: inline-block;
  width: 3px;
  height: 1.3em;
  background: var(--ocre);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: cursor-blink 1s step-end infinite;
}

/* --- Shake sur erreur ------------------------------------- */
@keyframes shake {
  0%  { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100%{ transform: translateX(0); }
}
.shake {
  animation: shake 0.25s ease-in-out;
}

/* --- Flash erreur sur le texte ---------------------------- */
@keyframes error-flash {
  0%   { background-color: rgba(192,57,43,0.4); }
  100% { background-color: transparent; }
}
.error-flash {
  animation: error-flash 0.3s ease-out;
}

/* --- Pulse correct ---------------------------------------- */
@keyframes correct-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.correct-pulse {
  animation: correct-pulse 0.15s ease-out;
}

/* --- Slide-in résultats ----------------------------------- */
@keyframes slide-up {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.slide-up {
  animation: slide-up 0.45s cubic-bezier(0.22,1,0.36,1) both;
}

/* --- Fade in ---------------------------------------------- */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in {
  animation: fade-in 0.35s ease-out both;
}

/* --- Bounce bouton ---------------------------------------- */
@keyframes bounce-in {
  0%   { transform: scale(0.8); opacity: 0; }
  60%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}
.bounce-in {
  animation: bounce-in 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

/* --- Confetti Level-up ------------------------------------ */
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(80px) rotate(360deg); opacity: 0; }
}
.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  animation: confetti-fall 0.9s ease-out forwards;
}

/* --- Timer urgence (rouge pulsant) ------------------------ */
@keyframes timer-urgent {
  0%, 100% { color: var(--brick); transform: scale(1); }
  50%       { color: #ff6b6b;    transform: scale(1.1); }
}
.timer-urgent {
  animation: timer-urgent 0.5s ease-in-out infinite;
}

/* --- Screen transitions ----------------------------------- */
.screen {
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.screen.active {
  display: flex;
  opacity: 1;
}

/* --- Stat number update ----------------------------------- */
@keyframes stat-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); color: var(--ocre); }
  100% { transform: scale(1); }
}
.stat-pop {
  animation: stat-pop 0.2s ease-out;
}

/* --- Level card unlock ------------------------------------ */
@keyframes unlock-glow {
  0%   { box-shadow: var(--shadow); }
  50%  { box-shadow: 0 0 20px var(--ocre), var(--shadow); }
  100% { box-shadow: var(--shadow); }
}
.unlock-glow {
  animation: unlock-glow 0.8s ease-in-out 2;
}

/* --- Mode card hover press -------------------------------- */
.mode-card {
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.mode-card:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--black);
}
.mode-card:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

/* --- Btn press effect ------------------------------------- */
.btn {
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--black) !important;
}
.btn:active {
  transform: translate(4px, 4px);
  box-shadow: none !important;
}

/* --- Progress bar fill ------------------------------------ */
@keyframes progress-fill {
  from { width: 0%; }
}
.progress-bar-fill {
  animation: progress-fill 0.5s ease-out;
}
