/* Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* Screens */
.screen { display: none; }
.screen.active { display: block; }

/* Player is special — needs flex column for canvas + controls */
#player.active {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #050508;
}
#highway { flex: 1; width: 100%; min-height: 0; }

/* Song cards */
.song-card {
    background: linear-gradient(145deg, #10101e 0%, #0d0d18 100%);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
}
.song-card:hover {
    border-color: rgba(64,128,224,0.2);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(64,128,224,0.1);
}
.song-card .card-art {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #1a1a30 0%, #0f0f1e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.song-card .card-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.song-card .card-art .placeholder {
    font-size: 3rem;
    opacity: 0.15;
}

/* Library tree */
.artist-row {
    background: linear-gradient(145deg, #10101e 0%, #0d0d18 100%);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.artist-row:hover {
    border-color: rgba(64,128,224,0.15);
}
.artist-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
}
.artist-header .chevron {
    transition: transform 0.2s;
    color: #555;
    flex-shrink: 0;
}
.artist-row.open .artist-header .chevron {
    transform: rotate(90deg);
}
.artist-body {
    display: none;
    padding: 0 12px 12px;
}
.artist-row.open .artist-body {
    display: block;
}
.album-group {
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    margin-bottom: 6px;
    overflow: hidden;
}
.album-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
}
.album-header .chevron {
    transition: transform 0.2s;
    color: #444;
    flex-shrink: 0;
}
.album-group.open .album-header .chevron {
    transform: rotate(90deg);
}
.album-body {
    display: none;
    padding: 0 8px 8px;
}
.album-group.open .album-body {
    display: block;
}
.album-art-sm {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    background: #1a1a2e;
    flex-shrink: 0;
}
.song-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.song-row:hover {
    background: rgba(64,128,224,0.08);
}

/* Search result items */
.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #10101e;
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.result-item:hover {
    background: #181830;
    border-color: rgba(64,128,224,0.15);
}

/* Progress bar */
.progress-bar {
    height: 6px;
    background: #1a1a2e;
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #4080e0, #60a0ff);
    border-radius: 999px;
    transition: width 0.3s ease;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a50; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a60; }

/* Mobile controls */
@media (max-width: 640px) {
    #player-controls { gap: 4px; padding: 6px; }
    #player-controls button { padding: 4px 8px; font-size: 11px; }
    #volume { width: 50px; }
}
