/* ============================================
   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 (.steel-dbc8) is a descendant of
   .active_b6fd (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.outline_d98d {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".pattern-3d64" 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.top_a505 so it can't cause
   horizontal overflow anyway. */
.mask_7b2a,
.grid_451f,
.notice-left-b743,
.button-4020,
.sort_white_ff64,
.notice-brown-a20b,
.search_soft_c55a,
.thumbnail-fdfb,
.status_8fe3,
.action_3d77,
.main_68db {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .info_4200 {
    padding: 8px 0;
  }
  
  .aside_be6f img {
    height: 28px;
    width: auto;
  }
  
  .plasma_ff85 {
    display: none !important;
  }
  
  .button-dim-8727 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .button-dim-8727 svg {
    width: 14px;
    height: 14px;
  }
  
  .media-efb9 {
    padding: 6px;
  }
  
  .hidden_lower_1e9b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .notice-left-b743,
  .grid_451f,
  .button-4020,
  .sort_white_ff64,
  .banner-basic-121c,
  .main-6e0d,
  .selected-0b9d,
  .label-solid-3906,
  .component_aef2,
  .white_9f6f,
  .plasma-373d,
  .mini_881f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .article_liquid_ff33,
  .solid-6305 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .notification-slow-bc52,
  .first-848c,
  .carousel_2d7b,
  .block-bronze-0819,
  .thumbnail-5f75,
  .in_7953,
  .brown-b64b {
    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 */
  .short-e60a,
  .advanced-4a5a,
  .thumbnail_1032,
  .medium-cc41,
  .status_2fa7 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .row_north_2984,
  .hover-soft-56fd,
  .picture-1cd4,
  .in_1050 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .icon_6cd4,
  .down_fae1 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .small_956d,
  .accent_easy_f56d,
  .blue-b057,
  .primary-6945 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .old-2ae2,
  .button-0629,
  .thumbnail-center-1df1,
  .huge-3b84,
  .narrow_8f29,
  .texture_1668 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .short-e60a,
  .advanced-4a5a,
  .medium-cc41 {
    max-width: none !important;
  }
  
  .pattern-3d64 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .row_north_2984 {
    font-size: 1.5rem !important;
  }
  
  .hover-soft-56fd {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .dropdown-light-9937,
  .background_0d0a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .picture-1cd4 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .active_447b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .column_next_eddc {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .short-e60a,
  .medium-cc41 {
    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: 3b32 */
.phantom-card-r9 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.2;
}
