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

:root {
    --bg-base: #080808;
    --bg-surface: #0d0d0d;
    --bg-elevated: #111111;
    --bg-card: #0f0f0f;
    --bg-card-hover: #1a1a1a;
    --accent-v: #7c3aed;
    --accent-v2: #9d6ef8;
    --accent-c: #5b21b6;
    --accent-c2: #c4b5fd;
    --accent-green: #22c55e;
    --accent-pink: #be185d;
    --grad-accent: linear-gradient(135deg, #7c3aed, #4c1d95);
    --grad-card: linear-gradient(180deg, transparent 35%, rgba(8, 8, 8, 0.99) 100%);
    --grad-hero: linear-gradient(0deg, rgba(8, 8, 8, 0.95) 0%, rgba(8, 8, 8, 0.3) 50%, transparent 100%);
    --text-primary: #ffffff;
    --text-secondary: #777790;
    --text-muted: #404050;
    --border: rgba(255, 255, 255, 0.07);
    --border-bright: rgba(124, 58, 237, 0.5);
    --glass-bg: rgba(8, 8, 8, 0.85);
    --glass-border: rgba(255, 255, 255, 0.06);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-pill: 999px;
    --shadow-card: 0 4px 32px rgba(0, 0, 0, 0.8);
    --shadow-hover: 0 8px 40px rgba(124, 58, 237, 0.35);
    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    --header-h: 62px;
    --max-w: 1380px;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: none;
}

::-webkit-scrollbar {
    display: none;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

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

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

ul,
ol {
    list-style: none;
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 28px;
}

.grad-text {
    background: var(--grad-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: var(--radius-pill);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #e11d48, #881337);
    color: #fff;
    box-shadow: 0 0 22px rgba(225, 29, 72, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 30px rgba(225, 29, 72, 0.55);
}

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

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

.btn-sm {
    padding: 7px 16px;
    font-size: 0.82rem;
}

.btn-icon {
    padding: 10px;
    border-radius: 50%;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-accent {
    background: rgba(139, 92, 246, 0.18);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-cyan {
    background: rgba(6, 182, 212, 0.15);
    color: #67e8f9;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-score {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-pink {
    background: rgba(236, 72, 153, 0.15);
    color: #f9a8d4;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
}

.section-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 22px;
    background: var(--grad-accent);
    border-radius: 2px;
}

.section-link {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--accent-v2);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.section-link:hover {
    color: var(--accent-c2);
    gap: 8px;
}

.genre-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0 32px;
    scrollbar-width: none;
}

.genre-bar::-webkit-scrollbar {
    display: none;
}

.genre-pill {
    padding: 9px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
}

.genre-pill:hover {
    background: var(--accent-v);
    border-color: var(--border-bright);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}

.anime-card {
    position: relative;
    flex-shrink: 0;
    width: 158px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.anime-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--border-bright);
    box-shadow: var(--shadow-hover);
}

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

.anime-card:hover .card-quick {
    opacity: 1;
    transform: translateY(0);
}

.anime-card:hover .card-poster img {
    transform: scale(1.05);
    /* Reduced from 1.07 to avoid clipping heads */
}

.card-poster {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

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

.card-overlay {
    position: absolute;
    inset: 0;
    background: var(--grad-card);
    opacity: 0;
    transition: var(--transition);
}

.card-quick {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    opacity: 0;
    transform: translateY(8px);
    transition: var(--transition);
}

.card-quick-btn {
    width: 100%;
    padding: 7px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #e11d48, #881337);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    font-family: 'Outfit', sans-serif;
}

.card-rank {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--grad-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
}

.card-badge-ep {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.72);
    font-size: 0.7rem;
    font-weight: 600;
    color: #67e8f9;
    border: 1px solid rgba(6, 182, 212, 0.3);
    backdrop-filter: blur(4px);
}

.card-body {
    padding: 10px 10px 12px;
}

.card-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.card-meta-item {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}

.card-score {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6ee7b7;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ── Genre Bar Navigation Arrows ────────────────────────────── */
.genre-nav-wrap:hover .genre-nav-btn {
    opacity: 1;
    pointer-events: auto;
}

.genre-nav-btn {
    position: absolute;
    /* USER: Edit this 'top' value to move the arrows up or down on the Y axis! */
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(8, 8, 8, 0.8) !important;
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.genre-nav-btn:hover {
    background: var(--accent-v) !important;
    border-color: var(--border-bright) !important;
    color: #fff !important;
}

.genre-nav-btn.prev {
    left: -18px;
    /* Offset outside the container slightly */
}

.genre-nav-btn.next {
    right: -18px;
}

@media (max-width: 768px) {
    .genre-nav-btn {
        display: none !important;
        /* Hide arrows on mobile where touch scroll is native */
    }
}

/* ── Watch History Cards ───────────────────────────────────── */
.history-card {
    position: relative;
    flex-shrink: 0;
    width: 280px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.history-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-bright);
    box-shadow: var(--shadow-hover);
}

.history-poster {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    cursor: pointer;
}

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

.history-card:hover .history-poster img {
    transform: scale(1.05);
}

.history-progress-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.4);
    z-index: 5;
}

.history-progress-bar {
    height: 100%;
    background: #e11d48;
    box-shadow: 0 0 10px #e11d48;
}

.history-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}

.history-play-icon svg {
    width: 32px;
    height: 32px;
}

.history-card:hover .history-play-icon {
    opacity: 1;
}

.history-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    z-index: 10;
}

.history-remove svg {
    width: 14px;
    height: 14px;
}

.history-card:hover .history-remove {
    opacity: 1;
}

.history-remove:hover {
    background: #e11d48;
    transform: scale(1.1);
}

.history-ep-tag {
    position: absolute;
    bottom: 12px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 3;
}

.history-body {
    padding: 12px;
    cursor: pointer;
}

.history-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.history-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scroll-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 12px 0 12px;
    /* Added top padding; bottom was 8px */
    margin-top: -12px;
    /* Offset top padding to maintain heading gap */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-v) transparent;
}

.scroll-row::-webkit-scrollbar {
    height: 4px;
}

.scroll-row::-webkit-scrollbar-thumb {
    background: var(--accent-v);
    border-radius: 99px;
}

.scroll-row .anime-card {
    scroll-snap-align: start;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card-hover) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

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

    100% {
        background-position: -200% 0;
    }
}

.skel-card {
    width: 158px;
    flex-shrink: 0;
}

.skel-poster {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.skel-line {
    height: 11px;
    margin: 8px 10px;
    border-radius: 6px;
}

.skel-line-sm {
    width: 55%;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

@keyframes glow-pulse {

    0%,
    100% {
        opacity: .7;
    }

    50% {
        opacity: 1;
    }
}

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

.loading-center {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px;
}

/* ── Redirection Overlay ────────────────────────────────────── */
.redirect-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(8, 8, 8, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: fadeIn 0.3s ease;
}

.redirect-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--accent-v);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin-bottom: 20px;
}

.redirect-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-h);
    transition: var(--transition);
}

#header.scrolled {
    background: rgba(7, 7, 15, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
}

#header .container {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo-icon {
    display: none;
}

.logo-wordmark {
    display: flex;
    align-items: flex-end;
    gap: 0.3em;
    line-height: 1;
}

.logo-wordmark .l {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.2rem;
    font-weight: 400;
    line-height: 1;
    color: #ffffff;
}

.logo-sub {
    display: none;
}

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

nav a {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

nav a:hover,
nav a.active {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.15);
}

.search-wrap {
    flex: 1;
    max-width: 360px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 9px 16px 9px 42px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-v);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.search-icon svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.autocomplete {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: none;
}

.autocomplete.open {
    display: block;
    animation: fadeUp 0.18s ease;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition);
}

.autocomplete-item:hover {
    background: rgba(139, 92, 246, 0.12);
}

.autocomplete-item img {
    width: 36px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.autocomplete-item-title {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
}

.autocomplete-item-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

#hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    max-height: 850px;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.7s ease;
    pointer-events: none;
    z-index: 0;
}

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.hero-bg {
    position: absolute;
    inset: 0;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transform: scale(1.04);
    transition: transform 8s ease;
}

.hero-slide.active .hero-bg img {
    transform: scale(1);
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: var(--grad-hero);
}

.hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding-top: var(--header-h);
    padding-bottom: 36px;
}

.hero-content .container {
    width: 100%;
}

.hero-info {
    flex-shrink: 0;
    max-width: 560px;
    animation: fadeUp 0.6s ease both;
}

.hero-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.hero-title {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 14px;
}

.hero-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 18px;
    max-width: 440px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.hero-genre-tag {
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.hero-genre-tag:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--accent-v);
    color: var(--accent-v2);
}

.hero-stat-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.hero-prev,
.hero-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-pill);
    background: rgba(8, 8, 8, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    opacity: 0;
    pointer-events: none;
}

#hero:hover .hero-prev,
#hero:hover .hero-next {
    opacity: 1;
    pointer-events: auto;
}

.hero-prev {
    left: 20px;
}

.hero-prev:hover {
    background: var(--accent-v);
    border-color: var(--border-bright);
    transform: translate(-4px, -50%);
}

.hero-next {
    right: 20px;
}

.hero-next:hover {
    background: var(--accent-v);
    border-color: var(--border-bright);
    transform: translate(4px, -50%);
}

.hero-stat-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.hero-stat-chip svg {
    opacity: 0.6;
}

.hero-stat-divider {
    color: var(--text-muted);
    font-size: 0.7rem;
}

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

.hero-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    width: 100%;
}

.hero-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.hero-stat svg {
    color: var(--accent-v2);
    flex-shrink: 0;
}

.hero-cover-wrap {
    position: relative;
    flex-shrink: 0;
    animation: fadeIn 0.8s ease 0.3s both;
}

.hero-cover {
    width: 190px;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border);
    display: block;
}

.hero-cover-glow {
    position: absolute;
    inset: -14px;
    border-radius: 32px;
    background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.28), transparent 70%);
    z-index: -1;
    animation: glow-pulse 3s ease infinite;
}

.hero-prev {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(14, 14, 28, 0.6);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}

.hero-prev:hover {
    background: rgba(124, 58, 237, 0.35);
    border-color: var(--accent-v);
}

.hero-indicators {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}

.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: var(--transition);
}

.hero-dot.active {
    width: 28px;
    background: var(--accent-v);
}

.hero-next {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(10, 10, 18, 0.75);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
}

.hero-next:hover {
    background: rgba(124, 58, 237, 0.35);
    border-color: var(--accent-v);
}

#hero:hover .hero-next,
#hero:hover .hero-prev {
    opacity: 1;
    pointer-events: auto;
}

#main-content {
    padding: 56px 0;
}

.content-section {
    margin-bottom: 52px;
}

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    background: var(--bg-elevated);
    border: 1px solid var(--border-bright);
    color: var(--text-primary);
    backdrop-filter: blur(12px);
    animation: fadeUp 0.25s ease;
    box-shadow: var(--shadow-card);
}

footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 32px 0 24px;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-brand-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
}

.footer-links-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links-row a {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.footer-links-row a:hover {
    color: var(--text-primary);
}

.footer-author {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.footer-author a {
    color: var(--accent-v2);
    margin-left: 6px;
}

.footer-bottom {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 500px;
    line-height: 1.4;
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    nav {
        display: none;
    }
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
}

.mobile-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-btn.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.open span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .anime-card {
        width: 130px;
    }

    .skel-card {
        width: 130px;
    }

    .hero-next,
    .hero-prev {
        display: none !important;
    }

    #hero {
        max-height: 680px;
    }

    .hero-info {
        max-width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero-cover-wrap {
        display: none;
    }

    .hero-layout {
        gap: 0;
    }

    #main-nav {
        display: none;
    }

    .search-wrap {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }
}




.mobile-nav {
    display: none;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--border);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
}

.mobile-nav.open {
    display: flex;
}

.mobile-search-wrap {
    position: relative;
    padding: 14px 16px 10px;
}

.mobile-search-wrap .search-icon {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.mobile-search-wrap .search-input {
    width: 100%;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    padding: 0 16px 14px;
    gap: 2px;
}

.mobile-nav-links a {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    background: rgba(124, 58, 237, 0.12);
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .anime-card {
        width: 112px;
    }

    .skel-card {
        width: 112px;
    }

    .hero-title {
        font-size: 1.6rem;
    }
}

.genre-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 14px 0 12px;
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
    margin-bottom: 40px;
}

.genre-bar::-webkit-scrollbar {
    display: none;
}

.genre-pill {
    flex-shrink: 0;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.genre-pill:hover,
.genre-pill.active {
    background: rgba(124, 58, 237, 0.18);
    border-color: var(--accent-v);
    color: var(--accent-v2);
}

.card-airing-dot {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.home-grid {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 28px;
    align-items: start;
}

.home-sections {
    min-width: 0;
    /* Prevents flex/grid children from blowing out the 1fr container */
}

.sidebar-widget {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.sidebar-tabs {
    display: flex;
    gap: 16px;
    padding: 14px 16px 0;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-tab {
    padding: 0 0 10px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.sidebar-tab:hover {
    color: var(--text-primary);
}

.sidebar-tab.active {
    color: var(--accent-v2);
    border-bottom-color: var(--accent-v);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
}

.sidebar-item:last-child {
    border-bottom: none;
}

.sidebar-item:hover {
    background: var(--bg-elevated);
}

.sidebar-thumb {
    width: 50px;
    height: 68px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.sidebar-rank {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    width: 18px;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.sidebar-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

@media (max-width: 1024px) {
    .home-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-widget {
        margin-top: 20px;
        position: static;
    }
}

/* Row Nav Hover */
.content-section .row-nav-btn {
    opacity: 0.3;
    pointer-events: auto;
    transform: translateX(10px);
    transition: var(--transition);
}

.content-section:hover .row-nav-btn {
    opacity: 1;
    transform: translateX(0);
}

/* Row Nav Hover */
.content-section .row-nav-btn {
    opacity: 0.3;
    pointer-events: auto;
    transform: translateX(10px);
    transition: var(--transition);
}

.content-section:hover .row-nav-btn {
    opacity: 1;
    transform: translateX(0);
}

/* =========================================
   BROWSE PAGE STYLES
   ========================================= */
.browse-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    align-items: start;
}

.browse-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 24px);
}

.filter-widget {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.filter-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.filter-group {
    margin-bottom: 18px;
}

.filter-label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 700;
}

.filter-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    outline: none;
}

.filter-select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.filter-genres {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 8px;
}

.filter-genres::-webkit-scrollbar {
    width: 4px;
}

.filter-genres::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.genre-cb {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.genre-cb:hover {
    color: var(--text-primary);
}

.genre-cb input {
    accent-color: var(--accent-v);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.filter-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.browse-main {
    min-width: 0;
}

.browse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.browse-title {
    font-size: 1.8rem;
    font-weight: 800;
}

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

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
}

@media (max-width: 1024px) {
    .browse-layout {
        grid-template-columns: 1fr;
    }

    .browse-sidebar {
        position: static;
        margin-bottom: 30px;
    }
}

@media (max-width: 600px) {
    .browse-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 16px;
    }
}

/* =========================================
   WATCH / DETAIL PAGE STYLES
   ========================================= */
.watch-container {
    padding-top: 24px;
}

.watch-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    margin-bottom: 40px;
    align-items: start;
}

.watch-sidebar {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    max-height: 600px;
    overflow: hidden;
    position: sticky;
    top: calc(var(--header-h) + 24px);
}

.ep-list-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
}

.ep-list-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
}

.audio-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.audio-btn {
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
}

.audio-btn.active {
    background: var(--accent-v);
    color: #fff;
}

.ep-search-wrap {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.01);
}

.ep-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.82rem;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.ep-search-input:focus {
    border-color: var(--accent-v);
    background: rgba(255, 255, 255, 0.08);
}

.ep-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.ep-list::-webkit-scrollbar {
    width: 5px;
}

.ep-list::-webkit-scrollbar-thumb {
    background: var(--border-bright);
    border-radius: 10px;
}

.ep-item {
    display: flex;
    gap: 14px;
    padding: 13px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    margin-bottom: 6px;
}

.ep-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.ep-item.active {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.3);
}

/* ── Filler Episode Styles ─────────────────────────────────── */
.ep-item.filler-ep {
    background: rgba(234, 179, 8, 0.05);
    /* Yellow tinted background */
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.ep-item.filler-ep:hover {
    background: rgba(234, 179, 8, 0.1);
    border-color: rgba(234, 179, 8, 0.4);
}

.ep-item.filler-ep.active {
    background: rgba(234, 179, 8, 0.15);
    border-color: rgba(234, 179, 8, 0.6);
}

.ep-filler-warn {
    font-size: 0.7rem;
    font-weight: 700;
    color: #facc15;
    /* Bright yellow */
    margin-top: 4px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}


.ep-img-wrap {
    width: 130px;
    aspect-ratio: 16/9;
    flex-shrink: 0;
    position: relative;
    border-radius: 7px;
    overflow: hidden;
    background: var(--bg-elevated);
}

.ep-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ep-num-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
}

.ep-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ep-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ep-item.active .ep-item-title {
    color: var(--accent-v2);
}

.ep-item-air {
    font-size: 0.73rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.ep-load-more {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: none;
    border-top: 1px solid var(--border);
    color: var(--accent-v2);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ep-load-more:hover {
    background: rgba(124, 58, 237, 0.05);
}

.ep-load-more svg {
    width: 16px;
    height: 16px;
}

/* Player Area */
.player-wrapper {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    margin-bottom: 24px;
    position: relative;
}

.player-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1a1a2e, #07070f);
    color: var(--text-muted);
}

.player-placeholder svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.watch-player-info {
    padding: 0 4px;
}

.watch-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.watch-ep-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent-v2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.watch-ep-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Detail Area */
.anime-detail-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 32px;
}

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

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

.detail-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, var(--bg-surface));
}

.detail-body {
    padding: 0 32px 32px;
    margin-top: -60px;
    position: relative;
    z-index: 2;
    display: flex;
    gap: 32px;
}

.detail-poster {
    width: 180px;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-bright);
    flex-shrink: 0;
}

.detail-main {
    flex: 1;
}

.detail-title-large {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 12px;
}

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

.detail-genre-tag {
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.detail-desc {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 900px;
}

.detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border);
}

.detail-stat-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-box-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.stat-box-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive Watch Page */
@media (max-width: 1200px) {
    .watch-layout {
        display: flex;
        flex-direction: column-reverse;
        gap: 20px;
    }

    .watch-main {
        width: 100%;
    }

    .watch-sidebar {
        width: 100%;
        max-height: 500px;
        position: static;
    }
}

@media (max-width: 768px) {
    .detail-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -80px;
    }

    .detail-genres {
        justify-content: center;
    }

    .detail-title-large {
        font-size: 1.6rem;
    }

    .detail-desc {
        font-size: 0.88rem;
    }
}

/* ── Server Panel ───────────────────────────────────────────── */
.server-panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-top: 10px;
    margin-bottom: 4px;
}

.server-panel-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}

.server-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.server-group-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.server-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.server-btn {
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.server-btn:hover {
    border-color: var(--border-bright);
    color: var(--accent-c2);
    background: rgba(124, 58, 237, 0.08);
}

.server-btn.active {
    border-color: var(--accent-v);
    background: rgba(124, 58, 237, 0.18);
    color: var(--accent-c2);
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.3);
}

.server-btn-tag {
    display: inline-block;
    margin-left: 5px;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(124, 58, 237, 0.25);
    color: var(--accent-c2);
    vertical-align: middle;
}

.server-btn-tag--embed {
    background: rgba(20, 184, 166, 0.2);
    color: #5eead4;
}

.server-quality-wrap {
    margin-left: auto;
    align-self: flex-end;
}

.server-quality-select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 5px 28px 5px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    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='%23777790' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: var(--transition);
}

.server-quality-select:focus {
    outline: none;
    border-color: var(--border-bright);
    color: var(--text-primary);
}

.server-quality-select option {
    background: #111;
    color: #fff;
}

.server-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    color: var(--text-secondary);
    font-size: 0.83rem;
}

.server-loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-v);
    animation: pulse-dot 1.2s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.7);
    }
}

.server-error {
    padding-top: 10px;
    color: #f87171;
    font-size: 0.83rem;
}

/* ── Player Spinner ─────────────────────────────────────────── */
.player-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(124, 58, 237, 0.2);
    border-top-color: var(--accent-v);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

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

.player-unsupported {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f87171;
    font-size: 0.9rem;
    width: 100%;
    height: 100%;
    background: #000;
}

@media (max-width: 600px) {
    .server-panel-row {
        flex-direction: column;
        gap: 12px;
    }

    .server-quality-wrap {
        margin-left: 0;
    }
}

/* ── Watch Page Bottom Layout ────────────────────────────────────── */
.watch-bottom-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    align-items: start;
    margin-top: 28px;
}

/* ── Recommended Sidebar ─────────────────────────────────────────── */
.watch-rec-sidebar {
    position: sticky;
    top: 80px;
}

.watch-rec-sidebar .sidebar-title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

.rec-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rec-item {
    display: flex;
    flex-direction: row;
    /* Changed to row for posters */
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    text-decoration: none;
    transition: var(--transition);
    background: transparent;
    align-items: center;
    height: 105px;
    /* Uniform height as requested */
    overflow: hidden;
}

.rec-poster {
    width: 60px;
    height: 85px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

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

.rec-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.rec-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--transition);
    margin-bottom: 4px;
}

.rec-item:hover .rec-title {
    color: var(--accent-v2);
}

.rec-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.rec-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: rgba(124, 58, 237, 0.2);
    color: var(--accent-c2);
}

.rec-badge--dub {
    background: rgba(20, 184, 166, 0.18);
    color: #5eead4;
}

@media (max-width: 900px) {
    .watch-bottom-layout {
        grid-template-columns: 1fr;
    }

    .watch-rec-sidebar {
        position: static;
    }
}

/* Global Toast System */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-item {
    pointer-events: all;
    width: 320px;
    background: rgba(15, 17, 26, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: toast-in 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.toast-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #7c3aed;
}

.toast-item.error::before {
    background: #e85d75;
}

.toast-icon {
    color: #8b5cf6;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-item.error .toast-icon {
    color: #e85d75;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 4px;
    margin-top: -4px;
    margin-right: -4px;
    font-size: 16px;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #fff;
}

@keyframes toast-in {
    0% {
        opacity: 0;
        transform: translateX(30px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

#mobile-autocomplete {
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    z-index: 1000;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#mobile-autocomplete.open {
    display: block;
}

/* ── Changelog Modal ─────────────────────────────────────────── */
.changelog-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.changelog-modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 24px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: modal-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modal-pop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.changelog-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.changelog-close:hover {
    color: #fff;
}

.changelog-modal-content h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: #fff;
    padding-right: 24px;
}

.changelog-body {
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 8px;
}

.changelog-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 14px;
}

.changelog-item-title {
    font-weight: 700;
    color: var(--accent-v2);
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.changelog-item-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}