html,
body.swipe-body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #050507;
}

body.swipe-body {
    min-height: 100%;
    overscroll-behavior: none;
}

.swipe-feed {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    background: #050507;
    overscroll-behavior-y: contain;
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

.swipe-feed::-webkit-scrollbar {
    display: none;
}

.swipe-feed.is-restoring {
    scroll-behavior: auto !important;
    scroll-snap-type: none;
}

.swipe-startup {
    display: grid;
    height: 100vh;
    height: 100dvh;
    place-content: center;
    gap: 16px;
    color: #a4a7b0;
    text-align: center;
}

.swipe-startup p {
    margin: 0;
    font-size: 14px;
}

.swipe-startup.is-error p {
    max-width: 280px;
    color: #f0f1f4;
    line-height: 1.6;
}

.swipe-spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto;
    border: 3px solid rgba(255, 255, 255, 0.14);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: swipe-spin 0.8s linear infinite;
}

.swipe-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #050507;
    isolation: isolate;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.swipe-backdrop {
    position: absolute;
    inset: -42px;
    z-index: -2;
    background-position: center;
    background-size: cover;
    filter: blur(30px) brightness(0.34) saturate(1.15);
    opacity: 0.86;
    transform: scale(1.08);
}

.swipe-card::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(5, 5, 7, 0.78), transparent 30%, transparent 70%, rgba(5, 5, 7, 0.78)),
        linear-gradient(180deg, rgba(5, 5, 7, 0.2), transparent 48%, rgba(5, 5, 7, 0.88));
    content: "";
    pointer-events: none;
}

.swipe-video-shell {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

.swipe-video {
    display: block;
    width: 100%;
    height: 100%;
    background: transparent;
    object-fit: contain;
}

.swipe-status {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 5;
    display: grid;
    min-width: 120px;
    place-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(7, 8, 11, 0.66);
    box-shadow: 0 16px 46px rgba(0, 0, 0, 0.3);
    color: #e8e9ed;
    font-size: 13px;
    text-align: center;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(15px);
}

.swipe-status[hidden] {
    display: none;
}

.swipe-status .swipe-spinner {
    width: 28px;
    height: 28px;
}

.swipe-retry {
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid rgba(255, 70, 85, 0.42);
    border-radius: 10px;
    background: rgba(255, 70, 85, 0.18);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 750;
}

.swipe-play-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 4;
    width: 74px;
    height: 74px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    background: rgba(5, 5, 7, 0.45);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.88);
    transition: opacity 160ms ease, transform 160ms ease;
    backdrop-filter: blur(12px);
}

.swipe-play-indicator::after {
    position: absolute;
    top: 50%;
    left: 53%;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 17px solid #fff;
    content: "";
    transform: translate(-50%, -50%);
}

.swipe-card.is-paused .swipe-play-indicator {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.swipe-copy {
    position: absolute;
    right: 22px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: 22px;
    z-index: 6;
    max-width: 760px;
    pointer-events: none;
}

.swipe-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 9px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.swipe-duration {
    padding: 4px 7px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    background: rgba(5, 5, 7, 0.5);
    color: #fff;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.swipe-title {
    display: -webkit-box;
    overflow: hidden;
    max-width: 680px;
    margin: 0;
    color: #fff;
    font-size: clamp(17px, 2.5vw, 24px);
    font-weight: 760;
    line-height: 1.35;
    letter-spacing: -0.02em;
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.65);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.swipe-tools {
    position: absolute;
    right: 18px;
    bottom: calc(164px + env(safe-area-inset-bottom));
    z-index: 8;
}

.swipe-sound {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: rgba(6, 7, 10, 0.5);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 18px;
    backdrop-filter: blur(14px);
}

.swipe-progress {
    position: absolute;
    right: 0;
    bottom: calc(58px + env(safe-area-inset-bottom));
    left: 0;
    z-index: 8;
    height: 22px;
    background: transparent;
    cursor: pointer;
    touch-action: none;
}

.swipe-progress::before {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    content: "";
    transform: translateY(-50%);
}

.swipe-progress-bar {
    position: absolute;
    top: 50%;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(255, 70, 85, 0.7);
    pointer-events: none;
    transform: translateY(-50%);
}

.swipe-progress::after {
    position: absolute;
    top: 50%;
    left: var(--progress, 0%);
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.42);
    content: "";
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.8);
    transition: opacity 140ms ease, transform 140ms ease;
}

.swipe-progress:hover::after,
.swipe-progress:focus-visible::after,
.swipe-progress.is-dragging::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.swipe-progress:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.62);
    outline-offset: -3px;
}

.swipe-toast {
    position: fixed;
    top: calc(18px + env(safe-area-inset-top));
    left: 50%;
    z-index: 100;
    max-width: calc(100vw - 32px);
    margin: 0;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    background: rgba(8, 9, 12, 0.78);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 12px;
    text-align: center;
    transform: translateX(-50%);
    backdrop-filter: blur(16px);
}

.swipe-toast[hidden] {
    display: none;
}

.swipe-bottom-nav {
    border-top-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(7, 7, 10, 0.7), rgba(5, 5, 7, 0.96));
}

@keyframes swipe-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (min-width: 760px) {
    .swipe-card::after {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        z-index: -1;
        width: min(76vw, 820px);
        border-right: 1px solid rgba(255, 255, 255, 0.06);
        border-left: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: 0 0 80px rgba(0, 0, 0, 0.38);
        content: "";
        transform: translateX(-50%);
    }

    .swipe-video {
        width: min(76vw, 820px);
    }

    .swipe-copy {
        right: max(30px, calc((100vw - min(76vw, 820px)) / 2 + 30px));
        left: max(30px, calc((100vw - min(76vw, 820px)) / 2 + 30px));
    }

    .swipe-tools {
        right: max(28px, calc((100vw - min(76vw, 820px)) / 2 + 28px));
    }
}

@media (max-width: 520px) {
    .swipe-copy {
        right: 76px;
        bottom: calc(82px + env(safe-area-inset-bottom));
        left: 16px;
    }

    .swipe-tools {
        right: 15px;
        bottom: calc(102px + env(safe-area-inset-bottom));
    }

    .swipe-title {
        font-size: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .swipe-feed {
        scroll-behavior: auto;
    }
}
