:root {
    --color-primary: 30 30 35;
    --color-secondary: 45 45 50;
    --color-accent: 70 130 180;
    --color-success: 46 125 50;
    --color-warning: 255 152 0;
    --color-error: 211 47 47;
    --color-text-primary: 240 240 245;
    --color-text-secondary: 180 180 190;
    --color-text-muted: 120 120 130;
    --color-bg-primary: 18 18 22;
    --color-bg-secondary: 25 25 30;
    --color-bg-tertiary: 35 35 40;
    --color-border: 50 50 60;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: rgb(var(--color-bg-primary));
    color: rgb(var(--color-text-primary));
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

img,
video {
    max-width: 100%;
}

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    background: rgba(18, 18, 22, 0.82);
    border-bottom: 1px solid rgba(var(--color-border), 0.9);
    backdrop-filter: blur(18px);
}

.nav-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-logo,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgb(var(--color-accent)), #8ec5ff);
    color: #fff;
    box-shadow: 0 12px 35px rgba(70, 130, 180, 0.35);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link,
.mobile-link {
    padding: 10px 14px;
    border-radius: 999px;
    color: rgb(var(--color-text-secondary));
    transition: color 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
    color: #fff;
    background: rgba(var(--color-accent), 0.16);
}

.nav-link:hover {
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(var(--color-border), 0.9);
    border-radius: 12px;
    background: rgb(var(--color-bg-secondary));
    color: #fff;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: currentColor;
    border-radius: 999px;
}

.mobile-panel {
    display: none;
    padding: 8px 24px 20px;
    border-top: 1px solid rgba(var(--color-border), 0.7);
}

.mobile-panel.open {
    display: grid;
    gap: 8px;
}

.home-hero {
    position: relative;
    max-width: 1280px;
    height: min(72vh, 680px);
    min-height: 460px;
    margin: 26px auto 0;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(var(--color-border), 0.85);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

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

.hero-slide img,
.detail-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-shade,
.detail-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 20%, rgba(70, 130, 180, 0.35), transparent 35%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.42) 52%, rgba(0, 0, 0, 0.18)),
        linear-gradient(0deg, rgba(0, 0, 0, 0.86), transparent 60%);
}

.hero-content {
    position: absolute;
    left: clamp(24px, 6vw, 76px);
    bottom: clamp(34px, 8vw, 84px);
    width: min(680px, calc(100% - 48px));
}

.eyebrow {
    margin: 0 0 12px;
    color: rgb(var(--color-accent));
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 13px;
}

.hero-content h1,
.page-hero h1,
.detail-copy h1 {
    margin: 0;
    font-size: clamp(34px, 6vw, 68px);
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: #fff;
    text-shadow: 0 14px 36px rgba(0, 0, 0, 0.56);
}

.hero-summary,
.page-hero p,
.detail-line {
    margin: 18px 0 0;
    max-width: 760px;
    color: rgba(245, 247, 250, 0.84);
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.75;
}

.hero-tags,
.detail-meta,
.tag-row,
.filter-strip,
.category-cloud,
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.hero-tags {
    margin: 22px 0 0;
}

.hero-tags span,
.tag-row span,
.detail-meta span,
.category-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
}

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

.btn-primary,
.btn-secondary,
.home-search button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 800;
    transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.btn-primary,
.home-search button {
    border: 0;
    color: #fff;
    background: linear-gradient(135deg, rgb(var(--color-accent)), #8ec5ff);
    box-shadow: 0 16px 40px rgba(70, 130, 180, 0.35);
}

.btn-secondary {
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
}

.btn-primary:hover,
.btn-secondary:hover,
.home-search button:hover {
    transform: translateY(-2px);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 34px;
    line-height: 1;
}

.hero-arrow.prev {
    left: 18px;
}

.hero-arrow.next {
    right: 18px;
}

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.42);
}

.hero-dot.active {
    width: 28px;
    background: #fff;
}

.section-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 54px 24px;
}

.tinted {
    max-width: none;
    background: rgba(var(--color-bg-secondary), 0.46);
}

.tinted > * {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

.intro-search,
.section-heading,
.ranking-split,
.footer-grid,
.detail-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: center;
}

.intro-copy h2,
.section-title,
.ranking-copy h2,
.content-panel h2,
.side-panel h2,
.category-info h2 {
    margin: 0;
    font-size: clamp(26px, 3.3vw, 42px);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.intro-copy p:not(.eyebrow),
.ranking-copy p,
.category-info p,
.content-panel p,
.side-panel,
.footer-grid p,
.movie-line,
.movie-meta {
    color: rgb(var(--color-text-secondary));
}

.home-search,
.search-panel {
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-search input,
.search-panel input {
    width: min(440px, 70vw);
    min-height: 48px;
    border: 1px solid rgba(var(--color-border), 0.95);
    border-radius: 999px;
    background: rgb(var(--color-bg-secondary));
    color: #fff;
    padding: 0 18px;
    outline: 0;
}

.home-search input:focus,
.search-panel input:focus {
    border-color: rgba(var(--color-accent), 0.85);
    box-shadow: 0 0 0 4px rgba(var(--color-accent), 0.16);
}

.search-panel {
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 18px;
    border-radius: 20px;
    background: rgb(var(--color-bg-secondary));
    border: 1px solid rgba(var(--color-border), 0.8);
}

.search-label {
    font-weight: 800;
}

.section-more {
    color: rgb(var(--color-accent));
    font-weight: 800;
}

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

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

.movie-card {
    min-width: 0;
    border: 1px solid rgba(var(--color-border), 0.85);
    border-radius: 20px;
    overflow: hidden;
    background: rgb(var(--color-bg-secondary));
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
    transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    border-color: rgba(var(--color-accent), 0.74);
    background: rgb(var(--color-bg-tertiary));
}

.poster-link {
    display: block;
    height: 100%;
}

.poster-wrap {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: rgb(var(--color-bg-tertiary));
}

.poster-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

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

.poster-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.66), transparent 48%);
}

.poster-badge,
.poster-play {
    position: absolute;
    z-index: 2;
}

.poster-badge {
    top: 10px;
    left: 10px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.64);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.poster-play {
    right: 12px;
    bottom: 12px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(var(--color-accent), 0.92);
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}

.card-content {
    padding: 15px;
}

.movie-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.compact h3 {
    font-size: 15px;
}

.movie-meta,
.movie-line {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
}

.movie-line {
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tag-row {
    margin-top: 12px;
    gap: 6px;
}

.tag-row span {
    min-height: 26px;
    padding: 4px 8px;
    font-size: 12px;
    color: rgb(var(--color-text-secondary));
    background: rgba(255, 255, 255, 0.05);
}

.category-cloud,
.filter-strip {
    gap: 12px;
}

.category-chip {
    min-height: 42px;
    padding: 9px 16px;
    background: rgb(var(--color-bg-tertiary));
}

.category-chip:hover {
    border-color: rgba(var(--color-accent), 0.72);
    color: #fff;
}

.rank-list,
.rank-page-list {
    display: grid;
    gap: 12px;
}

.rank-row {
    display: grid;
    grid-template-columns: 44px 54px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 16px;
    background: rgb(var(--color-bg-secondary));
    border: 1px solid rgba(var(--color-border), 0.86);
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.rank-row:hover {
    transform: translateX(4px);
    border-color: rgba(var(--color-accent), 0.72);
}

.rank-number {
    font-size: 24px;
    font-weight: 900;
    color: rgb(var(--color-accent));
    text-align: center;
}

.rank-row img {
    width: 54px;
    height: 76px;
    object-fit: cover;
    border-radius: 10px;
}

.rank-title {
    min-width: 0;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-meta {
    color: rgb(var(--color-text-secondary));
    font-size: 13px;
}

.rank-score {
    padding: 6px 10px;
    border-radius: 999px;
    color: #fff;
    background: rgba(var(--color-accent), 0.28);
    font-weight: 800;
}

.page-hero,
.detail-hero {
    position: relative;
    overflow: hidden;
    min-height: 360px;
    display: grid;
    place-items: center;
    padding: 72px 24px;
    background:
        radial-gradient(circle at 70% 15%, rgba(70, 130, 180, 0.28), transparent 30%),
        linear-gradient(135deg, rgb(var(--color-bg-secondary)), rgb(var(--color-bg-primary)));
    border-bottom: 1px solid rgba(var(--color-border), 0.8);
}

.page-hero > div {
    width: min(1050px, 100%);
}

.small-hero h1,
.category-hero h1 {
    font-size: clamp(34px, 5vw, 58px);
}

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

.category-card {
    border-radius: 22px;
    overflow: hidden;
    background: rgb(var(--color-bg-secondary));
    border: 1px solid rgba(var(--color-border), 0.85);
    transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: rgba(var(--color-accent), 0.72);
}

.category-covers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 160px;
    overflow: hidden;
}

.category-covers img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-info {
    padding: 20px;
}

.category-info h2 {
    font-size: 24px;
}

.category-info p {
    min-height: 68px;
    margin: 10px 0 18px;
    line-height: 1.65;
}

.category-info span {
    color: rgb(var(--color-accent));
    font-weight: 800;
}

.detail-hero {
    min-height: 580px;
    padding: 92px 24px;
    place-items: end center;
}

.detail-bg,
.detail-overlay {
    position: absolute;
    inset: 0;
}

.detail-bg {
    filter: blur(8px) saturate(1.05);
    transform: scale(1.04);
    opacity: 0.62;
}

.detail-shell {
    position: relative;
    z-index: 2;
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 38px;
    align-items: end;
}

.detail-poster {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

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

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: rgb(var(--color-text-secondary));
}

.breadcrumb a:hover,
.side-panel a:hover {
    color: rgb(var(--color-accent));
}

.detail-meta {
    margin-top: 20px;
}

.large-tags span {
    min-height: 30px;
}

.player-section {
    padding-top: 36px;
}

.player-frame {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    border: 1px solid rgba(var(--color-border), 0.9);
    background: #050507;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    aspect-ratio: 16 / 9;
}

.movie-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 14px;
    border: 0;
    color: #fff;
    background: rgba(0, 0, 0, 0.42);
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-cover.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.play-icon {
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    margin: 0 auto;
    border-radius: 999px;
    background: linear-gradient(135deg, rgb(var(--color-accent)), #8ec5ff);
    font-size: 34px;
    box-shadow: 0 20px 42px rgba(70, 130, 180, 0.35);
}

.detail-main {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
}

.content-panel,
.side-panel {
    padding: 28px;
    border-radius: 24px;
    background: rgb(var(--color-bg-secondary));
    border: 1px solid rgba(var(--color-border), 0.86);
}

.content-panel h2 + p {
    margin-top: 14px;
}

.content-panel p + h2 {
    margin-top: 30px;
}

.content-panel p {
    font-size: 17px;
    line-height: 1.9;
}

.side-panel dl {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    margin: 18px 0 0;
}

.side-panel dt {
    color: rgb(var(--color-text-muted));
}

.side-panel dd {
    margin: 0;
    color: rgb(var(--color-text-primary));
}

.empty-state {
    margin: 24px 0 0;
    padding: 22px;
    border-radius: 18px;
    color: rgb(var(--color-text-secondary));
    background: rgb(var(--color-bg-secondary));
    border: 1px solid rgba(var(--color-border), 0.86);
}

.site-footer {
    border-top: 1px solid rgba(var(--color-border), 0.9);
    background: #0f0f13;
    margin-top: 28px;
}

.footer-grid {
    max-width: 1280px;
    margin: 0 auto;
    padding: 46px 24px;
    grid-template-columns: 1.5fr 1fr 1fr;
    align-items: start;
}

.footer-grid h2 {
    margin: 0 0 14px;
    font-size: 17px;
}

.footer-links {
    display: grid;
    gap: 10px;
    color: rgb(var(--color-text-secondary));
}

.footer-links a:hover {
    color: rgb(var(--color-accent));
}

.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 24px 28px;
    color: rgb(var(--color-text-muted));
    border-top: 1px solid rgba(var(--color-border), 0.55);
}

[hidden] {
    display: none !important;
}

@media (max-width: 1180px) {
    .movie-grid,
    .compact-grid,
    .category-movie-grid,
    .search-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

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

    .menu-toggle {
        display: block;
    }

    .home-hero {
        width: calc(100% - 28px);
        min-height: 560px;
        border-radius: 22px;
    }

    .hero-arrow {
        display: none;
    }

    .intro-search,
    .section-heading,
    .ranking-split,
    .footer-grid,
    .detail-main,
    .detail-shell {
        grid-template-columns: 1fr;
    }

    .home-search,
    .search-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .home-search input,
    .search-panel input {
        width: 100%;
    }

    .movie-grid,
    .compact-grid,
    .category-movie-grid,
    .search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

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

    .rank-row {
        grid-template-columns: 36px 48px minmax(0, 1fr) auto;
    }

    .rank-meta {
        display: none;
    }

    .detail-shell {
        align-items: center;
    }

    .detail-poster {
        width: min(220px, 72vw);
    }

    .footer-grid {
        gap: 26px;
    }
}

@media (max-width: 520px) {
    .nav-shell,
    .section-container,
    .page-hero,
    .detail-hero {
        padding-left: 16px;
        padding-right: 16px;
    }

    .home-hero {
        min-height: 520px;
    }

    .hero-content {
        left: 18px;
        bottom: 46px;
        width: calc(100% - 36px);
    }

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

    .movie-grid,
    .compact-grid,
    .category-movie-grid,
    .search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .card-content {
        padding: 12px;
    }

    .movie-line,
    .tag-row {
        display: none;
    }

    .player-frame {
        border-radius: 16px;
    }

    .play-icon {
        width: 64px;
        height: 64px;
        font-size: 26px;
    }
}
