﻿/* ============================================================
   VARIÁVEIS GLOBAIS
============================================================ */
:root {
    --card-w: 200px;
    --card-h: 290px;
    --wrap-px: 20px;
    --section-pt: 120px;
}

@media (max-width: 1024px) {
    :root {
        --card-w: 170px;
        --card-h: 250px;
        --wrap-px: 16px;
        --section-pt: 100px;
    }
}

@media (max-width: 768px) {
    :root {
        --card-w: 140px;
        --card-h: 200px;
        --wrap-px: 12px;
        --section-pt: 84px;
    }

    .homeBanner {
        min-height: 340px;
    }

    .homeBannerMedia,
    .homeBannerShade {
        inset: 0 var(--wrap-px);
        border-radius: 18px;
    }

    .homeBannerContent {
        min-height: 340px;
        padding: 24px calc(var(--wrap-px) + 14px) 22px;
    }

    .homeBannerSynopsis {
        font-size: 15px;
        line-height: 1.5;
    }

    .homeBannerBtn {
        width: 100%;
        min-width: 0;
    }
}

/* ============================================================
   GLOBAIS
============================================================ */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html,
body {
    -ms-content-zooming: none;
    touch-action: manipulation;
}

img,
video {
    max-width: none !important;
}

body {
    background: #111;
    color: #fff;
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
        Cantarell, Noto Sans, sans-serif;
}

/* ============================================================
   BACKDROP
============================================================ */
#backdropArea {
    position: fixed;
    inset: 0 0 auto 0;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    transition: background-image 0.5s ease, background-color 0.5s ease;
}

#backdropArea {
    display: none !important;
}

/* ============================================================
   TOP BAR
============================================================ */
#topBar {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 130;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid #222;
    backdrop-filter: blur(6px);
    padding: 8px;
    border-radius: 12px;
}

.brand {
    font-weight: 800;
    letter-spacing: 0.8px;
    background: #e60000;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
}

/* ============================================================
   BUSCA
============================================================ */
#formBuscaTop {
    display: flex;
    gap: 8px;
    flex: 1;
}

#inputBusca {
    flex: 1;
    padding: 10px 12px;
    font-size: 15px;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
    background: #151515;
    color: #fff;
}

#btnAplicarBusca {
    background: #0a84ff;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
}

#btnAplicarBusca:hover {
    filter: brightness(1.07);
}

#limparFiltroBtn {
    display: none;
    background: #444;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 600;
}

/* ============================================================
   TÍTULOS
============================================================ */
.sectionTitle {
    padding: 18px var(--wrap-px) 4px;
    max-width: 1600px;
    margin: 0 auto;
    font-size: 20px;
    font-weight: 800;
}

.sectionTitle:first-of-type {
    padding-top: var(--section-pt);
}

.homeBanner {
    position: relative;
    min-height: 430px;
    max-width: 1600px;
    margin: 0 auto -8px;
    padding: 0 var(--wrap-px);
}

.homeBannerMedia,
.homeBannerShade {
    position: absolute;
    inset: 0 var(--wrap-px);
    border-radius: 24px;
}

.homeBannerMedia {
    background-color: #0f1722;
    background-size: cover;
    background-position: center top;
    transition: opacity 0.42s ease, transform 0.42s ease;
}

.homeBannerShade {
    background:
        linear-gradient(90deg, rgba(5, 7, 12, 0.92) 0%, rgba(5, 7, 12, 0.62) 38%, rgba(5, 7, 12, 0.2) 68%, rgba(5, 7, 12, 0.82) 100%),
        linear-gradient(180deg, rgba(5, 7, 12, 0.06) 0%, rgba(5, 7, 12, 0.3) 52%, rgba(5, 7, 12, 0.92) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
    transition: opacity 0.42s ease;
}

.homeBannerContent {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 430px;
    max-width: 720px;
    padding: 42px calc(var(--wrap-px) + 28px) 34px;
    transition: opacity 0.42s ease, transform 0.42s ease;
}

.homeBanner.is-fading .homeBannerMedia,
.homeBanner.is-fading .homeBannerShade,
.homeBanner.is-fading .homeBannerContent {
    opacity: 0.18;
}

.homeBanner.is-fading .homeBannerMedia {
    transform: scale(1.015);
}

.homeBanner.is-fading .homeBannerContent {
    transform: translateY(8px);
}

.homeBannerMeta {
    color: rgba(255, 255, 255, 0.76);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.homeBannerTitle {
    margin: 12px 0 10px;
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.02;
}

.homeBannerSynopsis {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 17px;
    line-height: 1.6;
}

.homeBannerActions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.homeBannerDots {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}

.homeBannerDot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
    cursor: pointer;
}

.homeBannerDot.active {
    width: 28px;
    background: #fff;
}

.homeBannerBtn {
    min-width: 160px;
    padding: 14px 18px;
    border: 0;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.homeBannerBtn.primary {
    background: linear-gradient(135deg, #e50914, #ff5a5f);
    color: #fff;
}

.homeBannerBtn.secondary {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

#homeBanner + .sectionTitle {
    padding-top: 0;
}

/* ============================================================
   CARROSSEL
============================================================ */
.carouselWrap {
    margin: 0 auto 2px;
    max-width: 1600px;
    padding: 0 var(--wrap-px);
}

.carousel {
    padding: 8px 0;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.carousel > .cItem {
    scroll-snap-align: start;
}

.carousel::-webkit-scrollbar {
    height: 8px;
}

.carousel::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

/* ============================================================
   CARDS
============================================================ */
.cItem {
    width: var(--card-w);
    min-width: var(--card-w);
    max-width: var(--card-w);
    background: #1c1c1c;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    flex: 0 0 auto;
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.cThumb {
    width: var(--card-w);
    height: var(--card-h);
    object-fit: cover;
    background: #0f0f0f;
}

.cInfo {
    padding: 8px;
    background: #1b1b1b;
    text-align: center;
}

.cTitle {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cCats {
    font-size: 12px;
    color: #bbb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   FOCO TV
============================================================ */
.cItem.focused {
    outline: 3px solid #e50914;
    outline-offset: -3px;
    transform: scale(1.06);
    box-shadow: 0 0 20px #e5091480;
    z-index: 30;
}

/* ============================================================
   VER MAIS – BOTÃO
============================================================ */
.verMaisLinha {
    max-width: 1600px;
    margin: 12px auto;
    padding: 0 var(--wrap-px);
    display: flex;
    justify-content: center;
}

.verMaisBtn {
    background: #0a84ff;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 800;
}

/* ============================================================
   EXPANSÃO VERTICAL (GRADE 7×N)
============================================================ */
body.tv-mode .tv-expand-wrap {
    max-width: 1600px;
    margin: 0 auto 28px;
    padding: 0 var(--wrap-px);
}

body.tv-mode .tv-expand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-w), 1fr));
    gap: 12px;
    justify-items: start;
}

body.tv-mode .tv-expand-grid .cItem {
    width: var(--card-w);
}

/* ============================================================
   TARJA
============================================================ */
.tarjaBadge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
    color: #000;
    background: linear-gradient(90deg, #ffcc00, #fff07a);
    border-radius: 6px;
    box-shadow: 0 0 10px #ffeb8a90;
    transform: skewX(-8deg);
}

/* ============================================================
   PLAYER
============================================================ */
#playerContainer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    padding: 60px var(--wrap-px) 20px;
    z-index: 9999;
}

/* ===============================
   EPISÓDIO ATIVO (TV / Fire Stick)
=============================== */
#playerContainer .epItemBox.epAtivo {
    border: 3px solid #e50914;
    box-shadow: 0 0 12px rgba(229, 9, 20, 0.85);
    transform: scale(1.03);
}

#playerContainer .epItemBox {
    border: 3px solid transparent;
    transition: border 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

#epList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
}

#playerContainer .epItemBox img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

#playerContainer .epItemBox div {
    margin-top: 4px !important;
    font-size: 11px !important;
    line-height: 1.2;
}

/* ============================================================
   PLAYER — MOBILE FALLBACK
============================================================ */
@media (max-width: 768px) {

    #playerLayout {
        display: flex !important;
        flex-direction: column !important;
    }

    #sidebarSerie {
        width: 100% !important;
        max-height: none !important;
        overflow-y: visible !important;
        border-top: 1px solid rgba(0, 0, 0, 0.15);
        border-right: none !important;
        margin-top: 14px;
        padding-top: 14px;
    }

    #epList {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .epItemBox div {
        font-size: 14px !important;
    }
}

/* ============================================================
   PLAYER — SCROLL MOBILE
============================================================ */
@media (max-width: 768px) {
    #playerContainer {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================================
   PLAYER TV — TEMPORADAS
============================================================ */
#tempList {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tempBtn {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.4px;
    transition: all 0.18s ease;
}

.tempBtnActive {
    background: transparent;
    border-color: #e50914;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.45);
}

.tempBtn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(229, 9, 20, 0.75),
        0 0 16px rgba(229, 9, 20, 0.55);
}

/* ============================================================
   BADGE TEMPORADA / EPISÓDIO (TV)
============================================================ */
#tvEpisodeBadge {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 22px;
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    border: 2px solid rgba(229, 9, 20, 0.65);
    box-shadow:
        0 0 18px rgba(229, 9, 20, 0.35),
        0 8px 22px rgba(0, 0, 0, 0.6);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #fff;
    z-index: 60;
    pointer-events: none;
    text-align: center;
}

@media (min-width: 1280px) {
    #tvEpisodeBadge {
        font-size: 18px;
        padding: 12px 26px;
    }
}

@media (max-width: 768px) {
    #tvEpisodeBadge {
        font-size: 14px;
        padding: 8px 16px;
        top: 12px;
    }
}

/* ============================================================
   TV / FIRE STICK — FOCO PREMIUM NO CARROSSEL
============================================================ */
.cItem.focused,
.cItem:focus-visible {
    transform: scale(1.08);
    z-index: 40;
    border-radius: 14px;
    box-shadow:
        0 22px 45px rgba(0, 0, 0, 0.75),
        0 0 0 3px rgba(229, 9, 20, 0.65),
        0 0 22px rgba(229, 9, 20, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cItem.focused .cThumb,
.cItem:focus-visible .cThumb {
    filter: brightness(1.12) contrast(1.08);
}

.cItem.focused .cTitle,
.cItem:focus-visible .cTitle {
    color: #fff;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.9);
}

.cItem.focused .cCats,
.cItem:focus-visible .cCats {
    color: rgba(255, 255, 255, 0.95);
}

@media (max-width: 768px) {
    .cItem.focused,
    .cItem:focus-visible {
        transform: scale(1.04);
    }
}

/* ============================================================
   TV / FIRE STICK — FOCO VISUAL COM ZOOM
============================================================ */
.cItem {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    transform: scale(1);
    z-index: 1;
}

.cItem.focused {
    transform: scale(1.08);
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.85),
        0 0 0 3px rgba(255, 255, 255, 0.9);
    z-index: 10;
}

/* ============================================================
   CARD EFFECTS — TESTE VISUAL
============================================================ */
.cItem {
    isolation: isolate;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(8, 8, 8, 0.92));
    transition:
        transform 0.24s ease,
        box-shadow 0.24s ease,
        border-color 0.24s ease,
        filter 0.24s ease;
}

.cItem::before {
    content: "";
    position: absolute;
    inset: -20% auto 12% -65%;
    width: 55%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 45%,
        rgba(255, 255, 255, 0.22) 50%,
        rgba(255, 255, 255, 0.08) 55%,
        transparent 100%
    );
    transform: rotate(14deg) translateX(0);
    opacity: 0;
    transition: transform 0.55s ease, opacity 0.3s ease;
    pointer-events: none;
    z-index: 3;
}

.cItem::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.04) 0%,
            transparent 24%,
            transparent 58%,
            rgba(0, 0, 0, 0.12) 72%,
            rgba(0, 0, 0, 0.5) 100%
        );
    opacity: 0.9;
    pointer-events: none;
    z-index: 1;
}

.cThumb,
.cInfo,
.tarjaBadge,
.trailerBtn,
.soundBtn {
    position: relative;
}

.cThumb {
    display: block;
    z-index: 0;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 0.34s ease, filter 0.34s ease;
}

.cInfo {
    z-index: 2;
    background: linear-gradient(180deg, rgba(17, 17, 17, 0.72), rgba(10, 10, 10, 0.96));
    transition: background 0.24s ease, transform 0.24s ease;
}

.cTitle,
.cCats {
    position: relative;
    z-index: 2;
    transition: color 0.24s ease, transform 0.24s ease;
}

.carousel .cItem:hover {
    transform: translateY(-8px) scale(1.035);
    border-color: rgba(229, 9, 20, 0.35);
    box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 0 22px rgba(229, 9, 20, 0.16);
    z-index: 22;
}

.carousel .cItem:hover::before,
.cItem.focused::before,
.cItem:focus-visible::before {
    opacity: 1;
    transform: rotate(14deg) translateX(255%);
}

.carousel .cItem:hover .cThumb,
.cItem.focused .cThumb,
.cItem:focus-visible .cThumb {
    transform: scale(1.07);
    filter: brightness(1.08) saturate(1.08);
}

.carousel .cItem:hover .cInfo {
    background: linear-gradient(180deg, rgba(22, 22, 22, 0.78), rgba(8, 8, 8, 0.98));
    transform: translateY(-2px);
}

.carousel .cItem:hover .cTitle,
.cItem.focused .cTitle,
.cItem:focus-visible .cTitle {
    color: #fff;
    transform: translateY(-1px);
}

.carousel .cItem:hover .cCats,
.cItem.focused .cCats,
.cItem:focus-visible .cCats {
    color: rgba(255, 255, 255, 0.9);
}

.carousel .cItem:hover .trailerBtn,
.cItem.focused .trailerBtn,
.cItem:focus-visible .trailerBtn {
    background: rgba(229, 9, 20, 0.92);
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    .cItem,
    .cItem::before,
    .cThumb,
    .cInfo,
    .cTitle,
    .cCats {
        transition: none;
    }
}

/* ============================================================
   DETAILS OVERLAY
============================================================ */
body.details-open {
    overflow: hidden;
}

#detailsOverlay {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9800;
}

#detailsOverlay.active {
    display: block;
}

.detailsBackdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 4, 8, 0.84);
    backdrop-filter: blur(14px);
}

.detailsDialog {
    position: relative;
    width: min(1180px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    margin: 16px auto;
    border-radius: 24px;
    overflow-x: hidden;
    overflow-y: auto;
    background: linear-gradient(180deg, #121826 0%, #090c14 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.52),
        0 0 0 1px rgba(255, 255, 255, 0.04);
}

#detailsClose {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 5;
    min-width: 108px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

.detailsHero {
    position: relative;
    min-height: 360px;
}

.detailsHeroImage {
    position: absolute;
    inset: 0;
    background-color: #111827;
    background-size: cover;
    background-position: center top;
    transform: scale(1.02);
}

.detailsTrailerVideo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.detailsTrailerFrame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

.detailsTrailerFullscreen {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 4;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.detailsHeroShade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(5, 7, 12, 0.88) 0%, rgba(5, 7, 12, 0.54) 40%, rgba(5, 7, 12, 0.16) 68%, rgba(5, 7, 12, 0.78) 100%),
        linear-gradient(180deg, rgba(5, 7, 12, 0.02) 0%, rgba(5, 7, 12, 0.12) 36%, #090c14 100%);
}

.detailsBody {
    position: relative;
    z-index: 2;
    margin-top: -96px;
    padding: 18px 32px 32px;
    display: block;
}

.detailsContent {
    max-width: 860px;
    padding-top: 32px;
    padding-bottom: 6px;
}

.detailsMeta {
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.detailsResume {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(229, 9, 20, 0.16);
    border: 1px solid rgba(229, 9, 20, 0.34);
    color: #ffd7da;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

#detailsTitle {
    margin: 12px 0 10px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
}

#detailsSynopsis {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 17px;
    line-height: 1.65;
}

.detailsCast {
    margin-top: 22px;
}

.detailsCastTitle {
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.detailsCastGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.detailsCastCard {
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
}

.detailsCastPhoto {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: #111827;
}

.detailsCastBody {
    padding: 10px;
}

.detailsCastName {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
}

.detailsCastCharacter {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
    line-height: 1.35;
}

.detailsSeriesNav {
    margin-top: 24px;
}

.detailsSeasonTabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.detailsSeasonTab {
    min-width: 0;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.detailsSeasonTab.active {
    background: rgba(229, 9, 20, 0.18);
    border-color: rgba(229, 9, 20, 0.42);
}

.detailsEpisodeGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 10px;
}

.detailsEpisodeCard {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 96px;
    overflow: hidden;
    padding: 0;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    text-align: left;
}

.detailsEpisodeCard.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.26);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.22);
}

.detailsEpisodeThumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detailsEpisodeOverlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(5, 7, 12, 0.08) 0%, rgba(5, 7, 12, 0.18) 40%, rgba(5, 7, 12, 0.92) 100%);
}

.detailsEpisodeBody {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px;
}

.detailsEpisodeNumber {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.64);
}

.detailsEpisodeName {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.detailsEpisodeResume {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(229, 9, 20, 0.2);
    color: #ffd7da;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.detailsActions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 24px;
}

.detailsAction,
#detailsClose {
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
}

.detailsAction {
    min-width: 180px;
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 800;
}

.detailsAction.primary {
    background: linear-gradient(135deg, #e50914, #ff4d5a);
    color: #fff;
    box-shadow: 0 16px 28px rgba(229, 9, 20, 0.24);
}

.detailsAction.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.detailsAction:hover,
.detailsAction:focus-visible,
#detailsClose:hover,
#detailsClose:focus-visible {
    transform: translateY(-2px);
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.1),
        0 12px 26px rgba(0, 0, 0, 0.32);
}

.detailsAction:focus-visible,
#detailsClose:focus-visible {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 900px) {
    .detailsDialog {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        margin: 10px auto;
    }

    .detailsHero {
        min-height: 280px;
    }

    .detailsBody {
        margin-top: -34px;
        padding: 14px 20px 24px;
    }

    #detailsSynopsis {
        font-size: 15px;
        line-height: 1.55;
    }

    .detailsEpisodeGrid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .detailsDialog {
        border-radius: 20px;
    }

    #detailsClose,
    .detailsAction {
        min-width: 0;
        width: 100%;
    }

    .detailsActions {
        flex-direction: column;
    }
}
