/* ============================================
   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-5e9f) is a descendant of
   .dynamic_a7ff (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.gradient_cool_fd59 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".silver-fbda" 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.glass-753b so it can't cause
   horizontal overflow anyway. */
.narrow-c4ca,
.shadow_hard_6bb9,
.header-4a4c,
.info_rough_88eb,
.shade_1c05,
.sort_33a8,
.banner-a336,
.warm_8583,
.card_cool_8e2c,
.widget_616d,
.photo-purple-719e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .tooltip_hovered_a50e {
    padding: 8px 0;
  }
  
  .gold_72ea img {
    height: 28px;
    width: auto;
  }
  
  .photo_hovered_e042 {
    display: none !important;
  }
  
  .description-smooth-72c8 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .description-smooth-72c8 svg {
    width: 14px;
    height: 14px;
  }
  
  .notice-eddc {
    padding: 6px;
  }
  
  .banner_f3b3 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .header-4a4c,
  .shadow_hard_6bb9,
  .info_rough_88eb,
  .shade_1c05,
  .gradient-iron-cf9c,
  .dynamic-c1bf,
  .article_1b5a,
  .nav_4090,
  .dropdown_607e,
  .link-center-dd9e,
  .tooltip-bfc4 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .bronze_4407,
  .wrapper-8785 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .aside_new_2ad5,
  .video_outer_db7e,
  .tooltip_static_17d4,
  .info_medium_4208,
  .footer_red_6bb2,
  .paper-71ad,
  .form_right_803f {
    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 */
  .popup-8000,
  .soft-f3be,
  .status-02cf,
  .pagination-00e7,
  .notification_medium_8d14 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .input_copper_c282,
  .active-771f,
  .chip_simple_e89c,
  .image-last-a0ab {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .silver-cde9,
  .wood_59f0 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .pressed-c492,
  .paragraph_6407,
  .summary-new-3dd0,
  .detail_b92e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .article_over_e9ee,
  .alert-easy-bc3f,
  .aside_d540,
  .slow_c687,
  .top-5b96,
  .border_cool_71d6 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .popup-8000,
  .soft-f3be,
  .pagination-00e7 {
    max-width: none !important;
  }
  
  .silver-fbda {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .input_copper_c282 {
    font-size: 1.5rem !important;
  }
  
  .active-771f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .hero-hard-9a69,
  .icon_smooth_ef12 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .chip_simple_e89c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .preview_right_b3aa {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .dim_7d22 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .popup-8000,
  .pagination-00e7 {
    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: 692f */
.promo-block-h5 {
  padding: 0.2rem;
  font-size: 13px;
  line-height: 1.3;
}
