/* ============================================
   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 (.dynamic_4a00) is a descendant of
   .bottom_60ac (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.center_4228 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".button-first-8e8d" 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.old_724a so it can't cause
   horizontal overflow anyway. */
.slider_bd73,
.detail_north_8b89,
.gradient-d272,
.search_yellow_72f8,
.mini-1bc0,
.black-fe2a,
.silver_0316,
.detail-b438,
.accent-b252,
.panel-hard-fdc7,
.block-short-3224 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .border-dea3 {
    padding: 8px 0;
  }
  
  .media-6f26 img {
    height: 28px;
    width: auto;
  }
  
  .new_dc98 {
    display: none !important;
  }
  
  .content-8dbf {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .content-8dbf svg {
    width: 14px;
    height: 14px;
  }
  
  .gas_3295 {
    padding: 6px;
  }
  
  .breadcrumb-warm-cb41 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .gradient-d272,
  .detail_north_8b89,
  .search_yellow_72f8,
  .mini-1bc0,
  .tag-warm-16ee,
  .card_1845,
  .tall_f602,
  .footer_narrow_7569,
  .sort-0543,
  .light-bcc4,
  .glass_5185,
  .tabs-medium-be05 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .summary-0061,
  .secondary_yellow_7d66 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tag-09ae,
  .gold_5b36,
  .box-3cea,
  .blue_61e3,
  .aside-67b3,
  .tabs-next-5e29,
  .pink_1bff {
    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 */
  .grid_focused_b62e,
  .warm_b2aa,
  .clean_494a,
  .last_2a5f,
  .pagination_fluid_8f5c {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .highlight-f21f,
  .gold_1083,
  .sidebar-6e76,
  .form_5f59 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .caption_ecbb,
  .modal-3f66 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .gradient-1c64,
  .preview-gas-30e4,
  .gas_e6bd,
  .tabs_8866 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .chip_easy_eaf1,
  .red-e13b,
  .upper-4133,
  .menu_action_83cb,
  .secondary-last-72fd,
  .hard_422c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .grid_focused_b62e,
  .warm_b2aa,
  .last_2a5f {
    max-width: none !important;
  }
  
  .button-first-8e8d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .highlight-f21f {
    font-size: 1.5rem !important;
  }
  
  .gold_1083 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .avatar_steel_0ae5,
  .first_a598 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .sidebar-6e76 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .bronze_5dc3 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .orange_1c66 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .grid_focused_b62e,
  .last_2a5f {
    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: 8074 */
.promo-block-c6 {
  padding: 0.1rem;
  font-size: 14px;
  line-height: 1.0;
}
