/* ============================================
   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 (.image_d9f4) is a descendant of
   .wood-25b2 (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.alert_caa7 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".motion_89e3" 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.overlay-thick-fd28 so it can't cause
   horizontal overflow anyway. */
.mask_active_d15d,
.tag-glass-cf32,
.background_8469,
.east_0d67,
.glass_ca6c,
.avatar_selected_fb83,
.red_b924,
.banner_inner_43ad,
.shadow_wide_487e,
.info_active_6bab,
.image_top_6527 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .rough_9468 {
    padding: 8px 0;
  }
  
  .module_7e2c img {
    height: 28px;
    width: auto;
  }
  
  .input_large_d860 {
    display: none !important;
  }
  
  .accent_4a8a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .accent_4a8a svg {
    width: 14px;
    height: 14px;
  }
  
  .blue-b4f7 {
    padding: 6px;
  }
  
  .dirty-a185 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .background_8469,
  .tag-glass-cf32,
  .east_0d67,
  .glass_ca6c,
  .list-soft-bba2,
  .full-7b90,
  .dynamic_960f,
  .card_smooth_dac7,
  .hard-fbd3,
  .lite_2439,
  .component-in-5395,
  .current-597d {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .outline-5510,
  .tooltip-bc02 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .slider_337b,
  .texture_ad9b,
  .backdrop_3385,
  .primary-medium-91ee,
  .gas_5eec,
  .list_new_d9e8,
  .stone-fc40 {
    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 */
  .new-fc36,
  .border_solid_c4c3,
  .advanced-7cdf,
  .primary-soft-154e,
  .slider_9748 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .caption-5085,
  .in_704a,
  .fast_cd83,
  .primary_focused_5aa9 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .container-north-0f6e,
  .summary-9f70 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .info-right-ecaa,
  .sidebar_lite_155a,
  .bronze_9737,
  .photo_fluid_5955 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .text-slow-9830,
  .icon_thick_d678,
  .element_01be,
  .logo-bright-592c,
  .container-hard-0e01,
  .heading_51f6 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .new-fc36,
  .border_solid_c4c3,
  .primary-soft-154e {
    max-width: none !important;
  }
  
  .motion_89e3 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .caption-5085 {
    font-size: 1.5rem !important;
  }
  
  .in_704a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tabs_soft_15f6,
  .caption_7f36 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .fast_cd83 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .hero-smooth-e191 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .photo-small-500c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .new-fc36,
  .primary-soft-154e {
    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: 7563 */
.shadow-element-l9 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.1;
}
