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

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

/* ===== DESKTOP BACKGROUND ===== */
.desktop-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0, 180, 220, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(0, 100, 180, 0.06) 0%, transparent 60%),
        #060c16;
    z-index: 0;
}

/* ===== WRAPPER ===== */
.stories-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100vh;
    gap: 0;
}

@media (min-width: 600px) {
    .stories-wrapper {
        justify-content: center;
        gap: 14px;
    }
}

/* ===== STORIES CONTAINER ===== */
.stories-container {
    position: relative;
    background: #0a0f1e;
    overflow: hidden;
    border-radius: 0;
    box-shadow: 0 0 60px rgba(0, 200, 255, 0.08);

    /* Mobile: полный экран */
    height: 100svh;
    width: 100vw;
    aspect-ratio: unset;
    max-width: 100vw;
}

/* ===== DESKTOP STYLES ===== */
@media (min-width: 600px) {
    .stories-container {
        border-radius: 16px;
        height: calc(100vh - 60px);
        max-height: 860px;
        aspect-ratio: 9 / 16;
        width: auto;
        max-width: none;
    }
}

/* ===== SLIDES ===== */
.slides-track {
    position: absolute;
    inset: 0;
}

.slide {
    position: absolute;
    inset: 0;
    display: none;
    background: #080d1a;
}

.slide.active {
    display: block;
}

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

/* ===== PROGRESS BARS ===== */
.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%;
    transition: none;
}

.progress-bar.done .progress-fill {
    width: 100%;
}

.progress-bar.active .progress-fill {
    animation: progressAnim var(--duration, 5s) linear forwards;
}

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

/* ===== TAP ZONES ===== */
.tap-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 35%;
    z-index: 20;
    cursor: pointer;
}

.tap-left  { left: 0; }
.tap-right { right: 0; }

/* ===== BOTTOM NAV (стрелки + точки/счётчик) ===== */
.bottom-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    max-width: 420px;
    padding: 0 4px;
}

/* ===== NAV ARROWS ===== */
.nav-btn {
    display: none;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    background: rgba(10, 15, 30, 0.7);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

.nav-btn:hover {
    background: rgba(0, 180, 230, 0.3);
    border-color: rgba(0, 212, 255, 0.6);
    transform: scale(1.08);
}

.nav-btn:active {
    transform: scale(0.93);
}

.nav-btn:disabled {
    opacity: 0.2;
    cursor: default;
    pointer-events: none;
}

@media (min-width: 600px) {
    .bottom-nav {
        max-width: none;
        gap: 20px;
    }
    .nav-btn {
        display: flex;
        width: 46px;
        height: 46px;
    }
    .nav-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* ===== SLIDE COUNTER ===== */
.slide-counter {
    display: none;
    color: rgba(255,255,255,0.4);
    font-size: 13px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

@media (min-width: 600px) {
    .slide-counter { display: block; }
}

/* ===== DOTS (MOBILE) ===== */
.dots-nav {
    display: flex;
    gap: 6px;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    transition: all 0.25s;
    cursor: pointer;
}

.dot.active {
    background: #00d4ff;
    width: 20px;
    border-radius: 3px;
}

@media (min-width: 600px) {
    .dots-nav { display: none; }
}

/* Мобильный: точки поверх слайдера снизу */
@media (max-width: 599px) {
    .bottom-nav {
        position: absolute;
        bottom: 14px;
        left: 0;
        right: 0;
        z-index: 40;
        pointer-events: none;
    }
    .bottom-nav .dots-nav {
        pointer-events: all;
    }
    .stories-container {
        position: relative;
    }
}

/* ===== TELEGRAM BUTTON ===== */
.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;
}

/* ===== SLIDE TRANSITION ===== */
.slide {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.slide.active {
    opacity: 1;
}

/* ===== SWIPE HINT (mobile, first load) ===== */
.swipe-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 25;
    animation: hintFade 3s ease forwards;
}

@keyframes hintFade {
    0%   { opacity: 0; }
    20%  { opacity: 1; }
    80%  { opacity: 1; }
    100% { opacity: 0; }
}
