:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #1c2129;
    --bg-hover: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-dim: #484f58;
    --accent: #5288c1;
    --accent-glow: rgba(82, 136, 193, 0.3);
    --border: #30363d;
    --radius: 12px;
    --radius-sm: 8px;
}

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

html, body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* ══ LOGIN ══ */
#login-screen {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-content {
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.login-icon {
    color: var(--accent);
    margin-bottom: 12px;
}

.login-content h2 {
    font-size: 24px;
    margin-bottom: 4px;
}

.login-hint {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.login-content input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 1px;
}

.login-content input:focus { border-color: var(--accent); }
.login-content input::placeholder { color: var(--text-dim); letter-spacing: 0; }

.login-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.login-btn:hover { background: #6199d0; }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.login-error {
    color: #e5534b;
    font-size: 13px;
    margin-top: 12px;
    min-height: 20px;
}

/* ══ APP ══ */
#app { display: flex; height: 100%; position: relative; }

/* ── Side Panel ── */
#side-panel {
    width: 320px;
    min-width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 10;
    overflow: hidden;
}

/* ── User Profile ── */
#user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}

#user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    color: var(--text-dim);
}

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

#user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Tabs ── */
#panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.tab {
    flex: 1;
    padding: 12px 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Tab content ── */
.tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
}

/* ── Panel sub-header ── */
.panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    min-height: 44px;
    flex-shrink: 0;
}

#panel-title {
    font-size: 15px;
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#btn-close-panel { display: none; }

/* ── Search Bar ── */
.search-bar {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.search-bar input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-bar input:focus { border-color: var(--accent); }
.search-bar input::placeholder { color: var(--text-dim); }

/* ── Group/Playlist containers ── */
#browse-groups, #browse-tracks-container, #playlists-container,
#playlist-tracks-container, #pg-results {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

/* ── Playlist group bar ── */
#playlist-group-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

#playlist-group-name {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Playlist actions ── */
#playlists-actions {
    padding: 10px 16px;
    flex-shrink: 0;
}

.playlist-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.playlist-action-btn:hover { background: var(--bg-hover); }
.playlist-action-btn.accent { color: var(--accent); border-color: var(--accent); }
.playlist-action-btn.accent:hover { background: rgba(82, 136, 193, 0.1); }

/* ── Group Item ── */
.group-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    gap: 12px;
}

.group-item:hover { background: var(--bg-hover); }

.group-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--text-dim);
}

.group-photo {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

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

.group-title {
    font-size: 14px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.group-type {
    font-size: 12px; color: var(--text-dim); text-transform: capitalize;
}

/* ── Playlist Item ── */
.playlist-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    gap: 12px;
}

.playlist-item:hover { background: var(--bg-hover); }

.playlist-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: var(--text-dim);
}

.playlist-emoji {
    font-size: 18px;
    background: none;
}

.playlist-title {
    flex: 1; font-size: 14px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.playlist-arrow { color: var(--text-dim); flex-shrink: 0; }

/* ── Select bar ── */
#select-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    flex-shrink: 0;
}

#select-count { flex: 1; color: var(--text-secondary); }

/* ── Track Item ── */
.track-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    gap: 12px;
}

.track-item:hover { background: var(--bg-hover); }

.track-item.active {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent);
    padding-left: 13px;
}

.track-item.selected { background: rgba(82, 136, 193, 0.1); }

.track-checkbox {
    width: 18px; height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}

.track-item.selected .track-checkbox {
    background: var(--accent); border-color: var(--accent);
}

.track-item-index {
    color: var(--text-dim); font-size: 13px;
    min-width: 24px; text-align: center;
}

.track-item.active .track-item-index { color: var(--accent); }

.track-item-thumb {
    width: 40px; height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.track-item-thumb-placeholder {
    width: 40px; height: 40px;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim);
}

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

.track-item-title {
    font-size: 14px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.track-item.active .track-item-title { color: var(--accent); }

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

.track-item-duration {
    color: var(--text-dim); font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.track-add-btn {
    background: none; border: none;
    color: var(--text-dim); cursor: pointer;
    padding: 4px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
    margin-left: 4px;
}

.track-add-btn:hover { color: var(--accent); background: var(--bg-hover); }

/* ── Toast ── */
#toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    z-index: 200;
}

#toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Buttons ── */
.text-btn {
    background: none; border: none;
    color: var(--text-secondary);
    font-size: 13px; cursor: pointer;
    padding: 4px 8px; border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.text-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.text-btn.accent { color: var(--accent); }
.text-btn.accent:hover { background: rgba(82, 136, 193, 0.1); }

.icon-btn {
    background: none; border: none;
    color: var(--text-secondary); cursor: pointer;
    padding: 4px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    transition: color 0.15s, background 0.15s;
}

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

/* ── Modal ── */
#playlist-modal {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
}

.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    width: 90%; max-width: 360px; max-height: 60vh;
    overflow-y: auto;
}

.modal-content h3 { margin-bottom: 12px; font-size: 16px; }

#modal-playlists { margin-bottom: 12px; }

.modal-playlist-item {
    padding: 10px 12px; cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s; font-size: 14px;
}

.modal-playlist-item:hover { background: var(--bg-hover); }

/* ── Main Player ── */
#player {
    flex: 1; display: flex; flex-direction: column;
    align-items: center;
    padding: 0 24px 24px;
    overflow: hidden; min-width: 0;
}

#top-bar {
    display: flex; align-items: center;
    justify-content: space-between;
    width: 100%; padding: 12px 0;
}

#btn-show-panel { display: none; }

#now-playing-label {
    font-size: 14px; color: var(--text-secondary); font-weight: 500;
}

/* ── Artwork ── */
#artwork {
    width: 100%; max-width: 420px;
    aspect-ratio: 1;
    background: var(--bg-secondary);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    margin: 8px 0 16px; flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

#artwork-icon { color: var(--text-dim); opacity: 0.6; }

#artwork-img {
    width: 100%; height: 100%;
    object-fit: cover;
    position: absolute; inset: 0;
}

#artwork-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 20px 16px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-end;
    gap: 8px;
    z-index: 2;
}

/* ── Source / Save Bar ── */
#source-bar {
    display: flex; gap: 8px;
    width: 100%; max-width: 420px;
    flex-shrink: 0;
    margin-bottom: 8px;
    justify-content: center;
}

.source-btn {
    display: flex; align-items: center; gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px; cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.15s;
    white-space: nowrap;
}

.source-btn:hover { color: var(--accent); border-color: var(--accent); background: rgba(82,136,193,0.08); }
.source-btn.saving { opacity: 0.5; pointer-events: none; }
.source-btn.saved { color: var(--accent); border-color: var(--accent); }

.overlay-add-btn {
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    width: 34px; height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.15s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.overlay-add-btn:hover, .overlay-share-btn:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.overlay-share-btn {
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    width: 34px; height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.15s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.overlay-share-btn.sharing {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Track Info ── */
#track-info {
    flex: 1; min-width: 0;
}

#track-title {
    font-size: 18px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

#track-artist {
    font-size: 13px; color: rgba(255,255,255,0.7);
    margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ── Lyrics ── */
#lyrics-container {
    flex: 1; width: 100%; max-width: 500px;
    overflow-y: auto; overflow-x: hidden;
    margin-bottom: 16px;
    mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
    scroll-behavior: smooth; min-height: 0;
}

#lyrics-content { padding: 40px 16px; text-align: center; }

.lyrics-placeholder { color: var(--text-dim); font-size: 14px; padding: 40px 0; text-align: center; }

.lyric-line {
    padding: 6px 8px; font-size: 16px; color: var(--text-dim);
    transition: color 0.3s, transform 0.3s, font-size 0.3s;
    cursor: pointer; line-height: 1.6; border-radius: 6px;
}

.lyric-line:hover { color: var(--text-secondary); }

.lyric-line.active {
    color: var(--accent); font-size: 19px; font-weight: 600;
    transform: scale(1.02);
}

.lyric-line.past { color: var(--text-secondary); }

/* ── Progress Bar ── */
#progress-section {
    display: flex; align-items: center; gap: 10px;
    width: 100%; max-width: 500px;
    margin-bottom: 16px; flex-shrink: 0;
}

#time-current, #time-total {
    font-size: 12px; color: var(--text-secondary);
    font-variant-numeric: tabular-nums; min-width: 36px;
}

#time-current { text-align: right; }
#time-total { text-align: left; }

#progress-bar {
    flex: 1; height: 6px;
    background: var(--bg-tertiary); border-radius: 3px;
    position: relative; cursor: pointer; touch-action: none;
}

#progress-buffered {
    position: absolute; left: 0; top: 0; height: 100%;
    background: var(--border); border-radius: 3px;
    width: 0%; transition: width 0.3s;
}

#progress-fill {
    position: absolute; left: 0; top: 0; height: 100%;
    background: var(--accent); border-radius: 3px; width: 0%;
}

#progress-handle {
    position: absolute; top: 50%; left: 0%;
    width: 14px; height: 14px;
    background: var(--accent); border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px var(--accent-glow);
    opacity: 0; transition: opacity 0.2s;
}

#progress-bar:hover #progress-handle,
#progress-bar.dragging #progress-handle { opacity: 1; }

/* ── Controls ── */
#controls {
    display: flex; align-items: center; gap: 24px;
    flex-shrink: 0; padding-bottom: 8px;
}

.control-btn {
    background: none; border: none;
    color: var(--text-primary); cursor: pointer;
    padding: 10px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, transform 0.1s;
}

.control-btn:hover { background: var(--bg-hover); }
.control-btn:active { transform: scale(0.92); }

.play-btn { width: 56px; height: 56px; background: var(--accent); color: #fff; position: relative; }
.play-btn:hover { background: #6199d0; }
.play-btn.loading-audio::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    margin: auto; width: 24px; height: 24px;
    border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff;
    border-radius: 50%; animation: spin 0.8s linear infinite;
}

.control-btn-sm { color: var(--text-dim); padding: 8px; }
.control-btn-sm.active { color: var(--accent); }

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

/* ── Overlay ── */
#overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 5;
}

#overlay.visible { display: block; }

/* ── Loading ── */
.loading {
    display: inline-block; width: 20px; height: 20px;
    border: 2px solid var(--border); border-top-color: var(--accent);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}

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

/* ── Search FAB ── */
#fab-search {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--accent-glow);
    z-index: 30;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
#fab-search * { pointer-events: none; }
#fab-search:hover { transform: scale(1.08); box-shadow: 0 6px 24px var(--accent-glow); }
#fab-search:active { transform: scale(0.95); }
#fab-search.hidden { opacity: 0; pointer-events: none; }

/* ── Search Overlay ── */
/* Desktop: bubble popup near FAB */
#search-overlay {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 400px;
    max-height: 500px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 60;
    display: flex;
    flex-direction: column;
    transform: scale(0.8) translateY(10px);
    transform-origin: bottom right;
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    pointer-events: none;
}
#search-overlay.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}
#search-overlay-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
#search-overlay-header .search-bar { padding: 0; }
#search-overlay-header .search-bar input { margin: 0; }
/* Hide back arrow on desktop */
#search-overlay-close { display: none; }
#search-results-container {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* ── Install Banner ── */
#install-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
    font-size: 14px;
    color: var(--text-primary);
    animation: slideDown 0.3s ease;
}

#install-banner span { flex: 1; }

#btn-install {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

#btn-install:hover { background: #6199d0; }

#btn-install-dismiss {
    color: var(--text-secondary);
    font-size: 20px;
    width: 32px; height: 32px;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* ── Mobile ── */
@media (max-width: 700px) {
    #fab-search { top: 16px; right: 16px; bottom: auto; left: auto; width: 48px; height: 48px; }
    #search-overlay {
        top: 70px; right: 16px; bottom: auto; left: 16px;
        width: auto; max-height: 60vh;
        transform-origin: top right;
    }
    #side-panel {
        position: fixed; left: -320px; top: 0; bottom: 0;
        transition: left 0.3s ease; z-index: 20;
    }
    #side-panel.open { left: 0; }
    #btn-show-panel { display: flex; }
    #btn-close-panel { display: flex; }

    /* Fullscreen immersive player */
    #player {
        padding: 0;
        position: relative;
        overflow: hidden;
    }

    /* Artwork becomes fullscreen background */
    #artwork {
        position: absolute;
        inset: 0;
        width: 100%; height: 100%;
        max-width: none;
        aspect-ratio: auto;
        border-radius: 0;
        margin: 0;
        z-index: 0;
    }

    #artwork-img {
        filter: blur(0px) brightness(0.45);
        transition: filter 0.5s;
    }

    /* When lyrics are showing, blur the artwork more */
    #artwork.lyrics-active #artwork-img {
        filter: blur(12px) brightness(0.3);
    }

    #artwork-icon { opacity: 0.3; }

    /* Overlay moves to bottom, above controls */
    #artwork-overlay {
        position: fixed;
        bottom: 110px;
        left: 0; right: 0;
        top: auto;
        padding: 12px 20px;
        background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
        z-index: 3;
    }

    #track-title { font-size: 16px; }

    /* Top bar over everything */
    #top-bar {
        position: relative;
        z-index: 4;
        padding: 12px 16px;
    }

    #now-playing-label { color: rgba(255,255,255,0.7); }
    #top-bar .icon-btn { color: rgba(255,255,255,0.7); }

    /* Lyrics over the artwork */
    #lyrics-container {
        position: relative;
        z-index: 2;
        flex: 1;
        max-width: 100%;
        padding: 0 8px;
        margin-bottom: 0;
        mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 70%, transparent 100%);
        -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 70%, transparent 100%);
    }

    #lyrics-content {
        padding: 60px 16px 120px;
    }

    .lyric-line {
        font-size: 16px;
        color: rgba(255,255,255,0.35);
        text-shadow: 0 1px 8px rgba(0,0,0,0.5);
    }

    .lyric-line:hover { color: rgba(255,255,255,0.55); }

    .lyric-line.active {
        color: #fff;
        font-size: 20px;
        text-shadow: 0 2px 12px rgba(0,0,0,0.6);
    }

    .lyric-line.past { color: rgba(255,255,255,0.5); }

    .lyrics-placeholder { color: rgba(255,255,255,0.3); }

    /* Progress and controls at the very bottom */
    #progress-section {
        position: relative;
        z-index: 4;
        padding: 0 20px;
        margin-bottom: 8px;
    }

    #time-current, #time-total { color: rgba(255,255,255,0.6); }

    #controls {
        position: relative;
        z-index: 4;
        padding-bottom: 16px;
    }

    .control-btn { color: rgba(255,255,255,0.9); }
    .control-btn:hover { background: rgba(255,255,255,0.1); }
    .control-btn-sm { color: rgba(255,255,255,0.4); }
    .control-btn-sm.active { color: var(--accent); }
    .play-btn { background: var(--accent); color: #fff; }

    /* Source/save bar */
    #source-bar {
        position: relative;
        z-index: 4;
        max-width: 100%;
        padding: 0 16px;
        margin-bottom: 4px;
    }

    .source-btn {
        background: rgba(255,255,255,0.1);
        border-color: rgba(255,255,255,0.2);
        color: rgba(255,255,255,0.7);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .source-btn:hover {
        background: rgba(255,255,255,0.18);
        border-color: rgba(255,255,255,0.35);
        color: #fff;
    }
}
