/* ============================================
   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 (.element-glass-bc0a) is a descendant of
   .button-1d28 (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.container_b796 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".image-fresh-6552" 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.cool_d026 so it can't cause
   horizontal overflow anyway. */
.card_dynamic_64df,
.media_f460,
.dropdown_hovered_0fd8,
.component-c97f,
.focused_95e3,
.frame-3625,
.widget-iron-2c1f,
.sort_b491,
.module_upper_beb3,
.hovered_21d2,
.active_next_73d6 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .fast_d45e {
    padding: 8px 0;
  }
  
  .tertiary-6abf img {
    height: 28px;
    width: auto;
  }
  
  .title_75dc {
    display: none !important;
  }
  
  .active_2f3a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .active_2f3a svg {
    width: 14px;
    height: 14px;
  }
  
  .banner-clean-1b50 {
    padding: 6px;
  }
  
  .west-c6d6 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .dropdown_hovered_0fd8,
  .media_f460,
  .component-c97f,
  .focused_95e3,
  .accent_9814,
  .slow-ff57,
  .menu-6ff3,
  .secondary_stone_50fe,
  .shadow_small_4449,
  .focus_bronze_f68b,
  .hero-outer-93fa,
  .slider-bronze-8649 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .motion-a378,
  .banner-static-9fe8 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .media-over-d74d,
  .thick-d6ba,
  .east_a341,
  .logo_9fb0,
  .notification_outer_eb68,
  .shadow_f898,
  .liquid_268b {
    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 */
  .video-pressed-3eef,
  .brown_62d1,
  .light-f4a9,
  .dirty_842d,
  .gradient-fe7d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .pagination-334a,
  .yellow_d0d9,
  .hard_6fba,
  .right_45a1 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .stale-2317,
  .accent-01f8 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .heading_full_da98,
  .simple_556e,
  .pattern_plasma_7bfe,
  .inner_8581 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .tag_465c,
  .green_3cce,
  .lower_8ab3,
  .picture-warm-69eb,
  .nav-copper-bebd,
  .message-over-dd07 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .video-pressed-3eef,
  .brown_62d1,
  .dirty_842d {
    max-width: none !important;
  }
  
  .image-fresh-6552 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .pagination-334a {
    font-size: 1.5rem !important;
  }
  
  .yellow_d0d9 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .detail_purple_6868,
  .next-9d1e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .hard_6fba {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .avatar-pro-83dc {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .component-plasma-5743 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .video-pressed-3eef,
  .dirty_842d {
    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: 3ac3 */
.widget-item-a1 {
  padding: 0.5rem;
  font-size: 11px;
  line-height: 1.3;
}
