/* ============================================
   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 (.north_5459) is a descendant of
   .menu_854e (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.notice-5d09 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".avatar_549e" 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.black-c0ea so it can't cause
   horizontal overflow anyway. */
.active-small-e084,
.slow_cbd4,
.row-f82d,
.basic_d1d5,
.avatar-steel-5115,
.panel_8d7f,
.glass-935b,
.slider_5aea,
.orange-6880,
.overlay-small-aac9,
.wrapper-prev-545f {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .photo-active-3a3f {
    padding: 8px 0;
  }
  
  .hero_tiny_7144 img {
    height: 28px;
    width: auto;
  }
  
  .left-3aa4 {
    display: none !important;
  }
  
  .gallery_upper_4bce {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .gallery_upper_4bce svg {
    width: 14px;
    height: 14px;
  }
  
  .hover_iron_9b80 {
    padding: 6px;
  }
  
  .stale_216f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .row-f82d,
  .slow_cbd4,
  .basic_d1d5,
  .avatar-steel-5115,
  .modal-hard-0adc,
  .thumbnail_white_48b9,
  .border_glass_9044,
  .plasma_28f6,
  .tooltip-b171,
  .surface-fluid-3927,
  .modal_out_44b2,
  .bottom_3daf {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .notice-pressed-3905,
  .in-6839 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .button_fluid_7856,
  .content_advanced_7f01,
  .overlay-4388,
  .focus-d7df,
  .green_0348,
  .gradient-middle-5a3d,
  .footer-west-cf59 {
    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 */
  .bottom_d287,
  .advanced_6831,
  .breadcrumb_motion_f74c,
  .pagination_664c,
  .info_b1b0 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .pattern-16e5,
  .mini_f847,
  .next_8d90,
  .highlight_08a8 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .notification_dd07,
  .medium_c765 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tooltip-north-d5ad,
  .gradient_f395,
  .highlight-aa82,
  .heading-prev-b5cb {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .icon_mini_2bb4,
  .cold-c8b7,
  .thumbnail_dim_a16c,
  .status-ee98,
  .backdrop_clean_b92e,
  .border_east_a4fb {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .bottom_d287,
  .advanced_6831,
  .pagination_664c {
    max-width: none !important;
  }
  
  .avatar_549e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .pattern-16e5 {
    font-size: 1.5rem !important;
  }
  
  .mini_f847 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .detail-cb0e,
  .hard_a42c {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .next_8d90 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .slow_be4d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tag-36b0 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .bottom_d287,
  .pagination_664c {
    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: b1b0 */
.ghost-box-f3 {
  padding: 0.4rem;
  font-size: 14px;
  line-height: 1.1;
}
