/* ============================================
   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 (.action_c537) is a descendant of
   .text-cold-3e82 (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.fresh-dc4e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".icon_east_4ed0" 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.mask-top-7031 so it can't cause
   horizontal overflow anyway. */
.slider_lite_f29c,
.element_narrow_06e1,
.first-cf15,
.left-199f,
.notice_8669,
.modal-2019,
.silver-a15a,
.component-fixed-28d1,
.highlight_5770,
.easy_c314,
.solid_2f81 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .surface-north-b956 {
    padding: 8px 0;
  }
  
  .photo_2ed0 img {
    height: 28px;
    width: auto;
  }
  
  .item_a608 {
    display: none !important;
  }
  
  .outline_ecd1 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .outline_ecd1 svg {
    width: 14px;
    height: 14px;
  }
  
  .small-7d2a {
    padding: 6px;
  }
  
  .brown_c5c0 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .first-cf15,
  .element_narrow_06e1,
  .left-199f,
  .notice_8669,
  .picture-5815,
  .cold_61a4,
  .text-ad5a,
  .focused-6914,
  .highlight-light-eaad,
  .mask-pro-9a2e,
  .top-5cf5,
  .card_bronze_4d11 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .pattern-outer-c10b,
  .backdrop-red-93c1 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .bronze_c0d6,
  .column-4f57,
  .section-action-e732,
  .row-hard-1183,
  .tag_437b,
  .texture-41e2,
  .avatar-copper-cfaf {
    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 */
  .caption-aa27,
  .brown_00d9,
  .grid-right-6ee3,
  .border-west-26d1,
  .under-1679 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .highlight-basic-a221,
  .button-ffd3,
  .search_d56d,
  .fixed-2da0 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .top_c302,
  .yellow-0edb {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .layout-light-69d3,
  .shadow_huge_c679,
  .text-9986,
  .list-dc49 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .gas-242a,
  .title-4ac2,
  .left_6136,
  .status-1a1f,
  .shadow-de4d,
  .logo_center_0065 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .caption-aa27,
  .brown_00d9,
  .border-west-26d1 {
    max-width: none !important;
  }
  
  .icon_east_4ed0 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .highlight-basic-a221 {
    font-size: 1.5rem !important;
  }
  
  .button-ffd3 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tabs_medium_19e9,
  .hover-1dce {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .search_d56d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .red_3a9b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .thumbnail-hard-8bf1 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .caption-aa27,
  .border-west-26d1 {
    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: 76fd */
.shadow-element-f3 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.1;
}
