/* ═══════════════════════════════════════════════════════════════════════════
   Cherry — Game Platform with Cloud Saves
   Theme: Black & Gray with Pink accents (cherry blossom)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Variables ──────────────────────────────────────────────────────────── */
:root {
    /* Core blacks & grays */
    --bg-primary: #0a0a0b;
    --bg-secondary: #111113;
    --bg-sidebar: #0d0d0f;
    --bg-card: #161618;
    --bg-card-hover: #1c1c1f;
    --bg-input: #1a1a1d;
    --bg-overlay: rgba(0, 0, 0, 0.85);

    /* Borders */
    --border: #222225;
    --border-light: #2a2a2e;
    --border-focus: #444;

    /* Text */
    --text-primary: #e8e8ea;
    --text-secondary: #888890;
    --text-muted: #555558;
    --text-inverse: #0a0a0b;

    /* Cherry accent */
    --cherry: #ff6b9d;
    --cherry-dark: #d44a7a;
    --cherry-glow: rgba(255, 107, 157, 0.15);
    --cherry-glow-strong: rgba(255, 107, 157, 0.3);

    /* Status */
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #60a5fa;

    /* Sizing */
    --sidebar-width: 240px;
    --header-height: 56px;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;

    /* Transitions */
    --transition: 0.2s ease;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input { font-family: inherit; }

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

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

.logo-icon {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--cherry), #ff9ec6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Nav Items ──────────────────────────────────────────────────────────── */
.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    border: 1px solid transparent;
}

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

.nav-item.active {
    background: var(--cherry-glow);
    color: var(--cherry);
    border-color: rgba(255, 107, 157, 0.1);
}

.nav-item.active svg {
    stroke: var(--cherry);
}

/* ─── Sidebar Footer (User Card) ────────────────────────────────────────── */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 8px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-muted);
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-status {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.auth-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition);
}

.auth-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--cherry);
    color: var(--cherry);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE HEADER
   ═══════════════════════════════════════════════════════════════════════════ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    align-items: center;
    gap: 12px;
    z-index: 90;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 6px;
}

.mobile-title {
    font-size: 18px;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════════════ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.page {
    display: none;
    padding: 40px;
    max-width: 1200px;
    animation: fadeIn 0.2s ease;
}

.page.active {
    display: block;
}

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

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ─── Search ─────────────────────────────────────────────────────────────── */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 16px;
    margin-bottom: 24px;
    transition: border-color var(--transition);
}

.search-bar:focus-within {
    border-color: var(--cherry);
}

.search-bar svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    padding: 12px 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

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

/* ─── Sync Banner ────────────────────────────────────────────────────────── */
.sync-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--cherry-glow);
    border: 1px solid rgba(255, 107, 157, 0.15);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 24px;
}

.sync-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sync-icon svg {
    stroke: var(--cherry);
}

.sync-text strong {
    display: block;
    font-size: 13px;
    color: var(--cherry);
}

.sync-text span {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ─── Section Header ─────────────────────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.game-count {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 4px 10px;
    border-radius: 20px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GAME GRID
   ═══════════════════════════════════════════════════════════════════════════ */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-light);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.game-card:hover .game-thumb {
    filter: brightness(1.1);
}

.game-thumb {
    width: 100%;
    aspect-ratio: 16/10;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    transition: filter var(--transition);
    overflow: hidden;
    position: relative;
}

.game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-thumb .placeholder-icon {
    color: var(--text-muted);
    font-size: 40px;
}

/* Cloud save badge */
.save-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 4px;
}

.save-badge .dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
}

.game-card-body {
    padding: 12px 14px;
}

.game-card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.game-card-category {
    background: var(--bg-input);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

/* ─── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon svg {
    stroke: var(--text-muted);
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CATEGORY TABS
   ═══════════════════════════════════════════════════════════════════════════ */
.category-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
}

.tab:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   CLOUD SAVES PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.saves-container,
.profile-container {
    max-width: 600px;
}

.auth-required {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.auth-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
}

.auth-icon svg {
    stroke: var(--text-muted);
}

.auth-required h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.auth-required p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.saves-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.save-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.save-item:hover {
    border-color: var(--border-light);
}

.save-item-info h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.save-item-info span {
    font-size: 12px;
    color: var(--text-muted);
}

.save-item-actions {
    display: flex;
    gap: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROFILE
   ═══════════════════════════════════════════════════════════════════════════ */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 3px solid var(--cherry);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

.profile-info span {
    font-size: 13px;
    color: var(--text-muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--cherry);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   GAME PLAYER (Fullscreen Overlay)
   ═══════════════════════════════════════════════════════════════════════════ */
.game-player {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 200;
    display: flex;
    flex-direction: column;
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 48px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.back-btn:hover {
    background: var(--bg-card);
}

.player-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.save-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--success);
    background: rgba(74, 222, 128, 0.1);
    padding: 3px 8px;
    border-radius: 20px;
}

.save-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.save-indicator.saving {
    color: var(--warning);
    background: rgba(251, 191, 36, 0.1);
}

.save-indicator.saving .save-dot {
    background: var(--warning);
}

.player-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Auto-save toggle */
.auto-save-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.auto-save-toggle input {
    display: none;
}

.toggle-slider {
    width: 32px;
    height: 18px;
    background: var(--bg-card);
    border-radius: 9px;
    position: relative;
    transition: background var(--transition);
    border: 1px solid var(--border);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-secondary);
    top: 2px;
    left: 2px;
    transition: all var(--transition);
}

.auto-save-toggle input:checked + .toggle-slider {
    background: var(--cherry);
    border-color: var(--cherry);
}

.auto-save-toggle input:checked + .toggle-slider::after {
    transform: translateX(14px);
    background: white;
}

.toggle-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Save button with text */
.save-btn {
    width: auto !important;
    padding: 0 10px !important;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
}

.save-btn-text {
    font-size: 12px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.icon-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.game-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: #000;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--cherry);
    color: #fff;
}

.btn-primary:hover {
    background: var(--cherry-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

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

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

#modalWatchlistBtn.active {
    background: var(--cherry);
    color: #fff;
    border-color: var(--cherry);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-primary);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 320px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
.toast.warning { border-left: 3px solid var(--warning); }

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

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-header {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding-top: var(--header-height);
    }

    .page {
        padding: 20px 16px;
    }

    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

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

    .player-header {
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .page-header h1 {
        font-size: 22px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MUSIC PLAYER
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Music Search ────────────────────────────────────────────────────────── */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px;
    margin-bottom: 16px;
    transition: border-color var(--transition);
}

.search-bar:focus-within {
    border-color: var(--cherry);
}

.search-bar svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}

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

.search-go-btn {
    background: var(--cherry);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.search-go-btn:hover {
    background: var(--cherry-dark);
}

.music-quality-select {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.music-quality-select select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
}

.music-quality-select select:focus {
    border-color: var(--cherry);
}

/* ─── Track Results ───────────────────────────────────────────────────────── */
.music-results {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.track-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}

.track-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.track-item.active {
    border-color: var(--cherry);
    background: var(--cherry-glow);
}

.track-art {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-input);
}

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

.track-title {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-duration {
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

.music-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.music-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--cherry);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

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

/* ─── Mini Player (persistent bottom bar) ─────────────────────────────────── */
.music-mini-player {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 64px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    z-index: 900;
    transition: left var(--transition);
}

.mini-player-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
    max-width: 280px;
}

.mini-album-art {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-card);
}

.mini-track-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mini-track-title {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-track-artist {
    color: var(--text-secondary);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: color var(--transition), background var(--transition);
    line-height: 1;
}

.mini-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.mini-play {
    font-size: 22px;
    color: var(--cherry);
}

.mini-play:hover {
    color: var(--cherry-dark);
}

.mini-close {
    margin-left: auto;
    font-size: 14px;
}

.mini-player-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.mini-progress-bar:hover {
    height: 6px;
}

.mini-progress-fill {
    height: 100%;
    background: var(--cherry);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s linear;
}

.mini-time {
    color: var(--text-muted);
    font-size: 11px;
    min-width: 36px;
    text-align: right;
}

/* Adjust main content when mini player is visible */
body.music-playing .main-content {
    padding-bottom: 80px;
}

@media (max-width: 768px) {
    .music-mini-player {
        left: 0;
    }

    .mini-player-info {
        min-width: 100px;
    }

    .mini-player-progress {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   AI Chat
   ═══════════════════════════════════════════════════════════════════════════ */

.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    overflow: hidden;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Welcome screen */
.ai-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    padding: 40px 20px;
    gap: 16px;
}

.ai-welcome-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--cherry-glow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-welcome h3 {
    color: var(--text-primary);
    font-size: 1.4rem;
}

.ai-welcome p {
    color: var(--text-secondary);
    max-width: 400px;
    line-height: 1.6;
}

.ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}

.ai-suggestion-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.ai-suggestion-btn:hover {
    background: var(--cherry-glow);
    border-color: var(--cherry);
    color: var(--cherry);
}

/* Messages */
.ai-msg {
    display: flex;
    gap: 10px;
    animation: aiMsgIn 0.3s ease;
}

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

.ai-msg-user {
    justify-content: flex-end;
}

.ai-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cherry-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.ai-msg-content {
    max-width: 75%;
}

.ai-msg-bubble {
    padding: 10px 16px;
    border-radius: 16px;
    line-height: 1.6;
    font-size: 14px;
    word-wrap: break-word;
}

.ai-user-bubble {
    background: var(--cherry);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-ai-bubble {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.ai-ai-bubble pre {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin: 8px 0;
    overflow-x: auto;
    font-size: 13px;
}

.ai-ai-bubble code {
    font-family: 'Courier New', monospace;
}

.ai-inline-code {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.ai-error-bubble {
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 12px;
    text-align: center;
    font-size: 13px;
}

/* Typing indicator */
.ai-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.ai-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: aiBounce 1.4s infinite ease-in-out both;
}

.ai-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-dots span:nth-child(2) { animation-delay: -0.16s; }
.ai-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes aiBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input area */
.ai-chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.ai-chat-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 12px;
    transition: var(--transition);
}

.ai-chat-input-wrap:focus-within {
    border-color: var(--cherry);
    box-shadow: 0 0 0 3px var(--cherry-glow);
}

.ai-chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    resize: none;
    outline: none;
    font-family: inherit;
    line-height: 1.5;
    min-height: 24px;
    max-height: 150px;
}

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

.ai-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cherry);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.ai-send-btn:hover {
    background: var(--cherry-dark);
    transform: scale(1.05);
}

.ai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.ai-disclaimer {
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 8px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .ai-chat-container {
        height: calc(100vh - 140px);
        border-radius: var(--radius);
    }

    .ai-msg-content {
        max-width: 85%;
    }

    .ai-chat-messages {
        padding: 16px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Movies & TV Shows
   ═══════════════════════════════════════════════════════════════════════════ */

/* Media section headers */
.media-section {
    margin-top: 24px;
}

.media-section-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 16px;
    padding-left: 4px;
}

.media-loading {
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
}

/* Media cards grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.media-card {
    cursor: pointer;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
}

.media-card:hover {
    transform: translateY(-4px);
    border-color: var(--cherry);
    box-shadow: 0 8px 24px rgba(255, 107, 157, 0.15);
}

.media-card-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    background: var(--bg-secondary);
}

.media-card-no-poster {
    width: 100%;
    aspect-ratio: 2/3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 13px;
}

.media-card-info {
    padding: 10px;
}

.media-card-title {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-card-year {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
}

.media-card-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #fbbf24;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.media-card-type {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--cherry);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* ── Detail Modal ─────────────────────────────────────────────────────── */
.media-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

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

.media-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.media-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.media-modal-close:hover {
    background: var(--cherry);
}

.media-modal-backdrop {
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.media-modal-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-secondary) 0%, transparent 60%);
}

.media-modal-body {
    display: flex;
    gap: 24px;
    padding: 0 24px 24px;
    margin-top: -80px;
    position: relative;
    z-index: 1;
}

.media-modal-poster {
    width: 180px;
    flex-shrink: 0;
}

.media-modal-poster img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

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

.media-modal-info h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.media-modal-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 10px;
}

.media-rating {
    color: #fbbf24;
    font-weight: 700;
}

.media-modal-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.media-genre-tag {
    background: var(--cherry-glow);
    color: var(--cherry);
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.media-modal-tagline {
    color: var(--text-muted);
    font-style: italic;
    font-size: 13px;
    margin-bottom: 8px;
}

.media-modal-overview {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.media-modal-cast {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.cast-item {
    text-align: center;
    flex-shrink: 0;
    width: 60px;
}

.cast-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-card);
    margin-bottom: 4px;
}

.cast-name {
    font-size: 10px;
    color: var(--text-secondary);
    display: block;
}

.cast-character {
    font-size: 9px;
    color: var(--text-muted);
}

.media-modal-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.media-play-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px !important;
    font-size: 15px !important;
}

/* ── TV Picker ────────────────────────────────────────────────────────── */
.media-tv-picker {
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.tv-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.tv-picker-header h3 {
    color: var(--text-primary);
    font-size: 1rem;
}

.tv-picker-header select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
}

.tv-episodes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.episode-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.episode-item:hover {
    border-color: var(--cherry);
    background: var(--bg-card-hover);
}

.episode-still {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

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

.episode-title {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}

.episode-overview {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.episode-play-icon {
    color: var(--cherry);
    flex-shrink: 0;
}

/* ── Video Player Overlay ─────────────────────────────────────────────── */
.video-player-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: #000;
    display: flex;
    flex-direction: column;
}

.video-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    z-index: 1;
}

.video-player-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.video-player-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: #000;
}

/* Click shield to absorb ad pop-up clicks */
.video-click-shield {
    position: absolute;
    inset: 0;
    top: 44px; /* below header */
    z-index: 5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
}

.video-click-shield.hidden {
    display: none;
}

.click-shield-msg {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 20px 32px;
    border-radius: var(--radius);
    text-align: center;
    font-size: 15px;
    pointer-events: none;
}

.click-shield-msg small {
    color: var(--text-muted);
    font-size: 11px;
}

/* ── Mobile overrides ─────────────────────────────────────────────────── */
/* ─── Theme: Midnight (dark blue + cyan) ─────────────────────────────────── */
html[data-theme="midnight"] {
    --bg-primary: #080d16;
    --bg-secondary: #0d1b2e;
    --bg-sidebar: #0a1520;
    --bg-card: #111e32;
    --bg-card-hover: #162540;
    --bg-input: #0f1d30;
    --bg-overlay: rgba(4, 10, 20, 0.9);

    --border: #162540;
    --border-light: #1e3050;
    --border-focus: #38bdf8;

    --text-primary: #d8eeff;
    --text-secondary: #7aa5c8;
    --text-muted: #3e6080;
    --text-inverse: #080d16;

    --cherry: #38bdf8;
    --cherry-dark: #0ea5e9;
    --cherry-glow: rgba(56, 189, 248, 0.15);
    --cherry-glow-strong: rgba(56, 189, 248, 0.3);

    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #818cf8;
}

/* ─── Theme: Daylight (light blue + royal blue) ──────────────────────────── */
html[data-theme="daylight"] {
    --bg-primary: #f0f7ff;
    --bg-secondary: #e4f0fd;
    --bg-sidebar: #d8eaf8;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f9ff;
    --bg-input: #e8f3fc;
    --bg-overlay: rgba(200, 225, 248, 0.9);

    --border: #bdd9f2;
    --border-light: #cfe5f7;
    --border-focus: #2563eb;

    --text-primary: #0f1e30;
    --text-secondary: #3a5878;
    --text-muted: #7a9ab8;
    --text-inverse: #f0f7ff;

    --cherry: #2563eb;
    --cherry-dark: #1d4ed8;
    --cherry-glow: rgba(37, 99, 235, 0.12);
    --cherry-glow-strong: rgba(37, 99, 235, 0.25);

    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0284c7;
}

/* ─── Theme Picker ─────────────────────────────────────────────────────────── */
.theme-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
}
.theme-picker-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    flex-shrink: 0;
}
.theme-swatches {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: flex-end;
}
.theme-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .15s, border-color .15s;
    position: relative;
    flex-shrink: 0;
}
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch.active { border-color: var(--text-primary); }
.theme-swatch[data-theme="cherry"] {
    background: conic-gradient(#0a0a0b 50%, #ff6b9d 50%);
}
.theme-swatch[data-theme="midnight"] {
    background: conic-gradient(#080d16 50%, #38bdf8 50%);
}
.theme-swatch[data-theme="daylight"] {
    background: conic-gradient(#f0f7ff 50%, #2563eb 50%);
    border-color: #bdd9f2;
}
.theme-swatch[data-theme="daylight"].active { border-color: #2563eb; }
.theme-swatch-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 5px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
}
.theme-swatch:hover .theme-swatch-tooltip { opacity: 1; }


/* ─── Theme: Forest ───────────────────────────────────────────────────────── */
html[data-theme="forest"] {
    --bg-primary: #071a0d; --bg-secondary: #0d2416; --bg-sidebar: #091e10;
    --bg-card: #0d2416; --bg-card-hover: #122c1a; --bg-input: #0b2012;
    --bg-overlay: rgba(4,14,7,0.9);
    --border: #142e1a; --border-light: #1c3e24; --border-focus: #86efac;
    --text-primary: #d4f5dc; --text-secondary: #6fad80; --text-muted: #3a6045;
    --text-inverse: #071a0d;
    --cherry: #86efac; --cherry-dark: #4ade80; --cherry-glow: rgba(134,239,172,.15); --cherry-glow-strong: rgba(134,239,172,.3);
    --success: #4ade80; --warning: #fbbf24; --danger: #f87171; --info: #60a5fa;
}
/* ─── Theme: Sunset ───────────────────────────────────────────────────────── */
html[data-theme="sunset"] {
    --bg-primary: #0d0906; --bg-secondary: #1a1008; --bg-sidebar: #120c06;
    --bg-card: #1a1008; --bg-card-hover: #221506; --bg-input: #180e07;
    --bg-overlay: rgba(10,7,4,0.9);
    --border: #2a1a08; --border-light: #3a2210; --border-focus: #fb923c;
    --text-primary: #fde8d4; --text-secondary: #c8906a; --text-muted: #704a30;
    --text-inverse: #0d0906;
    --cherry: #fb923c; --cherry-dark: #ea580c; --cherry-glow: rgba(251,146,60,.15); --cherry-glow-strong: rgba(251,146,60,.3);
    --success: #4ade80; --warning: #fbbf24; --danger: #f87171; --info: #60a5fa;
}
/* ─── Theme: Grape ────────────────────────────────────────────────────────── */
html[data-theme="grape"] {
    --bg-primary: #0d0814; --bg-secondary: #130d1f; --bg-sidebar: #100b1a;
    --bg-card: #130d1f; --bg-card-hover: #1a1228; --bg-input: #110a1c;
    --bg-overlay: rgba(7,4,12,0.9);
    --border: #1e1030; --border-light: #281640; --border-focus: #a78bfa;
    --text-primary: #ede0ff; --text-secondary: #9d80c8; --text-muted: #5c3e80;
    --text-inverse: #0d0814;
    --cherry: #a78bfa; --cherry-dark: #7c3aed; --cherry-glow: rgba(167,139,250,.15); --cherry-glow-strong: rgba(167,139,250,.3);
    --success: #4ade80; --warning: #fbbf24; --danger: #f87171; --info: #60a5fa;
}
/* ─── Theme: Crimson ──────────────────────────────────────────────────────── */
html[data-theme="crimson"] {
    --bg-primary: #0d0505; --bg-secondary: #1a0808; --bg-sidebar: #120606;
    --bg-card: #1a0808; --bg-card-hover: #220a0a; --bg-input: #180707;
    --bg-overlay: rgba(10,3,3,0.9);
    --border: #2a0c0c; --border-light: #3a1010; --border-focus: #f87171;
    --text-primary: #ffe4e4; --text-secondary: #c87878; --text-muted: #703838;
    --text-inverse: #0d0505;
    --cherry: #f87171; --cherry-dark: #ef4444; --cherry-glow: rgba(248,113,113,.15); --cherry-glow-strong: rgba(248,113,113,.3);
    --success: #4ade80; --warning: #fbbf24; --danger: #fca5a5; --info: #60a5fa;
}
/* ─── Theme: Ocean ────────────────────────────────────────────────────────── */
html[data-theme="ocean"] {
    --bg-primary: #030f12; --bg-secondary: #061619; --bg-sidebar: #041214;
    --bg-card: #061619; --bg-card-hover: #0a1e22; --bg-input: #051518;
    --bg-overlay: rgba(2,8,10,0.9);
    --border: #0c2028; --border-light: #102832; --border-focus: #2dd4bf;
    --text-primary: #d0f5f0; --text-secondary: #60a898; --text-muted: #305850;
    --text-inverse: #030f12;
    --cherry: #2dd4bf; --cherry-dark: #0d9488; --cherry-glow: rgba(45,212,191,.15); --cherry-glow-strong: rgba(45,212,191,.3);
    --success: #4ade80; --warning: #fbbf24; --danger: #f87171; --info: #60a5fa;
}
/* ─── Theme: Gold Rush ────────────────────────────────────────────────────── */
html[data-theme="gold-rush"] {
    --bg-primary: #0d0a00; --bg-secondary: #1a1500; --bg-sidebar: #120e00;
    --bg-card: #1a1500; --bg-card-hover: #221c00; --bg-input: #181200;
    --bg-overlay: rgba(10,8,0,0.9);
    --border: #2a2200; --border-light: #3a3000; --border-focus: #fbbf24;
    --text-primary: #fff8d4; --text-secondary: #c8a860; --text-muted: #706030;
    --text-inverse: #0d0a00;
    --cherry: #fbbf24; --cherry-dark: #d97706; --cherry-glow: rgba(251,191,36,.15); --cherry-glow-strong: rgba(251,191,36,.3);
    --success: #4ade80; --warning: #fde68a; --danger: #f87171; --info: #60a5fa;
}
/* ─── Theme: Sakura ───────────────────────────────────────────────────────── */
html[data-theme="sakura"] {
    --bg-primary: #fff5f8; --bg-secondary: #fce8ef; --bg-sidebar: #fad8e5;
    --bg-card: #ffffff; --bg-card-hover: #fff0f5; --bg-input: #fce4ed;
    --bg-overlay: rgba(252,225,235,0.92);
    --border: #f4c0d4; --border-light: #f8d4e4; --border-focus: #ec4899;
    --text-primary: #2d0c18; --text-secondary: #8c4060; --text-muted: #c080a0;
    --text-inverse: #fff5f8;
    --cherry: #ec4899; --cherry-dark: #db2777; --cherry-glow: rgba(236,72,153,.12); --cherry-glow-strong: rgba(236,72,153,.25);
    --success: #16a34a; --warning: #d97706; --danger: #dc2626; --info: #0284c7;
}
/* ─── Theme: Neon City ────────────────────────────────────────────────────── */
html[data-theme="neon-city"] {
    --bg-primary: #000000; --bg-secondary: #0a0a0a; --bg-sidebar: #050505;
    --bg-card: #0a0a0a; --bg-card-hover: #111111; --bg-input: #080808;
    --bg-overlay: rgba(0,0,0,0.95);
    --border: #1a1a1a; --border-light: #222222; --border-focus: #39ff14;
    --text-primary: #e0ffe0; --text-secondary: #60c060; --text-muted: #307030;
    --text-inverse: #000000;
    --cherry: #39ff14; --cherry-dark: #22cc00; --cherry-glow: rgba(57,255,20,.15); --cherry-glow-strong: rgba(57,255,20,.3);
    --success: #39ff14; --warning: #ffff00; --danger: #ff3333; --info: #00ffff;
}
/* ─── Theme: Arctic ───────────────────────────────────────────────────────── */
html[data-theme="arctic"] {
    --bg-primary: #f0faff; --bg-secondary: #e0f3fc; --bg-sidebar: #d0ecf8;
    --bg-card: #ffffff; --bg-card-hover: #eaf7ff; --bg-input: #e5f4fb;
    --bg-overlay: rgba(210,235,248,0.9);
    --border: #b0d8f0; --border-light: #c8e8f8; --border-focus: #7dd3fc;
    --text-primary: #0c2030; --text-secondary: #3878a0; --text-muted: #80b8d0;
    --text-inverse: #f0faff;
    --cherry: #7dd3fc; --cherry-dark: #38bdf8; --cherry-glow: rgba(125,211,252,.12); --cherry-glow-strong: rgba(125,211,252,.25);
    --success: #16a34a; --warning: #d97706; --danger: #dc2626; --info: #0284c7;
}
/* ─── Theme: Lava ─────────────────────────────────────────────────────────── */
html[data-theme="lava"] {
    --bg-primary: #0d0400; --bg-secondary: #1a0800; --bg-sidebar: #120600;
    --bg-card: #1a0800; --bg-card-hover: #251000; --bg-input: #180700;
    --bg-overlay: rgba(10,3,0,0.9);
    --border: #2a1000; --border-light: #3a1800; --border-focus: #f97316;
    --text-primary: #ffeddc; --text-secondary: #c87840; --text-muted: #703c18;
    --text-inverse: #0d0400;
    --cherry: #f97316; --cherry-dark: #ea580c; --cherry-glow: rgba(249,115,22,.15); --cherry-glow-strong: rgba(249,115,22,.3);
    --success: #4ade80; --warning: #fbbf24; --danger: #f87171; --info: #60a5fa;
}
/* ─── Theme: Lavender ─────────────────────────────────────────────────────── */
html[data-theme="lavender"] {
    --bg-primary: #f5f3ff; --bg-secondary: #ede9fe; --bg-sidebar: #ddd6fe;
    --bg-card: #ffffff; --bg-card-hover: #f0ecff; --bg-input: #e8e1ff;
    --bg-overlay: rgba(230,220,255,0.9);
    --border: #c4b5fd; --border-light: #d8ccff; --border-focus: #8b5cf6;
    --text-primary: #1e0a3a; --text-secondary: #5c3898; --text-muted: #9878c8;
    --text-inverse: #f5f3ff;
    --cherry: #8b5cf6; --cherry-dark: #7c3aed; --cherry-glow: rgba(139,92,246,.12); --cherry-glow-strong: rgba(139,92,246,.25);
    --success: #16a34a; --warning: #d97706; --danger: #dc2626; --info: #0284c7;
}
/* ─── Theme: Matrix ───────────────────────────────────────────────────────── */
html[data-theme="matrix"] {
    --bg-primary: #000000; --bg-secondary: #001200; --bg-sidebar: #000800;
    --bg-card: #001200; --bg-card-hover: #001c00; --bg-input: #000f00;
    --bg-overlay: rgba(0,6,0,0.95);
    --border: #003800; --border-light: #004800; --border-focus: #00ff41;
    --text-primary: #ccffcc; --text-secondary: #00cc00; --text-muted: #006600;
    --text-inverse: #000000;
    --cherry: #00ff41; --cherry-dark: #00cc30; --cherry-glow: rgba(0,255,65,.15); --cherry-glow-strong: rgba(0,255,65,.3);
    --success: #00ff41; --warning: #ffff00; --danger: #ff4444; --info: #00ffcc;
}
/* ─── Theme: Rust ─────────────────────────────────────────────────────────── */
html[data-theme="rust"] {
    --bg-primary: #0d0500; --bg-secondary: #1a0c00; --bg-sidebar: #120800;
    --bg-card: #1a0c00; --bg-card-hover: #221200; --bg-input: #180a00;
    --bg-overlay: rgba(10,4,0,0.9);
    --border: #2e1400; --border-light: #3e1e00; --border-focus: #c2410c;
    --text-primary: #ffe8d4; --text-secondary: #b06040; --text-muted: #603020;
    --text-inverse: #0d0500;
    --cherry: #c2410c; --cherry-dark: #9a3412; --cherry-glow: rgba(194,65,12,.15); --cherry-glow-strong: rgba(194,65,12,.3);
    --success: #4ade80; --warning: #fbbf24; --danger: #f87171; --info: #60a5fa;
}
/* ─── Theme: Cotton Candy ─────────────────────────────────────────────────── */
html[data-theme="cotton-candy"] {
    --bg-primary: #fff0f8; --bg-secondary: #fce0f0; --bg-sidebar: #f8d0e8;
    --bg-card: #ffffff; --bg-card-hover: #fff4fa; --bg-input: #fce8f4;
    --bg-overlay: rgba(252,220,240,0.9);
    --border: #f4b0d8; --border-light: #f8c8e4; --border-focus: #f472b6;
    --text-primary: #380c28; --text-secondary: #904070; --text-muted: #c88ab0;
    --text-inverse: #fff0f8;
    --cherry: #f472b6; --cherry-dark: #ec4899; --cherry-glow: rgba(244,114,182,.12); --cherry-glow-strong: rgba(244,114,182,.25);
    --success: #16a34a; --warning: #d97706; --danger: #dc2626; --info: #0284c7;
}
/* ─── Theme: Monochrome ───────────────────────────────────────────────────── */
html[data-theme="monochrome"] {
    --bg-primary: #0a0a0a; --bg-secondary: #141414; --bg-sidebar: #0d0d0d;
    --bg-card: #1a1a1a; --bg-card-hover: #222222; --bg-input: #181818;
    --bg-overlay: rgba(0,0,0,0.9);
    --border: #282828; --border-light: #323232; --border-focus: #9ca3af;
    --text-primary: #e8e8e8; --text-secondary: #888888; --text-muted: #505050;
    --text-inverse: #0a0a0a;
    --cherry: #9ca3af; --cherry-dark: #6b7280; --cherry-glow: rgba(156,163,175,.15); --cherry-glow-strong: rgba(156,163,175,.3);
    --success: #6b7280; --warning: #9ca3af; --danger: #9ca3af; --info: #9ca3af;
}
/* ─── Theme: Rose Gold ────────────────────────────────────────────────────── */
html[data-theme="rose-gold"] {
    --bg-primary: #0d0806; --bg-secondary: #1a1009; --bg-sidebar: #120c07;
    --bg-card: #1a1009; --bg-card-hover: #22160c; --bg-input: #180e08;
    --bg-overlay: rgba(10,6,4,0.9);
    --border: #2a1c14; --border-light: #3a2820; --border-focus: #e0a080;
    --text-primary: #ffece0; --text-secondary: #c09070; --text-muted: #705040;
    --text-inverse: #0d0806;
    --cherry: #e0a080; --cherry-dark: #c87850; --cherry-glow: rgba(224,160,128,.15); --cherry-glow-strong: rgba(224,160,128,.3);
    --success: #4ade80; --warning: #fbbf24; --danger: #f87171; --info: #60a5fa;
}
/* ─── Theme: Cyber Yellow ─────────────────────────────────────────────────── */
html[data-theme="cyber-yellow"] {
    --bg-primary: #000000; --bg-secondary: #0d0d00; --bg-sidebar: #080800;
    --bg-card: #0d0d00; --bg-card-hover: #181800; --bg-input: #0a0a00;
    --bg-overlay: rgba(0,0,0,0.95);
    --border: #2a2a00; --border-light: #3a3a00; --border-focus: #facc15;
    --text-primary: #fffce0; --text-secondary: #c8c060; --text-muted: #706800;
    --text-inverse: #000000;
    --cherry: #facc15; --cherry-dark: #ca8a04; --cherry-glow: rgba(250,204,21,.15); --cherry-glow-strong: rgba(250,204,21,.3);
    --success: #4ade80; --warning: #fde68a; --danger: #f87171; --info: #60a5fa;
}
/* ─── Theme: Mint ─────────────────────────────────────────────────────────── */
html[data-theme="mint"] {
    --bg-primary: #040d09; --bg-secondary: #091a10; --bg-sidebar: #071410;
    --bg-card: #091a10; --bg-card-hover: #0e2418; --bg-input: #081812;
    --bg-overlay: rgba(2,8,5,0.9);
    --border: #102818; --border-light: #183822; --border-focus: #6ee7b7;
    --text-primary: #d4fff0; --text-secondary: #60a890; --text-muted: #305848;
    --text-inverse: #040d09;
    --cherry: #6ee7b7; --cherry-dark: #10b981; --cherry-glow: rgba(110,231,183,.15); --cherry-glow-strong: rgba(110,231,183,.3);
    --success: #4ade80; --warning: #fbbf24; --danger: #f87171; --info: #60a5fa;
}
/* ─── Theme: Deep Space ───────────────────────────────────────────────────── */
html[data-theme="deep-space"] {
    --bg-primary: #02030a; --bg-secondary: #080a18; --bg-sidebar: #050812;
    --bg-card: #080a18; --bg-card-hover: #0d1025; --bg-input: #060814;
    --bg-overlay: rgba(2,2,8,0.95);
    --border: #10142e; --border-light: #181e3e; --border-focus: #818cf8;
    --text-primary: #e0e4ff; --text-secondary: #7880c0; --text-muted: #3840a0;
    --text-inverse: #02030a;
    --cherry: #818cf8; --cherry-dark: #4f46e5; --cherry-glow: rgba(129,140,248,.15); --cherry-glow-strong: rgba(129,140,248,.3);
    --success: #4ade80; --warning: #fbbf24; --danger: #f87171; --info: #a5b4fc;
}
/* ─── Theme: Amber ────────────────────────────────────────────────────────── */
html[data-theme="amber"] {
    --bg-primary: #0a0600; --bg-secondary: #140c00; --bg-sidebar: #0d0900;
    --bg-card: #140c00; --bg-card-hover: #1e1400; --bg-input: #120a00;
    --bg-overlay: rgba(8,5,0,0.9);
    --border: #281a00; --border-light: #382400; --border-focus: #d97706;
    --text-primary: #fff8e0; --text-secondary: #c09040; --text-muted: #685020;
    --text-inverse: #0a0600;
    --cherry: #d97706; --cherry-dark: #b45309; --cherry-glow: rgba(217,119,6,.15); --cherry-glow-strong: rgba(217,119,6,.3);
    --success: #4ade80; --warning: #fde68a; --danger: #f87171; --info: #60a5fa;
}
/* ─── Theme: Coffee ───────────────────────────────────────────────────────── */
html[data-theme="coffee"] {
    --bg-primary: #0a0600; --bg-secondary: #1a0e00; --bg-sidebar: #120a00;
    --bg-card: #1a0e00; --bg-card-hover: #231600; --bg-input: #180d00;
    --bg-overlay: rgba(8,4,0,0.9);
    --border: #2c1a00; --border-light: #3c2400; --border-focus: #b45309;
    --text-primary: #ffeedd; --text-secondary: #a07040; --text-muted: #604020;
    --text-inverse: #0a0600;
    --cherry: #b45309; --cherry-dark: #92400e; --cherry-glow: rgba(180,83,9,.15); --cherry-glow-strong: rgba(180,83,9,.3);
    --success: #4ade80; --warning: #fbbf24; --danger: #f87171; --info: #60a5fa;
}
/* ─── Theme: Neon Pink ────────────────────────────────────────────────────── */
html[data-theme="neon-pink"] {
    --bg-primary: #000000; --bg-secondary: #0d0009; --bg-sidebar: #080006;
    --bg-card: #0d0009; --bg-card-hover: #140012; --bg-input: #0a0008;
    --bg-overlay: rgba(0,0,0,0.95);
    --border: #280020; --border-light: #380030; --border-focus: #ff2d78;
    --text-primary: #ffe0f0; --text-secondary: #c060a0; --text-muted: #703060;
    --text-inverse: #000000;
    --cherry: #ff2d78; --cherry-dark: #e00060; --cherry-glow: rgba(255,45,120,.15); --cherry-glow-strong: rgba(255,45,120,.3);
    --success: #4ade80; --warning: #fbbf24; --danger: #f87171; --info: #60a5fa;
}

/* ─── Layout variants ─────────────────────────────────────────────────────── */
html[data-radius="sharp"] { --radius: 4px; --radius-sm: 2px; --radius-lg: 6px; }
html[data-radius="rounded"] { --radius: 16px; --radius-sm: 10px; --radius-lg: 24px; }
html[data-radius="pill"] { --radius: 999px; --radius-sm: 999px; --radius-lg: 999px; }
html[data-sidebar="compact"] { --sidebar-width: 200px; }
html[data-sidebar="wide"] { --sidebar-width: 290px; }
html[data-anim="off"] { --transition: 0s; }
html[data-anim="slow"] { --transition: 0.5s ease; }
html[data-fontscale="small"] { font-size: 14px; }
html[data-fontscale="large"] { font-size: 18px; }

/* ─── Customize Page ──────────────────────────────────────────────────────── */
.customize-page { max-width: 960px; }

.customize-section {
    margin-bottom: 40px;
}
.customize-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Preset grid */
.theme-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.theme-preset-card {
    border-radius: var(--radius);
    border: 2px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition), border-color var(--transition);
    position: relative;
}
.theme-preset-card:hover { transform: translateY(-2px); border-color: var(--border-light); }
.theme-preset-card.active { border-color: var(--cherry); }
.theme-preset-card.active .theme-preset-check {
    opacity: 1;
}
.theme-preset-preview {
    height: 70px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    position: relative;
}
.theme-preview-bar {
    height: 7px;
    border-radius: 4px;
    opacity: 0.9;
}
.theme-preview-bar.accent { width: 50%; }
.theme-preview-bar.muted { width: 80%; opacity: 0.4; }
.theme-preview-bar.muted2 { width: 60%; opacity: 0.25; }
.theme-preset-footer {
    padding: 8px 10px;
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.theme-preset-name {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-primary);
}
.theme-preset-badge {
    font-size: .65rem;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255,255,255,.12);
    color: inherit;
}
.theme-preset-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    background: var(--cherry);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
}

/* Custom builder */
.custom-builder {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 700px) { .custom-builder { grid-template-columns: 1fr; } }

.color-picker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.color-picker-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.color-picker-label {
    font-size: .8rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.color-picker-row input[type="color"] {
    width: 100%;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    cursor: pointer;
    padding: 2px 4px;
}
.custom-preview-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    position: sticky;
    top: 20px;
}
.custom-preview-panel h4 {
    font-size: .8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.preview-fake-card {
    background: var(--preview-card, #161618);
    border: 1px solid var(--preview-border, #222225);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}
.preview-fake-title {
    height: 8px;
    width: 70%;
    border-radius: 4px;
    background: var(--preview-text, #e8e8ea);
    margin-bottom: 6px;
}
.preview-fake-sub {
    height: 6px;
    width: 45%;
    border-radius: 4px;
    background: var(--preview-text, #e8e8ea);
    opacity: .4;
}
.preview-fake-btn {
    height: 28px;
    width: 80px;
    border-radius: 6px;
    background: var(--preview-accent, #ff6b9d);
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    color: #fff;
}
.custom-builder-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

/* Layout settings */
.layout-settings {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.layout-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.layout-setting-label {
    font-size: .88rem;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 120px;
}
.layout-btn-group {
    display: flex;
    gap: 4px;
}
.layout-btn {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: .8rem;
    cursor: pointer;
    transition: all var(--transition);
    font-weight: 500;
}
.layout-btn:hover { border-color: var(--cherry); color: var(--text-primary); }
.layout-btn.active {
    background: var(--cherry-glow);
    border-color: var(--cherry);
    color: var(--cherry);
}
.customize-reset-row {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }

    .media-modal-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .media-modal-poster {
        width: 140px;
    }

    .media-modal-actions {
        justify-content: center;
    }

    .media-modal-genres {
        justify-content: center;
    }

    .episode-still {
        width: 80px;
        height: 45px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════ */
.dashboard { display: flex; flex-direction: column; gap: 28px; }
.dash-greeting { }
.dash-greeting h1 { font-size: 1.55rem; margin: 0 0 4px; }
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .dash-stats { grid-template-columns: repeat(2, 1fr); } }
.dash-stat-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; transition: border-color .2s; }
.dash-stat-card:hover { border-color: var(--accent); }
.dash-stat-value { font-size: 1.75rem; font-weight: 700; color: var(--accent); line-height: 1; }
.dash-stat-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.dash-quick-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-quick-btn { padding: 8px 18px; border-radius: var(--radius); background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-secondary); cursor: pointer; font-size: .85rem; transition: border-color .2s, color .2s, transform .15s; }
.dash-quick-btn:hover { border-color: var(--accent); color: var(--text-primary); transform: translateY(-1px); }
.dash-section { display: flex; flex-direction: column; gap: 10px; }
.dash-section-header { display: flex; align-items: center; justify-content: space-between; }
.dash-section-header h2 { font-size: .95rem; font-weight: 600; color: var(--text-primary); margin: 0; display: flex; align-items: center; gap: 8px; }
.dash-section-link { font-size: .78rem; color: var(--accent); cursor: pointer; text-decoration: none; }
.dash-section-link:hover { text-decoration: underline; }
.dash-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.dash-row::-webkit-scrollbar { display: none; }
.dash-empty-row { color: var(--text-muted); font-size: .82rem; padding: 10px 0; }
.dash-game-card { flex: 0 0 144px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; transition: transform .2s, border-color .2s; }
.dash-game-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.dash-game-card-thumb { width: 100%; height: 92px; overflow: hidden; background: var(--bg-input); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.dash-game-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dash-game-card-title { font-size: .78rem; font-weight: 600; padding: 8px 10px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-game-card-meta { font-size: .68rem; color: var(--text-muted); padding: 0 10px 8px; }
.dash-media-card { flex: 0 0 124px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; transition: transform .2s, border-color .2s; }
.dash-media-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.dash-media-card-poster { width: 100%; height: 178px; object-fit: cover; background: var(--bg-input); display: block; }
.dash-media-card-title { font-size: .74rem; font-weight: 600; padding: 6px 8px 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.dash-media-card-year { font-size: .67rem; color: var(--text-muted); padding: 0 8px 8px; }
.dash-media-card-badge { display: inline-block; font-size: .62rem; padding: 2px 6px; border-radius: 100px; background: var(--accent); color: #fff; margin: 0 8px 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* ═══════════════════════════════════════════════════════════════════════════
   MUSIC TABS + PLAYLISTS
   ═══════════════════════════════════════════════════════════════════════════ */
.music-page-inner { display: flex; flex-direction: column; gap: 0; }
.music-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border-color); margin-bottom: 20px; }
.music-tab-btn { padding: 9px 18px; background: none; border: none; color: var(--text-muted); font-size: .88rem; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s, border-color .2s; font-family: inherit; border-radius: 0; }
.music-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.music-tab-btn:hover:not(.active) { color: var(--text-primary); }
.music-tab-content { display: none; }
.music-tab-content.active { display: block; }
.track-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); cursor: pointer; transition: background .15s; }
.track-item:hover { background: var(--bg-input); }
.track-item.active { background: var(--bg-input); }
.track-actions { display: flex; gap: 4px; margin-left: auto; flex-shrink: 0; }
.track-action-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px 7px; border-radius: 5px; font-size: .9rem; line-height: 1; transition: color .15s, background .15s; }
.track-action-btn:hover { color: var(--accent); background: var(--bg-card); }
.track-action-btn.liked { color: #ff4d6d !important; }
.playlist-toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
.playlist-create-input { flex: 1; }
.playlist-list { display: flex; flex-direction: column; gap: 8px; }
.playlist-item { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 12px 16px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: border-color .2s, transform .15s; }
.playlist-item:hover { border-color: var(--accent); transform: translateX(2px); }
.playlist-item-icon { width: 42px; height: 42px; border-radius: var(--radius); background: linear-gradient(135deg, var(--accent), var(--accent-dark)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem; flex-shrink: 0; }
.playlist-item-info { flex: 1; min-width: 0; }
.playlist-item-name { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playlist-item-count { font-size: .73rem; color: var(--text-muted); margin-top: 2px; }
.playlist-item-del { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; font-size: .85rem; opacity: 0; transition: opacity .15s, color .15s; }
.playlist-item:hover .playlist-item-del { opacity: 1; }
.playlist-item-del:hover { color: #ef4444; }
.playlist-tracks-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.playlist-tracks-back { background: none; border: none; color: var(--accent); cursor: pointer; font-size: .85rem; display: flex; align-items: center; gap: 6px; padding: 0; font-family: inherit; }
.playlist-tracks-title { font-weight: 600; font-size: 1rem; }
.playlist-tracks-count { font-size: .78rem; color: var(--text-muted); margin-left: auto; }
.playlist-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.playlist-modal { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 22px; width: 300px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.playlist-modal h3 { margin: 0 0 14px; font-size: .95rem; }
.playlist-modal-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; max-height: 260px; overflow-y: auto; }
.playlist-modal-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius); cursor: pointer; background: var(--bg-input); transition: background .15s; font-size: .85rem; }
.playlist-modal-item:hover { background: var(--border-color); }
.playlist-modal-close { width: 100%; padding: 9px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius); cursor: pointer; color: var(--text-secondary); transition: color .2s; font-family: inherit; font-size: .85rem; }
.playlist-modal-close:hover { color: var(--text-primary); }
.music-history-empty { color: var(--text-muted); font-size: .85rem; padding: 20px 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   SETTINGS PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.settings-page { max-width: 680px; display: flex; flex-direction: column; gap: 20px; }
.settings-section { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; }
.settings-section-title { padding: 12px 18px; border-bottom: 1px solid var(--border-color); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.settings-row { display: flex; align-items: center; gap: 16px; padding: 13px 18px; border-bottom: 1px solid var(--border-color); }
.settings-row:last-child { border-bottom: none; }
.settings-row-info { flex: 1; min-width: 0; }
.settings-row-label { font-size: .87rem; font-weight: 500; color: var(--text-primary); }
.settings-row-desc { font-size: .73rem; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.settings-select { background: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-primary); border-radius: var(--radius); padding: 6px 10px; font-size: .83rem; cursor: pointer; font-family: inherit; }
.settings-toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.settings-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.settings-toggle-slider { position: absolute; inset: 0; border-radius: 24px; background: var(--border-color); cursor: pointer; transition: background .25s; }
.settings-toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; left: 3px; top: 3px; transition: transform .25s; }
.settings-toggle input:checked + .settings-toggle-slider { background: var(--accent); }
.settings-toggle input:checked + .settings-toggle-slider::before { transform: translateX(20px); }
.settings-select { padding: 7px 12px; border-radius: var(--radius); border: 1px solid var(--border-color); background: var(--bg-input); color: var(--text-primary); font-size: .81rem; font-family: inherit; cursor: pointer; outline: none; min-width: 160px; }
.settings-select:focus { border-color: var(--accent); }
.settings-action-btn { padding: 7px 14px; border-radius: var(--radius); border: 1px solid var(--border-color); background: var(--bg-input); color: var(--text-secondary); font-size: .81rem; cursor: pointer; white-space: nowrap; transition: border-color .2s, color .2s; font-family: inherit; }
.settings-action-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.settings-action-btn.danger { border-color: rgba(239,68,68,.4); color: #ef4444; }
.settings-action-btn.danger:hover { background: rgba(239,68,68,.08); border-color: #ef4444; }
.settings-about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.settings-about-cell { padding: 13px 18px; border-bottom: 1px solid var(--border-color); border-right: 1px solid var(--border-color); }
.settings-about-cell:nth-child(even) { border-right: none; }
.settings-about-cell:nth-last-child(-n+2) { border-bottom: none; }
.settings-about-val { font-weight: 600; font-size: .88rem; color: var(--text-primary); }
.settings-about-key { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Manga
   ═══════════════════════════════════════════════════════════════════════════ */

/* Status badge colours */
.manga-status-ongoing { background: #22c55e !important; }
.manga-status-completed { background: #3b82f6 !important; }
.manga-status-hiatus { background: #f59e0b !important; }
.manga-status-cancelled { background: #ef4444 !important; }

/* ── Manga Detail Modal ─────────────────────────────────────────────── */
.manga-modal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; overflow-y: auto;
}
.manga-modal {
    background: var(--bg-card, #1a1a2e); border-radius: 16px;
    width: 100%; max-width: 800px; max-height: 90vh;
    overflow-y: auto; position: relative;
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.manga-modal-body {
    display: flex; gap: 24px; padding: 28px;
}
.manga-modal-cover {
    flex-shrink: 0; width: 200px;
}
.manga-modal-cover img {
    width: 100%; border-radius: 10px; display: block;
}
.manga-modal-info {
    flex: 1; min-width: 0;
}
.manga-modal-info h2 {
    margin: 0 0 8px; font-size: 1.4rem; color: var(--text-primary);
}
.manga-modal-meta {
    display: flex; gap: 10px; align-items: center; margin-bottom: 10px;
    font-size: 13px; color: var(--text-muted);
}
.manga-modal-status {
    padding: 2px 8px; border-radius: 4px; font-size: 11px;
    font-weight: 700; color: #fff; text-transform: uppercase;
}
.manga-modal-tags {
    display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
}
.manga-tag {
    padding: 3px 9px; border-radius: 20px; font-size: 11px;
    background: var(--bg-secondary, rgba(255,255,255,0.06));
    color: var(--text-muted); border: 1px solid var(--border, rgba(255,255,255,0.08));
}
.manga-modal-desc {
    color: var(--text-secondary, rgba(255,255,255,0.7));
    font-size: 13px; line-height: 1.6; margin-bottom: 12px;
    max-height: 120px; overflow-y: auto;
}
.manga-modal-author {
    font-size: 12px; color: var(--text-muted); margin-bottom: 16px;
}

/* ── Chapters list ───────────────────────────────────────────────────── */
.manga-chapters-section { margin-top: 8px; }
.manga-chapters-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.manga-chapters-header h3 {
    margin: 0; font-size: 1rem; color: var(--text-primary);
}
.manga-chapters-sort {
    display: flex; gap: 4px;
}
.manga-sort-btn {
    padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border);
    background: transparent; color: var(--text-muted); font-size: 11px;
    cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.manga-sort-btn.active {
    background: var(--cherry, #e74c6f); color: #fff; border-color: var(--cherry);
}
.manga-chapters-list {
    max-height: 340px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 10px;
}
.manga-chapter-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; cursor: pointer;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
    transition: background 0.15s;
}
.manga-chapter-row:last-child { border-bottom: none; }
.manga-chapter-row:hover { background: var(--bg-secondary, rgba(255,255,255,0.04)); }
.manga-chapter-num {
    font-weight: 600; font-size: 13px; color: var(--cherry, #e74c6f);
    white-space: nowrap; min-width: 55px;
}
.manga-chapter-title {
    flex: 1; font-size: 13px; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.manga-chapter-meta {
    display: flex; gap: 8px; font-size: 11px; color: var(--text-muted);
    white-space: nowrap;
}
.manga-chapter-group {
    max-width: 120px; overflow: hidden; text-overflow: ellipsis;
}
.manga-load-more-btn {
    display: block; width: 100%; padding: 10px; margin-top: 8px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text-secondary); font-size: 13px;
    cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.manga-load-more-btn:hover {
    background: var(--cherry); color: #fff; border-color: var(--cherry);
}

/* ── Manga Reader ────────────────────────────────────────────────────── */
.manga-reader {
    position: fixed; inset: 0; z-index: 3000;
    background: #000; display: flex; flex-direction: column;
}
.manga-reader-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px; background: rgba(0,0,0,0.85);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0; z-index: 1;
}
.manga-reader-title {
    color: #fff; font-size: 14px; font-weight: 500;
    flex: 1; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    padding: 0 12px;
}
.manga-reader-nav {
    display: flex; align-items: center; gap: 8px;
    color: #fff; font-size: 12px;
}
.manga-reader-nav .icon-btn {
    font-size: 16px; color: #fff; background: rgba(255,255,255,0.1);
    border: none; border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
.manga-reader-nav .icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.manga-reader-pages {
    flex: 1; overflow-y: auto; display: flex; flex-direction: column;
    align-items: center; padding: 0; background: #111;
}
.manga-page-wrap {
    width: 100%; max-width: 800px; min-height: 200px;
    flex-shrink: 0; margin: 0 auto; display: block;
}
.manga-page-img {
    width: 100%; height: auto; display: block;
    object-fit: contain;
}
.manga-page-error {
    padding: 40px; color: var(--text-muted); text-align: center;
    font-size: 13px;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .manga-modal-body { flex-direction: column; padding: 20px; }
    .manga-modal-cover { width: 140px; margin: 0 auto; }
    .manga-chapters-list { max-height: 250px; }
    .manga-chapter-meta { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════
   YOUTUBE
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Suggestion Chips ────────────────────────────────────────────────── */
.yt-suggestions {
    display: flex; flex-wrap: wrap; gap: 10px;
    padding: 10px 0;
}
.yt-suggestion-chip {
    padding: 10px 20px; border-radius: 20px;
    background: var(--card-bg); color: var(--text);
    border: 1px solid var(--border); cursor: pointer;
    font-size: 14px; font-weight: 500;
    transition: all 0.2s ease;
}
.yt-suggestion-chip:hover {
    background: var(--accent); color: #fff;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ── Video Grid ──────────────────────────────────────────────────────── */
.yt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px; padding: 10px 0;
}
.yt-card {
    background: var(--card-bg); border-radius: 12px;
    overflow: hidden; cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.25s ease;
}
.yt-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-color: var(--accent);
}
.yt-card-thumb {
    position: relative; width: 100%;
    aspect-ratio: 16 / 9; overflow: hidden;
    background: #111;
}
.yt-card-thumb img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.3s ease;
}
.yt-card:hover .yt-card-thumb img {
    transform: scale(1.05);
}
.yt-duration {
    position: absolute; bottom: 8px; right: 8px;
    background: rgba(0,0,0,0.85); color: #fff;
    padding: 2px 6px; border-radius: 4px;
    font-size: 12px; font-weight: 600;
    font-family: 'Roboto Mono', monospace;
}
.yt-card-info {
    padding: 12px 14px;
}
.yt-card-title {
    font-weight: 600; font-size: 14px; line-height: 1.4;
    color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: 6px;
}
.yt-card-channel {
    font-size: 13px; color: var(--text-muted);
    margin-bottom: 4px;
}
.yt-card-meta {
    font-size: 12px; color: var(--text-muted);
    display: flex; gap: 6px;
}

/* ── Video Player Overlay ────────────────────────────────────────────── */
.yt-player {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg); z-index: 5000;
    display: flex; flex-direction: column;
}
.yt-player-header {
    display: flex; align-items: center; gap: 16px;
    padding: 12px 20px; border-bottom: 1px solid var(--border);
    background: var(--card-bg);
}
.yt-player-title {
    flex: 1; font-weight: 600; font-size: 15px;
    color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.yt-nocookie-badge {
    background: rgba(34,197,94,0.15); color: #22c55e;
    padding: 4px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
    white-space: nowrap;
}
.yt-player-frame-wrap {
    flex: 1; display: flex; align-items: center;
    justify-content: center; background: #000;
    padding: 0;
}
.yt-player-frame {
    width: 100%; height: 100%; border: none;
}
.yt-player-info {
    padding: 0 20px;
}

/* ── YT Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .yt-grid { grid-template-columns: 1fr; gap: 14px; }
    .yt-player-header { padding: 10px 14px; gap: 10px; }
    .yt-player-title { font-size: 13px; }
    .yt-nocookie-badge { display: none; }
    .yt-suggestion-chip { padding: 8px 14px; font-size: 13px; }
}
