:root {
    color-scheme: dark;
    --bg: #050509;
    --bg-soft: #111119;
    --panel: rgba(31, 41, 55, 0.72);
    --panel-strong: rgba(17, 24, 39, 0.92);
    --line: rgba(248, 113, 113, 0.22);
    --text: #f8fafc;
    --muted: #cbd5e1;
    --subtle: #94a3b8;
    --red: #dc2626;
    --red-dark: #7f1d1d;
    --gold: #facc15;
    --blue: #2563eb;
    --radius: 20px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(127, 29, 29, 0.42), transparent 34rem),
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.2), transparent 30rem),
        linear-gradient(180deg, #030306 0%, #111827 48%, #030306 100%);
    color: var(--text);
    line-height: 1.6;
}

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

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(90deg, rgba(127, 29, 29, 0.98), rgba(185, 28, 28, 0.98), rgba(127, 29, 29, 0.98));
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(16px);
}

.header-inner {
    width: min(1240px, calc(100% - 32px));
    min-height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #facc15, #ef4444 55%, #7f1d1d);
    color: white;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.brand-copy {
    display: grid;
    line-height: 1.16;
}

.brand-copy strong {
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, #fef08a, #ffffff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-copy small {
    color: #fecaca;
    font-size: 0.76rem;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 22px;
}

.site-nav a {
    position: relative;
    color: #fee2e2;
    font-size: 0.95rem;
    font-weight: 700;
    transition: color 180ms ease;
}

.site-nav a:hover,
.site-nav a.active {
    color: #fef08a;
}

.site-nav a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 3px;
    border-radius: 999px;
    background: var(--gold);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    color: white;
    background: rgba(127, 29, 29, 0.75);
}

.page-wrap {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
}

.hero-carousel {
    position: relative;
    margin: 28px auto 0;
    min-height: 620px;
    overflow: hidden;
    border-radius: 30px;
    background: #111827;
    box-shadow: var(--shadow);
    border: 1px solid rgba(248, 113, 113, 0.22);
}

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

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

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.1) contrast(1.02);
    transform: scale(1.02);
}

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(3, 7, 18, 0.96) 0%, rgba(17, 24, 39, 0.82) 42%, rgba(127, 29, 29, 0.4) 100%),
        linear-gradient(0deg, rgba(3, 7, 18, 0.88), transparent 45%);
}

.hero-content {
    position: relative;
    min-height: 620px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 360px;
    align-items: center;
    gap: 46px;
    padding: 72px;
}

.hero-copy h1 {
    max-width: 780px;
    margin: 16px 0 18px;
    font-size: clamp(2.6rem, 7vw, 5.5rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.hero-copy p {
    max-width: 760px;
    color: #e5e7eb;
    font-size: 1.08rem;
}

.hero-pill,
.eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid rgba(250, 204, 21, 0.38);
    border-radius: 999px;
    background: rgba(127, 29, 29, 0.42);
    color: #fef08a;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.hero-tags {
    margin-top: 24px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

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

.primary-button {
    color: #450a0a;
    background: linear-gradient(135deg, #fde047, #f97316);
    box-shadow: 0 18px 40px rgba(249, 115, 22, 0.28);
}

.ghost-button {
    border: 1px solid rgba(248, 113, 113, 0.34);
    color: #fee2e2;
    background: rgba(31, 41, 55, 0.52);
}

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

.hero-poster {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border-radius: 26px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms ease;
}

.hero-poster span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 38, 38, 0.88);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
}

.hero-poster:hover img {
    transform: scale(1.06);
}

.hero-control {
    position: absolute;
    left: 72px;
    right: 72px;
    bottom: 38px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.hero-control button {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: white;
    background: rgba(17, 24, 39, 0.75);
}

.hero-dots {
    display: flex;
    gap: 10px;
}

.hero-dots button {
    width: 36px;
    height: 8px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
}

.hero-dots button.active {
    background: var(--gold);
}

.content-section,
.category-overview-card,
.page-hero,
.detail-hero,
.breadcrumb {
    margin-top: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(18px);
}

.content-section,
.category-overview-card,
.detail-hero,
.breadcrumb {
    padding: 28px;
}

.page-hero {
    padding: 58px;
    background:
        linear-gradient(135deg, rgba(127, 29, 29, 0.42), rgba(17, 24, 39, 0.82)),
        radial-gradient(circle at right, rgba(250, 204, 21, 0.12), transparent 26rem);
}

.page-hero h1 {
    margin: 18px 0 12px;
    font-size: clamp(2.2rem, 5vw, 4.6rem);
    line-height: 1.05;
}

.page-hero p {
    max-width: 860px;
    color: var(--muted);
    font-size: 1.05rem;
}

.panel-head h2,
.section-title h2,
.prose-section h2 {
    margin: 8px 0 0;
    font-size: clamp(1.55rem, 3vw, 2.4rem);
    line-height: 1.15;
}

.section-title,
.category-overview-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.section-title a {
    color: #fef08a;
    font-weight: 800;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 170px 190px;
    gap: 14px;
    margin-top: 22px;
}

.filter-panel label {
    display: grid;
    gap: 8px;
    color: #fecaca;
    font-weight: 800;
    font-size: 0.86rem;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(248, 113, 113, 0.28);
    border-radius: 16px;
    padding: 0 14px;
    color: white;
    background: rgba(3, 7, 18, 0.7);
    outline: none;
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: rgba(250, 204, 21, 0.72);
    box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.08);
}

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

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

.movie-card {
    overflow: hidden;
    border-radius: 20px;
    background: rgba(17, 24, 39, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.12);
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.movie-card:hover {
    transform: translateY(-4px);
    border-color: rgba(248, 113, 113, 0.5);
    box-shadow: 0 22px 46px rgba(127, 29, 29, 0.28);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #111827;
}

.compact-card .poster-link {
    aspect-ratio: 16 / 9;
}

.poster-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 450ms ease;
}

.movie-card:hover .poster-link img {
    transform: scale(1.08);
}

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

.card-badge,
.card-year {
    position: absolute;
    z-index: 2;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.76rem;
    font-weight: 800;
}

.card-badge {
    left: 12px;
    top: 12px;
    background: rgba(220, 38, 38, 0.92);
}

.card-year {
    right: 12px;
    bottom: 12px;
    background: rgba(3, 7, 18, 0.78);
}

.play-mark {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(220, 38, 38, 0.9);
    transition: opacity 220ms ease, transform 220ms ease;
}

.movie-card:hover .play-mark {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.card-body {
    padding: 16px;
}

.card-title {
    display: -webkit-box;
    overflow: hidden;
    min-height: 2.8em;
    color: white;
    font-weight: 850;
    font-size: 1.02rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    transition: color 180ms ease;
}

.card-title:hover {
    color: #f87171;
}

.card-desc {
    display: -webkit-box;
    overflow: hidden;
    min-height: 3.1em;
    margin: 9px 0 12px;
    color: var(--subtle);
    font-size: 0.92rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag-row span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    color: #fecaca;
    background: rgba(127, 29, 29, 0.42);
    font-size: 0.76rem;
    font-weight: 700;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    color: #94a3b8;
    font-size: 0.82rem;
}

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

.category-card {
    position: relative;
    min-height: 210px;
    overflow: hidden;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: end;
    border: 1px solid rgba(248, 113, 113, 0.18);
    background: #111827;
}

.category-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.34;
    transition: transform 400ms ease, opacity 220ms ease;
}

.category-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(3, 7, 18, 0.92), rgba(127, 29, 29, 0.25));
}

.category-card span,
.category-card p {
    position: relative;
    z-index: 1;
}

.category-card span {
    color: white;
    font-size: 1.22rem;
    font-weight: 900;
}

.category-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.category-card:hover img {
    opacity: 0.52;
    transform: scale(1.08);
}

.category-overview-card {
    background: rgba(17, 24, 39, 0.72);
}

.category-overview-head p {
    max-width: 720px;
    margin: 8px 0 0;
    color: var(--muted);
}

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

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

.rank-row {
    display: grid;
    grid-template-columns: 52px 86px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    background: rgba(3, 7, 18, 0.5);
    transition: transform 180ms ease, border-color 180ms ease;
}

.rank-row:hover {
    transform: translateX(4px);
    border-color: rgba(250, 204, 21, 0.42);
}

.rank-number {
    color: #fef08a;
    font-size: 1.4rem;
    font-weight: 950;
    text-align: center;
}

.rank-row img {
    width: 86px;
    height: 58px;
    border-radius: 12px;
    object-fit: cover;
}

.rank-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.rank-main strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rank-main small {
    overflow: hidden;
    color: var(--subtle);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rank-score {
    color: #fecaca;
    font-weight: 850;
    white-space: nowrap;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    color: #fecaca;
    font-size: 0.92rem;
}

.breadcrumb a {
    color: #fef08a;
}

.detail-hero {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 34px;
    align-items: center;
    background:
        linear-gradient(135deg, rgba(127, 29, 29, 0.48), rgba(17, 24, 39, 0.88)),
        radial-gradient(circle at right top, rgba(250, 204, 21, 0.12), transparent 28rem);
}

.detail-poster {
    overflow: hidden;
    border-radius: 26px;
    box-shadow: var(--shadow);
    aspect-ratio: 2 / 3;
}

.detail-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-copy h1 {
    margin: 18px 0;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: 1;
}

.lead-text {
    color: #e5e7eb;
    font-size: 1.1rem;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0;
}

.detail-meta span {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(3, 7, 18, 0.42);
    color: #cbd5e1;
}

.player-frame {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #000;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(248, 113, 113, 0.26);
    box-shadow: var(--shadow);
}

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

.player-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 0;
    color: white;
    background:
        linear-gradient(0deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.2)),
        rgba(0, 0, 0, 0.28);
}

.player-cover[hidden] {
    display: none;
}

.player-cover span {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.92);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
    font-size: 1.5rem;
}

.prose-section p {
    margin: 16px 0 0;
    color: #dbeafe;
    font-size: 1.02rem;
}

.empty-state {
    margin: 24px 0 0;
    padding: 22px;
    border-radius: 18px;
    color: #fecaca;
    background: rgba(127, 29, 29, 0.28);
    text-align: center;
}

.site-footer {
    width: min(1240px, calc(100% - 32px));
    margin: 42px auto 0;
    padding: 34px 0 24px;
    color: #94a3b8;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) 1fr 1fr;
    gap: 28px;
    padding: 28px;
    border-radius: 24px;
    background: rgba(3, 7, 18, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.footer-brand {
    color: white;
    font-size: 1.25rem;
    font-weight: 900;
}

.footer-grid h3 {
    margin: 0 0 12px;
    color: white;
}

.footer-links {
    display: grid;
    gap: 8px;
}

.footer-links a:hover {
    color: #f87171;
}

.footer-bottom {
    padding-top: 18px;
    text-align: center;
}

.back-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 30;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    color: white;
    background: #2563eb;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.34);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.back-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

[hidden] {
    display: none !important;
}

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

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

    .hero-content {
        grid-template-columns: 1fr 280px;
        padding: 56px;
    }
}

@media (max-width: 860px) {
    .nav-toggle {
        display: grid;
        place-items: center;
    }

    .site-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 74px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px;
        border-radius: 18px;
        background: rgba(69, 10, 10, 0.98);
        box-shadow: var(--shadow);
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a {
        padding: 12px 14px;
        border-radius: 12px;
    }

    .site-nav a.active::after {
        display: none;
    }

    .hero-carousel,
    .hero-content {
        min-height: 720px;
    }

    .hero-content {
        grid-template-columns: 1fr;
        align-items: end;
        padding: 34px 24px 96px;
    }

    .hero-poster {
        width: 210px;
        grid-row: 1;
    }

    .hero-control {
        left: 24px;
        right: 24px;
        bottom: 28px;
    }

    .filter-panel {
        grid-template-columns: 1fr;
    }

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

    .home-rank {
        grid-template-columns: 1fr;
    }

    .detail-hero {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 560px) {
    .page-wrap,
    .header-inner,
    .site-footer {
        width: min(100% - 20px, 1240px);
    }

    .brand-copy strong {
        font-size: 1rem;
    }

    .brand-copy small {
        display: none;
    }

    .hero-carousel,
    .hero-content {
        min-height: 640px;
    }

    .hero-copy h1 {
        font-size: 2.55rem;
    }

    .content-section,
    .category-overview-card,
    .detail-hero,
    .breadcrumb,
    .page-hero {
        padding: 20px;
    }

    .section-title,
    .category-overview-head {
        align-items: start;
        flex-direction: column;
    }

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

    .rank-row {
        grid-template-columns: 40px 74px minmax(0, 1fr);
    }

    .rank-score {
        grid-column: 3;
    }
}
