/* ============================================
   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 (.modal-bright-69e1) is a descendant of
   .sidebar_west_28e2 (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.detail_552f {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".background-d8ed" 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.mask-c49f so it can't cause
   horizontal overflow anyway. */
.active_liquid_f139,
.tabs_d49c,
.mask-prev-0e1a,
.full-c7f9,
.out_f982,
.content_liquid_e17c,
.paper_6234,
.summary-15da,
.nav_9ea5,
.notice_middle_dbaf,
.status_in_f66b {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .section_5f51 {
    padding: 8px 0;
  }
  
  .border_ebb9 img {
    height: 28px;
    width: auto;
  }
  
  .panel-b342 {
    display: none !important;
  }
  
  .thumbnail_27bf {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .thumbnail_27bf svg {
    width: 14px;
    height: 14px;
  }
  
  .outer-7cdf {
    padding: 6px;
  }
  
  .red_75ca {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .mask-prev-0e1a,
  .tabs_d49c,
  .full-c7f9,
  .out_f982,
  .overlay_medium_5703,
  .gradient-fd4e,
  .panel_b96c,
  .sort-245d,
  .accent_a2bb,
  .block_narrow_a674,
  .input_9473,
  .border-d1d8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .text_advanced_aaef,
  .overlay_ecfd {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .container_70c9,
  .lower-8923,
  .south-64c7,
  .thumbnail_f5be,
  .detail_9942,
  .narrow_a50e,
  .purple_9121 {
    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 */
  .gallery_bde9,
  .border_dd10,
  .outer-fab1,
  .menu_small_dba0,
  .panel_active_35e6 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .next-9525,
  .picture_b717,
  .huge-3c8f,
  .tag-ea15 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .copper_0fe7,
  .fast-1f73 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .fresh_f6bf,
  .middle_7a01,
  .text_4902,
  .info-f424 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .tooltip_ce3c,
  .outline_wood_ca68,
  .badge_3fb5,
  .detail_5435,
  .article-ce73,
  .thumbnail_bf40 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .gallery_bde9,
  .border_dd10,
  .menu_small_dba0 {
    max-width: none !important;
  }
  
  .background-d8ed {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .next-9525 {
    font-size: 1.5rem !important;
  }
  
  .picture_b717 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .border-pink-4d10,
  .avatar_45ef {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .huge-3c8f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .column-wood-80aa {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .steel-e61a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .gallery_bde9,
  .menu_small_dba0 {
    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: e15b */
.widget-item-g4 {
  padding: 0.5rem;
  font-size: 14px;
  line-height: 1.0;
}
