/* =========================
   БАЗОВЫЕ НАСТРОЙКИ
========================= */

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

html,
body {
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;

    font-family:
            -apple-system,
            BlinkMacSystemFont,
            "Segoe UI",
            Roboto,
            Arial,
            sans-serif;
}

button {
    font-family: inherit;
}


/* =========================
   ПРИЛОЖЕНИЕ
========================= */

.app {
    width: 100%;
    height: 100dvh;

    position: relative;

    background: #000;
    overflow: hidden;
}


/* =========================
   ЛЕНТА
========================= */

.feed {
    width: 100%;
    height: 100%;

    overflow-y: auto;

    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;

    overscroll-behavior-y: contain;

    scrollbar-width: none;
}

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


/* =========================
   ОДИН СЕРИАЛ
========================= */

.feed-item {
    position: relative;

    width: 100%;
    height: 100dvh;

    overflow: hidden;

    background: #000;

    scroll-snap-align: start;
    scroll-snap-stop: always;
}


/* =========================
   ВИДЕО
========================= */

.feed-video {
    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    background: #000;
}


/* =========================
   ЗАТЕМНЕНИЕ
========================= */

.video-gradient {
    position: absolute;

    inset: 0;

    pointer-events: none;

    background:
            linear-gradient(
                    to bottom,
                    rgba(0, 0, 0, 0.12) 0%,
                    rgba(0, 0, 0, 0) 35%,
                    rgba(0, 0, 0, 0.05) 55%,
                    rgba(0, 0, 0, 0.82) 100%
            );
}

/* =========================
   КЛИКАБЕЛЬНОЕ НАЗВАНИЕ
   И АВТОР
========================= */

.feed-series-link,
.feed-author-link {
    border: none;
    padding: 0;

    background: transparent;

    color: inherit;

    font: inherit;

    text-align: left;

    cursor: pointer;
}


.feed-series-link {
    display: block;

    width: fit-content;
    max-width: 100%;
}


.feed-author-link {
    display: block;

    width: fit-content;
    max-width: 100%;
}


/* =========================
   ИНФОРМАЦИЯ О СЕРИАЛЕ
========================= */

.series-info {
    position: absolute;

    left: 18px;
    right: 95px;

    bottom: calc(92px + env(safe-area-inset-bottom));

    z-index: 10;

    color: #fff;
}

.author {
    font-size: 14px;
    font-weight: 600;

    margin-bottom: 8px;

    opacity: 0.9;
}

.series-title {
    font-size: 23px;
    line-height: 1.15;

    font-weight: 800;

    margin-bottom: 5px;
}

/* =========================
   СМОТРЕТЬ ДАЛЕЕ — LIQUID GLASS
========================= */

.feed-watch-next {
    position: relative;

    width: fit-content;
    min-height: 30px;

    margin-top: 7px;
    margin-bottom: 5px;

    padding:
            0
            12px;

    overflow: hidden;

    border:
            1px solid
            rgba(255, 255, 255, 0.24);

    border-radius: 999px;

    display: inline-flex;
    align-items: center;

    gap: 8px;

    background:
            linear-gradient(
                    135deg,
                    rgba(255, 255, 255, 0.18),
                    rgba(255, 255, 255, 0.07)
            );

    color: #ffffff;

    box-shadow:
            inset 0 1px 0
            rgba(255, 255, 255, 0.28),

            inset 0 -1px 0
            rgba(255, 255, 255, 0.06),

            0 5px 18px
            rgba(0, 0, 0, 0.24);

    backdrop-filter:
            blur(18px)
            saturate(150%);

    -webkit-backdrop-filter:
            blur(18px)
            saturate(150%);

    font-family: inherit;
    font-size: 10px;
    font-weight: 750;

    cursor: pointer;

    text-shadow:
            0 1px 3px
            rgba(0, 0, 0, 0.35);

    transition:
            transform 0.16s ease,
            background 0.16s ease,
            border-color 0.16s ease;
}

.feed-watch-next::before {
    content: "";

    position: absolute;

    top: 1px;
    left: 10%;

    width: 70%;
    height: 45%;

    border-radius: 999px;

    background:
            linear-gradient(
                    to bottom,
                    rgba(255, 255, 255, 0.20),
                    rgba(255, 255, 255, 0)
            );

    pointer-events: none;
}

.feed-watch-next-arrow {
    position: relative;

    z-index: 1;

    font-size: 15px;
    line-height: 1;

    font-weight: 500;

    color:
            rgba(255, 255, 255, 0.82);

    transform:
            translateY(-0.5px);
}


.feed-watch-next > span:first-child {
    position: relative;

    z-index: 1;
}

.feed-watch-next:active {
    transform: scale(0.95);

    background:
            linear-gradient(
                    135deg,
                    rgba(255, 255, 255, 0.25),
                    rgba(255, 255, 255, 0.10)
            );

    border-color:
            rgba(255, 255, 255, 0.34);
}

.series-description {
    font-size: 14px;
    line-height: 1.35;

    max-width: 450px;

    margin-bottom: 14px;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
}


/* =========================
   КОРОТКАЯ АННОТАЦИЯ
========================= */

.feed-description {
    display: block;

    width: 100%;
    max-width: 320px;

    margin-top: 6px;

    padding: 0;

    border: none;

    background: transparent;
    color: inherit;

    text-align: left;

    cursor: pointer;
}


.feed-description-text {
    min-width: 0;

    font-size: 12px;
    line-height: 1.4;

    color:
            rgba(255, 255, 255, 0.82);

    display: -webkit-box;

    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
}


/* =========================
   ТЕГИ В ЛЕНТЕ
========================= */

.feed-tags-inline {
    display: flex;
    flex-wrap: wrap;

    column-gap: 8px;
    row-gap: 2px;

    max-width: 320px;

    margin-top: 5px;
}


.feed-inline-tag {
    border: none;

    padding: 0;

    background: transparent;

    color:
            rgba(255, 255, 255, 0.92);

    font-family: inherit;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 600;

    text-align: left;

    cursor: pointer;

    text-shadow:
            0 1px 4px
            rgba(0, 0, 0, 0.55);
}


.feed-inline-tag:active {
    opacity: 0.6;
}


/* =========================
   ПАНЕЛЬ АННОТАЦИИ
========================= */

.feed-description-modal {
    position: fixed;

    inset: 0;

    z-index: 910;

    display: none;
}


.feed-description-modal.open {
    display: block;
}


.feed-description-backdrop.feed-description-backdrop {
    position: absolute;

    inset: 0;

    background:
            rgba(0, 0, 0, 0.16);
}


.feed-description-sheet {
    position: absolute;

    left: 50%;
    bottom: 0;

    width: 100%;
    max-width: var(--app-width, 430px);

    max-height: 72dvh;

    transform:
            translateX(-50%);

    border-radius:
            22px
            22px
            0
            0;

    background: #171717;

    color: #ffffff;

    overflow: hidden;
}


.feed-description-handle {
    width: 38px;
    height: 4px;

    margin: 8px auto 3px;

    border-radius: 5px;

    background:
            rgba(255, 255, 255, 0.22);
}


.feed-description-header {
    min-height: 48px;

    padding: 0 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom:
            1px solid
            rgba(255, 255, 255, 0.06);
}


.feed-description-heading {
    font-size: 14px;
    font-weight: 800;
}


.feed-description-close {
    width: 34px;
    height: 34px;

    border: none;
    border-radius: 50%;

    background:
            rgba(255, 255, 255, 0.06);

    color: white;

    font-size: 22px;

    cursor: pointer;
}


.feed-description-content {
    max-height:
            calc(72dvh - 60px);

    overflow-y: auto;

    padding:
            16px
            16px
            calc(
                    24px +
                    env(safe-area-inset-bottom)
            );
}


.feed-description-series-title {
    margin-bottom: 10px;

    font-size: 19px;
    line-height: 1.25;

    font-weight: 800;
}


.feed-description-full-text {
    margin-bottom: 22px;

    font-size: 13px;
    line-height: 1.55;

    color:
            rgba(255, 255, 255, 0.78);
}


.feed-description-group {
    margin-top: 18px;
}


.feed-description-group-title {
    margin-bottom: 9px;

    font-size: 11px;
    font-weight: 800;

    color:
            rgba(255, 255, 255, 0.48);

    text-transform: uppercase;
}

.feed-description-chips {
    display: flex;
    flex-wrap: wrap;

    column-gap: 10px;
    row-gap: 5px;
}


.feed-genre-chip,
.feed-tag-chip {
    min-height: 0;

    border: none;
    border-radius: 0;

    padding: 0;

    background: transparent;

    color:
            rgba(255, 255, 255, 0.88);

    font-family: inherit;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 600;

    cursor: pointer;
}


.feed-genre-chip:active,
.feed-tag-chip:active {
    opacity: 0.6;
}


.feed-genre-chip:active,
.feed-tag-chip:active {
    opacity: 0.6;
}


.feed-ai-label {
    width: fit-content;

    margin-top: 22px;

    padding: 6px 9px;

    border-radius: 7px;

    background:
            rgba(255, 255, 255, 0.06);

    color:
            rgba(255, 255, 255, 0.48);

    font-size: 10px;
}

/* =========================
   ТИЗЕР В ЛЕНТЕ
========================= */

.feed-teaser-label {
    width: fit-content;

    margin-bottom: 8px;

    padding:
            5px
            8px;

    border-radius: 8px;

    background:
            rgba(255, 255, 255, 0.14);

    color:
            rgba(255, 255, 255, 0.88);

    font-size: 9px;
    line-height: 1;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.7px;

    backdrop-filter:
            blur(8px);

    -webkit-backdrop-filter:
            blur(8px);
}


.feed-teaser-title {
    margin-bottom: 10px;
}


.feed-teaser-series-button {
    min-height: 38px;

    padding:
            0
            14px;

    border:
            1px solid
            rgba(255, 255, 255, 0.24);

    border-radius: 999px;

    display: inline-flex;
    align-items: center;

    gap: 9px;

    background:
            rgba(255, 255, 255, 0.13);

    color: #ffffff;

    font-size: 11px;
    font-weight: 750;

    cursor: pointer;

    backdrop-filter:
            blur(14px);

    -webkit-backdrop-filter:
            blur(14px);
}


.feed-teaser-series-button:active {
    transform:
            scale(0.96);
}


.teaser-like-button.liked
.teaser-like-icon {
    color: #ff315d;
}


/* =========================
   КНОПКИ СПРАВА
========================= */

.side-actions {
    position: absolute;

    right: 12px;

    bottom:
            calc(
                    88px +
                    env(safe-area-inset-bottom)
            );

    z-index: 10;

    display: flex;
    flex-direction: column;

    align-items: center;

    gap: 20px;
}

.side-button {
    width: 68px;

    border: 0;
    outline: none;

    background: transparent;

    color: #fff;

    cursor: pointer;

    display: flex;
    flex-direction: column;

    align-items: center;

    gap: 5px;

    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.side-icon {
    width: 44px;
    height: 44px;

    border-radius: 50%;

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

    font-size: 29px;

    background: rgba(0, 0, 0, 0.35);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.side-label {
    font-size: 10px;
    font-weight: 600;
}

.like-button.liked .side-icon {
    background: rgba(0, 0, 0, 0.4);
}

.like-button.liked .side-icon {
    color: #ff315d;
}

/* =========================
   БИБЛИОТЕКА В ЛЕНТЕ
========================= */

.save-icon {
    background:
            rgba(0, 0, 0, 0.35);
}


.save-icon svg {
    width: 20px;
    height: 23px;

    display: block;
}


.save-icon path {
    fill: transparent;

    stroke: currentColor;
    stroke-width: 2;

    stroke-linecap: round;
    stroke-linejoin: round;

    transition:
            fill 0.15s ease;
}


.save-button.saved
.save-icon path {
    fill: currentColor;
}


.save-count {
    font-size: 10px;
    line-height: 1;
}


/* =========================
   ПОДЕЛИТЬСЯ В ЛЕНТЕ
========================= */

.feed-share-icon svg {
    width: 23px;
    height: 23px;

    display: block;
}


.feed-share-icon path {
    fill: none;

    stroke: currentColor;
    stroke-width: 2;

    stroke-linecap: round;
    stroke-linejoin: round;
}

/* =========================
   TOAST
========================= */

.feed-toast {
    position: fixed;

    left: 50%;
    bottom:
            calc(
                    95px +
                    env(safe-area-inset-bottom)
            );

    z-index: 1200;

    transform:
            translate(
                    -50%,
                    8px
            );

    max-width: calc(100% - 40px);

    padding: 9px 13px;

    border-radius: 10px;

    background:
            rgba(25, 25, 25, 0.95);

    color: #ffffff;

    font-size: 11px;
    font-weight: 650;

    white-space: nowrap;

    opacity: 0;

    pointer-events: none;

    transition:
            opacity 0.18s ease,
            transform 0.18s ease;
}


.feed-toast.visible {
    opacity: 1;

    transform:
            translate(
                    -50%,
                    0
            );
}


/* =========================
   РЕКЛАМА В ЛЕНТЕ
========================= */

.ad-feed-item {
    background: #111;
}


.feed-ad {
    position: relative;

    width: 100%;
    height: 100%;

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

    padding:
            30px
            24px
            calc(100px + env(safe-area-inset-bottom));

    background:
            linear-gradient(
                    145deg,
                    #171717,
                    #090909
            );
}


.feed-ad-label {
    position: absolute;

    top:
            calc(
                    18px +
                    env(safe-area-inset-top)
            );

    left: 18px;

    padding: 5px 8px;

    border-radius: 7px;

    background:
            rgba(255, 255, 255, 0.09);

    color:
            rgba(255, 255, 255, 0.55);

    font-size: 9px;

    text-transform: uppercase;

    letter-spacing: 1px;
}


.feed-ad-content {
    width: 100%;
    max-width: 320px;

    text-align: center;

    color: white;
}


.feed-ad-icon {
    width: 70px;
    height: 70px;

    margin:
            0 auto
            20px;

    border-radius: 20px;

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

    background:
            rgba(255, 255, 255, 0.08);

    font-size: 18px;
    font-weight: 900;

    letter-spacing: 2px;
}


.feed-ad-title {
    font-size: 25px;
    font-weight: 900;

    margin-bottom: 10px;
}


.feed-ad-description {
    font-size: 14px;
    line-height: 1.5;

    color:
            rgba(255, 255, 255, 0.5);

    margin-bottom: 23px;
}


.feed-ad-button {
    min-width: 160px;
    min-height: 46px;

    padding: 0 20px;

    border: none;
    border-radius: 13px;

    background: white;
    color: #111;

    font-size: 14px;
    font-weight: 800;

    cursor: pointer;
}

/* =========================
   КОММЕНТАРИИ В ЛЕНТЕ
========================= */

.feed-comments-modal {
    position: fixed;

    top: 0;
    bottom: 0;
    left: 50%;

    width: 100%;
    max-width: var(--app-width, 430px);

    transform:
            translateX(-50%);

    z-index: 900;

    display: none;
}


.feed-comments-modal.open {
    display: block;
}


.feed-comments-backdrop {
    position: absolute;

    inset: 0;

    background:
            rgba(0, 0, 0, 0.42);
}


.feed-comments-sheet {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: min(72dvh, 650px);

    display: flex;
    flex-direction: column;

    border-radius:
            22px
            22px
            0
            0;

    background: #171717;

    color: #ffffff;

    overflow: hidden;
}

.feed-comment-report:disabled {
    opacity: 0.55;

    cursor: default;
}


.feed-comments-handle {
    width: 38px;
    height: 4px;

    flex-shrink: 0;

    margin: 8px auto 3px;

    border-radius: 5px;

    background:
            rgba(255, 255, 255, 0.22);
}


.feed-comments-header {
    min-height: 48px;

    padding: 0 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom:
            1px solid
            rgba(255, 255, 255, 0.06);
}


.feed-comments-title {
    font-size: 14px;
    font-weight: 800;

    color: #ffffff;
}


.feed-comments-close {
    width: 34px;
    height: 34px;

    border: none;
    border-radius: 50%;

    background:
            rgba(255, 255, 255, 0.06);

    color: white;

    font-size: 22px;

    cursor: pointer;
}


.feed-comments-list {
    flex: 1;

    min-height: 0;

    overflow-y: auto;
    overscroll-behavior: contain;

    padding: 8px 16px 18px;
}


.feed-comments-empty {
    padding: 45px 20px;

    text-align: center;

    font-size: 12px;
    line-height: 1.5;

    color:
            rgba(255, 255, 255, 0.4);
}


.feed-comment {
    display: flex;

    gap: 9px;

    padding: 10px 0;
}


.feed-comment-replies {
    margin-left: 38px;

    border-left:
            1px solid
            rgba(255, 255, 255, 0.08);

    padding-left: 10px;
}


.feed-comment-avatar {
    width: 32px;
    height: 32px;

    flex-shrink: 0;

    border-radius: 50%;

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

    background:
            rgba(255, 255, 255, 0.07);

    font-size: 15px;
}


.feed-comment-body {
    flex: 1;

    min-width: 0;
}


.feed-comment-meta {
    display: flex;
    align-items: center;

    gap: 7px;

    margin-bottom: 4px;
}


.feed-comment-user {
    font-size: 11px;
    font-weight: 800;

    color: #ffffff;
}


.feed-comment-date {
    font-size: 9px;

    color:
            rgba(255, 255, 255, 0.32);
}


.feed-comment-text {
    font-size: 12px;
    line-height: 1.45;

    color:
            rgba(255, 255, 255, 0.86);
}


.feed-comment-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: 7px;
}


.feed-comment-action {
    padding: 0;

    border: none;

    background: transparent;

    color:
            rgba(255, 255, 255, 0.42);

    font-size: 10px;

    cursor: pointer;
}


.feed-comment-action.liked {
    color: white;
}


.feed-reply-indicator {
    flex-shrink: 0;

    padding: 0 16px;

    font-size: 10px;

    color:
            rgba(255, 255, 255, 0.55);
}


.feed-reply-indicator:not(:empty) {
    padding-top: 7px;
}


.feed-cancel-reply {
    margin-left: 5px;

    border: none;

    background: transparent;

    color: white;

    cursor: pointer;
}


.feed-comment-form {
    flex-shrink: 0;

    display: flex;
    align-items: flex-end;

    gap: 8px;

    padding:
            10px
            12px
            calc(
                    10px +
                    env(safe-area-inset-bottom)
            );

    border-top:
            1px solid
            rgba(255, 255, 255, 0.07);

    background: #171717;
}


.feed-comment-input {
    flex: 1;

    min-height: 40px;
    max-height: 100px;

    resize: none;

    border:
            1px solid
            rgba(255, 255, 255, 0.08);

    border-radius: 14px;

    outline: none;

    padding: 10px 12px;

    background:
            rgba(255, 255, 255, 0.06);

    color: white;

    font: inherit;

    font-size: 12px;
}


.feed-comment-send {
    min-height: 40px;

    border: none;
    border-radius: 12px;

    padding: 0 12px;

    background: white;

    color: #111;

    font-size: 11px;
    font-weight: 800;

    cursor: pointer;
}


/* =========================
   НИЖНЕЕ МЕНЮ
========================= */

.bottom-nav {
    position: fixed;

    left: 50%;
    bottom: 0;
    width: 100%;
    max-width: 430px;

    transform: translateX(-50%);

    height: calc(72px + env(safe-area-inset-bottom));

    padding-bottom: env(safe-area-inset-bottom);

    z-index: 100;

    display: grid;
    grid-template-columns: repeat(5, 1fr);

    background:
            linear-gradient(
                    to top,
                    rgba(0, 0, 0, 0.95),
                    rgba(0, 0, 0, 0.72)
            );

    border-top: 1px solid rgba(255, 255, 255, 0.08);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.nav-item {
    border: none;

    background: transparent;

    color: rgba(255, 255, 255, 0.5);

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 3px;

    cursor: pointer;
}

.nav-item.active {
    color: white;
}

.nav-icon {
    font-size: 24px;
    line-height: 1;
}

.nav-label {
    font-size: 9px;
    line-height: 1.1;
    white-space: nowrap;
}

.nav-item.active {
    color: #fff;
}

.nav-item.active .nav-label {
    font-weight: 700;
}

.feed-nav-item .feed-icon {
    width: 38px;
    height: 30px;

    border-radius: 10px;

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

    background: rgba(255, 255, 255, 0.11);

    font-size: 16px;
}


/* =========================
   ДЕСКТОПНЫЙ ПРОСМОТР
========================= */

@media (min-width: 700px) {

    body {
        display: flex;
        justify-content: center;

        background: #181818;
    }

    .app {
        width: 430px;
        max-width: 100%;

        box-shadow:
                0 0 40px rgba(0, 0, 0, 0.7);
    }
}

/* =========================
   ЖАЛОБА НА СЕРИАЛ
========================= */

.feed-series-report-button {
    display: block;

    margin-top: 22px;
    padding: 8px 0;

    border: none;
    background: none;

    color: rgba(255, 255, 255, 0.58);

    font-size: 13px;
    font-weight: 500;

    cursor: pointer;
}

.feed-series-report-button:hover {
    color: rgba(255, 255, 255, 0.9);
}

.feed-series-report-button:active {
    opacity: 0.65;
}