/* ============================================
   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-b686) is a descendant of
   .aside-left-686f (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.block-hard-f8eb {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".large_6f9c" 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.caption-up-1eba so it can't cause
   horizontal overflow anyway. */
.tall-2470,
.avatar_rough_a73e,
.banner-yellow-a50b,
.smooth-3bab,
.blue-547c,
.table-hard-8bb3,
.surface_medium_ce97,
.icon-3e9f,
.border_new_31ad,
.detail_pressed_0b63,
.upper-2b1c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .icon_pressed_ce36 {
    padding: 8px 0;
  }
  
  .accordion_7b99 img {
    height: 28px;
    width: auto;
  }
  
  .item_plasma_c09f {
    display: none !important;
  }
  
  .button_789b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .button_789b svg {
    width: 14px;
    height: 14px;
  }
  
  .frame_dynamic_8b24 {
    padding: 6px;
  }
  
  .content-green-5216 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .banner-yellow-a50b,
  .avatar_rough_a73e,
  .smooth-3bab,
  .blue-547c,
  .dropdown-f712,
  .cool-e2a9,
  .texture_d983,
  .slow_29cb,
  .accent_d805,
  .over-e3a5,
  .dynamic-890f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .description-d8cf,
  .medium-b080 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .texture_dynamic_a054,
  .element_motion_0a3d,
  .image-plasma-ecc1,
  .gas-6708,
  .liquid-3548,
  .list-ece1,
  .box_6df0 {
    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 */
  .top_3794,
  .easy-1fef,
  .message_a4bf,
  .container_22f7,
  .liquid-72d0 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .mask-in-c1dc,
  .secondary-dynamic-196b,
  .column_d55f,
  .dim-4945 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .heading_silver_ae53,
  .accordion_705f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .sidebar_0c41,
  .filter-82d4,
  .hidden_118c,
  .main-9384 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .bronze-a8e3,
  .gold_2ea2,
  .frame_deea,
  .mask_lite_f5cf,
  .tag-east-d230,
  .nav_solid_5d2e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .top_3794,
  .easy-1fef,
  .container_22f7 {
    max-width: none !important;
  }
  
  .large_6f9c {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .mask-in-c1dc {
    font-size: 1.5rem !important;
  }
  
  .secondary-dynamic-196b {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .card_dfbc,
  .purple_5b3a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .column_d55f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .sort-cfe4 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .sidebar-b106 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .top_3794,
  .container_22f7 {
    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: c902 */
.ghost-box-p5 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.2;
}
