/* ==========================================================================
   Страница релиза по макету «Аниме страница»: шапка с баннером, вкладки
   «О сериале / Медиа / Связанное / Комментарии». Цвета — сайта AniBaza.
   ========================================================================== */

.rp {
    --rp-gutter: clamp(16px, 3.6vw, 70px);
    margin-top: calc((var(--header-height) + 24px) * -1);
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Шапка с баннером ---------- */

.rp-hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-bottom: 1px solid var(--border-color);
    isolation: isolate;
}

.rp-hero__media {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

/* Фон шапки: размытый и притушенный кадр баннера, без обрезки и без «огромной картинки» */
.rp-hero__backdrop {
    position: absolute;
    inset: -60px;
    width: calc(100% + 120px);
    height: calc(100% + 120px);
    object-fit: cover;
    filter: blur(40px) brightness(.5) saturate(1.25);
    transform: scale(1.05);
}

.rp-hero__shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, var(--bg-color) 0%, rgba(9, 0, 15, .55) 35%, rgba(9, 0, 15, .25) 100%),
        linear-gradient(90deg, rgba(9, 0, 15, .6) 0%, rgba(9, 0, 15, 0) 60%);
}

.rp-hero__inner {
    display: flex;
    align-items: flex-end;
    gap: clamp(24px, 2.6vw, 48px);
    padding: calc(var(--header-height) + 48px) var(--rp-gutter) 34px;
}

/* Постер 2:3 целиком, как карточка */
.rp-hero__poster {
    align-self: center;
    flex: none;
    width: clamp(190px, 15vw, 290px);
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(255, 255, 255, .06);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .08);
}

.rp-hero__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Баннер 16:9 целиком в рамке справа — только на широком экране */
.rp-hero__frame {
    width: clamp(320px, 24vw, 480px);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 14px;
    background: rgba(255, 255, 255, .06);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .08);
}

.release__banner {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 1499px) {
    .rp-hero__frame {
        display: none;
    }
}

.rp-hero__main {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 1300px;
}

.rp-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 0;
    margin-bottom: 18px;
}

.rp-meta > span {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, .78);
    font-size: 15px;
}

.rp-meta > span + span::before {
    content: "";
    width: 4px;
    height: 4px;
    margin: 0 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .45);
}

.rp-meta__rating {
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .12);
    color: #fff !important;
    font-weight: 600;
}

.rp-meta__rating .ic {
    width: 16px;
    height: 16px;
    color: #f5c518;
}

.rp-meta__warn {
    color: #ff7a85 !important;
}

.rp-title {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: #fff;
    font-size: clamp(28px, 2.8vw, 54px);
    font-weight: 700;
    line-height: 1.15;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow-wrap: break-word;
}

.rp-orig {
    margin-top: 8px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--text-color-faint);
    font-size: 16px;
}

.rp-lead {
    margin-top: 20px;
    max-width: 1080px;
    color: rgba(255, 255, 255, .78);
    font-size: 18px;
    line-height: 1.45;
}

.rp-facts {
    margin: 28px 0 0;
    display: grid;
    gap: 6px;
}

.rp-facts div {
    display: flex;
    gap: 6px;
}

.rp-facts dt,
.rp-facts dd {
    margin: 0;
    font-size: 17px;
    font-weight: 400;
}

.rp-facts dt {
    color: var(--text-color-faint);
}

.rp-facts dd {
    color: #fff;
}

/* Кнопки шапки */
.rp-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
}

.rp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 56px;
    min-width: 56px;
    padding: 0 28px;
    border: 0;
    border-radius: 12px;
    background: rgba(40, 36, 46, .82);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    transition: background-color .2s ease, filter .2s ease;
}

.rp-btn::-webkit-details-marker {
    display: none;
}

.rp-btn:hover {
    background: rgba(62, 56, 72, .9);
    color: #fff;
}

.rp-btn span {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.rp-btn_primary {
    min-width: 200px;
    background: var(--accent-gradient);
}

.rp-btn_primary:hover {
    background: var(--accent-gradient);
    filter: brightness(1.1);
}

.rp-btn_icon {
    width: 56px;
    padding: 0;
}

.rp-btn_icon-text {
    padding: 0 20px;
}

.rp-btn .ic {
    width: 22px;
    height: 22px;
}

.rp-btn.is-active .ic {
    color: var(--text-color-emphasis);
}

.rp-btn.is-active .ic path {
    fill: currentColor;
}

.rp-bm .bm-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
}

.rp-bm .bm-dot:not([class*="bm-dot_"]) {
    display: none;
}

.rp-bm .bm-select__menu {
    top: auto;
    bottom: calc(100% + 8px);
    min-width: 240px;
}

.rp-dots {
    margin-left: 0;
}

.rp-dots > summary {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    color: #fff;
}

.rp-dots > summary:hover,
.rp-dots[open] > summary {
    background: rgba(62, 56, 72, .9);
}

.rp-dots .dots__menu {
    top: auto;
    bottom: calc(100% + 8px);
    left: 0;
    right: auto;
}

/* Правый блок: обновление и оценка */
.rp-hero__side {
    flex: none;
    display: grid;
    justify-items: end;
    gap: 10px;
    padding-bottom: 8px;
    text-align: right;
}

.rp-update {
    color: rgba(255, 255, 255, .85);
    font-size: 16px;
}

.rp-rate {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rp-rate__label {
    padding-right: 12px;
    border-right: 1px solid rgba(255, 255, 255, .25);
    color: var(--text-color-faint);
    font-size: 15px;
}

.rp-rate__stars {
    display: inline-flex;
    gap: 2px;
}

.rp-star {
    display: inline-grid;
    place-items: center;
    padding: 2px;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, .28);
    cursor: pointer;
    transition: color .15s ease, transform .15s ease;
}

.rp-star .ic {
    width: 20px;
    height: 20px;
}

.rp-star.is-on {
    color: #f5c518;
}

.rp-star:hover {
    transform: scale(1.12);
}

.rp-star input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rp-rate__avg {
    min-width: 28px;
    color: #fff;
    font-weight: 700;
}

/* Вкладки */
.rp-tabs {
    display: flex;
    gap: clamp(20px, 2vw, 40px);
    padding: 0 var(--rp-gutter);
    overflow-x: auto;
    scrollbar-width: none;
}

.rp-tab {
    padding: 14px 0 16px;
    color: rgba(255, 255, 255, .9);
    font-size: clamp(17px, 1.1vw, 21px);
    font-weight: 600;
    white-space: nowrap;
}

.rp-tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: transparent;
    transition: background-color .2s ease;
}

.rp-tab:hover {
    color: #fff;
}

.rp-tab.is-active {
    color: #fff;
}

.rp-tab.is-active::after {
    background: var(--text-color-emphasis);
}

.rp-tab__count {
    color: var(--text-color-faint);
    font-size: .8em;
}

/* ---------- Тело страницы ---------- */

.rp-body {
    padding: 40px var(--rp-gutter) 80px;
}

.rp-section {
    margin-top: 64px;
}

.rp-section_first {
    margin-top: 0;
}

.rp-section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.rp-section__head .rp-h2 {
    margin: 0;
}

.rp-h2 {
    margin: 0 0 24px;
    color: #fff;
    font-size: clamp(24px, 1.8vw, 34px);
    font-weight: 700;
}

.rp-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.rp-more {
    display: block;
    margin: 18px auto 0;
    border: 0;
    background: none;
    color: var(--text-color-faint);
    font-size: 14px;
    cursor: pointer;
}

.rp-more:hover {
    color: #fff;
}

/* О сериале: описание + таблица */
.rp-about {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 80px);
    align-items: start;
}

.rp-remind {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    color: #fff;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: border-color .2s ease;
}

.rp-remind span {
    color: inherit;
    font-size: inherit;
}

.rp-remind .ic {
    color: var(--text-color-emphasis);
}

.rp-remind:hover {
    border-color: rgba(1, 174, 76, .5);
    color: #fff;
}

.rp-remind.is-on {
    border-color: var(--text-color-emphasis);
    background: rgba(1, 174, 76, .1);
}

.rp-desc {
    margin-top: 28px;
    color: rgba(255, 255, 255, .9);
    font-size: 18px;
    line-height: 1.5;
}

.rp-desc p {
    margin: 0 0 1em;
    font-size: inherit;
    color: inherit;
}

.rp-desc__label {
    float: left;
    margin-right: 6px;
    color: var(--text-color-faint);
    font-size: inherit;
}

.rp-info {
    margin: 0;
}

.rp-info__row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.rp-info__row:first-child {
    padding-top: 0;
}

.rp-info dt,
.rp-info dd {
    margin: 0;
    font-size: 17px;
}

.rp-info dt {
    flex: none;
    color: var(--text-color-faint);
    font-weight: 400;
}

.rp-info dd {
    color: #fff;
    text-align: right;
}

.rp-info__staff {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.8;
}

.rp-info__staff a {
    color: #fff;
}

.rp-info__staff a:hover {
    color: var(--text-color-emphasis);
}

.rp-info__staff span {
    color: var(--text-color-faint);
}

/* В списках у пользователей */

/* Герои */
.heroes {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: clamp(10px, 1.2vw, 22px);
}

.hero-card {
    margin: 0;
}

.hero-card__img {
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #10301f, #23122f);
}

.hero-card__img::after {
    content: "";
    position: absolute;
    inset: 55% 0 0;
    background: linear-gradient(0deg, rgba(9, 0, 15, .85), transparent);
}

.hero-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-card__ph {
    display: grid;
    place-items: center;
    height: 100%;
    color: rgba(255, 255, 255, .4);
    font-size: 40px;
    font-weight: 700;
}

.hero-card__cap {
    margin-top: 10px;
    display: grid;
    gap: 2px;
}

.hero-card__name {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-card__actor {
    color: var(--text-color-faint);
    font-size: 13px;
}

a.hero-card__actor:hover {
    color: var(--text-color-emphasis);
}

/* Отзывы */
.reviews {
    display: grid;
    gap: 20px;
}

.review__stars {
    display: flex;
    gap: 4px;
    margin-top: 20px;
}

.review__star {
    color: rgba(255, 255, 255, .25);
}

.review__star.is-on {
    color: #f5c518;
}

.review__star .ic {
    width: 18px;
    height: 18px;
}

.review__title {
    margin: 14px 0 6px;
    color: #fff;
    font-size: clamp(20px, 1.4vw, 26px);
    font-weight: 600;
}

.review__text {
    color: rgba(255, 255, 255, .85);
    font-size: 17px;
    line-height: 1.5;
}

.review-form {
    width: min(640px, 100%);
    display: grid;
    gap: 12px;
}

.review-form__stars {
    display: flex;
    gap: 4px;
}

.review-form__stars .ic {
    width: 30px;
    height: 30px;
}

/* Медиа */
.rp-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.rp-subtab {
    height: 52px;
    padding: 0 30px;
    border: 0;
    border-radius: 12px;
    background: var(--surface-color);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .2s ease;
}

.rp-subtab span {
    color: var(--text-color-faint);
    font-size: 14px;
}

.rp-subtab:hover {
    background: var(--surface-color-raised);
}

.rp-subtab.is-active {
    background: var(--accent-gradient);
}

.rp-subtab.is-active span {
    color: rgba(255, 255, 255, .8);
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(10px, 1.2vw, 24px);
}

.media-grid__empty {
    grid-column: 1 / -1;
}

.media-item {
    aspect-ratio: 16 / 9;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #10301f, #23122f);
    cursor: zoom-in;
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.media-item:hover img {
    transform: scale(1.04);
}

.media-item_video {
    cursor: pointer;
}

.media-item__play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

.media-item__play .ic {
    width: 56px;
    height: 56px;
    padding: 14px;
    border-radius: 50%;
    background: rgba(9, 0, 15, .6);
    color: #fff;
}

.media-item__title {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
}

/* Папки коллекций */
.folders {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(14px, 1.6vw, 30px);
}

/* Окно видео и просмотр кадров */
.rp-video-modal__box {
    width: min(1100px, 94vw);
}

.rp-video-modal .cm-modal__close {
    position: absolute;
    top: -44px;
    right: 0;
}

.rp-video-modal__frame {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: #000;
}

.rp-video-modal__frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.viewer.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.viewer__img {
    max-width: min(1400px, 84vw);
    max-height: 84vh;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.viewer .cm-modal__close {
    position: absolute;
    top: 20px;
    right: 24px;
}

.viewer__nav {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    cursor: pointer;
}

.viewer__nav:hover {
    background: rgba(255, 255, 255, .22);
}

.viewer__nav_prev .ic {
    transform: rotate(90deg);
}

.viewer__nav_next .ic {
    transform: rotate(-90deg);
}

.viewer__count {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    color: var(--text-color-muted);
    font-size: 14px;
}

/* Пузырёк «ссылка скопирована» */
.share-bubble {
    position: fixed;
    z-index: 1000;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(18, 10, 26, .95);
    border: 1px solid var(--border-color);
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.share-bubble--show {
    opacity: 1;
}

/* ---------- Адаптив ---------- */

@media screen and (max-width: 1400px) {
    .heroes {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media screen and (max-width: 1200px) {
    .rp-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .folders,
    .media-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .lstats__tile {
        padding: 16px;
    }
}

@media screen and (max-width: 992px) {
    .rp-hero__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .rp-hero__side {
        justify-items: start;
        text-align: left;
    }

    .rp-about {
        grid-template-columns: 1fr;
    }

    .lstats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .heroes {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media screen and (max-width: 768px) {
    .rp-hero__inner {
        padding-top: calc(var(--header-height) + 32px);
    }

    .rp-hero__poster {
        width: 150px;
        border-radius: 12px;
    }

    .rp-lead {
        font-size: 16px;
    }

    .rp-actions {
        margin-top: 28px;
        gap: 8px;
    }

    .rp-btn {
        height: 48px;
        min-width: 48px;
        font-size: 15px;
    }

    .rp-btn_primary {
        flex: 1 1 100%;
    }

    .rp-btn_icon,
    .rp-dots > summary {
        width: 48px;
        height: 48px;
    }

    .rp-grid,
    .folders,
    .media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lstats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .heroes {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .rp-info dt,
    .rp-info dd,
    .rp-desc {
        font-size: 15px;
    }

    .rp-section {
        margin-top: 44px;
    }
}
