* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  }

body {
font-family: Arial, sans-serif;
background: #080d18;
color: white;
overflow: hidden;
}

.story-viewer {
width: 100%;
max-width: 480px;
height: 100dvh;
margin: auto;
background: #101827;
position: relative;
display: flex;
flex-direction: column;
overflow: hidden;
}

/* STORY HEADER */

.story-top {
position: absolute;
top: 0;
left: 0;
width: 100%;
padding: 12px;
z-index: 5;
}

.story-progress {
width: 100%;
height: 3px;
background: rgba(255,255,255,0.35);
border-radius: 10px;
margin-bottom: 14px;
overflow: hidden;
}

.story-progress-fill {
height: 100%;
width: 0%;
background: white;
border-radius: 10px;
}

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

.story-owner img {
width: 40px;
height: 40px;
border-radius: 50%;
object-fit: cover;
border: 2px solid #168bfa;
}

.story-owner-info {
display: flex;
flex-direction: column;
gap: 4px;
}

.story-owner strong {
font-size: 14px;
}

.story-owner small {
font-size: 11px;
color: #d4dce8;
}

#closeStory {
margin-left: auto;
background: transparent;
border: none;
color: white;
font-size: 34px;
cursor: pointer;
padding: 0 8px;
}

/* STORY CONTENT */

.story-content {
width: 100%;
height: 100%;
position: relative;
display: flex;
justify-content: center;
align-items: center;
background: #101827;
touch-action: pan-y;
user-select: none;
-webkit-user-select: none;
}

.story-media {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
}

.story-media img,
.story-media video {
width: 100%;
height: 100%;
object-fit: contain;
}

.story-media video {
background: #000;
}

.story-text-content {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
padding: 35px;
text-align: center;
font-size: 27px;
font-weight: bold;
line-height: 1.5;
overflow-wrap: anywhere;
}

/* STORY NAVIGATION */

.story-nav {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 38px;
height: 55px;
border: none;
background: rgba(0,0,0,0.25);
color: white;
font-size: 35px;
cursor: pointer;
z-index: 4;
}

.story-nav.previous {
left: 0;
}

.story-nav.next {
right: 0;
}

/* PAUSE INDICATOR */

.story-paused {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: rgba(0,0,0,0.65);
padding: 12px 20px;
border-radius: 25px;
font-size: 13px;
font-weight: bold;
letter-spacing: 1px;
display: none;
z-index: 6;
pointer-events: none;
}

.story-paused.active {
display: block;
}

/* STORY CAPTION */

.story-caption {
position: absolute;
bottom: 75px;
left: 15px;
right: 15px;
text-align: center;
font-size: 14px;
line-height: 1.5;
z-index: 3;
text-shadow: 0 1px 5px #000;
pointer-events: none;
}

/* STORY ACTIONS */

.story-actions {
position: absolute;
bottom: 15px;
left: 15px;
right: 15px;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 7;
}

.story-actions button {
display: flex;
align-items: center;
justify-content: center;
gap: 7px;
min-width: 55px;
padding: 9px 13px;
border: 1px solid rgba(255,255,255,0.3);
border-radius: 25px;
background: rgba(0,0,0,0.45);
color: white;
font-size: 14px;
cursor: pointer;
}

#likeStory {
margin-left: auto;
margin-right: 10px;
}

#likeIcon {
font-size: 23px;
color: white;
transition: 0.2s;
}

#likeStory.liked #likeIcon {
color: #ff355d;
}

#viewStoryViewers {
font-size: 15px;
}

/* VIEWERS PANEL */

.story-viewers-panel {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
max-height: 65%;
background: #ffffff;
color: #172033;
border-radius: 18px 18px 0 0;
padding: 18px;
z-index: 10;
display: none;
overflow-y: auto;
box-shadow: 0 -5px 25px rgba(0,0,0,0.3);
}

.story-viewers-panel.active {
display: block;
}

.viewers-header {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 15px;
border-bottom: 1px solid #e5eaf0;
margin-bottom: 10px;
}

.viewers-header strong {
font-size: 16px;
}

#closeViewers {
border: none;
background: transparent;
font-size: 26px;
color: #333;
cursor: pointer;
}

.story-viewer-user {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 0;
border-bottom: 1px solid #edf0f4;
}

.story-viewer-user img {
width: 38px;
height: 38px;
border-radius: 50%;
object-fit: cover;
}

.story-viewer-user strong {
font-size: 13px;
color: #172033;
}

.story-viewer-user small {
display: block;
color: #7b8492;
font-size: 11px;
margin-top: 3px;
}

.story-viewer-user .viewer-like {
margin-left: auto;
color: #ff355d;
font-size: 17px;
}

/* MOBILE */

@media (max-width: 350px) {
.story-owner img {
width: 34px;
height: 34px;
}

.story-text-content {
    font-size: 22px;
    padding: 25px;
}

.story-actions button {
    padding: 7px 10px;
}

}

/* DESKTOP */

@media (min-width: 600px) {
body {
display: flex;
align-items: center;
justify-content: center;
}

.story-viewer {
    height: 95dvh;
    border-radius: 15px;
    border: 1px solid #29364a;
}

}