/* ============================================
   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 (.red_782a) is a descendant of
   .caption_cold_b32e (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.text-e448 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".focus_hard_32c1" 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.description_80cc so it can't cause
   horizontal overflow anyway. */
.pagination-43bc,
.avatar_dynamic_0285,
.item-silver-7919,
.main_basic_050b,
.soft-d191,
.down_3081,
.light-e983,
.heading-cold-9247,
.gallery_c0c9,
.outline-light-7f56,
.slow_5362 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .label_4f0f {
    padding: 8px 0;
  }
  
  .last-1a89 img {
    height: 28px;
    width: auto;
  }
  
  .mask_a94a {
    display: none !important;
  }
  
  .hot_b3fa {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hot_b3fa svg {
    width: 14px;
    height: 14px;
  }
  
  .carousel-pressed-e3af {
    padding: 6px;
  }
  
  .tall_55d5 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .item-silver-7919,
  .avatar_dynamic_0285,
  .main_basic_050b,
  .soft-d191,
  .motion-6e62,
  .old_13b7,
  .background_edd0,
  .pressed-4fd3,
  .dropdown_fast_1c30,
  .status_1ea9,
  .outline-ab52,
  .next_b7c1 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .gradient-west-4eae,
  .basic_acf0 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .badge_tiny_584f,
  .background_pressed_ea1f,
  .header-selected-62a5,
  .banner-4d16,
  .main-0eba,
  .icon_lite_1bbf,
  .primary-7c4c {
    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 */
  .feature-9c96,
  .silver-5268,
  .hidden_mini_b17d,
  .light_7f2e,
  .tabs-d638 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .modal_outer_23c2,
  .slider-tall-e369,
  .item_selected_10fb,
  .fresh-323c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .pagination-clean-e468,
  .item-3e9e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .huge-6bab,
  .paper-4308,
  .brown-4ff2,
  .accent_b829 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .hard_5ef7,
  .lite-e878,
  .cold_4d2c,
  .link-d9f2,
  .title_first_a631,
  .easy_42e6 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .feature-9c96,
  .silver-5268,
  .light_7f2e {
    max-width: none !important;
  }
  
  .focus_hard_32c1 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .modal_outer_23c2 {
    font-size: 1.5rem !important;
  }
  
  .slider-tall-e369 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .dark-39c6,
  .border-0aba {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .item_selected_10fb {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .row-6d69 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .button_ddfa {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .feature-9c96,
  .light_7f2e {
    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: 9a54 */
.promo-block-h9 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.1;
}
