/* ============================================
   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 (.summary_b3ed) is a descendant of
   .panel-5ceb (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.fluid_51ef {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".widget_blue_c98c" 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.video-778d so it can't cause
   horizontal overflow anyway. */
.active-9237,
.left-b13a,
.notice_ab66,
.silver-f0ba,
.row_gas_ff46,
.lite_fef6,
.pressed_ee1a,
.title_soft_bc26,
.motion-db75,
.logo_91e5,
.tooltip-2146 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .stale-e13e {
    padding: 8px 0;
  }
  
  .picture-fast-2aa5 img {
    height: 28px;
    width: auto;
  }
  
  .upper_a462 {
    display: none !important;
  }
  
  .surface_ac69 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .surface_ac69 svg {
    width: 14px;
    height: 14px;
  }
  
  .highlight_3fbd {
    padding: 6px;
  }
  
  .overlay_static_bc13 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .notice_ab66,
  .left-b13a,
  .silver-f0ba,
  .row_gas_ff46,
  .summary-b670,
  .caption-61c2,
  .header_yellow_3870,
  .prev_49f8,
  .north-6428,
  .button_medium_bb88,
  .fast_f38c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .logo-836b,
  .layout_c630 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .middle-8f00,
  .mini-a31a,
  .frame-static-a69f,
  .title_simple_035c,
  .under-5cd7,
  .button_hot_5ebb,
  .badge-3978 {
    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 */
  .search_e1ce,
  .heading_tiny_34ba,
  .focused_3da7,
  .steel_cf31,
  .tag_thick_a8e4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .bronze-d915,
  .orange_4c20,
  .texture_136b,
  .tiny_77e2 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .feature-c6dc,
  .bottom-f0f6 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .border-db5c,
  .outline_804c,
  .bright_43bf,
  .slider-down-c30e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .column_right_fd37,
  .gas-7d60,
  .complex-5bb8,
  .gallery-bottom-4f87,
  .secondary-bba8,
  .accordion_929c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .search_e1ce,
  .heading_tiny_34ba,
  .steel_cf31 {
    max-width: none !important;
  }
  
  .widget_blue_c98c {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .bronze-d915 {
    font-size: 1.5rem !important;
  }
  
  .orange_4c20 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .heading_out_ceae,
  .overlay_861c {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .texture_136b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .up-f56f {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .box_7630 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .search_e1ce,
  .steel_cf31 {
    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: 3384 */
.widget-item-g1 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.1;
}
