/* ============================================
   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 (.background-left-3da6) is a descendant of
   .notice-a69f (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.smooth_e081 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".popup_gold_910e" 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.article-stone-9202 so it can't cause
   horizontal overflow anyway. */
.layout_8251,
.fast-e593,
.sidebar-right-b1af,
.active_5d11,
.filter_last_8586,
.summary_fab4,
.picture-motion-791f,
.element-smooth-552a,
.dynamic-ec35,
.dark-9904,
.sort_b2b2 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .tooltip_8068 {
    padding: 8px 0;
  }
  
  .current-f61b img {
    height: 28px;
    width: auto;
  }
  
  .input_a35e {
    display: none !important;
  }
  
  .lite-ad63 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .lite-ad63 svg {
    width: 14px;
    height: 14px;
  }
  
  .tooltip_full_fa99 {
    padding: 6px;
  }
  
  .background_hovered_9c53 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .sidebar-right-b1af,
  .fast-e593,
  .active_5d11,
  .filter_last_8586,
  .border-fixed-4b76,
  .filter-f927,
  .media_last_c67f,
  .overlay_85fa,
  .search_26dc,
  .block-956c,
  .full_6b14 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .block_1ff1,
  .popup-667a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .description_f82e,
  .surface_604d,
  .slow-1b07,
  .lower_7513,
  .paper_e8cd,
  .gallery-edb7,
  .panel-030f {
    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 */
  .under-6496,
  .message-2b8f,
  .panel_basic_0dd1,
  .main-96fc,
  .dirty_409f {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .action_6b57,
  .image-d1c5,
  .old_5bb0,
  .modal-c222 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .gallery_cba5,
  .tabs_pro_391d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .under-b903,
  .footer-current-81f0,
  .inner_e4ef,
  .image-short-c408 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .hover_hovered_28e9,
  .shadow-solid-d702,
  .breadcrumb_smooth_3b83,
  .fresh-d783,
  .fluid_5e32,
  .aside_868a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .under-6496,
  .message-2b8f,
  .main-96fc {
    max-width: none !important;
  }
  
  .popup_gold_910e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .action_6b57 {
    font-size: 1.5rem !important;
  }
  
  .image-d1c5 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .banner_current_4b54,
  .notice_dae7 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .old_5bb0 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .center-d57a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .shade_large_58e4 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .under-6496,
  .main-96fc {
    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: e7a8 */
.ghost-box-k7 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.0;
}
