/* ============================================
   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 (.alert-over-4894) is a descendant of
   .pink_e283 (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.over_86e1 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".north_ae6b" 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-ec8f so it can't cause
   horizontal overflow anyway. */
.item-26c3,
.over-a536,
.last-3203,
.panel_current_75e2,
.gallery-6282,
.secondary-81fe,
.north-0b38,
.slider-thick-5e0e,
.notification_1275,
.texture-over-b19d,
.description_gold_10d2 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .description-purple-1f80 {
    padding: 8px 0;
  }
  
  .tabs_20af img {
    height: 28px;
    width: auto;
  }
  
  .avatar-wide-0aae {
    display: none !important;
  }
  
  .motion-fbde {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .motion-fbde svg {
    width: 14px;
    height: 14px;
  }
  
  .menu-fluid-fd20 {
    padding: 6px;
  }
  
  .pressed_5009 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .last-3203,
  .over-a536,
  .panel_current_75e2,
  .gallery-6282,
  .upper-65a7,
  .basic_1698,
  .action-917c,
  .backdrop_current_31d0,
  .icon-orange-a3dc,
  .mask_outer_97c7,
  .column_wide_206b,
  .heading_wide_ecff {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .video-hard-7f21,
  .sidebar-deb5 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .breadcrumb-iron-cddb,
  .content_dd44,
  .accordion-stale-91cb,
  .shadow-8ee8,
  .layout_advanced_9d5e,
  .hot_209a,
  .tooltip_down_833d {
    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 */
  .hover-steel-2301,
  .widget-under-4d31,
  .over_6825,
  .advanced-c8b3,
  .easy-dda9 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .container_gas_b59e,
  .huge-6a23,
  .tertiary-2e7a,
  .form-926a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .black-db51,
  .tiny_05bb {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .label-c309,
  .tabs-red-04be,
  .iron-4e3b,
  .silver-f167 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .widget-8a5a,
  .texture-purple-40ef,
  .button-c398,
  .image_6278,
  .box_bright_bec2,
  .selected-5c3e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .hover-steel-2301,
  .widget-under-4d31,
  .advanced-c8b3 {
    max-width: none !important;
  }
  
  .north_ae6b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .container_gas_b59e {
    font-size: 1.5rem !important;
  }
  
  .huge-6a23 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tabs-large-40c1,
  .popup_fbc3 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .tertiary-2e7a {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .purple-50d0 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .badge_8539 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hover-steel-2301,
  .advanced-c8b3 {
    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: 3119 */
.phantom-card-a2 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.2;
}
