.stories {
    display: flex;
    gap: 18px;
    padding: 30px 20px;
    overflow-x: auto;
    max-width: 900px;
    margin: 0 auto;
    justify-content: center;
}
.story {
    flex: 0 0 auto;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    padding: 3px;
    background: #006dff;
    cursor: pointer;
    transition:
    transform 0.2s ease,
    background 0.3s ease,
    opacity 0.3s ease;
}
.story:hover {
    transform: scale(1.05);
}
.story.viewed {
    background: #d6d6d6;
}
.story-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 0;
}
.story-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.story-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.40s ease;
    z-index: 9999;
}
.story-modal.active {
    opacity: 1;
    visibility: visible;
}
.story-viewer {
    position: relative;

    width: min(90vw, 420px);
    height: min(90vh, 750px);

    aspect-ratio: 9 / 16;

    background: #000;
    border-radius: 14px;
    overflow: hidden;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.story-viewer video {
    width: 100%;
    height: 100%;

    object-fit: cover;
    display: block;
}
.story-progress {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 10;
}
.progress-item {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    overflow: hidden;
}
.progress-item span {
    display: block;
    width: 0;
    height: 100%;
    background: #fff;
}
.progress-item.completed span {
    width: 100%;
}
.story-close {
    position: absolute;
    top: 22px;
    right: 18px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 20;
}
.story-prev,
.story-next {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 35%;
    border: 0;
    background: transparent;
    cursor: pointer;
    z-index: 5;
}
.story-prev {
    left: 0;
}
.story-next {
    right: 0;
}
@media (max-width: 600px) {
    .stories {
    gap: 14px;
    padding: 20px 15px;
    }
    .story {
    width: 70px;
    height: 70px;
    }
    .story-viewer {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    }
}