/* ===== RESET ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0; padding: 0;
    -webkit-tap-highlight-color: transparent;
}

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

/* ===== ВИДИМОСТЬ ===== */
.mobile-view  { display: block; }
.desktop-view { display: none;  }

@media (min-width: 768px) {
    .mobile-view  { display: none;  }
    .desktop-view {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100vh;
        background: #060c16;
        padding: 0 70px;
    }
}

/* Обёртка: слайдер + кнопки снаружи */
.desk-wrapper {
    position: relative;
    width: 100%;
    max-width: min(95vw, calc(95vh * 16 / 9));
    display: flex;
    align-items: center;
}

/* ============================================================
   МОБИЛЬНЫЙ СЛАЙДЕР (9:16)
   ============================================================ */
.stories-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
}

.stories-container {
    position: relative;
    background: #0a0f1e;
    overflow: hidden;
    height: calc(100svh - 44px);
    width: 100vw;
}

.slides-track {
    position: absolute;
    inset: 0;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.25s ease;
    background: #080d1a;
}
.slide.active { opacity: 1; }

.slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* Прогресс-бары */
.progress-bars {
    position: absolute;
    top: 10px; left: 10px; right: 10px;
    display: flex;
    gap: 4px;
    z-index: 10;
    pointer-events: none;
}
.progress-bar {
    flex: 1; height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px; overflow: hidden;
}
.progress-fill {
    height: 100%; background: #fff;
    border-radius: 3px; width: 0%;
}
.progress-bar.done  .progress-fill { width: 100%; }
.progress-bar.active .progress-fill { width: 50%; }

/* Зоны тапа */
.tap-zone {
    position: absolute;
    top: 0; bottom: 0; width: 40%;
    z-index: 20; cursor: pointer;
}
.tap-left  { left: 0; }
.tap-right { right: 0; }

/* Нижняя панель */
.bottom-nav {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Точки */
.dots-nav {
    display: flex;
    gap: 6px;
    align-items: center;
}
.dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: all 0.25s;
    cursor: pointer;
}
.dot.active {
    background: #00d4ff;
    width: 20px;
    border-radius: 3px;
}

/* Telegram кнопка */
.cta-overlay {
    position: absolute;
    bottom: 6%; left: 0; right: 0;
    display: flex;
    justify-content: center;
    z-index: 15;
    pointer-events: none;
}
.tg-button {
    pointer-events: all;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #0088cc, #00aee4);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-size: clamp(14px, 3.5vw, 17px);
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 24px rgba(0,180,230,0.45);
    transition: transform 0.18s, box-shadow 0.18s;
    white-space: nowrap;
}
.tg-button:hover, .tg-button:active {
    transform: scale(1.04);
    box-shadow: 0 6px 32px rgba(0,180,230,0.65);
}
.tg-icon { width: 22px; height: 22px; flex-shrink: 0; }

/* ============================================================
   ДЕСКТОП СЛАЙДЕР (16:9)
   ============================================================ */
.desk-slider {
    position: relative;
    width: 100%;
    flex: 1;
    background: #0a0f1e;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 80px rgba(0,200,255,0.1);
    aspect-ratio: 16 / 9;
}

.desk-track { position: absolute; inset: 0; }

.desk-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: #080d1a;
}
.desk-slide.active { opacity: 1; }

.desk-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* Стрелки десктоп */
.desk-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px; height: 52px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.2);
    background: rgba(8,13,26,0.7);
    backdrop-filter: blur(8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.desk-btn svg { width: 22px; height: 22px; }
.desk-btn:hover {
    background: rgba(0,180,230,0.3);
    border-color: rgba(0,212,255,0.6);
    transform: translateY(-50%) scale(1.08);
}
.desk-btn:active { transform: translateY(-50%) scale(0.94); }
.desk-btn:disabled { opacity: 0.2; cursor: default; pointer-events: none; }

/* Кнопки снаружи слайдера, в обёртке */
.desk-prev { left: -62px; }
.desk-next { right: -62px; }

/* Прогресс-бары десктоп */
.desk-progress {
    position: absolute;
    top: 14px; left: 14px; right: 14px;
    display: flex;
    gap: 5px;
    z-index: 10;
    pointer-events: none;
}
.desk-progress .progress-bar {
    flex: 1; height: 3px;
    background: rgba(255,255,255,0.25);
    border-radius: 3px; overflow: hidden;
}
.desk-progress .progress-fill {
    height: 100%; background: #fff;
    border-radius: 3px; width: 0%;
}
.desk-progress .progress-bar.done  .progress-fill { width: 100%; }
.desk-progress .progress-bar.active .progress-fill { width: 50%; }

/* Точки десктоп */
.desk-dots {
    position: absolute;
    bottom: 18px; left: 0; right: 0;
    display: flex;
    gap: 7px;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}
.desk-dots .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: all 0.25s;
    cursor: pointer;
    pointer-events: all;
}
.desk-dots .dot.active {
    background: #00d4ff;
    width: 24px;
    border-radius: 4px;
}
