/* ============================================
   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 (.bright_47f3) is a descendant of
   .motion_529b (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.hidden_1cf5 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".action-9a07" 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.grid_soft_affc so it can't cause
   horizontal overflow anyway. */
.icon-purple-8f39,
.border_yellow_0d28,
.badge-ac56,
.glass_19f5,
.nav_fa92,
.aside_1645,
.west-acf7,
.background_f56d,
.texture_basic_0be1,
.slider-e3e8,
.preview-glass-4022 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .text_lower_caf3 {
    padding: 8px 0;
  }
  
  .aside_lower_e35c img {
    height: 28px;
    width: auto;
  }
  
  .cold-5eee {
    display: none !important;
  }
  
  .black_bccf {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .black_bccf svg {
    width: 14px;
    height: 14px;
  }
  
  .chip_outer_e72a {
    padding: 6px;
  }
  
  .fast-ba07 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .badge-ac56,
  .border_yellow_0d28,
  .glass_19f5,
  .nav_fa92,
  .text_dbaf,
  .dropdown_ba74,
  .soft_a9c6,
  .content-iron-b97c,
  .image_cold_94b7,
  .fresh-dfa6,
  .header-dirty-421c,
  .thick-67a8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .avatar_16e7,
  .video-motion-eca8 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .pressed_ce4c,
  .purple_b435,
  .wrapper-9423,
  .summary_4511,
  .search_plasma_ef0e,
  .picture_0ba6,
  .complex_9ea6 {
    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 */
  .lower_2351,
  .progress_fast_62a5,
  .layout-fluid-31f6,
  .easy_8d60,
  .hover-c934 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .main-1e31,
  .west_5164,
  .layout_hot_6c02,
  .layout_ce95 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .prev-880a,
  .background_simple_9a60 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .label_basic_5b8e,
  .prev_1dbe,
  .notice_solid_04e2,
  .yellow_8d42 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .wrapper_59ec,
  .background_hot_511b,
  .background_small_f229,
  .modal_outer_a352,
  .center-337b,
  .breadcrumb-290f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .lower_2351,
  .progress_fast_62a5,
  .easy_8d60 {
    max-width: none !important;
  }
  
  .action-9a07 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .main-1e31 {
    font-size: 1.5rem !important;
  }
  
  .west_5164 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .popup-c26b,
  .list-98c1 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .layout_hot_6c02 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .north_2a27 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .gold_fa1c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .lower_2351,
  .easy_8d60 {
    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: 6e01 */
.shadow-element-k8 {
  padding: 0.1rem;
  font-size: 11px;
  line-height: 1.2;
}
