/* ── Lenutime — Void Premium Design System ───────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* ── Surfaces ── */
    --bg:          #06060f;
    --bg-2:        #09091a;
    --surface:     #0d0d22;
    --card:        #111128;
    --card-hover:  #18183a;
    --glass:       rgba(255,255,255,0.03);
    --glass-hover: rgba(255,255,255,0.055);

    /* ── Borders ── */
    --border:        rgba(255,255,255,0.065);
    --border-light:  rgba(255,255,255,0.11);
    --border-bright: rgba(255,255,255,0.18);
    --border-focus:  rgba(99,102,241,0.55);

    /* ── Text ── */
    --text:           #eeeef8;
    --text-secondary: #8888aa;
    --text-muted:     #4a4a6a;

    /* ── Accents ── */
    --accent:        #6366f1;
    --accent-2:      #818cf8;
    --accent-hover:  #818cf8;
    --accent-dim:    rgba(99,102,241,0.12);
    --accent-glow:   rgba(99,102,241,0.18);
    --accent-glow-lg: rgba(99,102,241,0.08);
    --rose:          #e11d48;
    --rose-hover:    #f43f5e;
    --rose-glow:     rgba(225,29,72,0.22);
    --green:         #10b981;
    --green-dim:     rgba(16,185,129,0.12);
    --amber:         #f59e0b;

    /* ── Typography ── */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --text-xs:   0.6875rem;
    --text-sm:   0.8125rem;
    --text-base: 0.9375rem;
    --text-lg:   1.125rem;
    --text-xl:   1.375rem;
    --text-2xl:  1.875rem;
    --text-3xl:  2.5rem;
    --text-hero: clamp(2.25rem, 1.5rem + 4vw, 3.75rem);

    /* ── Spacing ── */
    --space-xs:      0.25rem;
    --space-sm:      0.5rem;
    --space-md:      1rem;
    --space-lg:      1.5rem;
    --space-xl:      2rem;
    --space-2xl:     3rem;
    --space-3xl:     4.5rem;
    --space-section: clamp(2.5rem, 1.5rem + 3vw, 4.5rem);

    /* ── Radii ── */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* ── Motion ── */
    --ease:          cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in:       cubic-bezier(0.4, 0, 1, 1);
    --ease-out:      cubic-bezier(0, 0, 0.2, 1);
    --duration-fast: 140ms;
    --duration-mid:  220ms;
    --duration-slow: 380ms;

    /* ── Layout ── */
    --nav-h:       68px;
    --content-max: 1440px;
    --content-pad: clamp(1rem, 2.5vw, 3rem);
}

/* ── Keyframes ───────────────────────────────────────────── */

@keyframes shimmer {
    0%   { background-position: -400% 0; }
    100% { background-position:  400% 0; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}


@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; }
    50%       { opacity: 1; }
}

@keyframes airing-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

@keyframes ep-highlight-flash {
    0%   { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent), 0 0 50px rgba(99,102,241,0.9), 0 0 100px rgba(99,102,241,0.4); background: rgba(99,102,241,0.22); }
    35%  { border-color: var(--accent);   box-shadow: 0 0 0 3px var(--accent), 0 0 60px rgba(99,102,241,1.0), 0 0 110px rgba(99,102,241,0.45); background: rgba(99,102,241,0.18); }
    70%  { border-color: var(--accent);   box-shadow: 0 0 0 2px rgba(99,102,241,0.5), 0 0 28px rgba(99,102,241,0.25); background: rgba(99,102,241,0.08); }
    100% { border-color: var(--border);   box-shadow: none; background: var(--card); }
}

/* ── Reset & Base ────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-h);
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01s !important;
        transition-duration: 0.01s !important;
    }
}

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

/* Ambient depth glow */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 15% 40%, rgba(99,102,241,0.028) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 85% 15%, rgba(129,140,248,0.018) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

main, nav, footer { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; cursor: pointer; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
input, select { font: inherit; }

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

::selection {
    background: rgba(99,102,241,0.35);
    color: var(--text);
}

/* ── Scrollbar ───────────────────────────────────────────── */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Navigation ──────────────────────────────────────────── */

.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--nav-h);
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid transparent;
    box-shadow: none;
    transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}

.nav.scrolled {
    background: rgba(6, 6, 15, 0.92);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 var(--border), 0 8px 40px rgba(0,0,0,0.5);
}


.nav-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--content-pad);
    height: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: var(--text-xl);
    font-weight: 800;
    letter-spacing: -0.04em;
    flex-shrink: 0;
    transition: opacity var(--duration-fast);
}

.nav-logo:hover { opacity: 0.85; }

.logo-icon-svg {
    width: 22px;
    height: 22px;
    color: var(--rose);
    filter: drop-shadow(0 0 8px var(--rose-glow));
    flex-shrink: 0;
}

.logo-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-text { color: var(--text); text-shadow: 0 1px 8px rgba(0,0,0,0.6); }
.logo-accent { color: var(--accent-2); }
.nav.scrolled .logo-text { text-shadow: none; }

.nav-links {
    display: flex;
    gap: var(--space-xs);
}

.nav-link {
    font-size: var(--text-sm);
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    position: relative;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
    transition: color var(--duration-fast), background var(--duration-fast), text-shadow var(--duration-fast);
}

.nav.scrolled .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    text-shadow: none;
}

.nav-link:hover { color: #fff; background: rgba(255,255,255,0.1); }
.nav.scrolled .nav-link:hover { color: var(--text); background: var(--glass-hover); }

.nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}
.nav.scrolled .nav-link.active {
    color: var(--text);
    background: var(--glass-hover);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

.nav-settings {
    position: relative;
    margin-left: auto;
}

.nav-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: rgba(255,255,255,0.7);
    transition: background 0.15s, color 0.15s;
}

.nav-settings-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav.scrolled .nav-settings-btn { color: var(--text-secondary); }
.nav.scrolled .nav-settings-btn:hover { color: var(--text); }

.nav-settings-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    min-width: 180px;
    padding: 4px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    display: none;
    z-index: 200;
}

.nav-settings-menu.open { display: block; }

.nav-settings-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: calc(var(--radius-md) - 2px);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    text-decoration: none;
}

.nav-settings-item:hover { background: var(--card-hover); color: var(--text); }

.nav-search {
    margin-left: var(--space-sm);
    position: relative;
    width: min(340px, 40vw);
}

.search-form { position: relative; }

.search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: rgba(255,255,255,0.5);
    pointer-events: none;
    transition: color var(--duration-fast);
}

.nav.scrolled .search-icon { color: var(--text-muted); }
.search-form:focus-within .search-icon { color: var(--text-secondary); }

.search-input {
    width: 100%;
    height: 40px;
    padding: 0 var(--space-md) 0 38px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-xl);
    color: var(--text);
    font-size: var(--text-sm);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition:
        border-color var(--duration-fast),
        background var(--duration-fast),
        box-shadow var(--duration-fast);
}

.nav.scrolled .search-input {
    background: var(--glass);
    border: 1px solid var(--border);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.search-input::placeholder { color: rgba(255,255,255,0.45); }
.nav.scrolled .search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
    border-color: var(--border-focus);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
    outline: none;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0; right: 0;
    background: rgba(13,13,34,0.98);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px var(--border);
    backdrop-filter: blur(20px);
    max-height: 420px;
    overflow-y: auto;
    display: none;
    z-index: 200;
    animation: fadeUp 0.18s var(--ease) both;
}

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

.search-result {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px 14px;
    transition: background var(--duration-fast);
    cursor: pointer;
}

.search-result:hover, .search-result.search-highlight { background: var(--glass-hover); }

.search-view-all {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--accent-2);
    border-top: 1px solid var(--border);
}

.search-history-label {
    padding: 8px 14px 4px;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.search-history-item { gap: 10px; }

.search-result-img {
    width: 38px;
    height: 54px;
    object-fit: cover;
    border-radius: var(--radius-xs);
    flex-shrink: 0;
    opacity: 0.9;
}

.search-result-info { flex: 1; min-width: 0; }

.search-result-title {
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.search-result-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Main & Footer ───────────────────────────────────────── */

.main { min-height: 100dvh; }

.footer {
    padding: var(--space-2xl) var(--content-pad);
    border-top: 1px solid var(--border);
    margin-top: var(--space-3xl);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: -1px; left: 50%;
    transform: translateX(-50%);
    width: min(200px, 30%);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--rose) 70%, transparent);
    opacity: 0.5;
}

.footer-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.footer-text {
    font-size: var(--text-xs);
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ── Hero Banner ─────────────────────────────────────────── */

.hero {
    position: relative;
    height: clamp(500px, 72vh, 800px);
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 5%, var(--accent) 30%, var(--rose) 50%, var(--accent) 70%, transparent 95%);
    opacity: 0.25;
    z-index: 5;
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 25%;
    transition: opacity 0.75s var(--ease);
    will-change: opacity;
    z-index: 1;
}

#heroBackdropNext {
    opacity: 0;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    z-index: 3;
    background:
        linear-gradient(to top, var(--bg) 0%, rgba(6,6,15,0.6) 45%, transparent 75%),
        linear-gradient(to right, rgba(6,6,15,0.92) 0%, rgba(6,6,15,0.45) 55%, transparent 90%),
        linear-gradient(to bottom, rgba(6,6,15,0.3) 0%, transparent 18%);
}

.hero-content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: var(--space-3xl) var(--content-pad);
    max-width: var(--content-max);
    margin: 0 auto;
    z-index: 4;
    animation: fadeUp 0.7s var(--ease) both;
    transition: opacity 0.32s ease, transform 0.32s var(--ease);
}

.hero-content.hero-out {
    opacity: 0;
    transform: translateY(10px);
    animation: none;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.hero-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.hero-tag.score {
    background: rgba(99,102,241,0.18);
    color: var(--accent-2);
    border: 1px solid rgba(99,102,241,0.3);
}

.hero-tag.genre {
    background: rgba(255,255,255,0.07);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.hero-tag.episodes {
    background: var(--green-dim);
    color: var(--green);
    border: 1px solid rgba(16,185,129,0.25);
}

.hero-title {
    font-size: var(--text-hero);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.035em;
    margin-bottom: var(--space-md);
    max-width: 680px;
    text-shadow: 0 4px 30px rgba(0,0,0,0.7);
}

.hero-desc {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 520px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--space-xl);
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.hero-nav {
    position: absolute;
    bottom: var(--space-xl);
    right: var(--content-pad);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 4;
}

.hero-nav-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    backdrop-filter: blur(8px);
    transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast);
}

.hero-nav-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: var(--border-bright);
    color: var(--text);
}

.hero-nav-btn svg { width: 16px; height: 16px; }

.hero-dots { display: flex; gap: 6px; }

.hero-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    cursor: pointer;
    transition: background 0.35s var(--ease), width 0.35s var(--ease), border-radius 0.35s var(--ease), box-shadow 0.35s;
}

.hero-dot:hover { background: rgba(255,255,255,0.45); }

.hero-dot.active {
    background: var(--accent-2);
    width: 24px;
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(99,102,241,0.55);
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 26px;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.015em;
    transition:
        transform 0.2s var(--ease),
        box-shadow 0.2s var(--ease),
        background 0.15s,
        border-color 0.15s,
        opacity var(--duration-fast);
    white-space: nowrap;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.15s;
}

.btn:hover::after { background: rgba(255,255,255,0.06); }

.btn:active {
    transform: scale(0.97) !important;
    transition-duration: 0.08s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--rose) 0%, #c81d44 100%);
    color: #fff;
    box-shadow: 0 4px 20px var(--rose-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(225,29,72,0.4), 0 2px 8px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.18);
}

/* Subtle idle glow pulse on detail page primary */
@keyframes btnGlow {
    0%, 100% { box-shadow: 0 4px 20px var(--rose-glow), inset 0 1px 0 rgba(255,255,255,0.15); }
    50%      { box-shadow: 0 4px 28px rgba(225,29,72,0.35), 0 0 40px rgba(225,29,72,0.1), inset 0 1px 0 rgba(255,255,255,0.15); }
}
.detail-actions .btn-primary { animation: btnGlow 3s ease-in-out infinite; }
.detail-actions .btn-primary:hover { animation: none; }

.btn-ghost {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(8px);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.12);
    border-color: var(--border-bright);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, #4f52d3 100%);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.12);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--accent-glow), 0 2px 8px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.12);
}

/* ── Sections & Carousels ────────────────────────────────── */

.section {
    padding: 0 var(--content-pad);
    margin-top: var(--space-section);
    max-width: var(--content-max);
    margin-left: auto;
    margin-right: auto;
    animation: fadeUp 0.6s var(--ease) both;
}

.section:nth-child(2) { animation-delay: 0.05s; }
.section:nth-child(3) { animation-delay: 0.1s; }
.section:nth-child(4) { animation-delay: 0.15s; }
.section:nth-child(5) { animation-delay: 0.2s; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.section-title {
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
}

.section-title::before {
    content: '';
    width: 3px;
    height: 1.15em;
    background: linear-gradient(to bottom, var(--accent-2), var(--rose));
    border-radius: 2px;
    flex-shrink: 0;
}

.section-more {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}

.section-more:hover {
    color: var(--accent-2);
    border-color: rgba(99,102,241,0.35);
    background: var(--accent-dim);
    transform: translateX(2px);
}

.carousel { position: relative; }

/* Fade mask edges */
.carousel::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    right: 0;
    width: 60px;
    z-index: 5;
    pointer-events: none;
    background: linear-gradient(to left, var(--bg), transparent);
}

.carousel-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: var(--space-sm);
    padding-left: 2px;
    padding-right: 2px;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-62%);
    z-index: 10;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(9, 9, 26, 0.9);
    border: 1px solid var(--border-light);
    color: var(--text);
    opacity: 0;
    transition:
        opacity var(--duration-fast),
        background var(--duration-fast),
        border-color var(--duration-fast),
        transform var(--duration-fast) var(--ease);
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.6);
}

.carousel:hover .carousel-btn { opacity: 1; }

.carousel-btn:hover {
    background: rgba(20, 20, 50, 0.95);
    border-color: var(--border-focus);
    transform: translateY(-62%) scale(1.08);
}

.carousel-btn svg { width: 18px; height: 18px; }
.carousel-prev { left: -14px; }
.carousel-next { right: -14px; }

/* ── Anime Cards ─────────────────────────────────────────── */

.anime-card {
    flex: 0 0 180px;
    scroll-snap-align: start;
    cursor: pointer;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid transparent;
    transition:
        transform 0.4s var(--ease),
        box-shadow 0.4s var(--ease),
        border-color 0.4s var(--ease);
    will-change: transform;
}

.anime-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(99,102,241,0.2);
    box-shadow:
        0 8px 20px rgba(0,0,0,0.4),
        0 24px 60px rgba(0,0,0,0.5),
        0 0 40px rgba(99,102,241,0.06),
        inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Stagger cards in carousels */
.carousel-track .anime-card:nth-child(1)  { animation: fadeUp 0.4s var(--ease) 0.04s both; }
.carousel-track .anime-card:nth-child(2)  { animation: fadeUp 0.4s var(--ease) 0.08s both; }
.carousel-track .anime-card:nth-child(3)  { animation: fadeUp 0.4s var(--ease) 0.12s both; }
.carousel-track .anime-card:nth-child(4)  { animation: fadeUp 0.4s var(--ease) 0.16s both; }
.carousel-track .anime-card:nth-child(5)  { animation: fadeUp 0.4s var(--ease) 0.2s  both; }
.carousel-track .anime-card:nth-child(6)  { animation: fadeUp 0.4s var(--ease) 0.24s both; }
.carousel-track .anime-card:nth-child(7)  { animation: fadeUp 0.4s var(--ease) 0.28s both; }
.carousel-track .anime-card:nth-child(8)  { animation: fadeUp 0.4s var(--ease) 0.32s both; }
.carousel-track .anime-card:nth-child(n+9){ animation: fadeUp 0.4s var(--ease) 0.36s both; }

.anime-card-img-wrap {
    position: relative;
    aspect-ratio: 3 / 4.2;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--card);
}

.anime-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease);
}

.anime-card:hover .anime-card-img { transform: scale(1.07); }


.anime-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(6,6,15,0.88) 0%, rgba(6,6,15,0.2) 45%, transparent 70%);
    opacity: 0;
    transition: opacity var(--duration-mid);
    display: flex;
    align-items: flex-end;
    padding: var(--space-sm);
}

.anime-card:hover .anime-card-overlay { opacity: 1; }

.anime-card-play {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rose), #c81d44);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
    box-shadow: 0 4px 20px var(--rose-glow);
    transition: transform var(--duration-fast), box-shadow var(--duration-fast);
}

.anime-card:hover .anime-card-play {
    transform: scale(1.12);
    box-shadow: 0 6px 28px rgba(225,29,72,0.55);
}

.anime-card-play svg { width: 16px; height: 16px; fill: #fff; margin-left: 2px; }

.anime-card-score {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(6,6,15,0.82);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99,102,241,0.35);
    color: var(--accent-2);
    letter-spacing: 0.03em;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 0 12px rgba(99,102,241,0.15);
}

.anime-card-ep {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 20px;
    background: var(--green-dim);
    border: 1px solid rgba(16,185,129,0.3);
    color: var(--green);
    letter-spacing: 0.03em;
}

.anime-card-info {
    padding: 8px 8px 10px;
}

.anime-card-title {
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.anime-card-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.anime-card-genre-chip {
    font-size: 0.67rem;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 2px 7px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* ── Anime Grid (Browse/Search) ──────────────────────────── */

.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: var(--space-lg);
}

/* Grid cards (not in carousel) */
.anime-grid .anime-card {
    flex: none;
    width: 100%;
    animation: fadeUp 0.4s var(--ease) both;
}

.anime-grid .anime-card:nth-child(1)  { animation-delay: 0.04s; }
.anime-grid .anime-card:nth-child(2)  { animation-delay: 0.08s; }
.anime-grid .anime-card:nth-child(3)  { animation-delay: 0.12s; }
.anime-grid .anime-card:nth-child(4)  { animation-delay: 0.16s; }
.anime-grid .anime-card:nth-child(5)  { animation-delay: 0.20s; }
.anime-grid .anime-card:nth-child(6)  { animation-delay: 0.24s; }
.anime-grid .anime-card:nth-child(7)  { animation-delay: 0.28s; }
.anime-grid .anime-card:nth-child(8)  { animation-delay: 0.32s; }
.anime-grid .anime-card:nth-child(9)  { animation-delay: 0.36s; }
.anime-grid .anime-card:nth-child(10) { animation-delay: 0.40s; }
.anime-grid .anime-card:nth-child(11) { animation-delay: 0.44s; }
.anime-grid .anime-card:nth-child(12) { animation-delay: 0.48s; }
.anime-grid .anime-card:nth-child(n+13) { animation-delay: 0.52s; }

/* ── Skeleton Loading ────────────────────────────────────── */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--card) 25%,
        rgba(255,255,255,0.05) 50%,
        var(--card) 75%
    );
    background-size: 400% 100%;
    animation: shimmer 2s ease-in-out infinite;
    border-radius: var(--radius-md);
}

.skeleton-card { flex: 0 0 180px; }
.skeleton-card .skeleton-img { aspect-ratio: 3 / 4.2; border-radius: var(--radius-md); }
.skeleton-card .skeleton-title { height: 13px; margin-top: 10px; width: 80%; border-radius: 4px; }
.skeleton-card .skeleton-sub   { height: 10px; margin-top: 6px;  width: 50%; border-radius: 4px; }
.skeleton-hero { height: clamp(500px, 72vh, 800px); }

/* ── Detail Page ─────────────────────────────────────────── */

.detail-banner {
    position: relative;
    height: 380px;
    overflow: hidden;
}

.detail-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
}

.detail-banner-gradient {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, var(--bg) 0%, rgba(6,6,15,0.4) 55%, transparent 80%),
        linear-gradient(to right, var(--bg) 0%, transparent 35%),
        linear-gradient(to bottom, rgba(6,6,15,0.55) 0%, transparent 30%);
}

.detail-content {
    max-width: var(--content-max);
    margin: -130px auto 0;
    padding: 0 var(--content-pad);
    position: relative;
    z-index: 1;
}

.detail-header {
    display: flex;
    gap: var(--space-xl);
    animation: fadeUp 0.6s var(--ease) both;
}

.detail-poster {
    width: 220px;
    flex-shrink: 0;
}

.detail-poster img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 50px rgba(0,0,0,0.7), 0 0 0 1px var(--border), 0 0 60px rgba(99,102,241,0.08);
}

.detail-info { flex: 1; min-width: 0; padding-top: 4px; }

.detail-title {
    font-size: var(--text-2xl);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.12;
    color: var(--text);
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.detail-tag {
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s var(--ease);
}

.detail-tag:hover {
    border-color: var(--border-bright);
    color: var(--text);
    background: var(--glass-hover);
    transform: translateY(-1px);
}

.detail-tag.accent {
    background: var(--accent-dim);
    border-color: rgba(99,102,241,0.3);
    color: var(--accent-2);
}

.detail-desc {
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.72;
    margin-top: var(--space-lg);
    max-width: 720px;
}

.detail-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    flex-wrap: wrap;
}

/* ── Episodes Section ────────────────────────────────────── */

.episodes-section {
    margin-top: var(--space-2xl);
}

.episodes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.episodes-header h2 {
    font-size: var(--text-base);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.ep-selects-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ep-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ep-select-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
    transition: color 0.15s;
}

.ep-select-wrap:hover .ep-select-icon,
.ep-select-wrap:focus-within .ep-select-icon {
    color: var(--accent-2);
}

.ep-provider-select,
.ep-lang-select {
    height: 38px;
    padding: 0 32px 0 34px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888aa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s, transform 0.15s var(--ease);
}

.ep-provider-select:hover,
.ep-lang-select:hover {
    border-color: var(--border-light);
    background-color: var(--card-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.ep-provider-select:focus,
.ep-lang-select:focus {
    border-color: var(--accent);
    background-color: var(--surface);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
    outline: none;
}

.ep-provider-select option,
.ep-lang-select option {
    background: var(--card);
    color: var(--text);
    padding: 8px;
}

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

.episode-btn {
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--glass);
    border: 1px solid var(--border);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--duration-fast);
    font-variant-numeric: tabular-nums;
}

.episode-btn:hover {
    background: var(--accent-dim);
    border-color: rgba(99,102,241,0.4);
    color: var(--text);
}

.episode-btn.active {
    background: linear-gradient(135deg, var(--accent), #4f52d3);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.episode-btn.watched {
    background: var(--green-dim);
    border-color: rgba(16,185,129,0.25);
    color: var(--green);
}

/* ── Episode Cards (detail / watch page) ─────────────────── */

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

.episode-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    transition:
        border-color var(--duration-mid) var(--ease),
        transform var(--duration-mid) var(--ease),
        box-shadow var(--duration-mid) var(--ease);
    text-decoration: none;
    position: relative;
}

.episode-card:hover {
    border-color: rgba(99,102,241,0.5);
    transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(0,0,0,0.5), 0 0 20px rgba(99,102,241,0.06);
}

.episode-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--card-hover);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ep-num-large {
    font-size: 2.6rem;
    font-weight: 800;
    color: rgba(255,255,255,0.08);
    user-select: none;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.ep-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity var(--duration-fast);
    color: #fff;
}

.episode-card:hover .ep-play-overlay { opacity: 1; }

.ep-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.78);
    color: rgba(255,255,255,0.8);
    font-size: 9px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 20px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    font-variant-numeric: tabular-nums;
}

.ep-dur {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.72);
    color: rgba(255,255,255,0.7);
    font-size: 9px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    backdrop-filter: blur(6px);
    font-variant-numeric: tabular-nums;
}

.ep-info {
    padding: 10px 11px 11px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ep-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.episode-card.ep-card-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 0 20px rgba(99,102,241,0.12);
}

.episode-card.ep-card-active .ep-badge {
    background: var(--accent);
    color: #fff;
}

/* Unavailable episode cards */
.episode-card.ep-unavailable {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}
.ep-unavail-label {
    opacity: 0.7;
    font-size: 0.72rem;
    font-style: italic;
}
.ep-list-unavailable {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* ── Episode Controls Bar ────────────────────────────────── */

.ep-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: var(--space-md);
}

.ep-range-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ep-range-chip {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    background: var(--glass);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition:
        border-color var(--duration-fast),
        color var(--duration-fast),
        background var(--duration-fast),
        box-shadow var(--duration-fast);
    white-space: nowrap;
}

.ep-range-chip:hover {
    border-color: rgba(99,102,241,0.5);
    color: var(--accent-2);
    background: var(--accent-dim);
}

.ep-range-chip.active {
    background: linear-gradient(135deg, var(--accent), #4f52d3);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.ep-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.ep-jump {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ep-jump input {
    width: 86px;
    padding: 7px 10px;
    background: var(--glass);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: var(--text-sm);
    font-weight: 600;
    -moz-appearance: textfield;
    font-variant-numeric: tabular-nums;
    transition: border-color var(--duration-fast);
}

.ep-jump input::-webkit-outer-spin-button,
.ep-jump input::-webkit-inner-spin-button { -webkit-appearance: none; }

.ep-jump input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
}

.ep-jump button {
    padding: 7px 16px;
    background: var(--accent-dim);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: var(--radius-sm);
    color: var(--accent-2);
    font-size: var(--text-sm);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.ep-jump button:hover {
    background: linear-gradient(135deg, var(--accent), #4f52d3);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.ep-view-toggle {
    display: flex;
    gap: 3px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-left: auto;
}

.ep-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    border-radius: 6px;
    color: var(--text-muted);
    transition: background var(--duration-fast), color var(--duration-fast);
}

.ep-view-btn:hover { color: var(--text); background: var(--glass-hover); }

.ep-view-btn.active {
    background: linear-gradient(135deg, var(--accent), #4f52d3);
    color: #fff;
}

/* ── Episode List View ───────────────────────────────────── */

.episode-list-view {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ep-list-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition:
        border-color var(--duration-fast),
        background var(--duration-fast),
        transform var(--duration-fast);
}

.ep-list-item:hover {
    border-color: rgba(99,102,241,0.4);
    background: var(--card);
    transform: translateX(4px);
}

.ep-list-num {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--accent-2);
    min-width: 54px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.ep-list-title {
    flex: 1;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep-list-dur {
    font-size: var(--text-xs);
    color: var(--text-muted);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.ep-list-play {
    color: var(--text-muted);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--duration-fast), color var(--duration-fast);
}

.ep-list-item:hover .ep-list-play {
    opacity: 1;
    color: var(--accent-2);
}

/* ── Episode Progress & Watched ─────────────────────────────*/

.ep-progress-wrap {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: rgba(255,255,255,0.07);
}

.ep-progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--accent), var(--accent-2));
    border-radius: 0 2px 0 0;
    transition: width 0.3s ease;
}

.ep-watched-mark {
    position: absolute;
    top: 8px; right: 8px;
    width: 20px; height: 20px;
    background: var(--green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(16,185,129,0.35);
}

.ep-watched-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(16,185,129,0.5);
}

.ep-list-watched .ep-list-title { color: var(--text-muted); }

/* ── Episode Number Chips (watch page) ───────────────────────*/

.ep-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ep-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s var(--ease), box-shadow 0.15s;
    position: relative;
    overflow: hidden;
}

.ep-chip:hover {
    border-color: rgba(99,102,241,0.5);
    color: var(--text);
    background: var(--card-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.ep-chip:active {
    transform: translateY(0) scale(0.96);
    transition-duration: 0.06s;
}

.ep-chip.ep-chip-active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.ep-chip.ep-chip-watched {
    opacity: 0.4;
    border-color: rgba(16, 185, 129, 0.25);
    color: rgba(255, 255, 255, 0.35);
}

/* ── Episode chip context menu ───────────────────────────────*/

.ep-ctx-menu {
    position: fixed;
    z-index: 9999;
    background: var(--card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.25);
    min-width: 168px;
    display: none;
    animation: ctxFadeIn 0.1s var(--ease);
}

.ep-ctx-menu.open {
    display: block;
}

@keyframes ctxFadeIn {
    from { opacity: 0; transform: scale(0.96) translateY(-4px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ep-ctx-item {
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: calc(var(--radius-sm) - 2px);
    transition: background var(--duration-fast), color var(--duration-fast);
    white-space: nowrap;
    user-select: none;
}

.ep-ctx-item:hover {
    background: var(--card-hover);
    color: var(--text);
}

.ep-list-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: rgba(255,255,255,0.04);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.ep-list-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--accent), var(--accent-2));
    border-radius: inherit;
}

.ep-highlight {
    animation: ep-highlight-flash 2.4s var(--ease) forwards;
    position: relative;
    z-index: 1;
}

/* ── Skip Markers on Seek Bar ────────────────────────────── */

.skip-marker {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 1px;
    pointer-events: none;
    opacity: 0.85;
}
.skip-marker-op { background: #f59e0b; }
.skip-marker-ed { background: #f43f5e; }

/* ── Video Player Page ───────────────────────────────────── */

.player-page { padding-top: var(--nav-h); }

.player-container {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.player-container.fullscreen {
    max-width: none;
    border-radius: 0;
    aspect-ratio: auto;
    width: 100vw;
    height: 100vh;
}

.player-container video {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}

.player-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: #000;
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.04em;
    z-index: 20;
}

.player-loading::before {
    content: '';
    width: 36px;
    height: 36px;
    border: 2.5px solid rgba(99,102,241,0.15);
    border-top-color: var(--accent-2);
    border-radius: 50%;
    animation: loadSpin 0.8s linear infinite;
}

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

.subtitle-overlay {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
    z-index: 12;
    width: 80%;
    transition: bottom 0.2s ease;
    padding: 20px 0;
}

.subtitle-overlay.has-subs {
    pointer-events: none;
}

.subtitle-overlay.has-subs.sub-unlocked {
    pointer-events: auto;
    cursor: grab;
}

.subtitle-overlay.sub-dragging {
    cursor: grabbing;
    transition: none;
}

.caption-hint {
    font-size: 10px;
    color: rgba(255,255,255,0.25);
    font-style: italic;
    margin-left: auto;
}

/* ── Subtitle Size Slider ───────────────────────────────── */

.sub-slider-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.sub-slider-icon {
    color: rgba(255,255,255,0.35);
    font-family: var(--font);
    font-weight: 700;
    user-select: none;
    line-height: 1;
}

.sub-slider-small { font-size: 10px; }
.sub-slider-large { font-size: 18px; }

.sub-slider-track {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.sub-slider-track:hover { height: 6px; }

.sub-slider-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    background: var(--accent-2, #818cf8);
    border-radius: 2px;
    pointer-events: none;
}

.sub-slider-thumb {
    position: absolute;
    top: 50%;
    width: 14px; height: 14px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 6px rgba(99,102,241,0.5), 0 1px 3px rgba(0,0,0,0.4);
    transition: transform 0.1s ease;
}

.sub-slider-track:hover .sub-slider-thumb {
    transform: translate(-50%, -50%) scale(1.15);
}

.subtitle-line {
    display: inline-block;
    padding: 4px 14px;
    margin: 2px 0;
    background: var(--sub-bg, transparent);
    color: #fff;
    font-size: var(--sub-size, 1.15rem);
    font-family: var(--font);
    font-weight: 700;
    border-radius: 4px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    -webkit-text-stroke: 1.5px rgba(0,0,0,0.7);
    paint-order: stroke fill;
    text-shadow:
        /* 8-direction outline for full coverage */
        -1px -1px 0 #000,  1px -1px 0 #000,
        -1px  1px 0 #000,  1px  1px 0 #000,
         0   -2px 0 #000,   0    2px 0 #000,
        -2px  0   0 #000,   2px  0   0 #000,
        /* soft outer glow for depth */
        0 0 6px rgba(0,0,0,0.8),
        0 2px 4px rgba(0,0,0,0.6);
}

.player-controls {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.player-container.controls-hidden .player-controls {
    opacity: 0;
    pointer-events: none;
}

.player-container.controls-hidden { cursor: none; }
.player-container.controls-hidden .subtitle-overlay.has-subs.sub-unlocked { cursor: grab; }

.player-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 16px 44px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.75), transparent);
}

.player-top-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.player-top-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-top-ep {
    font-size: var(--text-xs);
    color: rgba(255,255,255,0.55);
}

.quality-badge {
    align-self: flex-start;
    width: fit-content;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.03em;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

.player-center-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.88);
    width: 70px; height: 70px;
    background: rgba(0,0,0,0.55);
    border: 2px solid rgba(255,255,255,0.18);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s var(--ease);
    pointer-events: none;
    backdrop-filter: blur(12px);
    z-index: 11;
}

.player-center-play svg { width: 28px; height: 28px; margin-left: 3px; }

.player-container.paused .player-center-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 0 40px rgba(0,0,0,0.4);
}

.player-center-play:active {
    transform: translate(-50%, -50%) scale(0.9);
    transition-duration: 0.08s;
}

.player-bottom {
    padding: 44px 16px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.82), transparent);
}

.seek-bar {
    position: relative;
    height: 5px;
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: height 0.2s var(--ease);
}

/* Invisible hit area — makes the bar easy to click without looking thick */
.seek-bar::before {
    content: '';
    position: absolute;
    top: -10px; bottom: -10px;
    left: 0; right: 0;
    z-index: 1;
}

.seek-bar:hover,
.seek-bar.dragging { height: 7px; }

.seek-buffered {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    background: rgba(255,255,255,0.18);
    border-radius: 3px;
    pointer-events: none;
    transition: background 0.15s;
}

.seek-bar:hover .seek-buffered { background: rgba(255,255,255,0.24); }

.seek-progress {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0.95), #f0607a);
    border-radius: 3px;
    pointer-events: none;
    box-shadow: 0 0 6px rgba(225,29,72,0.2);
    transition: box-shadow 0.2s;
}

.seek-bar:hover .seek-progress,
.seek-bar.dragging .seek-progress {
    box-shadow: 0 0 10px rgba(225,29,72,0.4), 0 0 24px rgba(225,29,72,0.12);
}

.seek-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 14px; height: 14px;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    transition: transform 0.2s var(--ease), box-shadow 0.2s;
    box-shadow: 0 0 8px rgba(225,29,72,0.4), 0 1px 3px rgba(0,0,0,0.4);
}

.seek-bar:hover .seek-thumb { transform: translate(-50%, -50%) scale(1); }

.seek-bar.dragging .seek-thumb {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 0 14px rgba(225,29,72,0.6), 0 0 28px rgba(225,29,72,0.15);
}

/* Glow ring while dragging */
.seek-bar.dragging .seek-thumb::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(240,96,122,0.35);
    animation: seekPulse 0.8s ease-out infinite;
}

@keyframes seekPulse {
    0%   { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.8); opacity: 0; }
}

.seek-tooltip {
    display: none;
}

/* ── Seek Preview Thumbnail ─────────────────────────────── */

.seek-preview {
    position: absolute;
    bottom: calc(100% + 12px);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 30;
}

.seek-preview.visible { opacity: 1; }

.seek-preview canvas {
    width: 192px;
    height: 108px;
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.15);
    background: #000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 1px rgba(0,0,0,0.3);
}

.seek-preview-time {
    margin-top: 5px;
    background: rgba(9,9,26,0.92);
    border: 1px solid var(--border);
    color: #fff;
    font-size: 11px;
    font-family: var(--font);
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 5px;
    font-variant-numeric: tabular-nums;
    backdrop-filter: blur(8px);
}

/* Arrow pointing down from preview */
.seek-preview::after {
    content: '';
    width: 8px;
    height: 8px;
    background: rgba(9,9,26,0.92);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: rotate(45deg);
    margin-top: -5px;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 2px;
}

.ctrl-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    width: 38px; height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.12s, color 0.12s, transform 0.12s var(--ease);
    text-decoration: none;
    padding: 0;
}

.ctrl-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    transform: scale(1.1);
}

.ctrl-btn:active {
    transform: scale(0.92);
    transition-duration: 0.06s;
}

.ctrl-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.ctrl-btn.ctrl-active { color: var(--accent-2); }
.ctrl-back svg { width: 18px; height: 18px; }

.volume-group { display: flex; align-items: center; }

.vol-bar-wrap {
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease;
    display: flex;
    align-items: center;
}

.volume-group:hover .vol-bar-wrap {
    width: 68px;
    padding-right: 6px;
}

.vol-bar {
    width: 60px; height: 4px;
    background: rgba(255,255,255,0.18);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: height 0.12s ease;
}

.vol-bar:hover { height: 6px; }

.vol-bar-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%; width: 100%;
    background: #fff;
    border-radius: 2px;
    pointer-events: none;
    transition: width 0.08s linear;
}

.caption-settings {
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 8px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.caption-settings-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.caption-settings-label {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    width: 38px;
    flex-shrink: 0;
}

.caption-chip {
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.05);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.12s;
    line-height: 1.4;
}

.caption-chip:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.caption-chip.active {
    color: var(--accent-2);
    border-color: var(--accent);
    background: var(--accent-dim);
}

.caption-lang-label {
    font-size: 10px;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 6px 16px 4px;
}

.caption-source-label {
    font-size: 9px;
    color: rgba(129,140,248,0.6);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    padding: 8px 16px 3px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.caption-source-label:first-of-type {
    border-top: none;
}

.time-display {
    color: rgba(255,255,255,0.65);
    font-size: 12px;
    font-family: var(--font);
    margin-left: 10px;
    white-space: nowrap;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.ctrl-dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: rgba(11, 11, 28, 0.97);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    min-width: 172px;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px 0;
    display: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px var(--border);
    z-index: 30;
}

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

.dropdown-item {
    padding: 9px 16px 9px 36px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    position: relative;
    transition: background 0.12s, color 0.12s;
}

.dropdown-item:hover { background: rgba(255,255,255,0.07); color: #fff; }

.dropdown-item.active { color: var(--accent-2); font-weight: 600; }

.dropdown-item.active::before {
    content: '';
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    width: 6px; height: 6px;
    background: var(--accent-2);
    border-radius: 50%;
}

.dropdown-menu::-webkit-scrollbar { width: 4px; }
.dropdown-menu::-webkit-scrollbar-track { background: transparent; }
.dropdown-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

/* ── Settings Menu ───────────────────────────────────────── */

.settings-menu { min-width: 210px; }

.settings-section {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.settings-section:last-child { border-bottom: none; }

.settings-section-title {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 4px 16px 8px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px;
    cursor: pointer;
    transition: background 0.12s;
}

.settings-row:hover { background: rgba(255,255,255,0.05); }

.settings-label {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    font-family: var(--font);
    user-select: none;
}

.settings-toggle {
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.settings-toggle::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255,255,255,0.8);
    top: 2px;
    left: 2px;
    transition: transform 0.2s var(--ease), background 0.2s;
}

.settings-toggle.on {
    background: var(--accent);
}

.settings-toggle.on::after {
    transform: translateX(16px);
    background: #fff;
}

.settings-speed-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 12px 8px;
}

.player-info-bar {
    max-width: 1100px;
    margin: var(--space-md) auto 0;
    padding: 0 var(--content-pad);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.player-title-below {
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.player-ep-below {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: 2px;
}

.player-nav-btns { display: flex; gap: var(--space-sm); }

/* ── Keyboard Shortcuts Overlay ──────────────────────────── */

.shortcuts-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.shortcuts-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.shortcuts-panel {
    background: rgba(13,13,34,0.95);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px 36px;
    min-width: 320px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.shortcuts-title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.shortcuts-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.shortcut-row kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--font);
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.shortcut-row span {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* ── Muted Autoplay Banner ───────────────────────────────── */

.muted-banner {
    position: absolute;
    top: 70px; left: 50%;
    transform: translateX(-50%) translateY(-6px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 22px;
    background: rgba(9,9,26,0.88);
    border: 1px solid var(--border-light);
    border-radius: 28px;
    color: rgba(255,255,255,0.85);
    font-size: var(--text-sm);
    font-weight: 500;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(12px);
    transition: opacity 0.3s ease, transform 0.3s var(--ease);
    white-space: nowrap;
}

.muted-banner.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.muted-banner svg {
    color: var(--rose);
    flex-shrink: 0;
}

/* ── Skip Button ─────────────────────────────────────────── */

.skip-btn {
    position: absolute;
    bottom: 80px; right: 24px;
    padding: 10px 22px;
    background: rgba(9,9,26,0.9);
    border: 2px solid rgba(255,255,255,0.8);
    border-radius: 5px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    z-index: 15;
    backdrop-filter: blur(10px);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    letter-spacing: 0.03em;
}

.skip-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255,255,255,0.15);
    transform: scale(1.03);
}

.skip-btn:active {
    transform: scale(0.96);
    transition-duration: 0.06s;
}

/* ── Resume Toast ────────────────────────────────────────── */

.resume-toast {
    position: absolute;
    top: 70px; left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(9,9,26,0.92);
    border: 1px solid var(--border-light);
    color: #fff;
    font-size: var(--text-sm);
    font-weight: 500;
    padding: 9px 20px;
    border-radius: 24px;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
    backdrop-filter: blur(12px);
}

.resume-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.resume-prompt {
    display: flex;
    align-items: center;
    gap: 12px;
}

.resume-restart-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 4px 14px;
    border-radius: 16px;
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    pointer-events: auto;
}

.resume-restart-btn:hover { background: rgba(255,255,255,0.22); }

/* ── Airing Countdown Bar ────────────────────────────────── */

.airing-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(225,29,72,0.06) 100%);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.airing-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.04) 50%, transparent);
    animation: airingShimmer 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes airingShimmer {
    0%, 100% { opacity: 0; transform: translateX(-100%); }
    50%      { opacity: 1; transform: translateX(100%); }
}

.airing-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.airing-bar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 8px rgba(99,102,241,0.6);
    animation: airing-pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.airing-bar.airing-now .airing-bar-dot {
    background: var(--green);
    box-shadow: 0 0 8px rgba(16,185,129,0.6);
}

.airing-bar-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.airing-bar-title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.airing-bar-sub {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.airing-bar.airing-now .airing-bar-sub { color: var(--green); }

.airing-bar-countdown {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.airing-bar-seg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 38px;
}

.airing-seg-num {
    font-size: 1.1rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 2px 8px;
    line-height: 1.4;
    letter-spacing: 0.02em;
}

.airing-bar.airing-now .airing-seg-num {
    color: var(--green);
    border-color: rgba(16,185,129,0.2);
    background: rgba(16,185,129,0.06);
}

.airing-seg-lbl {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.airing-bar-colon {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    padding-bottom: 14px;
    animation: colonBlink 1s step-end infinite;
}

@keyframes colonBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.2; }
}

/* ── Continue Watching Cards ─────────────────────────────── */

.continue-card {
    flex: 0 0 200px;
    scroll-snap-align: start;
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--duration-slow) var(--ease), box-shadow var(--duration-slow) var(--ease);
    text-decoration: none;
}

.continue-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(99,102,241,0.2);
}

.continue-card-img-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--card);
}

.continue-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    transition: transform 0.5s var(--ease);
}

.continue-card:hover .continue-card-img { transform: scale(1.08); }

.continue-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6,6,15,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--duration-mid);
}

.continue-card:hover .continue-card-overlay { opacity: 1; }

.continue-card-play {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform var(--duration-fast), background var(--duration-fast);
}

.continue-card:hover .continue-card-play {
    transform: scale(1.1);
    background: rgba(255,255,255,0.22);
}

.continue-card-play svg { margin-left: 2px; }

.continue-card-progress {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: rgba(255,255,255,0.1);
}

.continue-card-progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--accent), var(--accent-2));
    border-radius: 0 2px 0 0;
}

.continue-card-ep {
    position: absolute;
    top: 8px; right: 8px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(6,6,15,0.82);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

.continue-card-info { padding: 8px 4px; }

.continue-card-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Library Page ────────────────────────────────────────── */

.library-tabs {
    display: flex;
    gap: 6px;
    margin-top: var(--space-lg);
    flex-wrap: wrap;
}

.lib-tab {
    padding: 7px 18px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.lib-tab:hover { border-color: var(--border-light); color: var(--text); }

.lib-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.lib-progress {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: rgba(255,255,255,0.1);
}

.lib-progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--accent), var(--accent-2));
    border-radius: 0 2px 0 0;
}

.lib-status-chip {
    color: var(--accent-2) !important;
    border-color: rgba(99,102,241,0.3) !important;
    background: var(--accent-dim) !important;
}

/* Library empty state */
.library-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    animation: fadeUp 0.5s var(--ease) both;
}

.library-empty-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-xs);
}

.library-empty-sub {
    font-size: var(--text-sm);
    color: var(--text-muted);
    max-width: 320px;
    line-height: 1.6;
}

/* Library button wrapper on detail page */
.lib-btn-wrap {
    position: relative;
    display: inline-flex;
}

/* Library dropdown on detail page */
.lib-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    display: none;
    z-index: 20;
    min-width: 180px;
}

.lib-dropdown.open { display: block; }

.lib-dropdown-item {
    padding: 9px 14px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: calc(var(--radius-sm) - 2px);
    transition: background 0.1s, color 0.1s;
}

.lib-dropdown-item:hover { background: var(--card-hover); color: var(--text); }

.lib-dropdown-remove { color: var(--rose); }
.lib-dropdown-remove:hover { background: rgba(225,29,72,0.1); color: var(--rose); }

/* ── History Page ────────────────────────────────────────── */

.history-group-label {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: var(--space-md) 0 var(--space-sm);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-sm);
}

.history-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 12px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, transform 0.15s var(--ease);
}

.history-item:hover {
    border-color: rgba(99,102,241,0.4);
    transform: translateX(3px);
}

.history-item:active { transform: translateX(0) scale(0.99); }

.history-poster {
    width: 48px;
    height: 66px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    background: var(--surface);
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-title {
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.history-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-progress-bar {
    width: 60px;
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.history-progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--accent), var(--accent-2));
}

/* ── Scroll to Top Button ────────────────────────────────── */

.scroll-top-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.25s, transform 0.25s var(--ease), background 0.15s, color 0.15s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
}

.scroll-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.scroll-top-btn svg { width: 18px; height: 18px; }

/* ── Theater Mode ────────────────────────────────────────── */

.player-page.theater-mode .player-container {
    max-width: none;
    border-radius: 0;
}

.player-page.theater-mode .player-info-bar,
.player-page.theater-mode .player-info-bar + * {
    max-width: none;
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
}

/* ── Page Transitions & Scroll Reveals ───────────────────── */

.main {
    animation: pageIn 0.45s var(--ease) both;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Sections fade-slide up on scroll */
.section.reveal-ready {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
    animation: none !important;
}

.section.reveal-ready.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children inside revealed sections */
.section.revealed .carousel-track .anime-card:nth-child(1)  { animation: fadeUp 0.45s var(--ease) 0.04s both; }
.section.revealed .carousel-track .anime-card:nth-child(2)  { animation: fadeUp 0.45s var(--ease) 0.08s both; }
.section.revealed .carousel-track .anime-card:nth-child(3)  { animation: fadeUp 0.45s var(--ease) 0.12s both; }
.section.revealed .carousel-track .anime-card:nth-child(4)  { animation: fadeUp 0.45s var(--ease) 0.16s both; }
.section.revealed .carousel-track .anime-card:nth-child(5)  { animation: fadeUp 0.45s var(--ease) 0.2s  both; }
.section.revealed .carousel-track .anime-card:nth-child(6)  { animation: fadeUp 0.45s var(--ease) 0.24s both; }
.section.revealed .carousel-track .anime-card:nth-child(7)  { animation: fadeUp 0.45s var(--ease) 0.28s both; }
.section.revealed .carousel-track .anime-card:nth-child(8)  { animation: fadeUp 0.45s var(--ease) 0.32s both; }
.section.revealed .carousel-track .anime-card:nth-child(n+9){ animation: fadeUp 0.45s var(--ease) 0.36s both; }

/* ── Browse & Search ─────────────────────────────────────── */

.page-header {
    padding: calc(var(--nav-h) + var(--space-2xl)) var(--content-pad) var(--space-xl);
    max-width: var(--content-max);
    margin: 0 auto;
    animation: fadeUp 0.5s var(--ease) both;
}

.page-title {
    font-size: var(--text-2xl);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.filters-bar .filter-select:nth-child(1) { animation: fadeUp 0.4s var(--ease) 0.05s both; }
.filters-bar .filter-select:nth-child(2) { animation: fadeUp 0.4s var(--ease) 0.10s both; }
.filters-bar .filter-select:nth-child(3) { animation: fadeUp 0.4s var(--ease) 0.15s both; }
.filters-bar .filter-select:nth-child(4) { animation: fadeUp 0.4s var(--ease) 0.20s both; }
.filters-bar .filter-select:nth-child(5) { animation: fadeUp 0.4s var(--ease) 0.25s both; }
.filters-bar .filter-select:nth-child(6) { animation: fadeUp 0.4s var(--ease) 0.30s both; }

.filter-select {
    height: 38px;
    padding: 0 14px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: border-color var(--duration-fast), color var(--duration-fast), background var(--duration-fast);
    appearance: none;
    -webkit-appearance: none;
}

.filter-select:hover {
    border-color: var(--border-light);
    color: var(--text);
}

.filter-select:focus {
    border-color: var(--border-focus);
    background: var(--surface);
    color: var(--text);
    outline: none;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
}

.browse-grid {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--content-pad) var(--space-3xl);
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: var(--space-2xl);
}

/* ── Empty / Error States ────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.3;
    filter: grayscale(1);
}

/* ── Responsive Player Controls ──────────────────────────── */

@media (max-width: 640px) {
    .player-bottom { padding: 30px 10px 8px; }
    .ctrl-btn { width: 40px; height: 40px; }
    .ctrl-btn svg { width: 20px; height: 20px; }
    .time-display { font-size: 11px; }
    .subtitle-line { font-size: var(--sub-size, 0.9rem); }
    .player-info-bar { flex-direction: column; gap: var(--space-sm); align-items: flex-start; }
    .player-nav-btns { width: 100%; }
    .player-nav-btns .btn { flex: 1; justify-content: center; }
    .ep-selects-row { width: 100%; }
    .ep-select-wrap { flex: 1; }
    .ep-provider-select, .ep-lang-select { width: 100%; }
    .continue-card { flex: 0 0 160px; }
    .airing-bar { flex-direction: column; gap: var(--space-sm); align-items: flex-start; }
    .airing-bar-countdown { align-self: center; }
    .shortcuts-panel { min-width: auto; width: 90vw; padding: 20px 24px; }
    .muted-banner { font-size: var(--text-xs); padding: 8px 16px; }
    .seek-preview canvas { width: 144px; height: 81px; }
    .dropdown-menu { min-width: 150px; }
    .settings-menu { min-width: 190px; }
}

/* ── Schedule Page ───────────────────────────────────────── */

.sched-page {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: calc(var(--nav-h) + var(--space-xl)) var(--content-pad) var(--space-3xl);
}

.sched-header {
    margin-bottom: var(--space-xl);
}

.sched-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.sched-subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: 6px;
}

/* ── Day Tabs ── */

.sched-tabs-wrap {
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.sched-tabs-wrap::-webkit-scrollbar { display: none; }

.sched-tabs {
    display: flex;
    gap: 4px;
    padding-bottom: 0;
    min-width: max-content;
}

.sched-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 20px 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: color var(--duration-fast), border-color var(--duration-fast);
    margin-bottom: -1px;
}

.sched-tab:hover { color: var(--text-secondary); }

.sched-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.sched-tab-label {
    font-size: var(--text-sm);
    font-weight: 600;
}

.sched-tab-date {
    font-size: var(--text-xs);
    opacity: 0.6;
}

.sched-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    color: var(--accent-2);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    margin-left: 5px;
    vertical-align: middle;
    line-height: 1.6;
}

/* ── Schedule Entries ── */

.sched-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: fadeIn 0.18s ease;
}

.sched-entry {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text);
    transition: background var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast);
}

.sched-entry:hover {
    background: var(--card-hover);
    border-color: var(--border-light);
    transform: translateX(2px);
}

.sched-entry-aired {
    opacity: 0.5;
}

.sched-entry-airing {
    border-color: rgba(99,102,241,0.35);
    background: rgba(99,102,241,0.05);
}

.sched-entry-airing:hover {
    border-color: rgba(99,102,241,0.55);
    background: rgba(99,102,241,0.09);
}

/* Cover */

.sched-cover-wrap {
    position: relative;
    flex-shrink: 0;
}

.sched-cover {
    width: 48px;
    height: 66px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--surface);
    display: block;
}

.sched-ep-pill {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 20px;
    white-space: nowrap;
    line-height: 1.4;
    border: 1.5px solid var(--card);
}

/* Info */

.sched-info {
    flex: 1;
    min-width: 0;
    padding-left: 4px;
}

.sched-entry-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.sched-entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.sched-score {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--amber);
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 20px;
    padding: 2px 7px;
}

.sched-format {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px 7px;
    text-transform: capitalize;
}

.sched-genre {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    background: var(--glass);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 2px 7px;
    white-space: nowrap;
}

/* Time column */

.sched-time-col {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    min-width: 110px;
}

.sched-air-time {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.sched-countdown {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--accent-2);
    background: var(--accent-dim);
    border: 1px solid rgba(99,102,241,0.18);
    border-radius: 20px;
    padding: 3px 10px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sched-countdown.airing-now {
    color: var(--green);
    background: var(--green-dim);
    border-color: rgba(16,185,129,0.2);
    animation: airing-pulse 2s ease infinite;
}

.sched-aired-badge {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 10px;
    white-space: nowrap;
}

/* Skeleton */

.sched-skeleton {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sched-entry-skeleton {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 12px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.sched-sk-cover {
    width: 48px;
    height: 66px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.sched-sk-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sched-sk-title {
    height: 16px;
    width: 55%;
    border-radius: var(--radius-xs);
}

.sched-sk-meta {
    height: 12px;
    width: 35%;
    border-radius: var(--radius-xs);
}

.sched-sk-time {
    width: 80px;
    height: 28px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-search { width: 100%; margin-left: var(--space-md); }

    .anime-card { flex: 0 0 145px; }

    .hero-content { padding: var(--space-xl) var(--content-pad); }
    .hero-title { max-width: 100%; font-size: clamp(1.5rem, 5vw, 2.5rem); }
    .hero-desc { display: none; }

    .detail-header { flex-direction: column; align-items: center; text-align: center; }
    .detail-poster { width: 160px; }
    .detail-meta { justify-content: center; flex-wrap: wrap; }
    .detail-desc { max-width: 100%; }
    .detail-actions { justify-content: center; width: 100%; }
    .detail-actions .btn { flex: 1; justify-content: center; }

    .carousel::after { width: 30px; }

    .episodes-header { flex-direction: column; gap: var(--space-sm); align-items: flex-start; }
    .episodes-header > div { width: 100%; }

    .ep-chip { min-width: 40px; height: 40px; }
    .ep-range-chip { padding: 6px 12px; }

    .section-header { flex-direction: column; gap: var(--space-sm); align-items: flex-start; }

    .filter-select { height: 42px; font-size: var(--text-base); }
    .filters-bar { gap: var(--space-xs); }

    .page-header { padding-top: calc(var(--nav-h) + var(--space-lg)); }
    .page-title { font-size: var(--text-xl); }
}

@media (max-width: 480px) {
    .anime-card { flex: 0 0 125px; }
    .carousel-btn { display: none; }
    .hero { height: clamp(380px, 60vh, 550px); }
    .hero-nav { display: none; }
    .hero-actions .btn { padding: 10px 18px; font-size: var(--text-xs); }

    .carousel::after { display: none; }

    .detail-title { font-size: var(--text-lg); }
    .detail-banner { height: 260px; }

    .sched-entry-title { font-size: var(--text-sm); }
    .sched-time-col { min-width: 70px; }
    .sched-entry-meta { display: none; }
    .sched-cover { width: 40px; height: 56px; }

    .nav-inner { gap: var(--space-md); }
    .logo-text { font-size: var(--text-base); }
    .logo-img { width: 34px; height: 34px; }
    .search-input { height: 36px; font-size: var(--text-xs); }

    .player-container { border-radius: 0; }
    .volume-group { display: none; }
    .time-display { font-size: 10px; }
    #pipBtn { display: none; }
}

/* ── Safe areas (notch devices) ─────────────────────────── */
@supports (padding: env(safe-area-inset-top)) {
    .nav { padding-top: env(safe-area-inset-top); }
    .player-container.fullscreen {
        padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    }
    .footer { padding-bottom: env(safe-area-inset-bottom); }
}

/* ── Touch device optimizations ─────────────────────────── */
@media (hover: none) and (pointer: coarse) {
    /* Always show carousel buttons on touch — no hover */
    .carousel-btn { opacity: 0.7; }

    /* Larger touch targets */
    .ctrl-btn { min-width: 44px; min-height: 44px; }
    .ep-chip { min-height: 44px; }
    .nav-link { padding: 8px 14px; }
    .dropdown-item { padding: 12px 16px 12px 36px; }

    /* Disable hover-only effects */
    .anime-card:hover { transform: none; }
    .anime-card:active { transform: scale(0.97); }
    .btn:hover { transform: none; }
    .btn:active { transform: scale(0.96); }

    /* Show player controls always on touch (no mouse hover) */
    .player-container .player-controls { opacity: 1; }
    .player-container.controls-hidden .player-controls { opacity: 0; }

    /* Hide keyboard-only features */
    .shortcuts-overlay { display: none !important; }

    /* Seek preview not practical on touch */
    .seek-preview { display: none; }

    /* Volume bar hidden on mobile — use device volume */
    .vol-bar-wrap { display: none; }

    /* Wider seek bar hit area for thumbs */
    .seek-bar::before { top: -14px; bottom: -14px; }
}
