:root {
    color-scheme: light;
    --rose-50: #fff1f2;
    --rose-100: #ffe4e6;
    --rose-200: #fecdd3;
    --rose-400: #fb7185;
    --rose-500: #f43f5e;
    --rose-600: #e11d48;
    --pink-500: #ec4899;
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --text: #1f2937;
    --muted: #64748b;
    --white: #ffffff;
    --shadow: 0 18px 45px rgba(244, 63, 94, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, var(--slate-50), var(--rose-50) 52%, var(--amber-50));
}

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

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

button,
input {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid rgba(254, 205, 211, 0.78);
    backdrop-filter: blur(18px);
}

.header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand,
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
}

.brand-icon,
.hero-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background: linear-gradient(135deg, var(--rose-500), var(--pink-500), var(--amber-400));
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(244, 63, 94, 0.28);
}

.brand-text {
    display: grid;
    line-height: 1.1;
}

.brand-text strong,
.footer-brand,
.hero-content h1,
.section-heading h2 {
    background: linear-gradient(90deg, var(--rose-500), var(--pink-500), var(--amber-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-text small {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

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

.nav-link {
    padding: 10px 16px;
    border-radius: 12px;
    color: var(--slate-600);
    transition: 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--rose-600);
    background: var(--rose-100);
}

.top-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-search input,
.filter-panel input {
    width: 230px;
    border: 1px solid var(--rose-200);
    border-radius: 999px;
    padding: 11px 16px;
    outline: none;
    background: rgba(255, 255, 255, 0.72);
    transition: 0.25s ease;
}

.top-search input:focus,
.filter-panel input:focus {
    border-color: var(--rose-400);
    box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.18);
}

.top-search button,
.btn {
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    cursor: pointer;
    transition: 0.25s ease;
}

.top-search button,
.btn.primary {
    color: var(--white);
    background: linear-gradient(90deg, var(--rose-500), var(--pink-500));
    box-shadow: 0 14px 30px rgba(244, 63, 94, 0.24);
}

.top-search button:hover,
.btn.primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 18px 38px rgba(244, 63, 94, 0.32);
}

.btn.ghost {
    color: var(--white);
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
}

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

.menu-button {
    display: none;
    margin-left: auto;
    border: 0;
    background: var(--rose-50);
    color: var(--rose-600);
    border-radius: 12px;
    padding: 10px 12px;
}

.hero-mosaic {
    position: relative;
    min-height: 78vh;
    overflow: hidden;
}

.hero-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.hero-cell {
    position: relative;
    overflow: hidden;
    background-position: center;
    background-size: cover;
    transform: scale(1.01);
    transition: transform 0.7s ease, filter 0.7s ease;
}

.hero-cell:hover {
    transform: scale(1.08);
    filter: saturate(1.12);
}

.hero-cell::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.12), transparent);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.hero-cell:hover::after {
    opacity: 1;
}

.hero-cell span {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 22px;
    z-index: 1;
    color: var(--white);
    font-weight: 700;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.65);
    transform: translateY(16px);
    opacity: 0;
    transition: 0.35s ease;
}

.hero-cell:hover span {
    transform: translateY(0);
    opacity: 1;
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0.44), var(--slate-50));
}

.hero-content {
    position: relative;
    z-index: 1;
    min-height: 78vh;
    width: min(880px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 72px 0;
}

.hero-mark {
    width: 76px;
    height: 76px;
    margin-bottom: 28px;
    font-size: 30px;
    animation: pulseGlow 2.8s ease-in-out infinite;
}

.hero-content h1 {
    margin: 0 0 22px;
    font-size: clamp(42px, 7vw, 84px);
    line-height: 1.05;
    letter-spacing: -0.04em;
    text-shadow: 0 18px 44px rgba(0, 0, 0, 0.25);
}

.hero-content p {
    max-width: 720px;
    margin: 0 0 28px;
    color: var(--white);
    font-size: clamp(17px, 2vw, 22px);
    text-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

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

.hero-category-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.hero-category-links a {
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 8px 14px;
    backdrop-filter: blur(10px);
}

.section {
    padding: 64px 0;
}

.soft-section {
    background: linear-gradient(135deg, rgba(255, 241, 242, 0.88), rgba(255, 251, 235, 0.88));
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.section-heading h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(26px, 3vw, 36px);
}

.section-heading p {
    margin: 8px 0 0;
    color: var(--muted);
}

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

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

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

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

.card-link {
    display: flex;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
    background: var(--white);
    border: 1px solid rgba(254, 205, 211, 0.55);
    border-radius: 24px;
    box-shadow: var(--shadow);
    transition: 0.3s ease;
}

.card-link:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 56px rgba(244, 63, 94, 0.18);
}

.poster {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(135deg, var(--rose-100), var(--amber-100));
}

.poster.square {
    aspect-ratio: 1 / 1;
}

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

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

.poster-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.12), transparent);
    opacity: 0;
    transition: 0.3s ease;
}

.card-link:hover .poster-gradient {
    opacity: 1;
}

.play-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rose-500);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.84);
    opacity: 0;
    transition: 0.3s ease;
}

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

.duration {
    position: absolute;
    right: 12px;
    top: 12px;
    color: var(--white);
    background: rgba(15, 23, 42, 0.72);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    backdrop-filter: blur(6px);
}

.card-body {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.card-body strong {
    color: var(--slate-800);
    font-size: 17px;
    line-height: 1.35;
    transition: color 0.25s ease;
}

.card-link:hover .card-body strong {
    color: var(--rose-600);
}

.card-body em {
    min-height: 42px;
    overflow: hidden;
    display: -webkit-box;
    color: var(--muted);
    font-style: normal;
    font-size: 14px;
    line-height: 1.5;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-body.compact em {
    min-height: auto;
}

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

.card-tags span,
.tag-list span {
    color: var(--rose-600);
    background: linear-gradient(135deg, var(--rose-50), #fdf2f8);
    border: 1px solid var(--rose-200);
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 13px;
}

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

.category-card,
.category-overview-card a {
    min-height: 176px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(254, 205, 211, 0.68);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow);
    transition: 0.28s ease;
}

.category-card:hover,
.category-overview-card a:hover {
    transform: translateY(-6px);
    border-color: var(--rose-400);
    box-shadow: 0 22px 48px rgba(244, 63, 94, 0.18);
}

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

.category-card strong,
.category-overview-card strong {
    color: var(--slate-800);
    font-size: 20px;
}

.category-card em,
.category-overview-card em {
    color: var(--muted);
    font-style: normal;
    line-height: 1.55;
}

.mini-list {
    display: grid;
    gap: 6px;
    margin-top: 6px;
    color: var(--rose-600);
    font-size: 13px;
}

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

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

.rank-card a {
    display: grid;
    grid-template-columns: 58px 84px 1fr;
    gap: 16px;
    align-items: center;
    padding: 14px;
    background: var(--white);
    border: 1px solid rgba(254, 205, 211, 0.6);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
    transition: 0.25s ease;
}

.rank-card a:hover {
    transform: translateX(6px);
    border-color: var(--rose-400);
}

.rank-number {
    color: var(--rose-500);
    font-size: 26px;
    font-weight: 900;
}

.rank-card img {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 16px;
    background: var(--rose-100);
}

.rank-info {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.rank-info strong,
.rank-info em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-info strong {
    color: var(--slate-800);
}

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

.page-hero {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 20% 20%, rgba(251, 113, 133, 0.28), transparent 35%), linear-gradient(135deg, var(--slate-900), #4c0519 55%, var(--slate-900));
    color: var(--white);
}

.compact-hero .container {
    padding: 76px 0;
}

.page-hero h1 {
    margin: 18px 0 12px;
    font-size: clamp(34px, 5vw, 58px);
}

.page-hero p {
    max-width: 720px;
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: rgba(255, 255, 255, 0.76);
    font-size: 14px;
}

.breadcrumbs a:hover {
    color: var(--white);
}

.breadcrumbs > * + *::before {
    content: "/";
    margin-right: 10px;
    opacity: 0.6;
}

.detail-breadcrumbs {
    color: var(--muted);
    margin-bottom: 24px;
}

.detail-breadcrumbs a:hover {
    color: var(--rose-600);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 0.85fr);
    gap: 28px;
    align-items: start;
}

.player-frame {
    position: relative;
    overflow: hidden;
    background: #000000;
    border-radius: 24px;
    box-shadow: 0 28px 64px rgba(15, 23, 42, 0.28);
}

.video-element {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: var(--white);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.1));
    cursor: pointer;
    transition: 0.25s ease;
}

.player-overlay span {
    width: 86px;
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.32);
    backdrop-filter: blur(12px);
    font-size: 36px;
    padding-left: 6px;
    transition: 0.25s ease;
}

.player-overlay:hover span {
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.32);
}

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

.detail-card,
.side-card {
    margin-top: 24px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(254, 205, 211, 0.65);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.detail-card h1 {
    margin: 0 0 14px;
    color: var(--slate-800);
    font-size: clamp(28px, 4vw, 42px);
}

.detail-card h2 {
    margin: 28px 0 12px;
    color: var(--slate-800);
    font-size: 22px;
}

.detail-card p {
    color: var(--slate-700);
    line-height: 1.9;
}

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

.detail-meta span {
    color: var(--slate-700);
    background: var(--rose-50);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.lead {
    font-weight: 700;
    color: var(--slate-800) !important;
}

.review-box {
    color: var(--slate-700);
    line-height: 1.9;
    background: linear-gradient(135deg, var(--rose-50), #fdf2f8);
    border: 1px solid var(--rose-100);
    border-radius: 18px;
    padding: 20px;
}

.detail-side {
    position: sticky;
    top: 104px;
}

.side-card {
    margin-top: 0;
}

.side-card h3 {
    margin: 0 0 18px;
    color: var(--slate-800);
    font-size: 22px;
}

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

.side-list a {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 16px;
    transition: 0.25s ease;
}

.side-list a:hover {
    background: var(--rose-50);
}

.side-list img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 14px;
    background: var(--rose-100);
}

.side-list span {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.side-list strong,
.side-list em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-list strong {
    color: var(--slate-800);
}

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

.filter-panel {
    margin-bottom: 28px;
    display: flex;
    justify-content: flex-end;
}

.filter-panel.search-wide {
    justify-content: center;
}

.filter-panel.search-wide input {
    width: min(720px, 100%);
}

.empty-state {
    display: none;
    margin-top: 24px;
    padding: 28px;
    text-align: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.78);
    border-radius: 22px;
}

.empty-state.is-visible {
    display: block;
}

.site-footer {
    color: var(--white);
    background: linear-gradient(135deg, var(--slate-900), #4c0519 52%, var(--slate-900));
    margin-top: 32px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    padding: 54px 0 34px;
}

.footer-grid p,
.footer-grid a,
.footer-grid span {
    display: block;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.8;
    font-size: 14px;
}

.footer-grid a:hover {
    color: var(--rose-400);
}

.footer-grid h3 {
    margin: 0 0 16px;
    color: #fda4af;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.62);
    font-size: 14px;
}

@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 12px 30px rgba(244, 63, 94, 0.28);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 20px 44px rgba(244, 63, 94, 0.42);
    }
}

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

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

    .top-search input {
        width: 180px;
    }
}

@media (max-width: 860px) {
    .header-inner {
        flex-wrap: wrap;
        min-height: auto;
        padding: 12px 0;
    }

    .menu-button {
        display: inline-flex;
    }

    .nav-panel {
        order: 4;
        display: none;
        width: 100%;
        margin: 0;
        flex-direction: column;
        align-items: stretch;
        padding-top: 12px;
        border-top: 1px solid var(--rose-100);
    }

    .nav-panel.is-open {
        display: flex;
    }

    .top-search {
        width: 100%;
        order: 5;
    }

    .top-search input {
        flex: 1;
        width: auto;
    }

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

    .hero-cell:nth-child(n + 4) {
        display: none;
    }

    .movie-grid,
    .catalog-grid,
    .square-grid,
    .rank-list,
    .big-rank-list,
    .detail-layout,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .detail-side {
        position: static;
    }

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

@media (max-width: 560px) {
    .container {
        width: min(100% - 24px, 1180px);
    }

    .hero-content h1 {
        font-size: 40px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
    }

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

    .rank-card a {
        grid-template-columns: 44px 72px 1fr;
        gap: 10px;
    }

    .rank-card img {
        width: 72px;
        height: 72px;
    }

    .detail-card,
    .side-card {
        padding: 20px;
    }
}
