/* ============================================
   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 (.text_0f11) is a descendant of
   .pink-5561 (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.accordion-smooth-ce97 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".west-136a" 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.main-b0ac so it can't cause
   horizontal overflow anyway. */
.simple-e9c9,
.backdrop_cd3e,
.article-e0d0,
.accordion_1fad,
.steel_d72b,
.outline-403d,
.card_a979,
.lower-b802,
.section_6ccc,
.sidebar-e7e7,
.silver_606b {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .carousel-static-c105 {
    padding: 8px 0;
  }
  
  .sidebar_solid_0d68 img {
    height: 28px;
    width: auto;
  }
  
  .row_e2ab {
    display: none !important;
  }
  
  .lite-ce27 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .lite-ce27 svg {
    width: 14px;
    height: 14px;
  }
  
  .glass-33fc {
    padding: 6px;
  }
  
  .texture-6da7 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .article-e0d0,
  .backdrop_cd3e,
  .accordion_1fad,
  .steel_d72b,
  .hot_9515,
  .backdrop_upper_0367,
  .image-stale-a97c,
  .widget_east_5719,
  .large-37df,
  .dropdown_cool_b6c0,
  .narrow-c021,
  .static_f4fa {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .highlight-narrow-75ce,
  .panel_in_499a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .backdrop_ae21,
  .info-hot-29f6,
  .preview_fast_0c9c,
  .dynamic-205b,
  .column-first-5d49,
  .cool-6781,
  .pro-330c {
    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 */
  .list_7009,
  .table_3b9e,
  .text_41ac,
  .texture_5a06,
  .accent_2a06 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .surface_875f,
  .tooltip-fixed-d126,
  .content-complex-c0c1,
  .background-bd2e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .image_bronze_260e,
  .complex-6b6a {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tiny_4672,
  .popup_center_4995,
  .tooltip_84e7,
  .menu_hovered_4d7d {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .nav-active-3cad,
  .text-e486,
  .accent_fluid_4fc1,
  .thumbnail-current-8f36,
  .active-4f0a,
  .button_7537 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .list_7009,
  .table_3b9e,
  .texture_5a06 {
    max-width: none !important;
  }
  
  .west-136a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .surface_875f {
    font-size: 1.5rem !important;
  }
  
  .tooltip-fixed-d126 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tag_bb33,
  .avatar_63aa {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .content-complex-c0c1 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .dropdown-under-1137 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .avatar_54dd {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .list_7009,
  .texture_5a06 {
    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: ea07 */
.promo-block-n4 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.0;
}
