/* Homepage mobile: prioritize scroll FPS over decorative motion */

@media (max-width: 991.98px) {
  html {
    scroll-behavior: auto;
  }

  /* content-visibility during fast scroll feels "behind" — avoid on the home grid */
  .featured-competitions #featured-competitions-container,
  .iw-section,
  .winners-section,
  .referral-loyalty-section,
  .experience-section,
  .about-section,
  .why-join-section,
  .featured-competitions .competition-image img {
    content-visibility: visible !important;
    contain-intrinsic-size: unset !important;
  }

  /* Hero decorations off on mobile */
  body.page-home .home-hero-title__accent,
  body.page-home .home-hero-header,
  body.page-home .hero-featured-card__shine::before,
  body.page-home .winner-skeleton {
    animation: none !important;
  }

  /*
   * Instant wins + winner marquees: compositor translateX only.
   * Slow + paused while scrolling / off-screen (home-mobile-scroll.js).
   */
  body.page-home .iw-track {
    animation: iw-slide-mobile 120s linear infinite;
    will-change: transform;
  }

  body.page-home .marquee-top .marquee-track {
    animation: scroll 100s linear infinite;
    will-change: transform;
  }

  body.page-home .marquee-bottom .marquee-track {
    animation: scrollReverse 100s linear infinite;
    will-change: transform;
  }

  body.page-home .marquee-middle .text-marquee-wrapper {
    animation: scrollText 80s linear infinite;
    will-change: transform;
  }

  html.is-scrolling body.page-home .iw-track,
  html.is-scrolling body.page-home .marquee-top .marquee-track,
  html.is-scrolling body.page-home .marquee-bottom .marquee-track,
  html.is-scrolling body.page-home .marquee-middle .text-marquee-wrapper {
    animation-play-state: paused !important;
  }

  /* Lighter hero while scrolling past (full-bleed bg image is costly on phones) */
  body.page-home .home-hero::after {
    display: none;
  }

  body.page-home .home-hero::before {
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--dark-bg) 92%, transparent) 0%,
      var(--dark-bg) 100%
    );
  }

  .featured-competitions .competition-card,
  .featured-competitions .competition-card.glass-card {
    transition: none !important;
    contain: none;
  }

  .featured-competitions .competition-card.touch-active {
    transform: none !important;
    box-shadow: inherit !important;
  }

  .competition-card.glass-card,
  .competition-card {
    transition: none;
  }

  .competition-card.touch-active {
    transform: none;
    box-shadow: inherit;
  }

  .glass-card {
    transition: none;
  }

  .glass-card:hover {
    transform: none;
  }

  .hero-featured-card:not(.is-sold-out) .hero-featured-card__shine::before {
    animation: none;
    display: none;
  }

  .hero-featured-card {
    transition: none;
  }

  .home-hero-badge__dot {
    animation: none;
  }

  .competition-card .ending-today-banner,
  .competition-card .recently-listed-badge,
  .competition-card [class*='recently-listed'] {
    animation: none !important;
  }

  .home-hero-viewport {
    -webkit-overflow-scrolling: auto;
    scroll-snap-type: none;
    touch-action: pan-y;
    overscroll-behavior-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .iw-track,
  .marquee-track,
  .text-marquee,
  .hero-featured-card__shine::before,
  .skeleton-shimmer,
  .winner-skeleton {
    animation: none !important;
  }
}
