/* ============================================
   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 (.under-d12a) is a descendant of
   .focus-42b7 (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.next_e692 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".green-7905" 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.lite_c41b so it can't cause
   horizontal overflow anyway. */
.shadow_advanced_0824,
.bronze-c035,
.wrapper_fresh_ad02,
.pressed-e71f,
.hard_a783,
.preview_over_1de7,
.dropdown-5a1f,
.paragraph_bottom_36ee,
.block-medium-fdac,
.link-pressed-ca63,
.aside-0d22 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .thumbnail-inner-04a6 {
    padding: 8px 0;
  }
  
  .highlight_basic_4cac img {
    height: 28px;
    width: auto;
  }
  
  .panel-58e7 {
    display: none !important;
  }
  
  .layout-9f47 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .layout-9f47 svg {
    width: 14px;
    height: 14px;
  }
  
  .detail-east-b6d4 {
    padding: 6px;
  }
  
  .main_first_7d75 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .wrapper_fresh_ad02,
  .bronze-c035,
  .pressed-e71f,
  .hard_a783,
  .search_green_8181,
  .black_3c7b,
  .out-6997,
  .tertiary_in_1dc7,
  .stone_9c45,
  .full_b1d2,
  .notification_warm_321f,
  .sidebar_middle_22fd {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .layout-cd4c,
  .tooltip_1e5e {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .heading-first-aa2f,
  .caption_da51,
  .hidden-3133,
  .status-818e,
  .pressed-a160,
  .over-3693,
  .action_e663 {
    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 */
  .old-cf29,
  .column-first-6128,
  .popup_action_d150,
  .last-0850,
  .last-26c3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .item_0cc0,
  .full-5692,
  .modal-south-eaec,
  .paper_3dcf {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .title_advanced_d0e6,
  .table_a7b5 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .stone_2693,
  .tag_e1d2,
  .full-9a42,
  .shade_924f {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .light_2493,
  .static-f9ae,
  .upper-2c0c,
  .detail_221b,
  .caption-072d,
  .breadcrumb_5097 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .old-cf29,
  .column-first-6128,
  .last-0850 {
    max-width: none !important;
  }
  
  .green-7905 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .item_0cc0 {
    font-size: 1.5rem !important;
  }
  
  .full-5692 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .full-2a9a,
  .badge-gold-9199 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .modal-south-eaec {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .avatar-static-bcb5 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .chip_7eb8 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .old-cf29,
  .last-0850 {
    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: 8a8f */
.phantom-card-p2 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.2;
}
