/* ============================================
   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 (.frame-smooth-e109) is a descendant of
   .info_motion_349b (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.tooltip_a0b5 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".wrapper_new_99ad" 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.avatar_c7f6 so it can't cause
   horizontal overflow anyway. */
.status-3121,
.texture_0e4e,
.modal_7534,
.dirty-32e8,
.dirty_8331,
.accordion-9dcb,
.content-e083,
.selected_75c8,
.right_1a3c,
.icon_next_8856,
.in_7538 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .table_hovered_1f55 {
    padding: 8px 0;
  }
  
  .brown-0c85 img {
    height: 28px;
    width: auto;
  }
  
  .solid_28a5 {
    display: none !important;
  }
  
  .stone_f43a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .stone_f43a svg {
    width: 14px;
    height: 14px;
  }
  
  .backdrop-bright-c6cd {
    padding: 6px;
  }
  
  .medium-74d8 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .modal_7534,
  .texture_0e4e,
  .dirty-32e8,
  .dirty_8331,
  .layout_purple_8281,
  .brown-55f7,
  .info_red_32c5,
  .focus-hard-4509,
  .thumbnail-d408,
  .steel_8ac8,
  .surface_7dfb,
  .button-fresh-88bd {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .rough_523a,
  .hovered_3bf0 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .video_6d43,
  .label-iron-cddd,
  .tabs-north-bebe,
  .pattern-dynamic-44bf,
  .lite-20e3,
  .texture-4cb1,
  .form-96b9 {
    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 */
  .pattern_5ab7,
  .white_64d5,
  .preview_c7cd,
  .text_complex_8af1,
  .logo_last_ee3c {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .sort-bronze-aa01,
  .carousel_old_58df,
  .overlay-wide-ad3f,
  .bottom_3cfd {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .accent_stone_d7ac,
  .overlay-white-2e41 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .solid-a562,
  .table-81c2,
  .nav_cold_f1c4,
  .hidden-0271 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .large-d0b4,
  .mask_smooth_d40b,
  .article_6896,
  .bronze-419e,
  .west-ff2a,
  .component_f3c4 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .pattern_5ab7,
  .white_64d5,
  .text_complex_8af1 {
    max-width: none !important;
  }
  
  .wrapper_new_99ad {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .sort-bronze-aa01 {
    font-size: 1.5rem !important;
  }
  
  .carousel_old_58df {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .paper_01dd,
  .section_c00b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .overlay-wide-ad3f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .tabs-inner-5f5e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .notice_c1b7 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .pattern_5ab7,
  .text_complex_8af1 {
    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: 2bf9 */
.widget-item-q9 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.0;
}
