:root {
    color-scheme: dark;
    --bg: #020617;
    --panel: #0f172a;
    --panel-soft: #111827;
    --line: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-strong: #cbd5e1;
    --emerald: #10b981;
    --emerald-dark: #047857;
    --amber: #f59e0b;
    --shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.18), transparent 32rem),
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 30rem),
        var(--bg);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.logo-mark {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--emerald), var(--amber));
    color: #04111f;
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.35);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow: hidden;
}

.desktop-nav a,
.mobile-nav a,
.footer-links a {
    color: var(--muted-strong);
    border-radius: 999px;
    transition: color 0.25s ease, background 0.25s ease;
}

.desktop-nav a {
    padding: 8px 12px;
    font-size: 14px;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.footer-links a:hover {
    color: #ecfdf5;
    background: rgba(16, 185, 129, 0.16);
}

.header-search {
    width: min(300px, 26vw);
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.82);
    border-radius: 999px;
    overflow: hidden;
}

.header-search input,
.wide-search input,
.local-filter {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

.header-search input {
    padding: 10px 14px;
}

.header-search button,
.wide-search button {
    border: 0;
    color: #04111f;
    background: var(--emerald);
    font-weight: 700;
    padding: 10px 16px;
    cursor: pointer;
}

.menu-button {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.82);
    cursor: pointer;
}

.menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: var(--text);
    border-radius: 999px;
}

.mobile-nav {
    display: none;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.95);
}

.mobile-nav.open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.mobile-nav a {
    padding: 10px 12px;
}

.hero {
    position: relative;
    min-height: 85vh;
    overflow: hidden;
    background: #020617;
}

.hero-track,
.hero-slide,
.hero-backdrop {
    position: absolute;
    inset: 0;
}

.hero-slide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease;
}

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.hero-backdrop {
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.3)),
        linear-gradient(0deg, rgba(2, 6, 23, 1), rgba(2, 6, 23, 0.1) 45%, rgba(2, 6, 23, 0.84)),
        var(--hero-image) center / cover no-repeat;
    transform: scale(1.05);
    filter: saturate(1.05);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1280px, calc(100% - 32px));
    height: 100%;
    min-height: 85vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.65fr);
    align-items: center;
    gap: 48px;
    padding: 96px 0 170px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--emerald);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-copy h1 {
    margin: 14px 0 18px;
    font-size: clamp(42px, 7vw, 82px);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

.hero-desc,
.page-hero p,
.detail-line {
    color: var(--muted-strong);
    font-size: clamp(16px, 2vw, 21px);
    max-width: 760px;
}

.hero-tags,
.detail-meta,
.tag-row,
.footer-links,
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.hero-tags,
.detail-meta,
.tag-row {
    margin-top: 22px;
}

.hero-tags span,
.detail-meta span,
.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    color: var(--muted-strong);
    background: rgba(15, 23, 42, 0.62);
    font-size: 13px;
}

.hero-actions {
    margin-top: 32px;
}

.primary-button,
.ghost-button,
.section-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.primary-button {
    color: #04111f;
    background: linear-gradient(135deg, var(--emerald), #34d399);
    box-shadow: 0 18px 45px rgba(16, 185, 129, 0.32);
}

.ghost-button,
.section-link {
    color: var(--text);
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.66);
}

.primary-button:hover,
.ghost-button:hover,
.section-link:hover {
    transform: translateY(-2px);
}

.ghost-button:hover,
.section-link:hover {
    border-color: rgba(16, 185, 129, 0.55);
    background: rgba(16, 185, 129, 0.16);
}

.hero-poster {
    position: relative;
    justify-self: end;
    width: min(340px, 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transform: rotate(1.5deg);
}

.hero-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.hero-poster span {
    position: absolute;
    left: 18px;
    bottom: 18px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.9);
    color: #04111f;
    font-weight: 800;
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.72);
    font-size: 32px;
    cursor: pointer;
}

.hero-prev {
    left: 24px;
}

.hero-next {
    right: 24px;
}

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 118px;
    z-index: 5;
    display: flex;
    gap: 10px;
    transform: translateX(-50%);
}

.hero-dot {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
    cursor: pointer;
}

.hero-dot.active {
    width: 38px;
    background: var(--emerald);
}

.hero-strip {
    position: absolute;
    left: 50%;
    bottom: 24px;
    z-index: 4;
    width: min(960px, calc(100% - 32px));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    transform: translateX(-50%);
}

.hero-mini-card {
    display: grid;
    grid-template-columns: 50px 1fr;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.76);
    backdrop-filter: blur(12px);
}

.hero-mini-card img {
    width: 50px;
    height: 62px;
    border-radius: 12px;
    object-fit: cover;
}

.hero-mini-card span {
    min-width: 0;
    overflow: hidden;
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-band,
.content-section,
.watch-section,
.page-hero,
.detail-inner {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.search-band {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(300px, 1fr);
    gap: 24px;
    align-items: center;
    margin-top: 34px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(15, 23, 42, 0.86));
    box-shadow: var(--shadow);
}

.search-band h2,
.section-heading h2,
.page-hero h1,
.detail-copy h1,
.detail-article h2 {
    color: var(--text);
}

.search-band h2,
.section-heading h2,
.detail-article h2 {
    margin: 8px 0;
    font-size: clamp(26px, 4vw, 42px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.wide-search {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    background: rgba(2, 6, 23, 0.68);
}

.wide-search input {
    padding: 14px 18px;
}

.wide-search button {
    min-height: 52px;
    padding: 0 24px;
}

.content-section,
.watch-section {
    padding: 72px 0 0;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.section-heading p,
.category-card p,
.card-desc,
.detail-article p,
.site-footer p,
#searchStatus {
    color: var(--muted);
}

.movie-grid,
.category-grid,
.ranking-grid {
    display: grid;
    gap: 20px;
}

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

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

.category-movie-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

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

.movie-card,
.category-card,
.detail-article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.movie-card {
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover,
.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 20px 60px rgba(16, 185, 129, 0.12);
}

.poster-wrap {
    position: relative;
    display: block;
    overflow: hidden;
    background: rgba(30, 41, 59, 0.88);
}

.poster-wrap img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.movie-card:hover .poster-wrap img {
    transform: scale(1.06);
}

.score,
.rank-badge {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 30px;
    border-radius: 999px;
    font-weight: 900;
}

.score {
    right: 10px;
    bottom: 10px;
    color: #04111f;
    background: var(--amber);
}

.rank-badge {
    top: 10px;
    left: 10px;
    color: #04111f;
    background: var(--emerald);
}

.card-body {
    padding: 16px;
}

.card-body h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
}

.card-body h3 a:hover {
    color: var(--emerald);
}

.card-meta {
    margin: 8px 0 0;
    color: var(--muted-strong);
    font-size: 13px;
}

.card-desc {
    display: -webkit-box;
    min-height: 44px;
    margin: 10px 0 0;
    overflow: hidden;
    font-size: 14px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tag-row span {
    font-size: 12px;
}

.compact-card {
    display: grid;
    grid-template-columns: 112px 1fr;
}

.compact-card .poster-wrap img {
    height: 100%;
    min-height: 168px;
}

.category-card {
    display: grid;
    gap: 18px;
    padding: 18px;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.category-stack {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.category-stack img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 14px;
}

.category-card h3 {
    margin: 10px 0 8px;
    font-size: 22px;
}

.page-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
    gap: 32px;
    align-items: end;
    padding: 82px 0 16px;
}

.compact-hero {
    min-height: 320px;
}

.compact-search {
    align-self: center;
}

.filter-heading {
    align-items: center;
}

.local-filter {
    max-width: 320px;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
}

.detail-hero {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    background: var(--detail-image) center / cover no-repeat;
}

.detail-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.97), rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.45)),
        linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.2) 55%, rgba(2, 6, 23, 0.86) 100%);
    backdrop-filter: blur(3px);
}

.detail-inner {
    position: relative;
    z-index: 2;
    padding: 34px 0 72px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 36px;
    color: var(--muted-strong);
    font-size: 14px;
}

.breadcrumb a:hover {
    color: var(--emerald);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
    gap: 42px;
    align-items: end;
}

.detail-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.detail-copy h1 {
    font-size: clamp(38px, 6vw, 72px);
}

.large-tags span {
    min-height: 32px;
    padding: 6px 12px;
}

.player-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: #000;
    box-shadow: var(--shadow);
}

.movie-video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.play-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    border: 0;
    color: var(--text);
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2), rgba(2, 6, 23, 0.72));
    cursor: pointer;
}

.player-frame.is-playing .play-overlay {
    opacity: 0;
    pointer-events: none;
}

.play-circle {
    width: 76px;
    height: 76px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #04111f;
    background: var(--emerald);
    font-size: 30px;
    box-shadow: 0 16px 48px rgba(16, 185, 129, 0.38);
}

.detail-text-section {
    padding-top: 50px;
}

.detail-article {
    padding: 28px;
}

.detail-article h2 {
    font-size: 28px;
}

.detail-article p {
    font-size: 17px;
}

.site-footer {
    margin-top: 86px;
    border-top: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.75);
}

.footer-inner {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0;
    display: grid;
    gap: 16px;
}

.footer-links a {
    padding: 8px 12px;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 1180px) {
    .desktop-nav {
        display: none;
    }

    .menu-button {
        display: block;
    }

    .header-search {
        flex: 1;
        width: auto;
    }

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

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

@media (max-width: 860px) {
    .hero-content,
    .search-band,
    .page-hero,
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .hero-content {
        padding-top: 92px;
        padding-bottom: 188px;
    }

    .hero-poster {
        display: none;
    }

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

    .hero-mini-card:nth-child(n + 5) {
        display: none;
    }

    .hero-dots {
        bottom: 138px;
    }

    .movie-grid,
    .small-grid,
    .category-movie-grid,
    .ranking-grid,
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section-heading,
    .filter-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .local-filter {
        max-width: 100%;
    }

    .detail-hero {
        min-height: auto;
    }

    .detail-poster {
        max-width: 260px;
    }
}

@media (max-width: 560px) {
    .header-inner {
        gap: 10px;
        min-height: 64px;
    }

    .logo span:last-child {
        display: none;
    }

    .header-search {
        display: none;
    }

    .hero-copy h1,
    .page-hero h1,
    .detail-copy h1 {
        font-size: 38px;
    }

    .hero-arrow {
        display: none;
    }

    .hero-strip {
        display: none;
    }

    .hero-dots {
        bottom: 34px;
    }

    .hero-content {
        padding-bottom: 90px;
    }

    .wide-search {
        align-items: stretch;
        flex-direction: column;
        border-radius: 22px;
    }

    .wide-search button {
        width: 100%;
    }

    .movie-grid,
    .small-grid,
    .category-movie-grid,
    .ranking-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .compact-card {
        grid-template-columns: 100px 1fr;
    }
}
