:root {
    --dongker: #0b1b3a;
    --dongker-2: #0f234b;
    --panel: #0e2148;
    --panel-2: #0a1a39;
    --line: #1b2f61;
    --accent: #1e90ff;
    --accent-2: #00b3ff;
    --text: #e9f1ff;
    --muted: #b7c9ff;
}

html,
body {
    background: linear-gradient(180deg, var(--dongker), #061124) fixed;
    color: var(--text);
}

a {
    color: #9ec7ff;
    text-decoration: none
}

a:hover {
    color: #cfe3ff
}

img {
    max-width: 100%;
    display: block
}

/* NAV */
.navbar {
    background: rgba(11, 27, 58, .95);
    border-bottom: 1px solid var(--line)
}

.navbar .nav-link,
.navbar-brand {
    color: var(--text)
}

.navbar .nav-link.active {
    color: #fff
}

/* PANEL */
.panel {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid #193466;
    border-radius: 1rem
}

/* ====== CARD DRAMA ala mockup ====== */
.card-drama {
    background: linear-gradient(180deg, #0e2148, #0a1a39);
    border: 1px solid #193466;
    color: var(--text);
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}

.card-drama .poster-wrap {
    position: relative;
}

.card-drama img.card-img-top {
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

/* gradasi bawah poster agar tag kebaca */
.card-drama .poster-grad {
    position: absolute;
    inset: auto 0 0 0;
    height: 38%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(10, 26, 57, .92) 90%);
}

/* pill generik */
.pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: rgba(10, 26, 57, .7);
    color: #e6efff;
    border: 1px solid rgba(255, 255, 255, .25);
    padding: .28rem .6rem;
    border-radius: 1rem;
    font-size: .82rem;
    font-weight: 600;
    backdrop-filter: blur(4px) saturate(1.2);
}

.pill-blue {
    background: #cfe2ff;
    color: #0b1b3a;
    border: 0;
}

/* posisi pill */
.card-drama .pill-views {
    position: absolute;
    left: .6rem;
    top: .6rem;
    z-index: 3;
}

.card-drama .pill-ribbon {
    position: absolute;
    right: .6rem;
    top: .6rem;
    z-index: 3;
}

/* tag di atas poster */
.card-drama .tag-stack {
    position: absolute;
    left: .6rem;
    right: .6rem;
    bottom: .6rem;
    z-index: 3;
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.tag {
    background: rgba(17, 43, 87, .85);
    border: 1px solid #2a4d8b;
    color: #d7e5ff;
    padding: .22rem .55rem;
    border-radius: 1rem;
    font-size: .78rem;
    font-weight: 600;
}

/* body */
.card-drama .card-body {
    padding: 1rem 1rem 1.25rem;
}

.card-drama .title {
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1.3;
    margin: 0 0 .35rem;
    color: #cfe2ff;
}

.card-drama .meta {
    color: #b7c9ff;
    font-size: .9rem;
    margin-bottom: .6rem;
}

.card-drama .desc {
    color: #c9d7ff;
    font-size: .95rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* section header */
.section-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 1.25rem 0 .75rem
}

.section-title .dot {
    width: .65rem;
    height: .65rem;
    border-radius: 50%;
    background: var(--accent)
}

.section-title h2,
.section-title h3 {
    margin: 0;
    font-size: 1.15rem
}

/* hero */
.hero .tab {
    display: inline-block;
    padding: .35rem .7rem;
    border: 1px solid #22417c;
    border-radius: .7rem;
    background: #0f234b;
    margin-right: .35rem;
    color: #d6e4ff
}

.hero .ad {
    border: 1px dashed #345aa0;
    border-radius: .9rem;
    color: #a9c1ff;
    display: flex;
    align-items: center;
    justify-content: center
}

/* footer */
.footer {
    background: #08142c;
    border-top: 1px solid var(--line);
    color: var(--muted)
}

/* grid util: 5 item responsif */
.grid-5 {
    display: grid;
    gap: 1rem;
}

@media (min-width:576px) {
    .grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width:992px) {
    .grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width:1400px) {
    .grid-5 {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ===== DETAIL PAGE ===== */
.detail-title {
    font-weight: 800
}

.detail-sub {
    color: #b7c9ff
}

.info-panel {
    background: linear-gradient(180deg, #0e2148, #0a1a39);
    border: 1px solid #193466;
    border-radius: 1rem;
    padding: 1rem
}

.info-panel .row-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem 0;
    border-top: 1px dashed #2a4689
}

.info-panel .row-line:first-child {
    border-top: 0
}

.info-panel .btn-wrap .btn {
    width: 100%
}

/* Episode board - Scroll vertical */
.episode-board {
    background: linear-gradient(180deg, #0e2148, #0a1a39);
    border: 1px solid #193466;
    border-radius: 1rem;
    padding: 1rem;
    max-height: 400px;
    /* tinggi maksimum box episode */
    overflow-y: auto;
    /* scroll vertikal jika konten lebih */
}

.ep-grid {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.ep-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b1f46;
    border: 1px solid #224785;
    color: #e5efff;
    border-radius: .9rem;
    min-height: 64px;
    font-weight: 700;
    text-align: center;
}

.ep-item:hover {
    background: #113064;
}

@media (min-width:576px) {
    .ep-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width:768px) {
    .ep-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width:992px) {
    .ep-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width:1200px) {
    .ep-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width:1400px) {
    .ep-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.ep-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b1f46;
    border: 1px solid #224785;
    color: #e5efff;
    border-radius: .9rem;
    min-height: 64px;
    font-weight: 700;
}

.ep-item:hover {
    background: #113064
}

/* Ad panel */
.ad-slot {
    background: repeating-linear-gradient(45deg, #0f2b5a 0, #0f2b5a 10px, #0c2146 10px, #0c2146 20px);
    border: 1px dashed #345aa0;
    border-radius: .9rem;
    color: #a9c1ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== STREAM PAGE ===== */
.player-portrait {
    max-width: 520px
}

.ratio-9x16 {
    position: relative;
    width: 100%
}

.ratio-9x16::before {
    content: "";
    display: block;
    padding-top: 177.7777%
}

/* 9:16 */
.ratio-9x16>* {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: .75rem
}

.side-panel {
    background: linear-gradient(180deg, #0e2148, #0a1a39);
    border: 1px solid #193466;
    border-radius: 1rem;
    padding: 1rem
}

.side-panel h6 {
    margin: 0 0 .5rem
}

.ep-legend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .5rem;
    color: #b7c9ff
}

.ep-board {
    max-height: 420px;
    overflow-y: auto;
    border-radius: .75rem
}

.ep-grid-s {
    display: grid;
    gap: .6rem;
    grid-template-columns: repeat(4, 1fr)
}

@media (min-width:1200px) {
    .ep-grid-s {
        grid-template-columns: repeat(5, 1fr)
    }
}

/* EPISODE CHIP STYLE */
.ep-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    background: #0b1f46;
    border: 1px solid #224785;
    color: #e5efff;
    border-radius: .7rem;
    font-weight: 700;
    text-align: center;
    position: relative;
    overflow: visible;
    transition: background .2s, color .2s;
}

.ep-chip:hover {
    background: #113064;
}

.ep-chip.active {
    background: #173772;
    color: #ffffff;
    border-color: #3e6fe0;
    font-weight: 800;
}

/* Ribbon "Play" di pojok kanan atas */
.ep-chip.active::after {
    content: "Play";
    position: absolute;
    top: -0px;
    right: -8px;
    background: #4CAF50;
    /* hijau Play */
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
}

.badge-play {
    font-size: .7rem;
    border-radius: .5rem;
    background: #8fe1a9;
    color: #0b1b3a;
    font-weight: 800;
    padding: .2rem .45rem
}

/* ringkas panel di kanan bawah */
.meta-table {
    margin: 0
}

.meta-table .row-line {
    display: flex;
    justify-content: space-between;
    padding: .5rem 0;
    border-top: 1px dashed #2a4689
}

.meta-table .row-line:first-child {
    border-top: 0
}

/* episode now playing panel */
.now-panel {
    background: linear-gradient(180deg, #0e2148, #0a1a39);
    border: 1px solid #193466;
    border-radius: 1rem;
    padding: 1rem
}

.now-title {
    font-weight: 800
}

.now-stats {
    color: #b7c9ff
}

.now-tags {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin-top: .35rem
}

.now-tags .pill {
    padding: .25rem .55rem
}

/* related grid */
.related .section-title {
    margin-top: 1.25rem
}

.card-land {
    background: linear-gradient(180deg, #0e2148, #0a1a39);
    border: 1px solid #193466;
    border-radius: .9rem;
    overflow: hidden;
    color: #e9f1ff
}

.card-land .thumb {
    aspect-ratio: 16/9;
    object-fit: cover;
    width: 100%
}

.card-land .body {
    padding: .65rem
}

.card-land .title {
    font-weight: 700;
    margin: 0 0 .2rem;
    font-size: .95rem
}

.card-land .tags {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap
}

.card-land .tag {
    background: #112b57;
    border: 1px solid #1e3e7b;
    color: #cfe0ff;
    padding: .12rem .4rem;
    border-radius: .5rem;
    font-size: .72rem
}

/* ==== NAV (dark, mobile drawer) ==== */
:root {
    --nav-bg: #0e2148;
    /* Biru dongker utama */
    --nav-elev: #132d5e;
    /* Elevation untuk elemen */
    --nav-line: #1b3e85;
    /* Border line */
    --nav-text: #ffffff;
    /* Teks terang */
    --nav-muted: #c0c9dd;
    /* Teks sekunder */
    --pill-bg: #1b3e85;
    /* Hover & pill */
}

.nav-modern {
    background: var(--nav-bg);
    color: var(--nav-text);
    border-bottom: 1px solid var(--nav-line);
}

.nav-modern .brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--nav-text);
    font-weight: 800;
    text-decoration: none;
}

.nav-modern .brand .logo {
    width: 34px;
    height: 34px;
    border-radius: .8rem;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #2a2a2a, #1a1a1a);
    box-shadow: inset 0 0 0 1px #383838;
}

.nav-modern .brand .logo svg {
    width: 18px;
    height: 18px;
    fill: #fff
}

.nav-modern .nav-actions {
    display: flex;
    align-items: center;
    gap: .6rem
}

.nav-modern .search {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--nav-elev);
    border: 1px solid var(--nav-line);
    padding: .35rem .6rem;
    border-radius: .6rem;
    min-width: 240px;
    color: var(--nav-text);
}

.nav-modern .search input {
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--nav-text);
    width: 100%;
}

.nav-modern .lang {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: var(--nav-elev);
    border: 1px solid var(--nav-line);
    padding: .4rem .6rem;
    border-radius: .6rem;
    color: var(--nav-text);
    text-decoration: none;
}

.nav-modern .desk-menu {
    display: flex;
    align-items: center;
    gap: 1rem
}

.nav-modern .desk-menu a {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .55rem;
    border-radius: .6rem;
    color: var(--nav-text);
    text-decoration: none;
}

.nav-modern .desk-menu a:hover {
    background: var(--pill-bg)
}

/* ============ Drawer ============ */
#nav-toggle {
    display: none
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: saturate(1.2) blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: .2s ease;
    z-index: 1040;
}

.drawer {
    position: fixed;
    top: 0;
    left: -290px;
    width: 280px;
    height: 100dvh;
    background: #111;
    color: var(--nav-text);
    border-right: 1px solid var(--nav-line);
    padding: 1rem;
    z-index: 1050;
    transition: left .25s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.drawer .close {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--nav-muted);
    text-decoration: none;
}

.drawer .menu a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem .7rem;
    color: var(--nav-text);
    text-decoration: none;
    border-radius: .6rem;
}

.drawer .menu a:hover {
    background: #1a1a1a
}

.drawer .muted {
    color: var(--nav-muted);
    font-size: .85rem
}

/* toggle on */
#nav-toggle:checked~.drawer-overlay {
    opacity: 1;
    pointer-events: auto
}

#nav-toggle:checked~.drawer {
    left: 0
}

/* ============ Responsive ============ */
.navbar-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .6rem 0
}

.nav-modern .hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: .6rem;
    border: 1px solid var(--nav-line);
    background: var(--nav-elev);
    color: #fff;
    cursor: pointer;
}

@media (min-width:992px) {
    .nav-modern .hamburger {
        display: none
    }

    .drawer,
    .drawer-overlay {
        display: none
    }

    .navbar-wrap {
        gap: 1rem
    }

    .nav-modern .search {
        min-width: 420px
    }
}

.btn-outline-light {
    border-color: #1b3e85;
    color: #fff;
    font-weight: 600;
    padding: 0.4rem 1.2rem;
    border-radius: 0.6rem;
}

.btn-outline-light:hover {
    background-color: #1b3e85;
    color: #fff;
}