/* ===========================
   Design Tokens
   =========================== */
:root {
    --bg-base: transparent;
    
    /* TWEAK TRANSPARENCY: Adjust the '0.75' (alpha) values below to change how see-through the main panels are */
    --bg-surface: rgba(21, 21, 28, 0.75); /* Main panels, topbar, and lists */
    --bg-card: rgba(28, 28, 40, 0.75);    /* Inner cards, queue, and playlist items */
    --bg-hover: rgba(38, 38, 54, 0.85);   /* Hover state for list items */
    --bg-input: rgba(26, 26, 38, 0.6);    /* Search bars and text inputs */
    
    --accent: #06b6d4;
    --accent-hover: #0891b2;
    --accent-dim: rgba(6, 182, 212, 0.15);
    --accent-glow: rgba(6, 182, 212, 0.35);
    --warm: #f59e0b;
    --warm-dim: rgba(245, 158, 11, 0.15);
    --text: #eeeef2;
    --text-2: #9898b0;
    --text-3: #5a5a72;
    --border: #2a2a3c;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.2s ease;
}

/* ===========================
   Reset
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; overflow-x: hidden; }
body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===========================
   Overlay / Login
   =========================== */
.overlay {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(16px);
}
.login-card, .modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px;
    width: 420px;
    max-width: 90vw; /* Prevent horizontal stretching on mobile */
    text-align: center;
}
.login-card h1 { font-size: 1.6rem; margin-bottom: 4px; }
.login-card p, .modal-card p { color: var(--text-2); font-size: 0.9rem; margin-bottom: 18px; }
.modal-card h3 { margin-bottom: 14px; font-size: 1.1rem; }
.login-logo {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: white;
    margin: 0 auto 14px;
    box-shadow: 0 0 40px var(--accent-glow);
}
.login-card input, .modal-card input {
    width: 100%; padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text); font-size: 0.95rem;
    margin-bottom: 12px; outline: none;
    transition: border var(--transition);
}
.login-card input:focus, .modal-card input:focus { border-color: var(--accent); }
.modal-btns { display: flex; gap: 8px; }
.modal-btns > * { flex: 1; }

/* Discord Login Button */
.btn-discord {
    width: 100%;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    background: #5865f2;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}
.btn-discord:hover { background: #4752c4; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(88, 101, 242, 0.4); }

/* Login Divider */
.login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 16px 0;
    color: var(--text-3);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.login-divider::before, .login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Server Picker */
.server-picker-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    margin-bottom: 14px;
    font-size: 0.85rem;
    color: var(--text-2);
}
.server-picker-user img {
    width: 28px; height: 28px;
    border-radius: 50%;
}
.server-picker-user strong { color: var(--text); }

.server-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-height: 240px;
    overflow-y: auto;
    margin-bottom: 4px;
}
.server-grid-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    color: var(--text-3);
    font-size: 0.85rem;
}
.server-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text);
}
.server-card:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.15);
}
.server-card-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-2);
    overflow: hidden;
}
.server-card-icon img { width: 100%; height: 100%; object-fit: cover; }
.server-card-name {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.server-grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px;
    color: var(--text-3);
    font-size: 0.85rem;
}

/* Create Playlist Type Toggle */
.cp-type-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.cp-type-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 2px solid var(--border);
    color: var(--text-3);
    transition: all 0.25s ease;
    cursor: pointer;
}
.cp-type-btn i { font-size: 1.1rem; }
.cp-type-btn span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
}
.cp-type-btn small {
    font-size: 0.7rem;
    color: var(--text-3);
    font-weight: 400;
}
.cp-type-btn:hover {
    border-color: var(--text-3);
    background: var(--bg-hover);
}
.cp-type-btn.active {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 20px var(--accent-glow);
}
.cp-type-btn.active i,
.cp-type-btn.active span {
    color: var(--accent);
}

/* ===========================
   Buttons
   =========================== */
.btn-accent {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; border-radius: var(--radius-sm);
    background: var(--accent); color: #000; font-weight: 600; font-size: 0.9rem;
    transition: all var(--transition);
    width: 100%;
}
.btn-accent:hover { background: var(--accent-hover); box-shadow: 0 2px 16px var(--accent-glow); }
.btn-ghost {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-2); font-size: 0.85rem;
    transition: all var(--transition);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); border-color: var(--accent); }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

/* ===========================
   Dynamic Background
   =========================== */
#glcanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -1;
    background-color: var(--bg);
}

/* ===========================
   Top Bar
   =========================== */
.topbar {
    display: flex; align-items: center;
    padding: 14px 24px; gap: 16px;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.topbar-brand {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 1.1rem;
    flex-shrink: 0;
}
.topbar-brand i { color: var(--accent); }
.topbar-search-wrap {
    flex: 1; max-width: 500px;
    position: relative;
}
.topbar-search {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 24px;
    transition: border var(--transition);
}
.topbar-search:focus-within { border-color: var(--accent); }
.topbar-search i { color: var(--text-3); font-size: 0.85rem; }
.topbar-search input {
    flex: 1; border: none; background: none;
    color: var(--text); font-size: 0.9rem; outline: none;
}
.search-dropdown {
    display: none;
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 400px; overflow-y: auto;
    z-index: 200;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.search-dropdown.visible { display: block; }
.topbar-actions {
    display: flex; align-items: center; gap: 12px; margin-left: auto;
}
.discord-auth-area {
    display: flex; align-items: center; gap: 10px;
    margin-right: 6px;
    padding-right: 16px;
    border-right: 1px solid var(--border);
}
#discordLoginBtn {
    background: #5865F2; /* Discord blurple */
    color: white;
}
#discordLoginBtn:hover {
    background: #4752C4;
}
.discord-profile {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-input);
    padding: 4px 12px 4px 4px;
    border-radius: 20px;
    border: 1px solid var(--border);
}
.discord-profile img {
    width: 24px; height: 24px; border-radius: 50%;
}
.discord-profile span {
    font-size: 0.85rem; font-weight: 600; color: var(--text);
}
.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--text-3);
    transition: background var(--transition);
}
.status-dot.connected { background: var(--success); box-shadow: 0 0 8px rgba(34,197,94,0.5); }

/* ===========================
   Overflow Menu
   =========================== */
.topbar-overflow-wrap {
    position: relative;
}
.topbar-overflow-btn {
    padding: 8px 10px !important;
    font-size: 1rem;
}
.topbar-overflow-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-surface);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
    z-index: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    animation: overflowSlideIn 0.15s ease-out;
}
.topbar-overflow-menu.open { display: block; }
@keyframes overflowSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.overflow-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-2);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    text-align: left;
}
.overflow-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.overflow-item i {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
}
.overflow-item .status-dot {
    margin-left: auto;
}
.overflow-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 8px;
}
/* On PC: hide the mobile-only overflow items */
.overflow-mobile-only { display: none; }

/* ===========================
   Content
   =========================== */
.content {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

/* ===========================
   Hero / Now Playing
   =========================== */
.hero {
    text-align: center;
    margin-bottom: 30px;
}
.hero-art-wrap {
    width: 220px; height: 220px;
    margin: 0 auto 20px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}
.hero-art {
    width: 100%; height: 100%;
    object-fit: cover;
    display: none;
}
.hero-art.visible { display: block; }
.hero-art-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: var(--text-3);
}
.hero-art-placeholder.hidden { display: none; }

.hero-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 2px;
}
.btn-hero-action {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-2);
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
    font-size: 0.8rem;
}
.btn-hero-action:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text);
    transform: scale(1.1);
}
/* Favorite Star */
.hero-fav-btn.favorited {
    color: var(--warm);
    border-color: var(--warm);
    background: var(--warm-dim);
}
.hero-fav-btn.favorited:hover {
    background: rgba(245, 158, 11, 0.25);
}
/* Clickable hero title */
.hero-title {
    font-size: 1.4rem; font-weight: 700;
    margin-bottom: 0px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 600px;
    text-decoration: none;
    color: var(--text);
    transition: color 0.2s;
}
.hero-title:hover { color: var(--accent); }
/* Download spinner */
.hero-download-spinner {
    color: var(--accent);
    font-size: 0.9rem;
    flex-shrink: 0;
}
/* Guild branding in topbar */
.guild-brand {
    display: flex; align-items: center; gap: 6px;
}
.guild-sep {
    color: var(--text-3);
    font-weight: 400;
    margin: 0 2px;
}
.guild-icon {
    width: 22px; height: 22px;
    border-radius: 50%;
}
.guild-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-2);
}
/* Added-by text in queue items */
.queue-item .added-by {
    font-size: 0.7rem;
    color: var(--text-3);
    font-style: italic;
}
.hero-subtitle {
    font-size: 0.9rem; color: var(--text-2);
}

/* ===========================
   Progress Bar
   =========================== */
.progress-section {
    display: flex; align-items: center; gap: 10px;
    margin: 18px auto 14px;
    max-width: 500px;
}
.time { font-size: 0.75rem; color: var(--text-3); min-width: 36px; font-variant-numeric: tabular-nums; }
.progress-track {
    flex: 1; height: 4px;
    background: var(--border);
    border-radius: 2px;
    position: relative; cursor: pointer;
    transition: height 0.15s;
}
.progress-track:hover { height: 6px; }
.progress-fill {
    height: 100%; width: 0%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s linear;
}
.progress-track:hover .progress-fill {
    background: linear-gradient(90deg, var(--accent), #06d6a0);
}
.progress-knob {
    position: absolute; top: 50%; left: 0%;
    transform: translate(-50%, -50%);
    width: 12px; height: 12px;
    background: var(--text);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.15s;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
}
.progress-track:hover .progress-knob { opacity: 1; }

/* ===========================
   Controls
   =========================== */
.controls {
    display: flex; align-items: center; justify-content: center;
    gap: 16px; /* Adjusted cap for 7 buttons */
    margin-bottom: 10px;
}
.ctrl {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 1rem;
    color: var(--text-2);
    transition: all var(--transition);
}
.ctrl:hover { color: var(--text); }
.ctrl.active { color: var(--accent); }
.ctrl-play {
    width: 52px; height: 52px;
    background: var(--text);
    color: #1a1a24 !important;
    font-size: 1.15rem;
    box-shadow: 0 2px 16px rgba(255,255,255,0.15);
}
.ctrl-play:hover { transform: scale(1.08); }

.volume-row {
    display: flex; align-items: center; justify-content: center;
    gap: 14px; margin-top: 6px;
}
.ctrl-sm {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
    color: var(--text-3);
    transition: color var(--transition);
}
.ctrl-sm:hover { color: var(--danger); }
.volume-slider-wrap {
    display: flex; align-items: center; gap: 8px;
    color: var(--text-3); font-size: 0.8rem;
}
.vol-label { min-width: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.ctrl-normalize {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
    color: var(--text-3);
    transition: all var(--transition);
    position: relative;
}
.ctrl-normalize:hover { color: var(--text); }
.ctrl-normalize.active {
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
}

/* Range slider */
.slider {
    -webkit-appearance: none; appearance: none;
    width: 110px; height: 4px;
    background: var(--border);
    border-radius: 2px; outline: none; cursor: pointer;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    background: var(--text);
    border-radius: 50%; cursor: pointer;
}

/* ===========================
   Panels / Tabs
   =========================== */
.panels {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.tab-bar {
    display: flex;
    border-bottom: 1px solid var(--border);
}
.tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-3);
    transition: all var(--transition);
    border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text-2); background: var(--bg-card); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--bg-card); }
.tab i { margin-right: 5px; }
.tab-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 4px;
}

.tab-panel { display: none; max-height: 400px; overflow-y: auto; }
.tab-panel.active { display: block; }

.add-bar {
    display: flex; gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}
.add-bar input {
    flex: 1; padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text); font-size: 0.85rem;
    outline: none;
}
.add-bar input:focus { border-color: var(--accent); }
.add-bar .btn-accent { width: auto; }

.pl-header { padding: 10px 14px; }

.empty-state {
    text-align: center; padding: 40px 16px;
    color: var(--text-3);
}
.empty-state i { font-size: 1.5rem; margin-bottom: 8px; display: block; }
.empty-state p { font-size: 0.85rem; }

/* ===========================
   Queue Items
   =========================== */
.song-list-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 14px; border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}
.header-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); }
.header-actions { display: flex; gap: 8px; }

.btn-header-action {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-2); font-size: 0.75rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.btn-header-action:hover { background: rgba(255,255,255,0.1); color: var(--text); border-color: var(--text-3); }
.btn-header-action.active { background: rgba(59, 130, 246, 0.15); color: var(--accent); border-color: var(--accent); }

/* Hidden Message Area */
.hidden-notice {
    text-align: center; padding: 60px 24px;
    color: var(--text-2);
}
.hidden-notice i { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; display: block; }
.hidden-notice h4 { font-size: 1.2rem; margin-bottom: 8px; color: var(--text); }
.hidden-notice p { font-size: 0.9rem; color: var(--text-3); }

.song-list { padding: 4px 0; }
.queue-item {
    display: flex; align-items: center;
    gap: 12px; padding: 10px 14px;
    transition: background var(--transition);
    cursor: grab; user-select: none;
}
.queue-item:hover { background: var(--bg-hover); }
.queue-item.dragging { opacity: 0.3; }
.queue-item .idx {
    width: 22px; text-align: center;
    font-size: 0.8rem; color: var(--text-3); font-weight: 600;
}
.queue-item .info { flex: 1; min-width: 0; }
.queue-item .name {
    font-size: 0.88rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.queue-item .dur { font-size: 0.75rem; color: var(--text-3); }
.queue-item .rm {
    padding: 5px; border-radius: 4px;
    color: var(--text-3); opacity: 0;
    transition: all var(--transition);
}
.queue-item:hover .rm { opacity: 1; }
.queue-item .rm:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

/* Admin Toggle */
.admin-btn {
    margin-left: auto !important;
    font-size: 0.85rem;
    opacity: 0.5;
    transition: all var(--transition);
}
.admin-btn:hover { opacity: 1; }
.admin-btn.admin-active {
    opacity: 1;
    color: var(--accent);
}

/* ===========================
   Search Results
   =========================== */
.result-item {
    display: flex; align-items: center;
    gap: 12px; padding: 10px 14px;
    transition: background var(--transition);
}
.result-item:hover { background: var(--bg-hover); }
.result-thumb-wrap {
    width: 80px; height: 45px;
    border-radius: 6px; overflow: hidden;
    flex-shrink: 0; position: relative;
    background: var(--bg-card);
}
.result-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.dur-badge {
    position: absolute; bottom: 3px; right: 3px;
    background: rgba(0,0,0,0.85);
    padding: 1px 5px; border-radius: 3px;
    font-size: 0.65rem; font-weight: 600;
}
.result-info { flex: 1; min-width: 0; }
.result-name {
    font-size: 0.88rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-meta { font-size: 0.75rem; color: var(--text-3); }
.age-badge {
    background: var(--danger); color: white;
    padding: 0 5px; border-radius: 3px;
    font-size: 0.65rem; font-weight: 700;
}
.result-add-btn {
    padding: 7px 14px;
    border-radius: 20px;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 0.8rem; font-weight: 600;
    transition: all var(--transition);
}
.result-add-btn:hover { background: var(--accent); color: #000; }

/* ===========================
   Playlists
   =========================== */
.playlist-grid { padding: 10px 14px; }
.pl-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; margin-bottom: 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.pl-card:hover { border-color: var(--accent); }
.pl-clickable { cursor: pointer; }
.pl-card .pl-name { font-weight: 600; font-size: 0.9rem; }
.pl-card .pl-count { font-size: 0.8rem; color: var(--text-3); }
.pl-card .pl-actions { display: flex; gap: 6px; }
.pl-btn {
    padding: 6px 12px; border-radius: 6px;
    font-size: 0.8rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.pl-btn:hover { background: var(--bg-surface); }
.pl-btn.play { background: var(--accent-dim); color: var(--accent); border-color: transparent; }
.pl-btn.play:hover { background: var(--accent); color: #000; }
.pl-btn.del:hover { color: var(--danger); border-color: var(--danger); }

/* ===========================
   Voice Channel List
   =========================== */
.vc-btn {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 11px 14px; margin-bottom: 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text); font-size: 0.9rem;
    transition: all var(--transition);
    text-align: left;
}
.vc-btn:hover { background: var(--bg-hover); border-color: var(--accent); }
.vc-btn i { color: var(--text-3); }

/* ===========================
   Loading
   =========================== */
.loading {
    text-align: center; padding: 30px;
    color: var(--text-3);
}

/* ===========================
   Playlist Detail
   =========================== */
.pl-detail-header {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0 12px; margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.pl-back-btn {
    padding: 8px 10px; border-radius: 6px;
    background: var(--bg-hover); border: 1px solid var(--border);
    color: var(--text-2); font-size: 0.9rem;
    transition: all var(--transition);
}
.pl-back-btn:hover { color: var(--accent); border-color: var(--accent); }
.pl-detail-title { font-weight: 700; font-size: 1rem; flex: 1; }
.pl-detail-count { color: var(--text-3); font-size: 0.8rem; }
.pl-play-all-btn {
    padding: 6px 14px; border-radius: 6px;
    background: var(--accent-dim); color: var(--accent);
    border: none; font-size: 0.8rem; font-weight: 600;
    transition: all var(--transition);
}
.pl-play-all-btn:hover { background: var(--accent); color: #000; }

.pl-song {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; margin-bottom: 4px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
    cursor: grab;
}
.pl-song:hover { border-color: var(--accent); }
.pl-song.dragging { opacity: 0.4; }
.pl-song-idx { color: var(--text-3); font-size: 0.75rem; min-width: 20px; text-align: center; }
.pl-song-info { flex: 1; min-width: 0; }
.pl-song-title { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-song-dur { font-size: 0.75rem; color: var(--text-3); }
.pl-song-actions { display: flex; gap: 4px; }
.pl-song-btn {
    padding: 5px 8px; border-radius: 4px;
    background: var(--bg-hover); border: 1px solid transparent;
    color: var(--text-2); font-size: 0.75rem;
    transition: all var(--transition);
}
.pl-song-btn:hover { border-color: var(--accent); color: var(--accent); }
.pl-song-btn.rm-btn:hover { border-color: var(--danger); color: var(--danger); }

/* ===========================
   Responsive
   =========================== */
@media (max-width: 600px) {
    .content { padding: 16px 12px 40px; }
    .hero-art-wrap { width: 160px; height: 160px; }
    .hero-title { font-size: 1.1rem; }
    
    .topbar { flex-wrap: wrap; padding: 12px 14px; gap: 10px; }
    .topbar-search-wrap { order: 10; flex: 1 1 100%; min-width: 100%; margin-top: 2px; }
    .topbar-actions span { display: none; }

    /* Hide primary Games button on mobile — it's in the overflow menu instead */
    .topbar-primary-action { display: none !important; }
    /* Show mobile-only overflow items */
    .overflow-mobile-only { display: flex !important; }
    /* Keep text visible inside the overflow menu */
    .topbar-overflow-menu span { display: inline !important; }
}

/* ===========================
   Autoplay Sidebar
   =========================== */
.sidebar {
    position: fixed;
    top: 65px; /* Height of topbar */
    right: 0;
    bottom: 0;
    width: 320px;
    
    /* TWEAK TRANSPARENCY: Adjust the '0.6' below for the Activity and Autoplay sidebars specifically */
    background: rgba(21, 21, 28, 0.60); 
    backdrop-filter: blur(24px);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 150;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0,0,0,0.3);
}
.sidebar.open {
    transform: translateX(0);
}

/* Activity Sidebar opens from the left */
.activity-sidebar {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    box-shadow: 10px 0 40px rgba(0,0,0,0.3);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.sidebar-help {
    font-size: 0.85rem;
    color: var(--text-2);
    margin-bottom: 24px;
    line-height: 1.5;
}

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

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}
.checkbox-item:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}
.checkbox-item input {
    display: none;
}
.checkbox-item.selected {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}
.checkbox-item.excluded {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--danger);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}
.checkbox-item.excluded:hover {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
}
.checkbox-item span {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.checkbox-item {
    justify-content: space-between;
}
.checkbox-state-icon {
    font-size: 0.8rem;
    flex-shrink: 0;
}

.btn-close {
    font-size: 1.25rem;
    color: var(--text-3);
    transition: color var(--transition);
}
.btn-close:hover {
    color: var(--danger);
}

/* Autoplay Button State */
#btnToggleAutoplay.active {
    color: var(--accent);
    text-shadow: 0 0 15px var(--accent-glow);
}

.sidebar-open-btn.active {
    background: var(--accent-dim);
    color: var(--accent);
}

@media (max-width: 800px) {
    .sidebar {
        width: 100vw;
        max-width: 100vw;
        top: 60px;
    }
}

/* Autoplay Sidebar Layout */
.sidebar-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.section-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-2);
}

.limit-badge {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 0 10px var(--accent-glow);
}

.sidebar-tip {
    font-size: 0.75rem;
    color: var(--text-3);
    margin-top: 12px;
    font-style: italic;
}

/* ===========================
   Activity Items
   =========================== */
.activity-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    margin-bottom: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.activity-item.status-done {
    opacity: 0.75;
}
.activity-item.status-active {
    border-color: var(--accent);
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.05) 0%, transparent 100%);
}
.activity-item.status-error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.activity-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: var(--text-2);
    flex-shrink: 0;
    margin-top: 2px;
}
.status-active .activity-icon { color: var(--accent); }
.status-error .activity-icon { color: var(--danger); }
.status-done .activity-icon { color: var(--success); }

.activity-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 0.7rem;
    color: var(--text-3);
}

.activity-primary-status {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}
.status-active .activity-primary-status { color: var(--accent); text-shadow: 0 0 8px rgba(6, 182, 212, 0.3); }
.status-error .activity-primary-status { color: var(--danger); }

.activity-title {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-2);
    word-break: break-word;
    line-height: 1.3;
}



.activity-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
}
.activity-indicator i { font-size: 0.8rem; }

.activity-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

#btnOpenActivity {
    position: relative;
}
#activityBadge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: #000;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    display: none;
}
#activityBadge.visible {
    display: block;
}

/* ===========================
   Resolve Modal
   =========================== */
.resolve-modal {
    max-width: 440px;
    text-align: left;
}
.resolve-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.resolve-header h3 {
    margin-bottom: 0;
    font-size: 1.1rem;
}
.resolve-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.resolve-result:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}
.resolve-result-thumb {
    width: 52px;
    height: 36px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    font-size: 0.8rem;
}
.resolve-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.resolve-result-info {
    flex: 1;
    min-width: 0;
}
.resolve-result-title {
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.resolve-result-dur {
    font-size: 0.7rem;
    color: var(--text-3);
}
.resolve-pick-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ===========================
   Profile Page
   =========================== */
.profile-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

.profile-header {
    margin-bottom: 28px;
}
.profile-header .btn-ghost {
    margin-bottom: 16px;
}
.profile-identity {
    display: flex;
    align-items: center;
    gap: 18px;
}
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    box-shadow: 0 0 24px var(--accent-glow);
}
.profile-username {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2px;
}
.profile-member-since {
    font-size: 0.8rem;
    color: var(--text-3);
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.profile-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px 16px;
    text-align: center;
    transition: all var(--transition);
}
.profile-stat-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}
.profile-stat-card .stat-icon {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 8px;
}
.profile-stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}
.profile-stat-card .stat-label {
    font-size: 0.72rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-section {
    margin-bottom: 24px;
}
.profile-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.profile-section-title i {
    color: var(--accent);
}

.profile-song-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.profile-song-item:hover {
    background: var(--bg-hover);
}
.profile-song-rank {
    width: 22px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-3);
}
.profile-song-rank.gold { color: #fbbf24; }
.profile-song-rank.silver { color: #94a3b8; }
.profile-song-rank.bronze { color: #d97706; }
.profile-song-thumb {
    width: 42px;
    height: 30px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-card);
}
.profile-song-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-song-info {
    flex: 1;
    min-width: 0;
}
.profile-song-title {
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-song-meta {
    font-size: 0.7rem;
    color: var(--text-3);
}

.profile-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-3);
}
.profile-empty i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.3;
}
.profile-empty p {
    font-size: 0.85rem;
}

