

/* =========================
   СТРАНИЦА
========================= */

.series-page {
    position: relative;

    width: 100%;
    min-height: 100dvh;

    background: var(--bg-main);
}

/* =========================
   ШАПКА
========================= */

.series-header {
    position: fixed;

    top: 0;
    left: 50%;

    width: 100%;
    max-width: var(--app-width);

    transform: translateX(-50%);

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

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

    z-index: 300;

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

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

    pointer-events: none;
}

.series-header .back-button {
    position: absolute;

    left: 14px;

    pointer-events: auto;

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

    -webkit-backdrop-filter:
            blur(10px);

    backdrop-filter:
            blur(10px);
}

.header-title {
    font-size: 15px;
    font-weight: 700;

    opacity: 0;
}


/* =========================
   ОБЛОЖКА
========================= */

.series-hero {
    position: relative;

    width: 100%;
    height: 55dvh;

    min-height: 380px;
    max-height: 600px;

    background: #111;

    overflow: hidden;
}

.series-cover {
    visibility: hidden;
    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: 50% 50%;

    display: block;
}

.hero-gradient {
    position: absolute;

    inset: 0;

    background:
            linear-gradient(
                    to bottom,
                    rgba(0, 0, 0, 0.08) 30%,
                    rgba(13, 13, 13, 0.3) 65%,
                    #0d0d0d 100%
            );
}


/* =========================
   КОНТЕНТ
========================= */

.series-content {
    position: relative;

    margin-top: -60px;

    z-index: 10;

    padding:
            0
            18px
}

.series-views-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.series-views-meta[hidden] {
    display: none;
}

.series-views-meta svg {
    display: block;
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}

.series-author-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 3px;
}

.series-author-header .series-author {
    min-width: 0;
    flex: 1;
    margin-bottom: 0;
}

.series-completion-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    font-weight: 650;
    white-space: nowrap;
}

.series-completion-badge[hidden] {
    display: none;
}

.series-completion-badge.is-completed {
    background: rgba(94, 154, 115, 0.2);
    color: #BCE5C9;
}

.series-completion-badge.is-ongoing {
    background: rgba(184, 184, 184, 0.12);
    color: #B8B8B8;
}

.series-completion-icon {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
}

.series-author {
    font-size: 16px;
    line-height: 1.1;
    font-weight: 600;

    color: var(--text-white-92);
    opacity: 1;

    margin-bottom: 3px;
}

/* =========================
   СОАВТОРЫ СЕРИАЛА
========================= */

.series-author-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 9px;
    margin-bottom: 5px;
}

.series-author-row:last-child {
    margin-bottom: 0;
}

.series-author-row .series-author-link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.series-author-role {
    font-size: 12px;
    line-height: 1.3;
    font-weight: 400;
    color: var(--text-white-65);
}

.series-name {
    font-size: 30px;
    line-height: 1.08;

    font-weight: 800;

    margin-bottom: 10px;
}

.series-meta {
    display: flex;
    align-items: center;

    gap: 8px;

    font-size: 13px;

    opacity: 0.65;

    margin-bottom: 16px;
}

.meta-dot {
    font-size: 10px;
}

.series-description-wrap {
    margin-bottom: 20px;
}


.series-description {
    white-space: pre-line;
    overflow-wrap: anywhere;

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

    color: var(--text-white-85);

    margin-bottom: 0;

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

    overflow: hidden;
}


.series-description.expanded {
    display: block;

    -webkit-line-clamp: unset;

    overflow: visible;
}


.series-description-toggle {
    display: inline-block;

    margin-top: 4px;

    border: none;
    padding: 0;

    background: transparent;

    color: var(--text-white-55);

    font-family: inherit;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 650;

    cursor: pointer;
}

.series-author-link {
    cursor: pointer;
}


@media (hover: hover) {

    .series-author-link:hover {
        color:
                var(--text-white-85);
    }

}

/* =========================
   ДОПОЛНИТЕЛЬНАЯ ИНФОРМАЦИЯ О СЕРИАЛЕ
========================= */

.series-extra-info {
    margin-top: 10px;
    margin-bottom: 12px;
}


.series-extra-group {
    margin-top: 8px;
}


.series-extra-group:first-child {
    margin-top: 0;
}


.series-extra-title {
    display: inline;

    margin-right: 6px;

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

    color:
            var(--text-white-48);
}


.series-extra-items {
    display: inline;
}


.series-extra-item {
    display: inline;

    margin: 0;
    padding: 0;

    border: none;
    border-radius: 0;

    background: transparent;

    color:
            var(--text-white-72);

    font-family: inherit;
    font-size: 11px;
    line-height: 1.5;
    font-weight: 500;

    white-space: normal;

    cursor: pointer;
}

/* Компактный рейтинг по каждому жанру */
#seriesGenresBlock .series-extra-title {
    display: block;
    margin: 0 0 5px;
    font-size: 10px;
    letter-spacing: 0.04em;
}

#seriesGenresBlock .series-extra-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.series-genre-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.series-genre-row .series-genre-link {
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
}

#seriesGenresBlock .series-genre-link::after {
    content: none;
}

.series-genre-rank {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex: 0 0 auto;
    color: #C8C8C8;
    font-size: 10px;
    line-height: 1.3;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.series-genre-rank svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.series-extra-item:hover {
    color:
            rgba(255, 255, 255, 1);
}

.series-extra-item:focus-visible {
    outline: none;
    text-decoration: underline;
}


.series-extra-item:not(:last-child)::after {
    content: " · ";

    color:
            var(--text-faint);
}


#seriesTagsBlock .series-extra-title {
    display: none;
}


#seriesTagsBlock .series-extra-items {
    display: inline;
}


#seriesTagsBlock .series-extra-item {
    min-height: 0;
    padding: 0;

    border: none;
    border-radius: 0;

    background: transparent;

    color:
            var(--text-white-48);

    font-size: 11px;
    font-weight: 500;
}


#seriesTagsBlock .series-extra-item:not(:last-child)::after {
    content: "  ";
}


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

    margin-top: 9px;

    padding:
            4px 8px;

    border:
            1px solid
            var(--border-default);

    border-radius: 999px;

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

    color:
            var(--text-white-42);

    font-size: 9px;
    line-height: 1.2;
    font-weight: 500;
}


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

.series-description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;

    overflow: hidden;
}


.series-description.expanded {
    display: block;
    overflow: visible;
}


.series-description-toggle {
    margin-top: 4px;

    border: none;
    padding: 0;

    background: transparent;

    color:
            var(--text-secondary);

    font-family: inherit;
    font-size: 12px;
    font-weight: 650;

    cursor: pointer;
}


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

.comments-section {
    margin-top: 10px;
}

.comments-header {
    display: flex;

    align-items: center;

    gap: 8px;

    margin-bottom: 16px;
}

.comments-header .section-title {
    margin-bottom: 0;
}

.comments-count {
    min-width: 23px;
    height: 23px;

    padding: 0 7px;

    border-radius: var(--radius-12);

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

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

    font-size: 10px;

    color:
            var(--text-white-55);
}


/* ФОРМА */

.comment-form {
    display: flex;

    gap: 10px;

    margin-bottom: 24px;
}

.comment-avatar {
    width: 38px;
    height: 38px;

    flex-shrink: 0;

    border-radius: 50%;

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

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

    font-size: 18px;
}

.comment-input-wrapper {
    flex: 1;

    padding: 10px;

    border-radius: var(--radius-control);

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

.comment-input {
    width: 100%;
    min-height: 64px;
    max-height: 150px;

    resize: vertical;

    border: none;
    outline: none;

    background: transparent;

    color: white;

    font-size: 14px;
    line-height: 1.4;
}

.comment-input::placeholder {
    color:
            var(--text-white-35);
}

.comment-form-bottom {
    display: flex;

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

    gap: 10px;

    margin-top: 7px;
}

.comment-symbol-count {
    font-size: 10px;

    color:
            var(--text-white-30);
}

.send-comment-button {
    min-height: 34px;

    padding: 0 13px;

    border: none;
    border-radius: var(--radius-small);

    background: white;
    color: var(--text-on-light);

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

    cursor: pointer;
}

.send-comment-button:disabled {
    opacity: 0.3;

    cursor: default;
}


/* СПИСОК */

.comments-list {
    display: flex;
    flex-direction: column;

    gap: 18px;
}

.comment-item {
    display: flex;

    gap: 10px;
}

.comment-item-avatar {
    width: 36px;
    height: 36px;

    flex-shrink: 0;

    border-radius: 50%;

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

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

    font-size: 16px;
}

.comment-body {
    flex: 1;

    min-width: 0;
}

.comment-user-row {
    display: flex;

    align-items: center;

    gap: 7px;

    margin-bottom: 5px;
}

.comment-user {
    font-size: 12px;
    font-weight: 800;
}

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

    color:
            var(--text-white-30);
}

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

    color:
            var(--text-white-78);

    word-break: break-word;
}

.comment-actions {
    margin-top: 7px;

    display: flex;

    gap: 12px;
}

.comment-action-button {
    border: none;

    background: transparent;

    color:
            var(--text-white-38);

    font-size: 10px;

    cursor: pointer;
}

.comment-action-button:hover {
    color: white;
}

/* =========================
   ДЕЙСТВИЯ С КОММЕНТАРИЯМИ
========================= */

.comment-actions {
    margin-top: 8px;

    display: flex;
    align-items: center;

    gap: 14px;
}


.comment-action-button {
    border: none;

    background: transparent;

    color: var(--text-muted);

    font-size: 10px;
    font-weight: 600;

    cursor: pointer;

    padding: 0;
}


.comment-action-button:hover {
    color: white;
}


.comment-like-button.liked {
    color: var(--ui-color-ff315d);
}

/* =========================
   ПОДСВЕТКА КОММЕНТАРИЯ
========================= */

.comment-item.highlighted-comment,
.reply-item.highlighted-comment {
    position: relative;

    border-radius: var(--radius-12);

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

    box-shadow:
            0 0 0 1px
            rgba(255, 255, 255, 0.14);

    transition:
            background 0.6s ease,
            box-shadow 0.6s ease;
}


.comment-item.highlighted-comment {
    padding: 10px;
}


.reply-item.highlighted-comment {
    padding: 8px;
}


/* =========================
   СЧЁТЧИК ОТВЕТОВ
========================= */

.replies-count {
    margin-top: 8px;

    border: none;

    background: transparent;

    color: var(--text-white-55);

    font-size: 10px;
    font-weight: 700;

    cursor: pointer;

    padding: 0;
}


/* =========================
   ОТВЕТЫ
========================= */

.comment-replies {
    margin-top: 13px;

    padding-left: 12px;

    border-left:
            1px solid var(--border-card);

    display: flex;
    flex-direction: column;

    gap: 15px;
}


.reply-item {
    display: flex;

    gap: 9px;
}


.reply-avatar {
    width: 30px;
    height: 30px;

    flex-shrink: 0;

    border-radius: 50%;

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

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

    font-size: 13px;
}


.reply-body {
    flex: 1;

    min-width: 0;
}


/* =========================
   ФОРМА ОТВЕТА
========================= */

.reply-form {
    margin-top: 12px;

    padding: 10px;

    border-radius: var(--radius-12);

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


.reply-input {
    width: 100%;

    min-height: 50px;

    border: none;
    outline: none;

    resize: vertical;

    background: transparent;

    color: white;

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


.reply-input::placeholder {
    color:
            var(--text-white-30);
}


.reply-form-actions {
    margin-top: 8px;

    display: flex;
    justify-content: flex-end;

    gap: 8px;
}


.cancel-reply-button,
.send-reply-button {
    min-height: 31px;

    padding: 0 11px;

    border: none;
    border-radius: var(--radius-8);

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

    cursor: pointer;
}


.cancel-reply-button {
    background:
            rgba(255, 255, 255, 0.08);

    color: white;
}


.send-reply-button {
    background: white;
    color: var(--text-on-light);
}


/* =========================
   ЖАЛОБА
========================= */

.comment-reported {
    margin-top: 7px;

    font-size: 9px;

    color: var(--text-white-32);
}


/* =========================
   КНОПКИ СЕРИАЛА
========================= */

.series-actions {
    width: 100%;

    display: grid;

    grid-template-columns:
            minmax(0, 1fr)
            48px
            48px
            48px
            48px;

    gap: 7px;

    margin-bottom: 10px;
}


/* =========================
   СМОТРЕТЬ
========================= */

.primary-button {
    min-width: 0;
    height: 48px;

    padding: 4px 8px;

    border: none;
    border-radius: var(--radius-12);

    background: #ffffff;
    color: var(--text-on-light);

    font-family: inherit;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.2;

    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;

    cursor: pointer;
}

/* Кнопка просмотра на узких экранах */
@media (max-width: 375px) {
    .series-actions .primary-button {
        font-size: 8px;
        line-height: 1.15;
        padding: 3px 2px;
        overflow: hidden;
    }
}


/* =========================
   ОБЩИЙ ВИД ИКОНОК
========================= */

.library-button,
.series-like-button,
.series-comments-button,
.series-share-button {
    width: 48px;
    min-width: 48px;

    height: 48px;
    min-height: 48px;

    padding: 4px 0;

    box-sizing: border-box;

    border: none;
    border-radius: var(--radius-12);

    display: flex;
    flex-direction: column;

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

    gap: 2px;

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

    color: var(--text-main);

    cursor: pointer;

    overflow: hidden;
}


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

.library-icon {
    width: 18px;
    height: 21px;

    flex-shrink: 0;

    display: block;
}


.library-icon svg {
    display: block;

    width: 100%;
    height: 100%;
}


.library-icon path {
    fill: transparent;

    stroke: currentColor;
    stroke-width: 2;

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

    transition:
            fill 0.15s ease;
}


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


.library-count {
    min-height: 8px;

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

    color:
            var(--text-white-70);
}

/* =========================
   УВЕДОМЛЕНИЕ БИБЛИОТЕКИ
========================= */

.library-toast {
    position: fixed;
    top: 18px;
    left: 50%;

    z-index: 9999;

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

    padding: 11px 18px;

    border-radius: var(--radius-12);

    background: rgba(24, 24, 28, 0.96);

    color: var(--text-main);

    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;

    box-shadow:
            0 8px 30px rgba(0, 0, 0, 0.3);

    opacity: 0;

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

    pointer-events: none;

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


.library-toast.show {
    opacity: 1;

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


/* =========================
   ЛАЙК
========================= */

#seriesLikeIcon {
    font-size: 19px;
    line-height: 1;
}


#seriesLikeCount {
    font-size: 8px;
    line-height: 1;

    color:
            var(--text-white-68);
}


.series-like-button.liked {
    color: var(--ui-color-ff315d);
}


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

.series-comments-icon {
    width: 21px;
    height: 21px;

    display: block;
}

.series-comments-icon svg {
    width: 100%;
    height: 100%;

    display: block;
}

.series-comments-icon path {
    fill: none;

    stroke: currentColor;
    stroke-width: 1.8;

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

.series-comments-count {
    display: block;

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

    color: var(--text-white-68);
}


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

.series-share-icon {
    width: 21px;
    height: 21px;

    display: block;
}


.series-share-icon svg {
    display: block;

    width: 100%;
    height: 100%;
}


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

    stroke: currentColor;
    stroke-width: 2;

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


/* =========================
   НАЖАТИЕ
========================= */

.primary-button:active,
.library-button:active,
.series-like-button:active,
.series-comments-button:active,
.series-share-button:active {
    transform: scale(0.96);
}


/* =========================
   СПИСОК СЕРИЙ
========================= */

.episodes-section {
    width: 100%;
}

.section-title {
    font-size: 22px;

    margin-bottom: 16px;
}

.episodes-list {
    display: flex;
    flex-direction: column;

    gap: 10px;
}


.episodes-list {
    transition: height 420ms ease;
}

.episodes-list.is-collapsed {
    -webkit-mask-image: linear-gradient(
        to bottom,
        black 0%,
        black calc(100% - 45px),
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        black 0%,
        black calc(100% - 45px),
        transparent 100%
    );
}

.episodes-toggle {
    width: 100%;
    min-height: 46px;
    margin-top: 12px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-control);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.episodes-toggle[hidden] {
    display: none;
}

.episodes-toggle svg {
    transition: transform 300ms ease;
}

.episodes-toggle.is-expanded svg {
    transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
    .episodes-list,
    .episodes-toggle svg {
        transition: none;
    }
}

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

.episode-card {
    width: 100%;

    min-height: 82px;

    padding: 10px;

    border: none;
    border-radius: var(--radius-control);

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

    color: var(--text-main);

    display: flex;
    align-items: center;

    gap: 14px;

    text-align: left;

    cursor: pointer;
}

.episode-card:active {
    background: rgba(255, 255, 255, 0.1);
}

.episode-thumbnail {
    position: relative;

    width: 56px;
    height: 84px;

    flex-shrink: 0;

    border-radius: var(--radius-10);

    overflow: hidden;

    background: #222;
}

.episode-thumbnail img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.episode-number-badge {
    position: absolute;

    left: 6px;
    bottom: 5px;

    padding: 3px 6px;

    border-radius: 5px;

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

    font-size: 10px;
    font-weight: 700;
}

.episode-details {
    flex: 1;

    min-width: 0;
}

.episode-title {
    font-size: 15px;
    font-weight: 700;

    margin-bottom: 6px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.episode-access {
    font-size: 12px;

    color: var(--text-white-60);
}

.episode-access.free {
    color: var(--ui-color-8ee89b);
}

.episode-access.paid {
    color: var(--ui-color-ffd36a);
}

.episode-lock {
    width: 35px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    text-align: center;
}

.episode-lock-svg {
    width: 20px;
    height: 20px;
    color: var(--text-white-60);
    flex-shrink: 0;
}


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

.series-share-button {
    position: relative;

    width: 48px;
    height: 48px;

    padding: 0;

    border: none;
    border-radius: var(--radius-12);

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

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

    color: var(--text-main);

    cursor: pointer;
}


.primary-button:active,
.library-button:active,
.series-comments-button:active,
.series-share-button:active {
    transform: scale(0.97);
}

/* =========================
   ПОДЖАНРЫ
========================= */

.subgenres-scroll {
    display: none;

    gap: 7px;

    overflow-x: auto;

    padding:
            9px
            16px
            3px;

    scrollbar-width: none;
}


.subgenres-scroll::-webkit-scrollbar {
    display: none;
}


.subgenre-button {
    flex-shrink: 0;

    min-height: 32px;

    padding:
            0
            12px;

    border:
            1px solid
            var(--border-card);

    border-radius: 999px;

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

    color:
            var(--text-secondary);

    font-family: inherit;
    font-size: 11px;
    font-weight: 600;

    cursor: pointer;
}


.subgenre-button.active {
    border-color:
            rgba(255, 255, 255, 0.32);

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

    color: var(--text-main);
}

/* =========================
   ДЛИТЕЛЬНОСТЬ СЕРИИ
========================= */

.episode-meta-row {
    display: flex;
    align-items: center;

    gap: 5px;

    font-size: 12px;
}

.episode-duration {
    color: var(--text-white-60);
}

.episode-meta-dot {
    color: var(--text-white-35);
}

/* =========================
   MORE
========================= */

.header-title {
    flex: 1;
}


.series-more-button {

    position: relative;
    z-index: 20;

    width: 38px;
    height: 38px;

    margin-right: 12px;
    padding: 0;

    flex: 0 0 38px;

    border: none;
    border-radius: 50%;

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

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

    color: var(--text-main);

    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;

    cursor: pointer;

    pointer-events: auto;
}


/* =========================
   ACTIONS MODAL
========================= */

.series-actions-modal {

    position: fixed;

    inset: 0;

    z-index: 6000;

    display: none;
}


.series-actions-modal.open {

    display: block;
}


.series-actions-backdrop {

    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    border: none;

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


.series-actions-sheet {

    position: absolute;

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

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

    border-radius:
            20px
            20px
            0
            0;

    background: var(--bg-outside);
}


.series-actions-handle {

    width: 38px;
    height: 4px;

    margin:
            2px
            auto
            12px;

    border-radius: 999px;

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


.series-actions-item,
.series-actions-cancel {

    width: 100%;
    min-height: 48px;

    border: none;

    background: transparent;
    color: var(--text-main);

    font-family: inherit;
    font-size: 12px;
    font-weight: 800;

    cursor: pointer;
}


.series-actions-item {

    border-bottom:
            1px solid
            var(--border-subtle);
}


.series-actions-cancel {

    margin-top: 8px;

    border-radius: var(--radius-12);

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

/* =========================
   ТИЗЕРЫ НА СТРАНИЦЕ СЕРИАЛА
========================= */

.series-teasers-section[hidden] {
    display: none;
}

.series-teasers-section {
    margin-bottom: 30px;
}

.series-teasers-list {
    display: flex;
    gap: 12px;

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

    padding-bottom: 6px;

    scrollbar-width: none;
}

.series-teasers-list::-webkit-scrollbar {
    display: none;
}

.series-teaser-card {
    position: relative;

    flex: 0 0 76px;
    width: 76px;
    aspect-ratio: 9 / 16;

    padding: 0;
    border: none;
    border-radius: var(--radius-control);

    overflow: hidden;

    background: #222;
    color: white;

    cursor: pointer;
}

.series-teaser-card img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.series-teaser-card:active {
    transform: scale(0.97);
}
.series-discount-badge {
    position: absolute;
    top: 72px;
    left: 14px;
    z-index: 4;

    padding: 9px 13px;
    border-radius: var(--radius-small);

    background: #ff2d55;
    color: var(--text-main);

    font-size: 17px;
    line-height: 1;
    font-weight: 850;
    text-align: center;
}

.series-discount-badge[hidden] {
    display: none;
}

.episode-discount-badge {
    position: absolute;
    top: 5px;
    left: 6px;
    z-index: 2;

    padding: 4px 6px;
    border-radius: 6px;

    background: #ff2d55;
    color: var(--text-main);

    font-size: 10px;
    line-height: 1;
    font-weight: 850;
    text-align: center;
}


.series-ai-meta {
    display: inline-block;

    background:
        linear-gradient(
            90deg,
            #feda75,
            #fa7e1e,
            #d62976,
            #962fbf,
            #4f5bd5,
            #feda75
        );

    background-size: 300% 100%;

    -webkit-background-clip: text;
    background-clip: text;

    -webkit-text-fill-color: transparent;

    animation:
        seriesAiGradient 4.5s ease-in-out infinite;

    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.series-ai-meta-dot {
    margin: 0 2px;
}

@keyframes seriesAiGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}


/* =========================
   НАГРАДЫ СЕРИАЛА
========================= */

.series-rewards-summary[hidden] {
    display: none !important;
    width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.series-rewards-summary {
    width: auto;
    min-height: 0;

    margin: 0;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: var(--text-white-72);

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

    line-height: 1;

    white-space: nowrap;
}

.series-reward-summary-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;

    white-space: nowrap;
}

.series-reward-summary-icon {
    font-size: 15px;
    line-height: 1;
}

.series-reward-toggle {
    width: 100%;
    height: 36px;

    margin-top: 0;
    margin-bottom: 10px;

    padding: 0 12px;

    box-sizing: border-box;

    border: none;
    border-radius: var(--radius-10);

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

    gap: 6px;

    background: var(--surface-control);
    color: var(--text-main);

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

    cursor: pointer;
}

.series-reward-toggle:hover {
    background: var(--surface-selected);
}

.series-reward-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: #E8BD76;
}

.series-reward-toggle-icon svg {
    display: block;
    width: 18px;
    height: 18px;
}

.series-reward-toggle-arrow {
    display: none;
}

.series-rewards-panel {
    width: 100%;

    margin-bottom: 20px;

    padding: 8px;

    box-sizing: border-box;

    border-radius: var(--radius-control);

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

.series-rewards-summary[hidden] {
    display: none !important;
}

.series-reward-option {
    width: 100%;
    min-height: 52px;

    padding: 8px 10px;

    box-sizing: border-box;

    border: none;
    border-radius: var(--radius-10);

    display: flex;
    align-items: center;
    gap: 10px;

    background: transparent;
    color: var(--text-main);

    font-family: inherit;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

.series-reward-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.series-reward-option:active {
    transform: scale(0.985);
}

.series-reward-option-icon {
    width: 30px;
    min-width: 30px;

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

    text-align: center;
}

.series-reward-option-info {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 3px;
}

.series-reward-option-name {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
}

.series-reward-option-meta {
    color: var(--text-white-52);

    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
}

.series-rewards-loading,
.series-rewards-empty {
    padding: 12px;

    color: var(--text-white-48);

    font-size: 12px;
    text-align: center;
}

.series-custom-reward-input-wrap {
    margin-top: 16px;

    display: flex;
    align-items: center;
    gap: 8px;
}

.series-custom-reward-input {
    width: 100%;
    height: 44px;

    padding: 0 12px;

    box-sizing: border-box;

    border:
            1px solid
            var(--border-strong);

    border-radius: var(--radius-12);

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

    color: var(--text-main);

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    outline: none;
}

.series-custom-reward-input:focus {
    border-color:
            rgba(255, 255, 255, 0.25);
}

.series-custom-reward-currency {
    flex-shrink: 0;

    color:
            var(--text-white-55);

    font-size: 14px;
    font-weight: 700;
}


/* WOW NOW — WATCHED EPISODES */

.episode-card.episode-watched {
    background: rgba(255, 255, 255, 0.035);
}

.episode-watched-label {
    display: inline-flex;
    align-items: center;

    color: var(--ui-color-8ee89b);

    font-size: 12px;
    font-weight: 600;

    white-space: nowrap;
}
/* WOW NOW — EPISODE NUMBER SINGLE LINE */

.episode-number-badge {
    font-size: 9px;
    white-space: nowrap;
    padding: 3px 4px;
}

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

.series-not-found {
    min-height: 100dvh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: var(--bg-main);
    color: var(--text-main);
    text-align: center;
}

.series-not-found-content {
    width: 100%;
    max-width: 340px;
}

.series-not-found-logo {
    margin-bottom: 44px;
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -1px;
}

.series-not-found h1 {
    margin: 0 0 14px;
    font-size: 24px;
    font-weight: 800;
}

.series-not-found p {
    margin: 0 0 32px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.series-not-found-home {
    display: block;
    padding: 15px 20px;
    border-radius: 12px;
    background: var(--text-main);
    color: var(--text-on-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.series-not-found-home:active {
    opacity: 0.85;
}


/* Плавающее сворачивание раскрытого списка серий */
.episodes-floating-toggle {
    position: fixed;
    left: 50%;
    bottom: calc(
        var(--nav-height, 72px) +
        env(safe-area-inset-bottom) +
        10px
    );
    transform: translateX(-50%);
    z-index: 490;

    width: calc(100% - 36px);
    max-width: calc(var(--app-width, 430px) - 36px);
    min-height: 46px;
    padding: 10px 16px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-control);
    background: rgba(27, 27, 27, 0.96);
    color: var(--text-main);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;

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

.episodes-floating-toggle {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

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

    transition:
        opacity 420ms ease,
        transform 420ms ease,
        visibility 420ms ease;
}

.episodes-floating-toggle.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
    .episodes-floating-toggle {
        transition: none;
    }
}


/* WOW NOW — Liquid Glass floating button */
.episodes-floating-toggle {
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.16),
            rgba(255, 255, 255, 0.055) 42%,
            rgba(255, 255, 255, 0.025)
        );

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

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(255, 255, 255, 0.055),
        0 8px 28px rgba(0, 0, 0, 0.28);

    -webkit-backdrop-filter: blur(22px) saturate(175%);
    backdrop-filter: blur(22px) saturate(175%);
}

/* Скрываем место до получения рейтинга */
.series-genre-rank[hidden] {
    display: none;
}


/* Золотой рейтинг только для первых 10 мест */
.series-genre-rank-top {
    color: #D6AD6C;
}

/* Три постоянные строки жанров */
#seriesGenresBlock .series-genre-row {
    min-height: 17px;
}

#seriesGenresBlock .series-genre-placeholder {
    color: var(--text-white-48);
    font-size: 11px;
    line-height: 17px;
}

#seriesGenresBlock .series-genre-link {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Теги: одна строка с раскрытием */
#seriesTagsBlock {
    min-height: 17px;
}

.series-tags-layout {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    min-width: 0;
}

#seriesTagsBlock #seriesTags {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    max-height: 17px;
    line-height: 17px;
    overflow: hidden;
}

#seriesTagsBlock.is-expanded #seriesTags {
    max-height: none;
    overflow: visible;
}

.series-tags-toggle {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-white-72);
    font: inherit;
    font-size: 11px;
    line-height: 17px;
    cursor: pointer;
}

.series-tags-toggle[hidden] {
    display: none;
}

/* Не показываем незаполненную карточку */
.series-content[data-loading="true"] {
    visibility: hidden;
}
