:root {
    --jelly-bg-primary: #f8f9fe;
    --jelly-bg-secondary: #ffffff;
    --jelly-text-primary: #2d3748;
    --jelly-text-secondary: #718096;
    --jelly-accent-mint: #b8e6d5;
    --jelly-accent-lavender: #d4c5f9;
    --jelly-accent-pink: #ffc4dd;
    --jelly-accent-blue: #c4ddff;
    --jelly-accent-peach: #ffd4c4;
    --jelly-moon: #e8eaf6;
    --shadow-soft: 0 16px 48px rgba(31, 38, 135, 0.18);
    --shadow-card: 0 8px 32px rgba(31, 38, 135, 0.15), 0 2px 8px rgba(31, 38, 135, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    color: var(--jelly-text-primary);
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb, #4facfe, #00f2fe);
    background-size: 400% 400%;
    animation: gradientShift 30s ease infinite;
}

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

button,
input {
    font: inherit;
}

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

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.jelly-card {
    overflow: hidden;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(24px);
}

.jelly-glass {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.30);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(40px);
}

.jelly-gradient-text {
    color: transparent;
    background-image: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    background-clip: text;
    -webkit-background-clip: text;
}

.moon-glow {
    position: relative;
}

.moon-glow::before {
    content: "";
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle, rgba(232, 234, 246, 0.38) 0%, transparent 70%);
    pointer-events: none;
    animation: moonPulse 4s ease-in-out infinite;
}

@keyframes moonPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    border-radius: 0;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
}

.logo-link,
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 800;
}

.logo-mark {
    display: inline-flex;
    width: 2.65rem;
    height: 2.65rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #a78bfa, #f9a8d4);
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.25);
}

.logo-text,
.footer-logo {
    font-size: 1.25rem;
    color: transparent;
    background-image: linear-gradient(135deg, #5b21b6, #db2777);
    background-clip: text;
    -webkit-background-clip: text;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.desktop-nav a {
    padding: 0.6rem 0.85rem;
    border-radius: 999px;
    color: #4b5563;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    color: #7c3aed;
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-1px);
}

.header-search {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
    min-width: 280px;
}

.header-search input,
.mobile-menu input,
.filter-box input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    outline: none;
    padding: 0.72rem 1rem;
    color: #374151;
    background: rgba(255, 255, 255, 0.82);
}

.header-search button,
.mobile-menu button,
.sort-actions button,
.player-actions-inline button {
    border: 0;
    border-radius: 999px;
    padding: 0.72rem 1rem;
    color: #ffffff;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.20);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.header-search button:hover,
.mobile-menu button:hover,
.sort-actions button:hover,
.player-actions-inline button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(124, 58, 237, 0.28);
}

.menu-toggle {
    display: none;
    width: 2.8rem;
    height: 2.8rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    color: #6d28d9;
    cursor: pointer;
}

.mobile-menu {
    display: none;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem 1rem;
}

.mobile-menu.open {
    display: block;
}

.mobile-menu form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.mobile-menu nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.mobile-menu a {
    padding: 0.8rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.55);
}

.page-shell {
    width: min(1280px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 6.5rem 0 3rem;
}

.hero-carousel {
    position: relative;
    min-height: 600px;
    margin-bottom: 2rem;
}

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

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

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

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea, #f093fb);
}

.hero-slide img.image-missing,
.poster-frame img.image-missing,
.rank-row img.image-missing {
    display: none;
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.42), rgba(15, 23, 42, 0.12));
}

.hero-content {
    position: absolute;
    left: clamp(1.4rem, 5vw, 4.5rem);
    right: clamp(1.4rem, 5vw, 4.5rem);
    bottom: clamp(2rem, 8vw, 5rem);
    max-width: 780px;
    color: #ffffff;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(16px);
    font-size: 0.88rem;
    font-weight: 700;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
    margin: 1rem 0;
    font-size: clamp(2.15rem, 5vw, 4.85rem);
    line-height: 1.05;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.hero-content p,
.page-hero p,
.detail-one-line {
    max-width: 760px;
    font-size: 1.08rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.90);
}

.hero-tags,
.detail-tags,
.movie-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.hero-tags span,
.detail-tags span,
.movie-tags span {
    border-radius: 999px;
    padding: 0.35rem 0.72rem;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.20);
    backdrop-filter: blur(16px);
    font-size: 0.82rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.primary-action,
.secondary-action,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.85rem 1.35rem;
    font-weight: 800;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.primary-action {
    color: #5b21b6;
    background: #ffffff;
    box-shadow: 0 16px 32px rgba(255, 255, 255, 0.24);
}

.secondary-action {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(16px);
}

.text-link {
    color: #7c3aed;
    background: rgba(255, 255, 255, 0.65);
}

.primary-action:hover,
.secondary-action:hover,
.text-link:hover {
    transform: translateY(-2px);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 3rem;
    height: 3rem;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.20);
    backdrop-filter: blur(16px);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.hero-arrow.prev {
    left: 1rem;
}

.hero-arrow.next {
    right: 1rem;
}

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 1.25rem;
    z-index: 3;
    display: flex;
    gap: 0.5rem;
    transform: translateX(-50%);
}

.hero-dot {
    width: 0.7rem;
    height: 0.7rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
}

.hero-dot.active {
    width: 2rem;
    background: #ffffff;
}

.quick-entry,
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    border-radius: 1.5rem;
}

.quick-entry p,
.section-kicker {
    margin: 0 0 0.35rem;
    color: #7c3aed;
    font-weight: 800;
}

.quick-entry h2,
.section-heading h2,
.page-hero h1,
.detail-copy h2 {
    margin: 0;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
}

.quick-links a {
    border-radius: 999px;
    padding: 0.62rem 0.95rem;
    background: rgba(255, 255, 255, 0.62);
    color: #4b5563;
    transition: color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.quick-links a:hover {
    color: #7c3aed;
    background: #ffffff;
    transform: translateY(-2px);
}

.content-section {
    margin-top: 3rem;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-heading h2 {
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    color: transparent;
    background-image: linear-gradient(135deg, #4f46e5, #db2777);
    background-clip: text;
    -webkit-background-clip: text;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.25rem;
}

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

.movie-card {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
}

.movie-card:hover {
    transform: translateY(-8px) scale(1.015);
    box-shadow: var(--shadow-soft);
}

.poster-frame {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(135deg, #d4c5f9, #ffc4dd, #c4ddff);
}

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

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

.poster-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.72), transparent 52%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.poster-type,
.poster-year,
.rank-badge {
    position: absolute;
    z-index: 2;
    border-radius: 999px;
    padding: 0.32rem 0.62rem;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(12px);
    font-size: 0.76rem;
    font-weight: 800;
}

.poster-type {
    left: 0.65rem;
    top: 0.65rem;
}

.poster-year {
    right: 0.65rem;
    bottom: 0.65rem;
}

.rank-badge {
    left: 0.65rem;
    bottom: 0.65rem;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.movie-card-body {
    padding: 1rem;
}

.movie-card-body h3 {
    margin: 0 0 0.55rem;
    font-size: 1.05rem;
    line-height: 1.35;
}

.movie-card-summary {
    display: -webkit-box;
    min-height: 3.25rem;
    margin: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: #667085;
    line-height: 1.65;
}

.movie-card-summary.compact {
    min-height: 2.6rem;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
    color: #7c3aed;
    font-size: 0.82rem;
    font-weight: 700;
}

.movie-tags span {
    color: #6d28d9;
    background: rgba(124, 58, 237, 0.10);
}

.page-hero,
.detail-hero,
.player-section,
.detail-copy {
    margin-bottom: 2rem;
    padding: clamp(1.3rem, 4vw, 2.5rem);
}

.page-hero {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.92), rgba(219, 39, 119, 0.74)), rgba(255, 255, 255, 0.4);
}

.page-hero p {
    color: rgba(255, 255, 255, 0.92);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
    color: rgba(255, 255, 255, 0.90);
    font-size: 0.94rem;
}

.detail-hero .breadcrumb {
    color: #6b7280;
}

.breadcrumb a:hover {
    color: #7c3aed;
}

.toolbar {
    position: sticky;
    top: 5rem;
    z-index: 12;
}

.filter-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    color: #6d28d9;
    font-weight: 800;
}

.filter-box.wide {
    flex: 1.5;
}

.sort-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sort-actions button.active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

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

.category-overview-card {
    padding: 1.35rem;
}

.category-main-link {
    display: block;
}

.category-icon {
    display: inline-flex;
    width: 3rem;
    height: 3rem;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    color: #ffffff;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    font-weight: 900;
}

.category-overview-card h2 {
    margin: 1rem 0 0.5rem;
}

.category-overview-card p {
    color: #667085;
    line-height: 1.75;
}

.category-sample {
    display: grid;
    gap: 0.45rem;
    margin-top: 1rem;
}

.category-sample a {
    border-radius: 0.9rem;
    padding: 0.65rem 0.8rem;
    color: #4b5563;
    background: rgba(255, 255, 255, 0.56);
}

.category-sample a:hover {
    color: #7c3aed;
    background: #ffffff;
}

.rank-list {
    display: grid;
    gap: 0.75rem;
}

.rank-row {
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.rank-row-link {
    display: grid;
    grid-template-columns: 3.5rem 4rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
}

.rank-number {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    font-weight: 900;
}

.rank-row img {
    width: 4rem;
    height: 5.2rem;
    border-radius: 0.85rem;
    object-fit: cover;
    background: linear-gradient(135deg, #d4c5f9, #ffc4dd);
}

.rank-main {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

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

.rank-main em {
    color: #667085;
    font-style: normal;
}

.rank-side {
    color: #7c3aed;
    font-size: 0.9rem;
    font-weight: 800;
}

.detail-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 2rem;
    align-items: center;
}

.detail-poster {
    border-radius: 1.4rem;
    box-shadow: var(--shadow-soft);
}

.detail-info .hero-pill {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

.detail-info h1 {
    color: #1f2937;
    text-shadow: none;
}

.detail-one-line {
    color: #4b5563;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 1.35rem;
}

.detail-meta-grid span {
    display: grid;
    gap: 0.3rem;
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    background: rgba(124, 58, 237, 0.08);
    color: #4b5563;
}

.detail-meta-grid strong {
    color: #7c3aed;
}

.detail-tags span {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.12);
}

.player-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.player-heading h2 {
    margin: 0;
}

.player-actions-inline {
    display: flex;
    gap: 0.5rem;
}

.video-shell {
    position: relative;
    overflow: hidden;
    border-radius: 1.25rem;
    background: #0f172a;
    aspect-ratio: 16 / 9;
}

.video-shell video {
    width: 100%;
    height: 100%;
    background: #0f172a;
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: #ffffff;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.62));
    cursor: pointer;
}

.play-overlay span {
    display: flex;
    width: clamp(4rem, 10vw, 6rem);
    height: clamp(4rem, 10vw, 6rem);
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(16px);
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    padding-left: 0.25rem;
}

.play-overlay.hidden {
    display: none;
}

.detail-copy h2 {
    margin-top: 1.2rem;
    color: #7c3aed;
}

.detail-copy h2:first-child {
    margin-top: 0;
}

.detail-copy p {
    color: #4b5563;
    line-height: 1.9;
    white-space: pre-line;
}

.site-footer {
    width: min(1280px, calc(100% - 2rem));
    margin: 1rem auto 2rem;
    border-radius: 1.5rem;
    padding: 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2rem;
}

.footer-grid p {
    color: #667085;
    line-height: 1.8;
}

.footer-grid h2 {
    margin: 0 0 0.9rem;
    font-size: 1.05rem;
}

.footer-links {
    display: grid;
    gap: 0.55rem;
}

.footer-links a {
    color: #667085;
}

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

.footer-bottom {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.55);
    color: #667085;
    font-size: 0.92rem;
}

.hidden-card {
    display: none !important;
}

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

@media (max-width: 900px) {
    .desktop-nav,
    .header-search {
        display: none;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
    }

    .hero-carousel {
        min-height: 540px;
    }

    .quick-entry,
    .toolbar,
    .section-heading,
    .player-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .quick-links {
        justify-content: flex-start;
    }

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

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

    .detail-poster {
        width: min(320px, 100%);
    }

    .rank-row-link {
        grid-template-columns: 3rem 3.4rem minmax(0, 1fr);
    }

    .rank-side {
        display: none;
    }
}

@media (max-width: 620px) {
    .page-shell {
        width: min(100% - 1rem, 1280px);
        padding-top: 5.6rem;
    }

    .header-inner {
        padding: 0.75rem;
    }

    .hero-carousel {
        min-height: 500px;
        border-radius: 1.1rem;
    }

    .hero-content {
        left: 1.15rem;
        right: 1.15rem;
        bottom: 3rem;
    }

    .hero-arrow {
        display: none;
    }

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

    .movie-card-body {
        padding: 0.85rem;
    }

    .movie-card-summary {
        min-height: 2.8rem;
        font-size: 0.9rem;
    }

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

    .player-actions-inline,
    .sort-actions {
        width: 100%;
    }

    .player-actions-inline button,
    .sort-actions button {
        flex: 1;
    }

    .site-footer {
        width: min(100% - 1rem, 1280px);
        padding: 1.25rem;
    }
}
