:root {
    --onyx: #050505;
    --amethyst: #ba9eff;
    --primary-dim: #8455ef;
    --neon-red: #ff0000;
    --glass: rgba(255, 255, 255, 0.05);
    /* Mood Colors for HUD Badges */
    --item-color: #FF4B2B;
    --powerful-color: #9D50BB;
    --party-color: #FF8C00;
    --groovy-color: #4ade80;
    --happy-color: #fde047;
    --romance-color: #00F2FE;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: var(--onyx); color: white; font-family: 'Inter', sans-serif; overflow: hidden; }

/* --- 1. LAYOUT ADJUSTMENT --- */
/* This ensures your middle column (the HUD) fits between the card and library */
.main-engine-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    height: 75vh;
    padding: 0 40px;
}

/* THEATER VIEW (9:16) */
.theater-view {
    aspect-ratio: 9/16;
    height: 70vh;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 50px rgba(132, 85, 239, 0.1);
}

/* --- 2. VIBE HUD (The Roadmap) --- */
.roadmap-container {
    width: 340px; /* Slightly wider for the equalizer bars */
    height: 70vh;
    background: #0d0d0d; /* Darker, more solid background for contrast */
    border-radius: 12px;
    border: 1px solid rgba(132, 85, 239, 0.3); /* Distinct purple tint border */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.roadmap-list {
    flex: 1;
    overflow-y: auto;
    pointer-events: auto; /* CRITICAL FIX: Turns the scrollbar back on */
    padding-bottom: 20px;
}

.roadmap-list::-webkit-scrollbar { width: 4px; }
.roadmap-list::-webkit-scrollbar-thumb { background: var(--primary-dim); border-radius: 10px; }

/* SET DIVIDERS (Matching the mockup) */
.set-divider {
    background: rgba(132, 85, 239, 0.05);
    padding: 12px 16px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--amethyst);
    text-transform: uppercase;
    border-top: 1px solid rgba(132, 85, 239, 0.4);
    border-bottom: 1px solid rgba(132, 85, 239, 0.4);
    margin-top: 8px;
    margin-bottom: 4px;
}

/* ROADMAP ROWS */
.roadmap-row {
    pointer-events: none; /* Keeps the songs view-only */
    display: grid;
    grid-template-columns: 24px 1fr auto auto;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.3s ease;
}

.set-rows {
    transition: max-height 0.5s ease-out, opacity 0.3s ease;
    max-height: 1000px; /* Large enough to hold 10 rows */
    overflow: hidden;
    opacity: 1;
}

.set-group.collapsed .set-rows {
    max-height: 0;
    opacity: 0;
}

.set-group.collapsed .set-divider {
    opacity: 0.3;
    border-color: transparent;
}

/* Highlight the currently playing song in the HUD */
.roadmap-row.active-vibe {
    background: rgba(186, 158, 255, 0.1);
    border-left: 2px solid var(--amethyst);
}

.vibe-index {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    color: #666;
    text-align: right;
}

.vibe-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.vibe-title {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
}

.vibe-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    color: #a1a1aa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* MOOD DOTS */
.mood-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 5px currentColor; /* Gives it a slight neon glow */
}

/* THE VIBE METER (The 10-Bar Equalizer) */
.vibe-meter {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.vibe-bar {
    width: 3px;
    border-radius: 1px;
    transition: all 0.2s ease;
}

/* --- 3. MASTER LIBRARY & SERIALS --- */
#master-list::-webkit-scrollbar { width: 4px; }
#master-list::-webkit-scrollbar-thumb { background: var(--glass); border-radius: 10px; }

.library-row { display: flex; align-items: center; gap: 12px; cursor: pointer; transition: all 0.2s; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.song-number { font-family: 'Space Grotesk', sans-serif; font-size: 10px; color: #3f3f46; width: 24px; text-align: right; flex-shrink: 0; }

.library-row:hover .song-number { color: var(--amethyst); }
.library-row:hover { background: rgba(255, 255, 255, 0.02); }

/* ENERGY BADGES */
.energy-badge {
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    font-family: 'Space Grotesk', sans-serif;
    background: rgba(0, 0, 0, 0.5);
    min-width: 32px;
    text-align: center;
}

/* --- 4. PROGRESS BAR --- */
.progress-container {
    width: 100%;
    height: 12px;
    display: flex;
    align-items: center;
    background: transparent;
    cursor: pointer;
    position: relative;
}

.progress-container::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    transition: height 0.2s ease;
}

#progress-fill {
    height: 4px;
    width: 0%;
    background: var(--amethyst);
    box-shadow: 0 0 10px var(--primary-dim);
    border-radius: 2px;
    z-index: 1;
    transition: width 0.1s linear, height 0.2s ease;
}

.progress-container:hover::before,
.progress-container:hover #progress-fill {
    height: 6px;
}

#current-time, #total-duration { font-family: 'Space Grotesk', sans-serif; letter-spacing: 1px; opacity: 0.8; font-size: 10px; }

/* PLAYER CONTROLS */
#play-btn:hover { box-shadow: 0 0 20px rgba(186, 158, 255, 0.3); }

/* STATUS INDICATORS */
#shuffle-toggle.active { color: var(--neon-red) !important; filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.8)); }
#repeat-btn.active { color: var(--amethyst) !important; filter: drop-shadow(0 0 8px var(--amethyst)); }

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