/* Истории */
.stories-carousel-section {
  position: relative;
  z-index: 3;
  bottom: 43px;
  padding: 0px 0px;
  background: var(--darker-slate);
}

.stories-carousel {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 60px;
  overflow: hidden;
}

.stories-track {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.stories-track::-webkit-scrollbar {
  display: none;
}

.story-item {
  flex: 0 0 280px;
  scroll-snap-align: start;
  cursor: pointer;
}

.story-container {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  border-radius: 16px;
  overflow: hidden;
  background: var(--matte-grey, #393f4d);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-md);
}

.story-item:hover .story-container {
  transform: translateY(-5px) scale(1.02);
}

.story-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: opacity 0.25s ease;
}

.story-poster.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.story-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
}

.story-item.is-video-loaded .story-video {
  z-index: 2;
}

.story-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 20%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: white;
}

.story-overlay h3 {
  margin-bottom: 15px;
  font-size: 1.1rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.story-play, .play-button {
  width: 50px;
  height: 50px;
  background: rgba(254, 218, 106, 0.9);
  border: none;
  border-radius: 50%;
  color: var(--dark-slate);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-play:hover, .play-button:hover {
  background: var(--bee-yellow);
  transform: scale(1.1);
}

.play-button {
  width: 60px;
  height: 60px;
  font-size: 1.5rem;
}

.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--bee-yellow);
  z-index: 2;
  transition: width 0.1s linear;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(29, 30, 34, 0.8);
  backdrop-filter: blur(5px);
  border: none;
  border-radius: 50%;
  color: var(--bee-yellow);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stories-carousel:hover .carousel-nav {
  opacity: 1;
}

.carousel-nav.prev {
  left: 0;
}

.carousel-nav.next {
  right: 0;
}

.mute-icon {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  cursor: pointer;
}

.story-item:hover .mute-icon {
  opacity: 1;
  pointer-events: auto;
  animation: pulse 2s infinite;
}

.story-video[muted] + .progress-bar + .mute-icon {
  opacity: 1;
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(254, 218, 106, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark-slate);
  font-size: 24px;
  cursor: pointer;
  z-index: 3;
  opacity: 0.9;
  transition: transform 0.3s ease;
}

.play-button:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--bee-yellow);
}

/* Мобильные правки stories — в layout/home-mobile.css (грузится после async) */