/* ============================================
   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 (.search_hot_1d49) is a descendant of
   .overlay-dirty-ef7b (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.carousel_liquid_539b)
   and the redesigned template (header.element-green-c56d). Keep both selectors. */
header.carousel_liquid_539b,
header.element-green-c56d {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".outer-84e6" 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.black_9a42 so it can't cause
   horizontal overflow anyway. */
.slider-d33c,
.article_cb71,
.notice-gas-9f5f,
.status-edab,
.gold_60a8,
.photo_c16f,
.tiny-e73c,
.message-stale-98d6,
.short_13d7,
.small-d5ff,
.hidden-ccc9 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .main-simple-566e {
    padding: 8px 0;
  }
  
  .tabs-b732 img {
    height: 28px;
    width: auto;
  }
  
  .medium-f106 {
    display: none !important;
  }
  
  .avatar_medium_1c1b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .avatar_medium_1c1b svg {
    width: 14px;
    height: 14px;
  }
  
  .element_current_1c89 {
    padding: 6px;
  }
  
  .top_5fa2 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .notice-gas-9f5f,
  .article_cb71,
  .status-edab,
  .gold_60a8,
  .block-9847,
  .chip_ea4f,
  .background_3958,
  .small_5c41,
  .paragraph-gas-c249,
  .solid_1ea2,
  .list_down_e462,
  .row_over_9926 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .caption_1a95,
  .logo-top-03ad {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .image_ad52,
  .hovered-e3ae,
  .backdrop-liquid-fe05,
  .steel_f6fb,
  .backdrop-c33b,
  .layout-easy-7d37,
  .status-d932 {
    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 */
  .purple_41d0,
  .tag_full_d446,
  .notice-last-1fda,
  .info_1450,
  .under-25be {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .liquid_d01f,
  .notification_2adc,
  .solid_5e0c,
  .red-2a71 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .media_149d,
  .accent_tiny_20d2 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .stale-70d7,
  .status-42d0,
  .footer-cool-dd05,
  .detail-soft-5bb4 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .description-static-00b1,
  .up_c68d,
  .row-up-5430,
  .upper_7d7e,
  .item-basic-43c5,
  .first-fcb6 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .purple_41d0,
  .tag_full_d446,
  .info_1450 {
    max-width: none !important;
  }
  
  .outer-84e6 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .liquid_d01f {
    font-size: 1.5rem !important;
  }
  
  .notification_2adc {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .image_cold_0637,
  .last_f78a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .solid_5e0c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .column_ae87 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tooltip_plasma_19ae {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .purple_41d0,
  .info_1450 {
    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 */
.gas-501c {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 058d */
.shadow-element-n0 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.2;
}
