* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, sans-serif;
    color: #fff;
    background: #111;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #333;
}

.header h1 {
    margin: 0;
}

.header a {
    padding: 10px 16px;
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, #ff2e85, #8b5cf6);
}

.story-list {
    display: flex;
    gap: 18px;
    padding: 24px;
    overflow-x: auto;
}

.story-button {
    width: 82px;
    flex: 0 0 82px;
    border: 0;
    color: #fff;
    background: transparent;
    cursor: pointer;
}

.story-ring {
    display: block;
    width: 74px;
    height: 74px;
    margin: 0 auto 7px;
    padding: 3px;
    border-radius: 50%;
    background: conic-gradient(
        #feda75,
        #fa7e1e,
        #d62976,
        #962fbf,
        #4f5bd5,
        #feda75
    );
}

.story-ring img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border: 3px solid #111;
    border-radius: 50%;
}

.story-user {
    display: block;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.story-viewer[hidden] {
    display: none;
}

.story-viewer {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.9);
}

.story-modal {
    position: relative;
    width: min(100vw, 430px);
    height: min(100vh, 760px);
    overflow: hidden;
    border-radius: 18px;
    background: #000;
}

.story-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.story-header {
    position: absolute;
    z-index: 4;
    top: 22px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    background: linear-gradient(
        rgba(0, 0, 0, 0.7),
        transparent
    );
}

.story-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.story-profile img {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border: 2px solid #fff;
    border-radius: 50%;
}

.story-profile div {
    display: grid;
}

.story-header button {
    border: 0;
    color: #fff;
    font-size: 30px;
    background: transparent;
    cursor: pointer;
}

.story-caption {
    position: absolute;
    z-index: 4;
    right: 16px;
    bottom: 24px;
    left: 16px;
    margin: 0;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    background: rgba(0, 0, 0, 0.55);
}

.progress-bars {
    position: absolute;
    z-index: 5;
    top: 9px;
    right: 10px;
    left: 10px;
    display: flex;
    gap: 4px;
}

.progress-track {
    flex: 1;
    height: 3px;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.35);
}

.progress-fill {
    display: block;
    width: 0;
    height: 100%;
    background: #fff;
    transition-property: width;
    transition-timing-function: linear;
}

.navigation {
    position: absolute;
    z-index: 3;
    top: 80px;
    bottom: 0;
    width: 40%;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.navigation.previous {
    left: 0;
}

.navigation.next {
    right: 0;
}

@media (max-width: 480px) {
    .story-modal {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}

.progress-fill {
    display: block;
    width: 0;
    height: 100%;
    background: #ffffff;
}