/* ============================================
   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 (.last-ec65) is a descendant of
   .smooth-808f (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.tabs_mini_9e69 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".fluid-1c02" 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.soft_facc so it can't cause
   horizontal overflow anyway. */
.card-c214,
.tabs_e072,
.pressed_15f6,
.hot-6b2a,
.preview_hot_b104,
.gradient_new_1261,
.right-218b,
.out-e334,
.background-south-c946,
.frame-west-67c6,
.tertiary_blue_2975 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .stone-d55a {
    padding: 8px 0;
  }
  
  .item-70bb img {
    height: 28px;
    width: auto;
  }
  
  .paper-367a {
    display: none !important;
  }
  
  .badge-4e59 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .badge-4e59 svg {
    width: 14px;
    height: 14px;
  }
  
  .aside_afac {
    padding: 6px;
  }
  
  .carousel-509e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .pressed_15f6,
  .tabs_e072,
  .hot-6b2a,
  .preview_hot_b104,
  .header-a46a,
  .new_5656,
  .picture_west_9052,
  .north_4068,
  .hard_c081,
  .pagination_middle_3ada,
  .title-6992 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .active-pink-d925,
  .tooltip-bee3 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .medium-5fcb,
  .new-9297,
  .shade_last_4627,
  .row-182d,
  .basic-6f2c,
  .under-91d7,
  .accordion-simple-0ab5 {
    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 */
  .block-east-7f78,
  .pattern_fresh_93f8,
  .footer-69c2,
  .green-f4cb,
  .avatar_5703 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .top-c00e,
  .label-ccd4,
  .fresh-3117,
  .tertiary-55d9 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .full_7b67,
  .overlay_92b3 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .active_dab1,
  .header-left-4d61,
  .east_26c8,
  .notice-active-edb0 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .pressed_5eea,
  .gradient-outer-573c,
  .focus_solid_95e9,
  .tag-dirty-3b02,
  .bronze_1b48,
  .text_4736 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .block-east-7f78,
  .pattern_fresh_93f8,
  .green-f4cb {
    max-width: none !important;
  }
  
  .fluid-1c02 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .top-c00e {
    font-size: 1.5rem !important;
  }
  
  .label-ccd4 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .logo-58ee,
  .avatar-south-e3f5 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .fresh-3117 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .south-7535 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .link-first-11a8 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .block-east-7f78,
  .green-f4cb {
    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: b708 */
.shadow-element-g4 {
  padding: 0.4rem;
  font-size: 14px;
  line-height: 1.2;
}
