/* ============================================
   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 (.accent_blue_eeab) is a descendant of
   .fresh-2902 (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.avatar_bronze_8133 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".dirty-4294" 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.popup-b1a4 so it can't cause
   horizontal overflow anyway. */
.mask-over-d736,
.column-7134,
.north_6b1c,
.table_62bc,
.element_153d,
.feature-314b,
.shade-gold-2c3a,
.pagination_e43f,
.plasma-1c54,
.breadcrumb_ee4e,
.outline_motion_c62c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .article_376b {
    padding: 8px 0;
  }
  
  .backdrop_selected_f014 img {
    height: 28px;
    width: auto;
  }
  
  .sidebar_fa30 {
    display: none !important;
  }
  
  .footer-a09c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .footer-a09c svg {
    width: 14px;
    height: 14px;
  }
  
  .texture_01c3 {
    padding: 6px;
  }
  
  .old_939f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .north_6b1c,
  .column-7134,
  .table_62bc,
  .element_153d,
  .wood_6ae6,
  .upper_5690,
  .label-9705,
  .header_c2d9,
  .thumbnail-6652,
  .item-top-ec71,
  .steel_dfdb {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .first-6811,
  .tertiary-a786 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .clean_7819,
  .selected_5317,
  .paragraph-d529,
  .medium_88a8,
  .tertiary_30d6,
  .heading-stale-9fcd,
  .button_ab0b {
    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 */
  .sort-fb8a,
  .tooltip-c7db,
  .in_0abb,
  .tiny_0370,
  .hovered_6219 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .medium-3cb0,
  .overlay_fixed_006a,
  .medium-9051,
  .icon-pink-5a59 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .info-bdfb,
  .background-white-2189 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .plasma_1e89,
  .large-26cf,
  .breadcrumb-89f3,
  .section-right-7bc9 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .gradient-48f5,
  .element_69c9,
  .column_fluid_3dc0,
  .progress_pink_8b4d,
  .dynamic_84b5,
  .carousel-04ac {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .sort-fb8a,
  .tooltip-c7db,
  .tiny_0370 {
    max-width: none !important;
  }
  
  .dirty-4294 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .medium-3cb0 {
    font-size: 1.5rem !important;
  }
  
  .overlay_fixed_006a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .motion_2ac7,
  .feature-729d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .medium-9051 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .tooltip-8696 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .mini-4a56 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .sort-fb8a,
  .tiny_0370 {
    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: 015f */
.widget-item-i0 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.2;
}
