/* ============================================
   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_3b81) is a descendant of
   .bottom-eb3f (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.
   Two site templates coexist: legacy obfuscated-class (header.shadow-full-e2be)
   and the redesigned template (header.wrapper_south_b387). Keep both selectors. */
header.shadow-full-e2be,
header.wrapper_south_b387 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".huge_d5a0" 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.yellow_e45e so it can't cause
   horizontal overflow anyway. */
.heading-a7a2,
.notice_basic_cbbd,
.tertiary_lower_8388,
.gradient_f533,
.form_2f1c,
.white-2676,
.avatar-bronze-c26f,
.modal-f400,
.info_cool_2179,
.stone-a58e,
.plasma-9c0e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hidden-8f70 {
    padding: 8px 0;
  }
  
  .preview_70b2 img {
    height: 28px;
    width: auto;
  }
  
  .east_5e1b {
    display: none !important;
  }
  
  .small_16c6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .small_16c6 svg {
    width: 14px;
    height: 14px;
  }
  
  .filter_medium_3b5e {
    padding: 6px;
  }
  
  .container_5ef4 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tertiary_lower_8388,
  .notice_basic_cbbd,
  .gradient_f533,
  .form_2f1c,
  .label_inner_4c40,
  .button_thick_527e,
  .pressed_6a5a,
  .left-d7b6,
  .logo-acb1,
  .form-61ee,
  .basic-dfec,
  .avatar-motion-4cc3 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .tiny_ac24,
  .module-black-e835 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .gold_123d,
  .disabled_lower_30bb,
  .narrow-80c2,
  .image-slow-f330,
  .header_b136,
  .summary_2138,
  .steel_e60b {
    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 */
  .border-7ca7,
  .notice-stone-05c5,
  .icon_b037,
  .heading_fb08,
  .avatar-2fdc {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .glass-acda,
  .selected_ceb3,
  .list-paper-d601,
  .tall-221f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .clean_0956,
  .over-797f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .block-3301,
  .notice-active-5063,
  .feature_0dfd,
  .chip-cd15 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .top_aed3,
  .active_bbc3,
  .content_1276,
  .dirty-6172,
  .copper_002d,
  .main-55e1 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .border-7ca7,
  .notice-stone-05c5,
  .heading_fb08 {
    max-width: none !important;
  }
  
  .huge_d5a0 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .glass-acda {
    font-size: 1.5rem !important;
  }
  
  .selected_ceb3 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .carousel_ff9b,
  .pagination-wood-23a7 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .list-paper-d601 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .mini-6c1c {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .title_84a8 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .border-7ca7,
  .heading_fb08 {
    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: 94a5 */
.shade_down_a106 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 3917 */
.shadow-element-t3 {
  padding: 0.4rem;
  font-size: 13px;
  line-height: 1.3;
}
