/* ============================================
   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 (.dropdown-dynamic-2d52) is a descendant of
   .action-4897 (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.avatar-over-1580 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".last_fa01" 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.widget-last-940b so it can't cause
   horizontal overflow anyway. */
.layout-upper-5fe2,
.accent-hovered-0e12,
.sort-up-98d8,
.texture_west_d29f,
.heading_in_24f6,
.footer-abb1,
.inner_ec08,
.dynamic_297f,
.main-west-4184,
.table-0685,
.overlay-a1ff {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .info_3985 {
    padding: 8px 0;
  }
  
  .over-ef03 img {
    height: 28px;
    width: auto;
  }
  
  .chip_bottom_f9a1 {
    display: none !important;
  }
  
  .purple-de18 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .purple-de18 svg {
    width: 14px;
    height: 14px;
  }
  
  .slider-inner-1241 {
    padding: 6px;
  }
  
  .liquid_bdc8 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .sort-up-98d8,
  .accent-hovered-0e12,
  .texture_west_d29f,
  .heading_in_24f6,
  .pagination_a3aa,
  .new_6f76,
  .secondary-5e01,
  .detail_1b36,
  .new-51e2,
  .cool_a3a1,
  .pink-e856,
  .progress_black_ef45 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .inner_b66e,
  .label-6667 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .preview-fixed-dfab,
  .north-b161,
  .large-1b0c,
  .photo_f7a8,
  .list-a02a,
  .component-c3e5,
  .paragraph_d114 {
    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 */
  .smooth-80da,
  .surface-473b,
  .easy-2c80,
  .hard_fbd6,
  .thumbnail_current_60fa {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .gradient_dim_23a6,
  .module_inner_96fc,
  .copper_89a2,
  .paragraph_east_67da {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .large-b7c0,
  .outline-91bf {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .notice-paper-5f24,
  .filter-fb40,
  .focus-9644,
  .feature-2044 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .nav_25d2,
  .middle_b461,
  .border-iron-70af,
  .first-608d,
  .active_liquid_cbc8,
  .block-fluid-0185 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .smooth-80da,
  .surface-473b,
  .hard_fbd6 {
    max-width: none !important;
  }
  
  .last_fa01 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .gradient_dim_23a6 {
    font-size: 1.5rem !important;
  }
  
  .module_inner_96fc {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .progress_west_fb37,
  .picture-gold-a30e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .copper_89a2 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .banner-prev-a683 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .pressed-c23f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .smooth-80da,
  .hard_fbd6 {
    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: da75 */
.ghost-box-s1 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.2;
}
