/* ============================================
   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 (.copper-90b4) is a descendant of
   .tag-30f4 (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.button-huge-6e83 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".inner-4c6a" 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.search_lite_ce60 so it can't cause
   horizontal overflow anyway. */
.video_active_1a50,
.active-red-40ce,
.current_cff4,
.active_46cb,
.texture_fluid_a790,
.accent-5a1a,
.caption-9e0f,
.component_smooth_1d25,
.south-7339,
.dropdown_top_ce1c,
.element_bright_3293 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .full-90fe {
    padding: 8px 0;
  }
  
  .gold_108f img {
    height: 28px;
    width: auto;
  }
  
  .sort_static_6e26 {
    display: none !important;
  }
  
  .section-238e {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .section-238e svg {
    width: 14px;
    height: 14px;
  }
  
  .background-basic-e9b2 {
    padding: 6px;
  }
  
  .search-04a9 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .current_cff4,
  .active-red-40ce,
  .active_46cb,
  .texture_fluid_a790,
  .message-f927,
  .filter-7490,
  .yellow-0b92,
  .modal-c8ff,
  .content_prev_62af,
  .green_c89d,
  .inner-3448,
  .liquid_4161 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .form-f30a,
  .tall-b08c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .aside-first-a835,
  .shade-green-6044,
  .prev_bfcd,
  .aside_a203,
  .label_57e7,
  .item-up-b15b,
  .current_7d02 {
    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 */
  .complex-8ae1,
  .notice_254a,
  .box_eb3f,
  .link-3079,
  .fluid_140b {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .form-fresh-0308,
  .accent-basic-d5dc,
  .aside_b1d3,
  .main_paper_4587 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hero-8cbd,
  .orange-20ba {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .title-62d1,
  .media_hovered_c2c7,
  .card_e051,
  .info-53ca {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .logo_8040,
  .upper_9f43,
  .icon-next-6b7f,
  .small-a806,
  .plasma_1bac,
  .feature-pressed-bea8 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .complex-8ae1,
  .notice_254a,
  .link-3079 {
    max-width: none !important;
  }
  
  .inner-4c6a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .form-fresh-0308 {
    font-size: 1.5rem !important;
  }
  
  .accent-basic-d5dc {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .focus_b723,
  .chip_0f30 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .aside_b1d3 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .upper-815b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .mask_e1e3 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .complex-8ae1,
  .link-3079 {
    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: 136a */
.shadow-element-r4 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.2;
}
