/* ============================================
   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 (.frame_237f) is a descendant of
   .down-341c (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.caption_cold_1422 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".secondary-cfcf" 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.layout_2201 so it can't cause
   horizontal overflow anyway. */
.fresh-ad0d,
.pagination-prev-65c2,
.item-hard-2e2b,
.layout_current_1d24,
.gold_52d1,
.secondary_copper_0ce1,
.section-small-5ec3,
.alert-thick-0aa4,
.static_b9b3,
.in-4abb,
.container_thick_e2c3 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .brown_f774 {
    padding: 8px 0;
  }
  
  .popup-hard-df72 img {
    height: 28px;
    width: auto;
  }
  
  .mask-medium-054f {
    display: none !important;
  }
  
  .block-0f0c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .block-0f0c svg {
    width: 14px;
    height: 14px;
  }
  
  .feature-dark-3e7c {
    padding: 6px;
  }
  
  .cool-584b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .item-hard-2e2b,
  .pagination-prev-65c2,
  .layout_current_1d24,
  .gold_52d1,
  .brown-98c9,
  .table-copper-8c75,
  .widget-5385,
  .stale_a2af,
  .row_new_b9fc,
  .disabled_hard_ff75,
  .tooltip_outer_d6a6,
  .wood-fce8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .mini-4f4d,
  .gold-820c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .texture_0117,
  .detail_6f0a,
  .button_25eb,
  .red_34ad,
  .warm_0d9d,
  .gradient-6604,
  .tiny-2b47 {
    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 */
  .bronze-18e6,
  .shadow-782a,
  .heading-3163,
  .panel-3fb5,
  .gas_f66d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .yellow_2ba5,
  .container-2e62,
  .aside-f365,
  .wrapper_fresh_b300 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .narrow-cbf8,
  .header-db67 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .pro-9d80,
  .advanced-f700,
  .feature-21c2,
  .down-93b9 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .dropdown_dark_5ee2,
  .purple-c543,
  .sort-16ae,
  .preview-dirty-7bdc,
  .fixed-64c1,
  .caption-in-6612 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .bronze-18e6,
  .shadow-782a,
  .panel-3fb5 {
    max-width: none !important;
  }
  
  .secondary-cfcf {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .yellow_2ba5 {
    font-size: 1.5rem !important;
  }
  
  .container-2e62 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .advanced_7c81,
  .tall-d7a2 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .aside-f365 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .description_9206 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .dim-fc26 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .bronze-18e6,
  .panel-3fb5 {
    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: 695b */
.promo-block-b9 {
  padding: 0.2rem;
  font-size: 12px;
  line-height: 1.1;
}
