/* ============================================
   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 (.container-thick-700a) is a descendant of
   .accordion_wide_9222 (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.label_0fa0 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".secondary-left-7295" 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.slider_d4b6 so it can't cause
   horizontal overflow anyway. */
.cold_b3d2,
.last-535c,
.up_6c01,
.middle_a30a,
.badge-08e4,
.liquid-7e14,
.highlight_7f4c,
.widget-stale-5ebc,
.pagination-3800,
.red_85c2,
.feature_009b {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .element-d8fe {
    padding: 8px 0;
  }
  
  .middle_06fd img {
    height: 28px;
    width: auto;
  }
  
  .footer_2a0c {
    display: none !important;
  }
  
  .summary-fd14 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .summary-fd14 svg {
    width: 14px;
    height: 14px;
  }
  
  .logo-1e4d {
    padding: 6px;
  }
  
  .image-gold-3d87 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .up_6c01,
  .last-535c,
  .middle_a30a,
  .badge-08e4,
  .preview-white-48ce,
  .texture-south-7a4f,
  .shade-3bd4,
  .thick_98f8,
  .container_pro_ffc1,
  .footer_outer_0867,
  .column-up-f10c,
  .slider_53e1 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .accent_628f,
  .nav_rough_59b3 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .active-9bbe,
  .outline-up-7143,
  .slider-879e,
  .sidebar_39af,
  .carousel-ba65,
  .new-e7cb,
  .sidebar_center_a3a3 {
    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 */
  .copper-1f48,
  .small_48f4,
  .cool-17b1,
  .yellow_b500,
  .current_8268 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .bright_5687,
  .dark_8cf4,
  .nav_tiny_3828,
  .tooltip_paper_c5bd {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .detail_e275,
  .filter_green_5f86 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .link-cold-eb97,
  .tooltip-f2f3,
  .video_focused_f7ee,
  .prev_41fd {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .pressed-1616,
  .paragraph_huge_bc55,
  .widget-0523,
  .heading_a9b0,
  .bronze-6f75,
  .feature_11a8 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .copper-1f48,
  .small_48f4,
  .yellow_b500 {
    max-width: none !important;
  }
  
  .secondary-left-7295 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .bright_5687 {
    font-size: 1.5rem !important;
  }
  
  .dark_8cf4 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .title_west_8882,
  .preview-fluid-77b4 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .nav_tiny_3828 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .title-easy-9474 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .stale_d38f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .copper-1f48,
  .yellow_b500 {
    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: 253a */
.widget-item-i4 {
  padding: 0.5rem;
  font-size: 14px;
  line-height: 1.0;
}
