:root {
    color-scheme: dark;
    --bg-main: #020617;
    --bg-panel: rgba(15, 23, 42, 0.78);
    --bg-card: rgba(15, 23, 42, 0.92);
    --bg-card-soft: rgba(30, 41, 59, 0.72);
    --stroke: rgba(148, 163, 184, 0.18);
    --accent: #22d3ee;
    --accent-strong: #06b6d4;
    --accent-warm: #fb7185;
    --text-main: #f8fafc;
    --text-soft: rgba(226, 232, 240, 0.8);
    --shadow-soft: 0 20px 55px rgba(2, 6, 23, 0.4);
}

body.movie-site-bg {
    /* Themed background lives in theme.css (single source of truth) */
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.font-display {
    font-family: "Outfit", sans-serif;
}

.hero-mesh {
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95), transparent 90%);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Unified sticky site header shared by all public pages */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.74));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.site-header::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.55), rgba(251, 113, 133, 0.45), transparent);
    pointer-events: none;
}

.nav-pill,
.trend-chip,
.meta-chip,
.badge-surface,
.cta-button,
.cta-button-secondary {
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease, opacity 180ms ease;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.7rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--stroke);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.55);
    line-height: 1;
    white-space: nowrap;
    font-weight: 700;
}

.nav-pill svg {
    width: 0.95rem;
    height: 0.95rem;
    flex: none;
}

.nav-pill:hover,
.trend-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(34, 211, 238, 0.45);
    color: white;
    box-shadow: 0 10px 24px rgba(34, 211, 238, 0.14);
}

.nav-pill:focus-visible {
    outline: 2px solid rgba(34, 211, 238, 0.65);
    outline-offset: 2px;
}

.nav-pill-active {
    border-color: transparent;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.26), rgba(125, 211, 252, 0.12));
    color: #ffffff;
    box-shadow:
        inset 0 0 0 1px rgba(34, 211, 238, 0.55),
        inset 0 -1.6em 1.4em -1.2em rgba(34, 211, 238, 0.35),
        0 8px 22px rgba(34, 211, 238, 0.16);
}

.nav-pill-back {
    background: rgba(2, 6, 23, 0.52);
}

.nav-pill-accent,
.cta-button {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.98), rgba(125, 211, 252, 0.94));
    color: #02111f;
    border-color: transparent;
    font-weight: 800;
}

.nav-pill-accent {
    box-shadow: 0 10px 26px rgba(34, 211, 238, 0.22);
}

.nav-pill-accent:hover {
    box-shadow: 0 14px 30px rgba(34, 211, 238, 0.34);
}

.nav-pill-accent:hover,
.cta-button:hover {
    transform: translateY(-2px);
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.9rem 1.35rem;
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
}

.cta-button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.35rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, 0.3);
    background: rgba(8, 17, 31, 0.55);
    color: white;
    font-weight: 700;
}

.cta-button-secondary.is-active {
    background: rgba(34, 211, 238, 0.2);
    border-color: rgba(34, 211, 238, 0.6);
    color: #22d3ee;
}

.spotlight-panel,
.browse-shell,
.empty-shell,
.variant-card {
    background: var(--bg-panel);
    border: 1px solid var(--stroke);
    border-radius: 1.75rem;
    box-shadow: var(--shadow-soft);
}

.spotlight-panel {
    padding: 1.5rem;
}

.hero-input,
.hero-select,
.filter-input {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(2, 6, 23, 0.55);
    color: white;
    padding: 0.95rem 1rem;
    outline: none;
}

.hero-input::placeholder,
.filter-input::placeholder {
    color: rgba(203, 213, 225, 0.58);
}

.eyebrow,
.section-kicker {
    color: rgba(165, 243, 252, 0.9);
    font-size: 0.8rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}

.section-title {
    font-family: "Outfit", sans-serif;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    color: white;
}

.trend-chip,
.meta-chip,
.badge-surface {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.65);
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-soft);
}

.genre-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(13.5rem, 18rem);
    gap: 1rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 211, 238, 0.45) rgba(15, 23, 42, 0.55);
    padding: 0.15rem 0 0.75rem;
}

.genre-rail::-webkit-scrollbar {
    height: 0.55rem;
}

.genre-rail::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.55);
    border-radius: 999px;
}

.genre-rail::-webkit-scrollbar-thumb {
    background: rgba(34, 211, 238, 0.42);
    border-radius: 999px;
}

.genre-card {
    position: relative;
    display: flex;
    min-height: 8.75rem;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    scroll-snap-align: start;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1.2rem;
    background:
        radial-gradient(circle at 20% 10%, rgba(34, 211, 238, 0.18), transparent 34%),
        radial-gradient(circle at 90% 95%, rgba(251, 113, 133, 0.18), transparent 38%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.78));
    padding: 1.05rem;
    box-shadow: var(--shadow-soft);
    isolation: isolate;
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.genre-card-poster {
    position: absolute;
    inset: 0;
    z-index: -3;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.74;
    transform: scale(1.02);
    transition: transform 420ms ease, opacity 220ms ease;
}

.genre-card-shade {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.06), rgba(2, 6, 23, 0.78) 68%, rgba(2, 6, 23, 0.94)),
        linear-gradient(90deg, rgba(2, 6, 23, 0.68), rgba(2, 6, 23, 0.08) 58%);
}

.genre-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 38%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 18px);
    opacity: 0.9;
}

.genre-card-has-poster::before {
    background:
        radial-gradient(circle at 15% 20%, rgba(34, 211, 238, 0.22), transparent 34%),
        linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 42%);
}

.genre-card::after {
    content: "→";
    position: absolute;
    top: 0.9rem;
    right: 1rem;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.38);
    color: rgba(224, 242, 254, 0.92);
    font-size: 1rem;
    font-weight: 800;
}

.genre-card:hover {
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, 0.42);
}

.genre-card:hover .genre-card-poster {
    opacity: 0.9;
    transform: scale(1.08);
}

.genre-card-title {
    font-family: "Outfit", sans-serif;
    color: white;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.05;
    text-shadow: 0 2px 18px rgba(2, 6, 23, 0.75);
}

.genre-card-copy {
    margin-top: 0.45rem;
    color: rgba(226, 232, 240, 0.76);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 2px 14px rgba(2, 6, 23, 0.78);
}

.tmdb-carousel-controls {
    display: inline-flex;
    gap: 0.5rem;
}

.tmdb-carousel-nav {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, 0.35);
    background: rgba(15, 23, 42, 0.8);
    color: rgba(226, 232, 240, 0.95);
    font-size: 1.5rem;
    line-height: 1;
    display: grid;
    place-items: center;
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.tmdb-carousel-nav:hover {
    transform: translateY(-1px);
    border-color: rgba(34, 211, 238, 0.7);
    background: rgba(8, 17, 31, 0.98);
}

.tmdb-carousel-shell {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background:
        radial-gradient(circle at left center, rgba(34, 211, 238, 0.08), transparent 35%),
        radial-gradient(circle at right center, rgba(251, 113, 133, 0.08), transparent 35%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(2, 6, 23, 0.92));
    padding: 0.95rem 2.9rem;
}

.tmdb-carousel-shell::before,
.tmdb-carousel-shell::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2.4rem;
    z-index: 2;
    pointer-events: none;
}

.tmdb-carousel-shell::before {
    left: 0;
    background: linear-gradient(90deg, rgba(2, 6, 23, 0.98), transparent);
}

.tmdb-carousel-shell::after {
    right: 0;
    background: linear-gradient(270deg, rgba(2, 6, 23, 0.98), transparent);
}

.tmdb-carousel-track {
    display: flex;
    gap: 0.9rem;
    transform: translateX(0);
    transition: transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.tmdb-carousel-card {
    flex: 0 0 clamp(120px, 14vw, 170px);
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.62);
    overflow: hidden;
    box-shadow: 0 16px 30px rgba(2, 6, 23, 0.45);
}

.tmdb-carousel-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
}

.tmdb-carousel-card span {
    display: block;
    padding: 0.6rem 0.65rem 0.72rem;
    font-size: 0.78rem;
    color: rgba(226, 232, 240, 0.92);
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-language {
    border-color: rgba(251, 113, 133, 0.25);
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.35rem;
}

.movie-card {
    position: relative;
    border-radius: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.78));
    padding: 0;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transform: translateZ(0);
    will-change: transform, opacity;
}

.movie-card:hover {
    transform: translateY(-4px);
    border-color: rgba(34, 211, 238, 0.32);
    box-shadow: var(--shadow-soft), 0 18px 44px rgba(34, 211, 238, 0.12);
}

.movie-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    outline: none;
}

.movie-card-link:focus-visible {
    outline: 2px solid rgba(34, 211, 238, 0.75);
    outline-offset: -2px;
    border-radius: inherit;
}

/* Poster fills the card; info sits on a gradient overlay */
.movie-card .movie-poster-shell {
    border-radius: 0;
}

@media (prefers-reduced-motion: no-preference) {
    .movie-card:hover .movie-poster.loaded {
        transform: scale(1.05);
    }
}

/* Sheen sweep across the poster once per hover */
.movie-card-sheen {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.16) 48%, transparent 62%);
    transform: translateX(-130%) skewX(-6deg);
}

@media (prefers-reduced-motion: no-preference) {
    .movie-card:hover .movie-card-sheen {
        animation: movie-card-sheen 900ms ease;
    }
}

@keyframes movie-card-sheen {
    to {
        transform: translateX(130%) skewX(-6deg);
    }
}

/* Bottom gradient carrying title + meta on the artwork */
.movie-card-overlay {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 3;
    display: grid;
    gap: 0.35rem;
    padding: 2.4rem 0.9rem 0.85rem;
    background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.62) 38%, rgba(2, 6, 23, 0.94));
    pointer-events: none;
}

.movie-card-title {
    margin: 0;
    color: white;
    font-family: "Outfit", sans-serif;
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 12px rgba(2, 6, 23, 0.8);
}

.movie-card-meta {
    margin: 0;
    color: rgba(203, 213, 225, 0.85);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Quality / NEW badges pinned to the poster's top-left corner */
.movie-card-badges {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-width: calc(100% - 4.6rem);
    pointer-events: none;
}

.movie-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(224, 242, 254, 0.24);
    background: rgba(2, 6, 23, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(224, 242, 254, 0.95);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1;
}

.movie-card-badge-new {
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.95), rgba(244, 114, 182, 0.9));
    border-color: transparent;
    color: #fff;
}

/* Rating ring pinned top-right */
.rating-ring {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 3;
    width: 2.5rem;
    height: 2.5rem;
    pointer-events: none;
    filter: drop-shadow(0 2px 8px rgba(2, 6, 23, 0.7));
}

.rating-ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.18);
}

.rating-ring-progress {
    fill: none;
    stroke: #22d3ee;
    stroke-linecap: round;
    transition: stroke-dashoffset 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.rating-ring-value {
    fill: #ffffff;
    font-size: 0.52rem;
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: central;
}

/* Favorite heart — outside the link so taps never trigger navigation */
.movie-card-fav {
    position: absolute;
    top: 3.5rem;
    right: 0.65rem;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(224, 242, 254, 0.22);
    background: rgba(2, 6, 23, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(240, 249, 255, 0.92);
    cursor: pointer;
    transition: transform 180ms ease, color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.movie-card-fav svg {
    width: 1rem;
    height: 1rem;
}

.movie-card-fav:hover {
    transform: translateY(-1px);
    color: #fb7185;
    border-color: rgba(251, 113, 133, 0.45);
}

.movie-card-fav:focus-visible {
    outline: 2px solid rgba(251, 113, 133, 0.7);
    outline-offset: 2px;
}

.movie-card-fav.is-active {
    color: #fb7185;
    border-color: rgba(251, 113, 133, 0.55);
    background: rgba(251, 113, 133, 0.16);
}

.movie-card-fav.is-active svg {
    fill: currentColor;
}

/* Skeleton card shown while more pages load */
.movie-card-skeleton {
    aspect-ratio: 2 / 3;
    border-radius: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background:
        linear-gradient(100deg, transparent 40%, rgba(148, 163, 184, 0.09) 50%, transparent 60%),
        linear-gradient(180deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.72));
    background-size: 200% 100%, 100% 100%;
    animation: skeleton-shimmer 1.4s linear infinite;
}

@keyframes skeleton-shimmer {
    from {
        background-position: 120% 0, 0 0;
    }
    to {
        background-position: -80% 0, 0 0;
    }
}

.browse-more-card {
    position: relative;
    min-height: 100%;
    padding: 0;
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.84));
    isolation: isolate;
}

.browse-more-link {
    position: relative;
    z-index: 0;
    display: flex;
    min-height: 100%;
    aspect-ratio: 2 / 3;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    padding: 1.2rem;
    color: white;
    isolation: isolate;
}

.browse-more-poster-collage {
    position: absolute;
    inset: -0.7rem;
    z-index: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 0.38rem;
    opacity: 0.78;
    transform: rotate(-4deg) scale(1.1);
    transition: opacity 220ms ease, transform 520ms ease;
}

.browse-more-poster {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 0.85rem;
    object-fit: cover;
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.52);
}

.browse-more-poster-1,
.browse-more-poster-4 {
    transform: translateY(0.7rem);
}

.browse-more-poster-3,
.browse-more-poster-6 {
    transform: translateY(-0.45rem);
}

.browse-more-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.6) 47%, rgba(2, 6, 23, 0.94)),
        linear-gradient(135deg, rgba(34, 211, 238, 0.24), transparent 45%),
        linear-gradient(315deg, rgba(251, 113, 133, 0.24), transparent 44%);
}

.browse-more-mark {
    position: absolute;
    z-index: 2;
    top: 1rem;
    right: 1rem;
    display: grid;
    place-items: center;
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.16);
    color: rgba(224, 242, 254, 0.96);
    font-size: 1.35rem;
    font-weight: 800;
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.28) inset;
}

.browse-more-title {
    position: relative;
    z-index: 2;
    font-family: "Outfit", sans-serif;
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.05;
    text-shadow: 0 2px 18px rgba(2, 6, 23, 0.84);
}

.browse-more-copy {
    position: relative;
    z-index: 2;
    margin-top: 0.55rem;
    color: rgba(226, 232, 240, 0.78);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    text-shadow: 0 2px 14px rgba(2, 6, 23, 0.82);
}

.browse-more-card:hover .browse-more-poster-collage {
    opacity: 0.92;
    transform: rotate(-2deg) scale(1.16);
}

.movie-poster-shell {
    position: relative;
    overflow: hidden;
    border-radius: 1.25rem;
    aspect-ratio: 2 / 3;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.8), rgba(2, 6, 23, 0.8));
}

.movie-poster,
.detail-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.movie-poster {
    opacity: 0;
    filter: blur(12px) saturate(0.86);
    transform: scale(1.02);
    transition: opacity 420ms ease, filter 620ms ease, transform 620ms ease;
}

.movie-poster.loaded {
    opacity: 1;
    filter: blur(0) saturate(1);
    transform: scale(1);
}

.movie-poster.error {
    opacity: 0;
}

.movie-poster-fallback,
.detail-poster-fallback {
    display: grid;
    place-items: center;
    color: rgba(226, 232, 240, 0.88);
    font-family: "Outfit", sans-serif;
    font-size: 3rem;
    font-weight: 800;
}

.poster-shell-loading::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            105deg,
            rgba(148, 163, 184, 0.06) 24%,
            rgba(226, 232, 240, 0.2) 38%,
            rgba(148, 163, 184, 0.06) 52%
        ),
        rgba(15, 23, 42, 0.48);
    background-size: 220% 100%;
    animation: poster-shimmer 1.5s linear infinite;
    pointer-events: none;
}

.poster-shell-loaded::before {
    opacity: 0;
    transition: opacity 240ms ease;
}

.reveal-card {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
    transition:
        opacity 460ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--card-delay, 0ms);
}

.reveal-card.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.browse-shell {
    padding: 1.4rem;
}

.browse-hero .section-title {
    font-size: clamp(1.8rem, 3.8vw, 2.5rem);
}

/* Self-sufficient nav defaults (pages without Tailwind render the same) */
/* ============================================================================
   Site navigation v2 — one cohesive glass bar shared by every catalog page:
   primary links · utilities (search, Telegram, appearance) · account.
   Filled accent is reserved for the single most important action (Join).
   ============================================================================ */

.site-nav {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 3rem;
    padding: 0.35rem 0.45rem;
    border: 1px solid var(--stroke);
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(15, 23, 42, 0.82), rgba(2, 6, 23, 0.66));
    box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.site-nav-links {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    min-width: 0;
}

.site-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background-color 180ms ease, color 180ms ease;
}

.site-nav-link:hover {
    color: #ffffff;
    background: rgba(34, 211, 238, 0.08);
}

.site-nav-link:focus-visible {
    outline: 2px solid rgba(34, 211, 238, 0.65);
    outline-offset: 2px;
}

/* Active page: cyan text + soft tint + accent notch under the label */
.site-nav-link.is-active {
    color: #a5f3fc;
    background: rgba(34, 211, 238, 0.1);
}

.site-nav-link.is-active::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0.24rem;
    transform: translateX(-50%);
    width: 1.1rem;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.9), rgba(125, 211, 252, 0.7));
}

.site-nav-link svg {
    width: 0.95rem;
    height: 0.95rem;
    flex: none;
}

.site-nav-link-back {
    color: rgba(165, 243, 252, 0.85);
}

.site-nav-sep {
    width: 1px;
    align-self: stretch;
    margin: 0.35rem 0.25rem;
    background: linear-gradient(180deg, transparent, rgba(148, 163, 184, 0.35), transparent);
}

.site-nav-utils {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
}

/* Telegram — distinct external/community action, visually secondary */
.site-nav-util {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.4rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background-color 180ms ease, color 180ms ease;
}

.site-nav-util:hover {
    color: #fda4af;
    background: rgba(251, 113, 133, 0.1);
}

.site-nav-util:focus-visible {
    outline: 2px solid rgba(251, 113, 133, 0.6);
    outline-offset: 2px;
}

.site-nav-util svg {
    width: 0.98rem;
    height: 0.98rem;
    flex: none;
}

.theme-slot {
    display: inline-flex;
}

/* In-header appearance control overrides the floating-page-button default
   defined for pages without the shared nav */
[data-theme-slot] .theme-toggle {
    position: static;
    width: 2.4rem;
    height: 2.4rem;
    box-shadow: none;
    background: transparent;
    color: var(--text-soft);
}

[data-theme-slot] .theme-toggle:hover {
    color: #ffffff;
    background: rgba(34, 211, 238, 0.08);
    border-color: transparent;
}

/* Guest entry point */
.site-nav-account {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* The one filled-accent action in the bar */
.account-join {
    display: inline-flex;
    align-items: center;
    min-height: 2.4rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.98), rgba(125, 211, 252, 0.94));
    color: #02111f;
    font-size: 0.88rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 8px 20px -8px rgba(34, 211, 238, 0.5);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.account-join:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 12px 26px -8px rgba(34, 211, 238, 0.6);
}

.account-join:active {
    transform: scale(0.96);
}

.account-join:focus-visible {
    outline: 2px solid rgba(34, 211, 238, 0.75);
    outline-offset: 2px;
}

/* Signed-in compact trigger + dropdown */
.account-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.4rem;
    padding: 0.28rem 0.65rem 0.28rem 0.32rem;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    color: var(--text-main);
    font-weight: 700;
    transition: background-color 180ms ease, border-color 180ms ease;
}

.account-trigger:hover {
    border-color: rgba(34, 211, 238, 0.4);
    background: rgba(34, 211, 238, 0.07);
}

.account-trigger:focus-visible {
    outline: 2px solid rgba(34, 211, 238, 0.65);
    outline-offset: 2px;
}

.account-avatar {
    display: grid;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.95), rgba(251, 113, 133, 0.9));
    color: #04111f;
    font-family: "Outfit", sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
}

.account-name {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
}

.account-chevron {
    width: 0.85rem;
    height: 0.85rem;
    color: var(--text-soft);
    transition: transform 180ms ease;
}

.account-trigger[aria-expanded="true"] .account-chevron {
    transform: rotate(180deg);
}

.account-menu {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    z-index: 70;
    min-width: 11.5rem;
    padding: 0.45rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 1.1rem;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.96));
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.account-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.62rem 0.75rem;
    border-radius: 0.75rem;
    color: var(--text-soft);
    font-size: 0.88rem;
    font-weight: 700;
    text-align: left;
    transition: background-color 180ms ease, color 180ms ease;
}

.account-menu-item:hover {
    color: #ffffff;
    background: rgba(34, 211, 238, 0.1);
}

.account-menu-item:focus-visible {
    outline: 2px solid rgba(34, 211, 238, 0.65);
    outline-offset: -2px;
}

.account-menu-item svg {
    width: 1rem;
    height: 1rem;
    flex: none;
}

.account-menu-signout:hover {
    color: #fda4af;
    background: rgba(251, 113, 133, 0.1);
}

/* --- Mobile drawer: Explore / Account / More ----------------------------- */

.mobile-drawer {
    display: none;
}

@media (max-width: 720px) {
    /* Primary links live in the drawer on small screens; utilities collapse
       to the burger (their actions have dedicated drawer rows) */
    .site-nav-links,
    .site-nav-util,
    .site-nav-account,
    .site-nav-search,
    [data-theme-slot].theme-slot {
        display: none;
    }

    .mobile-drawer {
        position: absolute;
        top: calc(100% + 0.65rem);
        right: 0;
        z-index: 60;
        display: none;
        flex-direction: column;
        gap: 0.35rem;
        width: min(19.5rem, calc(100vw - 2.5rem));
        max-height: calc(100vh - 7rem);
        overflow-y: auto;
        padding: 0.85rem;
        border: 1px solid rgba(148, 163, 184, 0.22);
        border-radius: 1.4rem;
        background: linear-gradient(160deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.95));
        box-shadow: var(--shadow-soft);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .mobile-drawer.is-open {
        display: flex;
    }

    .drawer-section {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.35rem 0 0.55rem;
    }

    .drawer-section + .drawer-section {
        border-top: 1px solid rgba(148, 163, 184, 0.16);
    }

    .drawer-label {
        padding: 0.3rem 0.8rem 0.35rem;
        color: rgba(165, 243, 252, 0.75);
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.28em;
        text-transform: uppercase;
    }

    .drawer-row {
        display: flex;
        align-items: center;
        gap: 0.7rem;
        width: 100%;
        min-height: 2.75rem;
        padding: 0.6rem 0.85rem;
        border-radius: 0.8rem;
        color: var(--text-soft);
        font-size: 0.92rem;
        font-weight: 700;
        text-align: left;
        transition: background-color 180ms ease, color 180ms ease;
    }

    .drawer-row:hover {
        color: #ffffff;
        background: rgba(34, 211, 238, 0.09);
    }

    .drawer-row:focus-visible {
        outline: 2px solid rgba(34, 211, 238, 0.65);
        outline-offset: -2px;
    }

    .drawer-row.is-active {
        color: #a5f3fc;
        background: rgba(34, 211, 238, 0.1);
    }

    .drawer-row svg {
        width: 1.05rem;
        height: 1.05rem;
        flex: none;
    }

    .drawer-row[data-theme-row] .theme-icon-sun {
        display: none;
    }

    .drawer-row[data-theme-row][data-show-sun] .theme-icon-sun {
        display: block;
    }

    .drawer-row[data-theme-row][data-show-sun] .theme-icon-moon {
        display: none;
    }
}

/* Hamburger toggle — hidden on desktop, the whole nav on mobile */
.nav-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background-color 180ms ease, transform 180ms ease;
}

.nav-menu-toggle:hover {
    background: rgba(34, 211, 238, 0.14);
    transform: translateY(-1px);
}

.nav-menu-toggle:focus-visible {
    outline: 2px solid rgba(34, 211, 238, 0.65);
    outline-offset: 2px;
}

.nav-menu-toggle svg {
    width: 1.2rem;
    height: 1.2rem;
}

.nav-menu-toggle .nav-icon-close {
    display: none;
}

.nav-menu-toggle[aria-expanded="true"] .nav-icon-burger {
    display: none;
}

.nav-menu-toggle[aria-expanded="true"] .nav-icon-close {
    display: block;
}

.movie-nav-search {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: clamp(13.5rem, 24vw, 20rem);
    min-height: 2.7rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.38);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
    transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.movie-nav-search:focus-within {
    border-color: rgba(34, 211, 238, 0.52);
    background: rgba(2, 6, 23, 0.58);
    box-shadow:
        0 0 0 3px rgba(34, 211, 238, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.movie-nav-search-icon {
    position: absolute;
    left: 0.95rem;
    width: 1rem;
    height: 1rem;
    color: rgba(165, 243, 252, 0.86);
    pointer-events: none;
}

.movie-nav-search-input {
    width: 100%;
    min-width: 0;
    min-height: 2.65rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: white;
    padding: 0.65rem 0.45rem 0.65rem 2.55rem;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0;
    outline: none;
}

.movie-nav-search-input::placeholder {
    color: rgba(203, 213, 225, 0.62);
}

.movie-nav-search-button {
    display: grid;
    place-items: center;
    width: 2.15rem;
    height: 2.15rem;
    margin-right: 0.28rem;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.14);
    color: rgba(224, 242, 254, 0.95);
    transition: transform 180ms ease, background-color 180ms ease, color 180ms ease;
}

.movie-nav-search-button:hover,
.movie-nav-search-button:focus-visible {
    transform: translateY(-1px);
    background: rgba(34, 211, 238, 0.24);
    color: white;
    outline: none;
}

.movie-nav-search-button svg {
    width: 1rem;
    height: 1rem;
}

.quality-strip {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quality-item,
.metric-card {
    border-radius: 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.6);
    padding: 1rem;
}

.quality-label {
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(165, 243, 252, 0.85);
}

.quality-value,
.metric-copy {
    margin-top: 0.4rem;
    color: rgba(226, 232, 240, 0.84);
    font-size: 0.92rem;
    line-height: 1.45;
}

.browse-metrics {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-title {
    font-family: "Outfit", sans-serif;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
}

.browse-filter-form {
    display: grid;
    gap: 0;
}

.browse-search-panel {
    position: relative;
    padding: 0.42rem;
    border: 1px solid rgba(226, 232, 240, 0.13);
    border-radius: 2rem;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
        rgba(3, 10, 22, 0.74);
    box-shadow:
        0 22px 60px rgba(2, 6, 23, 0.42),
        0 1px 0 rgba(255, 255, 255, 0.08) inset;
    backdrop-filter: blur(18px);
    transition:
        border-color 220ms ease,
        box-shadow 220ms ease,
        background-color 220ms ease,
        transform 220ms ease;
}

.browse-search-panel:focus-within,
.browse-search-panel.is-expanded {
    border-color: rgba(125, 211, 252, 0.42);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.045)),
        rgba(3, 10, 22, 0.86);
    box-shadow:
        0 28px 70px rgba(2, 6, 23, 0.5),
        0 0 0 4px rgba(34, 211, 238, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

.filter-search-wrap {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.45rem;
}

.filter-search-icon {
    position: absolute;
    top: 50%;
    left: 1.05rem;
    width: 1.1rem;
    height: 1.1rem;
    color: rgba(165, 243, 252, 0.85);
    transform: translateY(-50%);
    pointer-events: none;
}

.filter-search {
    min-height: 3.45rem;
    padding: 0.92rem 1rem 0.92rem 2.85rem;
    border-color: transparent;
    border-radius: 999px;
    background: transparent;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
    box-shadow: none;
}

.filter-search:focus {
    border-color: transparent;
    box-shadow: none;
}

.filter-submit-button {
    min-height: 2.85rem;
    padding: 0.75rem 1.2rem;
    box-shadow: 0 12px 30px rgba(34, 211, 238, 0.2);
}

.browse-filter-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.45rem 0.4rem 0;
}

.browse-filter-panel {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 0.35rem;
    transform: translateY(-6px);
    pointer-events: none;
    transition:
        max-height 320ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 220ms ease,
        padding 320ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.browse-search-panel:focus-within .browse-filter-panel,
.browse-search-panel.is-expanded .browse-filter-panel {
    max-height: 26rem;
    opacity: 1;
    padding: 0.8rem 0.35rem 0.45rem;
    transform: translateY(0);
    pointer-events: auto;
}

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

.browse-filter-field {
    display: grid;
    gap: 0.38rem;
}

.browse-filter-label {
    padding-left: 0.15rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(203, 213, 225, 0.76);
}

.browse-filter-field .filter-input {
    min-height: 2.8rem;
    border-radius: 0.95rem;
    background: rgba(15, 23, 42, 0.62);
    padding: 0.72rem 0.82rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(248, 250, 252, 0.94);
}

.browse-filter-field .filter-input:focus {
    border-color: rgba(125, 211, 252, 0.45);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.browse-pagination {
    position: relative;
    display: inline-grid;
    grid-template-columns: auto auto auto auto;
    align-items: center;
    gap: 0.85rem;
    overflow: hidden;
    max-width: 100%;
    min-height: 4.2rem;
    padding: 0.55rem 0.65rem 0.55rem 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
        rgba(2, 6, 23, 0.68);
    box-shadow:
        0 24px 70px rgba(2, 6, 23, 0.48),
        0 1px 0 rgba(255, 255, 255, 0.08) inset;
    isolation: isolate;
}

.browse-pagination::before {
    content: "";
    position: absolute;
    inset: -60% -20%;
    z-index: -1;
    background: conic-gradient(from 140deg, transparent, rgba(34, 211, 238, 0.24), rgba(251, 113, 133, 0.2), transparent 58%);
    opacity: 0.76;
    animation: pagination-glow 7s linear infinite;
}

.pagination-orbit {
    position: relative;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.24) inset;
}

.pagination-orbit::before {
    content: "";
    position: absolute;
    inset: 0.35rem;
    border-radius: inherit;
    border: 1px solid rgba(125, 211, 252, 0.34);
}

.pagination-orbit span {
    position: absolute;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: #22d3ee;
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.82);
}

.pagination-orbit span:nth-child(1) {
    transform: translateY(-0.9rem);
}

.pagination-orbit span:nth-child(2) {
    transform: rotate(120deg) translateY(-0.9rem);
    background: #fb7185;
    box-shadow: 0 0 18px rgba(251, 113, 133, 0.74);
}

.pagination-orbit span:nth-child(3) {
    transform: rotate(240deg) translateY(-0.9rem);
    background: #a78bfa;
    box-shadow: 0 0 18px rgba(167, 139, 250, 0.72);
}

.pagination-copy {
    display: grid;
    gap: 0.18rem;
    min-width: 8rem;
}

.pagination-page-label {
    font-family: "Outfit", sans-serif;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.05;
}

.pagination-count-label,
.pagination-done {
    color: rgba(203, 213, 225, 0.76);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.pagination-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    min-width: 3.3rem;
    max-width: 9rem;
    overflow: hidden;
}

.pagination-dot {
    width: 0.52rem;
    height: 0.52rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.42);
    transition: width 220ms ease, background-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.pagination-dot.is-active {
    width: 1.65rem;
    background: linear-gradient(90deg, #22d3ee, #fb7185);
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.38);
}

.pagination-dot.is-new {
    animation: pagination-dot-pop 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pagination-load-button {
    min-height: 3rem;
    padding: 0.75rem 1.15rem;
    box-shadow: 0 14px 34px rgba(34, 211, 238, 0.24);
}

.pagination-done {
    display: inline-flex;
    align-items: center;
    min-height: 3rem;
    padding: 0 1rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, 0.22);
    background: rgba(34, 211, 238, 0.08);
    color: rgba(224, 242, 254, 0.92);
}

.detail-hero {
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.detail-poster-frame {
    width: 100%;
    max-width: 320px;
    border-radius: 2rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--detail-poster-bg);
    box-shadow: var(--shadow-soft);
}

/* ============================================================================
   Movie detail page — hero metadata, variant interaction, toasts
   ============================================================================ */

.detail-title {
    text-wrap: balance;
}

.text-pretty {
    text-wrap: pretty;
}

.num-tabular {
    font-variant-numeric: tabular-nums;
}

.detail-tagline {
    margin-top: 0.75rem;
    max-width: 42rem;
    color: var(--eyebrow);
    font-size: 1.05rem;
    font-style: italic;
}

.detail-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.1rem;
}

/* Inline rating ring — same component as the cards, un-pinned for the meta row */
.detail-rating {
    display: inline-flex;
    flex: none;
}

.detail-rating .rating-ring {
    position: static;
    width: 3rem;
    height: 3rem;
    filter: drop-shadow(0 4px 12px rgba(2, 6, 23, 0.65));
}

.detail-cast {
    margin-top: 0.9rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-soft);
}

/* Pure white/black hairline outline keeps poster edges crisp on any backdrop */
.detail-poster-frame .detail-poster {
    outline: 1px solid oklch(1 0 0 / 0.1);
    outline-offset: -1px;
}

.more-like-shell {
    margin-top: 3.5rem;
    padding: 1.75rem;
}

/* The card macro ships .reveal-card and blurred .movie-poster states that
   movies.js unmarks via its scroll observer — but the detail page never
   loads movies.js, so without these overrides the grid renders as an empty
   panel. Fail open here instead. */
.more-like-shell .reveal-card {
    opacity: 1;
    transform: none;
}

.more-like-shell .movie-poster {
    opacity: 1;
    filter: none;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    .more-like-shell .movie-card {
        animation: variant-enter 420ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
    }

    .more-like-shell .movie-card:nth-child(2) { animation-delay: 60ms; }
    .more-like-shell .movie-card:nth-child(3) { animation-delay: 120ms; }
    .more-like-shell .movie-card:nth-child(4) { animation-delay: 180ms; }
    .more-like-shell .movie-card:nth-child(5) { animation-delay: 240ms; }
    .more-like-shell .movie-card:nth-child(n + 6) { animation-delay: 300ms; }
}

/* Variant rows: layered shadows for lift (borders stay structural) */
.variant-card {
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.variant-card:hover {
    border-color: rgba(34, 211, 238, 0.32);
    box-shadow:
        0 1px 2px rgba(2, 6, 23, 0.35),
        0 12px 28px -8px rgba(2, 6, 23, 0.5),
        0 24px 48px -18px rgba(34, 211, 238, 0.16);
}

@media (prefers-reduced-motion: no-preference) {
    .variant-card:hover {
        transform: translateY(-2px);
    }

    /* Staggered entrance on page load only — filtering stays instant */
    .variant-list .variant-card {
        animation: variant-enter 420ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
    }

    .variant-list .variant-card:nth-child(2) { animation-delay: 60ms; }
    .variant-list .variant-card:nth-child(3) { animation-delay: 120ms; }
    .variant-list .variant-card:nth-child(4) { animation-delay: 180ms; }
    .variant-list .variant-card:nth-child(5) { animation-delay: 240ms; }
    .variant-list .variant-card:nth-child(6) { animation-delay: 300ms; }
    .variant-list .variant-card:nth-child(n + 7) { animation-delay: 360ms; }
}

@keyframes variant-enter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Tactile press feedback on every button-style control */
.cta-button:active,
.cta-button-secondary:active,
.back-to-top:active,
.variant-filter-button:active {
    transform: scale(0.96);
}

.cta-button-secondary.is-busy {
    opacity: 0.55;
    pointer-events: none;
}

/* Favorite heart: one SVG, two states cross-faded (outline idle, fill active) */
.icon-heart .heart-fill {
    opacity: 0;
    transform: scale(0.25);
    filter: blur(4px);
    transform-origin: center;
    transition:
        opacity 240ms cubic-bezier(0.2, 0, 0, 1),
        transform 240ms cubic-bezier(0.2, 0, 0, 1),
        filter 240ms cubic-bezier(0.2, 0, 0, 1);
}

.icon-heart .heart-outline {
    transition: opacity 240ms cubic-bezier(0.2, 0, 0, 1);
}

.cta-button-secondary.is-active .heart-fill {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

.cta-button-secondary.is-active .heart-outline {
    opacity: 0;
}

/* Toast stack — replaces alert() feedback */
.toast-stack {
    position: fixed;
    left: 50%;
    bottom: 1.75rem;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transform: translateX(-50%);
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 1.05rem;
    border: 1px solid var(--stroke);
    border-radius: 0.9rem;
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: var(--shadow-soft);
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
}

.toast-action {
    color: var(--link-accent);
    font-weight: 800;
}

.toast-action:hover {
    color: var(--link-accent-hover);
}

.toast.is-leaving {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 180ms ease-out, transform 180ms ease-out;
}

@media (prefers-reduced-motion: no-preference) {
    .toast {
        animation: toast-in 200ms cubic-bezier(0.22, 1, 0.36, 1);
    }
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}


.variant-list {
    display: grid;
    gap: 1rem;
}

.variant-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.variant-quality-filter {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.32rem;
    border: 1px solid var(--input-stroke);
    border-radius: 999px;
    background: var(--filter-input-bg);
}

.variant-filter-button {
    min-height: 2.35rem;
    padding: 0.62rem 0.95rem;
    border-radius: 999px;
    color: rgba(226, 232, 240, 0.82);
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1;
    transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.variant-filter-button:hover,
.variant-filter-button:focus-visible {
    transform: translateY(-1px);
    background: rgba(34, 211, 238, 0.1);
    color: white;
}

.variant-filter-button:focus-visible {
    outline: 2px solid rgba(34, 211, 238, 0.65);
    outline-offset: 2px;
}

.variant-filter-button.is-active {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.26), rgba(125, 211, 252, 0.14));
    color: #ffffff;
    box-shadow:
        inset 0 0 0 1px rgba(34, 211, 238, 0.5),
        0 6px 16px -6px rgba(34, 211, 238, 0.45);
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Standard property for better browser compatibility */
    line-clamp: 3;
}

.variant-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.15rem 1.35rem;
}

/* --- Choose-a-version card contents ------------------------------------- */

.variants-intro {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-width: 34rem;
}

.variant-helper {
    font-size: 0.9rem;
    color: var(--text-soft);
}

.variant-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.variant-title {
    font-family: "Outfit", sans-serif;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-main);
}

.variant-size {
    margin-top: 0.3rem;
    font-size: 0.88rem;
    color: var(--text-soft);
}

.variant-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0.26rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(251, 113, 133, 0.38);
    background: rgba(251, 113, 133, 0.12);
    color: #fda4af;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.variant-flag svg {
    width: 0.8rem;
    height: 0.8rem;
    flex: none;
}

.variant-action svg {
    width: 1.05rem;
    height: 1.05rem;
    flex: none;
}

/* Duplicate toggle and fallback list styles */
.variant-duplicate-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.4);
    color: rgba(203, 213, 225, 0.8);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 180ms ease;
}

.variant-duplicate-toggle:hover {
    border-color: rgba(34, 211, 238, 0.4);
    background: rgba(15, 23, 42, 0.6);
    color: rgba(224, 242, 254, 0.95);
}

.variant-duplicate-toggle svg {
    width: 0.9rem;
    height: 0.9rem;
}

.variant-duplicate-toggle[aria-expanded="true"] {
    background: rgba(34, 211, 238, 0.15);
    border-color: rgba(34, 211, 238, 0.5);
    color: #22d3ee;
}

.variant-duplicate-list {
    margin-top: 0.6rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.variant-fallback-link {
    display: block;
    padding: 0.4rem 0.6rem;
    border-radius: 0.35rem;
    color: rgba(203, 213, 225, 0.85);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 150ms ease;
}

.variant-fallback-link:hover {
    background: rgba(34, 211, 238, 0.1);
    color: #22d3ee;
}

/* "Show more versions" control for large grouped variant lists */
.variants-show-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.variants-show-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, 0.35);
    background: rgba(15, 23, 42, 0.55);
    color: rgba(224, 242, 254, 0.95);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 180ms ease;
}

.variants-show-more:hover {
    background: rgba(34, 211, 238, 0.12);
    border-color: rgba(34, 211, 238, 0.6);
    color: #22d3ee;
}

.variants-show-more svg {
    width: 1rem;
    height: 1rem;
}

@media (max-width: 640px) {
    /* Stack rows on small screens; keep the action a full-width tap target */
    .variant-card {
        flex-direction: column;
        align-items: stretch;
        gap: 0.95rem;
        padding: 1.05rem;
    }

    .variant-action {
        width: 100%;
    }
}

.hidden {
    display: none !important;
}

@keyframes poster-shimmer {
    from {
        background-position: 200% 0, 0 0;
    }
    to {
        background-position: -20% 0, 0 0;
    }
}

@keyframes pagination-glow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pagination-dot-pop {
    0% {
        transform: scale(0.45);
        opacity: 0;
    }
    70% {
        transform: scale(1.18);
        opacity: 1;
    }
    100% {
        transform: scale(1);
    }
}

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

    .quality-strip,
    .browse-metrics {
        grid-template-columns: 1fr;
    }
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.98), rgba(125, 211, 252, 0.94));
    color: #02111f;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    visibility: hidden;
    transform: translateY(1rem);
    transition: opacity 300ms ease, visibility 300ms ease, transform 300ms ease;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px rgba(34, 211, 238, 0.4);
}

.back-to-top svg {
    width: 1.5rem;
    height: 1.5rem;
}

@media (max-width: 720px) {
    .browse-page main {
        padding-top: 1.25rem;
    }

    /* Mobile: collapse the nav into a hamburger + drawer panel */
    .nav-menu-toggle {
        display: inline-flex;
    }

    .browse-hero {
        margin-bottom: 1rem;
    }

    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }

    .browse-shell {
        padding: 0.95rem;
        border-radius: 1.35rem;
    }

    .tmdb-carousel-shell {
        padding: 0.85rem 1.9rem;
    }

    .genre-rail {
        grid-auto-columns: minmax(11.75rem, 78vw);
        gap: 0.8rem;
    }

    .genre-card {
        min-height: 7.75rem;
        border-radius: 1rem;
        padding: 0.95rem;
    }

    .genre-card-title {
        font-size: 1.25rem;
    }

    .browse-filter-grid {
        grid-template-columns: 1fr;
    }

    .browse-search-panel {
        border-radius: 1.45rem;
        padding: 0.35rem;
    }

    .filter-search-wrap {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.25rem;
    }

    .filter-search {
        min-height: 3.15rem;
        padding-left: 2.65rem;
        padding-right: 0.4rem;
        font-size: 0.94rem;
    }

    .filter-search-icon {
        left: 0.95rem;
    }

    .filter-submit-button {
        min-width: 4.8rem;
        min-height: 2.65rem;
        padding: 0.68rem 0.9rem;
        font-size: 0.86rem;
    }

    .browse-search-panel:focus-within .browse-filter-panel,
    .browse-search-panel.is-expanded .browse-filter-panel {
        max-height: 32rem;
        padding-top: 0.75rem;
    }

    .browse-filter-summary {
        padding-top: 0.35rem;
    }

    .browse-filter-summary .meta-chip {
        padding: 0.42rem 0.66rem;
        font-size: 0.74rem;
    }

    .browse-filter-field .filter-input {
        min-height: 2.75rem;
    }

    .browse-pagination {
        width: 100%;
        grid-template-columns: auto 1fr;
        border-radius: 1.4rem;
        padding: 0.75rem;
    }

    .pagination-dots {
        order: 3;
        grid-column: 1 / -1;
        max-width: 100%;
    }

    .pagination-load-button,
    .pagination-done {
        order: 4;
        grid-column: 1 / -1;
        width: 100%;
    }

    .variant-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .variant-section-head {
        align-items: stretch;
    }

    .variant-section-head > div:first-child,
    .variant-quality-filter {
        width: 100%;
    }

    .variant-quality-filter {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-radius: 1.15rem;
    }

    .variant-filter-button {
        width: 100%;
    }

    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 3rem;
        height: 3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .movie-poster,
    .reveal-card,
    .back-to-top,
    .nav-pill,
    .nav-menu-toggle,
    .trend-chip,
    .meta-chip,
    .badge-surface,
    .genre-card,
    .cta-button,
    .cta-button-secondary,
    .variant-filter-button,
    .browse-search-panel,
    .browse-filter-panel,
    .browse-pagination,
    .pagination-dot {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    .mobile-drawer.is-open {
        animation: none;
    }

    .reveal-card {
        opacity: 1;
        transform: none;
    }

    .poster-shell-loading::before {
        animation: none;
    }

    .movie-card-skeleton {
        animation: none;
    }

    .browse-pagination::before {
        animation: none;
    }

    .tmdb-carousel-track {
        transition: none;
    }
}

/* Page transition overlay */
.page-transition-overlay {
    position: fixed;
    inset: 0;
    background: #020617;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 300ms ease;
}

.page-transition-overlay.active {
    opacity: 1;
}

/* Page fade in animation */
body {
    opacity: 0;
    transition: opacity 300ms ease;
}

body.loaded {
    opacity: 1;
}

/* Mobile nav panel open animation */
@keyframes nav-panel-pop {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 720px) and (prefers-reduced-motion: no-preference) {
    .mobile-drawer.is-open {
        transform-origin: top right;
        animation: nav-panel-pop 180ms ease;
    }
}

/* Utility fallback for pages that do not load Tailwind (dmca, player, trailer) */
.hidden {
    display: none !important;
}

/* ===== Home page additions ===== */

.genre-card-viewall {
    justify-content: center;
    align-items: center;
    text-align: center;
    border-style: dashed;
    border-color: rgba(34, 211, 238, 0.4);
    background:
        radial-gradient(circle at 20% 10%, rgba(34, 211, 238, 0.22), transparent 40%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(8, 17, 31, 0.9));
}

.genre-card-viewall:hover {
    border-color: rgba(34, 211, 238, 0.75);
}

.genre-viewall-mark {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    margin-bottom: 0.65rem;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.16);
    color: rgba(165, 243, 252, 0.95);
    font-size: 1.3rem;
    font-weight: 800;
}

.trending-rating {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 2;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.82);
    color: #fbbf24;
    font-size: 0.72rem;
    font-weight: 800;
}

.tmdb-carousel-card {
    position: relative;
}

.trending-poster-fallback {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 2 / 3;
    font-size: 2.4rem;
    font-weight: 800;
    color: rgba(165, 243, 252, 0.7);
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.92));
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1rem;
}

.collection-card {
    position: relative;
    display: flex;
    min-height: 10.5rem;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    isolation: isolate;
    padding: 1.05rem 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1.2rem;
    background: radial-gradient(circle at 18% 8%, rgba(34, 211, 238, 0.14), transparent 38%), linear-gradient(150deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.76));
    box-shadow: var(--shadow-soft);
    transition: transform 180ms ease, border-color 180ms ease;
}

.collection-card-poster {
    position: absolute;
    inset: 0;
    z-index: -3;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.72;
    transform: scale(1.02);
    transition: transform 420ms ease, opacity 220ms ease;
}

.collection-card-shade {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.8) 64%, rgba(2, 6, 23, 0.95)),
        linear-gradient(90deg, rgba(2, 6, 23, 0.6), rgba(2, 6, 23, 0.1) 58%);
}

.collection-card::before {
    content: "→";
    position: absolute;
    top: 0.9rem;
    right: 1rem;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.38);
    color: rgba(224, 242, 254, 0.92);
    font-size: 1rem;
    font-weight: 800;
}

.collection-card:hover {
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, 0.42);
}

.collection-card:hover .collection-card-poster {
    opacity: 0.9;
    transform: scale(1.08);
}

.collection-count {
    position: absolute;
    top: 0.9rem;
    left: 1rem;
    z-index: 1;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.55);
    color: rgba(224, 242, 254, 0.88);
    font-size: 0.72rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

.collection-name {
    color: white;
    font-family: "Outfit", sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.1;
    text-shadow: 0 2px 18px rgba(2, 6, 23, 0.75);
}

.collection-copy {
    margin-top: 0.35rem;
    color: rgba(226, 232, 240, 0.8);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 2px 14px rgba(2, 6, 23, 0.78);
}

.poster-fallback {
    opacity: 1 !important;
    background:
        radial-gradient(circle at 50% 40%, rgba(56, 189, 248, 0.14), transparent 60%),
        linear-gradient(160deg, rgba(15, 23, 42, 0.99), rgba(30, 41, 59, 0.95)) !important;
}

.poster-fallback::after {
    content: "\1F3AC";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: clamp(1.6rem, 6vw, 3rem);
    opacity: 0.55;
}
