/* ============================================
   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 (.table-top-b379) is a descendant of
   .full_c9b3 (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.soft_0059 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".surface-5466" 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.heading-hard-5301 so it can't cause
   horizontal overflow anyway. */
.dynamic-c322,
.gold-048b,
.slider-upper-a12a,
.carousel_0854,
.preview-a62a,
.input_fedc,
.dim_262a,
.nav-df01,
.last_3eed,
.pattern-down-f049,
.right-b579 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .image-918e {
    padding: 8px 0;
  }
  
  .huge-17ba img {
    height: 28px;
    width: auto;
  }
  
  .image-07e7 {
    display: none !important;
  }
  
  .last-0c08 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .last-0c08 svg {
    width: 14px;
    height: 14px;
  }
  
  .black_1a49 {
    padding: 6px;
  }
  
  .tertiary_4915 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .slider-upper-a12a,
  .gold-048b,
  .carousel_0854,
  .preview-a62a,
  .footer-1865,
  .wrapper-gold-1406,
  .logo-rough-2780,
  .video_bronze_bf46,
  .hero-dark-7a2f,
  .huge_ceba,
  .static_a399,
  .tabs-active-ba46 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .hot_10e0,
  .filter-151b {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .item-static-77c5,
  .filter_beae,
  .hard-0657,
  .component_motion_2f3d,
  .notification-lower-366c,
  .block_fixed_10f4,
  .info-51e1 {
    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 */
  .dirty-26bf,
  .smooth-3a94,
  .main-07d1,
  .sidebar-prev-8816,
  .thick-5b47 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .black-ace4,
  .north-cde7,
  .preview_1a09,
  .down_2052 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tag_dynamic_41ad,
  .card_749b {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .accordion-active-b1b4,
  .solid-467b,
  .backdrop-black-cb0f,
  .active_2748 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .fast_bf67,
  .first-f3d4,
  .popup_9f28,
  .up-8a3d,
  .notice_9217,
  .slow-17a6 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .dirty-26bf,
  .smooth-3a94,
  .sidebar-prev-8816 {
    max-width: none !important;
  }
  
  .surface-5466 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .black-ace4 {
    font-size: 1.5rem !important;
  }
  
  .north-cde7 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .aside-orange-7e4f,
  .new-765c {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .preview_1a09 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .inner-eaaa {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .shade_basic_46fb {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .dirty-26bf,
  .sidebar-prev-8816 {
    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: 6f9f */
.phantom-card-m7 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.1;
}
