/* FLOP CORN — responsive and performance polish (2026) */
:root { color-scheme: dark; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 84px; }
body { max-width: 100%; overflow-x: clip; }
img, video, iframe, canvas, svg { max-inline-size: 100%; }
img { block-size: auto; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
:focus-visible { outline: 2px solid #ffd400; outline-offset: 3px; }

@media (max-width: 768px) {
  html { scroll-padding-top: 72px; }
  body { min-width: 0; }
  main, section, header, footer, nav, article, aside { min-width: 0; }
  p, h1, h2, h3, h4, a, button, label, span { overflow-wrap: anywhere; }
  /* Keep common controls comfortable to tap without stretching compact icon controls. */
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { max-width: 100%; }
  .movie-grid, .movies-grid, .movie-container, .movie-list, .search-results, .top-rated-grid, .trending-grid {
    min-width: 0;
  }
  .movie-card, .movie-poster, .movie-info { min-width: 0; }
  .movie-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .modal, .modal-content, .movie-modal, .movie-details-modal { max-width: calc(100vw - 20px); }
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

@media (max-width: 380px) {
  .nav-links, .bottom-nav, .bottom-nav a { min-width: 0; }
  .movie-grid, .movies-grid, .search-results { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* =========================================================
   MOBILE MOTION REDUCTION
   Desktop keeps the original cinematic motion. On phones,
   decorative/continuous animation is removed for smoother
   scrolling, lower GPU use and fewer rendering glitches.
========================================================= */
@media screen and (max-width: 768px), (hover: none) and (pointer: coarse) {
  html {
    scroll-behavior: auto !important;
  }

  /* Stop decorative and looping motion across all site pages. */
  *, *::before, *::after {
    animation: none !important;
    animation-name: none !important;
    transition-duration: 0.12s !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }

  /* Avoid expensive blur/backdrop effects on small GPUs. */
  [class*="glass"],
  [class*="Glass"],
  .modal,
  .modal-content,
  .movie-modal,
  .movie-details-modal,
  .fc-buddy-panel,
  .fc-movie-buddy .fc-buddy-panel,
  .mobile-menu,
  .ios-install-overlay,
  .ios-install-box {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  /* Prevent fixed desktop parallax backgrounds from repainting. */
  body, .hero, .movie-hero, [class*="banner"], [class*="parallax"] {
    background-attachment: scroll !important;
  }

  /* Remove decorative glow filters that can be costly on mobile. */
  .hero::before,
  .hero::after,
  [class*="glow"],
  [class*="Glow"],
  [class*="particle"],
  [class*="Particle"] {
    filter: none !important;
  }

  /* Keep touch interactions immediate and avoid hover-only motion. */
  a:hover, button:hover, [role="button"]:hover,
  .movie-card:hover, .movie-poster:hover {
    transform: none !important;
  }

  /* Preserve visible content that used animation-fill-mode: forwards. */
  .reveal, .fade-in, .fadeIn, .fade-up, .fadeUp,
  .slide-in, .slideIn, .visible, .is-visible {
    opacity: 1 !important;
    visibility: visible !important;
  }
}

/* Users who request reduced motion get the same calm experience
   regardless of screen size. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
