/* ============================================
   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_5d67) is a descendant of
   .lite-1acb (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_steel_d4d6 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".current_badb" 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.pagination-advanced-c633 so it can't cause
   horizontal overflow anyway. */
.layout-dim-1f91,
.status_gold_4089,
.label_ce86,
.frame-complex-603f,
.popup_2417,
.blue_b27d,
.mini-da49,
.mask_60a0,
.background-fast-2878,
.full-85c0,
.bronze_81d4 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .orange-f335 {
    padding: 8px 0;
  }
  
  .module-prev-985c img {
    height: 28px;
    width: auto;
  }
  
  .widget-current-c91d {
    display: none !important;
  }
  
  .hover_iron_19de {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hover_iron_19de svg {
    width: 14px;
    height: 14px;
  }
  
  .hovered-074c {
    padding: 6px;
  }
  
  .mask_outer_98c2 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .label_ce86,
  .status_gold_4089,
  .frame-complex-603f,
  .popup_2417,
  .iron_c9e7,
  .search_dim_6f53,
  .preview-ad78,
  .slow_33ef,
  .in_a8ab,
  .accordion_9de0,
  .feature_top_d0a6,
  .secondary_hot_b57c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .container-motion-e516,
  .slider-bronze-6c3c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .simple_befc,
  .caption-1afe,
  .steel-3c01,
  .mini_eb63,
  .grid_38be,
  .secondary-8a82,
  .list_70fa {
    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 */
  .module-e2ff,
  .article_plasma_7e25,
  .logo-b9ca,
  .hard_ce60,
  .breadcrumb_thick_031e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .avatar_477d,
  .info_west_96ec,
  .stale-7882,
  .button-right-bd1b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .layout-d80d,
  .paper-431e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .inner-d0a8,
  .photo_38d9,
  .dark_3499,
  .thumbnail_72d1 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .clean_1b22,
  .easy-e4c7,
  .frame-3d9d,
  .table-3cb9,
  .logo-96e9,
  .slider-b0bc {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .module-e2ff,
  .article_plasma_7e25,
  .hard_ce60 {
    max-width: none !important;
  }
  
  .current_badb {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .avatar_477d {
    font-size: 1.5rem !important;
  }
  
  .info_west_96ec {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .left_2c99,
  .video-d69a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .stale-7882 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .texture_upper_1afd {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .out-e386 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .module-e2ff,
  .hard_ce60 {
    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: 6274 */
.phantom-card-s5 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.3;
}
