/* ============================================
   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 (.mask-soft-7ebc) is a descendant of
   .card_c0d7 (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.title_old_e72e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".center_9cac" 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.info_9838 so it can't cause
   horizontal overflow anyway. */
.secondary-mini-3978,
.content_4d97,
.dirty-c077,
.simple_0322,
.west_2ef0,
.stale_e7f0,
.over-1b21,
.red-7a58,
.backdrop_bf1f,
.west-5849,
.new_8f84 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .link_0a8e {
    padding: 8px 0;
  }
  
  .west-b0d0 img {
    height: 28px;
    width: auto;
  }
  
  .mini-9e1b {
    display: none !important;
  }
  
  .video-next-c58e {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .video-next-c58e svg {
    width: 14px;
    height: 14px;
  }
  
  .tiny-6008 {
    padding: 6px;
  }
  
  .hidden_light_c1a1 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .dirty-c077,
  .content_4d97,
  .simple_0322,
  .west_2ef0,
  .row-dim-9a49,
  .container-e13d,
  .main_slow_5d04,
  .media_c623,
  .disabled-slow-382a,
  .first_6dc3,
  .description-707a,
  .icon-af67 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .secondary_194a,
  .overlay-4e78 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .hidden-short-82da,
  .breadcrumb-west-5998,
  .huge-6cea,
  .caption_fluid_6a8c,
  .description_lower_a478,
  .module_north_e243,
  .gold-3c7e {
    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 */
  .outer-dbbb,
  .hovered_1cfb,
  .pattern_light_dd2b,
  .simple-0051,
  .active-4c1d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .fixed_6d83,
  .tiny_29c6,
  .hot_7a13,
  .hover-6efa {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .article_372c,
  .purple_145f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .thick-20a1,
  .short-0d78,
  .main-cc31,
  .aside-down-397c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .texture-ad78,
  .alert_2adb,
  .yellow_3033,
  .wrapper-east-f057,
  .active_9f38,
  .motion-1d8c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .outer-dbbb,
  .hovered_1cfb,
  .simple-0051 {
    max-width: none !important;
  }
  
  .center_9cac {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .fixed_6d83 {
    font-size: 1.5rem !important;
  }
  
  .tiny_29c6 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .banner_hard_5f75,
  .tooltip-small-db7d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .hot_7a13 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .logo-narrow-8006 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .hover-liquid-94fa {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .outer-dbbb,
  .simple-0051 {
    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: f225 */
.ghost-box-y1 {
  padding: 0.1rem;
  font-size: 11px;
  line-height: 1.1;
}
