* {
    box-sizing: border-box;
}
.story-viewer-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

.story-wrapper {
    position: relative;
    width: 100%;
    max-width: 720px;
    /* Fixed Max Width */
    aspect-ratio: 9 / 16;
    /* Enforce 9:16 Ratio */
    max-height: 1280px;
    /* Fixed Max Height */
    height: auto;
    /* Allow height to adjust based on ratio */
    background: #111;
    display: flex;
    flex-direction: column;
    margin: auto;
    /* Center it */
}

.story-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    background-size: 100% 100%;
    /* FORCE STRETCH */
    background-position: center;
    background-repeat: no-repeat;
    animation: fadeIn 0.3s ease;
}

.story-slide.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.story-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 15px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.progress-container {
    display: flex;
    gap: 4px;
    width: 100%;
}

.progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    flex-grow: 1;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #fff;
    width: 0%;
}

.story-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.story-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.story-controls-top {
    display: flex;
    gap: 15px;
}

.control-btn {
    color: #fff;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
}

.control-btn:hover {
    transform: scale(1.1);
}

.nav-areas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    z-index: 5;
}

.nav-area-left,
.nav-area-right {
    width: 50%;
    height: 100%;
    cursor: pointer;
}

.story-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.story-nav-btns {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: space-between;
}

.story-nav-btn {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.story-nav-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

@media (min-width: 768px) {
    .story-wrapper {
        border-radius: 12px;
        height: 90vh;
        max-height: 850px;
        margin: auto;
    }
}