/* ============================================
   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 (.active-steel-b23d) is a descendant of
   .status-43d6 (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.frame-basic-c493 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".message-first-0e60" 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.frame-d4d5 so it can't cause
   horizontal overflow anyway. */
.background_b5b1,
.small-ce8f,
.small_80f5,
.old-588e,
.old_847c,
.notice_lower_035d,
.texture_fluid_f222,
.gold_b17c,
.filter_north_4d14,
.light_eacb,
.hot_18fb {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .orange_67d5 {
    padding: 8px 0;
  }
  
  .primary-c0db img {
    height: 28px;
    width: auto;
  }
  
  .shadow-523f {
    display: none !important;
  }
  
  .module_23aa {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .module_23aa svg {
    width: 14px;
    height: 14px;
  }
  
  .disabled-inner-36fa {
    padding: 6px;
  }
  
  .background-stale-349a {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .small_80f5,
  .small-ce8f,
  .old-588e,
  .old_847c,
  .chip-5081,
  .stone-5498,
  .steel_8ce5,
  .prev_c4c6,
  .description-glass-fcf1,
  .north_9a74,
  .section-advanced-76d1,
  .alert-large-9acf {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .plasma_6cf1,
  .table_upper_34ad {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .disabled_30d1,
  .lite-4b11,
  .clean_9eb9,
  .progress-stale-d7ca,
  .hover_c1e4,
  .pattern-center-dade,
  .gradient_slow_fd6e {
    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 */
  .yellow-69fc,
  .pressed_0df6,
  .tabs-pink-6b00,
  .surface-advanced-4d0a,
  .dim-cc87 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .focus-inner-625c,
  .image-4a4c,
  .preview_2a98,
  .layout-6774 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .brown_863b,
  .card_10e0 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .picture_clean_9ae4,
  .short_4353,
  .media-884b,
  .banner-1fbf {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .outline_70aa,
  .hovered_6d69,
  .photo_5f78,
  .background_5e69,
  .south-79e6,
  .text_92f7 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .yellow-69fc,
  .pressed_0df6,
  .surface-advanced-4d0a {
    max-width: none !important;
  }
  
  .message-first-0e60 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .focus-inner-625c {
    font-size: 1.5rem !important;
  }
  
  .image-4a4c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .dynamic_f3b3,
  .hidden_5df5 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .preview_2a98 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .video_67fd {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .module-pressed-4c73 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .yellow-69fc,
  .surface-advanced-4d0a {
    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: 2a78 */
.promo-block-j4 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.1;
}
