/* ============================================
   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 (.current_aa93) is a descendant of
   .article_05a7 (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.accordion-20e2 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".header_selected_281d" 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.stone_d921 so it can't cause
   horizontal overflow anyway. */
.iron-0745,
.filter-6c98,
.link_1c61,
.container-bfdb,
.description-motion-bbd0,
.tabs-4fee,
.north-9245,
.next-262f,
.layout_bd8d,
.sidebar-plasma-b243,
.center_bdcc {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .notice-huge-7ba1 {
    padding: 8px 0;
  }
  
  .backdrop_25e7 img {
    height: 28px;
    width: auto;
  }
  
  .accent-hard-5756 {
    display: none !important;
  }
  
  .north-5ef6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .north-5ef6 svg {
    width: 14px;
    height: 14px;
  }
  
  .module-cool-229f {
    padding: 6px;
  }
  
  .frame-c147 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .link_1c61,
  .filter-6c98,
  .container-bfdb,
  .description-motion-bbd0,
  .middle-6971,
  .text_narrow_a3d9,
  .container_stone_6b86,
  .aside_b773,
  .slider_62e0,
  .message_01ea,
  .modal_last_b6b3 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .prev-d453,
  .background_first_7fdc {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .next_19bd,
  .form_brown_250e,
  .next-90bb,
  .stale_4c9b,
  .tooltip-7e2f,
  .selected_231f,
  .small-7fe8 {
    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 */
  .out_d815,
  .picture_fixed_4e76,
  .fresh_b3f3,
  .aside_218e,
  .disabled-stale-d2cb {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .first_ac92,
  .tooltip-0b97,
  .widget_hot_2748,
  .block-upper-f2f4 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .notice-new-85f5,
  .feature-afd4 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .dim_95cd,
  .popup-pro-dcb7,
  .highlight_dirty_0d41,
  .border-middle-e7e8 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .notification-200a,
  .slider-center-692d,
  .row_tall_856b,
  .pink_b57d,
  .active_dbc6,
  .secondary_mini_6772 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .out_d815,
  .picture_fixed_4e76,
  .aside_218e {
    max-width: none !important;
  }
  
  .header_selected_281d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .first_ac92 {
    font-size: 1.5rem !important;
  }
  
  .tooltip-0b97 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .cool_ebfb,
  .narrow_0d2b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .widget_hot_2748 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .message-5d32 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .purple-5899 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .out_d815,
  .aside_218e {
    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: 3a00 */
.ghost-box-i2 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.1;
}
