/**
 * Football collage backdrop: full-screen hero image zoom, then tilted tile grid loop.
 * Used by FootballCollageBackdrop (Next) and /api/otp-page (link href).
 */

.fcb-collage-wrap {
  position: absolute;
  inset: -12%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fcbCollageVis 16s ease-in-out infinite;
}

.fcb-collage-inner {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  max-height: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  animation: fcbCollageDrift 22s ease-in-out infinite alternate;
}

.fcb-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 5px;
  width: min(165vw, 980px);
  transform: rotateX(16deg) rotateY(-12deg) translateZ(-40px) scale(1.08);
  transform-style: preserve-3d;
}

@media (max-width: 480px) {
  .fcb-grid {
    width: 200vw;
    gap: 4px;
    transform: rotateX(14deg) rotateY(-10deg) translateZ(-30px) scale(1.05);
  }
}

.fcb-tile {
  aspect-ratio: 1;
  border-radius: 7px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.55);
  opacity: 0.9;
  transform: rotate(calc(var(--fcb-rot, 0) * 1deg));
  filter: saturate(1.08) brightness(0.92);
}

.fcb-hero {
  position: absolute;
  inset: 0;
  animation: fcbHeroVis 16s ease-in-out infinite;
}

.fcb-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.36);
  pointer-events: none;
}

.fcb-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  animation: fcbHeroZoom 16s ease-in-out infinite;
}

@keyframes fcbHeroZoom {
  0% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.18);
  }
  30% {
    transform: scale(1);
  }
  34%,
  100% {
    transform: scale(1.06);
  }
}

@keyframes fcbHeroVis {
  0%,
  32% {
    opacity: 1;
    visibility: visible;
  }
  36%,
  86% {
    opacity: 0;
    visibility: hidden;
  }
  90%,
  100% {
    opacity: 1;
    visibility: visible;
  }
}

@keyframes fcbCollageVis {
  0%,
  32% {
    opacity: 0;
    visibility: hidden;
  }
  36%,
  86% {
    opacity: 1;
    visibility: visible;
  }
  90%,
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes fcbCollageDrift {
  0% {
    transform: perspective(1200px) rotateX(2deg) scale(1.02);
  }
  100% {
    transform: perspective(1200px) rotateX(-2deg) scale(1.08);
  }
}

.hero-bg.fcb-perspective {
  perspective: 1400px;
  perspective-origin: 50% 42%;
}

@media (prefers-reduced-motion: reduce) {
  .fcb-hero,
  .fcb-hero-img,
  .fcb-collage-wrap,
  .fcb-collage-inner {
    animation: none !important;
  }

  .fcb-hero {
    opacity: 0;
    visibility: hidden;
  }

  .fcb-collage-wrap {
    opacity: 1 !important;
    visibility: visible !important;
  }

  .fcb-collage-inner {
    transform: perspective(1200px) rotateX(14deg) scale(1.04);
  }
}
