/* ==========================================================================
   OriginRealm Unified Stylesheet Bundle
   ========================================================================== */


/* --- theme.css --- */
/* ============================================
   OriginRealm Theme - CSS Variables
   Colors from series detail page for other views
   ============================================ */

:root {
    /* Background Colors */
    --bg-primary: #182232;
    --bg-secondary: #1c2638;
    --bg-tertiary: #243044;
    --bg-gradient: linear-gradient(180deg, #182232 0%, #121924 100%);
    
    /* Card & Container Backgrounds (Glassmorphism) */
    --card-bg: rgba(28, 38, 56, 0.85);
    --card-bg-hover: rgba(36, 48, 68, 0.95);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-border: rgba(99, 102, 241, 0.4);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #e5e7eb;
    --text-tertiary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Accent Colors */
    --accent-primary: #3b82f6; /* Sleek Electric Blue */
    --accent-primary-hover: #60a5fa;
    --accent-primary-transparent: rgba(59, 130, 246, 0.15);
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    
    /* Status Colors */
    --status-ongoing: #10b981;
    --status-completed: #3b82f6;
    --status-pending: #f59e0b;
    --status-failed: #ef4444;
    --status-processing: #6366f1;
    
    /* Border & Divider */
    --border: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.2);
    --border-accent: rgba(59, 130, 246, 0.4);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
    
    /* Backdrop Filter */
    --backdrop-blur: blur(12px);
    --backdrop-blur-sm: blur(8px);
}

[data-theme="light"] {
    --bg-primary: #182232;
    --bg-secondary: #1c2638;
    --bg-tertiary: #243044;
    --bg-gradient: linear-gradient(180deg, #182232 0%, #121924 100%);
    --card-bg: rgba(28, 38, 56, 0.85);
    --card-bg-hover: rgba(36, 48, 68, 0.95);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-border: rgba(99, 102, 241, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-tertiary: #cbd5e1;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 24px 50px rgba(0, 0, 0, 0.5);
}

/* ============================================
   Apply theme to all views except detail page
   ============================================ */

/* Skip applying to series detail page */
body:not(.series-detail) {
    background: var(--bg-primary);
    background: var(--bg-gradient);
    color: var(--text-primary);
}

/* Update card backgrounds for other views */
body:not(.series-detail) .card,
body:not(.series-detail) .channel-card,
body:not(.series-detail) .slide {
    background: var(--card-bg);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--card-border);
}

/* Update footer backgrounds for other views */
body:not(.series-detail) footer {
    background: var(--bg-primary);
    border-color: var(--card-border);
}

/* Update accent colors for buttons and links for other views */
body:not(.series-detail) .btn-primary,
body:not(.series-detail) .tag,
body:not(.series-detail) .genre-tag,
body:not(.series-detail) .pagination .page-item.active .page-link {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: 1px solid var(--accent-primary);
}

body:not(.series-detail) .btn-primary:hover,
body:not(.series-detail) .pagination .page-item.active .page-link:hover {
    background: var(--accent-primary-hover);
    border-color: var(--accent-primary-hover);
}

body:not(.series-detail) .btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

body:not(.series-detail) .btn-secondary:hover {
    background: var(--card-bg);
    border-color: var(--accent-primary);
}

/* Update navigation colors for other views */
body:not(.series-detail) nav a {
    color: var(--text-primary);
}

body:not(.series-detail) nav a:hover {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* Update search bar for other views */
body:not(.series-detail) .search-bar input {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

body:not(.series-detail) .search-bar input::placeholder {
    color: var(--text-muted);
}

/* Update search suggestions for other views */
body:not(.series-detail) .search-suggestions {
    background: var(--card-bg);
    border: 1px solid var(--border);
}

body:not(.series-detail) .suggestion-item {
    border-bottom: 1px solid var(--border);
}

body:not(.series-detail) .suggestion-item:hover {
    background: var(--bg-secondary);
}

/* Update tag colors for other views */
body:not(.series-detail) .tag,
body:not(.series-detail) .genre-tag {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: 1px solid var(--accent-primary);
}

/* Update slider styles for other views */
body:not(.series-detail) .slide {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

body:not(.series-detail) .slider-btn {
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

body:not(.series-detail) .slider-btn:hover {
    background: var(--accent-primary-transparent);
    color: var(--accent-primary);
    border-color: var(--border-accent);
}

/* Update rating stars for other views */
body:not(.series-detail) .rating {
    color: var(--accent-primary);
}

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

@media (max-width: 768px) {
    body:not(.series-detail) {
        background: var(--bg-primary);
    }
}



/* --- base.css --- */
[x-cloak] {
    display: none !important;
}

:root {
    --bg-primary: #182232;
    --bg-secondary: #1c2638;
    --bg-card: #1c2638;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-secondary: #8b5cf6;
    --accent-secondary-hover: #a78bfa;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(28, 38, 56, 0.94);
    --glass-border: rgba(99, 102, 241, 0.25);
    --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
    --bg-primary: #182232;
    --bg-secondary: #1c2638;
    --bg-card: #1c2638;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-secondary: #8b5cf6;
    --accent-secondary-hover: #a78bfa;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(28, 38, 56, 0.94);
    --glass-border: rgba(99, 102, 241, 0.25);
    --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

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

html {
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
    background-color: #182232;
    background: var(--bg-primary, #182232);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-x: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Hide Vite dev indicator only — do not blanket-hide fixed bottom bars (cookie consent) */
#vite-plugin-checker-notification-root,
[data-vite-dev-id] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

#cookie-consent-banner {
    pointer-events: auto;
}

/* Hide close button */
.close-btn {
    display: none !important;
}

/* Hide JSON output that might appear on page */
body > pre:only-child {
    display: none !important;
}

/* Image Quality Improvements */
img {
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.p-1 { padding: 1rem; }
.p-2 { padding: 2rem; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}


/* --- header.css --- */
/* Header - Stays permanently dark across all themes */
header {
    background: rgba(9, 9, 11, 0.88) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    padding: 2rem 0;
    min-height: 95px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    isolation: isolate;
}

.header-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo span {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo:hover {
    transform: scale(1.03);
}

nav {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

nav ul.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.header-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: transparent;
}

.header-nav-btn:hover {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.18);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25);
}

/* Active page indicator */
.header-nav-btn--active {
    color: #ffffff !important;
    background: rgba(99, 102, 241, 0.22) !important;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4), 0 4px 12px rgba(99, 102, 241, 0.15) !important;
    position: relative;
}

.header-nav-btn--active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 2px;
    background: linear-gradient(90deg, #818cf8, #6366f1);
    border-radius: 2px;
}

.header-nav-btn--active svg {
    opacity: 1;
    color: #a5b4fc;
}

.header-nav-btn svg {
    opacity: 0.75;
    transition: all 0.2s ease;
}

.header-nav-btn:hover svg {
    opacity: 1;
    transform: scale(1.1);
}

.search-bar {
    flex: 1;
    max-width: 320px;
    position: relative;
}

.search-form {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.7rem 2.8rem 0.7rem 1.4rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 25px;
    color: #ffffff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(243, 156, 18, 0.6);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.15);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.search-btn:hover {
    color: #F39C12;
    background: rgba(255, 255, 255, 0.05);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.btn-donate {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.7rem 1.6rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
    transition: all 0.3s ease;
}

.btn-donate:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    filter: brightness(1.1);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1100;
}

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

.suggestion-item {
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.suggestion-item:hover {
    background: var(--bg-secondary);
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    padding: 10px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    box-sizing: border-box;
    font: inherit;
    color: inherit;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    z-index: 1100;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

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

.hamburger.is-open span:nth-child(2) {
    opacity: 0;
}

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

@media (max-width: 900px) {
    header {
        padding: 0.85rem 0;
        min-height: auto;
    }

    .hamburger {
        display: flex;
        order: 4;
    }

    .logo-section {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        position: relative;
        z-index: 2;
    }

    .header-actions {
        order: 2;
        z-index: 2;
        flex-shrink: 0;
    }

    .auth-buttons {
        order: 3;
        z-index: 2;
        flex-shrink: 0;
    }

    header nav,
    header .site-nav {
        display: none;
        width: 100%;
        order: 5;
        flex: 1 1 100%;
        position: relative;
        z-index: 1050;
        background: rgba(9, 9, 11, 0.96);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 12px;
        margin-top: 0.5rem;
        padding: 0.5rem;
        box-sizing: border-box;
    }

    header nav.active,
    header .site-nav.active {
        display: block;
    }

    header .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        padding: 0;
    }

    header .nav-links .header-nav-btn {
        width: 100%;
        padding: 0.85rem 1rem;
        min-height: 44px;
        box-sizing: border-box;
    }

    .header-container {
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 0.65rem;
    }

    .search-bar {
        order: 6;
        width: 100%;
        max-width: none;
        flex: 1 1 100%;
        position: relative;
        z-index: 1;
    }
}

body.nav-open {
    overflow: hidden;
}

/* Simple Profile Link */
.profile-link {
    display: inline-block;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    transition: all 0.3s ease;
}

.profile-link:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

/* Header profile avatar - must be 48px */
.auth-buttons .profile-avatar,
.profile-link .profile-avatar {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid #0f172a;
    transition: all 0.3s ease;
}

.profile-avatar-fallback {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    border: 2px solid #0f172a;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.45);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.25);
}

.theme-icon {
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.theme-toggle-btn:hover .theme-icon {
    transform: rotate(20deg) scale(1.1);
}

/* In Dark mode: show Sun icon, hide Moon icon */
html:not([data-theme="light"]) .theme-toggle-btn .sun-icon {
    display: block;
    color: #fbbf24;
}
html:not([data-theme="light"]) .theme-toggle-btn .moon-icon {
    display: none;
}

/* In Light mode: show Moon icon, hide Sun icon */
[data-theme="light"] .theme-toggle-btn .sun-icon {
    display: none;
}
[data-theme="light"] .theme-toggle-btn .moon-icon {
    display: block;
    color: #818cf8;
}

/* Guarantee header navbar is 100% identical in both Light and Dark mode */
header,
[data-theme="light"] header {
    background: rgba(9, 9, 11, 0.88) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5) !important;
}

header .logo,
[data-theme="light"] header .logo {
    color: #ffffff !important;
}

header .header-nav-btn,
[data-theme="light"] header .header-nav-btn {
    color: rgba(255, 255, 255, 0.75) !important;
    background: transparent !important;
}

header .header-nav-btn:hover,
[data-theme="light"] header .header-nav-btn:hover {
    color: #ffffff !important;
    background: rgba(99, 102, 241, 0.18) !important;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25) !important;
}

header .header-nav-btn--active,
[data-theme="light"] header .header-nav-btn--active {
    color: #ffffff !important;
    background: rgba(99, 102, 241, 0.22) !important;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.4), 0 4px 12px rgba(99, 102, 241, 0.15) !important;
}

header .search-input,
[data-theme="light"] header .search-input {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

header .search-input::placeholder,
[data-theme="light"] header .search-input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

header .search-btn,
[data-theme="light"] header .search-btn {
    color: rgba(255, 255, 255, 0.6) !important;
}

header .search-btn:hover,
[data-theme="light"] header .search-btn:hover {
    color: #F39C12 !important;
}

header .theme-toggle-btn,
[data-theme="light"] header .theme-toggle-btn {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

header .hamburger span,
[data-theme="light"] header .hamburger span {
    background: #ffffff !important;
}






/* --- cards.css --- */
/* Featured Slider */
.featured-slider {
    max-width: 1320px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 2rem;
    position: relative;
    box-sizing: border-box;
}

.slider-wrapper {
    overflow: hidden;
    border-radius: 18px;
    background: radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.2) 0%, rgba(15, 23, 42, 0.95) 90%);
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 30px rgba(99, 102, 241, 0.1);
    backdrop-filter: blur(20px);
}

.slider-container {
    display: flex;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
    transform: translateZ(0);
}

.slide {
    min-width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    display: flex;
    gap: 2.5rem;
    padding: 2.5rem;
    align-items: center;
    box-sizing: border-box;
    position: relative;
}

.slide-cover {
    width: 165px;
    height: 235px;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
    transform: translateZ(0);
}

.slide-cover:hover {
    transform: scale(1.03);
}

.slide-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.slide-info h2 {
    font-size: 2.1rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.6rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.rating {
    color: #fbbf24;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.genre-tags {
    display: flex;
    gap: 0.5rem;
    margin: 0.75rem 0 1rem 0;
    flex-wrap: wrap;
}

.tag {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.slide-info p {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slide-info .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    padding: 0.7rem 1.6rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45);
    transition: all 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.slide-info .btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

.slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 0.5rem;
    pointer-events: none;
}

.slider-btn {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.slider-btn:hover {
    background: rgba(99, 102, 241, 0.9);
    border-color: rgba(99, 102, 241, 0.5);
    transform: scale(1.1);
}

/* Grid & Cards */
.grid {
    max-width: 1320px !important;
    width: 100% !important;
    margin: 2rem auto !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)) !important;
    gap: 1.5rem !important;
    padding: 0 2rem !important;
    box-sizing: border-box;
}

.card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    position: relative;
    box-sizing: border-box;
    transform: translateZ(0);
    will-change: transform;
}

.card:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(99, 102, 241, 0.25);
}

.card-cover,
.card-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    object-position: center top;
    flex-shrink: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: #090e17;
    will-change: transform;
    transform: translateZ(0);
}

.card:hover .card-cover,
.card:hover .card-image {
    transform: scale(1.05);
}

.card-body {
    padding: 0.9rem 1rem 1rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 0.5rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.55rem;
    max-height: 2.55rem;
    word-break: break-word;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    margin-top: auto;
    padding-top: 0.4rem;
}

.type-badge {
    background: rgba(99, 102, 241, 0.18);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Card cover wrapper & overlay badges */
.card-cover-wrap {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.card-overlay-badges {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.8rem 0.6rem 0.6rem 0.6rem;
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    align-items: flex-end;
    background: linear-gradient(to top, rgba(5, 8, 20, 0.92) 0%, rgba(5, 8, 20, 0.5) 55%, transparent 100%);
    pointer-events: none;
}

.overlay-type-badge {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    background: rgba(99, 102, 241, 0.75);
    border: 1px solid rgba(99, 102, 241, 0.5);
    color: #e0e7ff;
    backdrop-filter: blur(4px);
}

.overlay-status-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    backdrop-filter: blur(4px);
    background: rgba(30, 30, 50, 0.7);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.overlay-status-badge.status-ongoing {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

.overlay-status-badge.status-completed {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: #93c5fd;
}

.card-rating {
    color: #fbbf24;
    font-weight: 700;
    font-size: 0.8rem;
}

/* Card display */
.reveal-card {
    opacity: 1;
    transform: none;
}

/* Channels */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.channel-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    align-items: center;
    position: relative;
}

.channel-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

.channel-info h3 {
    margin-bottom: 0.5rem;
}

.channel-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

.skeleton-card {
    height: 400px;
    border-radius: 8px;
}

/* Top 10 List */
.top-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.top-item {
    display: flex;
    gap: 1rem;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s;
}

.top-item:hover {
    transform: translateX(5px);
}

.rank-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent);
    min-width: 50px;
}

.top-item-cover {
    width: 80px;
    height: 100px;
    object-fit: cover;
    object-position: center;
    border-radius: 4px;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

.top-item-info {
    flex: 1;
}

.top-item-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* Unified Series Grid Styles */
.series-grid {
    max-width: 1280px !important;
    width: 100% !important;
    margin: 2rem auto !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 1.5rem !important;
    padding: 0 2rem !important;
}

.series-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.series-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.series-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    backface-visibility: hidden;
}

.series-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.series-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.series-type {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.series-status {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    background: var(--bg-secondary);
    margin-top: auto;
}

.filter-bar {
    max-width: 1280px;
    width: 100%;
    margin: 1.5rem auto;
    padding: 1rem 2rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 14px;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 200;
}

/* Hide native select — keep it for form POST, custom UI replaces it visually */
.filter-bar select {
    display: none !important;
}

/* ── Custom Select Component ── */
.cs-wrapper {
    position: relative;
    min-width: 130px;
}

.cs-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(99, 102, 241, 0.28);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    white-space: nowrap;
}

.cs-trigger:hover {
    border-color: rgba(99, 102, 241, 0.55);
    background: rgba(30, 41, 59, 1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.cs-trigger.cs-open {
    border-color: rgba(99, 102, 241, 0.7);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.cs-trigger-arrow {
    flex-shrink: 0;
    color: #818cf8;
    transition: transform 0.22s cubic-bezier(0.4,0,0.2,1);
}

.cs-trigger.cs-open .cs-trigger-arrow {
    transform: rotate(180deg);
}

.cs-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    background: rgba(10, 15, 30, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.55), 0 0 0 1px rgba(99,102,241,0.08);
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.4,0,0.2,1);
}

.cs-dropdown.cs-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.cs-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: #cbd5e1;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.cs-option:last-child {
    border-bottom: none;
}

.cs-option:hover {
    background: rgba(99, 102, 241, 0.18);
    color: #ffffff;
}

.cs-option.cs-selected {
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    font-weight: 700;
}

.cs-option.cs-selected::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #818cf8;
    border-radius: 50%;
    flex-shrink: 0;
}


.no-series {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    max-width: 1400px;
    margin: 2rem auto;
}

/* TikTok-style Follow Button */
.tiktok-follow-btn {
    position: absolute;
    bottom: 80px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.tiktok-follow-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

.tiktok-follow-btn.following {
    background: #10b981;
}

.tiktok-follow-btn .follow-icon {
    color: white;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

/* Promoted Series Section */
.promoted-section {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 140, 0, 0.1) 100%);
    border-radius: 12px;
    padding: 30px 20px;
    margin: 40px auto;
    max-width: 1280px;
}

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

.promoted-badge {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.promoted-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 2rem auto;
    max-width: 1280px;
    padding: 0 2rem;
}

.promoted-grid .card {
    width: 100%;
    flex-shrink: 0;
}

.promoted-card {
    position: relative;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.promoted-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
}

.promoted-card .card-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
    object-fit: cover;
    object-position: center;
}

.promoted-card .card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.promoted-card .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.promoted-card .card-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    margin: 0.5rem 0 0 0;
}

.promoted-ribbon {
    position: absolute;
    top: 8px;
    right: -3px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    padding: 3px 10px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.promoted-ribbon::before {
    content: '';
    position: absolute;
    bottom: -3px;
    right: 0;
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid #CC8400;
    border-top: 3px solid #CC8400;
}

/* Light Black / Midnight Slate Theme Card Overrides */
[data-theme="light"] .card,
[data-theme="light"] .series-card-glass,
[data-theme="light"] .channel-card-glass,
[data-theme="light"] .promoted-card {
    background: #1c2638 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="light"] .card:hover,
[data-theme="light"] .series-card-glass:hover,
[data-theme="light"] .channel-card-glass:hover,
[data-theme="light"] .promoted-card:hover {
    border-color: rgba(99, 102, 241, 0.5) !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(99, 102, 241, 0.25) !important;
    transform: translateY(-6px) scale(1.01) !important;
}

[data-theme="light"] .card-title,
[data-theme="light"] .series-title-glass,
[data-theme="light"] .promoted-card .card-title {
    color: #ffffff !important;
}

[data-theme="light"] .card-meta,
[data-theme="light"] .series-meta-glass,
[data-theme="light"] .promoted-card .card-description {
    color: #94a3b8 !important;
}

[data-theme="light"] .slider-wrapper {
    background: radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.2) 0%, rgba(28, 38, 56, 0.95) 90%) !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 30px rgba(99, 102, 241, 0.1) !important;
}

[data-theme="light"] .slide-info h2 {
    color: #ffffff !important;
}

[data-theme="light"] .slide-info p {
    color: #cbd5e1 !important;
}

[data-theme="light"] .tag {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    color: #a5b4fc !important;
}

[data-theme="light"] .type-badge {
    background: rgba(99, 102, 241, 0.18) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    color: #a5b4fc !important;
}

/* Buttons */
[data-theme="light"] .btn-read-more,
[data-theme="light"] .btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-theme="light"] .btn-read-more:hover,
[data-theme="light"] .btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
    color: #ffffff !important;
}

[data-theme="light"] .btn-details,
[data-theme="light"] .btn-warning,
[data-theme="light"] .btn-amber {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}





/* --- components.css --- */
/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Sections */
.section {
    max-width: 1320px;
    width: 100%;
    margin: 3rem auto;
    padding: 0 2rem;
}

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

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.02em;
    position: relative;
    padding-left: 1.1rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
}

.view-all {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #a5b4fc;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.view-all:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
    color: #c7d2fe;
    transform: translateX(2px);
}

/* Legal / static content pages */
.legal-page {
    position: relative;
    z-index: 1;
    max-width: 920px;
    margin: 0 auto;
    padding: 4rem 1.5rem 5rem;
}

.legal-hero {
    text-align: center;
    margin-bottom: 3rem;
}

.legal-hero-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.35rem;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.legal-hero-icon svg {
    width: 34px;
    height: 34px;
}

.legal-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.04em;
    margin: 0 0 0.75rem;
}

.legal-hero h1 span {
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.legal-hero .meta {
    color: #94a3b8;
    font-size: 1.05rem;
    margin: 0;
}

.legal-card {
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: clamp(1.75rem, 4vw, 3rem);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    color: #cbd5e1;
    line-height: 1.8;
}

.legal-card h2 {
    font-size: 1.35rem;
    color: #fff;
    font-weight: 700;
    margin: 0 0 0.85rem;
}

.legal-card p {
    margin: 0 0 1.75rem;
}

.legal-card p:last-child {
    margin-bottom: 0;
}

.legal-card a {
    color: #60a5fa;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-card ul {
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
}

.legal-card li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.65rem;
    color: #94a3b8;
}

.legal-card li svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.legal-notice {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 14px;
    padding: 1.15rem 1.35rem;
    margin-bottom: 2rem;
    color: #fca5a5;
    font-size: 0.95rem;
}

.legal-notice svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: #f87171;
    margin-top: 0.1rem;
}

.pay-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
}

.pay-badge svg {
    width: 18px;
    height: 18px;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
    color: #cbd5e1;
    font-size: 0.95rem;
}

.check-row svg {
    width: 18px;
    height: 18px;
    color: #10b981;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

/* OriginRealm custom HTTP error pages */
.or-error {
    position: relative;
    isolation: isolate;
    min-height: min(68vh, 720px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.25rem 5rem;
    overflow: hidden;
}

.or-error-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(8px);
}

.or-error-glow-a {
    width: min(520px, 80vw);
    height: min(520px, 80vw);
    top: -12%;
    left: 50%;
    transform: translateX(-55%);
    background: radial-gradient(circle, var(--or-error-glow, rgba(96, 165, 250, 0.22)) 0%, transparent 68%);
    animation: or-error-pulse 7s ease-in-out infinite;
}

.or-error-glow-b {
    width: min(380px, 70vw);
    height: min(380px, 70vw);
    bottom: -8%;
    right: 8%;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.9) 0%, transparent 70%);
}

@keyframes or-error-pulse {
    0%, 100% { opacity: 0.75; transform: translateX(-55%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.06); }
}

.or-error-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    text-align: center;
    padding: 2.75rem 2rem 2.5rem;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(22, 32, 52, 0.92), rgba(10, 15, 28, 0.94));
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.02) inset,
        0 28px 60px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: or-error-rise 0.55s ease-out;
}

@keyframes or-error-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.or-error-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.35rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--or-error-accent, #60a5fa);
    background: color-mix(in srgb, var(--or-error-accent, #60a5fa) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--or-error-accent, #60a5fa) 40%, transparent);
    box-shadow: 0 0 28px var(--or-error-glow, rgba(96, 165, 250, 0.22));
}

.or-error-icon svg {
    width: 34px;
    height: 34px;
}

.or-error-code {
    margin: 0 0 0.65rem;
    font-size: clamp(3.5rem, 10vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 0.95;
    color: var(--or-error-accent, #60a5fa);
    text-shadow: 0 0 40px var(--or-error-glow, rgba(96, 165, 250, 0.35));
}

.or-error-title {
    margin: 0 0 0.85rem;
    font-size: clamp(1.55rem, 3.5vw, 2rem);
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.03em;
}

.or-error-message {
    margin: 0 auto 1.85rem;
    max-width: 38ch;
    color: #94a3b8;
    font-size: 1.05rem;
    line-height: 1.65;
}

.or-error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

.or-error-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 46px;
    padding: 0.7rem 1.35rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.or-error-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.or-error-btn-primary {
    color: #0b1220;
    background: linear-gradient(135deg, #93c5fd, #3b82f6);
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.28);
}

.or-error-btn-primary:hover {
    transform: translateY(-2px);
    color: #0b1220;
}

.or-error-btn-ghost {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

.or-error-btn-ghost:hover {
    color: #fff;
    border-color: color-mix(in srgb, var(--or-error-accent, #60a5fa) 55%, rgba(255,255,255,0.12));
    background: color-mix(in srgb, var(--or-error-accent, #60a5fa) 12%, transparent);
}

.or-error-extra {
    margin-top: 1.75rem;
    padding-top: 1.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.or-error-hint {
    margin: 0;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.55;
}

.or-error-hint a {
    color: var(--or-error-accent, #60a5fa);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.or-error-search {
    display: flex;
    gap: 0.55rem;
    max-width: 360px;
    margin: 0.85rem auto 0;
}

.or-error-search input {
    flex: 1;
    min-width: 0;
    padding: 0.7rem 0.95rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.28);
    color: #e2e8f0;
    font-size: 0.92rem;
    font-family: inherit;
}

.or-error-search input::placeholder {
    color: #64748b;
}

.or-error-search input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--or-error-accent, #60a5fa) 70%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--or-error-accent, #60a5fa) 18%, transparent);
}

.or-error-search button {
    width: 46px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    color: #0b1220;
    background: linear-gradient(135deg, #93c5fd, #3b82f6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.or-error-search button svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 560px) {
    .or-error {
        padding: 2.5rem 1rem 3.5rem;
        min-height: auto;
    }

    .or-error-panel {
        padding: 2.1rem 1.25rem 1.85rem;
    }

    .or-error-actions {
        flex-direction: column;
    }

    .or-error-btn {
        width: 100%;
    }
}

/* User Profile */
.profile-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.profile-header {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Thread Detail */
.thread-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.thread-content {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.thread-author {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-item {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.reply-form {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.reply-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    resize: vertical;
    margin-bottom: 1rem;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    border: 3px solid var(--bg-card);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notifications */
.notification {
    position: fixed;
    top: 80px;
    right: 2rem;
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    border-left: 4px solid #27ae60;
}

.notification.error {
    border-left: 4px solid var(--accent);
}

/* Breadcrumb */
.breadcrumb {
    max-width: 1280px;
    width: 100%;
    margin: 1rem auto;
    padding: 0 2rem;
    display: flex;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--accent);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.page-btn {
    padding: 0.6rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
}

.page-btn:hover, .page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Go Back Button */
.go-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    margin-bottom: 1.5rem;
}

.go-back-btn:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.go-back-btn i {
    font-size: 1.2rem;
}

/* Statistics Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-box {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #6366f1;
    transition: all 0.3s;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

.stat-box h3 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.stat-box .value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #6366f1;
}

.stat-box .label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Modal/Overlay Close */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--accent-secondary);
    transform: rotate(90deg);
}

/* Detail Page Container with Close */
.detail-container {
    position: relative;
    padding-top: 60px;
}

.detail-container .close-btn {
    position: fixed;
}

/* Promoted CTA */
.promote-your-series-cta {
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 2px dashed rgba(255, 215, 0, 0.3);
}

.btn-promote {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    padding: 15px 40px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-promote:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, #FFA500 0%, #FFD700 100%);
}

.promote-info {
    margin-top: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* Light Black / Midnight Slate Component Overrides */
[data-theme="light"] .section-title {
    color: #ffffff !important;
}

[data-theme="light"] .view-all {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    color: #a5b4fc !important;
}

[data-theme="light"] .view-all:hover {
    background: rgba(99, 102, 241, 0.28) !important;
    color: #ffffff !important;
}

[data-theme="light"] .glass-form-container,
[data-theme="light"] .glass-form-card,
[data-theme="light"] .profile-header,
[data-theme="light"] .channel-banner {
    background: rgba(28, 38, 56, 0.94) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="light"] .profile-header-details h1,
[data-theme="light"] .channel-name,
[data-theme="light"] .glass-card-header,
[data-theme="light"] .tab-header-title {
    color: #ffffff !important;
}

[data-theme="light"] .profile-email,
[data-theme="light"] .channel-owner,
[data-theme="light"] .channel-description,
[data-theme="light"] .stat-label {
    color: #94a3b8 !important;
}

[data-theme="light"] .stat-item {
    background: #1c2638 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .tabs {
    background: rgba(28, 38, 56, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .tab-btn {
    color: #94a3b8 !important;
}

[data-theme="light"] .tab-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

[data-theme="light"] .tab-btn.active {
    color: #ffffff !important;
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
}

[data-theme="light"] .form-group input:not([type="checkbox"]):not([type="file"]):not([type="radio"]),
[data-theme="light"] .form-group textarea,
[data-theme="light"] .form-group select {
    background: #1c2638 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .form-group label {
    color: #cbd5e1 !important;
}

[data-theme="light"] .file-dropzone {
    background: #1c2638 !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

[data-theme="light"] .lib-pill {
    background: #1c2638 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
}

[data-theme="light"] .lib-pill-count {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
}

[data-theme="light"] .lib-pill:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #a5b4fc !important;
}

[data-theme="light"] .lib-pill-active {
    background: rgba(99, 102, 241, 0.25) !important;
    border-color: rgba(99, 102, 241, 0.5) !important;
    color: #ffffff !important;
}





/* --- footer.css --- */
/* Footer — jumbo site chrome */
.site-footer {
    background:
        radial-gradient(ellipse 80% 60% at 10% 0%, rgba(59, 130, 246, 0.12), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 100%, rgba(139, 92, 246, 0.1), transparent 50%),
        linear-gradient(180deg, #0a0f1c 0%, #060912 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 5.5rem 0 0;
    margin-top: 5rem;
    position: relative;
    z-index: 10;
}

.site-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2.5rem 4rem;
    display: grid;
    grid-template-columns: minmax(240px, 1.6fr) repeat(4, minmax(0, 1fr));
    gap: 3rem 2.5rem;
    align-items: start;
}

.site-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 360px;
}

.site-footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
}

.site-footer-logo img {
    height: 64px;
    width: 64px;
    border-radius: 14px;
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.45);
}

.site-footer-logo-text {
    font-size: 2.15rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
}

.site-footer-logo-text span {
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.site-footer-tagline {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #94a3b8;
    margin: 0;
}

.site-footer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.site-footer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

.site-footer-badge.pulse::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

/* Social icons */
.site-footer-social {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    transition: all 0.25s ease;
}

.site-footer-social a:hover {
    color: #fff;
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.25);
}

.site-footer-social svg {
    width: 20px;
    height: 20px;
    display: block;
}

.site-footer-social svg.fill {
    fill: currentColor;
}

.site-footer-social svg.stroke {
    fill: none;
    stroke: currentColor;
}

.site-footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.site-footer-col h3,
.site-footer-col h4 {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 0.6rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.site-footer-col h3::after,
.site-footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 24px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

.site-footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.site-footer-col ul li {
    margin: 0;
    padding: 0;
}

.site-footer-col a,
.site-footer-link {
    color: #94a3b8;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.site-footer-col a:hover,
.site-footer-link:hover {
    color: #fff;
    transform: translateX(4px);
}

.site-footer-col a.accent-gold:hover { color: #fbbf24; }
.site-footer-col a.accent-red:hover { color: #f87171; }
.site-footer-col a.accent-green:hover { color: #34d399; }

.site-footer-bottom {
    background: rgba(0, 0, 0, 0.45);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.75rem 2.5rem 2rem;
    text-align: center;
}

.site-footer-bottom p {
    margin: 0;
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.65;
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
}

.site-footer-bottom .copy {
    margin-top: 0.65rem;
    color: #6b7280;
}

@media (max-width: 1100px) {
    .site-footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem 2rem;
    }

    .site-footer-brand {
        grid-column: 1 / -1;
        max-width: 480px;
    }
}

@media (max-width: 640px) {
    .site-footer {
        padding-top: 3.5rem;
        margin-top: 3rem;
    }

    .site-footer-inner {
        grid-template-columns: 1fr;
        padding: 0 1.25rem 2.5rem;
        gap: 2rem;
    }

    .site-footer-logo img {
        height: 52px;
        width: 52px;
    }

    .site-footer-logo-text {
        font-size: 1.75rem;
    }

    .site-footer-bottom {
        padding: 1.35rem 1.25rem 1.75rem;
    }
}

/* Light Black / Midnight Slate Footer Overrides */
[data-theme="light"] .site-footer {
    background: #182232 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="light"] .site-footer-logo-text {
    color: #ffffff !important;
}

[data-theme="light"] .site-footer-tagline {
    color: #94a3b8 !important;
}

[data-theme="light"] .site-footer-badge {
    background: #1c2638 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
}

[data-theme="light"] .site-footer-social-btn {
    background: #1c2638 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
}

[data-theme="light"] .site-footer-social-btn:hover {
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    color: #ffffff !important;
}

[data-theme="light"] .site-footer-col h4,
[data-theme="light"] .site-footer-col h3 {
    color: #ffffff !important;
}

[data-theme="light"] .site-footer-col a {
    color: #94a3b8 !important;
}

[data-theme="light"] .site-footer-col a:hover {
    color: #ffffff !important;
}

[data-theme="light"] .site-footer-bottom {
    border-top-color: rgba(255, 255, 255, 0.06) !important;
    color: #64748b !important;
}





/* --- responsive.css --- */
/* Global Responsive Adjustments */
@media (max-width: 768px) {
    .promoted-grid {
        gap: 0.75rem;
        padding: 0 0.75rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .promoted-grid .card {
        width: 100%;
        min-width: 0;
    }
    
    .btn-promote {
        padding: 12px 30px;
        font-size: 16px;
    }

    .featured-slider {
        padding: 0 1rem;
    }

    .slide {
        padding: 1.25rem;
        flex-direction: column;
        text-align: center;
    }

    .slide-info h2 {
        font-size: 1.4rem;
    }

    .genre-tags {
        justify-content: center;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-stats {
        justify-content: center;
    }
}


/* --- spinning-border.css --- */
/* ============================================
   SPINNING BORDER ANIMATION - HYBRID HOUDINI & TRANSFORM FALLBACK
   ============================================ */

/* Register custom property for angle animation */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* Keyframes for spinning property animation */
@keyframes spinProperty {
    0% {
        --angle: 0deg;
    }
    100% {
        --angle: 360deg;
    }
}

/* Keyframes for fallback transform rotation */
@keyframes spinRotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ============================================
   SERIES CARDS ONLY (in grid/browse pages)
   ============================================ */

.grid .card,
.grid .manga-card,
.grid .series-card,
.manga-grid .card,
.manga-grid .manga-card,
.manga-grid .series-card,
.series-grid .card,
.series-grid .manga-card,
.series-grid .series-card,
.browse-grid .card,
.browse-grid .manga-card,
.browse-grid .series-card {
    position: relative;
    z-index: 1;
    overflow: hidden !important;
    border-radius: 12px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

/* Spinning border line using ::before pseudo-element */
.grid .card::before,
.grid .manga-card::before,
.grid .series-card::before,
.manga-grid .card::before,
.manga-grid .manga-card::before,
.manga-grid .series-card::before,
.series-grid .card::before,
.series-grid .manga-card::before,
.series-grid .series-card::before,
.browse-grid .card::before,
.browse-grid .manga-card::before,
.browse-grid .series-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250%;
    height: 250%;
    z-index: -1;
    border-radius: 50%;
    background: conic-gradient(
        from var(--angle),
        transparent 0deg,
        transparent 70deg,
        #BC13FE 120deg,
        #3B82F6 180deg,
        #BC13FE 240deg,
        transparent 290deg,
        transparent 360deg
    );
    /* Animation removed to fix lag */
    will-change: transform;
}

/* Ensure card content container clips properly with 2px inset gap */
.grid .card::after,
.grid .manga-card::after,
.grid .series-card::after,
.manga-grid .card::after,
.manga-grid .manga-card::after,
.manga-grid .series-card::after,
.series-grid .card::after,
.series-grid .manga-card::after,
.series-grid .series-card::after,
.browse-grid .card::after,
.browse-grid .manga-card::after,
.browse-grid .series-card::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: #0f172a;
    border-radius: 10px;
    z-index: -1;
}

/* Card hover effects */
.grid .card:hover,
.grid .manga-card:hover,
.grid .series-card:hover,
.manga-grid .card:hover,
.manga-grid .manga-card:hover,
.manga-grid .series-card:hover,
.series-grid .card:hover,
.series-grid .manga-card:hover,
.series-grid .series-card:hover,
.browse-grid .card:hover,
.browse-grid .manga-card:hover,
.browse-grid .series-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 
        0 0 20px rgba(188, 19, 254, 0.4),
        0 0 40px rgba(59, 130, 246, 0.3);
}


/* Ensure card covers render with smooth top rounded corners */
.card-cover,
.card img,
.series-card img,
.manga-card img {
    border-radius: 8px 8px 0 0;
    width: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card-cover,
.card:hover img {
    transform: scale(1.03);
}

/* ============================================
   DETAILS PAGE ONLY
   ============================================ */

.series-detail-page .detail-card,
.series-detail-page .info-section,
.series-detail-page .chapter-list,
.series-detail-page .comments-section {
    position: relative;
    z-index: 1;
    overflow: hidden !important;
    border-radius: 14px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.series-detail-page .detail-card::before,
.series-detail-page .info-section::before,
.series-detail-page .chapter-list::before,
.series-detail-page .comments-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250%;
    height: 250%;
    z-index: -1;
    border-radius: 50%;
    background: conic-gradient(
        from var(--angle),
        transparent 0deg,
        transparent 70deg,
        #BC13FE 120deg,
        #3B82F6 180deg,
        #BC13FE 240deg,
        transparent 290deg,
        transparent 360deg
    );
    /* Animation removed to fix lag */
    will-change: transform;
}

.series-detail-page .detail-card::after,
.series-detail-page .info-section::after,
.series-detail-page .chapter-list::after,
.series-detail-page .comments-section::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: #0f172a;
    border-radius: 12px;
    z-index: -1;
}

.series-detail-page .detail-card:hover,
.series-detail-page .info-section:hover,
.series-detail-page .chapter-list:hover,
.series-detail-page .comments-section:hover {
    box-shadow: 
        0 0 20px rgba(188, 19, 254, 0.4),
        0 0 40px rgba(59, 130, 246, 0.25);
}

/* ============================================
   ALL-IN-ONE PAGE ONLY
   ============================================ */

.all-in-one-page .content-card,
.all-in-one-page .section-card {
    position: relative;
    z-index: 1;
    overflow: hidden !important;
    border-radius: 14px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.all-in-one-page .content-card::before,
.all-in-one-page .section-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250%;
    height: 250%;
    z-index: -1;
    border-radius: 50%;
    background: conic-gradient(
        from var(--angle),
        transparent 0deg,
        transparent 70deg,
        #BC13FE 120deg,
        #3B82F6 180deg,
        #BC13FE 240deg,
        transparent 290deg,
        transparent 360deg
    );
    /* Animation removed to fix lag */
    will-change: transform;
}

.all-in-one-page .content-card::after,
.all-in-one-page .section-card::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: #0f172a;
    border-radius: 12px;
    z-index: -1;
}


/* --- grid-fix.css --- */
.grid {
    max-width: 1400px !important;
    margin: 2rem auto !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 1.5rem !important;
    padding: 0 2rem !important;
}

.series-grid {
    max-width: 1400px !important;
    margin: 2rem auto !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 1.5rem !important;
    padding: 0 2rem !important;
}

.promo-grid {
    max-width: 1400px !important;
    margin: 2rem auto !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 1.5rem !important;
    padding: 0 2rem !important;
}

.groups-grid {
    max-width: 1400px !important;
    margin: 2rem auto !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 1.5rem !important;
    padding: 0 2rem !important;
}

.channels-grid {
    max-width: 1400px !important;
    margin: 2rem auto !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 1.5rem !important;
    padding: 0 2rem !important;
}

.card,
.series-card,
.promo-card,
.group-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover,
.series-card:hover,
.promo-card:hover,
.group-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

.card-cover,
.series-card img,
.promo-card-image {
    width: 100%;
    height: 280px !important;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    backface-visibility: hidden;
}

.card-body,
.series-info,
.promo-card-body,
.group-card-body {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title,
.series-title,
.promo-card-title,
.group-card-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

@media (max-width: 1400px) {
    .grid,
    .series-grid,
    .promo-grid,
    .groups-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
        gap: 1.2rem !important;
    }
    
    .channels-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    }
}

@media (max-width: 1024px) {
    .grid,
    .series-grid,
    .promo-grid,
    .groups-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
        gap: 1rem !important;
    }
    
    .channels-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    }
    
    .card-cover,
    .series-card img,
    .promo-card-image {
        height: 240px !important;
    }
}

@media (max-width: 768px) {
    .grid,
    .series-grid,
    .promo-grid,
    .groups-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.8rem !important;
        padding: 0 0.75rem !important;
    }
    
    .channels-grid {
        grid-template-columns: 1fr !important;
        padding: 0 0.75rem !important;
    }
    
    .card-cover,
    .series-card img,
    .promo-card-image {
        height: auto !important;
        aspect-ratio: 2 / 3;
    }

    .card,
    .series-card,
    .promo-card,
    .group-card {
        min-width: 0 !important;
        overflow: hidden !important;
    }
}

@media (max-width: 480px) {
    .grid,
    .series-grid,
    .promo-grid,
    .groups-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.6rem !important;
        padding: 0 0.5rem !important;
    }
    
    .card-cover,
    .series-card img,
    .promo-card-image {
        height: auto !important;
        aspect-ratio: 2 / 3;
    }
    
    .card-title,
    .series-card .series-title,
    .promo-card-title,
    .group-card-title {
        font-size: 0.85rem;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 1.5rem;
    margin: 2rem 0;
}

.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
    gap: 15px;
    margin-bottom: 30px;
}

.systems-grid,
.power-systems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 20px;
    margin-bottom: 30px;
}

.ad-banner-horizontal {
    grid-column: 1 / -1 !important;
    margin: 40px 0 !important;
    text-align: center;
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
}

.ad-slot {
    width: 100%;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.ad-container {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.ad-label {
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
}

.ad-slot[style*="border: 2px dashed"] {
    border: 2px dashed #ffc107 !important;
}

.ad-banner-horizontal[style*="border: 2px dashed"] {
    border: 2px dashed #ffc107 !important;
}

.cover-crop-wrapper,
.cover-crop-wrapper-profile {
    width: 100%;
    height: 280px;
    overflow: hidden;
    border-radius: 8px;
    position: relative;
    display: block;
}

.cover-crop-wrapper img,
.cover-crop-wrapper-profile img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    margin-top: -14px !important;
    margin-bottom: -14px !important;
    border-radius: 8px !important;
}

.cover-crop-wrapper-profile {
    height: 250px;
}


/* --- ads.css --- */
/* Ad Slot Styles - EXACT COPY FROM MANHUA-SITE */

.ad-slot {
    max-width: 1400px !important;
    margin: 40px auto !important;
    padding: 0 2rem !important;
    text-align: center !important;
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

.ad-container {
    background: transparent !important;
    border-radius: 8px !important;
    padding: 20px !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 120px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    overflow: hidden !important;
}

/* Responsive Ad Container - Auto-fit to content */
.ad-container iframe,
.ad-container ins,
.ad-container script + div,
.ad-container > div:not(.ad-label) {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 90px !important;
    aspect-ratio: auto !important;
}

/* Fluid width for ad iframes */
.ad-container iframe[src*="doubleclick"],
.ad-container iframe[src*="googlesyndication"],
.ad-container iframe[src*="googleadservices"] {
    width: 100% !important;
    min-height: 90px !important;
    border: none !important;
}

/* Make AdSense responsive */
.ad-container ins.adsbygoogle {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 90px !important;
}

/* Responsive sizing based on ad slot size attribute */
.ad-slot[data-size="728x90"] .ad-container {
    min-height: 90px !important;
    max-height: 90px !important;
}

.ad-slot[data-size="300x250"] .ad-container {
    min-height: 250px !important;
    max-height: 300px !important;
}

.ad-slot[data-size="320x50"] .ad-container {
    min-height: 50px !important;
    max-height: 60px !important;
}

.ad-slot[data-size="300x600"] .ad-container {
    min-height: 600px !important;
    max-height: 600px !important;
}

.ad-label {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 10px;
    color: #b0b0b0;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-placeholder {
    color: #b0b0b0;
    font-size: 14px;
    opacity: 0.3;
}

/* Admin Ad Slot Styles */
.ad-slot-empty-admin {
    border: 3px dashed #ff6b6b;
    background: rgba(255, 107, 107, 0.05);
    border-radius: 8px;
}

.ad-slot-empty-admin .ad-container {
    background: rgba(255, 107, 107, 0.08);
    border: 2px solid #ff6b6b;
}

.ad-slot-active {
    border: 2px solid #51cf66;
    background: rgba(81, 207, 102, 0.03);
    border-radius: 8px;
}

.ad-slot-active .ad-container {
    background: rgba(81, 207, 102, 0.05);
}

/* Admin Label */
.ad-slot-admin-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
    color: white;
    border-radius: 6px 6px 0 0;
    font-size: 12px;
    font-weight: 600;
    margin: -20px -20px 15px -20px;
    padding: 10px 15px;
}

/* Legacy promo-slot and promo-container - Make responsive */
.promo-slot,
.ad-slot {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 2rem;
    text-align: center;
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.promo-container,
.ad-container {
    background: transparent;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    overflow: hidden;
}

/* Make promo-container content responsive */
.promo-container iframe,
.promo-container ins,
.promo-container script + div,
.promo-container > div:not(.promo-label),
.ad-container iframe,
.ad-container ins,
.ad-container script + div,
.ad-container > div:not(.ad-label):not(.promo-label) {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 90px;
}

.promo-label,
.ad-label {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 10px;
    color: #b0b0b0;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

.slot-name {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 3px;
}

.slot-status {
    margin-left: auto;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.3);
}

.ad-slot-active .ad-slot-admin-label {
    background: linear-gradient(135deg, #51cf66 0%, #69db7c 100%);
}

/* Admin Preview Box */
.admin-preview-box {
    padding: 30px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(255, 135, 135, 0.1) 100%);
    border-radius: 8px;
    text-align: center;
    border: 2px dashed #ff6b6b;
    width: 100%;
}

.preview-title {
    font-size: 16px;
    font-weight: 700;
    color: #c92a2a;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
}

.preview-message {
    font-size: 14px;
    color: #a61e4d;
    margin-bottom: 15px;
}

.preview-link {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
}

.preview-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* In-Grid Ad Styles */
.ad-slot.in-grid-ad,
.promo-slot.in-grid-ad {
    margin: 0;
    padding: 0;
    max-width: 100%;
    grid-column: 1 / -1;
}

.ad-slot.in-grid-ad .ad-container,
.promo-slot.in-grid-ad .promo-container {
    margin: 20px 0;
    padding: 20px;
    min-height: 150px;
    background: #f0f0f0;
    border-radius: 8px;
}

/* Responsive in-grid-ad */
@media (max-width: 768px) {
    .ad-slot.in-grid-ad,
    .promo-slot.in-grid-ad {
        margin: 15px 0;
    }
    
    .ad-slot.in-grid-ad .ad-container,
    .promo-slot.in-grid-ad .promo-container {
        margin: 15px 0;
        padding: 15px;
        min-height: 100px;
    }
}

@media (max-width: 480px) {
    .ad-slot.in-grid-ad,
    .promo-slot.in-grid-ad {
        margin: 10px 0;
    }
    
    .ad-slot.in-grid-ad .ad-container,
    .promo-slot.in-grid-ad .promo-container {
        margin: 10px 0;
        padding: 10px;
        min-height: 80px;
    }
}

/* Responsive promo-slot and ad-slot */
@media (max-width: 768px) {
    .promo-slot,
    .ad-slot {
        margin: 30px auto;
        padding: 0 1rem;
    }
    
    .promo-container,
    .ad-container {
        padding: 15px;
        min-height: 90px;
    }
    
    .promo-container iframe,
    .promo-container ins,
    .ad-container iframe,
    .ad-container ins {
        min-height: 60px !important;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .promo-slot,
    .ad-slot {
        margin: 20px auto;
        padding: 0 0.5rem;
    }
    
    .promo-container,
    .ad-container {
        padding: 10px;
        min-height: 60px;
    }
    
    .promo-container iframe,
    .promo-container ins,
    .ad-container iframe,
    .ad-container ins {
        min-height: 50px !important;
    }
}

/* Large screens - allow larger ads */
@media (min-width: 1200px) {
    .ad-slot[data-size="728x90"] .ad-container,
    .ad-slot:not([data-size]) .ad-container {
        min-height: 90px;
        max-height: 100px;
    }
}

/* Ad Code Container */
.ad-container > script,
.ad-container > iframe,
.ad-container > div[style*="width"],
.ad-container > div[style*="height"] {
    width: 100% !important;
    max-width: 100% !important;
}

/* Google AdSense Responsive */
.ad-container ins.adsbygoogle {
    display: block;
    text-align: center;
}

/* Media.net Responsive */
.ad-container .media-net-ad {
    display: block;
    text-align: center;
}

/* Generic Ad Container Responsive */
.ad-container > div {
    width: 100%;
    display: flex;
    justify-content: center;
}


/* --- mobile-fix.css --- */
/**
 * OriginRealm — Mobile layout fixes
 * Loaded last so it wins over grid-fix / spinning-border / style.css
 */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- Header ---------- */
@media (max-width: 900px) {
    .header-container {
        gap: 0.5rem 0.65rem;
        padding: 0 0.85rem;
        flex-wrap: wrap;
        align-items: center;
    }

    .logo {
        font-size: 1.05rem;
        gap: 0.45rem;
    }

    .logo img {
        height: 40px !important;
        width: 40px !important;
    }

    .header-actions,
    .auth-buttons {
        gap: 0.4rem;
        position: relative;
        z-index: 2;
    }

    .hamburger {
        display: flex !important;
        order: 4;
        z-index: 1100 !important;
        pointer-events: auto !important;
    }

    .btn-donate,
    .btn-login,
    .auth-buttons .btn {
        padding: 0.4rem 0.7rem !important;
        font-size: 0.8rem !important;
        white-space: nowrap;
    }

    .search-bar {
        order: 6 !important;
        width: 100%;
        max-width: none !important;
        flex: 1 1 100%;
        margin: 0.25rem 0 0;
        position: relative;
        z-index: 1;
    }

    .search-form,
    .search-input {
        width: 100%;
    }

    .profile-avatar {
        width: 36px !important;
        height: 36px !important;
    }

    header nav,
    header .site-nav {
        order: 5;
        z-index: 1050;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.75rem 0;
        min-height: auto;
    }

    .btn-donate {
        display: none; /* keep header clean; Donate still in footer */
    }

    .hamburger {
        margin-left: 0.15rem;
    }
}

/* ---------- Homepage / browse grids ---------- */
@media (max-width: 768px) {
    .featured-slider {
        padding: 0 0.75rem !important;
        margin: 1rem auto !important;
        overflow: hidden !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .slide {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
        padding: 1rem !important;
        text-align: left !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .slide-cover {
        width: 120px !important;
        height: 170px !important;
        max-width: 40vw;
        margin: 0 auto;
        flex-shrink: 0;
    }

    .slide-info {
        min-width: 0 !important;
        width: 100% !important;
        text-align: left !important;
    }

    .slide-info h2 {
        font-size: 1.25rem !important;
        line-height: 1.3;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .slider-controls {
        display: none !important;
    }

    .section {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .section-header {
        padding: 0 0.25rem;
        gap: 0.5rem;
    }

    .site-footer-inner {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        padding: 0 1rem 2.5rem !important;
    }

    .site-footer-brand {
        grid-column: auto !important;
        max-width: none !important;
    }

    .grid,
    .series-grid,
    .promo-grid,
    .groups-grid,
    .promoted-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.75rem !important;
        padding: 0 0.75rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 1rem auto !important;
    }

    .card,
    .series-card,
    .promo-card,
    .group-card,
    .promoted-card {
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box;
    }

    /* Spinning border was forcing overflow:visible and blowing card width */
    .grid .card,
    .grid .series-card,
    .series-grid .card,
    .series-grid .series-card {
        overflow: hidden !important;
    }

    .grid .card::before,
    .grid .series-card::before,
    .series-grid .card::before,
    .series-grid .series-card::before {
        inset: 0 !important;
        border-radius: 8px;
        pointer-events: none;
    }

    .card-cover,
    .card-image,
    .series-card img,
    .promo-card-image,
    .promoted-card .card-cover,
    .cover-crop-wrapper,
    .cover-crop-wrapper-profile {
        height: auto !important;
        aspect-ratio: 2 / 3;
        width: 100% !important;
        object-fit: cover !important;
        object-position: center top !important;
        max-height: none;
    }

    .cover-crop-wrapper,
    .cover-crop-wrapper-profile {
        overflow: hidden !important;
    }

    .cover-crop-wrapper img,
    .cover-crop-wrapper-profile img {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        height: 100% !important;
        width: 100% !important;
        object-fit: cover !important;
    }

    .card-body,
    .series-info {
        padding: 0.65rem !important;
        min-width: 0;
    }

    .card-title,
    .series-card .series-title,
    .card .series-title,
    .promo-card-title,
    .group-card-title,
    .promoted-card .card-title {
        font-size: 0.82rem !important;
        line-height: 1.25 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden !important;
        white-space: normal !important;
        word-break: break-word;
        margin-bottom: 0.35rem !important;
    }

    .card-meta {
        font-size: 0.72rem !important;
        gap: 0.25rem;
        flex-wrap: wrap;
    }

    .type-badge {
        font-size: 0.65rem !important;
        padding: 0.15rem 0.45rem !important;
    }

    .channels-grid {
        grid-template-columns: 1fr !important;
        padding: 0 0.75rem !important;
    }
}

@media (max-width: 380px) {
    .grid,
    .series-grid,
    .promo-grid,
    .groups-grid,
    .promoted-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.55rem !important;
        padding: 0 0.5rem !important;
    }

    .grid .card-title,
    .series-card .series-title,
    .card .series-title,
    .promo-card-title,
    .group-card-title {
        font-size: 0.75rem !important;
    }
}

/* ---------- Series detail page ---------- */
.series-detail-shell,
.series-detail-layout {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.series-detail-cover-col {
    min-width: 0;
}

.series-detail-meta-col {
    min-width: 0;
}

@media (max-width: 900px) {
    .series-detail-outer {
        padding: 0 0.75rem !important;
        margin: 1rem auto !important;
    }

    .series-detail-shell.series-detail-layout,
    .series-detail-layout {
        flex-direction: column !important;
        gap: 1.25rem !important;
        padding: 1rem !important;
        align-items: stretch !important;
    }

    .series-detail-cover-col {
        width: 100% !important;
        max-width: 240px;
        margin: 0 auto;
    }

    .series-detail-meta-col {
        width: 100% !important;
        gap: 1rem !important;
    }

    .series-detail-page .series-title,
    h1.series-title {
        font-size: 1.35rem !important;
        line-height: 1.3 !important;
        word-break: break-word;
        overflow-wrap: anywhere;
        max-width: 100%;
    }

    #alt-title-bar {
        max-width: 100% !important;
        flex-wrap: wrap;
    }

    #alt-title-primary {
        white-space: normal !important;
        max-width: 100% !important;
    }

    .series-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.75rem !important;
        padding-right: 2rem !important;
    }

    .series-info-grid > div {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    /* Tags must wrap, not clip */
    .series-tags,
    .tag-list,
    [class*="tags"] {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.4rem !important;
        max-width: 100%;
    }

    .series-tags a,
    .series-tags span,
    .tag-pill,
    .tag {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Prev/next arrows: don't cover content on phones */
    .nav-btn,
    .nav-btn-disabled {
        display: none !important;
    }

    .series-actions-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.65rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .series-actions-row .action-btn,
    .series-actions-row .lib-status-wrap,
    .series-actions-row .share-btn-wrap,
    .series-actions-row .lib-chapter-row {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0.65rem 0.5rem !important;
        font-size: 0.8rem !important;
        text-align: center !important;
    }

    .series-actions-row .lib-status-wrap .lib-status-badge,
    .series-actions-row .share-btn-wrap .share-btn {
        width: 100% !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    .series-actions-row > a.favorite-btn-add {
        grid-column: 1 / -1 !important;
        width: 100% !important;
    }

    .series-actions-row a[href*="home"],
    .series-actions-row > a:last-child {
        grid-column: 1 / -1 !important;
        text-align: center !important;
        margin: 0.5rem auto 0 !important;
        display: block !important;
    }

    .close-btn {
        top: 0.5rem !important;
        right: 0.5rem !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 20px !important;
    }
}

@media (max-width: 480px) {
    .series-detail-cover-col {
        max-width: 200px;
    }

    .series-detail-page .series-title,
    h1.series-title {
        font-size: 1.15rem !important;
    }

    .series-info-grid {
        grid-template-columns: 1fr 1fr !important;
        font-size: 0.9rem;
    }
}

/* ---------- Profile (mobile) ---------- */
@media (max-width: 768px) {
    .profile-wrapper {
        padding: 0 0.85rem !important;
        margin: 1rem auto !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .profile-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1.25rem !important;
        padding: 1.25rem !important;
    }

    .profile-stats {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 0.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0.75rem 0.5rem !important;
    }

    .stat-item {
        min-width: 0 !important;
    }

    .stat-label {
        font-size: 0.65rem !important;
        letter-spacing: 0.04em !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Keep tab panels from pulling the viewport toward the footer on iOS */
    .profile-wrapper .tabs {
        position: sticky;
        top: 4.5rem; /* sit below sticky site header, not over it */
        z-index: 40;
        scroll-margin-top: 0;
    }

    .profile-wrapper .tab-content {
        scroll-margin-top: 4.5rem;
        min-height: 40vh; /* avoids empty panels sitting above a huge footer void */
    }

    .profile-wrapper .tab-content.active {
        min-height: 50vh;
    }
}


/* --- feed-skeletons.css --- */
/* ==========================================================================
   High-Performance Feed Shimmer Skeleton & Cascade Wave Transitions
   GPU-Composited (0% CPU, 0 Layout Shift, 60fps)
   ========================================================================== */

@keyframes feedShimmerGpu {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes feedWaveIn {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    60% {
        transform: translateY(-2px) scale(1.008);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.skeleton-card {
    background: rgba(30, 41, 59, 0.7);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    contain: paint;
}

.skeleton-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: rgba(51, 65, 85, 0.6);
    position: relative;
    overflow: hidden;
}

.skeleton-cover::after,
.skeleton-line::after,
.skeleton-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
    animation: feedShimmerGpu 1.5s infinite;
    will-change: transform;
}

.skeleton-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: rgba(51, 65, 85, 0.6);
    position: relative;
    overflow: hidden;
}

.skeleton-line.title {
    width: 80%;
    height: 16px;
}

.skeleton-line.subtitle {
    width: 50%;
    height: 12px;
}

.feed-loaded-card {
    opacity: 0;
    animation: feedWaveIn 0.42s cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
    will-change: transform, opacity;
}

.feed-loaded-card img.card-cover {
    transition: opacity 0.25s ease-in-out;
}

/* Slider Skeleton */
.skeleton-slide {
    width: 100%;
    min-height: 280px;
    border-radius: 16px;
    background: rgba(30, 41, 59, 0.8);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 2rem;
}

/* ==========================================================================
   Accessibility & Layout Stability (CLS 0.00 & 100 A11y)
   ========================================================================== */
.tag {
    background: rgba(99, 102, 241, 0.25) !important;
    border: 1px solid rgba(99, 102, 241, 0.5) !important;
    color: #e0e7ff !important;
}

.btn.btn-primary, .slide-info .btn-primary {
    color: #ffffff !important;
    font-weight: 700 !important;
}

.site-footer-tagline, .site-footer-bottom p, .site-footer-bottom .copy {
    color: #94a3b8 !important;
}

.reveal-section {
    contain: layout;
    min-height: 380px;
}

.card, .skeleton-card {
    min-height: 320px;
}


