/* ============================================
   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 (.caption-3754) is a descendant of
   .stone_1bc8 (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.status-7317 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".wrapper_0a1a" 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.notice_6891 so it can't cause
   horizontal overflow anyway. */
.motion_94e9,
.video-5c3b,
.breadcrumb-c865,
.media-3ff5,
.breadcrumb-lite-8cf5,
.breadcrumb_motion_b2c0,
.element_4529,
.header_4764,
.focus-huge-5a3e,
.card-mini-8fc6,
.grid-642d {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .tiny-3f8d {
    padding: 8px 0;
  }
  
  .shade_cool_e68c img {
    height: 28px;
    width: auto;
  }
  
  .texture_11e0 {
    display: none !important;
  }
  
  .glass_3d60 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .glass_3d60 svg {
    width: 14px;
    height: 14px;
  }
  
  .hover-lite-0440 {
    padding: 6px;
  }
  
  .menu_small_2192 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .breadcrumb-c865,
  .video-5c3b,
  .media-3ff5,
  .breadcrumb-lite-8cf5,
  .disabled-brown-0114,
  .texture-5204,
  .widget-red-6bb9,
  .copper-1184,
  .gallery-dc55,
  .tooltip_4317,
  .slow_9848 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .shade-middle-c7df,
  .search-1ce9 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .video_old_2eea,
  .banner_last_0352,
  .cool_d311,
  .sort-8ac6,
  .description-05fa,
  .input-fast-b1c2,
  .media_outer_cb4b {
    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 */
  .widget_outer_32f7,
  .inner-605c,
  .title_wide_0bc0,
  .red-0d0d,
  .prev-c942 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .easy_8d30,
  .dynamic-b8f5,
  .gold_b7c4,
  .info-stone-6608 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .input-tall-b3c9,
  .status-a06d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .main_4f59,
  .hard-581d,
  .description-basic-0080,
  .dynamic-9b9f {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .black_00fe,
  .right-f4c1,
  .panel-99c0,
  .wrapper_old_3d98,
  .filter-cc15,
  .gradient_red_58bc {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .widget_outer_32f7,
  .inner-605c,
  .red-0d0d {
    max-width: none !important;
  }
  
  .wrapper_0a1a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .easy_8d30 {
    font-size: 1.5rem !important;
  }
  
  .dynamic-b8f5 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .slider-simple-78fc,
  .rough_1ba8 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .gold_b7c4 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .main-75f0 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .bronze-817a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .widget_outer_32f7,
  .red-0d0d {
    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: 786a */
.phantom-card-h0 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.1;
}
