* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

.reel {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  background: #000;
  overflow: hidden;
}

/* Progress bar (estilo stories) */
.progress-bar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 10;
  display: flex;
  gap: 6px;
}

.segment {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  overflow: hidden;
}

.segment span {
  display: block;
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 3px;
}

.segment.done span {
  width: 100%;
  transition: none;
}

.segment.active span {
  width: 0%;
  animation: fill 4s linear forwards;
}

.reel.paused .segment.active span {
  animation-play-state: paused;
}

@keyframes fill {
  from { width: 0%; }
  to { width: 100%; }
}

/* Slides */
.slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Navegación manual */
.nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 25%;
  background: transparent;
  border: none;
  color: transparent;
  cursor: pointer;
  z-index: 5;
  font-size: 1.5rem;
}

.nav.prev { left: 0; }
.nav.next { right: 0; }

.nav:hover { color: rgba(255, 255, 255, 0.5); }

/* Caption */
.caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 56px;
  z-index: 8;
  padding: 0 24px;
  text-align: center;
  pointer-events: none;
}

.caption p {
  display: none;
  color: #fff;
  font-size: 1.9rem;
  line-height: 1.4;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.caption p.active {
  display: block;
}

/* Dots */
.dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  z-index: 8;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0;
}

.dot.active {
  background: #fff;
}

/* Gradiente para legibilidad del texto */
.reel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 35%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  pointer-events: none;
  z-index: 6;
}
