/* ============================
   Vinyl Collection Player v2
   Static SPA — dark theme, amber accents
   ============================ */

:root {
    --bg: #0a0a0a;
    --bg-card: #141414;
    --bg-hover: #1a1a1a;
    --bg-surface: #111111;
    --border: #222;
    --text: #e8e8e8;
    --text-muted: #888;
    --text-dim: #555;
    --accent: #d4a026;
    --accent-hover: #e8b84a;
    --accent-glow: rgba(212, 160, 38, 0.15);
    --danger: #c0392b;
    --info: #2980b9;
    --radius: 8px;
    --radius-sm: 4px;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ============ TOP NAV ============ */

.top-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; height: 60px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}

.nav-brand {
    font-family: var(--font-mono); font-weight: 700; font-size: 18px;
    color: var(--text); display: flex; align-items: center; gap: 8px;
    cursor: pointer;
}
.nav-brand:hover { color: var(--accent); }
.vinyl-icon { font-size: 22px; color: var(--accent); }

.nav-links { display: flex; gap: 4px; margin-left: 24px; flex: 1; }
.nav-link {
    padding: 8px 14px; font-size: 13px; color: var(--text-muted);
    border-radius: var(--radius-sm); transition: all 0.2s; cursor: pointer;
}
.nav-link:hover { color: var(--text); background: var(--bg-hover); }

/* ============ BUTTONS ============ */

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-card);
    color: var(--text); font-family: var(--font-body);
    font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.btn:hover { background: var(--bg-hover); border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary, .btn-play-all {
    background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600;
}
.btn-primary:hover, .btn-play-all:hover {
    background: var(--accent-hover); border-color: var(--accent-hover); color: #000;
}

.btn-large { padding: 14px 28px; font-size: 16px; border-radius: var(--radius); }
.btn-sync .sync-icon, .btn-large .sync-icon { font-size: 16px; }

.btn-clear {
    background: transparent; border-color: var(--text-dim);
    color: var(--text-muted); font-size: 12px;
}

.btn-shuffle {
    background: none; border: 1px solid var(--accent); color: var(--accent);
    padding: 6px 14px; border-radius: var(--radius-sm); cursor: pointer;
    font-size: 13px; font-family: var(--font-body); transition: all 0.2s;
}
.btn-shuffle:hover { background: var(--accent); color: #000; }
.shuffle-controls {
    display: inline-flex; align-items: center; gap: 6px; margin-left: 12px;
}
.shuffle-count-input {
    width: 54px; background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 5px 8px; color: var(--text);
    font-family: var(--font-mono); font-size: 12px; outline: none;
    text-align: center; -moz-appearance: textfield;
}
.shuffle-count-input::-webkit-outer-spin-button,
.shuffle-count-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.shuffle-count-input:focus { border-color: var(--accent); }
.btn-shuffle-all {
    background: none; border: 1px solid var(--border); color: var(--text-muted);
    padding: 6px 14px; border-radius: var(--radius-sm); cursor: pointer;
    font-size: 13px; font-family: var(--font-body); transition: all 0.2s;
}
.btn-shuffle-all:hover { border-color: var(--accent); color: var(--accent); }

/* ============ SYNC BANNER ============ */

.sync-banner {
    display: flex; align-items: center; gap: 10px; padding: 10px 24px;
    background: rgba(212, 160, 38, 0.1);
    border-bottom: 1px solid rgba(212, 160, 38, 0.2);
    font-size: 13px; color: var(--accent);
}
.sync-spinner { animation: spin 1s linear infinite; font-size: 18px; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ============ CONTENT ============ */

.content { max-width: 1400px; margin: 0 auto; padding: 24px; }

/* ============ SETUP PAGE ============ */

.setup-page {
    display: flex; align-items: center; justify-content: center;
    min-height: calc(100vh - 160px);
}
.setup-card {
    text-align: center; max-width: 440px; width: 100%; padding: 48px 32px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
}
.setup-title { font-family: var(--font-mono); font-size: 22px; margin-bottom: 6px; }
.setup-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }
.setup-form { text-align: left; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.form-input {
    width: 100%; padding: 10px 14px; background: var(--bg);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-family: var(--font-body); font-size: 14px;
    outline: none; transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-dim); }
.form-hint { margin-top: 6px; font-size: 12px; color: var(--text-dim); }
.btn-full { width: 100%; justify-content: center; margin-top: 8px; }

/* ============ COLLECTION HEADER ============ */

.collection-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 24px; margin-bottom: 20px; flex-wrap: wrap;
}
.collection-stats { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.collection-stats h1 { font-family: var(--font-mono); font-size: 28px; font-weight: 700; }
.stat-count { color: var(--text-muted); font-size: 14px; }

.search-bar { display: flex; align-items: center; gap: 8px; }
.search-input {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 8px 14px; color: var(--text);
    font-family: var(--font-body); font-size: 14px; width: 280px;
    outline: none; transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-dim); }

/* ============ FILTER PILLS ============ */

.filter-label { font-size: 12px; color: var(--text-dim); margin-right: 4px; font-weight: 500; }

.folder-pills, .genre-pills {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px;
}
.genre-pills { padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }

.folder-pill, .genre-pill {
    padding: 4px 12px; border: 1px solid var(--border); border-radius: 20px;
    font-size: 12px; color: var(--text-muted); transition: all 0.2s;
    white-space: nowrap; cursor: pointer; background: none;
}
.folder-pill:hover, .folder-pill.active,
.genre-pill:hover, .genre-pill.active {
    border-color: var(--accent); color: var(--accent); background: var(--accent-glow);
}

/* ============ SORT BAR ============ */

.sort-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.sort-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.sort-option {
    font-size: 13px; color: var(--text-muted); padding: 4px 8px;
    border-radius: var(--radius-sm); transition: all 0.2s; cursor: pointer;
}
.sort-option:hover { color: var(--text); }
.sort-option.active { color: var(--accent); background: var(--accent-glow); }

/* ============ RELEASE GRID ============ */

.release-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }

.release-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: all 0.25s ease; display: block; color: var(--text); cursor: pointer;
}
.release-card:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 160, 38, 0.4);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow);
}

.card-cover { position: relative; aspect-ratio: 1; overflow: hidden; background: #0d0d0d; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.release-card:hover .card-cover img { transform: scale(1.05); }

.no-cover {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #111 0%, #1a1a1a 100%);
}
.vinyl-icon-large { font-size: 60px; color: var(--text-dim); }
.vinyl-icon-huge { font-size: 80px; color: var(--text-dim); margin-bottom: 16px; }

.badge {
    position: absolute; font-size: 10px; font-weight: 600;
    padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-videos { bottom: 8px; left: 8px; background: rgba(0,0,0,0.75); color: var(--accent); backdrop-filter: blur(4px); }
.badge-no-videos { bottom: 8px; left: 8px; background: rgba(192,57,43,0.8); color: #fff; }
.badge-quantity { top: 8px; right: 8px; background: rgba(212,160,38,0.85); color: #000; }

.card-info { padding: 12px; }
.card-artist { font-size: 13px; font-weight: 600; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-dim); }
.card-format { background: var(--bg); padding: 1px 6px; border-radius: 3px; font-size: 10px; }

/* ============ PAGINATION ============ */

.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 4px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border);
}
.page-link { padding: 6px 12px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-muted); transition: all 0.2s; cursor: pointer; }
.page-link:hover { background: var(--bg-card); color: var(--text); }
.page-link.active { background: var(--accent); color: #000; font-weight: 600; }
.page-dots { color: var(--text-dim); padding: 0 4px; }

/* ============ EMPTY STATE ============ */

.empty-state { text-align: center; padding: 80px 20px; }
.empty-title { font-family: var(--font-mono); font-size: 22px; margin-bottom: 8px; }
.empty-subtitle { color: var(--text-muted); margin-bottom: 24px; }

/* ============ RELEASE DETAIL ============ */

.back-link { display: inline-block; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; cursor: pointer; }
.back-link:hover { color: var(--accent); }
.release-detail { max-width: 1000px; }
.release-hero { display: flex; gap: 32px; margin-bottom: 40px; }
.release-cover-wrap { flex-shrink: 0; width: 320px; }
.release-cover { width: 100%; border-radius: var(--radius); box-shadow: 0 8px 40px rgba(0,0,0,0.5); }
.no-cover-large { width: 320px; height: 320px; display: flex; align-items: center; justify-content: center; background: var(--bg-card); border-radius: var(--radius); }
.release-meta { flex: 1; padding-top: 8px; }
.release-title { font-family: var(--font-mono); font-size: 28px; font-weight: 700; line-height: 1.2; margin-bottom: 4px; }
.release-artist { font-size: 20px; font-weight: 400; color: var(--accent); margin-bottom: 16px; }

.meta-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.meta-tag { padding: 4px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; color: var(--text-muted); }
.meta-tag-qty { border-color: var(--accent); color: var(--accent); }
.meta-genres, .meta-styles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.meta-styles { margin-bottom: 16px; }
.style-tag { font-size: 11px; color: var(--text-dim); padding: 2px 8px; border: 1px solid var(--border); border-radius: 12px; }
.discogs-link {
    display: inline-block; font-size: 13px; margin-top: 8px;
    padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-muted); transition: all 0.2s;
}
.discogs-link:hover { border-color: var(--accent); color: var(--accent); }

/* ============ VIDEO LIST ============ */

.video-section { border-top: 1px solid var(--border); padding-top: 24px; }
.video-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.video-header h3 { font-family: var(--font-mono); font-size: 16px; }
.video-list { display: flex; flex-direction: column; gap: 2px; }

.video-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: var(--radius-sm); transition: background 0.2s; cursor: default;
}
.video-item:hover { background: var(--bg-hover); }
.video-item.playing { background: var(--accent-glow); border-left: 3px solid var(--accent); }

.play-btn {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; border: none;
    background: var(--accent); color: #000; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; font-size: 12px;
}
.play-btn:hover { background: var(--accent-hover); transform: scale(1.1); }
.play-icon { margin-left: 2px; }

.video-info { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.video-title { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-duration { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); flex-shrink: 0; }
.no-videos-message { padding: 40px 20px; text-align: center; color: var(--text-muted); }
.no-videos-message .hint { font-size: 13px; color: var(--text-dim); margin-top: 8px; }

/* ============ NOW PLAYING BAR ============ */

.now-playing {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: auto; min-height: 80px;
    background: rgba(10, 10, 10, 0.95); backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; z-index: 200; gap: 16px;
}

.np-info { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.np-cover { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.np-text { min-width: 0; }
.np-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-artist { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-player { flex-shrink: 0; }
.np-player iframe { border-radius: 4px; }
.np-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.np-btn {
    background: none; border: 1px solid var(--border); color: var(--text-muted);
    width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; transition: all 0.2s;
}
.np-btn:hover { border-color: var(--accent); color: var(--accent); }
.np-btn-main { width: 42px; height: 42px; border-color: var(--accent); color: var(--accent); font-size: 14px; }
.np-btn-main:hover { background: var(--accent); color: #000; }
.np-btn-close { font-size: 18px; margin-left: 8px; }

.np-btn-suggest {
    width: auto; padding: 0 14px; font-size: 12px;
    font-weight: 600; letter-spacing: 0.5px;
    border-color: var(--accent); color: var(--accent);
}
.np-btn-suggest:hover, .np-btn-suggest.active {
    background: var(--accent); color: #000;
}
.np-btn-icon {
    font-size: 16px; font-weight: 700;
}

/* ============ VISUALIZER ============ */

.np-visualizer {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; flex-shrink: 0;
}
#viz-canvas {
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #1a1a2e;
    display: block;
}
.viz-switcher { display: flex; gap: 4px; }
.viz-btn {
    min-width: 44px; height: 22px;
    border: 1px solid #333; border-radius: 4px;
    background: none; color: #555; cursor: pointer;
    font-size: 10px; letter-spacing: 1px;
    transition: all 0.15s;
}
.viz-btn:hover  { border-color: #00e5ff; color: #00e5ff; }
.viz-btn.active { border-color: #00e5ff; color: #00e5ff; background: rgba(0, 229, 255, 0.1); }

/* ============ CROSSFADE CONTROLS ============ */

.np-cf-input {
    width: 46px; height: 36px;
    background: none; border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-family: var(--font-mono); font-size: 12px;
    text-align: center; padding: 0 4px; outline: none;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}
.np-cf-input::-webkit-outer-spin-button,
.np-cf-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.np-cf-input:focus { border-color: var(--accent); }

/* ============ SUGGESTIONS PANEL ============ */

.suggestions-panel {
    position: fixed;
    left: 20px; right: 20px; bottom: 220px;
    max-width: 720px; margin: 0 auto;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 60vh; overflow: hidden;
    display: flex; flex-direction: column;
    z-index: 250;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.6), 0 0 0 1px var(--accent-glow);
}
.suggestions-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.suggestions-title {
    font-family: var(--font-mono); font-size: 13px; font-weight: 700;
    color: var(--accent);
}
.suggestions-sub {
    padding: 8px 16px; font-size: 12px; color: var(--text-muted);
    border-bottom: 1px solid var(--border); background: var(--bg-surface);
}
.suggestions-empty { padding: 28px 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
.suggestions-list {
    overflow-y: auto; padding: 6px;
}
.suggestion-row {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.suggestion-row:hover { background: var(--bg-hover); }
.suggestion-row .track-info { flex: 1; min-width: 0; }
.suggestion-actions { display: flex; gap: 6px; flex-shrink: 0; }
.suggestion-actions .btn { padding: 6px 10px; font-size: 11px; }
.track-badge.score-badge {
    background: rgba(212, 160, 38, 0.25); color: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .suggestions-panel { bottom: 160px; left: 8px; right: 8px; }
}

/* ============ QUEUE PANEL ============ */

.queue-panel {
    position: fixed;
    right: 20px; bottom: 220px;
    width: 360px; max-width: calc(100vw - 40px);
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 60vh; overflow: hidden;
    display: flex; flex-direction: column;
    z-index: 251;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.6), 0 0 0 1px var(--accent-glow);
}
.queue-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.queue-title {
    font-family: var(--font-mono); font-size: 13px; font-weight: 700;
    color: var(--accent);
}
.queue-header-actions { display: flex; align-items: center; gap: 8px; }
.queue-header-actions .btn { font-size: 11px; padding: 4px 10px; }
.queue-list { overflow-y: auto; padding: 6px; flex: 1; }
.queue-row {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 8px; border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.queue-row:hover { background: var(--bg-hover); }
.queue-row.queue-current {
    background: var(--accent-glow);
    border: 1px solid rgba(212, 160, 38, 0.3);
}
.queue-row .track-info { flex: 1; min-width: 0; }
.queue-row .track-thumb { width: 36px; height: 36px; flex-shrink: 0; }
.queue-num {
    flex-shrink: 0; width: 22px; text-align: right;
    font-family: var(--font-mono); font-size: 11px; color: var(--text-dim);
}
.queue-actions { display: flex; gap: 4px; flex-shrink: 0; }
.queue-play-btn, .queue-remove-btn { padding: 4px 8px !important; font-size: 11px !important; }

@media (max-width: 768px) {
    .queue-panel { right: 8px; left: 8px; width: auto; bottom: 160px; }
}

/* ============ TRACKS VIEW ============ */

.track-filters {
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
    padding: 12px 14px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    margin-bottom: 16px;
}
.track-filter-group {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.track-filter-group > label {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-dim); font-weight: 600; margin-right: 4px;
}
.bpm-input {
    width: 60px; background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 5px 8px; color: var(--text);
    font-family: var(--font-mono); font-size: 12px; outline: none;
}
.bpm-input:focus { border-color: var(--accent); }
.bpm-dash { color: var(--text-dim); font-size: 12px; }
.track-filter-group select {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 5px 8px; color: var(--text);
    font-family: var(--font-mono); font-size: 12px; outline: none; cursor: pointer;
}
.track-filter-group select:focus { border-color: var(--accent); }

.rating-pill {
    padding: 4px 10px; border: 1px solid var(--border); border-radius: 12px;
    font-size: 11px; color: var(--text-muted); cursor: pointer;
    transition: all 0.2s; white-space: nowrap; letter-spacing: 1px;
}
.rating-pill:hover, .rating-pill.active {
    border-color: var(--accent); color: var(--accent); background: var(--accent-glow);
}

.tracks-list .track-row { padding: 8px 12px; }
.track-thumb {
    flex-shrink: 0; width: 48px; height: 48px; border-radius: 3px;
    object-fit: cover; background: var(--bg);
}
.track-thumb.no-thumb {
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim); font-size: 24px;
}
.track-row .track-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.track-title-line {
    font-size: 14px; color: var(--text); font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.track-sub-line {
    font-size: 12px; color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.t-artist, .t-release { cursor: pointer; }
.t-artist:hover, .t-release:hover { color: var(--accent); }
.t-year { color: var(--text-dim); }

/* ============ SETLISTS ============ */

.setlist-index {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.setlist-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 20px;
    cursor: pointer; transition: all 0.2s;
}
.setlist-card:hover {
    border-color: rgba(212, 160, 38, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.setlist-card-name {
    font-family: var(--font-mono); font-size: 16px; font-weight: 700;
    margin-bottom: 6px; color: var(--text);
}
.setlist-card-meta { font-size: 12px; color: var(--text-muted); }

.setlist-detail { max-width: 1000px; }
.setlist-header {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-bottom: 12px;
}
.setlist-name-input {
    flex: 1; min-width: 240px;
    background: transparent; border: 1px solid transparent;
    border-radius: var(--radius-sm); padding: 8px 10px;
    color: var(--text); font-family: var(--font-mono);
    font-size: 24px; font-weight: 700; outline: none;
    transition: all 0.2s;
}
.setlist-name-input:hover { border-color: var(--border); }
.setlist-name-input:focus { border-color: var(--accent); background: var(--bg-card); }
.setlist-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.setlist-export { position: relative; }
.export-menu {
    position: absolute; top: calc(100% + 4px); right: 0;
    min-width: 200px; z-index: 120;
}
.btn-danger { border-color: rgba(192,57,43,0.4); color: var(--danger); }
.btn-danger:hover { background: rgba(192,57,43,0.15); color: #ff6b5a; border-color: var(--danger); }

.setlist-notes {
    width: 100%; min-height: 60px; resize: vertical;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px 12px;
    color: var(--text); font-family: var(--font-body); font-size: 13px;
    outline: none; transition: border-color 0.2s;
    margin-bottom: 20px;
}
.setlist-notes:focus { border-color: var(--accent); }

.setlist-num {
    flex-shrink: 0; width: 28px; text-align: right;
    font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
}

.drag-handle {
    flex-shrink: 0; width: 16px; text-align: center;
    color: var(--text-dim); cursor: grab; font-size: 16px; line-height: 1;
    opacity: 0.3; transition: opacity 0.15s;
    user-select: none;
}
.setlist-row:hover .drag-handle { opacity: 0.9; }
.drag-handle:active { cursor: grabbing; }

.setlist-row.dragging {
    opacity: 0.4;
    background: var(--bg-surface);
}
.setlist-row.drag-over-above {
    border-top: 2px solid var(--accent);
}
.setlist-row.drag-over-below {
    border-bottom: 2px solid var(--accent);
}

/* ============ POPOVERS ============ */

.popover {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 6px;
    min-width: 220px; max-width: 280px; z-index: 300;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}
.popover-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-dim); padding: 6px 10px 4px; font-weight: 600;
}
.popover-empty { font-size: 12px; color: var(--text-dim); padding: 8px 10px; }
.popover-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; font-size: 13px; color: var(--text);
    border-radius: 3px; cursor: pointer; transition: background 0.15s;
}
.popover-item:hover { background: var(--bg-hover); color: var(--accent); }
.popover-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popover-item-count {
    font-size: 11px; color: var(--text-dim); font-family: var(--font-mono);
    background: var(--bg); padding: 1px 6px; border-radius: 8px;
}
.popover-divider { height: 1px; background: var(--border); margin: 4px 0; }
.popover-new { color: var(--accent); }

.meta-btn.add-btn { font-size: 18px; font-weight: 700; }

/* ============ TRACK METADATA ============ */

.track-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0 10px; }
.track-badge {
    font-family: var(--font-mono); font-size: 10px;
    padding: 2px 6px; border-radius: 3px;
    background: var(--bg); border: 1px solid var(--border);
    color: var(--text-muted); white-space: nowrap;
}
.track-badge.badge-bpm { border-color: var(--accent); color: var(--accent); }
.track-badge.badge-key { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
.track-badge.badge-rating { color: var(--accent); letter-spacing: 1px; }
.track-badge.badge-shelf { color: #6aa; border-color: #334; }

.meta-btn {
    flex-shrink: 0; width: 32px; height: 32px;
    border-radius: 50%; border: 1px solid var(--border);
    background: transparent; color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; transition: all 0.2s;
}
.meta-btn:hover { border-color: var(--accent); color: var(--accent); }

.track-meta-editor {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
    padding: 14px 16px; margin: 4px 0 12px 48px;
}
.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px; margin-bottom: 12px;
}
.meta-field {
    display: flex; flex-direction: column; gap: 4px;
    font-size: 11px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.3px;
}
.meta-field.wide { grid-column: 1 / -1; }
.meta-field.checkbox {
    flex-direction: row; align-items: center; gap: 6px;
    text-transform: none; letter-spacing: 0; font-size: 12px;
}
.meta-field input[type="text"],
.meta-field input[type="number"],
.meta-field select,
.meta-field textarea {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 6px 10px;
    color: var(--text); font-family: var(--font-body); font-size: 13px;
    text-transform: none; letter-spacing: 0;
    outline: none; transition: border-color 0.2s;
}
.meta-field input:focus, .meta-field select:focus, .meta-field textarea:focus {
    border-color: var(--accent);
}
.meta-field textarea { resize: vertical; }
.meta-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ============ BACKUP PAGE ============ */

.backup-page { max-width: 860px; }

.backup-warning {
    display: flex; align-items: flex-start; gap: 14px;
    background: rgba(212, 160, 38, 0.08); border: 1px solid rgba(212, 160, 38, 0.35);
    border-radius: var(--radius); padding: 16px 18px;
    font-size: 13px; color: var(--text-muted); line-height: 1.6;
    margin-bottom: 28px;
}
.backup-warning code { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.backup-warning-icon { font-size: 22px; color: var(--accent); flex-shrink: 0; margin-top: 1px; }

.backup-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
    margin-bottom: 32px;
}
.backup-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
    display: flex; flex-direction: column; gap: 14px;
}
.backup-card-icon { font-size: 32px; color: var(--accent); line-height: 1; }
.backup-card-title { font-family: var(--font-mono); font-size: 16px; font-weight: 700; }
.backup-card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.6; flex: 1; }
.backup-card-desc em { color: var(--text); font-style: normal; font-weight: 500; }
.backup-card-desc code { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.backup-card .btn-large { align-self: flex-start; margin-top: auto; }

.backup-legend {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px 24px;
    font-size: 13px; color: var(--text-muted);
}
.backup-legend h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); margin-bottom: 10px; }
.backup-legend ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.backup-legend li::before { content: '\2713\00a0'; color: var(--accent); }
.backup-legend li strong { color: var(--text); }

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

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
    .release-hero { flex-direction: column; gap: 20px; }
    .release-cover-wrap { width: 100%; max-width: 300px; }
    .collection-header { flex-direction: column; }
    .search-input { width: 100%; }
    .release-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .now-playing { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
    .np-player { display: none; }
    .np-cf-input { display: none !important; }
    .release-title { font-size: 22px; }
}
