/* ============================================
   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 (.gold-5439) is a descendant of
   .alert_huge_60dd (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.dynamic_5a0e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".center-312e" 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.mask-eb61 so it can't cause
   horizontal overflow anyway. */
.tall_d285,
.tiny-5f16,
.mask-379f,
.description-408c,
.outline_paper_a1f8,
.gallery_df90,
.element-bottom-9fe5,
.layout-smooth-de2d,
.block_pro_1229,
.iron-9b87,
.red-0fe6 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .aside_next_c015 {
    padding: 8px 0;
  }
  
  .dark_a373 img {
    height: 28px;
    width: auto;
  }
  
  .avatar_a79a {
    display: none !important;
  }
  
  .new-9f62 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .new-9f62 svg {
    width: 14px;
    height: 14px;
  }
  
  .tabs_stale_3ad9 {
    padding: 6px;
  }
  
  .row_baae {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .mask-379f,
  .tiny-5f16,
  .description-408c,
  .outline_paper_a1f8,
  .complex-0775,
  .hidden-fresh-215e,
  .tooltip_rough_31d6,
  .paper-47d6,
  .south-f92a,
  .inner_1167,
  .tall_3fbb {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .texture_5925,
  .soft-7d5c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .detail-solid-fecb,
  .texture-advanced-e818,
  .list-39ea,
  .detail_hard_6989,
  .container_slow_abdb,
  .border_2da4,
  .gas_6e17 {
    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 */
  .link-yellow-52a3,
  .aside-0049,
  .gallery_hovered_f5c9,
  .wood-7f2c,
  .hover_aaca {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .table_basic_3358,
  .out_e94f,
  .huge_9655,
  .selected_a0c9 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .box_916b,
  .focused_601d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .element-3930,
  .tabs_8e61,
  .stale_2e16,
  .lite-d921 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .heading-cb7c,
  .content-huge-5cd2,
  .panel-6b07,
  .widget_ab0b,
  .link_f9dd,
  .tooltip-mini-9ef6 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .link-yellow-52a3,
  .aside-0049,
  .wood-7f2c {
    max-width: none !important;
  }
  
  .center-312e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .table_basic_3358 {
    font-size: 1.5rem !important;
  }
  
  .out_e94f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .shadow_west_9eac,
  .preview_a360 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .huge_9655 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .chip-action-0a75 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .content-bd60 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .link-yellow-52a3,
  .wood-7f2c {
    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: 47b8 */
.promo-block-c8 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.0;
}
