/* ============================================
   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 (.soft_7437) is a descendant of
   .container-d4b1 (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.clean_993f {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".gradient-7c4b" 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.module-mini-e49f so it can't cause
   horizontal overflow anyway. */
.paragraph-wide-1acd,
.right_7a59,
.label-fixed-113f,
.down_8fa0,
.form-medium-319a,
.widget-60d5,
.tiny-2b21,
.current-7126,
.title-short-f9e2,
.warm-5d9f,
.avatar-b257 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .media_fec8 {
    padding: 8px 0;
  }
  
  .copper-68e9 img {
    height: 28px;
    width: auto;
  }
  
  .easy-ed06 {
    display: none !important;
  }
  
  .yellow-f3b7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .yellow-f3b7 svg {
    width: 14px;
    height: 14px;
  }
  
  .action-8eda {
    padding: 6px;
  }
  
  .banner-e490 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .label-fixed-113f,
  .right_7a59,
  .down_8fa0,
  .form-medium-319a,
  .border-out-b03e,
  .footer-b109,
  .gas-2004,
  .medium_990d,
  .wrapper_e8ac,
  .element_37d2,
  .sort_brown_64ac,
  .huge_8f58 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .filter_2e6c,
  .menu_24db {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .caption-2c47,
  .border_stone_64f0,
  .primary_f24a,
  .grid_tall_2cb0,
  .form-6b5a,
  .notice_red_36a4,
  .progress-ba4e {
    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 */
  .element_advanced_11f9,
  .video-dirty-b8ae,
  .highlight-ec71,
  .yellow_2d5a,
  .left_0c27 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .sidebar_first_e279,
  .chip_1944,
  .silver_3cc2,
  .box_c7b3 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .cool-eb6c,
  .disabled-206f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .east-aeba,
  .simple-9948,
  .preview_39f9,
  .detail-steel-169d {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .pagination_east_8abe,
  .soft-484d,
  .rough_211d,
  .light_a8f1,
  .focused_4b27,
  .shade-b295 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .element_advanced_11f9,
  .video-dirty-b8ae,
  .yellow_2d5a {
    max-width: none !important;
  }
  
  .gradient-7c4b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .sidebar_first_e279 {
    font-size: 1.5rem !important;
  }
  
  .chip_1944 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .left-a995,
  .up_74a0 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .silver_3cc2 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .wood_3b56 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .item_8395 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .element_advanced_11f9,
  .yellow_2d5a {
    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: b514 */
.ghost-box-r3 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.3;
}
