/* ============================================
   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 (.badge_6c37) is a descendant of
   .video_pressed_947b (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.nav-clean-be7a {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".brown_72cb" 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.small_f9d4 so it can't cause
   horizontal overflow anyway. */
.surface-north-29d7,
.huge-b208,
.video-hot-d374,
.dirty_a2a1,
.huge_9837,
.solid_98e7,
.layout_hard_e96b,
.table_pressed_20f5,
.content-ce12,
.highlight_next_a5ec,
.iron_ea89 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .picture_stale_26a2 {
    padding: 8px 0;
  }
  
  .sidebar_09ba img {
    height: 28px;
    width: auto;
  }
  
  .gallery_black_f06d {
    display: none !important;
  }
  
  .last_cac9 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .last_cac9 svg {
    width: 14px;
    height: 14px;
  }
  
  .element-new-8f05 {
    padding: 6px;
  }
  
  .wide-5373 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .video-hot-d374,
  .huge-b208,
  .dirty_a2a1,
  .huge_9837,
  .text-inner-0f2f,
  .avatar-prev-8675,
  .progress-pink-6b82,
  .popup-f343,
  .glass_8346,
  .banner-25e2,
  .sort-pro-1122,
  .west-8c25 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .gallery_first_482d,
  .main-5ef1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .title_6f7c,
  .black-8453,
  .last-ce7b,
  .notification-bottom-c0f4,
  .hovered_b51b,
  .button-fb6e,
  .banner_slow_c4c4 {
    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 */
  .label-pro-be41,
  .gallery_2ab2,
  .feature_0a6d,
  .text_top_a837,
  .pro_2890 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .liquid_f088,
  .wood-7550,
  .motion_b038,
  .module-7fbc {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .iron-3f1f,
  .layout-7643 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .secondary-abd7,
  .block_brown_603a,
  .footer-bright-3f86,
  .in_b752 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .outer-ceb3,
  .form_paper_c453,
  .element-center-ba99,
  .complex-05f5,
  .north-6267,
  .wood-2835 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .label-pro-be41,
  .gallery_2ab2,
  .text_top_a837 {
    max-width: none !important;
  }
  
  .brown_72cb {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .liquid_f088 {
    font-size: 1.5rem !important;
  }
  
  .wood-7550 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .video-new-c8d6,
  .liquid-9918 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .motion_b038 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .down-f687 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .hero-first-0853 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .label-pro-be41,
  .text_top_a837 {
    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: 2adc */
.shadow-element-h6 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.3;
}
