/* ============================================
   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 (.logo_3ddf) is a descendant of
   .fast-0b7b (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.lower_fb6c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".content-142a" 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.search_a7e8 so it can't cause
   horizontal overflow anyway. */
.list_dark_5fcc,
.aside_110e,
.tall-fa01,
.orange_d410,
.module_yellow_4610,
.surface_63a8,
.up_15c3,
.pattern_fast_7162,
.wood-2dc6,
.filter-tall-2e0b,
.search-bronze-eb32 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .list-bright-05bb {
    padding: 8px 0;
  }
  
  .filter-plasma-92b7 img {
    height: 28px;
    width: auto;
  }
  
  .west_524e {
    display: none !important;
  }
  
  .description_black_120a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .description_black_120a svg {
    width: 14px;
    height: 14px;
  }
  
  .thumbnail-d3ac {
    padding: 6px;
  }
  
  .soft_ef79 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tall-fa01,
  .aside_110e,
  .orange_d410,
  .module_yellow_4610,
  .old-8227,
  .current_b20f,
  .grid-old-3935,
  .sidebar_9943,
  .texture_dynamic_53b7,
  .mask-e1f9,
  .link-e313,
  .new_9c6b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .component-be8b,
  .gallery_b905 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .simple-b690,
  .texture-fluid-87bb,
  .element_0cdb,
  .alert_advanced_d2b3,
  .pattern_old_e51f,
  .up_10c7,
  .box_8da3 {
    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 */
  .title-active-1e42,
  .content-action-9ce8,
  .gas_d421,
  .banner_center_9f37,
  .container_pressed_f46d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .shadow-80f9,
  .preview-plasma-5c73,
  .backdrop-7dd2,
  .image_selected_4b3d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .content-hot-66ed,
  .focused_e21d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .cold-20e1,
  .label_4fb6,
  .popup_18b0,
  .photo_5dd8 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .tag_bottom_4951,
  .info-hot-4b40,
  .backdrop-plasma-9099,
  .tabs_f759,
  .tabs_hard_4829,
  .fluid-506d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .title-active-1e42,
  .content-action-9ce8,
  .banner_center_9f37 {
    max-width: none !important;
  }
  
  .content-142a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .shadow-80f9 {
    font-size: 1.5rem !important;
  }
  
  .preview-plasma-5c73 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .pagination-fluid-03c3,
  .component_b700 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .backdrop-7dd2 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .hero_770f {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .preview-7c9f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .title-active-1e42,
  .banner_center_9f37 {
    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: 81bd */
.ghost-box-d5 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.1;
}
