/* ═══════════════════════════════════════════
   STORIES — кружки + fullscreen просмотрщик
   ═══════════════════════════════════════════ */

/* ─── Circles row ─── */
.stories-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 12px;
}
.stories-row::-webkit-scrollbar { display: none; }

.story-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    width: 100px;
}
@media (min-width: 768px) { .story-circle { width: 116px; } }

.story-ring {
    width: 95px;
    height: 95px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 40%, #ec4899 70%, #8b5cf6 100%);
    transition: transform .2s;
}
@media (min-width: 768px) { .story-ring { width: 106px; height: 106px; } }

.story-circle:hover .story-ring { transform: scale(1.06); }

.story-circle.viewed .story-ring {
    background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%);
}

.story-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #f3f4f6;
    background-size: cover;
    background-position: center;
    border: 3px solid #fff;
    font-weight: 700;
    font-size: 28px;
    color: #059669;
    overflow: hidden;
}

.story-name {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    max-width: 106px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}

/* ─── Fullscreen viewer ─── */
.story-viewer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}
.story-viewer.open {
    opacity: 1;
    pointer-events: auto;
}

.sv-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
}

.sv-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    max-height: 100vh;
    background: #000;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
@media (min-width: 768px) {
    .sv-container {
        height: min(92vh, 780px);
        max-height: 780px;
        border-radius: 16px;
    }
}

/* Progress bars */
.sv-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    gap: 3px;
    padding: 8px 10px 0;
}
.sv-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}
.sv-bar-fill {
    height: 100%;
    width: 0;
    background: #fff;
    border-radius: 2px;
}

/* Header */
.sv-header {
    position: absolute;
    top: 18px;
    left: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sv-author {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sv-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #374151;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.sv-author-name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}
.sv-time {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}
.sv-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
}
.sv-close:hover { background: rgba(255, 255, 255, 0.25); }

/* Media area */
.sv-media {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.sv-img, .sv-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Gradient overlays — top (header/progress) and bottom (text/CTA) */
.sv-container::before,
.sv-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    z-index: 3;
    pointer-events: none;
}
.sv-container::before {
    top: 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
    border-radius: 16px 16px 0 0;
}
.sv-container::after {
    bottom: 0;
    height: 280px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 40%, transparent 100%);
    border-radius: 0 0 16px 16px;
}
@media (max-width: 767px) {
    .sv-container::before { border-radius: 0; }
    .sv-container::after { border-radius: 0; }
}

/* Text overlay */
.sv-overlay-text {
    position: absolute;
    left: 20px;
    right: 20px;
    z-index: 5;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.sv-overlay-text.pos-top { top: 70px; }
.sv-overlay-text.pos-center { top: 50%; transform: translateY(-50%); text-align: center; }
.sv-overlay-text.pos-bottom { bottom: 100px; }

/* CTA button */
.sv-cta-wrap {
    position: absolute;
    bottom: 36px;
    left: 20px;
    right: 20px;
    z-index: 5;
    display: flex;
    justify-content: flex-start;
}
.sv-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #fff;
    color: #111827;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .15s, background .15s;
}
.sv-cta:hover { transform: scale(1.03); background: #f3f4f6; }

/* Tap zones (invisible) */
.sv-tap {
    position: absolute;
    top: 60px;
    bottom: 80px;
    z-index: 4;
    cursor: pointer;
}
.sv-tap-left { left: 0; width: 30%; }
.sv-tap-right { right: 0; width: 70%; }

/* Nav arrows (desktop) */
.sv-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
}
.sv-nav:hover { background: rgba(255, 255, 255, 0.25); }
.sv-nav-prev { left: -56px; }
.sv-nav-next { right: -56px; }
@media (min-width: 768px) {
    .sv-nav { display: flex; }
}
