/* ============================================
   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 (.gradient-0f83) is a descendant of
   .tooltip-8e2c (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.complex_c823 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".secondary_hot_2a87" 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.cold-f0f8 so it can't cause
   horizontal overflow anyway. */
.stale-fad1,
.dropdown_west_352e,
.outer-9d0d,
.block_ab85,
.button_7401,
.feature_stale_af51,
.input_b77e,
.photo-static-3e60,
.red-e3d9,
.image_b680,
.secondary_up_46fc {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .center-e11e {
    padding: 8px 0;
  }
  
  .accent-mini-2a8a img {
    height: 28px;
    width: auto;
  }
  
  .overlay-outer-1288 {
    display: none !important;
  }
  
  .gallery-0394 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .gallery-0394 svg {
    width: 14px;
    height: 14px;
  }
  
  .pagination_02d1 {
    padding: 6px;
  }
  
  .action_41b1 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .outer-9d0d,
  .dropdown_west_352e,
  .block_ab85,
  .button_7401,
  .slow_6a74,
  .action_23bc,
  .lite_876a,
  .sort-paper-3d75,
  .tabs_complex_a7ed,
  .tabs_ebd3,
  .hard_2a97 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .layout_915d,
  .gas-0d23 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .fast_104d,
  .active_plasma_76a5,
  .banner-over-ceed,
  .filter-5175,
  .shade_6231,
  .link_smooth_88c5,
  .accent-af6c {
    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 */
  .sort_cool_3733,
  .wrapper_gold_4cd9,
  .soft_c08c,
  .container_ef40,
  .table_58de {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .footer_5a99,
  .advanced_ea76,
  .huge-bd17,
  .center-6a17 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .alert_bronze_aa07,
  .input_00ad {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .border-prev-f7cf,
  .selected-228d,
  .secondary_silver_d111,
  .banner-dim-4d48 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .list_black_e2db,
  .tooltip_f91e,
  .paper_565c,
  .filter-af33,
  .hard_a8a9,
  .out_3189 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .sort_cool_3733,
  .wrapper_gold_4cd9,
  .container_ef40 {
    max-width: none !important;
  }
  
  .secondary_hot_2a87 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .footer_5a99 {
    font-size: 1.5rem !important;
  }
  
  .advanced_ea76 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .caption-51a8,
  .light_530d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .huge-bd17 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .east_7f4d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .main-rough-3838 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .sort_cool_3733,
  .container_ef40 {
    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: c193 */
.promo-block-f7 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.3;
}
