/* ============================================
   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 (.chip_881c) is a descendant of
   .sidebar_north_f1f8 (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.left-0859 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".last_279b" 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.element_wide_74e9 so it can't cause
   horizontal overflow anyway. */
.alert-silver-6f22,
.outline-full-e9a4,
.accent_e97c,
.warm_ffd4,
.detail_gold_928b,
.red-62c6,
.description-new-e960,
.form-gas-16f2,
.footer_purple_6cad,
.mini_ba5d,
.banner-advanced-cf5f {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .heading-8d94 {
    padding: 8px 0;
  }
  
  .copper-26c4 img {
    height: 28px;
    width: auto;
  }
  
  .grid-upper-18b1 {
    display: none !important;
  }
  
  .notice-steel-b734 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .notice-steel-b734 svg {
    width: 14px;
    height: 14px;
  }
  
  .old_4ac6 {
    padding: 6px;
  }
  
  .button_1669 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .accent_e97c,
  .outline-full-e9a4,
  .warm_ffd4,
  .detail_gold_928b,
  .light-30cf,
  .notification-first-e1f8,
  .tooltip-29e9,
  .info_3cd2,
  .section-outer-0fb4,
  .media-d5de,
  .small-5109 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .footer-liquid-ab9b,
  .block_b86f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .notice_e7e0,
  .label_4da5,
  .list-tiny-149e,
  .gallery_5cf7,
  .green_49a5,
  .wood_b0f8,
  .outline_wide_24ed {
    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 */
  .backdrop-fast-d3bc,
  .sidebar_solid_dffb,
  .element-outer-4910,
  .fresh-3bb1,
  .border-slow-b751 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .nav_motion_fe13,
  .gas_988f,
  .fast_a8f3,
  .carousel-638f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .main-next-1fca,
  .accordion_glass_0bd9 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .fresh_5a3a,
  .chip-b575,
  .widget-e8b0,
  .logo-df54 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .nav_af2e,
  .button_thick_708b,
  .pattern_full_38d8,
  .north-611e,
  .notice_d772,
  .fast-2f0c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .backdrop-fast-d3bc,
  .sidebar_solid_dffb,
  .fresh-3bb1 {
    max-width: none !important;
  }
  
  .last_279b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .nav_motion_fe13 {
    font-size: 1.5rem !important;
  }
  
  .gas_988f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .element-cbcb,
  .lower-267d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .fast_a8f3 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .menu_fe17 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .hover_pink_ef0c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .backdrop-fast-d3bc,
  .fresh-3bb1 {
    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: 58cf */
.shadow-element-m0 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.0;
}
