:root {
    --red: #dc2626;
    --red-dark: #b91c1c;
    --orange: #f97316;
    --slate: #0f172a;
    --slate-soft: #1e293b;
    --muted: #64748b;
    --line: rgba(148, 163, 184, 0.22);
    --radius: 22px;
    --shadow: 0 22px 60px rgba(15, 23, 42, 0.16);
}

html {
    scroll-behavior: smooth;
}

body {
    background: #f8fafc;
    color: #111827;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-icon {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--red), var(--orange));
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(220, 38, 38, 0.38);
    font-size: 16px;
}

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

.nav-link,
.mobile-link {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 700;
    padding: 10px 14px;
    border-radius: 999px;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.menu-button span {
    width: 20px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
}

.mobile-nav {
    display: none;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px 16px;
    gap: 8px;
    flex-wrap: wrap;
}

.hero {
    position: relative;
    min-height: 720px;
    background: radial-gradient(circle at top left, rgba(248, 113, 113, 0.24), transparent 32%), linear-gradient(135deg, #0f172a 0%, #1e293b 48%, #7f1d1d 100%);
    overflow: hidden;
    color: #ffffff;
}

.hero-stage {
    position: relative;
    min-height: 720px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.7s ease, transform 0.7s ease;
    pointer-events: none;
}

.hero-slide.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.hero-bg,
.detail-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(8px) saturate(1.12);
    transform: scale(1.06);
    opacity: 0.32;
}

.hero-shade,
.detail-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.72), rgba(127, 29, 29, 0.7));
}

.hero-content {
    position: relative;
    z-index: 2;
    min-height: 640px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 96px 20px 140px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.58fr);
    align-items: center;
    gap: 56px;
}

.eyebrow {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    color: #fecaca;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow.dark {
    color: var(--red);
}

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

.hero-copy strong {
    color: #fca5a5;
}

.hero-copy p,
.page-hero p,
.detail-info .lead {
    max-width: 740px;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.75;
}

.hero-actions,
.hero-search,
.page-search {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

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

.primary-btn,
.ghost-btn,
.text-link,
.page-search button,
.hero-search button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-weight: 900;
    transition: 0.2s ease;
}

.primary-btn,
.page-search button,
.hero-search button {
    min-height: 48px;
    padding: 0 22px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 16px 34px rgba(220, 38, 38, 0.3);
}

.primary-btn:hover,
.page-search button:hover,
.hero-search button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 44px rgba(220, 38, 38, 0.4);
}

.ghost-btn {
    min-height: 48px;
    padding: 0 22px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.ghost-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.ghost-btn.small {
    min-height: 40px;
    padding: 0 16px;
}

.text-link {
    color: var(--red);
    gap: 6px;
}

.text-link:hover {
    color: var(--red-dark);
    transform: translateX(2px);
}

.hero-poster {
    position: relative;
    border-radius: 34px;
    overflow: hidden;
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.45);
    transform: rotate(2deg);
    border: 1px solid rgba(255, 255, 255, 0.18);
    aspect-ratio: 2 / 3;
}

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

.poster-badge {
    position: absolute;
    right: 18px;
    top: 18px;
    padding: 8px 12px;
    border-radius: 12px;
    color: #ffffff;
    background: rgba(220, 38, 38, 0.92);
    font-weight: 900;
}

.hero-controls {
    position: absolute;
    z-index: 4;
    left: 50%;
    bottom: 96px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    color: #ffffff;
}

.hero-controls > button {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 30px;
    line-height: 1;
}

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

.hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
    transition: 0.2s ease;
}

.hero-dot.active {
    width: 30px;
    background: #ffffff;
}

.hero-search {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: 28px;
    width: min(820px, calc(100% - 40px));
    transform: translateX(-50%);
    padding: 14px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(18px);
}

.hero-search input,
.page-search input,
.catalog-toolbar input {
    flex: 1 1 260px;
    width: 100%;
    min-height: 48px;
    border-radius: 14px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.96);
    color: #111827;
    outline: none;
}

.hero-search a {
    color: #ffffff;
    font-weight: 900;
    padding: 0 8px;
}

.feature-strip {
    max-width: 1280px;
    margin: -36px auto 0;
    position: relative;
    z-index: 10;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.feature-box {
    min-height: 112px;
    padding: 22px;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow);
}

.feature-box span {
    display: block;
    color: var(--muted);
    font-weight: 700;
}

.feature-box strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
    color: #111827;
}

.section,
.dark-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 80px 20px;
}

.dark-section {
    max-width: none;
    margin-top: 20px;
    background: linear-gradient(135deg, #0f172a, #111827 52%, #7f1d1d);
    color: #ffffff;
}

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

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

.section-head h2 {
    margin: 8px 0;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 900;
    letter-spacing: -0.04em;
}

.section-head p {
    color: var(--muted);
    max-width: 660px;
}

.section-head.light p {
    color: rgba(255, 255, 255, 0.68);
}

.section-head.compact {
    align-items: center;
    margin-bottom: 24px;
}

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

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

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

.movie-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.16);
}

.poster-link {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #0f172a;
}

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

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

.play-chip {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 50px;
    height: 50px;
    transform: translate(-50%, -50%) scale(0.8);
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(220, 38, 38, 0.92);
    opacity: 0;
    transition: 0.2s ease;
}

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

.movie-card-body {
    padding: 16px;
}

.movie-meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
}

.movie-card h3,
.rank-content h3 {
    margin: 8px 0;
    color: #111827;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 900;
}

.movie-card h3 a:hover,
.rank-content h3 a:hover {
    color: var(--red);
}

.movie-card p,
.rank-content p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag-row span {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    color: #dc2626;
    background: #fee2e2;
    font-size: 12px;
    font-weight: 800;
}

.tag-row.large span {
    font-size: 13px;
    padding: 7px 11px;
}

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

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

.category-card {
    position: relative;
    min-height: 280px;
    overflow: hidden;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    transition: 0.2s ease;
}

.category-grid.wide .category-card {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.08);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 34px 70px rgba(0, 0, 0, 0.26);
}

.category-poster-stack {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    opacity: 0.35;
}

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

.category-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0.94));
}

.category-card-content {
    position: absolute;
    z-index: 2;
    inset: auto 0 0 0;
    padding: 24px;
    color: #ffffff;
}

.category-emoji {
    font-size: 34px;
}

.category-card h2 {
    margin: 10px 0;
    font-size: 25px;
    font-weight: 900;
}

.category-card p {
    color: rgba(255, 255, 255, 0.74);
    line-height: 1.7;
}

.two-column-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 34px;
}

.rank-panel,
.content-card {
    background: #ffffff;
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
}

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

.rank-list.mini .rank-item {
    grid-template-columns: 38px 62px minmax(0, 1fr);
}

.rank-list.mini .rank-item .text-link {
    display: none;
}

.rank-list.mini .rank-content p,
.rank-list.mini .tag-row {
    display: none;
}

.rank-item {
    display: grid;
    grid-template-columns: 56px 94px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.rank-number {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #fee2e2;
    color: var(--red);
    font-weight: 900;
}

.rank-poster {
    overflow: hidden;
    border-radius: 14px;
    aspect-ratio: 2 / 3;
    background: #0f172a;
}

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

.page-hero,
.detail-hero {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(135deg, #0f172a, #1e293b 55%, #7f1d1d);
}

.page-hero {
    min-height: 360px;
    display: grid;
    align-items: end;
    gap: 28px;
    padding: 96px max(20px, calc((100vw - 1280px) / 2 + 20px)) 58px;
}

.page-hero.small-hero {
    min-height: 320px;
}

.page-hero h1 {
    max-width: 860px;
}

.page-search {
    max-width: 760px;
}

.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-bottom: 26px;
    padding: 18px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.catalog-toolbar.slim {
    align-items: center;
}

.catalog-toolbar label {
    flex: 1 1 320px;
}

.catalog-toolbar span {
    display: block;
    margin-bottom: 8px;
    color: #475569;
    font-weight: 900;
}

.catalog-toolbar input {
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #f8fafc;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tabs button {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    color: #475569;
    background: #f1f5f9;
    font-weight: 900;
}

.filter-tabs button.active,
.filter-tabs button:hover {
    color: #ffffff;
    background: var(--red);
}

.detail-hero {
    min-height: 760px;
}

.detail-wrap {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    margin: 0 auto;
    padding: 86px 20px 70px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 28px;
    font-weight: 700;
}

.breadcrumb a:hover {
    color: #ffffff;
}

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

.player-card {
    padding: 14px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 36px 100px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
}

.video-shell {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: #000000;
    aspect-ratio: 16 / 9;
}

.video-shell video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    cursor: pointer;
}

.video-shade {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0.62));
    cursor: pointer;
    z-index: 3;
}

.video-shade.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.big-play {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--red), var(--orange));
    box-shadow: 0 18px 46px rgba(220, 38, 38, 0.48);
    font-size: 32px;
    padding-left: 5px;
}

.detail-info {
    padding: 28px;
    border-radius: 28px;
    background: rgba(15, 23, 42, 0.46);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(18px);
}

.detail-info h1 {
    font-size: clamp(36px, 5vw, 58px);
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.meta-grid div {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
}

.meta-grid dt {
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
    font-weight: 800;
}

.meta-grid dd {
    color: #ffffff;
    margin-top: 4px;
    font-weight: 900;
}

.detail-section {
    display: grid;
    gap: 22px;
}

.content-card h2 {
    margin-bottom: 12px;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.content-card p {
    color: #334155;
    font-size: 17px;
    line-height: 1.9;
}

.footer {
    background: #0f172a;
    color: rgba(255, 255, 255, 0.68);
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 54px 20px;
    display: grid;
    grid-template-columns: 1fr 220px 220px;
    gap: 34px;
}

.footer-about p {
    max-width: 520px;
    margin-top: 18px;
    line-height: 1.8;
}

.footer h3 {
    color: #ffffff;
    font-weight: 900;
    margin-bottom: 16px;
}

.footer li + li {
    margin-top: 10px;
}

.footer a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    padding: 18px 20px;
}

.back-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 70;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    color: #ffffff;
    background: var(--red);
    box-shadow: 0 18px 40px rgba(220, 38, 38, 0.35);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: 0.2s ease;
}

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

[data-card].hidden-card {
    display: none;
}

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

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

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

    .two-column-section,
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

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

    .menu-button {
        display: flex;
    }

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

    .hero,
    .hero-stage {
        min-height: 780px;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 28px;
        padding-top: 74px;
        padding-bottom: 170px;
    }

    .hero-poster {
        width: min(280px, 78vw);
        margin: 0 auto;
    }

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

    .section-head,
    .catalog-toolbar,
    .footer-inner {
        display: grid;
        grid-template-columns: 1fr;
    }

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

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

    .rank-item .text-link {
        grid-column: 3;
        justify-self: start;
    }

    .page-hero {
        padding-top: 72px;
    }
}

@media (max-width: 560px) {
    .topbar-inner {
        padding-left: 14px;
        padding-right: 14px;
    }

    .brand {
        font-size: 19px;
    }

    .brand-icon {
        width: 34px;
        height: 34px;
    }

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

    .hero-search,
    .page-search {
        display: grid;
        grid-template-columns: 1fr;
    }

    .feature-strip,
    .movie-grid,
    .catalog-grid,
    .compact-grid,
    .category-grid,
    .category-grid.wide,
    .meta-grid {
        grid-template-columns: 1fr;
    }

    .rank-item,
    .rank-list.mini .rank-item {
        grid-template-columns: 42px 70px minmax(0, 1fr);
        gap: 10px;
    }

    .movie-card {
        display: grid;
        grid-template-columns: 110px minmax(0, 1fr);
    }

    .poster-link {
        height: 100%;
        aspect-ratio: auto;
    }

    .detail-wrap {
        padding-top: 64px;
    }

    .player-card,
    .detail-info,
    .content-card {
        border-radius: 20px;
        padding: 16px;
    }
}
