/* ============================================
   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 (.selected_1bea) is a descendant of
   .panel_steel_aa30 (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.header-simple-32cf {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".gallery-f328" 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.down-39ac so it can't cause
   horizontal overflow anyway. */
.old_9086,
.smooth_ed64,
.out-94f9,
.sidebar-light-9b27,
.tooltip-silver-05ce,
.picture-ceb3,
.texture_1eb6,
.liquid-d70d,
.secondary-center-2a66,
.summary-b772,
.basic_afc8 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .label-focused-21c5 {
    padding: 8px 0;
  }
  
  .carousel-focused-ca9e img {
    height: 28px;
    width: auto;
  }
  
  .rough-0447 {
    display: none !important;
  }
  
  .info_6e97 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .info_6e97 svg {
    width: 14px;
    height: 14px;
  }
  
  .last-2325 {
    padding: 6px;
  }
  
  .disabled_top_065a {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .out-94f9,
  .smooth_ed64,
  .sidebar-light-9b27,
  .tooltip-silver-05ce,
  .picture-514f,
  .notice-7588,
  .soft_3ac4,
  .gas-430e,
  .message_08f4,
  .table-advanced-7e0b,
  .badge-old-128a,
  .medium_cf39 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .table_0b8f,
  .green-cf67 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .nav_yellow_50e4,
  .border_red_ea00,
  .plasma-2cef,
  .table-pink-7a5c,
  .shadow-cool-cf8e,
  .filter-6c66,
  .module-8235 {
    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 */
  .header_easy_097f,
  .blue_50fb,
  .focus_168c,
  .text_058e,
  .in-b996 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .fresh-425f,
  .selected_b67d,
  .tag_edde,
  .solid-2cc4 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .footer_center_2bf5,
  .table-stale-9591 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .picture_ec4a,
  .image-f00b,
  .mask-34cb,
  .info-7c42 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .container_52b1,
  .notice-15b3,
  .list_basic_8f21,
  .article-a89d,
  .black_f9e1,
  .input-ffc3 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .header_easy_097f,
  .blue_50fb,
  .text_058e {
    max-width: none !important;
  }
  
  .gallery-f328 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .fresh-425f {
    font-size: 1.5rem !important;
  }
  
  .selected_b67d {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .module-fa3b,
  .silver_1212 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .tag_edde {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .thick_cfe6 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .aside_b4bf {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .header_easy_097f,
  .text_058e {
    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: bdb5 */
.phantom-card-f0 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.0;
}
