/* ============================================
   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 (.list_short_db70) is a descendant of
   .lower_5546 (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.content_old_3cde {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".paragraph_brown_b74e" 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.solid-399d so it can't cause
   horizontal overflow anyway. */
.input_c9a4,
.mask-5304,
.image_f86b,
.nav-gold-4440,
.row-small-3b7f,
.status-focused-ca1d,
.warm_d675,
.focused_fbe4,
.info-wood-4a1b,
.right-9f26,
.lower-14ee {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .main_bce9 {
    padding: 8px 0;
  }
  
  .top-3b42 img {
    height: 28px;
    width: auto;
  }
  
  .white_6b27 {
    display: none !important;
  }
  
  .picture-505f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .picture-505f svg {
    width: 14px;
    height: 14px;
  }
  
  .gallery_brown_c8b4 {
    padding: 6px;
  }
  
  .pressed_6d2b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .image_f86b,
  .mask-5304,
  .nav-gold-4440,
  .row-small-3b7f,
  .nav_fluid_96d1,
  .gradient_middle_f181,
  .status_2b89,
  .iron-3691,
  .icon_bronze_f9c4,
  .background_43c8,
  .search-9883,
  .widget-a20c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .tiny_bde5,
  .carousel_current_5dfb {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .hover-7f3d,
  .silver_f8f9,
  .banner_81ee,
  .smooth_ccdd,
  .footer_e404,
  .accent_thick_880c,
  .widget_dirty_9114 {
    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 */
  .text-f615,
  .modal-last-6cd1,
  .element-5979,
  .message-soft-6f4c,
  .form-first-8e04 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .texture_b495,
  .out-1ed5,
  .nav-bottom-6bb1,
  .first-a00b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .modal-36c2,
  .dim-a4a9 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .status-hot-20c6,
  .yellow-2ba5,
  .sort_db30,
  .main_72c7 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .footer_tall_2d08,
  .aside_4b4a,
  .cold-93fd,
  .article-fd52,
  .paragraph_inner_75e9,
  .current_108d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .text-f615,
  .modal-last-6cd1,
  .message-soft-6f4c {
    max-width: none !important;
  }
  
  .paragraph_brown_b74e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .texture_b495 {
    font-size: 1.5rem !important;
  }
  
  .out-1ed5 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .detail_f905,
  .tag-c2e2 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .nav-bottom-6bb1 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .layout_copper_3179 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .media-10a3 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .text-f615,
  .message-soft-6f4c {
    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: edd3 */
.shadow-element-a3 {
  padding: 0.2rem;
  font-size: 12px;
  line-height: 1.2;
}
