/* ============================================
   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 (.disabled-6a45) is a descendant of
   .sort_pressed_a34a (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.menu-b57e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".disabled-0ea1" 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.bright_00c4 so it can't cause
   horizontal overflow anyway. */
.bright_df3c,
.panel-3385,
.article_f490,
.avatar-2eb8,
.input_5386,
.search-21d7,
.panel-prev-f253,
.layout-bottom-d135,
.medium-d836,
.south-cd87,
.filter_outer_2f5b {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .shadow_2890 {
    padding: 8px 0;
  }
  
  .overlay_f72c img {
    height: 28px;
    width: auto;
  }
  
  .shade_3d47 {
    display: none !important;
  }
  
  .narrow_1da8 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .narrow_1da8 svg {
    width: 14px;
    height: 14px;
  }
  
  .inner-7d7a {
    padding: 6px;
  }
  
  .fixed_cf8f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .article_f490,
  .panel-3385,
  .avatar-2eb8,
  .input_5386,
  .notice-focused-6956,
  .dark_5224,
  .menu_active_62c6,
  .brown-2b77,
  .row_lite_02ff,
  .current-35c2,
  .progress-b8fc,
  .modal_short_401d {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .box_2f7f,
  .image_afac {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .header_inner_d57a,
  .accordion-fa40,
  .footer_69c6,
  .tabs_stale_7da2,
  .green_5d38,
  .shadow_purple_ea6d,
  .center_7002 {
    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 */
  .iron_1217,
  .picture-b3f0,
  .hover_purple_5165,
  .thumbnail_063d,
  .highlight-hard-e53f {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .mini_441c,
  .menu-51ad,
  .outline_gas_2d46,
  .medium-96a1 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .description_01f2,
  .gold_65dd {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .lite_ed1a,
  .blue-b3f0,
  .menu_east_0c86,
  .notice_52ca {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .narrow_0db1,
  .hero-smooth-8089,
  .tall_35f2,
  .last_7bd9,
  .preview-88b9,
  .prev_e2bc {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .iron_1217,
  .picture-b3f0,
  .thumbnail_063d {
    max-width: none !important;
  }
  
  .disabled-0ea1 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .mini_441c {
    font-size: 1.5rem !important;
  }
  
  .menu-51ad {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .middle_2827,
  .hover-c0a4 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .outline_gas_2d46 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .static_0746 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .shadow_de64 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .iron_1217,
  .thumbnail_063d {
    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: 077e */
.promo-block-d5 {
  padding: 0.5rem;
  font-size: 11px;
  line-height: 1.2;
}
