/* Стили блока видео-сторис septik.run (Классическое оформление, аккуратные тусклые иконки Play, Desktop First) */
.hero-stories-wrap, .stories-slider-wrap { width: 100%; max-width: 652px; margin: 6px 0 12px; position: relative; padding: 0 30px; box-sizing: border-box; }
.stories-track { display: flex; gap: 12px; justify-content: flex-start; align-items: flex-start; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; scroll-snap-type: x mandatory; padding: 4px 2px 8px; cursor: grab; user-select: none; width: 100%; box-sizing: border-box; -webkit-overflow-scrolling: touch; }
.stories-track::-webkit-scrollbar { display: none; }
.stories-track.is-dragging { cursor: grabbing; scroll-snap-type: none; }

/* Карточка сторис: СТРОГО 3 ШТУКИ В ВИДИМОЙ ОБЛАСТИ на десктопе, остальные в прокрутке */
.stories-card { flex: 0 0 calc((100% - 24px) / 3); width: calc((100% - 24px) / 3); max-width: calc((100% - 24px) / 3); display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; scroll-snap-align: start; transition: transform 0.2s ease; outline: none; box-sizing: border-box; }
.stories-card:hover { transform: translateY(-3px); }

/* Классическое аккуратное кольцо превью 148x148px (без ядовитого неона и анимаций) */
.stories-ring { position: relative; width: 148px; height: 148px; border-radius: 50%; padding: 3px; box-sizing: border-box; flex-shrink: 0; margin: 0 auto; background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.28); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; }
.stories-card:hover .stories-ring { background: rgba(255, 255, 255, 0.4); border-color: rgba(255, 255, 255, 0.85); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); }

.stories-ring-inner { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: #0f172a; border: 2px solid rgba(255, 255, 255, 0.95); box-sizing: border-box; position: relative; display: flex; align-items: center; justify-content: center; }
.stories-ring-inner img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.stories-card:hover .stories-ring-inner img { transform: scale(1.06); }

/* Иконка Play поверх превью: аккуратная, не жирная, тусклая, полупрозрачная */
.stories-play-ico { position: absolute; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 255, 255, 0.22); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease; }
.stories-play-ico svg { width: 9px; height: 9px; fill: rgba(255, 255, 255, 0.65); margin-left: 2px; transition: fill 0.2s ease; }
.stories-card:hover .stories-play-ico { transform: scale(1.08); background: rgba(0, 0, 0, 0.65); border-color: rgba(255, 255, 255, 0.5); }
.stories-card:hover .stories-play-ico svg { fill: rgba(255, 255, 255, 0.95); }

/* Подпись под кругляшкой в 1 строку */
.stories-caption { margin-top: 8px; font-size: 13px; line-height: 17px; font-weight: 600; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; transition: color 0.2s ease; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85); width: 100%; max-width: 100%; box-sizing: border-box; padding: 0 4px; }
.stories-card:hover .stories-caption { color: #ffffff; }

/* Классические стрелки навигации трека */
.stories-arrow { position: absolute; top: 78px; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; background: rgba(15, 23, 42, 0.85); border: 1px solid rgba(255, 255, 255, 0.25); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); color: #e2e8f0; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 5; transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.stories-arrow svg { width: 14px; height: 14px; }
.stories-arrow:hover { background: #1e293b; color: #ffffff; border-color: rgba(255, 255, 255, 0.6); transform: translateY(-50%) scale(1.08); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); }
.stories-prev { left: 0; }
.stories-next { right: 0; }

/* --- Модальное окно Story Player (Классический чистый плеер) --- */
.stories-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 2000000; display: none; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box; }
.stories-modal.is-active { display: flex; }
body.stories-modal-open { overflow: hidden; }
body.stories-modal-open .tab-bar,
body.stories-modal-open .fab-children,
body.stories-modal-open #floatingButtons {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.stories-modal-backdrop { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.88); backdrop-filter: blur(10px); }

/* Бокс плеера (формат 9:16) */
.stories-player-box { position: relative; z-index: 2; width: 420px; height: 76vh; max-height: 720px; background: #000000; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.15); box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85); overflow: hidden; display: flex; flex-direction: column; }

/* Верхний бар с прогрессом и метаданными */
.stories-top-bar { position: absolute; top: 0; left: 0; width: 100%; z-index: 25; padding: 12px 14px 8px; box-sizing: border-box; background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 80%, transparent 100%); display: flex; flex-direction: column; gap: 8px; }

/* Интерактивные полоски прогресса сторис */
.stories-progress-bars { display: flex; gap: 4px; width: 100%; }
.stories-progress-bar { flex: 1; height: 4px; background: rgba(255, 255, 255, 0.28); border-radius: 2px; overflow: hidden; position: relative; cursor: pointer; transition: height 0.15s ease; }
.stories-progress-bar:hover { height: 6px; }
.stories-progress-fill { height: 100%; width: 0%; background: #ffffff; box-shadow: 0 0 4px rgba(255, 255, 255, 0.6); border-radius: 2px; pointer-events: none; }

.stories-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Регулятор громкости */
.stories-volume-wrap { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 240px; }
.stories-volume-slider { position: relative; width: 100%; height: 20px; display: flex; align-items: center; cursor: pointer; touch-action: none; padding: 0 4px; box-sizing: border-box; }
.stories-volume-track { width: 100%; height: 4px; background: rgba(255, 255, 255, 0.25); border-radius: 2px; position: relative; overflow: hidden; }
.stories-volume-fill { height: 100%; width: 0%; background: #ffffff; border-radius: 2px; pointer-events: none; }
.stories-volume-thumb { position: absolute; top: 50%; left: 0%; transform: translate(-50%, -50%); width: 12px; height: 12px; border-radius: 50%; background: #ffffff; border: 2px solid #0f172a; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); pointer-events: none; transition: transform 0.1s ease; }
.stories-volume-slider:hover .stories-volume-thumb { transform: translate(-50%, -50%) scale(1.2); }

.stories-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.stories-btn { width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.2); color: #ffffff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease; padding: 0; }
.stories-btn:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.6); transform: scale(1.08); }

/* Видео-контейнер и зоны клика */
.stories-video-wrap { position: relative; width: 100%; height: 100%; background: #000000; display: flex; align-items: center; justify-content: center; }
.stories-video-wrap video { width: 100%; height: 100%; object-fit: contain; background: #000000; }

.stories-nav-zone { position: absolute; top: 60px; bottom: 70px; width: 35%; z-index: 10; cursor: pointer; }
.stories-nav-prev { left: 0; }
.stories-nav-next { right: 0; }

/* Нижний бар перемотки */
.stories-bottom-bar { position: absolute; bottom: 0; left: 0; width: 100%; z-index: 25; padding: 10px 14px 12px; box-sizing: border-box; background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 80%, transparent 100%); display: flex; flex-direction: column; gap: 6px; }

/* Таймлайн ползунок */
.stories-timeline-wrap { position: relative; width: 100%; height: 18px; display: flex; align-items: center; cursor: pointer; }
.stories-timeline-track { width: 100%; height: 4px; background: rgba(255, 255, 255, 0.25); border-radius: 2px; position: relative; overflow: hidden; }
.stories-timeline-progress { height: 100%; width: 0%; background: #ffffff; border-radius: 2px; }
.stories-timeline-thumb { position: absolute; top: 50%; left: 0%; transform: translate(-50%, -50%); width: 12px; height: 12px; border-radius: 50%; background: #ffffff; border: 2px solid #0f172a; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); pointer-events: none; transition: transform 0.1s ease; }
.stories-timeline-wrap:hover .stories-timeline-thumb { transform: translate(-50%, -50%) scale(1.2); }

/* Нижние кнопки управления и время */
.stories-bottom-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stories-time-display { font-family: monospace, sans-serif; font-size: 13px; font-weight: 600; color: #e2e8f0; }
.stories-seek-group { display: flex; align-items: center; gap: 6px; }
.stories-seek-btn { background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; padding: 3px 9px; font-family: monospace, sans-serif; font-size: 12px; font-weight: 700; color: #e2e8f0; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease; }
.stories-seek-btn:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.6); color: #ffffff; }

/* Внешние кнопки переключения на ПК */
.stories-modal-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; background: rgba(15, 23, 42, 0.85); border: 1px solid rgba(255, 255, 255, 0.25); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5); color: #ffffff; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10; transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease; }
.stories-modal-arrow:hover { background: #1e293b; border-color: rgba(255, 255, 255, 0.6); transform: translateY(-50%) scale(1.08); }
.stories-modal-prev { left: -70px; }
.stories-modal-next { right: -70px; }

/* Нижняя лента мини-превью роликов */
.stories-modal-thumbs-bar { position: relative; z-index: 5; margin-top: 14px; max-width: 900px; width: 100%; display: flex; justify-content: center; }
.stories-modal-thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 8px 12px; background: rgba(15, 23, 42, 0.88); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6); scrollbar-width: none; -ms-overflow-style: none; }
.stories-modal-thumbs::-webkit-scrollbar { display: none; }

.stories-modal-thumb { flex: 0 0 96px; height: 58px; border-radius: 8px; overflow: hidden; position: relative; cursor: pointer; border: 2px solid transparent; opacity: 0.6; transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.stories-modal-thumb:hover { opacity: 0.95; transform: translateY(-2px); }
.stories-modal-thumb.is-active { opacity: 1; border-color: #ffffff; box-shadow: 0 0 10px rgba(255, 255, 255, 0.4); transform: scale(1.05); }
.stories-modal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stories-modal-thumb-title { position: absolute; bottom: 0; left: 0; width: 100%; padding: 2px 4px; box-sizing: border-box; background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.9) 100%); font-size: 11px; line-height: 13px; font-weight: 700; color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }

/* Медиа-запросы строго внизу в порядке убывания ширины (Desktop First) */
@media (max-width: 1080px) {
    .hero-stories-wrap, .stories-slider-wrap { max-width: 100%; padding: 0 30px; }
    .stories-card { flex: 0 0 156px; width: 156px; min-width: 156px; max-width: 156px; }
    .stories-ring { width: 136px; height: 136px; }
    .stories-arrow { top: 72px; }
    .stories-modal-prev { left: 10px; }
    .stories-modal-next { right: 10px; }
}

@media (max-width: 768px) {
    .hero-stories-wrap, .stories-slider-wrap { padding: 0 10px; margin: 8px auto 10px; max-width: 520px; width: 100%; box-sizing: border-box; }
    .stories-arrow { display: none; }
    .stories-track { gap: 12px; padding: 4px 2px 8px; justify-content: flex-start; scroll-padding: 0 2px; }
    .stories-card { flex: 0 0 calc((100% - 12px) / 2); width: calc((100% - 12px) / 2); max-width: calc((100% - 12px) / 2); }
    .stories-ring { width: 140px; height: 140px; }
    .stories-play-ico { width: 26px; height: 26px; }
    .stories-play-ico svg { width: 8px; height: 8px; }
    .stories-caption { font-size: 13px; line-height: 16px; margin-top: 6px; padding: 0 2px; }
    .stories-player-box { width: 100%; height: calc(100% - 75px); max-height: none; border-radius: 0; border: none; }
    .stories-modal-arrow { display: none; }
    .stories-bottom-bar { padding: 10px 12px 14px; }
    .stories-modal-thumbs-bar { margin-top: 6px; padding: 0 6px; }
    .stories-modal-thumb { flex: 0 0 74px; height: 48px; }
    .stories-volume-wrap { max-width: 180px; gap: 8px; }
}

@media (max-width: 480px) {
    .hero-stories-wrap, .stories-slider-wrap { max-width: 100%; }
}

@media (max-width: 420px) {
    .hero-stories-wrap, .stories-slider-wrap { padding: 0 6px; margin: 6px auto 10px; }
    .stories-track { gap: 10px; padding: 4px 2px 6px; }
    .stories-card { flex: 0 0 calc((100% - 10px) / 2); width: calc((100% - 10px) / 2); max-width: calc((100% - 10px) / 2); }
    .stories-ring { width: 132px; height: 132px; }
    .stories-caption { font-size: 13px; line-height: 16px; }
    .stories-volume-wrap { max-width: 145px; gap: 6px; }
}

@media (max-width: 360px) {
    .hero-stories-wrap, .stories-slider-wrap { padding: 0 4px; }
    .stories-track { gap: 8px; padding: 4px 2px 6px; }
    .stories-card { flex: 0 0 calc((100% - 8px) / 2); width: calc((100% - 8px) / 2); max-width: calc((100% - 8px) / 2); }
    .stories-ring { width: 124px; height: 124px; }
    .stories-caption { font-size: 12px; line-height: 15px; }
    .stories-top-bar { padding: 12px 8px 8px; }
    .stories-volume-wrap { max-width: 125px; gap: 4px; }
}

@media (max-width: 320px) {
    .stories-ring { width: 114px; height: 114px; }
}
