/* ============================================
   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 (.card_061a) is a descendant of
   .detail-cold-bc3a (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.row_4beb {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".photo-brown-120a" 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.sort-steel-615c so it can't cause
   horizontal overflow anyway. */
.border-c9dd,
.accordion-yellow-e01b,
.sort_upper_da34,
.left-e0ee,
.text-2818,
.carousel-gold-1cf2,
.silver_23c6,
.notification-a05b,
.stale-8880,
.fluid_9737,
.stone-8769 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .column_72ef {
    padding: 8px 0;
  }
  
  .gold_9b92 img {
    height: 28px;
    width: auto;
  }
  
  .basic_0dc2 {
    display: none !important;
  }
  
  .hot_a36a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hot_a36a svg {
    width: 14px;
    height: 14px;
  }
  
  .solid_bac5 {
    padding: 6px;
  }
  
  .upper_3bcf {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .sort_upper_da34,
  .accordion-yellow-e01b,
  .left-e0ee,
  .text-2818,
  .hard_a99c,
  .shadow-26e9,
  .text_23d0,
  .cold_a92c,
  .paper_a432,
  .media-d9c0,
  .link_9c6e,
  .in_a0d4 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .smooth_5017,
  .wrapper-fc77 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .list-center-53dd,
  .header-outer-7c3f,
  .sidebar_short_f669,
  .medium-5b86,
  .sidebar_cc99,
  .link_d748,
  .easy-65c8 {
    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 */
  .highlight-medium-f754,
  .gold-10aa,
  .dark-b2c0,
  .accent_next_5114,
  .list_liquid_14ee {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .status_847d,
  .picture-advanced-1d29,
  .picture_8335,
  .motion_63b9 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .mask_tiny_7151,
  .next-b236 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .notice_b32b,
  .tall_22c8,
  .selected-ed6a,
  .gallery_next_363b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .active_076b,
  .pink_9ad2,
  .prev-b5e1,
  .south-3ab5,
  .alert_out_6d1b,
  .progress_c6d5 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .highlight-medium-f754,
  .gold-10aa,
  .accent_next_5114 {
    max-width: none !important;
  }
  
  .photo-brown-120a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .status_847d {
    font-size: 1.5rem !important;
  }
  
  .picture-advanced-1d29 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .row_e866,
  .over-d8f3 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .picture_8335 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .first-ca0b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .notification_copper_2ab0 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .highlight-medium-f754,
  .accent_next_5114 {
    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: 2690 */
.widget-item-s7 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.1;
}
