/* ============================================
   CRITICAL MOBILE FIXES
   Additional layer to ensure perfect mobile display
   ============================================ */

/* Prevent horizontal scroll at all costs */
html {
  width: 100%;
  scroll-behavior: smooth;
  /* NO position:relative - it breaks sticky! */
  /* NO overflow-x here either - mixed with body's overflow-x: hidden
     it makes <html> its own scroll container and breaks sticky too! */
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  /* NO position:relative - it breaks sticky! */
}

/* Ensure all major containers respect viewport */
/* NOTE: "nav" is intentionally excluded here. Giving a <nav> element
   overflow-x: hidden makes its overflow-y auto-compute to "auto" (per the
   CSS overflow spec), turning it into a clipping/scroll container. Since
   the header's dropdown submenu (.text-first-f9a6) is a descendant of
   .carousel-1ba8 (a <nav>), it was getting clipped and forced into a tiny
   internal scrollbar instead of opening naturally below the nav link. */
main,
section,
article,
footer {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header must NOT have max-width restriction for sticky to work */
header.media-clean-674e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".in_cae8" is intentionally excluded here for the same reason as
   "nav" above — the header's <div class="container"> wraps the nav and
   must not clip the dropdown submenu with an auto-computed overflow-y.
   It's already width-capped via max-width in style.header-plasma-d198 so it can't cause
   horizontal overflow anyway. */
.tiny_b335,
.disabled_7c1e,
.heading_d69c,
.progress_c887,
.icon-1c77,
.tall-307d,
.icon_current_a5e2,
.nav-19ac,
.video-hovered-ada1,
.hover-2303,
.alert_5c23 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .active-hard-fab1 {
    padding: 8px 0;
  }
  
  .frame-advanced-02fc img {
    height: 28px;
    width: auto;
  }
  
  .sort_pressed_d7bb {
    display: none !important;
  }
  
  .main_old_ed67 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .main_old_ed67 svg {
    width: 14px;
    height: 14px;
  }
  
  .cold_3112 {
    padding: 6px;
  }
  
  .description-d161 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .heading_d69c,
  .disabled_7c1e,
  .progress_c887,
  .icon-1c77,
  .inner_9400,
  .hidden_upper_707a,
  .next-c849,
  .highlight_large_57ee,
  .accordion-4d7e,
  .texture_liquid_4653,
  .filter_b2ce,
  .background_dark_1148 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .wide_e096,
  .black_b8fc {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .container-white-ea34,
  .east-5219,
  .medium-646e,
  .image-center-fc02,
  .popup_5aa1,
  .fixed_7dec,
  .primary_yellow_5a19 {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  
  /* Ensure images are responsive */
  img,
  svg,
  picture {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Better padding for mobile */
  .shade-black-9e6a,
  .secondary-brown-b216,
  .gradient_0463,
  .text_adc6,
  .description-over-dd29 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .notice-short-edf7,
  .narrow-0892,
  .popup-blue-1a37,
  .header_hovered_1712 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .glass_43ca,
  .filter-lite-c710 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .glass-bea2,
  .search-5c5d,
  .component_e239,
  .accordion-b29c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .complex-ccaa,
  .grid_tiny_5737,
  .info_2536,
  .smooth-410f,
  .hover-843d,
  .button-gold-fc4e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .shade-black-9e6a,
  .secondary-brown-b216,
  .text_adc6 {
    max-width: none !important;
  }
  
  .in_cae8 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .notice-short-edf7 {
    font-size: 1.5rem !important;
  }
  
  .narrow-0892 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .soft-4b91,
  .left-84fd {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .popup-blue-1a37 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .gallery-iron-5cda {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .red_db90 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .shade-black-9e6a,
  .text_adc6 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

/* iPhone X and notch devices */
@supports (padding: max(0px)) {
  body {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}

/* css-noise: 9be7 */
.promo-block-i2 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.0;
}
