/* ============================================
   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 (.avatar-glass-d68e) is a descendant of
   .background-d2f4 (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.sidebar-72bd {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".wide_d83a" 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.nav-large-a8e2 so it can't cause
   horizontal overflow anyway. */
.lower_32cc,
.gas-3650,
.advanced-bd75,
.frame_yellow_17f3,
.current_9805,
.fast_fdde,
.slider_2313,
.layout_16d4,
.info_1a94,
.right-46be,
.shadow_dark_70a5 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .description-lite-7d8d {
    padding: 8px 0;
  }
  
  .hover-stone-0985 img {
    height: 28px;
    width: auto;
  }
  
  .warm-d1ef {
    display: none !important;
  }
  
  .mask-2c8e {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .mask-2c8e svg {
    width: 14px;
    height: 14px;
  }
  
  .aside-rough-2a14 {
    padding: 6px;
  }
  
  .tag_cool_c02c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .advanced-bd75,
  .gas-3650,
  .frame_yellow_17f3,
  .current_9805,
  .hover-hard-6ba2,
  .top_1fd9,
  .fast_916e,
  .complex_095e,
  .slider-02b5,
  .button_stone_6f7f,
  .video_wood_2895 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .paragraph-gold-3b04,
  .breadcrumb_short_82c6 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .right-8549,
  .north-2761,
  .table_e348,
  .tag_inner_f595,
  .focused_ca06,
  .icon_brown_d740,
  .paragraph-1df3 {
    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 */
  .rough-7763,
  .card-a7a6,
  .box-f4e6,
  .hard_0681,
  .disabled-18df {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .gallery_action_d37b,
  .right_b955,
  .slow_fc59,
  .dropdown-0d4c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .plasma-63ae,
  .component-c0d7 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .slider-narrow-7603,
  .small-e584,
  .outer_6ec3,
  .preview_bdf2 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .item-1322,
  .blue-e9bb,
  .search_short_4301,
  .photo-static-d0b2,
  .secondary-b0b4,
  .badge-pressed-2b27 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .rough-7763,
  .card-a7a6,
  .hard_0681 {
    max-width: none !important;
  }
  
  .wide_d83a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .gallery_action_d37b {
    font-size: 1.5rem !important;
  }
  
  .right_b955 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .small_4f64,
  .tiny-33aa {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .slow_fc59 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .element-mini-1397 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .link-fast-a37c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .rough-7763,
  .hard_0681 {
    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: de59 */
.promo-block-u9 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.1;
}
