/* ============================================
   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 (.hover_a162) is a descendant of
   .surface-24a6 (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.tertiary-5e3f {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".steel-234b" 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.plasma_af3b so it can't cause
   horizontal overflow anyway. */
.dim_e60f,
.texture_fd57,
.focus_blue_8c34,
.soft_ec4d,
.text-12bb,
.info-lower-5165,
.header_2947,
.banner_f8f7,
.action-4e4f,
.video-lite-1620,
.overlay-soft-f62e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .green-e08e {
    padding: 8px 0;
  }
  
  .thumbnail_stone_8200 img {
    height: 28px;
    width: auto;
  }
  
  .summary-lower-ce48 {
    display: none !important;
  }
  
  .thumbnail_hovered_0202 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .thumbnail_hovered_0202 svg {
    width: 14px;
    height: 14px;
  }
  
  .stone_8a1a {
    padding: 6px;
  }
  
  .backdrop-b214 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .focus_blue_8c34,
  .texture_fd57,
  .soft_ec4d,
  .text-12bb,
  .text-last-9364,
  .badge-ab0e,
  .block_7cd1,
  .alert-c80b,
  .title-131b,
  .large_a69c,
  .dropdown-f7bd {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .module-plasma-1696,
  .chip-orange-ad18 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .glass-0247,
  .slider-under-2ca2,
  .glass_1143,
  .slider_down_7e71,
  .header-a3f7,
  .hovered-998b,
  .widget-5c8f {
    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 */
  .focused-44c4,
  .accent_3c0c,
  .avatar_short_697c,
  .info_8593,
  .lite-ca55 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .description-632c,
  .dropdown-middle-6643,
  .header_right_4659,
  .icon_east_8bd0 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .first-2fd8,
  .hard_54c0 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .image-d0ee,
  .container_270f,
  .complex-0421,
  .caption-silver-e945 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .sort_gas_f4c0,
  .column_e33b,
  .focused_11b8,
  .link-bronze-5f32,
  .old_039d,
  .preview_f1e1 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .focused-44c4,
  .accent_3c0c,
  .info_8593 {
    max-width: none !important;
  }
  
  .steel-234b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .description-632c {
    font-size: 1.5rem !important;
  }
  
  .dropdown-middle-6643 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .mask_6f1a,
  .image-wood-3cf6 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .header_right_4659 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .up-d99a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .nav_cool_e457 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .focused-44c4,
  .info_8593 {
    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: 57f8 */
.widget-item-p6 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.2;
}
