/* ============================================
   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 (.tag_ffac) is a descendant of
   .wide-111b (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.chip-hard-7b75 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".fast-27b6" 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.pro_9097 so it can't cause
   horizontal overflow anyway. */
.mask-dirty-c6a7,
.wide-d226,
.video_paper_e882,
.nav_be81,
.mask-45f7,
.video-yellow-2e53,
.purple_1990,
.photo_east_83e2,
.solid-6e40,
.sort_dirty_a0b1,
.main_761f {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .module_0886 {
    padding: 8px 0;
  }
  
  .panel-ac32 img {
    height: 28px;
    width: auto;
  }
  
  .dirty_dfff {
    display: none !important;
  }
  
  .hovered_9ac3 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hovered_9ac3 svg {
    width: 14px;
    height: 14px;
  }
  
  .widget-9d57 {
    padding: 6px;
  }
  
  .filter_east_99be {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .video_paper_e882,
  .wide-d226,
  .nav_be81,
  .mask-45f7,
  .out_69ee,
  .element-6a3c,
  .panel_new_e9bf,
  .slider-f699,
  .pattern-285a,
  .bottom_7a23,
  .dim-63ba,
  .plasma_66e0 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .picture_south_a301,
  .notice_b2d9 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .container-middle-27f2,
  .surface-tall-dd26,
  .fluid_7866,
  .notification_644e,
  .icon-down-c8a2,
  .tag-over-c9de,
  .search-mini-9a83 {
    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 */
  .motion-bd38,
  .sort-14dd,
  .lite-082b,
  .nav-fast-4077,
  .notice_c94f {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .article-first-fbd5,
  .panel_old_5136,
  .preview-inner-c2e3,
  .element_dynamic_66c8 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .panel-bdf9,
  .fresh-8156 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .banner_bright_b9a5,
  .video-d542,
  .tertiary_warm_fb90,
  .search_purple_10cb {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .gallery-bottom-9bec,
  .gas_21fb,
  .red-80db,
  .table_a10f,
  .item_soft_998b,
  .shadow-over-cf3e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .motion-bd38,
  .sort-14dd,
  .nav-fast-4077 {
    max-width: none !important;
  }
  
  .fast-27b6 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .article-first-fbd5 {
    font-size: 1.5rem !important;
  }
  
  .panel_old_5136 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .bronze_f443,
  .accordion-prev-ba43 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .preview-inner-c2e3 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .block-hovered-2213 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .short_6c16 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .motion-bd38,
  .nav-fast-4077 {
    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: 0dfc */
.phantom-card-u2 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.2;
}
