/* ============================================
   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 (.border-in-cbe5) is a descendant of
   .caption_20a6 (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.picture_6154 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".disabled-1fad" 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.up_a56c so it can't cause
   horizontal overflow anyway. */
.soft_0522,
.background_ef70,
.block-motion-17f3,
.tabs-1b80,
.box_fixed_a58c,
.link-e814,
.panel-1360,
.red_363c,
.modal-out-aed1,
.paragraph_hard_c645,
.white_8e60 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .focus_cd7b {
    padding: 8px 0;
  }
  
  .overlay-right-281a img {
    height: 28px;
    width: auto;
  }
  
  .gallery-d18a {
    display: none !important;
  }
  
  .active-iron-8196 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .active-iron-8196 svg {
    width: 14px;
    height: 14px;
  }
  
  .down-3b7c {
    padding: 6px;
  }
  
  .focused_8d15 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .block-motion-17f3,
  .background_ef70,
  .tabs-1b80,
  .box_fixed_a58c,
  .current-eb4d,
  .panel_gold_501f,
  .wrapper_5295,
  .first_f9ff,
  .gradient-fluid-e75c,
  .caption-a3ea,
  .pressed-baea,
  .focus_in_794a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .article_stone_f4c6,
  .gas_a8de {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .sidebar-over-f370,
  .photo-tiny-c3a2,
  .hero_107f,
  .banner_8f9d,
  .row-322d,
  .modal-e93c,
  .plasma-4b11 {
    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 */
  .in-b045,
  .content_d700,
  .focus-bronze-eb4e,
  .backdrop-pro-b19a,
  .layout_f4df {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .modal_dirty_4800,
  .filter-bottom-6004,
  .row-059d,
  .item-223c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .inner-a786,
  .left_190b {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .breadcrumb-e49f,
  .media_right_1c28,
  .surface-narrow-6ca6,
  .info-ab43 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .large-8ed3,
  .texture_mini_2ec5,
  .table_78aa,
  .motion-f3b9,
  .primary_hard_f266,
  .disabled-light-5f23 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .in-b045,
  .content_d700,
  .backdrop-pro-b19a {
    max-width: none !important;
  }
  
  .disabled-1fad {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .modal_dirty_4800 {
    font-size: 1.5rem !important;
  }
  
  .filter-bottom-6004 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .article_90f6,
  .large-58d3 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .row-059d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .under-a638 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .accent-center-3232 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .in-b045,
  .backdrop-pro-b19a {
    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: ca6a */
.widget-item-z1 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.3;
}
