/* ============================================
   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 (.action_fae3) is a descendant of
   .banner-a7cc (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.copper-fd30 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".sidebar-c0ef" 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.under_0863 so it can't cause
   horizontal overflow anyway. */
.status-dirty-eec3,
.texture-b48d,
.gradient-silver-2464,
.highlight_2101,
.aside-fluid-38d5,
.tertiary_active_e3e6,
.wood-07c6,
.preview-bright-766c,
.video_b83b,
.border-58c7,
.filter_next_cf10 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .button-next-3f79 {
    padding: 8px 0;
  }
  
  .container_390a img {
    height: 28px;
    width: auto;
  }
  
  .pressed-d2fd {
    display: none !important;
  }
  
  .next-2f2c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .next-2f2c svg {
    width: 14px;
    height: 14px;
  }
  
  .nav-hard-774e {
    padding: 6px;
  }
  
  .first_5314 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .gradient-silver-2464,
  .texture-b48d,
  .highlight_2101,
  .aside-fluid-38d5,
  .logo-77c7,
  .current_bd29,
  .hover_73fe,
  .brown_1123,
  .article-wide-b1da,
  .section-fixed-852e,
  .paper-33ef {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .row-dim-5b21,
  .detail-action-65de {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .hidden_solid_a85f,
  .label_plasma_5644,
  .box_2b3a,
  .accent-yellow-bf79,
  .tooltip_470b,
  .feature-3380,
  .dropdown-907c {
    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 */
  .mini_e948,
  .pagination-gold-1b96,
  .pattern-in-df21,
  .pattern-hot-ed80,
  .button-fluid-bdfc {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .narrow-afdc,
  .nav_1ccc,
  .orange-c58a,
  .nav_819b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .static_47f3,
  .dim-d655 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .link_dynamic_883e,
  .bronze_4aae,
  .dark-547f,
  .message-48b5 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .hot-cd5a,
  .disabled_large_efd9,
  .out_dd06,
  .east_c243,
  .carousel_plasma_c84e,
  .stale_db31 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .mini_e948,
  .pagination-gold-1b96,
  .pattern-hot-ed80 {
    max-width: none !important;
  }
  
  .sidebar-c0ef {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .narrow-afdc {
    font-size: 1.5rem !important;
  }
  
  .nav_1ccc {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .avatar-last-c98c,
  .menu-b848 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .orange-c58a {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .right_5543 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tag-stone-2ef9 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .mini_e948,
  .pattern-hot-ed80 {
    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: 75a9 */
.shadow-element-v3 {
  padding: 0.3rem;
  font-size: 13px;
  line-height: 1.1;
}
