/* Horizontal Gallery */
.horizontal-section {
  height: 5000px;
  background: #0f172a;
  margin-inline: -1rem;
  position: relative;
}

.sticky-wrapper {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #0f172a;
  contain: layout style paint;
}

.marquee-track {
  display: flex;
  gap: 100px;
  padding-left: 200px;
  contain: layout style paint;
  -webkit-overflow-scrolling: touch;
  transform: translateZ(0);
  isolation: isolate;
  transition: none;
}

.img-card {
  flex-shrink: 0;
  width: 80vh;
  height: 65vh;
  background: white;
  border-radius: 25px;
  padding: 15px;
  position: relative;
  text-align: justify;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  transform: translateZ(0);
  filter: drop-shadow(0 30px 60px rgba(0,0,0,0.6));
}

.img-card img {
  width: 100%;
  height: 65%;
  object-fit: cover;
  display: block;
  margin-bottom: 15px;
  border-radius: 4px;
}

.card-content {
  padding: 10px;
}

.img-title {
  display: block;
  background: black;
  color: white;
  padding: 5px 12px;
  font-weight: 900;
  font-size: 1.1rem;
  text-transform: uppercase;
  width: fit-content;
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.img-body {
  font-size: 1.5rem;
  font-weight: 400;
  color: #334155;
  line-height: 1.4;
  display: block;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
}

/* Animate card text when in view */
.img-card.animate .img-title,
.img-card.animate .img-body {
  opacity: 1;
  transform: translateY(0);
}

/* Hidden dummy card */
.dummy-card {
  opacity: 0;
  pointer-events: none;
  box-shadow: none;
  background: transparent !important;
  width: 600vh;
  height: 65vh;
}

/* === Stat Cards (Cards 1 & 2) === */
.stats-container {
  margin-top: 12px;
  font-size: 1.3rem;
  font-weight: 500;
  color: #334155;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
}

.img-card.animate .stats-container {
  opacity: 1;
  transform: translateY(0);
}

/* === TOTAL + TROLL ROW — FIXED FOR ALL DEVICES === */
.stat-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  width: 100%;
}

.stat-total-users,
.stat-total-trolls {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  white-space: nowrap;
  min-width: 0; /* prevents overflow issues */
}

/* === DESKTOP: age groups inline === */
@media (min-width: 769px) {
  .stat-desktop {
    display: flex;
    justify-content: space-between;
    gap: 40px;
  }
  .stat-desktop .group {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
  }
  .stat-desktop .icon {
    font-size: 1.6rem;
  }
  .stat-mobile {
    display: none;
  }
}

/* === MOBILE: age groups stacked, total row STILL INLINE === */
@media (max-width: 768px) {
  .img-card {
    width: 80vw;
    height: 55vh;
    max-height: 400px;
    padding: 10px;
    border-radius: 15px;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
    transform: translateZ(0) !important;
    transition: none !important;
  }

  .img-card img {
    height: 40%;
  }

  .img-title {
    font-size: 1rem;
    padding: 4px 8px;
    text-align: left;
  }

  .img-body {
    font-size: 0.9rem;
    line-height: 1.3;
    padding-top: 5%;
  }

  .marquee-track {
    gap: 50px;
    padding-left: 50px;
  }

  .dummy-card {
    width: 400vw;
    height: 40vh;
  }

  .stats-container {
    font-size: 1rem;
  }

  /* ✅ CRITICAL: Keep total row inline on mobile */
  .stat-total-row {
    gap: 12px;
  }

  .stat-total-users,
  .stat-total-trolls {
    font-size: 0.95rem;
  }

  /* Hide desktop, show mobile age layout */
  .stat-desktop {
    display: none;
  }

  .stat-mobile {
    display: flex;
    justify-content: space-between;
    gap: 20px;
  }

  .stat-mobile .mobile-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 45%;
    text-align: center;
  }

  .stat-mobile .label {
    margin-bottom: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .stat-mobile .value {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
  }

  .stat-mobile .icon {
    font-size: 1rem;
  }

  .stat-mobile .number {
    font-size: 1em;
  }
}

/* Scroll-triggered carousel title */
.carousel-title {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.carousel-title.animate {
  opacity: 1;
  transform: translateY(0);
}

/* iOS-Specific Performance Fix */
@media screen and (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
  .img-card {
    transform: none !important;
    transition: none !important;
  }
  .img-card:hover {
    transform: none !important;
  }
}
/* Skip button fixed to viewport */
#skipButtonOverlay {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 1000;
  pointer-events: none;
}

#skipButtonOverlay .skip-overlay-btn {
  background: rgba(255, 255, 255, 0.92);
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(10px);
}

#skipButtonOverlay .skip-overlay-btn:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

@media (max-width: 768px) {
  #skipButtonOverlay {
    bottom: 12px;
    right: 12px;
  }
  #skipButtonOverlay .skip-overlay-btn {
    font-size: 0.8rem;
    padding: 5px 12px;
  }
}