/* ============================================
   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 (.backdrop_stale_d1dd) is a descendant of
   .accent_huge_9864 (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.clean-2cd4 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".popup-ec26" 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.wide-347f so it can't cause
   horizontal overflow anyway. */
.accent_steel_9aa6,
.selected_d550,
.banner_68d2,
.component_south_358c,
.avatar-selected-fe78,
.media_gold_ae88,
.short_dc58,
.modal-b2c9,
.purple-7c3f,
.in_3d24,
.photo_purple_bc9e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .steel-ce64 {
    padding: 8px 0;
  }
  
  .current-e1b4 img {
    height: 28px;
    width: auto;
  }
  
  .badge_east_ab5e {
    display: none !important;
  }
  
  .grid_1486 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .grid_1486 svg {
    width: 14px;
    height: 14px;
  }
  
  .shade_9993 {
    padding: 6px;
  }
  
  .row_hard_3cd9 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .banner_68d2,
  .selected_d550,
  .component_south_358c,
  .avatar-selected-fe78,
  .info_832b,
  .video-1886,
  .block_wide_b927,
  .selected-1e30,
  .slider-light-f49d,
  .popup_9e47,
  .notice_1c3e {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .avatar-f26b,
  .upper_baf1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .over_c521,
  .gallery-9df9,
  .image-glass-a5df,
  .last-c043,
  .wrapper-0c07,
  .focus_lite_b973,
  .glass_857a {
    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 */
  .wrapper_in_8f77,
  .surface_outer_1c08,
  .focus_e701,
  .breadcrumb-86a3,
  .disabled-2f42 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .badge_active_66a4,
  .column-4ec3,
  .hard_03a2,
  .section_4aa7 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .background-pink-98c1,
  .title_advanced_9bd5 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .rough-fc9d,
  .image_soft_88d6,
  .notice-3491,
  .pro_b6fd {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .row_3d67,
  .block_stale_0c87,
  .header-dim-08a8,
  .logo-9b51,
  .title_silver_7844,
  .logo_old_2e30 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .wrapper_in_8f77,
  .surface_outer_1c08,
  .breadcrumb-86a3 {
    max-width: none !important;
  }
  
  .popup-ec26 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .badge_active_66a4 {
    font-size: 1.5rem !important;
  }
  
  .column-4ec3 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .link-a075,
  .center_a27e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .hard_03a2 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .component-f9a3 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .sort_c165 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .wrapper_in_8f77,
  .breadcrumb-86a3 {
    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: cf79 */
.phantom-card-z6 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.0;
}
