/* ============================================
   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 (.old_1a82) is a descendant of
   .border_a951 (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.gradient-down-4dd4 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".copper_c487" 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.preview-dce0 so it can't cause
   horizontal overflow anyway. */
.gallery_41d4,
.label-010b,
.rough-e744,
.texture_4530,
.secondary-narrow-a012,
.sort-7636,
.gradient-a5cb,
.under_3919,
.tertiary-2d4d,
.border_liquid_68dc,
.column_mini_2454 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .fluid_650a {
    padding: 8px 0;
  }
  
  .full-e8c6 img {
    height: 28px;
    width: auto;
  }
  
  .form-6ab7 {
    display: none !important;
  }
  
  .search_selected_fbd1 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .search_selected_fbd1 svg {
    width: 14px;
    height: 14px;
  }
  
  .content_a3cc {
    padding: 6px;
  }
  
  .filter-bronze-2a8f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .rough-e744,
  .label-010b,
  .texture_4530,
  .secondary-narrow-a012,
  .column-db72,
  .action-1567,
  .focus_6608,
  .wrapper_light_7e67,
  .accent-199f,
  .stale-0e9e,
  .primary-huge-bcf3,
  .dark-f1ed {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .huge_bcd9,
  .disabled-tall-b98a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .iron_d8b4,
  .content-06ce,
  .slow-9ba7,
  .filter_1325,
  .black-5fa1,
  .widget-bf51,
  .notification-warm-a125 {
    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 */
  .upper_f4b5,
  .progress_38c0,
  .status-thick-aec2,
  .pro-89a8,
  .media_063a {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .title-complex-ce5b,
  .secondary-fast-f37a,
  .article_0140,
  .thick-5ddb {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .status-ace9,
  .outline_f02c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .layout_under_dca1,
  .stale_b0bf,
  .video_a049,
  .background_slow_d640 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .article_a6a6,
  .dynamic_7316,
  .popup-glass-042c,
  .tabs-9d65,
  .small-5d21,
  .dark_6aa0 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .upper_f4b5,
  .progress_38c0,
  .pro-89a8 {
    max-width: none !important;
  }
  
  .copper_c487 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .title-complex-ce5b {
    font-size: 1.5rem !important;
  }
  
  .secondary-fast-f37a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .preview-pink-db5f,
  .info-c94f {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .article_0140 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .last_5293 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .large-7f6f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .upper_f4b5,
  .pro-89a8 {
    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: c094 */
.promo-block-j4 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.2;
}
