/* =====================================================================
   ORVIX - Design system
   Dark cinematic streaming interface. No build step, no frameworks.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Tokens
   ------------------------------------------------------------------- */
:root {
    /* Surfaces */
    --bg:            #07080c;
    --bg-soft:       #0a0c12;
    --surface:       #101320;
    --surface-2:     #161a29;
    --surface-3:     #1e2334;
    --line:          rgba(255, 255, 255, .075);
    --line-strong:   rgba(255, 255, 255, .14);

    /* Text */
    --text:          #eef1f8;
    --text-dim:      #b3bbcd;
    --muted:         #8c94a8;
    --faint:         #5d6478;

    /* Brand */
    --brand:         #7c6cff;
    --brand-2:       #b06cff;
    --brand-3:       #4fd8e6;
    --brand-soft:    rgba(124, 108, 255, .14);
    --brand-glow:    rgba(124, 108, 255, .45);
    --grad-brand:    linear-gradient(135deg, #7c6cff 0%, #b06cff 52%, #4fd8e6 100%);

    /* Semantic */
    --amber:         #ffb020;
    --green:         #35d9a0;
    --red:           #ff4d6d;
    --blue:          #4aa3ff;

    /* Shape */
    --r-xs: 8px;
    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 22px;
    --r-xl: 30px;
    --r-pill: 999px;

    /* Elevation */
    --sh-sm: 0 2px 10px rgba(0, 0, 0, .35);
    --sh-md: 0 14px 40px rgba(0, 0, 0, .48);
    --sh-lg: 0 30px 80px rgba(0, 0, 0, .62);

    /* Layout */
    --container: 1620px;
    --gutter: clamp(16px, 3.4vw, 42px);
    --header-h: 68px;
    --card-w: 172px;

    /* Motion */
    --ease: cubic-bezier(.22, .68, 0, 1);
    --fast: .18s var(--ease);
    --mid: .32s var(--ease);
    --slow: .55s var(--ease);

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Sora', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------------------------------------------------------------------
   2. Reset + base
   ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.nav-open { overflow: hidden; }

img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }

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

button, input, select, textarea {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
}

button { cursor: pointer; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -.015em;
}

ul, ol { list-style: none; }

hr { border: 0; border-top: 1px solid var(--line); }

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

:focus-visible {
    outline: 2px solid var(--brand-3);
    outline-offset: 2px;
    border-radius: 6px;
}

.icon-sprite { display: none; }

.ico {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
}
.ico-xs { width: 14px; height: 14px; }
.ico-sm { width: 17px; height: 17px; }
.ico-xxs { width: 11px; height: 11px; }
.ico-lg { width: 26px; height: 26px; }

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.page { display: block; padding-bottom: 72px; }

.skip-link {
    position: fixed;
    top: -60px;
    left: 16px;
    z-index: 2000;
    padding: 10px 18px;
    background: var(--brand);
    color: #fff;
    border-radius: 0 0 var(--r-sm) var(--r-sm);
    font-weight: 600;
    transition: top var(--fast);
}
.skip-link:focus { top: 0; }

.dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    margin-inline: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: .45;
    vertical-align: middle;
}

/* Scroll progress bar */
.scroll-progress {
    position: fixed;
    inset: 0 0 auto 0;
    height: 2px;
    z-index: 999;
    background: var(--grad-brand);
    transform: scaleX(0);
    transform-origin: 0 50%;
    opacity: 0;
    transition: opacity var(--fast);
    pointer-events: none;
}
.scroll-progress.is-active { opacity: 1; }

/* ---------------------------------------------------------------------
   3. Buttons
   ------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 22px;
    border-radius: var(--r-pill);
    font-family: var(--font);
    font-size: 14.5px;
    font-weight: 650;
    letter-spacing: .005em;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: transform var(--fast), background var(--fast), border-color var(--fast), box-shadow var(--fast), color var(--fast);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--grad-brand);
    color: #0a0713;
    box-shadow: 0 8px 24px -8px var(--brand-glow);
}
.btn-primary:hover { box-shadow: 0 14px 34px -8px var(--brand-glow); }

.btn-white { background: #fff; color: #0b0d14; }
.btn-white:hover { background: #e9ecf5; }

.btn-glass {
    background: rgba(255, 255, 255, .1);
    border-color: var(--line-strong);
    color: var(--text);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.btn-glass:hover { background: rgba(255, 255, 255, .17); }

.btn-ghost {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--text-dim);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: var(--line-strong); }

.btn-outline {
    border-color: var(--line-strong);
    color: var(--text);
}
.btn-outline:hover { background: rgba(255, 255, 255, .06); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #ff6b85; }

.btn-sm { padding: 9px 16px; font-size: 13.5px; }
.btn-lg { padding: 14px 30px; font-size: 16px; }
.btn-block { width: 100%; }

.icon-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-dim);
    border: 1px solid transparent;
    transition: background var(--fast), color var(--fast), border-color var(--fast);
}
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: var(--text); }

/* ---------------------------------------------------------------------
   4. Header
   ------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: linear-gradient(180deg, rgba(7, 8, 12, .92) 0%, rgba(7, 8, 12, .55) 60%, transparent 100%);
    transition: background var(--mid), box-shadow var(--mid), backdrop-filter var(--mid);
}

.site-header.is-stuck {
    background: rgba(8, 9, 14, .84);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    box-shadow: 0 1px 0 var(--line), 0 14px 40px -22px rgba(0, 0, 0, .9);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.6vw, 26px);
    height: var(--header-h);
}

/* Brand */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: none;
}
.brand-mark { display: grid; place-items: center; }
.brand-mark svg { filter: drop-shadow(0 3px 10px var(--brand-glow)); }
.brand-text {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: .055em;
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Primary nav */
.nav-primary {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: none;
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 13px;
    border-radius: var(--r-sm);
    font-size: 14.5px;
    font-weight: 550;
    color: var(--text-dim);
    white-space: nowrap;
    transition: color var(--fast), background var(--fast);
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav-link.is-active { color: var(--text); }
.nav-link.is-active::after {
    content: '';
    position: absolute;
    left: 13px;
    right: 13px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--grad-brand);
}
.nav-toggle-btn .ico-xs { transition: transform var(--fast); opacity: .6; }
.nav-item.has-menu:hover .nav-toggle-btn .ico-xs { transform: rotate(180deg); }

/* Genre dropdown */
.nav-item.has-menu { position: relative; }

.nav-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    width: min(560px, 88vw);
    padding: 18px;
    background: rgba(16, 19, 32, .96);
    backdrop-filter: blur(26px) saturate(160%);
    -webkit-backdrop-filter: blur(26px) saturate(160%);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-lg);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -10px);
    transition: opacity var(--fast), transform var(--fast), visibility var(--fast);
}
.nav-item.has-menu.is-open .nav-panel {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.nav-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--faint);
}
.nav-panel-head a { color: var(--brand-3); letter-spacing: 0; text-transform: none; font-size: 13px; }
.nav-panel-head a:hover { text-decoration: underline; }
.nav-panel-empty { color: var(--muted); font-size: 14px; }

.genre-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.genre-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 13px;
    font-weight: 550;
    color: var(--text-dim);
    transition: background var(--fast), color var(--fast), border-color var(--fast), transform var(--fast);
}
.genre-chip:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--text);
    transform: translateY(-1px);
}
.genre-chip-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--faint);
    padding-left: 7px;
    border-left: 1px solid var(--line);
}

/* Header search */
.header-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1 1 auto;
    max-width: 330px;
    margin-left: auto;
    padding: 0 12px;
    height: 42px;
    background: rgba(255, 255, 255, .055);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--muted);
    transition: border-color var(--fast), background var(--fast), box-shadow var(--fast);
}
.header-search:focus-within {
    border-color: var(--brand);
    background: rgba(255, 255, 255, .085);
    box-shadow: 0 0 0 4px var(--brand-soft);
}
.header-search input {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: var(--text);
}
.header-search input::placeholder { color: var(--faint); }
.header-search input::-webkit-search-cancel-button { filter: invert(.6); }

.search-kbd {
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding-inline: 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid var(--line);
    font-family: var(--font);
    font-size: 11px;
    font-weight: 600;
    color: var(--faint);
}

.search-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    min-width: 380px;
    max-height: 66vh;
    overflow-y: auto;
    padding: 8px;
    background: rgba(16, 19, 32, .97);
    backdrop-filter: blur(26px) saturate(160%);
    -webkit-backdrop-filter: blur(26px) saturate(160%);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    box-shadow: var(--sh-lg);
    z-index: 20;
}
.search-panel[hidden] { display: none; }

.suggest {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px;
    border-radius: var(--r-sm);
    text-align: left;
    transition: background var(--fast);
}
.suggest:hover, .suggest.is-active { background: rgba(255, 255, 255, .07); }
.suggest img {
    width: 42px;
    height: 62px;
    object-fit: cover;
    border-radius: 7px;
    background: var(--surface-3);
    flex: none;
}
.suggest-body { min-width: 0; flex: 1; }
.suggest-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.suggest-meta { font-size: 12px; color: var(--muted); }
.suggest-empty { padding: 22px 14px; text-align: center; color: var(--muted); font-size: 14px; }
.suggest-head {
    display: block;
    padding: 9px 9px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: var(--faint);
}

/* Header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: none;
}

.user-chip {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--grad-brand);
    color: #0a0713;
    font-weight: 800;
    font-size: 15px;
    border: 2px solid transparent;
    transition: border-color var(--fast), transform var(--fast);
}
.user-chip:hover { border-color: var(--brand-3); transform: scale(1.05); }
.user-chip img { width: 100%; height: 100%; object-fit: cover; }

.nav-burger { display: none; }

/* ---------------------------------------------------------------------
   5. Mobile navigation
   ------------------------------------------------------------------- */
.mobile-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 880;
    background: rgba(7, 8, 12, .97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity var(--mid), transform var(--mid);
}
.mobile-nav[hidden] { display: block; pointer-events: none; }
.mobile-nav.is-open { opacity: 1; transform: none; pointer-events: auto; }

.mobile-nav-inner { padding: 20px var(--gutter) 40px; }

.mobile-search {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding-inline: 16px;
    margin-bottom: 18px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--muted);
}
.mobile-search input { flex: 1; font-size: 15px; }

.mobile-links { display: grid; gap: 4px; margin-bottom: 24px; }
.mobile-links a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--r-sm);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dim);
    border: 1px solid transparent;
}
.mobile-links a:hover, .mobile-links a.is-active {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--line);
}
.mobile-links a .ico { color: var(--brand-3); }

.mobile-genres { margin-bottom: 24px; }
.mobile-genres-title {
    display: block;
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--faint);
}
.mobile-nav-logout { margin-top: 8px; }

/* ---------------------------------------------------------------------
   6. Hero
   ------------------------------------------------------------------- */
.hero {
    position: relative;
    height: clamp(500px, 82vh, 820px);
    margin-top: calc(var(--header-h) * -1);
    overflow: hidden;
    isolation: isolate;
}

.hero-media { position: absolute; inset: 0; z-index: -3; }
.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 22%;
    opacity: 0;
    transform: scale(1.07);
    transition: opacity 1s var(--ease), transform 9s linear;
}
.hero-slide.is-active .hero-media img { opacity: 1; transform: scale(1); }

.hero-scrim {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(to right, rgba(7, 8, 12, .97) 0%, rgba(7, 8, 12, .82) 34%, rgba(7, 8, 12, .24) 66%, rgba(7, 8, 12, .5) 100%),
        linear-gradient(to top, var(--bg) 1%, rgba(7, 8, 12, .68) 22%, transparent 62%);
}
.hero-vignette {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(120% 90% at 18% 50%, transparent 30%, rgba(7, 8, 12, .55) 100%);
    pointer-events: none;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .85s var(--ease), visibility .85s var(--ease);
}
.hero-slide.is-active { opacity: 1; visibility: visible; }

.hero-inner {
    position: relative;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding-bottom: clamp(88px, 13vh, 140px);
}

.hero-content { max-width: 620px; width: 100%; }

.hero-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .1);
    border: 1px solid var(--line-strong);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.pill-brand { background: var(--grad-brand); color: #0a0713; border-color: transparent; }
.pill-live { background: rgba(255, 77, 109, .16); border-color: rgba(255, 77, 109, .4); color: #ff90a5; }
.pill-hd { background: rgba(255, 255, 255, .14); color: #fff; }

.hero-title {
    font-size: clamp(32px, 5.6vw, 68px);
    line-height: 1.03;
    letter-spacing: -.032em;
    font-weight: 800;
    margin-bottom: 12px;
    text-shadow: 0 4px 30px rgba(0, 0, 0, .6);
}

.hero-tagline {
    font-size: clamp(14px, 1.5vw, 17px);
    font-weight: 500;
    color: var(--brand-3);
    margin-bottom: 12px;
}

.hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-dim);
}

.rating-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px 4px 8px;
    border-radius: var(--r-pill);
    background: rgba(255, 176, 32, .15);
    border: 1px solid rgba(255, 176, 32, .32);
    font-weight: 750;
    font-size: 13.5px;
    color: var(--amber);
}

.hero-overview {
    font-size: clamp(14.5px, 1.55vw, 16.5px);
    line-height: 1.68;
    color: var(--text-dim);
    max-width: 560px;
    margin-bottom: 22px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-genres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.hero-genres a {
    padding: 5px 13px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .08);
    border: 1px solid var(--line-strong);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-dim);
    transition: background var(--fast), color var(--fast), border-color var(--fast);
}
.hero-genres a:hover { background: var(--brand-soft); border-color: var(--brand); color: #fff; }

.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }

/* Hero controls */
.hero-controls {
    position: absolute;
    right: var(--gutter);
    bottom: clamp(88px, 13vh, 140px);
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 5;
}

.hero-dots { display: flex; gap: 8px; }
.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .28);
    transition: width var(--mid), background var(--mid);
}
.hero-dot.is-active { width: 28px; background: var(--grad-brand); }
.hero-dot:hover { background: rgba(255, 255, 255, .55); }

.hero-nav-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .09);
    border: 1px solid var(--line-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    transition: background var(--fast), transform var(--fast);
}
.hero-nav-btn:hover { background: rgba(255, 255, 255, .18); transform: scale(1.06); }

/* Hero thumbnail rail */
.hero-rail {
    position: absolute;
    left: var(--gutter);
    right: var(--gutter);
    bottom: clamp(18px, 3vh, 32px);
    display: flex;
    gap: 10px;
    z-index: 5;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.hero-rail::-webkit-scrollbar { display: none; }

.hero-thumb {
    position: relative;
    flex: none;
    width: 92px;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    opacity: .42;
    transition: opacity var(--mid), border-color var(--mid), transform var(--mid);
}
.hero-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hero-thumb:hover { opacity: .8; transform: translateY(-3px); }
.hero-thumb.is-active { opacity: 1; border-color: var(--brand-3); transform: translateY(-4px); }

/* ---------------------------------------------------------------------
   7. Section heading
   ------------------------------------------------------------------- */
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}
.section-eyebrow {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--brand-3);
    margin-bottom: 8px;
}
.section-title { font-size: clamp(24px, 3.1vw, 38px); letter-spacing: -.028em; }
.section-sub { margin-top: 8px; color: var(--muted); font-size: 15px; max-width: 62ch; }
.section-count {
    padding: 6px 14px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
}

/* Page top spacing */
.page-pad { padding-top: clamp(30px, 5vw, 54px); }
.section-block { margin-top: clamp(38px, 5.4vw, 62px); }

/* ---------------------------------------------------------------------
   8. Content rows
   ------------------------------------------------------------------- */
.row { margin-block: clamp(34px, 4.6vw, 54px); }

.row-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.row-heading { display: flex; align-items: center; gap: 13px; min-width: 0; }
.row-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand-3);
    flex: none;
}
.row-title { font-size: clamp(18px, 2vw, 23px); letter-spacing: -.02em; }
.row-sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; }

.row-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.row-explore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    transition: color var(--fast), gap var(--fast);
}
.row-explore:hover { color: var(--text); gap: 10px; }

.row-nav {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text-dim);
    transition: background var(--fast), color var(--fast), opacity var(--fast);
}
.row-nav:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.row-nav:disabled { opacity: .28; cursor: default; }

.row-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: var(--card-w);
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    padding-bottom: 6px;
    scrollbar-width: none;
}
.row-track::-webkit-scrollbar { display: none; }
.row-track > * { scroll-snap-align: start; }

/* ---------------------------------------------------------------------
   9. Cards
   ------------------------------------------------------------------- */
.card { position: relative; min-width: 0; }

.card-link { display: block; }

.card-art {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--line);
    transition: transform var(--mid), box-shadow var(--mid), border-color var(--mid);
}

.card-art > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--slow), filter var(--mid);
}

.card-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(6, 7, 11, .96) 0%, rgba(6, 7, 11, .55) 34%, transparent 66%);
    opacity: .55;
    transition: opacity var(--mid);
}

.card:hover .card-art {
    transform: translateY(-8px);
    border-color: rgba(124, 108, 255, .55);
    box-shadow: 0 26px 54px -22px rgba(0, 0, 0, .95), 0 0 0 1px var(--brand-soft), 0 0 44px -14px var(--brand-glow);
}
.card:hover .card-art > img { transform: scale(1.08); }
.card:hover .card-shade { opacity: .92; }

/* Badges */
.rating-badge {
    position: absolute;
    top: 9px;
    left: 9px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px 3px 6px;
    border-radius: var(--r-xs);
    background: rgba(8, 9, 14, .82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.3;
    color: var(--amber);
    border: 1px solid rgba(255, 176, 32, .28);
}
.rating-badge .ico-xxs { fill: currentColor; }
.rating-mid { color: #7fd1ff; border-color: rgba(122, 209, 255, .3); }
.rating-low { color: #a8b0c4; border-color: rgba(168, 176, 196, .26); }

.card-flag {
    position: absolute;
    top: 9px;
    right: 9px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--r-xs);
    background: rgba(8, 9, 14, .82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--text-dim);
    border: 1px solid var(--line-strong);
}
.card-flag-hot { color: #ff8b6b; border-color: rgba(255, 139, 107, .35); background: rgba(60, 20, 12, .75); }
.card-flag-meta { top: auto; bottom: 9px; right: 9px; }

.card-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, .18);
}
.card-progress-bar {
    display: block;
    height: 100%;
    width: var(--pct, 0%);
    background: var(--grad-brand);
    box-shadow: 0 0 10px var(--brand-glow);
}

/* Hover overlay */
.card-hover {
    position: absolute;
    inset: auto 0 0 0;
    padding: 14px;
    display: grid;
    gap: 8px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--mid), transform var(--mid);
}
.card:hover .card-hover, .card:focus-within .card-hover { opacity: 1; transform: none; }

.card-hover-meta {
    display: flex;
    align-items: center;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--brand-3);
}
.card-hover-title {
    font-family: var(--font-display);
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.28;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-hover-actions { display: flex; align-items: center; gap: 7px; margin-top: 2px; }

.card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 32px;
    border-radius: var(--r-pill);
    font-size: 12.5px;
    font-weight: 700;
    transition: background var(--fast), color var(--fast), transform var(--fast);
}
.card-btn-play { flex: 1; background: #fff; color: #0b0d14; padding-inline: 12px; }
.card-btn-play:hover { background: #e6e9f2; }
.card-btn-list { width: 32px; background: rgba(255, 255, 255, .16); color: #fff; backdrop-filter: blur(8px); }
.card-btn-list:hover { background: rgba(255, 255, 255, .3); }
.card-btn-list.is-active { background: var(--grad-brand); color: #0a0713; }

/* Card body */
.card-body { padding: 11px 2px 0; }
.card-title {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.35;
    letter-spacing: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-title a:hover { color: var(--brand-3); }
.card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}
.card-type { color: var(--text-dim); font-weight: 600; }
.quality-tag {
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--surface-3);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .05em;
}

/* Card variants */
.card-wide { }
.card-wide .card-art { aspect-ratio: 16 / 9; }
.card-compact .card-body { display: none; }
.card-compact .card-art { aspect-ratio: 3 / 4; border-radius: var(--r-sm); }

.card-hero-mini {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px;
    padding: 12px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    border: 1px solid var(--line);
    transition: border-color var(--fast), transform var(--fast), background var(--fast);
}
.card-hero-mini:hover { border-color: var(--brand); transform: translateX(4px); background: var(--surface-3); }
.card-hero-mini img { width: 96px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; }
.card-hero-mini h3 { font-family: var(--font); font-size: 15px; font-weight: 650; margin-bottom: 5px; }
.card-hero-mini p { font-size: 12.5px; color: var(--muted); margin-bottom: 9px; }
.card-hero-mini .mini-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------------
   10. Grid layouts
   ------------------------------------------------------------------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-w), 1fr));
    gap: 22px 16px;
}

.grid-list { display: grid; gap: 12px; }

.list-item {
    display: grid;
    grid-template-columns: 104px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 12px;
    border-radius: var(--r-md);
    background: var(--surface);
    border: 1px solid var(--line);
    transition: border-color var(--fast), transform var(--fast), background var(--fast);
}
.list-item:hover { border-color: var(--brand); transform: translateX(4px); background: var(--surface-2); }
.list-item img {
    width: 104px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px;
    background: var(--surface-3);
}
.list-item h3 { font-family: var(--font); font-size: 15.5px; font-weight: 650; margin-bottom: 6px; }
.list-item .list-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.list-item .list-overview {
    font-size: 13px;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.list-actions { display: flex; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------------
   11. Filters / chips
   ------------------------------------------------------------------- */
.filter-bar {
    display: grid;
    gap: 14px;
    padding: 18px 20px;
    margin-bottom: 28px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--line);
}

.filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 88px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--faint);
}
.filter-label .ico { color: var(--brand-3); }

.chip-scroll {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    transition: background var(--fast), color var(--fast), border-color var(--fast), transform var(--fast);
}
.chip:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.chip.is-active {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: #fff;
}
.chip-count { font-size: 11px; color: var(--faint); font-weight: 600; }
.chip.is-active .chip-count { color: var(--brand-3); }

.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-wrap .ico {
    position: absolute;
    right: 11px;
    pointer-events: none;
    color: var(--muted);
}

.select {
    appearance: none;
    -webkit-appearance: none;
    min-width: 152px;
    height: 40px;
    padding: 0 38px 0 15px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--fast), background var(--fast);
}
.select:hover { border-color: var(--line-strong); }
.select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

.input {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    font-size: 15px;
    color: var(--text);
    transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.input::placeholder { color: var(--faint); }
.input:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--brand-soft);
}
textarea.input { height: auto; min-height: 120px; padding: 13px 16px; resize: vertical; line-height: 1.6; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; }
.input.has-error { border-color: var(--red); }

/* Filter summary bar */
.filter-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.filter-summary p { font-size: 14px; color: var(--muted); }
.filter-summary strong { color: var(--text); font-weight: 650; }

/* Tab switcher (search / genre / account pages) */
.tabs {
    display: inline-flex;
    gap: 4px;
    padding: 5px;
    border-radius: var(--r-pill);
    background: var(--surface);
    border: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
    max-width: 100%;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 17px;
    border-radius: var(--r-pill);
    font-size: 13.5px;
    font-weight: 650;
    color: var(--muted);
    white-space: nowrap;
    transition: background var(--fast), color var(--fast);
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--grad-brand); color: #0a0713; }
.tab-count {
    font-size: 11px;
    font-weight: 700;
    opacity: .7;
    padding: 1px 6px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .1);
}
.tab.is-active .tab-count { background: rgba(0, 0, 0, .16); }

/* ---------------------------------------------------------------------
   12. Detail page
   ------------------------------------------------------------------- */
.detail-hero {
    position: relative;
    padding-top: clamp(40px, 6vw, 76px);
    padding-bottom: clamp(26px, 4vw, 46px);
    overflow: hidden;
}

.detail-backdrop {
    position: absolute;
    inset: 0;
    z-index: -2;
}
.detail-backdrop img { width: 100%; height: 100%; object-fit: cover; opacity: .42; }
.detail-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(7, 8, 12, .96) 0%, rgba(7, 8, 12, .74) 48%, rgba(7, 8, 12, .3) 100%),
        linear-gradient(to top, var(--bg) 2%, rgba(7, 8, 12, .6) 34%, rgba(7, 8, 12, .3) 100%);
}

.detail-layout {
    display: grid;
    grid-template-columns: 268px 1fr;
    gap: clamp(24px, 3.6vw, 48px);
    align-items: start;
}

.detail-poster {
    position: relative;
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--line-strong);
    box-shadow: var(--sh-lg);
    aspect-ratio: 2 / 3;
    background: var(--surface-2);
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-poster::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
    pointer-events: none;
}

.detail-body { min-width: 0; }

.detail-title {
    font-size: clamp(27px, 4.2vw, 50px);
    line-height: 1.05;
    letter-spacing: -.03em;
    margin: 14px 0 12px;
}
.detail-original {
    font-size: 15px;
    color: var(--muted);
    margin-bottom: 14px;
}

.detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 14.5px;
    color: var(--text-dim);
}
.detail-meta .dot { opacity: .35; }

.rating-block {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    margin-bottom: 20px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .045);
    border: 1px solid var(--line);
}
.rating-score {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    color: var(--amber);
}
.rating-info { display: grid; gap: 6px; min-width: 0; }
.rating-bar {
    width: 170px;
    max-width: 46vw;
    height: 5px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .12);
    overflow: hidden;
}
.rating-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--amber), #ffd166);
}
.rating-note { font-size: 12.5px; color: var(--muted); }

.detail-tagline {
    font-size: clamp(15px, 1.6vw, 17px);
    font-weight: 500;
    color: var(--brand-3);
    margin-bottom: 14px;
}

.detail-overview {
    font-size: 15.5px;
    line-height: 1.72;
    color: var(--text-dim);
    max-width: 74ch;
    margin-bottom: 22px;
}
.detail-overview.is-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.detail-genres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

.detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; }

.detail-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 18px 26px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}
.detail-fact dt {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 4px;
}
.detail-fact dd { font-size: 14.5px; color: var(--text-dim); font-weight: 500; }

/* Episodes */
.episodes-block { margin-top: clamp(40px, 5vw, 62px); }

.season-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.episode-list { display: grid; gap: 10px; }

.episode-item {
    display: grid;
    grid-template-columns: 116px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 12px;
    border-radius: var(--r-md);
    background: var(--surface);
    border: 1px solid var(--line);
    transition: border-color var(--fast), background var(--fast), transform var(--fast);
}
.episode-item:hover { border-color: var(--brand); background: var(--surface-2); transform: translateX(4px); }
.episode-item.is-current { border-color: var(--brand); background: var(--brand-soft); }

.episode-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface-3);
}
.episode-thumb img { width: 100%; height: 100%; object-fit: cover; }
.episode-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(6, 7, 11, .42);
    color: #fff;
    opacity: 0;
    transition: opacity var(--fast);
}
.episode-item:hover .episode-play { opacity: 1; }
.episode-play span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #0b0d14;
}
.episode-num {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(8, 9, 14, .84);
    font-size: 11px;
    font-weight: 750;
    color: var(--brand-3);
}

.episode-body { min-width: 0; }
.episode-title {
    font-family: var(--font);
    font-size: 15.5px;
    font-weight: 650;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.episode-item:hover .episode-title { color: var(--brand-3); }
.episode-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 5px;
}
.episode-overview {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.episode-actions { display: flex; align-items: center; gap: 8px; }

/* Cast-like strip */
.credit-strip { display: grid; gap: 14px; }
.credit {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
    align-items: center;
    padding: 11px;
    border-radius: var(--r-sm);
    background: var(--surface);
    border: 1px solid var(--line);
}
.credit-avatar {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--grad-brand);
    color: #0a0713;
    font-weight: 800;
    font-size: 15px;
}
.credit h4 { font-family: var(--font); font-size: 14px; font-weight: 650; margin-bottom: 2px; }
.credit p { font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------------
   13. Watch page
   ------------------------------------------------------------------- */
.watch-page { padding-top: clamp(18px, 2.4vw, 30px); }

.watch-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.watch-title { font-size: clamp(20px, 2.6vw, 30px); letter-spacing: -.025em; }
.watch-sub {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 7px;
    font-size: 13.5px;
    color: var(--muted);
}

.player-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: #000;
    border: 1px solid var(--line);
    box-shadow: var(--sh-lg);
}
.player-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-frame.is-loading { opacity: 0; }

.player-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 16px;
    background:
        radial-gradient(60% 60% at 50% 45%, rgba(124, 108, 255, .12), transparent 70%),
        #000;
    color: var(--muted);
    transition: opacity .4s var(--ease);
}
.player-loading[hidden] { display: none; }
.player-loading .ico { width: 34px; height: 34px; animation: spin 1s linear infinite; }
.player-loading p { font-size: 13.5px; font-weight: 600; letter-spacing: .04em; }

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

.player-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 14px;
    padding: 30px;
    text-align: center;
    background: var(--surface);
    color: var(--muted);
}
.player-empty .ico { width: 42px; height: 42px; color: var(--amber); }
.player-empty h3 { font-size: 19px; color: var(--text); }

.player-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.server-switch { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.server-switch .filter-label { min-width: 0; }
.server-btn {
    padding: 8px 15px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 13px;
    font-weight: 650;
    color: var(--text-dim);
    transition: background var(--fast), color var(--fast), border-color var(--fast);
}
.server-btn:hover { border-color: var(--line-strong); color: var(--text); }
.server-btn.is-active {
    background: var(--grad-brand);
    border-color: transparent;
    color: #0a0713;
}
.server-btn:disabled { opacity: .45; cursor: not-allowed; }

.watch-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: clamp(20px, 2.4vw, 30px);
    align-items: start;
    margin-top: clamp(26px, 3.4vw, 38px);
}

.watch-side { min-width: 0; }

.side-panel {
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
}
.side-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}
.side-panel-head h3 { font-size: 15px; font-weight: 700; }
.side-panel-head .count { font-size: 12px; color: var(--muted); }

.side-episode-list {
    max-height: 620px;
    overflow-y: auto;
    padding: 8px;
    display: grid;
    gap: 4px;
    scrollbar-width: thin;
}
.side-episode-list::-webkit-scrollbar { width: 8px; }
.side-episode-list::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

.side-episode {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 9px 10px;
    border-radius: var(--r-sm);
    transition: background var(--fast);
}
.side-episode:hover { background: var(--surface-2); }
.side-episode.is-current { background: var(--brand-soft); }
.side-episode-num {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--surface-3);
    font-size: 12.5px;
    font-weight: 750;
    color: var(--text-dim);
}
.side-episode.is-current .side-episode-num { background: var(--grad-brand); color: #0a0713; }
.side-episode.is-watched .side-episode-num { color: var(--green); }
.side-episode-title {
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.side-episode-sub { font-size: 11.5px; color: var(--muted); }

.nav-episode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: var(--r-md);
    background: var(--surface);
    border: 1px solid var(--line);
    transition: border-color var(--fast), transform var(--fast);
}
.nav-episode:hover { border-color: var(--brand); transform: translateX(3px); }
.nav-episode.is-disabled { opacity: .35; pointer-events: none; }
.nav-episode small { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 3px; }
.nav-episode span { font-size: 14px; font-weight: 650; }
.nav-episode .ico { color: var(--brand-3); }

.watch-about { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.watch-about h2 { font-size: 17px; margin-bottom: 10px; }
.watch-about p { font-size: 14.5px; line-height: 1.72; color: var(--text-dim); }

/* ---------------------------------------------------------------------
   14. Auth pages
   ------------------------------------------------------------------- */
.auth-wrap {
    display: grid;
    place-items: center;
    min-height: calc(100vh - var(--header-h));
    padding: 44px var(--gutter) 70px;
}
.auth-card {
    width: 100%;
    max-width: 452px;
    padding: clamp(26px, 3.4vw, 40px);
    border-radius: var(--r-xl);
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
    border: 1px solid var(--line);
    box-shadow: var(--sh-lg);
}
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-logo {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: var(--grad-brand);
    color: #0a0713;
    box-shadow: 0 12px 30px -10px var(--brand-glow);
}
.auth-logo .ico { width: 26px; height: 26px; }
.auth-head h1 { font-size: 25px; margin-bottom: 8px; }
.auth-head p { font-size: 14.5px; color: var(--muted); }

.field { margin-bottom: 17px; }
.field label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    font-size: 12.5px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.field .ico { color: var(--brand-3); }
.field-error { display: block; margin-top: 7px; font-size: 12.5px; color: #ff8fa3; }
.field-hint { display: block; margin-top: 7px; font-size: 12.5px; color: var(--faint); }

.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 48px; }
.input-affix {
    position: absolute;
    right: 6px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--muted);
    transition: color var(--fast), background var(--fast);
}
.input-affix:hover { color: var(--text); background: rgba(255, 255, 255, .07); }

.check-row { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.check {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dim);
    user-select: none;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check-box {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    color: transparent;
    transition: background var(--fast), border-color var(--fast), color var(--fast);
}
.check input:checked + .check-box {
    background: var(--grad-brand);
    border-color: transparent;
    color: #0a0713;
}
.check input:focus-visible + .check-box { box-shadow: 0 0 0 4px var(--brand-soft); }
.check a { color: var(--brand-3); font-weight: 600; }
.check a:hover { text-decoration: underline; }

.auth-alt { text-align: center; margin-top: 22px; font-size: 14px; color: var(--muted); }
.auth-alt a { color: var(--brand-3); font-weight: 650; }
.auth-alt a:hover { text-decoration: underline; }

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 15px;
    margin-bottom: 20px;
    border-radius: var(--r-sm);
    background: rgba(255, 77, 109, .1);
    border: 1px solid rgba(255, 77, 109, .3);
    font-size: 13.5px;
    color: #ff9fb0;
}
.auth-alert .ico { flex: none; margin-top: 1px; }

/* ---------------------------------------------------------------------
   15. Account pages
   ------------------------------------------------------------------- */
.profile-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: clamp(22px, 3vw, 38px);
    align-items: start;
}

.profile-card {
    position: relative;
    padding: 30px 26px;
    border-radius: var(--r-xl);
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
    border: 1px solid var(--line);
    overflow: hidden;
    text-align: center;
}
.profile-card::before {
    content: '';
    position: absolute;
    inset: -60% 0 auto 0;
    height: 200px;
    background: radial-gradient(60% 100% at 50% 0, var(--brand-soft), transparent 70%);
    pointer-events: none;
}
.profile-avatar {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--grad-brand);
    color: #0a0713;
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 800;
    box-shadow: 0 14px 34px -12px var(--brand-glow);
    overflow: hidden;
    position: relative;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-card h1 { font-size: 22px; margin-bottom: 5px; position: relative; }
.profile-handle { font-size: 13.5px; color: var(--muted); margin-bottom: 16px; position: relative; }
.profile-bio {
    font-size: 13.5px;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 20px;
    position: relative;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    position: relative;
}
.profile-stat {
    padding: 13px 8px;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--line);
}
.profile-stat b {
    display: block;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}
.profile-stat span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.profile-links { display: grid; gap: 8px; position: relative; }

.panels { display: grid; gap: 18px; }

.panel {
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.panel-head .ico { color: var(--brand-3); }
.panel-body { padding: 20px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}
.form-grid .field { margin-bottom: 0; }
.field-full { grid-column: 1 / -1; }

.panel-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 11px;
    padding: 15px 20px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
}

/* History rows */
.history-item {
    display: grid;
    grid-template-columns: 168px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border-radius: var(--r-md);
    background: var(--surface);
    border: 1px solid var(--line);
    transition: border-color var(--fast), transform var(--fast);
}
.history-item:hover { border-color: var(--brand); transform: translateX(4px); }
.history-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface-3);
}
.history-thumb img { width: 100%; height: 100%; object-fit: cover; }
.history-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, .2);
}
.history-progress span { display: block; height: 100%; background: var(--grad-brand); }
.history-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(6, 7, 11, .4);
    opacity: 0;
    transition: opacity var(--fast);
    color: #fff;
}
.history-item:hover .history-play { opacity: 1; }
.history-title { font-family: var(--font); font-size: 16px; font-weight: 650; margin-bottom: 7px; }
.history-title a:hover { color: var(--brand-3); }
.history-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.history-bar { height: 4px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .12); overflow: hidden; max-width: 320px; }
.history-bar span { display: block; height: 100%; background: var(--grad-brand); }
.history-actions { display: flex; align-items: center; gap: 7px; }

/* Continue watching cards (landscape) */
.continue-card {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--line);
    transition: transform var(--mid), border-color var(--mid), box-shadow var(--mid);
}
.continue-card:hover {
    transform: translateY(-5px) scale(1.015);
    border-color: var(--brand);
    box-shadow: 0 22px 44px -20px rgba(0, 0, 0, .95), 0 0 34px -12px var(--brand-glow);
}
.continue-card img { width: 100%; height: 100%; object-fit: cover; }
.continue-card .card-shade { opacity: .85; }
.continue-info {
    position: absolute;
    inset: auto 0 0 0;
    padding: 13px;
}
.continue-info h3 {
    font-family: var(--font);
    font-size: 14.5px;
    font-weight: 650;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.continue-info p { font-size: 11.5px; color: var(--muted); }
.continue-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.85);
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .93);
    color: #0b0d14;
    opacity: 0;
    transition: opacity var(--fast), transform var(--fast);
}
.continue-card:hover .continue-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------------------------------------------------------------------
   16. Empty state
   ------------------------------------------------------------------- */
.empty-state {
    display: grid;
    justify-items: center;
    text-align: center;
    padding: clamp(48px, 7vw, 90px) 24px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px dashed var(--line-strong);
}
.empty-icon {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin-bottom: 20px;
    border-radius: 20px;
    background: var(--brand-soft);
    color: var(--brand-3);
}
.empty-title { font-size: 21px; margin-bottom: 9px; }
.empty-text { font-size: 14.5px; color: var(--muted); max-width: 46ch; margin-bottom: 24px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 11px; justify-content: center; }

/* ---------------------------------------------------------------------
   17. Pagination
   ------------------------------------------------------------------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: clamp(36px, 5vw, 56px);
    padding-top: 28px;
    border-top: 1px solid var(--line);
}
.page-btn {
    display: grid;
    place-items: center;
    min-width: 40px;
    height: 40px;
    padding-inline: 12px;
    border-radius: var(--r-sm);
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 14px;
    font-weight: 650;
    color: var(--text-dim);
    transition: background var(--fast), color var(--fast), border-color var(--fast);
}
.page-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--line-strong); }
.page-btn.is-current { background: var(--grad-brand); border-color: transparent; color: #0a0713; }
.page-btn.is-disabled { opacity: .3; pointer-events: none; }
.page-gap { color: var(--faint); padding-inline: 3px; }
.page-info {
    width: 100%;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--faint);
}

/* ---------------------------------------------------------------------
   18. Toasts / flash / modal
   ------------------------------------------------------------------- */
.toast-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1400;
    display: grid;
    gap: 10px;
    max-width: min(360px, calc(100vw - 40px));
}
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-radius: var(--r-md);
    background: rgba(22, 26, 41, .96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--line-strong);
    box-shadow: var(--sh-md);
    font-size: 14px;
    font-weight: 550;
    animation: toast-in .34s var(--ease);
}
.toast.is-out { animation: toast-out .28s var(--ease) forwards; }
.toast .ico { flex: none; }
.toast-success .ico { color: var(--green); }
.toast-error .ico { color: var(--red); }
.toast-info .ico { color: var(--brand-3); }

@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

.flash-stack {
    position: fixed;
    top: calc(var(--header-h) + 14px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1350;
    display: grid;
    gap: 9px;
    width: min(440px, calc(100vw - 32px));
}
.flash {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 15px;
    border-radius: var(--r-md);
    background: rgba(22, 26, 41, .96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--line-strong);
    box-shadow: var(--sh-md);
    font-size: 14px;
    animation: toast-in .34s var(--ease);
}
.flash-success { border-color: rgba(53, 217, 160, .42); }
.flash-success .ico { color: var(--green); }
.flash-error { border-color: rgba(255, 77, 109, .42); }
.flash-error .ico { color: var(--red); }
.flash-info { border-color: rgba(79, 216, 230, .38); }
.flash-info .ico { color: var(--brand-3); }
.flash span { flex: 1; }
.flash-close {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    color: var(--muted);
}
.flash-close:hover { background: rgba(255, 255, 255, .1); color: var(--text); }

.modal { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 5, 8, .78); backdrop-filter: blur(6px); }
.modal-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 26px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    box-shadow: var(--sh-lg);
    animation: modal-in .28s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.modal-title { font-size: 19px; margin-bottom: 9px; }
.modal-text { font-size: 14.5px; color: var(--muted); margin-bottom: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------------------------------------------------------------------
   19. Skeletons / loading
   ------------------------------------------------------------------- */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--surface-2);
    border-radius: var(--r-sm);
}
.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
    animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.skel-card { aspect-ratio: 2 / 3; }
.is-loading-list { opacity: .5; pointer-events: none; }

/* ---------------------------------------------------------------------
   20. Utility
   ------------------------------------------------------------------- */
.hide-sm { display: initial; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 18px; }
.mb-2 { margin-bottom: 18px; }
.mb-3 { margin-bottom: 28px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack-2 { display: grid; gap: 12px; }
.flex-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ---------------------------------------------------------------------
   21. Responsive
   ------------------------------------------------------------------- */
@media (max-width: 1440px) {
    :root { --card-w: 158px; }
    .header-search { max-width: 260px; }
}

@media (max-width: 1200px) {
    :root { --card-w: 148px; --header-h: 64px; }
    .header-search { display: none; }
    .watch-layout { grid-template-columns: 1fr; }
    .watch-side { order: -1; }
    .side-episode-list { max-height: 340px; }
}

@media (max-width: 1024px) {
    :root { --card-w: 142px; }
    .nav-primary { display: none; }
    .nav-burger { display: grid; }
    .detail-layout { grid-template-columns: 1fr; }
    .detail-poster { width: 210px; }
    .profile-layout { grid-template-columns: 1fr; }
    .history-item { grid-template-columns: 132px 1fr; }
    .history-item .history-actions { grid-column: 2; justify-content: flex-start; }
}

@media (max-width: 860px) {
    :root { --card-w: 132px; }
    .hero { height: clamp(460px, 74vh, 660px); }
    .hero-controls { right: var(--gutter); bottom: clamp(74px, 11vh, 110px); }
    .hero-rail { display: none; }
    .episode-item { grid-template-columns: 92px 1fr; }
    .episode-item .episode-actions { grid-column: 2; justify-content: flex-start; margin-top: 4px; }
    .list-item { grid-template-columns: 88px 1fr; }
    .list-item .list-actions { grid-column: 2; justify-content: flex-start; }
    .hide-sm { display: none !important; }
}

@media (max-width: 640px) {
    :root { --card-w: 124px; }
    body { font-size: 14.5px; }
    .grid { gap: 18px 12px; }
    .row-track { gap: 12px; }
    .hero-title { font-size: clamp(26px, 8.5vw, 40px); }
    .hero-inner { padding-bottom: 76px; }
    .hero-actions .btn { flex: 1; min-width: 132px; }
    .section-head { margin-bottom: 20px; }
    .detail-facts { grid-template-columns: repeat(2, 1fr); }
    .player-wrap { border-radius: var(--r-md); }
    .watch-toolbar, .player-toolbar { flex-direction: column; align-items: stretch; }
    .server-switch { justify-content: flex-start; }
    .history-item { grid-template-columns: 112px 1fr; gap: 13px; }
    .filter-bar { padding: 15px; }
    .filter-label { min-width: 0; }
    .pagination { gap: 5px; }
    .page-btn { min-width: 36px; height: 36px; font-size: 13px; }
    .toast-stack { right: 12px; left: 12px; bottom: 12px; max-width: none; }
}

@media (max-width: 460px) {
    :root { --card-w: 116px; }
    .brand-text { font-size: 17px; }
    .row-nav { display: none; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}

/* ---------------------------------------------------------------------
   22. Motion preferences
   ------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .hero-media img { transition: opacity .01ms !important; }
}

/* ---------------------------------------------------------------------
   23. Print
   ------------------------------------------------------------------- */
@media print {
    .site-header, .hero, .toast-stack, .flash-stack, .modal, .row-nav { display: none !important; }
    body { background: #fff; color: #000; }
}