/* ============================================================
   What Will We Watch — modern cinematic theme
   ============================================================ */

:root {
    --bg: #07070e;
    --surface: #11111c;
    --surface-2: #14141f;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-strong: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.1);
    --text: #f3f3fa;
    --text-dim: #a3a3bd;
    --violet: #8a8ff8;
    --amber: #ffb454;
    --grad-violet: linear-gradient(135deg, #7b84db, #a06bff);
    --grad-amber: linear-gradient(135deg, #ffb454, #ff8e3c);
    --radius: 18px;
    --radius-sm: 12px;
    --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* Keeps the footer pinned to the bottom when content is short. */
main {
    flex: 1;
}

body.intro-active,
body.modal-open,
body.drawer-open {
    overflow: hidden;
}

::selection {
    background: var(--violet);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--violet);
    outline-offset: 2px;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 5px;
}

button {
    font-family: inherit;
}

/* ============================================================
   Ambient background
   ============================================================ */

.bg-glow {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
}

.glow-violet {
    width: 60vmax;
    height: 60vmax;
    top: -25%;
    left: -15%;
    background: #5d63e8;
    opacity: 0.18;
    animation: drift 20s ease-in-out infinite alternate;
}

.glow-amber {
    width: 50vmax;
    height: 50vmax;
    bottom: -30%;
    right: -18%;
    background: #ff8e3c;
    opacity: 0.1;
    animation: drift 26s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
    to {
        transform: translate(5%, 7%) scale(1.1);
    }
}

/* ============================================================
   Intro — WWWW morphs into What Will We Watch?
   ============================================================ */

.intro {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: var(--bg);
    cursor: pointer;
    transition: opacity 0.65s ease, transform 0.65s ease, filter 0.65s ease;
}

.intro-out {
    opacity: 0;
    transform: scale(1.06);
    filter: blur(6px);
    pointer-events: none;
}

.intro-words {
    font-size: clamp(1.5rem, 4.6vw, 4.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
    color: var(--violet);
    text-shadow: 0 0 40px rgba(138, 143, 248, 0.45);
}

.intro-word {
    display: inline-block;
    opacity: 0;
    animation: intro-w 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(var(--i) * 0.1s);
}

@keyframes intro-w {
    from {
        opacity: 0;
        transform: translateY(24px);
        filter: blur(8px);
    }

    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

.intro-rest {
    display: inline-block;
    vertical-align: bottom;
    overflow: hidden;
    white-space: nowrap;
    max-width: 0;
    opacity: 0;
    color: var(--text);
    text-shadow: none;
    animation: intro-rest 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--d);
}

@keyframes intro-rest {
    to {
        max-width: 7ch;
        opacity: 1;
    }
}

.intro-skip {
    position: absolute;
    bottom: 2.2rem;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    opacity: 0;
    animation: intro-skip 0.8s ease 2.1s forwards;
}

@keyframes intro-skip {
    to {
        opacity: 0.7;
    }
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.2rem;
    background: rgba(7, 7, 14, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    background: none;
    border: none;
    padding: 0.2rem 0;
    cursor: pointer;
    color: var(--text);
}

.brand-mark {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    background: var(--grad-violet);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dim);
}

.advanced-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.05rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.advanced-btn:hover {
    border-color: var(--violet);
    background: rgba(138, 143, 248, 0.12);
    box-shadow: 0 0 18px rgba(138, 143, 248, 0.25);
}

/* ============================================================
   Chat
   ============================================================ */

.chat-section {
    padding: 2rem 1rem 3.5rem;
}

.chat {
    max-width: 660px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.msg {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    animation: pop-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.msg.user {
    justify-content: flex-end;
}

.avatar {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    background: var(--grad-violet);
    box-shadow: 0 4px 16px rgba(123, 132, 219, 0.4);
}

.bubble {
    max-width: 80%;
    padding: 0.8rem 1.1rem;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 0.98rem;
}

.msg.bot .bubble {
    background: var(--glass-strong);
    border: 1px solid var(--border);
    border-bottom-left-radius: 6px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.msg.user .bubble {
    background: var(--grad-violet);
    color: #fff;
    font-weight: 600;
    border-bottom-right-radius: 6px;
}

@keyframes pop-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Typing indicator */

.dots {
    display: inline-flex;
    gap: 5px;
    padding: 0.2rem 0;
}

.dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-dim);
    animation: typing 1.1s ease-in-out infinite;
}

.dots i:nth-child(2) {
    animation-delay: 0.15s;
}

.dots i:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: none;
        opacity: 0.4;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Choice chips */

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-left: 44px;
    animation: pop-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.18s, border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.chip:hover {
    transform: translateY(-2px);
    border-color: var(--violet);
    background: rgba(138, 143, 248, 0.12);
    box-shadow: 0 4px 18px rgba(138, 143, 248, 0.25);
}

.chip-emoji {
    font-size: 1.05rem;
}

.chip-primary {
    background: var(--grad-amber);
    border: none;
    color: #221302;
    font-weight: 700;
}

.chip-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.chat-select {
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: 0.92rem;
    max-width: 100%;
}

.country-pick {
    align-items: center;
}

/* ============================================================
   Results
   ============================================================ */

.results-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.5rem 1.2rem 3.5rem;
}

.results-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.results-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.summary-pill {
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(138, 143, 248, 0.35);
    background: rgba(138, 143, 248, 0.1);
    color: #c3c6ff;
    font-size: 0.8rem;
    font-weight: 600;
}

.results-count {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 1.1rem;
}

.movie-card {
    cursor: pointer;
    border-radius: 14px;
}

.poster-wrap {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover .poster-wrap,
.movie-card:focus-visible .poster-wrap {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(138, 143, 248, 0.35);
}

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

.poster-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem;
    text-align: center;
    color: var(--text-dim);
    font-weight: 600;
}

.poster-fallback span {
    font-size: 2.2rem;
}

.rating-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--amber);
    font-size: 0.78rem;
    font-weight: 700;
}

.card-shade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 55%;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.92));
}

.card-meta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.75rem 0.8rem;
}

.card-meta h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
}

.card-meta span {
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* Loading skeletons */

.skeleton .poster-wrap {
    background: linear-gradient(100deg, #14141f 40%, #1e1e2d 50%, #14141f 60%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

/* Empty / error state */

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--text-dim);
}

.empty-emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.8rem;
}

.empty-state h3 {
    color: var(--text);
    margin: 0 0 0.4rem;
}

.empty-state p {
    margin: 0;
}

/* Load more */

.load-more-wrap {
    text-align: center;
    margin-top: 2rem;
}

.load-more {
    padding: 0.8rem 2.4rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.load-more:hover:not(:disabled) {
    border-color: var(--violet);
    background: rgba(138, 143, 248, 0.12);
    box-shadow: 0 0 18px rgba(138, 143, 248, 0.25);
}

.load-more:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 0.6rem 1rem;
}

.footer-inner {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.3rem 1.2rem;
    text-align: center;
}

.tmdb-logo {
    width: 60px;
    display: block;
}

.footer-inner p {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.72rem;
    line-height: 1.5;
}

.footer-contact {
    color: var(--violet);
    font-size: 0.75rem;
    text-decoration: none;
}

.footer-contact:hover {
    text-decoration: underline;
}

/* ============================================================
   Movie detail modal
   ============================================================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    place-items: center;
    padding: 1.2rem;
    background: rgba(4, 4, 10, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow-y: auto;
}

.modal.open {
    display: grid;
    animation: fade-in 0.25s ease;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
}

.modal-content {
    position: relative;
    width: min(860px, 100%);
    margin: auto;
    background: #0e0e19;
    border: 1px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    animation: slide-up 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(26px);
    }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.55);
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--violet);
}

.modal-loading {
    min-height: 320px;
    display: grid;
    place-items: center;
    color: var(--text-dim);
}

.spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--violet);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.modal-hero {
    position: relative;
    aspect-ratio: 16 / 7.5;
    background: #000;
}

.modal-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
}

.modal-hero iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.play-trailer {
    position: absolute;
    inset: 0;
    margin: auto;
    width: fit-content;
    height: fit-content;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.7rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, color 0.2s;
}

.play-trailer:hover {
    transform: scale(1.06);
    background: var(--amber);
    color: #221302;
}

.play-icon {
    font-size: 0.85rem;
}

.modal-body {
    padding: 0 1.6rem 2rem;
}

.modal-head {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    gap: 1.2rem;
    margin-top: -4.5rem;
}

.modal-poster {
    width: 132px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}

.modal-title-block h2 {
    margin: 0 0 0.2rem;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    line-height: 1.15;
}

.tagline {
    margin: 0.1rem 0;
    font-style: italic;
    color: var(--text-dim);
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem;
    margin: 0.45rem 0 0;
    color: var(--text-dim);
    font-size: 0.92rem;
}

.dot {
    margin: 0 0.4rem;
}

.cert-badge {
    padding: 0.05rem 0.45rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.78rem;
    color: var(--text);
}

.modal-rating {
    color: var(--amber);
    font-weight: 700;
}

.vote-count {
    font-size: 0.8rem;
}

.genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.7rem 0 0;
}

.genre-tag {
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: rgba(138, 143, 248, 0.12);
    border: 1px solid rgba(138, 143, 248, 0.3);
    color: #c3c6ff;
    font-size: 0.78rem;
    font-weight: 600;
}

.director {
    margin: 0.6rem 0 0;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.modal-section {
    margin-top: 1.6rem;
}

.modal-section h4 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.7rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
}

.region-tag {
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text);
    font-size: 0.75rem;
    text-transform: none;
    letter-spacing: normal;
}

.overview {
    margin: 0;
    line-height: 1.7;
    color: #d6d6e4;
}

.modal-hint {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Cast strip */

.cast-strip {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.cast-card {
    flex: none;
    width: 92px;
    margin: 0;
    text-align: center;
}

.cast-photo {
    width: 92px;
    height: 118px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-2);
    display: grid;
    place-items: center;
}

.cast-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cast-fallback {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dim);
}

.cast-card strong {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.78rem;
    line-height: 1.25;
}

.cast-card figcaption span {
    display: block;
    color: var(--text-dim);
    font-size: 0.72rem;
    line-height: 1.3;
}

/* Where to watch */

.provider-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 0.7rem;
}

.provider-label {
    flex: none;
    width: 56px;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 600;
}

.provider-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.provider img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: block;
}

.justwatch-link {
    display: inline-block;
    margin-top: 0.3rem;
    color: var(--violet);
    font-size: 0.85rem;
    text-decoration: none;
}

.justwatch-link:hover {
    text-decoration: underline;
}

.attribution-note {
    margin: 0.6rem 0 0;
    color: var(--text-dim);
    font-size: 0.7rem;
    opacity: 0.7;
}

/* ============================================================
   Advanced search drawer
   ============================================================ */

.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(4, 4, 10, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 85;
    width: min(440px, 100%);
    display: flex;
    flex-direction: column;
    background: rgba(12, 12, 22, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--border);
    transform: translateX(105%);
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.drawer.open {
    transform: none;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.3rem;
    border-bottom: 1px solid var(--border);
}

.drawer-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.drawer-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s;
}

.drawer-close:hover {
    background: var(--violet);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.3rem;
    display: grid;
    gap: 1.7rem;
    align-content: start;
}

.drawer-section h3 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0 0 0.7rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
}

.section-hint {
    font-weight: 400;
    font-size: 0.75rem;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-dim);
    opacity: 0.85;
}

.value-tag {
    margin-left: auto;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    background: rgba(138, 143, 248, 0.12);
    border: 1px solid rgba(138, 143, 248, 0.3);
    color: #c3c6ff;
    font-size: 0.78rem;
    text-transform: none;
    letter-spacing: normal;
}

.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

#matchChips {
    margin-top: 0.7rem;
}

.genre-chip,
.group-chip {
    padding: 0.42rem 0.85rem;
    font-size: 0.85rem;
}

.genre-chip.include,
.group-chip.on {
    background: var(--grad-violet);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

.genre-chip.exclude {
    background: rgba(255, 92, 92, 0.12);
    border-color: rgba(255, 92, 92, 0.55);
    color: #ff8a8a;
    text-decoration: line-through;
}

/* Dual-handle year slider */

.range-pair {
    position: relative;
    height: 28px;
}

.range-track {
    position: absolute;
    top: 50%;
    left: 10px;
    right: 10px;
    height: 6px;
    transform: translateY(-50%);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.range-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: 3px;
    background: var(--grad-violet);
}

.range-pair input[type="range"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 28px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    pointer-events: none;
}

.range-pair input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--violet);
    border: 3px solid #0c0c16;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    cursor: grab;
}

.range-pair input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--violet);
    border: 3px solid #0c0c16;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    cursor: grab;
}

.range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 0.3rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Single sliders */

.single-range {
    width: 100%;
    height: 6px;
    margin: 0.6rem 0 0.2rem;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--violet) var(--fill, 0%), rgba(255, 255, 255, 0.1) var(--fill, 0%));
    cursor: pointer;
}

.single-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--violet);
    border: 3px solid #0c0c16;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.single-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--violet);
    border: 3px solid #0c0c16;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Selects & inputs */

.drawer-select,
.drawer-input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: 0.92rem;
}

.drawer-select:focus,
.drawer-input:focus {
    outline: none;
    border-color: var(--violet);
}

/* Streaming provider chips */

.provider-hint {
    margin: 0.5rem 0 0.7rem;
    display: block;
}

.provider-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.provider-chip {
    padding: 3px;
    border: 2px solid transparent;
    border-radius: 13px;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.provider-chip img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: block;
    opacity: 0.55;
    transition: opacity 0.2s;
}

.provider-chip:hover img {
    opacity: 0.85;
}

.provider-chip.on {
    border-color: var(--amber);
    box-shadow: 0 0 14px rgba(255, 180, 84, 0.35);
}

.provider-chip.on img {
    opacity: 1;
}

.provider-loading {
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* People search */

.person-search {
    position: relative;
}

.person-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 10;
    max-height: 280px;
    overflow-y: auto;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.person-results:empty {
    display: none;
}

.person-result {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.55rem 0.8rem;
    border: 0;
    background: none;
    color: var(--text);
    text-align: left;
    font-size: 0.9rem;
    cursor: pointer;
}

.person-result:hover {
    background: rgba(255, 255, 255, 0.06);
}

.person-result img,
.person-fallback {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.person-fallback {
    display: grid;
    place-items: center;
    background: var(--glass-strong);
    color: var(--text-dim);
    font-weight: 700;
}

.person-name {
    font-weight: 600;
}

.person-dept {
    margin-left: auto;
    color: var(--text-dim);
    font-size: 0.75rem;
}

#personChips {
    margin-top: 0.6rem;
}

.person-chip {
    cursor: default;
}

.person-chip:hover {
    transform: none;
    box-shadow: none;
}

.chip-remove {
    border: none;
    background: none;
    padding: 0 0 0 0.15rem;
    color: var(--text-dim);
    font-size: 0.8rem;
    cursor: pointer;
}

.chip-remove:hover {
    color: #ff8a8a;
}

/* Drawer footer */

.drawer-footer {
    display: flex;
    gap: 0.8rem;
    padding: 1rem 1.3rem;
    border-top: 1px solid var(--border);
}

.drawer-reset {
    flex: none;
    padding: 0.8rem 1.3rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text-dim);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.drawer-reset:hover {
    color: var(--text);
    border-color: var(--violet);
}

.drawer-apply {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--grad-amber);
    color: #221302;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: filter 0.2s, transform 0.2s;
}

.drawer-apply:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 640px) {
    .brand-name {
        display: none;
    }

    .chip-row {
        padding-left: 0;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
        gap: 0.7rem;
    }

    .modal-content {
        border-radius: 16px;
    }

    .modal-body {
        padding: 0 1.1rem 1.6rem;
    }

    .modal-head {
        margin-top: -3rem;
    }

    .modal-poster {
        width: 96px;
    }

    .bubble {
        max-width: 88%;
    }
}

@media (max-width: 640px) {
    .advanced-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.85rem;
    }
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
