:root {
    --bg-primary: #121212;
    --bg-surface: #1e1e1e;
    --bg-surface-hover: #282828;
    --bg-surface-active: #333333;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #888888;
    --accent: #1db954;
    --accent-hover: #1ed760;
    --accent-light: rgba(29, 185, 84, 0.18);
    --border: #333333;
    --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 0 16px 80px;
    transition: background-color 0.2s ease, color 0.2s ease;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ----------------------------------------------------
   LINKS & TYPOGRAPHY
   Links always have a clean, clear underline.
   ---------------------------------------------------- */
a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--text-muted);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/* Explicit text link classes */
.song-title-link,
.song-title a {
    color: var(--text-primary);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--text-muted);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.song-title-link:hover,
.song-title a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

.artist-link {
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--text-muted);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.artist-link:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

.album-link {
    color: var(--text-secondary);
    text-decoration: underline;
    text-decoration-color: var(--text-muted);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.album-link:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

.user-subtitle a {
    color: var(--text-primary);
    font-weight: 600;
}

/* Button & Pill styles explicitly remove underline */
.nav-link,
.btn,
.spotify-icon-btn,
.spotify-pill-btn,
.cover-wrapper a,
.modal-close {
    text-decoration: none !important;
}

/* Header (Fully Sticky) */
header {
    text-align: center;
    margin-bottom: 24px;
    position: sticky;
    top: 0;
    z-index: 950;
    padding-top: 24px;
    padding-bottom: 16px;
    background: var(--bg-primary);
}

.header-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.header-title h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.spotify-icon {
    width: 38px;
    height: 38px;
    fill: var(--accent);
}

.user-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* Navigation Tabs */
.page-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.nav-link {
    padding: 8px 16px;
    background: var(--bg-surface);
    color: var(--text-primary);
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.nav-link.active {
    background: var(--text-primary);
    color: var(--bg-surface);
    border-color: var(--text-primary);
    font-weight: 700;
}

.nav-link.is-playing-now {
    background: var(--accent) !important;
    color: #000000 !important;
    border-color: var(--accent) !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 12px rgba(29, 185, 84, 0.45);
}

.nav-button {
    background: var(--accent);
    color: #000000;
    border-color: var(--accent);
    font-weight: 700;
}

/* Stats Ribbon */
.stats-ribbon {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Controls Card & Filters */
.controls-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--card-shadow);
}

.controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 1 auto;
}

.control-group.search-group {
    flex: 1 1 240px;
    min-width: 220px;
}

.control-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.control-group select,
.control-group input[type="text"] {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border: 1.5px solid var(--border);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    font-family: inherit;
    outline: none;
}

.control-group input[type="text"] {
    width: 100%;
    padding-left: 36px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='11' cy='11' r='8'%3e%3c/circle%3e%3cline x1='21' y1='21' x2='16.65' y2='16.65'%3e%3c/line%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 11px center;
    background-size: 15px;
    cursor: text;
}

.control-group select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 32px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
}

.control-group select:focus,
.control-group input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.checkbox-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    user-select: none;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--bg-surface);
}

.checkbox-toggle input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Loading & Empty State */
.loading-box, .empty-box {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin: 20px 0;
}

.spinner {
    width: 42px;
    height: 42px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Music Grid (Default) */
.music-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.song-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
    background: #202020;
}

.cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Play Preview Button - Permanently visible when preview exists */
.play-btn-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #000000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    opacity: 1;
}

.song-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.song-artist {
    font-size: 0.84rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
}

.album-year {
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: normal;
    margin-left: 2px;
}

.song-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 8px;
    border-top: 1px solid var(--border);
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--bg-surface-active);
    color: var(--text-secondary);
}

/* Compact View Mode */
.music-grid.view-compact {
    grid-template-columns: repeat(auto-fill, 158px);
    gap: 12px;
}

.music-grid.view-compact .song-card {
    padding: 10px;
}

.music-grid.view-compact .song-title {
    font-size: 0.85rem;
}

.music-grid.view-compact .song-artist {
    font-size: 0.75rem;
}

.music-grid.view-compact .song-meta {
    font-size: 0.75rem;
    padding-top: 6px;
}

/* List View Mode */
.music-grid.view-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.music-grid.view-list .song-card {
    flex-direction: row;
    align-items: center;
    padding: 12px 18px;
    gap: 20px;
}

.music-grid.view-list .cover-wrapper {
    width: 72px;
    height: 72px;
    min-width: 72px;
    margin-bottom: 0;
    flex-shrink: 0;
    border-radius: var(--radius-md);
}

.music-grid.view-list .play-btn-overlay {
    width: 32px;
    height: 32px;
    font-size: 13px;
    bottom: 6px;
    left: 6px;
}

.music-grid.view-list .song-details {
    flex: 1 1 auto;
    min-width: 0;
}

.music-grid.view-list .song-title {
    font-size: 1.05rem;
}

.music-grid.view-list .song-artist {
    font-size: 0.88rem;
    margin-bottom: 0;
}

.music-grid.view-list .song-meta {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
    gap: 16px;
    flex-shrink: 0;
}

/* Spotify Icon Action Button */
.spotify-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #000000 !important;
    text-decoration: none !important;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.spotify-icon-btn svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: #000000;
    pointer-events: none;
}

/* Spotify Pill Button */
.spotify-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #000000 !important;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    border: none;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.spotify-pill-btn svg {
    display: block;
    width: 14px;
    height: 14px;
    fill: #000000;
    flex-shrink: 0;
}

/* Album Card Footer Action Buttons */
.album-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    color: #000000 !important;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
    line-height: 1;
}

.album-card-btn:hover {
    background: var(--accent-hover);
}

.album-card-play-btn {
    font-size: 10px;
    padding-left: 2px;
    font-weight: 700;
}

.album-card-load-btn {
    font-size: 13px;
    background: var(--bg-surface);
    color: var(--text-primary) !important;
    border: 1px solid var(--border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.album-card-load-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--accent);
}

.album-card-spotify-btn svg {
    display: block;
    width: 14px;
    height: 14px;
    fill: #000000;
    pointer-events: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 10000;
}

.modal-content {
    position: relative;
    z-index: 10001;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    text-align: center;
    box-sizing: border-box;
}

.modal-card {
    position: relative;
    z-index: 10001;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    padding: 26px 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.random-display {
    margin: 20px 0;
}

.random-cover {
    width: 220px;
    height: 220px;
    border-radius: var(--radius-md);
    margin: 0 auto 16px;
    object-fit: cover;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent);
    color: #000000;
}

.btn-secondary {
    background: var(--bg-surface-active);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

/* Audio Player Bar */
.sticky-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    z-index: 900;
}

.player-track-info {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 300px;
}

.player-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.player-title {
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-artist {
    font-size: 0.76rem;
    color: var(--text-secondary);
}

/* Charts / Analytics components in Stats page */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.chart-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.chart-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
    font-size: 0.85rem;
}

.bar-label {
    width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

.bar-track {
    flex: 1;
    height: 12px;
    background: var(--bg-surface-active);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-full);
}

.bar-value {
    width: 40px;
    text-align: right;
    font-weight: 700;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-title h1 {
        font-size: 1.75rem;
    }
    .music-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    .stats-ribbon {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Artist Grouping */
.artist-group-section {
    margin-bottom: 36px;
}

.artist-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.artist-group-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.artist-group-badge {
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: var(--bg-surface-active);
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

/* Album Grouping Sections */
.album-group-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 20px;
}

.album-group-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.album-group-thumb {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: var(--card-shadow);
}

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

.album-group-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.album-group-artist {
    font-size: 0.84rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-group-badge {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--accent);
    background: var(--accent-light);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
    white-space: nowrap;
}

/* Artist Grid & Cards */
.artist-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.artist-avatar-wrapper {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 16px;
    background: #202020;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.artist-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.artist-card-info {
    width: 100%;
}

.artist-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artist-card-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 8px;
}

.genre-pill {
    background: var(--bg-surface-active);
    color: var(--text-secondary);
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
}

/* Compact view for artists */
.music-grid.view-compact .artist-avatar-wrapper {
    width: 90px;
    height: 90px;
    margin-bottom: 10px;
}

.music-grid.view-compact .artist-card {
    padding: 14px 10px;
}

.music-grid.view-compact .artist-card-name {
    font-size: 0.92rem;
}

/* List view for artists */
.music-grid.view-list .artist-card {
    flex-direction: row;
    text-align: left;
    padding: 12px 18px;
    gap: 18px;
}

.music-grid.view-list .artist-avatar-wrapper {
    width: 64px;
    height: 64px;
    margin-bottom: 0;
}

.music-grid.view-list .artist-card-genres {
    justify-content: flex-start;
}

/* ----------------------------------------------------
   SIDEBAR SPOTIFY PLAYER (TOP-TO-BOTTOM BOUNDED SIDEBAR)
   ---------------------------------------------------- */
.mini-player-container {
    position: fixed;
    top: 16px;
    bottom: 16px;
    right: max(24px, calc((100vw - 1200px) / 2));
    left: auto;
    width: 340px;
    height: calc(100vh - 32px);
    z-index: 1000;
    overflow: hidden;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.mini-player-dock {
    padding: 10px 10px 8px;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-height: 100%;
    gap: 8px;
    background: rgba(18, 18, 18, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid #333333;
    border-radius: 18px;
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.75);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    transform: translateX(0);
}

.mini-player-container.collapsed .mini-player-dock {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(24px);
}

/* ----------------------------------------------------
   FLOATING BOTTOM AUDIO DOCK (Narrow Centered Island)
   ---------------------------------------------------- */
.mini-player-bottom-bar {
    position: fixed;
    bottom: 18px;
    left: 50%;
    right: auto;
    width: min(680px, calc(100vw - 32px));
    height: 60px;
    z-index: 1000;
    background: rgba(18, 18, 18, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid #333333;
    border-radius: 20px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, 120%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, visibility 0.2s;
}

.mini-player-container.collapsed .mini-player-bottom-bar {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.bottom-bar-inner {
    width: 100%;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}

.bottom-bar-track-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    justify-self: start;
    max-width: 100%;
}

.bottom-bar-thumb {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    background: #282828;
    flex-shrink: 0;
}

.bottom-bar-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
    overflow: hidden;
}

.bottom-bar-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bottom-bar-artist {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bottom-bar-liked-badge {
    margin-left: 4px;
    flex-shrink: 0;
}

/* Playback Control Center (Dead-Center in Island) */
.bottom-bar-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    justify-self: center;
}

.bottom-ctrl-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.bottom-ctrl-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.bottom-ctrl-btn.play-pause-btn {
    background: var(--accent);
    color: #000000;
    width: 36px;
    height: 36px;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.4);
}

.bottom-ctrl-btn.play-pause-btn:hover {
    background: #1ed760;
    color: #000000;
}

.bottom-bar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
    gap: 8px;
}

.bottom-bar-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
}

.bottom-bar-expand-btn:hover {
    background: var(--bg-elevated);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--accent);
}

.mini-player-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    gap: 8px;
    min-height: 24px;
    flex-shrink: 0;
}

.mini-player-liked-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 6px;
    border-radius: 6px;
    user-select: none;
    cursor: pointer;
    flex-shrink: 0;
}

.mini-player-liked-badge.is-liked {
    background: rgba(29, 185, 84, 0.15);
    border: 1px solid rgba(29, 185, 84, 0.4);
}

.mini-player-liked-badge.is-liked:hover {
    background: rgba(29, 185, 84, 0.3);
    border-color: rgba(29, 185, 84, 0.65);
}

.mini-player-liked-badge.not-liked {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    opacity: 0.75;
}

.mini-player-liked-badge.not-liked:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
    opacity: 1;
}

.liked-heart-icon {
    font-size: 0.9rem;
    line-height: 1;
    display: inline-block;
}

.mini-player-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mini-player-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.mini-player-embed-wrap {
    width: 100%;
    height: calc(100% - 36px);
    flex: 1 1 auto;
    border-radius: 10px;
    overflow: hidden;
    background: #121212;
    display: flex;
}

.mini-player-embed-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Track Mode (Single Song): Compact floating card anchored at bottom-right */
.mini-player-container.track-mode {
    top: auto;
    bottom: 24px;
    height: auto;
    overflow: visible;
}

.mini-player-container.track-mode .mini-player-dock {
    height: auto;
    max-height: none;
}

.mini-player-container.track-mode .mini-player-embed-wrap {
    height: 152px;
    min-height: 152px;
    max-height: 152px;
    flex: 0 0 152px;
}

/* Collection Mode (Album / Playlist): Full-height right sidebar */
.mini-player-container.collection-mode {
    top: 16px;
    bottom: 16px;
    height: calc(100vh - 32px);
    overflow: hidden;
}

.mini-player-container.collection-mode .mini-player-dock {
    height: 100%;
    max-height: 100%;
}

.mini-player-container.collection-mode .mini-player-embed-wrap {
    height: calc(100% - 32px);
    max-height: none;
    flex: 1 1 auto;
}

/* Site Content Container Adjustment on Desktop */
@media (min-width: 1024px) {
    body.has-mini-player .container {
        max-width: 1200px;
        margin: 0 auto;
        padding-left: 0;
        padding-right: 0;
        box-sizing: border-box;
    }

    /* Collection mode (Album / Playlist): Full-height right sidebar with column shift */
    body.has-mini-player.has-collection-mode:not(.player-collapsed) .container > * {
        margin-right: 356px;
        margin-left: 0;
        transition: margin-right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* Track mode (Single Song): No content collapse. Full-width container with bottom-right card overlay */
    body.has-mini-player.has-track-mode .container > * {
        margin-right: 0;
        margin-left: 0;
    }

    body.has-mini-player.has-track-mode {
        padding-bottom: 220px;
    }

    body.has-mini-player.player-collapsed .container > * {
        margin-right: 0;
        margin-left: 0;
    }

    body.has-mini-player.player-collapsed {
        padding-bottom: 96px;
    }
}

/* On smaller screens / tablets (< 1024px) */
@media (max-width: 1023px) {
    .mini-player-container {
        top: auto;
        bottom: 24px;
        left: 16px;
        width: min(380px, calc(100vw - 32px));
    }
    .mini-player-dock {
        height: auto;
        max-height: 520px;
    }
    .mini-player-embed-wrap {
        height: 480px;
    }
    .mini-player-container.track-mode .mini-player-embed-wrap {
        height: 152px;
    }
}

/* Mobile Responsive Player */
@media (max-width: 768px) {
    .mini-player-dock {
        padding: 6px 12px;
        min-height: 60px;
        gap: 10px;
    }

    .mini-player-center {
        flex: 1 1 auto;
    }

    .mini-spotify-btn span {
        display: none;
    }

    .mini-spotify-btn {
        padding: 6px;
    }
}

/* ----------------------------------------------------
   ARTIST & PLAYLIST DETAIL HERO CARDS
   ---------------------------------------------------- */
.artist-hero,
.playlist-hero {
    display: flex;
    align-items: center;
    gap: 28px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}

.hero-cover {
    width: 180px;
    height: 180px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.hero-details {
    flex: 1;
    min-width: 0;
}

.hero-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 6px;
}

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.2;
    color: var(--text-primary);
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.hero-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.back-nav {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-heading {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 32px 0 16px 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-count {
    font-size: 0.8rem;
    background: var(--bg-surface-active);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

@media (max-width: 600px) {
    .artist-hero,
    .playlist-hero {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    .hero-meta {
        justify-content: center;
    }
}

/* ----------------------------------------------------
   SMART MIX & PLAYLIST BLENDER
   ---------------------------------------------------- */
.mix-section-title {
    margin-bottom: 16px;
}

.mix-section-title h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mix-section-title p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.mix-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.mix-preset-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--card-shadow);
}

.mix-preset-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--accent);
}

.preset-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.preset-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.preset-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    flex-grow: 1;
    line-height: 1.4;
}

.preset-btn {
    width: 100%;
    padding: 8px 14px;
    font-size: 0.84rem;
    border-radius: var(--radius-full);
}

/* Artist Multi-Blender Card */
.artist-blender-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 28px;
}

.blender-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.blender-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.artist-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 2px;
}

.artist-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-active);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
}

.artist-chip:hover {
    border-color: var(--accent);
}

.artist-chip.selected {
    background: var(--accent);
    color: #000000;
    border-color: var(--accent);
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(29, 185, 84, 0.35);
}

.chip-count {
    font-size: 0.72rem;
    background: rgba(0, 0, 0, 0.15);
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.artist-chip.selected .chip-count {
    background: rgba(0, 0, 0, 0.25);
    color: #000000;
}

/* Mix Result Card */
.mix-result-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 36px;
}

.mix-result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.mix-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 4px;
}

.mix-result-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mix-result-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.mix-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mix-play-main-btn {
    font-size: 0.95rem;
    padding: 10px 22px;
}

/* ----------------------------------------------------
   ALBUM DETAIL TRACKLIST TABLE
   ---------------------------------------------------- */
.album-tracklist-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 6px 14px;
    box-shadow: var(--card-shadow);
    margin-top: 20px;
}

.album-tracklist-header {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.album-track-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.album-track-row:last-child {
    border-bottom: none;
}

.album-track-row:hover {
    background: var(--bg-surface-active);
}

.album-track-row.is-playing {
    background: var(--bg-surface-active);
}

.album-track-row.is-playing .album-track-title {
    color: var(--accent);
    font-weight: 700;
}

.album-track-col-num {
    width: 42px;
    min-width: 42px;
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    display: flex;
    align-items: center;
}

.album-track-num-text {
    display: inline-block;
}

.album-track-play-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.album-track-row:hover .album-track-num-text {
    display: none;
}

.album-track-row:hover .album-track-play-btn {
    display: inline-block;
}

.album-track-col-main {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 16px;
}

.album-track-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.album-track-title {
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
}

.album-track-title:hover {
    color: var(--accent);
}

.album-track-feat {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.album-track-col-liked {
    width: 48px;
    min-width: 48px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.album-track-like-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 4px;
    opacity: 0.9;
}

.album-track-like-btn:hover {
    opacity: 1;
}

.album-track-like-btn.not-liked {
    opacity: 0.35;
    filter: grayscale(100%);
}

.album-track-like-btn.not-liked:hover {
    opacity: 0.85;
    filter: grayscale(0%);
}

.album-track-col-dur {
    width: 70px;
    min-width: 70px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
    padding-right: 8px;
    font-variant-numeric: tabular-nums;
}
