:root {
    --bg: #090b10;
    --surface: #11151d;
    --surface-2: #171c26;
    --text: #f5f7fb;
    --muted: #9ca7ba;
    --accent: #f59e0b;
    --border: rgba(255,255,255,.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }

.container {
    width: 100%;
    max-width: none;
    padding-inline: 24px;
    margin-inline: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--border);
    background: rgba(9,11,16,.94);
    backdrop-filter: blur(12px);
}

.nav {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    color: var(--text);
    text-decoration: none;
    font-weight: 900;
    letter-spacing: 1.5px;
    font-size: 21px;
}

.logo-svg {
    display: block;
    width: 195px;
    height: 41px;
}

.logo span { color: var(--accent); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 10px;
}

.nav-link.active { color: var(--accent); }

.filter-bar {
    position: relative;
    z-index: 15;
    border-bottom: 1px solid var(--border);
    background: #0d1119;
}

.filter-inner {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-trigger {
    min-height: 38px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    padding: 8px 14px;
}

.filter-trigger:hover,
.filter-trigger.active {
    background: var(--surface-2);
    color: var(--accent);
}

.chevron { margin-left: 4px; color: var(--muted); }

.filter-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 24px;
    width: min(760px, calc(100% - 48px));
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #171c26;
    box-shadow: 0 16px 36px rgba(0,0,0,.55);
    padding: 14px;
}

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

.filter-option {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 8px 10px;
}

.filter-option:hover,
.filter-option.active {
    background: var(--accent);
    color: #111;
}

.search {
    margin-left: auto;
    width: min(420px, 45vw);
    display: flex;
    position: relative;
}

.search input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--border);
    border-right: 0;
    border-radius: 8px 0 0 8px;
    background: var(--surface);
    color: var(--text);
    padding: 0 14px;
    outline: none;
}

.search input:focus { border-color: var(--accent); }

.search > button[type="submit"] {
    width: 48px;
    border: 0;
    border-radius: 0 8px 8px 0;
    background: var(--accent);
    color: #111;
    font-weight: 800;
}

.search-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 30;
    width: min(520px, calc(100vw - 40px));
    min-width: 420px;
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 10px;
    background: #11151d;
    color: #f5f7fb;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .65);
}

.search-suggestions.open { display: block; }

.suggestion-item {
    width: 100%;
    min-height: 96px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: #11151d;
    color: #ffffff;
    text-align: left;
    padding: 10px 12px;
    overflow: hidden;
}

.suggestion-content {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.suggestion-item:last-child { border-bottom: 0; }
.suggestion-item:hover, .suggestion-item.active { background: var(--surface-2); }

.suggestion-item img {
    flex: 0 0 64px;
    width: 64px;
    height: 68px;
    border-radius: 6px;
    object-fit: cover;
    background: #171c26;
}

.suggestion-name {
    display: block;
    width: 100%;
    max-width: 100%;
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-meta {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-top: 4px;
    color: #b7c0cf;
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 680px) {
    .search-suggestions {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
}

.catalog { min-height: 70vh; padding-block: 28px 50px; }

.home-sections {
    display: grid;
    gap: 24px;
}

.home-loading {
    min-height: 300px;
    display: grid;
    place-items: center;
}

.home-row {
    display: grid;
    grid-template-columns: clamp(150px, 12vw, 180px) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.home-row-title {
    min-height: 150px;
    border: 0;
    background: transparent;
    color: var(--row-accent);
    padding: 12px 8px 12px 0;
    text-align: left;
}

.home-row-title span {
    display: block;
    max-width: 140px;
    font-size: clamp(22px, 2vw, 30px);
    font-weight: 900;
    line-height: 1.05;
}

.home-row-title small {
    display: block;
    margin-top: 18px;
    color: var(--text);
    font-size: 13px;
}

.home-row-content {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 8px;
    align-items: center;
}

.home-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 84px) / 8);
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.home-rail::-webkit-scrollbar { display: none; }

.rail-card {
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    padding: 0;
    text-align: left;
    scroll-snap-align: start;
}

.home-rail > .rail-card,
.grid > .movie-card {
    position: relative;
    z-index: 1;
    transition: transform .4s ease, filter .4s ease, opacity .4s ease;
    will-change: transform, filter;
}

.home-rail > .rail-card:hover,
.grid > .movie-card:hover,
.home-rail > .rail-card.preview-active,
.grid > .movie-card.preview-active {
    z-index: 2;
    transform: scale(1.06);
}

.rail-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 9px;
    background: var(--surface-2);
}

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

.rail-name {
    margin-top: 8px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rail-original {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rail-button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #fff;
    color: #111;
    font-size: 24px;
    line-height: 28px;
}

.toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.advanced-filter-toggle {
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    padding: 8px 13px;
}

.advanced-filter-toggle span {
    display: inline-block;
    margin-right: 5px;
    transition: transform .2s;
}

.advanced-filter-toggle[aria-expanded="true"] span {
    transform: rotate(180deg);
}

.mood-btn {
    height: 38px;
    border: 1px solid rgba(255, 196, 120, .42);
    border-radius: 999px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #ff2a5f, #ff7b00);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .32),
        0 8px 22px rgba(255, 123, 0, .22);
    backdrop-filter: blur(14px) saturate(145%);
    -webkit-backdrop-filter: blur(14px) saturate(145%);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.mood-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .42),
        0 12px 28px rgba(255, 123, 0, .32);
}

.mood-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(5, 9, 18, .68);
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
}

.mood-modal[hidden] {
    display: none;
}

.mood-card {
    position: relative;
    width: min(620px, 100%);
    max-height: min(90vh, 820px);
    overflow: auto;
    padding: 24px;
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(32, 44, 70, .92), rgba(15, 21, 36, .88));
    color: #fff;
    box-shadow:
        inset 0 1px 0 var(--glass-highlight),
        0 28px 70px rgba(2, 6, 15, .48);
    backdrop-filter: blur(26px) saturate(160%);
    -webkit-backdrop-filter: blur(26px) saturate(160%);
}

.mood-card h2 {
    margin: 0 34px 6px 0;
}

.mood-sub,
.mood-reason {
    color: #bdc5d3;
}

.mood-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: rgba(31, 43, 68, .72);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mood-step {
    margin-top: 16px;
}

.mood-options,
.mood-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mood-options {
    margin-top: 8px;
}

.mood-option,
.mood-actions button {
    min-height: 38px;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: rgba(31, 43, 68, .72);
    color: #fff;
    padding: 8px 14px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mood-option.active {
    border-color: rgba(255, 255, 255, .28);
    background: linear-gradient(135deg, rgba(113, 183, 255, .92), rgba(184, 156, 255, .92));
    color: #07101d;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .38),
        0 8px 22px rgba(113, 183, 255, .18);
}

.mood-results {
    margin-top: 18px;
}

.mood-pick {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(31, 43, 68, .72), rgba(15, 21, 36, .58));
    color: #fff;
    text-align: left;
    cursor: pointer;
    box-shadow: inset 0 1px 0 var(--glass-highlight);
    backdrop-filter: blur(14px) saturate(145%);
    -webkit-backdrop-filter: blur(14px) saturate(145%);
}

.mood-pick img {
    width: 64px;
    height: 88px;
    flex: 0 0 64px;
    border-radius: 8px;
    object-fit: cover;
}

.mood-pick span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mood-pick strong {
    margin-bottom: 5px;
}

.mood-pick small {
    color: #bdc5d3;
}

.mood-actions {
    margin-top: 14px;
}

.mood-actions button:not([hidden]) {
    border-color: var(--glass-border);
    background: rgba(31, 43, 68, .72);
    box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.roulette-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 12px 0;
}

.roulette-filters label {
    flex: 1 1 180px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

.roulette-filters select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(31, 43, 68, .72);
    color: #fff;
    padding: 8px 10px;
    outline: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.roulette-filters select:focus {
    border-color: rgba(113, 183, 255, .72);
    box-shadow: 0 0 0 3px rgba(113, 183, 255, .12);
}

.roulette-stage {
    min-height: 260px;
    padding: 16px 0;
    text-align: center;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(31, 43, 68, .48), rgba(15, 21, 36, .38));
    box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.roulette-stage strong,
.roulette-stage small {
    display: block;
}

.roulette-stage strong {
    margin-bottom: 5px;
}

.roulette-stage small {
    color: #bdc5d3;
}

.roulette-poster {
    width: 160px;
    height: 220px;
    margin: 0 auto 12px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: rgba(31, 43, 68, .72);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 48px;
    box-shadow:
        inset 0 1px 0 var(--glass-highlight),
        0 18px 36px rgba(3, 8, 20, .28);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

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

.roulette-poster.spinning img {
    filter: blur(1px) brightness(1.2);
    transform: scale(1.03);
}

#rouletteSpin {
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 999px;
    background: linear-gradient(135deg, #83c6ff, #b7a1ff);
    color: #07101d;
    padding: 12px 28px;
    font-weight: 800;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .48),
        0 8px 24px rgba(99, 158, 255, .24);
}

#rouletteSpin:disabled {
    cursor: wait;
    opacity: .65;
}

#rouletteWatch {
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(210, 225, 255, .88));
    color: #07101d;
    padding: 12px 20px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 1px 0 #fff;
}

.advanced-filter-panel {
    margin: -4px 0 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    padding: 16px;
}

.advanced-filter-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    align-items: start;
    padding: 7px 0;
}

.advanced-filter-row strong {
    padding-top: 7px;
}

.advanced-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.advanced-option {
    min-height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    padding: 6px 10px;
}

.advanced-option:hover,
.advanced-option.active {
    background: #f59e0b;
    color: #111;
}

.advanced-filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.advanced-submit,
.advanced-close {
    min-height: 40px;
    border: 0;
    border-radius: 999px;
    padding: 8px 18px;
}

.advanced-submit {
    background: #f59e0b;
    color: #111;
    font-weight: 800;
}

.advanced-close {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(22px, 3vw, 32px); }

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

.tab {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    border-radius: 999px;
    padding: 8px 13px;
}

.tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #111;
    font-weight: 800;
}

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

.movie-card {
    min-width: 0;
    border: 0;
    background: none;
    color: inherit;
    text-align: left;
    padding: 0;
}

.poster {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

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

.movie-card:hover img { transform: scale(1.04); }

.movie-hover-preview {
    position: fixed;
    z-index: 40;
    width: 320px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(32, 44, 70, .96), rgba(15, 21, 36, .94));
    box-shadow:
        inset 0 1px 0 var(--glass-highlight),
        0 18px 45px rgba(3, 8, 20, .5);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(.82);
    transform-origin: center;
    transition: opacity .36s ease, transform .4s cubic-bezier(.2, .8, .2, 1);
}

.movie-hover-preview.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.movie-hover-preview.grid-preview {
    display: flex;
    flex-direction: column;
}

.movie-hover-preview.grid-preview .movie-hover-preview-poster {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
}

.movie-hover-preview-poster {
    display: block;
    width: 100%;
    height: 170px;
    object-fit: cover;
    background: var(--surface-2);
}

.movie-hover-preview-body {
    display: grid;
    gap: 7px;
    padding: 14px;
}

.movie-hover-preview-body strong {
    font-size: 16px;
    line-height: 1.25;
}

.movie-hover-preview-original {
    color: var(--accent);
    font-size: 13px;
}

.movie-hover-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}

.movie-hover-preview-meta span {
    padding: 4px 7px;
    border: 1px solid var(--glass-border);
    border-radius: 5px;
    background: rgba(31, 43, 68, .72);
}

.quality {
    position: absolute;
    left: 8px;
    top: 8px;
    background: var(--accent);
    color: #111;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 7px;
    border-radius: 5px;
}

.episode {
    position: absolute;
    right: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
    background: rgba(0,0,0,.82);
    border-radius: 5px;
    padding: 4px 7px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-name {
    margin: 9px 2px 2px;
    font-weight: 750;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-year { margin: 0 2px; color: var(--muted); font-size: 13px; }

.status {
    min-height: 220px;
    display: grid;
    place-items: center;
    color: var(--muted);
    text-align: center;
}

.spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

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

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
}

.page-btn {
    height: 40px;
    min-width: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

.page-btn.primary {
    background: var(--accent);
    color: #111;
    border-color: var(--accent);
    font-weight: 800;
}

.page-btn:disabled { opacity: .35; cursor: not-allowed; }

.site-footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
}

.footer-inner {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-inner p { margin: 0; }

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    background: rgba(0,0,0,.82);
    overflow-y: auto;
    padding: 18px;
}

.modal.open { display: block; }

.modal-shell {
    width: min(1120px, 100%);
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.modal-head {
    height: 52px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding: 0 14px 0 18px;
}

.modal-title {
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text);
    font-size: 20px;
}

.player { position: relative; aspect-ratio: 16/9; background: #000; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.details {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 18px;
    padding: 18px;
    border-bottom: 1px solid var(--border);
}

.details img {
    width: 150px;
    border-radius: 8px;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.meta { color: var(--muted); line-height: 1.7; }
.meta strong { color: var(--text); }
.description { margin-top: 8px; max-height: 90px; overflow-y: auto; color: #cbd3df; }

.episode-panel { padding: 18px; }
.server-row { margin-bottom: 16px; }
.server-name { color: var(--accent); font-weight: 800; margin-bottom: 8px; }

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px,1fr));
    gap: 7px;
}

.episode-btn {
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--text);
}

.episode-btn.active {
    background: var(--accent);
    color: #111;
    border-color: var(--accent);
    font-weight: 900;
}

@media (max-width: 900px) {
    .grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
    .home-row { grid-template-columns: 120px minmax(0, 1fr); }
    .home-rail { grid-auto-columns: calc((100% - 36px) / 4); }
}

@media (max-width: 680px) {
    .movie-hover-preview {
        width: calc(100vw - 24px);
    }

    .container {
        width: 100%;
        padding-inline: 10px;
    }
    .nav { min-height: 68px; flex-wrap: wrap; gap: 8px 12px; padding: 10px 0; }
    .nav-links { display: none; }
    .search { order: 3; width: 100%; }
    .filter-inner {
        overflow-x: auto;
        min-height: 50px;
    }
    .filter-trigger {
        flex: 0 0 auto;
        padding-inline: 10px;
    }
    .filter-dropdown {
        top: calc(100% + 6px);
        max-height: 55vh;
    }
    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px 8px; }
    .toolbar { align-items: start; flex-direction: column; }
    .toolbar-actions { width: 100%; }
    .filter-tabs { width: 100%; overflow-x: auto; }
    .advanced-filter-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .advanced-filter-row strong {
        padding-top: 4px;
    }
    .details { grid-template-columns: 92px 1fr; gap: 12px; }
    .details img { width: 92px; }
    .modal { padding: 0; }
    .modal-shell { border: 0; border-radius: 0; min-height: 100%; }
    .footer-inner { flex-direction: column; justify-content: center; text-align: center; }
    .home-row { grid-template-columns: 1fr; gap: 8px; }
    .home-row-title { min-height: 0; padding: 4px 0; }
    .home-row-title span { max-width: none; }
    .home-row-title small { margin-top: 6px; }
    .home-row-content { grid-template-columns: minmax(0,1fr); }
    .rail-button { display: none; }
    .home-rail { grid-auto-columns: calc((100% - 12px) / 2); }
}

@media (max-width: 420px) {
    .grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* Liquid glass theme */
:root {
    --glass-bg: rgba(19, 28, 46, .62);
    --glass-bg-strong: rgba(24, 34, 56, .78);
    --glass-border: rgba(190, 220, 255, .16);
    --glass-highlight: rgba(255, 255, 255, .14);
    --accent: #71b7ff;
    --accent-2: #b89cff;
}

body {
    background:
        radial-gradient(circle at 12% 8%, rgba(70, 120, 255, .19), transparent 26rem),
        radial-gradient(circle at 88% 18%, rgba(185, 101, 255, .14), transparent 24rem),
        radial-gradient(circle at 50% 100%, rgba(37, 185, 220, .09), transparent 32rem),
        #090d16;
    background-attachment: fixed;
}

.site-header,
.filter-bar {
    background: rgba(11, 17, 31, .72);
    border-color: var(--glass-border);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    box-shadow: 0 10px 30px rgba(5, 9, 18, .18);
}

.nav,
.filter-inner {
    text-shadow: 0 1px 12px rgba(120, 180, 255, .12);
}

.logo span { color: #8bc5ff; }

.search,
.filter-dropdown,
.advanced-filter-panel,
.site-footer,
.rail-poster,
.poster,
.player,
.episode-panel,
.movie-info,
.related-panel,
.modal-shell {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow:
        inset 0 1px 0 var(--glass-highlight),
        0 18px 45px rgba(3, 8, 20, .24);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.search input,
.filter-dropdown,
.advanced-filter-panel,
.episode-panel,
.movie-info,
.related-panel,
.modal-shell {
    background: linear-gradient(145deg, rgba(32, 44, 70, .72), rgba(15, 21, 36, .66));
}

.filter-dropdown {
    background: linear-gradient(145deg, rgba(32, 44, 70, .92), rgba(15, 21, 36, .88));
}

.search input {
    background: rgba(12, 18, 32, .66);
    border-color: var(--glass-border);
}

.search-suggestions {
    background: linear-gradient(145deg, rgba(29, 42, 68, .96), rgba(12, 18, 32, .94));
    border: 1px solid var(--glass-border);
    box-shadow:
        inset 0 1px 0 var(--glass-highlight),
        0 24px 55px rgba(2, 6, 15, .48);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
}

.suggestion-item,
.filter-option,
.advanced-option,
.page-btn,
.episode-btn,
.tab,
.filter-trigger,
.advanced-filter-toggle {
    border-color: var(--glass-border);
}

.suggestion-item,
.episode-btn,
.tab,
.page-btn {
    background: rgba(31, 43, 68, .72);
}

.suggestion-item:hover,
.suggestion-item.active,
.filter-option:hover,
.filter-option.active,
.advanced-option:hover,
.advanced-option.active,
.tab.active,
.episode-btn.active,
.page-btn.primary {
    background: linear-gradient(135deg, rgba(113, 183, 255, .92), rgba(184, 156, 255, .92));
    color: #07101d;
    border-color: rgba(255, 255, 255, .28);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .38),
        0 8px 22px rgba(113, 183, 255, .18);
}

.search > button[type="submit"],
.advanced-submit,
.rail-button {
    background: linear-gradient(135deg, #83c6ff, #b7a1ff);
    color: #08101c;
    border: 1px solid rgba(255, 255, 255, .26);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .48),
        0 8px 24px rgba(99, 158, 255, .24);
}

.filter-trigger.active,
.filter-trigger:hover,
.advanced-filter-toggle,
.nav-link.active {
    color: #a8d4ff;
}

.poster,
.rail-poster {
    border-radius: 12px;
    overflow: hidden;
}

.poster::after,
.rail-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,.10), transparent 42%);
}

.poster img,
.rail-poster img {
    transition: transform .35s ease, filter .35s ease;
}

.movie-card:hover .poster,
.rail-card:hover .rail-poster {
    border-color: rgba(176, 215, 255, .38);
    box-shadow: 0 16px 34px rgba(70, 130, 210, .16);
}

.movie-card:hover .poster img,
.rail-card:hover .rail-poster img {
    filter: saturate(1.08) brightness(1.04);
    transform: scale(1.035);
}

.quality,
.episode {
    border: 1px solid rgba(255,255,255,.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.quality {
    background: linear-gradient(135deg, rgba(113,183,255,.94), rgba(184,156,255,.94));
    color: #07101d;
}

.episode {
    background: rgba(7, 11, 22, .72);
}

.advanced-filter-panel,
.filter-dropdown {
    box-shadow:
        inset 0 1px 0 var(--glass-highlight),
        0 24px 60px rgba(2, 6, 15, .42);
}

.site-footer {
    background: rgba(10, 15, 28, .48);
}

@media (max-width: 680px) {
    .toolbar-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mood-btn,
    .advanced-filter-toggle {
        width: 100%;
        min-height: 42px;
        justify-content: center;
    }

    .mood-btn {
        padding-inline: 10px;
        white-space: normal;
    }

    .filter-tabs {
        grid-column: 1 / -1;
    }

    .mood-modal {
        align-items: flex-end;
        padding: 0;
    }

    .mood-card {
        width: 100%;
        max-height: 92dvh;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 22px 22px 0 0;
        padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    }

    .mood-card h2 {
        padding-right: 42px;
        font-size: 21px;
    }

    .mood-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mood-option {
        width: 100%;
        min-height: 44px;
        padding-inline: 8px;
        line-height: 1.2;
    }

    .mood-pick {
        min-height: 82px;
    }

    .mood-pick img {
        width: 58px;
        height: 80px;
        flex-basis: 58px;
    }

    .mood-actions {
        position: sticky;
        bottom: calc(-1 * env(safe-area-inset-bottom));
        z-index: 2;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-inline: -16px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--glass-border);
        background: rgba(12, 18, 32, .82);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .mood-actions button {
        width: 100%;
        min-height: 44px;
    }

    .roulette-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .roulette-filters label {
        min-width: 0;
    }

    .roulette-stage {
        min-height: 244px;
        padding: 12px 8px;
    }

    .roulette-poster {
        width: 138px;
        height: 190px;
    }

    #rouletteSpin,
    #rouletteWatch {
        width: 100%;
        padding-inline: 10px;
    }
}

@media (max-width: 420px) {
    .roulette-filters,
    .mood-options,
    .mood-actions {
        grid-template-columns: 1fr;
    }

    .mood-actions {
        position: static;
        margin-inline: 0;
        padding: 12px 0 0;
        border-top: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .mood-card {
        max-height: 94dvh;
    }
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
