/* ============================================
   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 (.notification-pink-f71b) is a descendant of
   .chip_smooth_5397 (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.media_d124 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".dropdown-fa82" 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.notice-blue-0518 so it can't cause
   horizontal overflow anyway. */
.advanced_eee1,
.silver-a75b,
.stale-1d11,
.popup-static-bd64,
.west_0093,
.fluid_beae,
.list-3916,
.article_over_a854,
.caption-solid-fc4c,
.mask_brown_d830,
.disabled-a043 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .simple-70de {
    padding: 8px 0;
  }
  
  .hover-hard-c3ee img {
    height: 28px;
    width: auto;
  }
  
  .silver_bf56 {
    display: none !important;
  }
  
  .large-a9a7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .large-a9a7 svg {
    width: 14px;
    height: 14px;
  }
  
  .primary-motion-86dd {
    padding: 6px;
  }
  
  .light_b48d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .stale-1d11,
  .silver-a75b,
  .popup-static-bd64,
  .west_0093,
  .popup_rough_a4b0,
  .icon_current_030f,
  .filter-f905,
  .detail-6774,
  .tooltip-dim-f628,
  .border_small_e9cf,
  .component_d6eb,
  .huge_6c9b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .header-3bf6,
  .alert_in_ce84 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .over-e952,
  .advanced-e4b7,
  .text_e2cc,
  .mini-0d79,
  .old-eb79,
  .black_a2f1,
  .main_glass_b14b {
    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 */
  .sort-top-5e18,
  .east_6ade,
  .right-00eb,
  .new_428d,
  .main_out_3c9d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .clean-adb0,
  .card_cool_7d4c,
  .link-bottom-d9fb,
  .center_5503 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .element_wood_349f,
  .preview-focused-9b0b {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .dynamic-34e9,
  .new_a1db,
  .last_9a3b,
  .hidden_old_0c26 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .up-3282,
  .mask_over_eca8,
  .focus-cool-ede9,
  .popup-easy-73f0,
  .input-c257,
  .mini-0de3 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .sort-top-5e18,
  .east_6ade,
  .new_428d {
    max-width: none !important;
  }
  
  .dropdown-fa82 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .clean-adb0 {
    font-size: 1.5rem !important;
  }
  
  .card_cool_7d4c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .outer_b17d,
  .full-23f9 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .link-bottom-d9fb {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .small-bed7 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .dim-1634 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .sort-top-5e18,
  .new_428d {
    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: faac */
.shadow-element-v1 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.3;
}
