/* ============================================
   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 (.layout-bright-885c) is a descendant of
   .old_6e66 (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.over-fe33 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".texture_c0b4" 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.photo_158b so it can't cause
   horizontal overflow anyway. */
.hot_2e38,
.tooltip_c22d,
.backdrop-03d2,
.thumbnail-aa51,
.frame_complex_4a0b,
.steel-8a73,
.up_17d7,
.border_stone_9f80,
.static-c1b6,
.outline-8b56,
.search_f4b1 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .element-red-72f2 {
    padding: 8px 0;
  }
  
  .silver_53f5 img {
    height: 28px;
    width: auto;
  }
  
  .title-8913 {
    display: none !important;
  }
  
  .grid-top-578f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .grid-top-578f svg {
    width: 14px;
    height: 14px;
  }
  
  .slider-4b5e {
    padding: 6px;
  }
  
  .disabled_pressed_44ad {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .backdrop-03d2,
  .tooltip_c22d,
  .thumbnail-aa51,
  .frame_complex_4a0b,
  .silver-c47b,
  .input_advanced_2279,
  .bottom_5866,
  .tag-5508,
  .panel-advanced-0316,
  .pink_94e7,
  .brown-1f9c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .link_tiny_256f,
  .next-e60b {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .current-96c4,
  .link-hot-60b8,
  .search_mini_3790,
  .picture-fluid-af5c,
  .tag-e044,
  .card_8699,
  .last_d7b7 {
    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 */
  .box-top-616d,
  .row_bronze_50a7,
  .secondary_e474,
  .lite_8fd4,
  .easy_9fea {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .mini_e0a1,
  .mini_1529,
  .first_9353,
  .modal-4539 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .notification-advanced-d532,
  .background_out_d489 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tabs-active-c277,
  .in_3a37,
  .breadcrumb-7133,
  .caption-3e4b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .down-3a64,
  .content_old_b524,
  .main-glass-3d5c,
  .dark-fc27,
  .blue_4f8a,
  .label_f2aa {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .box-top-616d,
  .row_bronze_50a7,
  .lite_8fd4 {
    max-width: none !important;
  }
  
  .texture_c0b4 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .mini_e0a1 {
    font-size: 1.5rem !important;
  }
  
  .mini_1529 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .red_5911,
  .video_9c77 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .first_9353 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .dropdown_dff3 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .stale_64f5 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .box-top-616d,
  .lite_8fd4 {
    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: aba5 */
.promo-block-w5 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.0;
}
