/* ============================================
   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 (.aside_fast_dbc5) is a descendant of
   .fluid-e5ea (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.tag-d52b {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".orange_e097" 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.prev-1440 so it can't cause
   horizontal overflow anyway. */
.tall_c454,
.hot_6e7d,
.hot-d7bf,
.detail-tiny-2e48,
.footer_bb66,
.panel-1f0f,
.gallery_slow_4e61,
.column_next_727c,
.first_29d8,
.hidden-bright-fa74,
.link-6cf3 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .warm_a494 {
    padding: 8px 0;
  }
  
  .frame_052a img {
    height: 28px;
    width: auto;
  }
  
  .label_pro_d017 {
    display: none !important;
  }
  
  .container_f8c6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .container_f8c6 svg {
    width: 14px;
    height: 14px;
  }
  
  .notification-hot-2c78 {
    padding: 6px;
  }
  
  .hover-middle-df4e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .hot-d7bf,
  .hot_6e7d,
  .detail-tiny-2e48,
  .footer_bb66,
  .rough_2b8b,
  .message-stale-ccac,
  .center-269c,
  .shade-plasma-7f51,
  .hidden-static-097d,
  .accordion-east-8dce,
  .prev_06b1,
  .texture_bf31 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .cold_e887,
  .picture-in-e09d {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .item-fd9c,
  .top_790a,
  .fast-4442,
  .modal_middle_3885,
  .blue-fec5,
  .full_bd78,
  .heading_bd6c {
    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 */
  .block_middle_1ce8,
  .search-rough-7767,
  .next_ab6c,
  .sort-focused-ec20,
  .dirty-589e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hot-7668,
  .row_5919,
  .sidebar-copper-7df4,
  .black-da5b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .dim_0991,
  .thick-158e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .static-0802,
  .pattern-in-7263,
  .rough-bf55,
  .info_e645 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .pattern_simple_be3c,
  .content_f4e6,
  .focus-mini-5ddd,
  .modal_bottom_b743,
  .backdrop_3d33,
  .right_01ca {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .block_middle_1ce8,
  .search-rough-7767,
  .sort-focused-ec20 {
    max-width: none !important;
  }
  
  .orange_e097 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hot-7668 {
    font-size: 1.5rem !important;
  }
  
  .row_5919 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .breadcrumb_ded2,
  .list_action_1089 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .sidebar-copper-7df4 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .texture_current_ba18 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .slow-c70a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .block_middle_1ce8,
  .sort-focused-ec20 {
    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: 74c3 */
.promo-block-l2 {
  padding: 0.1rem;
  font-size: 14px;
  line-height: 1.2;
}
