/* ============================================
   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_top_a419) is a descendant of
   .selected_4174 (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.active-59db {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".image_cool_ea17" 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.modal_narrow_5030 so it can't cause
   horizontal overflow anyway. */
.new_a322,
.shade-40ea,
.hidden_3de1,
.overlay-upper-7165,
.layout_1dd8,
.container_4cee,
.list_f2fb,
.avatar-yellow-855e,
.accent_middle_9570,
.top-bce7,
.block_e764 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .tooltip_wide_4132 {
    padding: 8px 0;
  }
  
  .overlay_27b9 img {
    height: 28px;
    width: auto;
  }
  
  .label_a086 {
    display: none !important;
  }
  
  .soft_84da {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .soft_84da svg {
    width: 14px;
    height: 14px;
  }
  
  .last_82fd {
    padding: 6px;
  }
  
  .fresh-862d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .hidden_3de1,
  .shade-40ea,
  .overlay-upper-7165,
  .layout_1dd8,
  .fixed_0c92,
  .selected-8cdb,
  .picture_hard_e3b9,
  .new-9168,
  .advanced_96fb,
  .disabled_bd70,
  .summary_gold_a330,
  .tabs-cold-8048 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .label-gas-8883,
  .secondary_thick_097c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .dynamic_8f37,
  .static_1889,
  .caption-brown-f7ed,
  .glass_2fd7,
  .current-536d,
  .active_prev_082e,
  .primary_solid_40fe {
    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 */
  .disabled-3340,
  .warm_e2e7,
  .column_west_221b,
  .fresh_5678,
  .orange_9037 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .pattern-tiny-900a,
  .active_steel_1f8a,
  .table-in-2a20,
  .progress-stale-a566 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .caption_action_d18c,
  .detail_e257 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .hover-3afe,
  .left-50fa,
  .shadow_first_9967,
  .title_6912 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .primary_tiny_cf75,
  .pagination-iron-4800,
  .pagination-9521,
  .hover-9051,
  .module_4831,
  .dim_2ab1 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .disabled-3340,
  .warm_e2e7,
  .fresh_5678 {
    max-width: none !important;
  }
  
  .image_cool_ea17 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .pattern-tiny-900a {
    font-size: 1.5rem !important;
  }
  
  .active_steel_1f8a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .status_wood_037c,
  .left_75d8 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .table-in-2a20 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .lower_df9a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .main_steel_5665 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .disabled-3340,
  .fresh_5678 {
    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: dc02 */
.ghost-box-p1 {
  padding: 0.1rem;
  font-size: 11px;
  line-height: 1.1;
}
