:root {
    color-scheme: dark;
    --bg: #0c0a09;
    --panel: #1c1917;
    --panel-soft: #292524;
    --panel-deep: #11100f;
    --line: rgba(245, 158, 11, 0.18);
    --text: #f5f5f4;
    --muted: #a8a29e;
    --muted-2: #78716c;
    --gold: #f59e0b;
    --gold-dark: #b45309;
    --gold-soft: rgba(245, 158, 11, 0.18);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    --radius: 18px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% -10%, rgba(245, 158, 11, 0.16), transparent 28rem),
        radial-gradient(circle at 100% 10%, rgba(217, 119, 6, 0.14), transparent 32rem),
        var(--bg);
    color: var(--text);
}

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

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

button,
input {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(12, 10, 9, 0.82);
    border-bottom: 1px solid rgba(120, 113, 108, 0.22);
    backdrop-filter: blur(18px);
}

.header-inner {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    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;
    color: #fde68a;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.logo-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 14px;
    color: #1c1917;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    box-shadow: 0 12px 36px rgba(245, 158, 11, 0.35);
}

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

.main-nav a {
    padding: 10px 16px;
    border-radius: 999px;
    color: #d6d3d1;
    transition: 0.25s ease;
}

.main-nav a:hover,
.main-nav a.is-active {
    color: #fff7ed;
    background: rgba(245, 158, 11, 0.16);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: rgba(41, 37, 36, 0.95);
    padding: 10px;
}

.nav-toggle span {
    display: block;
    height: 2px;
    margin: 6px 0;
    background: #fbbf24;
}

.hero-carousel {
    position: relative;
    min-height: 70vh;
    overflow: hidden;
    background: #000;
}

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

.hero-slide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 900ms ease;
}

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

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

.hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(12, 10, 9, 0.96) 0%, rgba(12, 10, 9, 0.72) 42%, rgba(12, 10, 9, 0.24) 100%),
        linear-gradient(0deg, #0c0a09 0%, rgba(12, 10, 9, 0.12) 48%);
}

.hero-content {
    position: absolute;
    left: max(24px, calc((100vw - 1280px) / 2));
    bottom: 12%;
    width: min(720px, calc(100% - 48px));
}

.hero-eyebrow,
.detail-meta,
.ranking-meta,
.card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
}

.hero-eyebrow span,
.detail-meta span,
.ranking-meta span {
    padding: 6px 11px;
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 999px;
    background: rgba(28, 25, 23, 0.68);
}

.hero-content h1,
.hero-movie-title {
    margin: 18px 0 12px;
    font-size: clamp(34px, 6vw, 72px);
    line-height: 0.95;
    color: #fff7ed;
    letter-spacing: -0.05em;
}

.hero-movie-title {
    margin-top: 10px;
    font-size: clamp(28px, 4vw, 56px);
}

.hero-content p {
    max-width: 680px;
    margin: 0 0 28px;
    color: #d6d3d1;
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.8;
}

.hero-actions,
.section-head,
.home-search-band,
.filter-panel,
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.btn,
.quick-search button,
.filter-chips button,
.hero-control {
    border: 0;
    cursor: pointer;
    transition: 0.25s ease;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: 800;
}

.btn.primary {
    color: #1c1917;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    box-shadow: 0 14px 34px rgba(245, 158, 11, 0.28);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(245, 158, 11, 0.36);
}

.btn.ghost {
    color: #fde68a;
    background: rgba(41, 37, 36, 0.7);
    border: 1px solid rgba(245, 158, 11, 0.24);
}

.btn.text {
    color: #fbbf24;
}

.btn.full {
    width: 100%;
}

.hero-control {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    color: #fff7ed;
    background: rgba(0, 0, 0, 0.42);
    font-size: 44px;
    line-height: 1;
}

.hero-control:hover {
    background: rgba(0, 0, 0, 0.72);
}

.hero-control.prev {
    left: 24px;
}

.hero-control.next {
    right: 24px;
}

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

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

.hero-dots button.is-active {
    width: 34px;
    background: #f59e0b;
}

.page-shell,
.home-search-band,
.category-strip,
.footer-grid {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.home-search-band {
    margin-top: -42px;
    position: relative;
    z-index: 8;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(28, 25, 23, 0.86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.home-search-band span,
.section-kicker,
.category-info span {
    color: #f59e0b;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.home-search-band h2,
.section-head h2,
.side-panel h2,
.category-info h2,
.detail-card h1,
.detail-card h2 {
    margin: 0;
    color: #fffbeb;
}

.quick-search {
    display: flex;
    width: min(520px, 100%);
    padding: 6px;
    border-radius: 16px;
    background: rgba(12, 10, 9, 0.72);
    border: 1px solid rgba(245, 158, 11, 0.14);
}

.quick-search input,
.filter-panel input {
    width: 100%;
    min-height: 46px;
    border: 0;
    outline: 0;
    color: #fff7ed;
    background: transparent;
}

.quick-search input {
    padding: 0 16px;
}

.quick-search button {
    padding: 0 20px;
    border-radius: 12px;
    color: #1c1917;
    font-weight: 900;
    background: #f59e0b;
}

.category-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 34px 0 10px;
}

.category-strip a,
.filter-chips button {
    border-radius: 999px;
    color: #d6d3d1;
    background: rgba(41, 37, 36, 0.78);
    border: 1px solid rgba(120, 113, 108, 0.26);
}

.category-strip a {
    padding: 12px 18px;
}

.category-strip a:hover,
.filter-chips button:hover,
.filter-chips button.is-active {
    color: #fff7ed;
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.46);
}

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    padding: 28px 0 70px;
}

.section-block,
.channel-panel,
.side-panel,
.detail-card,
.poster-panel,
.filter-panel,
.category-card,
.ranking-item {
    border: 1px solid rgba(120, 113, 108, 0.18);
    border-radius: var(--radius);
    background: rgba(28, 25, 23, 0.82);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

.section-block,
.channel-panel,
.side-panel {
    padding: 24px;
    margin-bottom: 28px;
}

.section-head {
    margin-bottom: 22px;
}

.section-head a {
    color: #fbbf24;
    font-weight: 800;
}

.horizontal-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 210px;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-color: #92400e #1c1917;
}

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

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

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

.movie-card {
    min-width: 0;
    border-radius: 16px;
    overflow: hidden;
    background: #292524;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.34);
}

.movie-card.is-hidden,
.ranking-item.is-hidden {
    display: none;
}

.poster-frame {
    position: relative;
    margin: 0;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #11100f;
}

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

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

.poster-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.08) 52%, transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.movie-card:hover .poster-frame::after {
    opacity: 1;
}

.poster-frame figcaption {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    color: #e7e5e4;
    font-size: 13px;
    line-height: 1.5;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.movie-card:hover figcaption {
    opacity: 1;
}

.type-badge,
.rank-badge {
    position: absolute;
    z-index: 3;
    top: 10px;
    right: 10px;
    padding: 5px 8px;
    border-radius: 8px;
    color: #fff7ed;
    background: #d97706;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.rank-badge {
    left: 10px;
    right: auto;
    background: rgba(12, 10, 9, 0.78);
    border: 1px solid rgba(245, 158, 11, 0.28);
}

.card-body {
    padding: 15px;
}

.card-body h3 {
    margin: 0 0 8px;
    color: #f5f5f4;
    font-size: 17px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.25s ease;
}

.movie-card:hover h3 {
    color: #fbbf24;
}

.card-meta {
    gap: 6px;
    font-size: 13px;
}

.card-desc {
    min-height: 42px;
    margin: 10px 0;
    color: #a8a29e;
    font-size: 13px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags,
.tag-cloud,
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 999px;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.12);
    font-size: 12px;
}

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

.mini-card,
.rank-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 14px;
    background: rgba(41, 37, 36, 0.62);
    transition: 0.25s ease;
}

.mini-card:hover,
.rank-row:hover {
    background: rgba(68, 64, 60, 0.8);
}

.mini-card img,
.rank-row img {
    width: 58px;
    height: 78px;
    border-radius: 10px;
    object-fit: cover;
}

.mini-card strong,
.rank-row strong {
    display: block;
    color: #f5f5f4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-card em,
.rank-row em {
    display: block;
    margin-top: 5px;
    color: #a8a29e;
    font-size: 12px;
    font-style: normal;
}

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

.rank-row span {
    color: #f59e0b;
    font-weight: 900;
}

.rank-row img {
    width: 48px;
    height: 64px;
}

.page-hero {
    position: relative;
    overflow: hidden;
    padding: 78px 0 56px;
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.18), transparent 42%),
        linear-gradient(180deg, rgba(28, 25, 23, 0.94), rgba(12, 10, 9, 0.94));
}

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

.page-hero h1 {
    margin: 10px 0 14px;
    color: #fffbeb;
    font-size: clamp(32px, 5vw, 58px);
    letter-spacing: -0.04em;
}

.page-hero p {
    max-width: 760px;
    margin: 0;
    color: #d6d3d1;
    font-size: 18px;
    line-height: 1.8;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    color: #a8a29e;
}

.breadcrumb a {
    color: #fbbf24;
}

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

.category-card {
    overflow: hidden;
}

.category-card a {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 220px;
}

.category-thumbs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    background: #11100f;
}

.category-thumbs img {
    width: 100%;
    height: 110px;
    object-fit: cover;
}

.category-info {
    padding: 28px;
}

.category-info p {
    color: #a8a29e;
    line-height: 1.8;
}

.filter-panel {
    margin: 34px 0 24px;
    padding: 18px;
}

.filter-panel input {
    padding: 0 14px;
    border-radius: 14px;
    background: rgba(12, 10, 9, 0.64);
    border: 1px solid rgba(120, 113, 108, 0.2);
}

.filter-chips button {
    padding: 9px 13px;
}

.ranking-stack {
    display: grid;
    gap: 14px;
    padding-bottom: 70px;
}

.ranking-item {
    overflow: hidden;
}

.ranking-item a {
    display: grid;
    grid-template-columns: 68px 104px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding: 16px;
}

.ranking-number {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 16px;
    color: #1c1917;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    font-size: 22px;
    font-weight: 900;
}

.ranking-item img {
    width: 104px;
    height: 136px;
    border-radius: 14px;
    object-fit: cover;
}

.ranking-item h2 {
    margin: 0 0 8px;
    color: #fff7ed;
}

.ranking-item p {
    margin: 0 0 14px;
    color: #a8a29e;
    line-height: 1.7;
}

.detail-hero {
    position: relative;
    min-height: 100vh;
    padding-bottom: 72px;
}

.detail-backdrop {
    position: absolute;
    inset: 0 0 auto;
    height: 520px;
    overflow: hidden;
    opacity: 0.38;
}

.detail-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(24px);
    transform: scale(1.08);
}

.detail-backdrop div {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(12, 10, 9, 0.2), #0c0a09 88%);
}

.detail-shell {
    position: relative;
    z-index: 1;
    padding-top: 34px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    margin-top: 28px;
}

.player-box {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #000;
    box-shadow: var(--shadow);
}

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

.player-layer {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 12px;
    align-content: center;
    color: #fff7ed;
    border: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.14));
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.player-layer span {
    display: grid;
    width: 82px;
    height: 82px;
    place-items: center;
    border-radius: 999px;
    color: #1c1917;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    font-size: 32px;
    box-shadow: 0 18px 48px rgba(245, 158, 11, 0.35);
}

.player-layer strong {
    font-size: 18px;
}

.detail-card {
    margin-top: 24px;
    padding: 28px;
}

.detail-card h1 {
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.15;
}

.detail-meta {
    margin: 16px 0 18px;
}

.one-line {
    color: #fef3c7;
    font-size: 18px;
    line-height: 1.8;
}

.tag-cloud {
    margin: 18px 0 28px;
}

.detail-card section {
    padding-top: 24px;
    border-top: 1px solid rgba(120, 113, 108, 0.18);
}

.detail-card section + section {
    margin-top: 24px;
}

.detail-card h2 {
    margin-bottom: 12px;
    font-size: 24px;
}

.detail-card p {
    color: #d6d3d1;
    line-height: 1.9;
}

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

.poster-panel img {
    width: 100%;
    border-radius: 16px;
    margin-bottom: 16px;
}

.site-footer {
    border-top: 1px solid rgba(120, 113, 108, 0.2);
    background: rgba(12, 10, 9, 0.86);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 30px;
    padding: 42px 0 26px;
}

.footer-grid p,
.footer-bottom {
    color: #a8a29e;
    line-height: 1.8;
}

.footer-grid h2 {
    margin: 0 0 12px;
    color: #fde68a;
    font-size: 18px;
}

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

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

.footer-bottom {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 28px;
    border-top: 1px solid rgba(120, 113, 108, 0.14);
}

@media (max-width: 1120px) {
    .movie-grid,
    .small-grid,
    .catalog-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

    .home-sidebar,
    .detail-side {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

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

    .main-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: 76px;
        display: none;
        padding: 12px;
        border-radius: 18px;
        background: rgba(28, 25, 23, 0.98);
        border: 1px solid rgba(245, 158, 11, 0.18);
        box-shadow: var(--shadow);
    }

    .main-nav.is-open {
        display: grid;
    }

    .hero-carousel {
        min-height: 78vh;
    }

    .hero-content {
        bottom: 11%;
    }

    .hero-actions,
    .home-search-band,
    .filter-panel,
    .section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .quick-search {
        width: 100%;
    }

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

    .category-grid,
    .footer-grid,
    .home-sidebar,
    .detail-side {
        grid-template-columns: 1fr;
    }

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

    .ranking-item a {
        grid-template-columns: 48px 82px minmax(0, 1fr);
        gap: 12px;
    }

    .ranking-item img {
        width: 82px;
        height: 112px;
    }
}

@media (max-width: 560px) {
    .header-inner,
    .page-shell,
    .home-search-band,
    .category-strip,
    .footer-grid,
    .footer-bottom {
        width: min(100% - 22px, 1280px);
    }

    .hero-control {
        display: none;
    }

    .hero-content h1,
    .hero-movie-title {
        letter-spacing: -0.03em;
    }

    .section-block,
    .channel-panel,
    .side-panel,
    .detail-card {
        padding: 18px;
    }

    .horizontal-row {
        grid-auto-columns: 185px;
    }

    .card-body {
        padding: 12px;
    }

    .card-desc,
    .card-tags {
        display: none;
    }
}
