.wpstb {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wpstb__title {
    font-size: 24px;
    font-weight: 700;
}

.wpstb__screen {
    max-width: 100%;
    margin-top: 40px;
}

.wpstb-timeline {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 0 10px;
    list-style: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.wpstb-timeline {
    margin: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;

    /* Firefox */
    scrollbar-width: none;

    /* IE/old Edge (на всякий) */
    -ms-overflow-style: none;
}

/* Chrome / Safari */
.wpstb-timeline::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.wpstb-timeline__item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-left: 0;
    cursor: pointer;
}

.wpstb-timeline__ring {
    padding: 3px;
    border-radius: 999px;
    background: linear-gradient(45deg, #facc15, #d946ef);
}

.wpstb-timeline__trigger {
    display: block;
    position: relative;
    padding: 3px;
    border-radius: 999px;
    background: #fff;
    text-decoration: none;
}

.wpstb-timeline__avatar {
    width: 84px;
    height: 84px;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}

.wpstb-timeline__name {
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    max-width: 86px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal reset */
audio,
embed,
iframe,
img,
object,
video {
    height: auto;
    max-width: 100%;
}

/* Modal */
.wpstb-modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    background: transparent;
    overflow: hidden;
    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;
}

.wpstb-modal[hidden] {
    display: none !important;
}

.wpstb-modal.is-open {
    display: flex;
}

.wpstb-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 0;
}

.wpstb-modal__frame {
    position: relative;
    z-index: 2;

    width: 56.25vh;
    max-width: 100vw;
    height: 100vh;
    background: #000;
    overflow: hidden;

    touch-action: pan-y;
}

.wpstb-modal__slides{
    width: 56.25vh;
    max-width: 100vw;
    height: 100vh;

    background: #000;
    overflow: hidden;
    display: flex;
    position: relative;
    transition: transform 0.25s cubic-bezier(0.8, 0, 0.2, 1);
    transform: translate3d(0px, 0px, 0px);
    backface-visibility: hidden;
}

.wpstb-modal__close {
    position: absolute;
    top: 25px;
    right: 12px;
    z-index: 5;
    width: 38px;
    height: 38px;
    border: 0;
    background: none;
    cursor: pointer;
    &:focus {
        outline: none;
    }
}

.wpstb-modal__close svg {
    max-width: 100%;
    height: auto;
}

.wpstb-modal__profile {
    position: absolute;
    top: 25px;
    left: 12px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
}

.wpstb-modal__profile-img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.wpstb-modal__profile-name {
    font-weight: 600;
    font-size: 16px;
    line-height: 1;
    color: #fff;
}

/* Slides */
.wpstb-slide {
    position: relative;
    display: block;
    width: 56.25vh;
    max-width: 100vw;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    will-change: opacity;
    opacity: 0;
    filter: blur(0);
    transition: opacity 0.5s ease, filter 0.25s ease;
}

.wpstb-slide.is-active {
    opacity: 1;
}

body.menu-open .wpstb-slide.is-active {
    filter: blur(10px);
}

.wpstb-slide img,
.wpstb-slide video {
    width: 56.25vh;
    max-width: 100vw;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    display: block;
    position: relative;
    padding: 0;
    margin: 0;
    object-fit: contain;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -o-user-select: none;
    pointer-events: none;
}

/* Nav */
.wpstb-modal__nav {
    display: block;
    width: 48px;
    height: 48px;
    text-align: center;
    cursor: pointer;
    position: absolute;
    top: calc(50% - 16px);
}

body.mobile .wpstb-modal__nav {
    display: none;
}

.wpstb-modal__nav svg {
    width: 100%;
    height: auto;
}

.wpstb-modal__nav--prev {
    left: calc(50% - 35vh - 16px);
}

.wpstb-modal__nav--prev svg {
    transform: rotate(-180deg);
}

.wpstb-modal__nav--next {
    left: calc(50% + 35vh - 16px);
}

.wpstb-modal__center-area {
    position: absolute;
    width: 30vh;
    height: 75vh;
    z-index: 1;
    display: block;
    top: 15vh;
    left: calc(50% - 15vh);
}

@media (min-width: 800px) {
    .wpstb-modal__center-area {
        width: 55vh;
        top: 12.5vh;
        left: calc(50% - 27.5vh);
    }
}

/* Progress */
.wpstb-modal__progress {
    position: absolute;
    padding: 10px 5px 87px;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    display: flex;
    z-index: 999;
    pointer-events: none;
}

.wpstb-modal__progress::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: linear-gradient(rgba(0, 0, 0, 0.5), transparent);
    pointer-events: none;
}

.wpstb-modal__progress[data-count="1"] .wpstb-bar { width: calc(100% - 6px); }
.wpstb-modal__progress[data-count="2"] .wpstb-bar { width: calc(100% / 2 - 6px); }
.wpstb-modal__progress[data-count="3"] .wpstb-bar { width: calc(100% / 3 - 6px); }
.wpstb-modal__progress[data-count="4"] .wpstb-bar { width: calc(100% / 4 - 6px); }
.wpstb-modal__progress[data-count="5"] .wpstb-bar { width: calc(100% / 5 - 6px); }
.wpstb-modal__progress[data-count="6"] .wpstb-bar { width: calc(100% / 6 - 6px); }
.wpstb-modal__progress[data-count="7"] .wpstb-bar { width: calc(100% / 7 - 6px); }
.wpstb-modal__progress[data-count="8"] .wpstb-bar { width: calc(100% / 8 - 6px); }
.wpstb-modal__progress[data-count="9"] .wpstb-bar { width: calc(100% / 9 - 6px); }
.wpstb-modal__progress[data-count="10"] .wpstb-bar { width: calc(100% / 10 - 6px); }

.wpstb-modal__progress[data-count="11"] .wpstb-bar { width: calc(100% / 11 - 6px); }
.wpstb-modal__progress[data-count="12"] .wpstb-bar { width: calc(100% / 12 - 6px); }
.wpstb-modal__progress[data-count="13"] .wpstb-bar { width: calc(100% / 13 - 6px); }
.wpstb-modal__progress[data-count="14"] .wpstb-bar { width: calc(100% / 14 - 6px); }
.wpstb-modal__progress[data-count="15"] .wpstb-bar { width: calc(100% / 15 - 6px); }
.wpstb-modal__progress[data-count="16"] .wpstb-bar { width: calc(100% / 16 - 6px); }
.wpstb-modal__progress[data-count="17"] .wpstb-bar { width: calc(100% / 17 - 6px); }
.wpstb-modal__progress[data-count="18"] .wpstb-bar { width: calc(100% / 18 - 6px); }
.wpstb-modal__progress[data-count="19"] .wpstb-bar { width: calc(100% / 19 - 6px); }
.wpstb-modal__progress[data-count="20"] .wpstb-bar { width: calc(100% / 20 - 6px); }

.wpstb-bar {
    display: block;
    position: relative;
    border-radius: 3px;
    height: 3px;
    margin: 0 3px;
    cursor: pointer;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.4);
}

.wpstb-bar span {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
    height: 100%;
    width: 100%;
    border-radius: 3px;
    background-color: #fff;
    will-change: auto;
    transform: translateX(-101%) rotate(0deg);
}

.wpstb-bar.is-seen span {
    transform: translateX(0%) rotate(0deg);
}

.wpstb-bar.is-animating span {
    animation: wpstb-bar 0s 0s linear both;
}

body.paused .wpstb-bar.is-animating span,
body.menu-open .wpstb-bar.is-animating span {
    animation-play-state: paused;
}

@keyframes wpstb-bar {
    from { transform: translateX(-101%) rotate(0deg); }
    to   { transform: translateX(0%) rotate(0deg); }
}

@media (max-width: 800px) {
    .wpstb__screen {
        margin-top: 20px;
    }

    .wpstb-timeline__avatar {
        width: 64px;
        height: 64px;
    }
}
