:root {
    color-scheme: dark;
    --page: #020617;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-strong: rgba(15, 23, 42, 0.96);
    --line: rgba(59, 130, 246, 0.24);
    --line-strong: rgba(34, 211, 238, 0.32);
    --text: #f8fafc;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --cyan: #22d3ee;
    --cyan-strong: #06b6d4;
    --blue: #3b82f6;
    --gold: #facc15;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 0%, rgba(34, 211, 238, 0.14), transparent 32rem),
        radial-gradient(circle at 80% 12%, rgba(59, 130, 246, 0.12), transparent 34rem),
        linear-gradient(180deg, #020617 0%, #0f172a 42%, #000000 100%);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

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

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

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.04em;
    background: linear-gradient(90deg, #22d3ee, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #020617;
    background: linear-gradient(135deg, #22d3ee, #3b82f6);
    box-shadow: 0 0 32px rgba(34, 211, 238, 0.42);
    font-size: 14px;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
}

.desktop-nav a,
.mobile-panel a,
.site-footer nav a {
    color: var(--soft);
    font-weight: 700;
    transition: color 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-panel a:hover,
.mobile-panel a.active,
.site-footer nav a:hover {
    color: var(--cyan);
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(310px, 26vw);
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
}

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

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

.header-search button,
.mobile-panel button,
.btn,
.search-button,
.player-start {
    border: 0;
    cursor: pointer;
    color: white;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cyan-strong), var(--blue));
    box-shadow: 0 12px 34px rgba(6, 182, 212, 0.28);
    font-weight: 900;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.header-search button {
    padding: 8px 14px;
}

.btn,
.search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
}

.btn.secondary {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--line-strong);
    box-shadow: none;
}

.header-search button:hover,
.mobile-panel button:hover,
.btn:hover,
.search-button:hover,
.player-start:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.08);
}

.mobile-toggle {
    display: none;
    margin-left: auto;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 26px;
    cursor: pointer;
}

.mobile-panel {
    display: none;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 16px 0 22px;
    border-top: 1px solid var(--line);
}

.mobile-panel.is-open {
    display: block;
}

.mobile-panel nav {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.mobile-panel form {
    display: flex;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.82);
}

.mobile-panel input {
    padding: 10px;
}

.mobile-panel button {
    padding: 10px 16px;
}

main {
    min-height: 60vh;
}

.hero {
    position: relative;
    height: 70vh;
    min-height: 540px;
    overflow: hidden;
    isolation: isolate;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1000ms ease;
}

.hero-slide.is-active {
    opacity: 1;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.04);
}

.hero-slide.is-active img {
    animation: slowZoom 6800ms ease both;
}

.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.55) 46%, rgba(2, 6, 23, 0.12)),
        linear-gradient(90deg, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.08));
}

.hero-content {
    position: absolute;
    z-index: 3;
    left: 50%;
    bottom: 0;
    width: min(1280px, calc(100% - 32px));
    transform: translateX(-50%);
    padding: 0 0 70px;
}

.hero-kicker,
.section-kicker,
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--cyan);
    background: rgba(8, 47, 73, 0.42);
    font-weight: 900;
}

.hero-title {
    max-width: 820px;
    margin: 0 0 16px;
    font-size: clamp(42px, 7vw, 88px);
    line-height: 0.95;
    font-weight: 950;
    letter-spacing: -0.07em;
    text-shadow: 0 18px 55px rgba(0, 0, 0, 0.72);
}

.hero-desc {
    max-width: 760px;
    margin: 0 0 28px;
    color: #e2e8f0;
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.75;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

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

.hero-dots {
    position: absolute;
    z-index: 5;
    right: max(24px, calc((100% - 1280px) / 2));
    bottom: 36px;
    display: flex;
    gap: 10px;
}

.hero-dots button {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.48);
    transition: width 0.24s ease, background 0.24s ease;
}

.hero-dots button.is-active {
    width: 40px;
    background: var(--cyan);
}

.hero-strip {
    position: absolute;
    z-index: 4;
    right: max(24px, calc((100% - 1280px) / 2));
    top: 50%;
    width: 330px;
    transform: translateY(-50%);
    display: grid;
    gap: 14px;
}

.hero-mini {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(10px);
}

.hero-mini img {
    width: 64px;
    height: 86px;
    border-radius: 14px;
    object-fit: cover;
}

.hero-mini strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.hero-mini span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

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

.section {
    padding: 58px 0;
}

.section.alt {
    width: min(1280px, calc(100% - 32px));
    margin: 42px auto;
    padding: 38px;
    border: 1px solid var(--line);
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.22), rgba(88, 28, 135, 0.2));
    box-shadow: var(--shadow);
}

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

.section-head h1,
.section-head h2,
.page-title h1,
.detail-title h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -0.05em;
}

.section-head p,
.page-title p,
.detail-title p {
    max-width: 760px;
    color: var(--muted);
    line-height: 1.8;
}

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

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

.movie-card {
    min-width: 0;
}

.movie-card-link {
    display: block;
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.62);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.24);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card-link:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: var(--line-strong);
    box-shadow: 0 26px 80px rgba(6, 182, 212, 0.18);
}

.poster-wrap {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(8, 47, 73, 0.84), rgba(15, 23, 42, 0.9));
}

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

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

.poster-shade {
    position: absolute;
    inset: auto 0 0;
    height: 42%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), transparent);
}

.type-badge,
.rank-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    padding: 5px 9px;
    border-radius: 999px;
    color: #04111d;
    background: var(--gold);
    font-size: 12px;
    font-weight: 950;
}

.card-body {
    display: grid;
    gap: 9px;
    padding: 15px;
}

.card-body strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 17px;
}

.card-line {
    min-height: 44px;
    color: var(--soft);
    font-size: 14px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mini-tags span,
.tag-cloud span {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    color: #a5f3fc;
    background: rgba(8, 145, 178, 0.16);
    border: 1px solid rgba(34, 211, 238, 0.18);
    font-size: 12px;
    font-weight: 700;
}

.compact .card-line {
    min-height: 0;
    -webkit-line-clamp: 1;
}

.horizontal-scroll {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 1fr);
    gap: 16px;
    overflow-x: auto;
    padding: 2px 2px 18px;
    scroll-snap-type: x mandatory;
}

.horizontal-scroll .movie-card {
    scroll-snap-align: start;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) 380px;
    gap: 28px;
    align-items: start;
}

.rank-panel,
.glass-panel,
.search-panel,
.detail-panel {
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.rank-panel {
    padding: 22px;
    position: sticky;
    top: 92px;
}

.rank-panel h2,
.glass-panel h2,
.detail-panel h2 {
    margin: 0 0 18px;
    font-size: 26px;
    font-weight: 950;
}

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

.rank-row {
    position: relative;
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 12px;
    align-items: center;
    padding: 9px;
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.42);
    transition: transform 0.2s ease, background 0.2s ease;
}

.rank-row.numbered {
    grid-template-columns: 38px 58px 1fr;
}

.rank-row .rank-badge {
    position: static;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
}

.rank-row:hover {
    transform: translateX(4px);
    background: rgba(8, 47, 73, 0.52);
}

.rank-poster {
    width: 58px;
    height: 76px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.9);
}

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

.rank-info strong,
.rank-info em {
    display: block;
}

.rank-info strong {
    margin-bottom: 6px;
}

.rank-info em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.page-title {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 56px 0 20px;
}

.category-cloud,
.pagination,
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

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

.category-tile {
    display: grid;
    gap: 10px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(8, 47, 73, 0.62));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover {
    transform: translateY(-5px);
    border-color: var(--line-strong);
}

.category-tile strong {
    font-size: 22px;
    font-weight: 950;
}

.category-tile span,
.category-tile em {
    color: var(--muted);
    font-style: normal;
}

.pagination {
    align-items: center;
    justify-content: center;
    margin: 36px auto 0;
}

.pagination a,
.pagination span {
    min-width: 42px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    text-align: center;
    background: rgba(15, 23, 42, 0.7);
    color: var(--soft);
    font-weight: 800;
}

.pagination a:hover,
.pagination .current {
    color: #04111d;
    background: var(--cyan);
    border-color: var(--cyan);
}

.detail-hero {
    padding: 54px 0 30px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 34px;
    align-items: center;
}

.detail-cover {
    overflow: hidden;
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.9);
    box-shadow: var(--shadow);
}

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

.detail-title h1 {
    margin-bottom: 18px;
}

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

.detail-meta span {
    padding: 8px 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    color: var(--soft);
    background: rgba(15, 23, 42, 0.62);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.player-section {
    padding: 22px 0 48px;
}

.player-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 30px;
    background: #000;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
}

.movie-player {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

.player-cover {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    background: #000;
}

.player-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.72;
}

.player-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.2), rgba(2, 6, 23, 0.75));
}

.player-start {
    position: relative;
    z-index: 3;
    width: 88px;
    height: 88px;
    display: inline-grid;
    place-items: center;
    font-size: 30px;
}

.player-shell.is-playing .player-cover {
    display: none;
}

.detail-panel {
    padding: 28px;
    margin-bottom: 28px;
}

.detail-panel p {
    color: var(--soft);
    font-size: 17px;
    line-height: 1.92;
}

.search-panel {
    padding: 24px;
    margin-bottom: 28px;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr 170px 170px auto;
    gap: 14px;
}

.search-input,
.filter-select {
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.62);
}

.search-status {
    margin: 16px 0 0;
    color: var(--muted);
}

.site-footer {
    margin-top: 64px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.75), rgba(0, 0, 0, 0.94));
}

.footer-inner {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.site-footer p {
    color: var(--muted);
}

.image-missing img {
    display: none;
}

.image-missing::before,
.poster-wrap.image-missing::before,
.rank-poster.image-missing::before {
    content: attr(data-title);
    display: grid;
    place-items: center;
    height: 100%;
    padding: 18px;
    color: var(--soft);
    text-align: center;
    background: linear-gradient(135deg, rgba(8, 47, 73, 0.84), rgba(15, 23, 42, 0.92));
}

@keyframes slowZoom {
    from {
        transform: scale(1.02);
    }
    to {
        transform: scale(1.1);
    }
}

@media (max-width: 1120px) {
    .header-search,
    .hero-strip {
        display: none;
    }

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

    .split-layout {
        grid-template-columns: 1fr;
    }

    .rank-panel {
        position: static;
    }
}

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

    .mobile-toggle {
        display: inline-flex;
    }

    .header-inner {
        height: 64px;
    }

    .brand,
    .footer-brand {
        font-size: 21px;
    }

    .hero {
        min-height: 560px;
        height: 78vh;
    }

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

    .hero-dots {
        left: 16px;
        right: auto;
        bottom: 28px;
    }

    .section,
    .section.alt {
        padding-top: 36px;
        padding-bottom: 36px;
    }

    .section.alt {
        padding-left: 18px;
        padding-right: 18px;
        border-radius: 24px;
    }

    .section-head {
        align-items: start;
        flex-direction: column;
    }

    .grid,
    .grid.dense,
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .card-body {
        padding: 12px;
    }

    .card-line {
        display: none;
    }

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

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

    .search-form {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .wrap,
    .page-title,
    .header-inner,
    .footer-inner,
    .mobile-panel {
        width: min(100% - 22px, 1280px);
    }

    .grid,
    .grid.dense,
    .category-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .type-badge {
        top: 8px;
        right: 8px;
        font-size: 11px;
    }

    .card-body strong {
        font-size: 15px;
    }

    .card-meta,
    .mini-tags {
        display: none;
    }

    .player-shell {
        border-radius: 18px;
    }
}
