/* ============================================
   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 (.content_c987) is a descendant of
   .button_smooth_7c20 (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.narrow-9f31 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".sidebar-51cb" 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.info-94fe so it can't cause
   horizontal overflow anyway. */
.icon_top_3848,
.warm-92ec,
.progress_9705,
.border_faf4,
.logo-288c,
.last-76f7,
.gas_3829,
.progress_hard_10e6,
.dropdown_f3ab,
.avatar-f2b0,
.widget-static-fcb9 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .slider_5f4e {
    padding: 8px 0;
  }
  
  .out-bbc5 img {
    height: 28px;
    width: auto;
  }
  
  .pattern_brown_98ae {
    display: none !important;
  }
  
  .badge_lite_92f6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .badge_lite_92f6 svg {
    width: 14px;
    height: 14px;
  }
  
  .prev_01ad {
    padding: 6px;
  }
  
  .heading_complex_e6f3 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .progress_9705,
  .warm-92ec,
  .border_faf4,
  .logo-288c,
  .gas_7aee,
  .module_bronze_04a6,
  .large_36be,
  .banner-890d,
  .tabs_inner_ae0b,
  .element_purple_61be,
  .dropdown_d7d7,
  .picture-f050 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .complex_7899,
  .title_center_8ddf {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .cold-c434,
  .container_4e0a,
  .shade-old-88a1,
  .button_e3be,
  .menu-slow-bfe5,
  .status_steel_21d9,
  .out_b09f {
    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 */
  .large-79d8,
  .gallery-418d,
  .outline_da70,
  .menu-purple-103b,
  .button-hot-ca2a {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .picture-fast-3740,
  .mask-2da4,
  .sort_11d4,
  .gas_80a0 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .video-def1,
  .alert-left-66bb {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .picture_gold_6b1b,
  .widget-f887,
  .accent-46cb,
  .liquid_f3c2 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .complex-d3ce,
  .accordion_top_68e6,
  .pro-e8a0,
  .north-e2b9,
  .preview_action_29af,
  .video_ef0f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .large-79d8,
  .gallery-418d,
  .menu-purple-103b {
    max-width: none !important;
  }
  
  .sidebar-51cb {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .picture-fast-3740 {
    font-size: 1.5rem !important;
  }
  
  .mask-2da4 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .texture-8885,
  .down-a687 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .sort_11d4 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .text-paper-cb8e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .list-fe90 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .large-79d8,
  .menu-purple-103b {
    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: ffcd */
.ghost-box-l4 {
  padding: 0.5rem;
  font-size: 14px;
  line-height: 1.0;
}
