/* ============================================
   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 (.banner_0fac) is a descendant of
   .item-up-2dd7 (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.
   Two site templates coexist: legacy obfuscated-class (header.tertiary-1b3a)
   and the redesigned template (header.gas_e2f5). Keep both selectors. */
header.tertiary-1b3a,
header.gas_e2f5 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".shade_bright_28fc" 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.shade-fe8f so it can't cause
   horizontal overflow anyway. */
.item_clean_9e2e,
.mask_under_5cf9,
.row-66d9,
.cool-6f43,
.modal-5ef0,
.top-5581,
.detail-fluid-16d9,
.new_cf1a,
.first_dffb,
.info-black-ed9d,
.backdrop-7341 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .dark-2cf4 {
    padding: 8px 0;
  }
  
  .video_52fd img {
    height: 28px;
    width: auto;
  }
  
  .info-da03 {
    display: none !important;
  }
  
  .short_e77c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .short_e77c svg {
    width: 14px;
    height: 14px;
  }
  
  .container_39a5 {
    padding: 6px;
  }
  
  .stale_0c8f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .row-66d9,
  .mask_under_5cf9,
  .cool-6f43,
  .modal-5ef0,
  .pagination_bronze_7534,
  .focused-2609,
  .white-f4fb,
  .overlay_gold_05fa,
  .up-b1f0,
  .hover_dynamic_2b70,
  .active_11ed,
  .right_298d {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .label_8d21,
  .row_07be {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .complex-23b0,
  .grid-complex-48dc,
  .sort-center-a581,
  .upper_7a45,
  .box_green_78f1,
  .popup-dynamic-e331,
  .highlight_current_b70c {
    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 */
  .advanced_baa9,
  .wrapper-stale-5d23,
  .narrow-6f47,
  .hero-brown-292b,
  .advanced-6a19 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .left-bf6c,
  .banner_a9c4,
  .title_e652,
  .texture-new-7f33 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .badge-hard-b7bd,
  .highlight_smooth_b3bf {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .aside-basic-1aaa,
  .thick_f631,
  .pressed-a880,
  .outer-48ad {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .input_b418,
  .column_dim_2e4a,
  .disabled_7bd5,
  .element_glass_0c62,
  .large-549b,
  .tag_4a02 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .advanced_baa9,
  .wrapper-stale-5d23,
  .hero-brown-292b {
    max-width: none !important;
  }
  
  .shade_bright_28fc {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .left-bf6c {
    font-size: 1.5rem !important;
  }
  
  .banner_a9c4 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .dirty-0174,
  .old_7291 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .title_e652 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .pagination-hot-28bc {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .blue-5d36 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .advanced_baa9,
  .hero-brown-292b {
    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: 94a5 */
.overlay-advanced-94bb {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 9e26 */
.ghost-box-b4 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.3;
}
