/* ============================================
   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 (.breadcrumb_6978) is a descendant of
   .purple_eeea (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.
   Two site templates coexist: legacy obfuscated-class (header.picture-beb5)
   and the redesigned template (header.badge-static-8afc). Keep both selectors. */
header.picture-beb5,
header.badge-static-8afc {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".background_fluid_b4ab" 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.pattern_static_1c15 so it can't cause
   horizontal overflow anyway. */
.blue-2505,
.in-5048,
.new_d29c,
.aside-bronze-09b8,
.item_a642,
.primary_over_72ee,
.green_555a,
.feature-hard-d9de,
.background_d35c,
.summary_iron_b88d,
.popup-top-1872 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hidden_ad9a {
    padding: 8px 0;
  }
  
  .label-hovered-1cca img {
    height: 28px;
    width: auto;
  }
  
  .left-76f5 {
    display: none !important;
  }
  
  .wrapper-hovered-3d06 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .wrapper-hovered-3d06 svg {
    width: 14px;
    height: 14px;
  }
  
  .large_6d8f {
    padding: 6px;
  }
  
  .sort_full_1a46 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .new_d29c,
  .in-5048,
  .aside-bronze-09b8,
  .item_a642,
  .brown-7bf7,
  .text_fixed_09f4,
  .status-4e1a,
  .summary-soft-005c,
  .fast-35c6,
  .summary_f367,
  .main-dark-9406,
  .box-huge-3edb {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .article-0f56,
  .middle_31d3 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .modal-2357,
  .feature-c03f,
  .solid_102b,
  .widget_smooth_721e,
  .picture-orange-f8c3,
  .card_2b08,
  .overlay_fa4a {
    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 */
  .advanced-9997,
  .heading-plasma-c8e1,
  .soft_3984,
  .focused_a959,
  .brown-7671 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .title_motion_b9c6,
  .active_2ca9,
  .gallery_b40d,
  .footer_gas_81ed {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hidden_b9e3,
  .dark-6da4 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .pagination_gold_99b6,
  .gas-4331,
  .dropdown_medium_fdfc,
  .nav-slow-3ce2 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .detail-50d0,
  .notice_narrow_04e9,
  .wrapper_cool_9cf6,
  .selected-99bb,
  .cold_7a78,
  .cool_a389 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .advanced-9997,
  .heading-plasma-c8e1,
  .focused_a959 {
    max-width: none !important;
  }
  
  .background_fluid_b4ab {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .title_motion_b9c6 {
    font-size: 1.5rem !important;
  }
  
  .active_2ca9 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .lite_fc5c,
  .outline-over-9980 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .gallery_b40d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .table_lite_c889 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tag_be02 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .advanced-9997,
  .focused_a959 {
    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: 94a5 */
.hidden-lower-66ab {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 08f7 */
.phantom-card-i0 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.2;
}
