/*
 * TV-only motion. Every animation is declared inside `prefers-reduced-motion: no-preference`, so a
 * screen that asks for reduced motion gets the final, static frame of each effect.
 */

@keyframes scene-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slam {
  0% {
    opacity: 0;
    transform: scale(1.55);
    filter: blur(12px);
  }
  55% {
    opacity: 1;
    transform: scale(0.97);
    filter: blur(0);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes lock-beat {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  45% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes flash {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 0;
  }
}

@keyframes bar-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes chip-in {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(12px);
  }
  70% {
    transform: scale(1.06);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* `bg-streaks` repeats every 59px along its -62° axis = 66.82px horizontally, so this loops seamlessly. */
@keyframes drift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(66.82px);
  }
}

@keyframes confetti-fall {
  0% {
    transform: translate3d(0, -120px, 0) rotate(0deg);
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--drift, 0px), 1220px, 0) rotate(var(--spin, 540deg));
    opacity: 0;
  }
}

@keyframes urgent {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes rays {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes dot-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

/* Static fallbacks (reduced motion): elements simply render in their final state. */
.confetti {
  display: none;
}

.barFill {
  transform-origin: left center;
}

.flash {
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .sceneIn {
    animation: scene-in 650ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .slam {
    animation: slam 750ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
  }
  .lockBeat {
    animation: lock-beat 600ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  }
  .flash {
    animation: flash 700ms ease-out both;
  }
  .barFill {
    animation: bar-grow 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: var(--delay, 0ms);
  }
  .chipIn {
    animation: chip-in 500ms cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
    animation-delay: var(--delay, 0ms);
  }
  .ticker {
    animation: ticker var(--duration, 30s) linear infinite;
  }
  .drift {
    animation: drift 7s linear infinite;
  }
  .urgent {
    animation: urgent 1s ease-in-out infinite;
  }
  .rays {
    animation: rays 60s linear infinite;
  }
  .panelIn {
    animation: panel-in 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .dotPulse {
    animation: dot-pulse 1.4s ease-in-out infinite;
  }
  .confetti {
    display: block;
  }
  .confettiPiece {
    animation: confetti-fall var(--fall, 5s) cubic-bezier(0.3, 0.4, 0.6, 1) infinite;
    animation-delay: var(--delay, 0s);
  }
}
