:root {
    --player-height: 80px;
    --card-bg: var(--primary-card-color, #121212);
    --card-bg-hover: var(--secondary-card-color, #1f1f1f);
    --accent-green: #1ed760;
}

body {
    background-color: var(--bg-color, #0A0A0A);
    overflow-x: hidden;
    padding-bottom: 120px;
    font-family: 'Inter', sans-serif;
    color: #ffffff;
}

.spotify-layout {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    overflow: hidden;
    padding-top: 64px;
    min-height: 100vh;
}


.harmony-main {
    flex-grow: 1;
    background: var(--bg-color, #0A0A0A);
    padding: 16px;
    width: 100%;
}

/* ===== Spotlight Search Overlay ===== */
.spotlight-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding-top: 80px;
    transition: opacity 0.2s ease;
}
.spotlight-overlay.hidden {
    display: none;
}
@keyframes spotlightIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.spotlight-overlay:not(.hidden) .spotlight-panel {
    animation: spotlightIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.spotlight-panel {
    width: 90%;
    max-width: 620px;
    background: linear-gradient(180deg, rgba(18,18,18,0.98) 0%, rgba(18,18,18,0.92) 70%, rgba(18,18,18,0) 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.08);
    position: relative;
    /* Cap height and let results scroll inside */
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.spotlight-input-row {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}
.spotlight-icon { color: rgba(255,255,255,0.5); flex-shrink: 0; }

.spotlight-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.15rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    caret-color: var(--accent-green, #1db954);
}
.spotlight-input::placeholder { color: rgba(255,255,255,0.35); }

.spotlight-esc-hint {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: rgba(255,255,255,0.4);
    font-size: 0.72rem;
    padding: 2px 7px;
    font-family: inherit;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    cursor: pointer;
}

.spotlight-results {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0 40px; /* extra bottom pad for fade */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.spotlight-results:empty { display: none; }

/* Gradient fade at the bottom */
.spotlight-fade-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, rgba(18,18,18,0.97));
    pointer-events: none;
}

/* Result rows */
.spotlight-result-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 0;
}
.spotlight-result-row:hover,
.spotlight-result-row:focus {
    background: rgba(255,255,255,0.07);
    outline: none;
}
.spotlight-result-art {
    width: 46px;
    height: 46px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.spotlight-result-info { flex: 1; min-width: 0; }
.spotlight-result-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.spotlight-result-artist {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.spotlight-result-play {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.3);
    flex-shrink: 0;
    transition: color 0.15s;
}
.spotlight-result-row:hover .spotlight-result-play { color: var(--accent-green, #1db954); }

.spotlight-no-results {
    padding: 24px 20px;
    text-align: center;
    color: rgba(255,255,255,0.35);
    font-size: 0.9rem;
}

/* Legacy class — keep so nothing crashes if still referenced */
.search-container { display: none !important; }
.search-input { display: none !important; }



@media (min-width: 768px) {
    .harmony-main { padding: 40px; }
}


.pill-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
}
.pill-nav::-webkit-scrollbar { display: none; }

.nav-pill {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.nav-pill:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-pill.active {
    background-color: var(--accent-color, #16A34A);
    color: black;
    border-color: var(--accent-color, #16A34A);
}


.greet-section h1 {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 800;
    margin-bottom: 32px;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.shelf {
    margin-bottom: 48px;
}

.shelf-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}

.shelf-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.see-all {
    font-size: 0.9rem;
    font-weight: 600;
    color: #b3b3b3;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
}
.see-all:hover { text-decoration: underline; color: white; }


/* Mobile: Horizontally scrolling row */
.card-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 16px;
    padding-bottom: 8px; /* space for potential scrollbar / drop shadow */
}
.card-grid::-webkit-scrollbar { display: none; }

/* Desktop: Standard Grid */
@media (min-width: 600px) {
    .card-grid { 
        display: grid;
        grid-template-columns: repeat(3, 1fr); 
        overflow-x: visible;
    }
}
@media (min-width: 900px) {
    .card-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1200px) {
    .card-grid { grid-template-columns: repeat(5, 1fr); }
}

.music-card {
    background-color: var(--card-bg);
    padding: 12px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    overflow: hidden;
    
    /* Mobile specific sizing */
    flex: 0 0 140px; 
    scroll-snap-align: start;
}

@media (min-width: 600px) {
    .music-card {
        flex: auto; /* Reset flex constraints on desktop grid */
    }
}

.music-card:hover {
    background-color: var(--card-bg-hover);
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.8);
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}
.card-img-wrapper::before {
    content: "";
    display: block;
    padding-bottom: 100%;
}
.card-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-play-btn {
    position: absolute;
    bottom: 8px;
    right: 50px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-color, #16A34A);
    color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    border: none;
    font-size: 20px;
}

.music-card:hover .card-play-btn {
    opacity: 1;
    transform: translateY(0);
}

.card-title {
    color: white;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.card-desc {
    color: #b3b3b3;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 600px) {
    .card-title { font-size: 1.1rem; }
    .card-desc { font-size: 0.9rem; }
}


.tiktok-grid {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    scrollbar-width: none;
}
.tiktok-grid::-webkit-scrollbar { display: none; }

.tiktok-card {
    flex: 0 0 min(325px, 90vw);
    width: min(325px, 90vw);
    max-width: min(325px, 90vw);
    min-width: min(325px, 90vw);
    border-radius: 12px;
    overflow: hidden;
    background: #0f0f0f;
    box-shadow: 0 6px 24px rgba(0,0,0,0.5);
    transition: transform 0.2s ease;
    scroll-snap-align: start;
    position: relative;
}

.tiktok-card:hover { transform: translateY(-2px); }

.tiktok-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tiktok-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 10px;
}

.tiktok-title {
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}


.back-btn {
    background: none;
    border: none;
    color: #b3b3b3;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 0.9rem;
}
.back-btn:hover { color: white; }


.playlist-header {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    overflow: hidden;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
}

@media (min-width: 600px) {
    .playlist-header {
        flex-direction: row;
        align-items: flex-end;
        text-align: left;
        gap: 24px;
    }
}

.album-art {
    width: 180px;
    height: 180px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
    object-fit: cover;
    margin-bottom: 15px;
}

.playlist-details h1 {
    font-size: 2rem;
    font-weight: 800;
    margin: 5px 0 10px;
    line-height: 1;
    color: white;
}

.action-btn-play {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent-color, #16A34A);
    border: none;
    font-size: 20px;
    color: black;
    cursor: pointer;
    margin-right: 10px;
    transition: transform 0.2s;
}
.action-btn-play:hover { transform: scale(1.05); }

.action-btn-secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 7px 15px;
    border-radius: 4px;
    height: 100%;
    transition: width 0.1s linear;
}

/* Animations */
@keyframes slideUpFadeIn {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDownFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(100%); }
}

.slide-up-active {
    animation: slideUpFadeIn 0.4s ease-out forwards;
}
.slide-down-active {
    animation: slideDownFadeOut 0.4s ease-in forwards;
}

/* Trending Lyric */
.trending-lyric {
    background: linear-gradient(90deg, rgba(147, 51, 234, 0) 0%, rgba(147, 51, 234, 0.4) 50%, rgba(147, 51, 234, 0) 100%);
    text-shadow: 0 0 10px rgba(147, 51, 234, 0.8);
    border-radius: 8px;
    padding: 0 10px;
    color: #fff !important;
}

/* Fullscreen Player */
.fullscreen-player {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2000;
    background-color: var(--lyrics-bg, #121212);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    justify-content: center;
    align-items: center;
    color: white;
    /* Slide-up animation driven by class */
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease;
}
.fullscreen-player.fs-visible {
    transform: translateY(0);
    opacity: 1;
}
.fullscreen-player.fs-hiding {
    transform: translateY(100%);
    opacity: 0;
}
.fullscreen-bg {
    position: absolute;
    top: -10%; left: -10%; width: 120%; height: 120%;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.4);
    z-index: 0;
}
.close-fullscreen-btn {
    position: absolute;
    top: 30px; right: 30px;
    background: rgba(255,255,255,0.1);
    border: none; border-radius: 50%;
    width: 44px; height: 44px;
    color: white; cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    z-index: 10;
}

/* Two-column layout: left = art+controls, right = lyrics panel */
.fullscreen-content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 60px 40px 40px;
    gap: 0;
    transition: gap 0.4s ease;
    box-sizing: border-box;
    overflow: hidden;
}
.fullscreen-content.lyrics-open {
    gap: 40px;
}

/* Left column: art + title + controls */
.fs-left-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    flex-shrink: 0;
    transition: flex-basis 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex-basis: 100%;
}
.fullscreen-content.lyrics-open .fs-left-panel {
    flex-basis: 45%;
}

.fullscreen-art {
    width: min(280px, 45vw);
    height: min(280px, 45vw);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    object-fit: cover;
    transition: width 0.4s ease, height 0.4s ease;
}
.fullscreen-content.lyrics-open .fullscreen-art {
    width: min(180px, 28vw);
    height: min(180px, 28vw);
}

.fullscreen-content h1 {
    font-size: 2rem; margin: 10px 0 0;
    transition: font-size 0.3s ease;
}
.fullscreen-content.lyrics-open h1 { font-size: 1.4rem; }
.fullscreen-content h2 {
    font-size: 1.2rem; color: #b3b3b3; margin: 0; cursor: pointer;
    transition: font-size 0.3s ease;
}
.fullscreen-content.lyrics-open h2 { font-size: 1rem; }

.fullscreen-controls {
    display: flex; align-items: center; gap: 30px; margin-top: 20px;
    transition: gap 0.3s ease;
}
.fullscreen-content.lyrics-open .fullscreen-controls { gap: 18px; }

/* Right column: lyrics panel sliding in */
.fs-lyrics-side-panel {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 0 10px;
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.fullscreen-content.lyrics-open .fs-lyrics-side-panel {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* On narrow screens, stack vertically */
@media (max-width: 700px) {
    .fullscreen-content {
        flex-direction: column;
        padding: 80px 20px 20px;
    }
    .fullscreen-content.lyrics-open .fs-left-panel {
        flex-basis: auto;
    }
    .fs-lyrics-side-panel {
        max-height: 40vh;
        transform: translateY(30px);
    }
    .fullscreen-content.lyrics-open .fs-lyrics-side-panel {
        transform: translateY(0);
    }
}



/* Artist Profile */
.artist-profile {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2100;
    background: var(--secondary-card-color, #121212);
    color: white;
    overflow-y: auto;
    padding-top: 60px;
}
.artist-header {
    text-align: center; padding: 40px 20px;
    background: linear-gradient(to bottom, #2a2a2a, #121212);
}
.artist-avatar {
    width: 150px; height: 150px;
    border-radius: 50%;
    background: #333;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.artist-tracks {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}
.action-btn-secondary:hover { border-color: white; }


.song-table {
    width: 100%;
    border-collapse: collapse;
    color: #b3b3b3;
    font-size: 0.9rem;
}

.song-table th {
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 10px 8px;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 400;
}

.song-table td {
    padding: 12px 8px;
}

.song-table tr {
    transition: background-color 0.2s;
    border-radius: 4px;
}

.song-table tbody tr:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.song-title {
    color: white;
    font-size: 1rem;
    font-weight: 500;
}

.song-table .playing {
    color: var(--accent-color, #16A34A);
}
.song-table .playing .song-title { color: var(--accent-color, #16A34A); }


.music-player-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 800px;
    height: var(--player-height);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    color: white;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(40px) saturate(200%) brightness(120%);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(120%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.current-song-details {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    overflow: hidden;
}

.current-song-details img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.song-info-text {
    overflow: hidden;
    white-space: nowrap;
}

.song-info-text p { margin: 0; text-overflow: ellipsis; overflow: hidden; }
#player-song-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; }
#player-song-artist { font-size: 0.75rem; color: #b3b3b3; }

.player-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    overflow: visible;
    align-items: center;
    justify-content: center;
}

.controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 5px;
}

.control-button {
    background: none;
    border: none;
    color: #b3b3b3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    filter: drop-shadow(0px 2px 5px rgba(0, 0, 0, 0.6));
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    -webkit-touch-callout: none;
}
.control-button:hover { color: white; }


#shuffle-btn, #repeat-btn, #mixer-btn { display: none; }
@media (min-width: 600px) {
    #shuffle-btn, #repeat-btn, #mixer-btn { display: flex; }
}
/* Lyrics and viral hidden on small screens, shown by overflow panel */
#lyrics-btn, #viral-skip-btn { display: none; }
@media (min-width: 600px) {
    #lyrics-btn, #viral-skip-btn { display: flex; }
}
/* Mixer button color: white=off, green=on */
#mixer-btn {
    color: #ffffff !important;
    transition: color 0.2s ease;
}
#mixer-btn.active {
    color: var(--accent-color, #16A34A) !important;
    transition: color 0.2s ease;
}

/* Lime-green pulse when actively crossfading (only when mixer is on) */
@keyframes pulseGreen {
    0%   { color: #1ed760 !important; filter: drop-shadow(0 0 5px #1ed760); }
    50%  { color: #9effc0 !important; filter: drop-shadow(0 0 14px #9effc0); }
    100% { color: #1ed760 !important; filter: drop-shadow(0 0 5px #1ed760); }
}
#mixer-btn.active.pulsing,
#fs-mixer-btn.active.pulsing {
    animation: pulseGreen 1.2s ease-in-out infinite !important;
}

/* Blue pulse when analyzing/pre-listening (only when mixer is on) */
@keyframes pulseBlue {
    0%   { color: #5b9cf6 !important; filter: drop-shadow(0 0 5px #5b9cf6); }
    50%  { color: #bfdbfe !important; filter: drop-shadow(0 0 14px #bfdbfe); }
    100% { color: #5b9cf6 !important; filter: drop-shadow(0 0 5px #5b9cf6); }
}
#mixer-btn.active.analyzing,
#fs-mixer-btn.active.analyzing {
    animation: pulseBlue 0.7s ease-in-out infinite !important;
}

.play-pause-btn {
    background-color: white;
    color: black;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.play-pause-btn:hover { color: black; transform: scale(1.05); }



.progress-bar-container {
    width: 100%;
    max-width: 300px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: #b3b3b3;
}


.current-time, .total-time { display: none; }
@media (min-width: 400px) {
    .current-time, .total-time { display: block; }
}

.progress-bar {
    flex-grow: 1;
    height: 4px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress {
    background-color: white;
    height: 100%;
    border-radius: 2px;
    width: 0%;
    transition: width 0.2s ease;
}

.progress-bar:hover .progress { background-color: var(--accent-color, #16A34A); }

.volume-container {
    display: none;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
}

@media (min-width: 768px) {
    .volume-container { display: flex; }
}

.volume-slider-wrapper {
    width: 80px;
    display: flex;
    align-items: center;
}


.volume-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    transition: transform 0.1s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.like-btn-player {
    background: none; border: none; color: #b3b3b3; cursor: pointer; font-size: 1.2rem;
    filter: drop-shadow(0px 2px 5px rgba(0, 0, 0, 0.6));
    margin-left: 5px;
}
.like-btn-player.active { color: var(--accent-color, #16A34A) !important; text-shadow: 0 0 10px rgba(30, 215, 96, 0.5); }

/* --- LYRICS OVERLAY --- */
.lyrics-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    overflow: hidden;
    overflow: hidden;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-lyrics-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 1010;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    transition: background 0.2s;
}

.close-lyrics-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.view-lyrics {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--lyrics-color, #2d1445);
    transition: background-color 2s ease-in-out;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    overflow: hidden;
    overflow: hidden;
}

.lyrics-bg {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at -10% 50%, color-mix(in srgb, var(--theme-color, #1a2b4c) 30%, transparent) 0%, transparent 50%),
                radial-gradient(circle at 110% 50%, color-mix(in srgb, var(--theme-color, #1a2b4c) 30%, transparent) 0%, transparent 50%);
    filter: blur(80px);
    z-index: 0;
    animation: slowSpin 30s linear infinite;
    opacity: 0.5;
    pointer-events: none;
}

@keyframes slowSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.lyrics-container {
    position: relative;
    z-index: 10;
    flex: 1;
    overflow-y: auto;
    padding: 100px 20px 200px;
    display: block;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.lyrics-container::-webkit-scrollbar {
    display: none;
}

#lyrics-content {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.lyric-line {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 800;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 24px;
    line-height: 1.3;
    transform-origin: left center;
    transition: color 0.4s ease, transform 0.4s ease, text-shadow 0.4s ease;
    cursor: pointer;
}

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

.lyric-line.active {
    /* Set un-sung words to a dimmer white/opacity */
    color: rgba(255, 255, 255, 0.4); 
    transform: scale(1.02);
    /* Remove line-level text shadow so only active words glow */
}

.lyric-word {
    display: inline-block;
    transition: color 0.15s ease, transform 0.1s ease, text-shadow 0.15s ease;
}

.lyric-word.active-word {
    /* Sung words become bright white and pop out slightly */
    color: #fff;
    text-shadow: 0 0 15px rgba(255,255,255,0.6);
}

.lyric-line:not(.active) .lyric-word {
    color: inherit;
}

/* --- MODAL / WHATS NEW --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn .3s ease;
}

.modal-content {
    background: #181818;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    color: white;
}

.close-modal-btn {
    position: absolute;
    top: 15px; right: 20px;
    background: none; border: none;
    color: #b3b3b3; font-size: 24px;
    cursor: pointer;
}
.close-modal-btn:hover { color: white; }

.modal-title {
    font-size: 1.5rem; font-weight: 800;
    margin-top: 0; margin-bottom: 25px;
    text-align: center;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.feature-icon {
    font-size: 24px;
    background: rgba(255,255,255,0.1);
    width: 40px; height: 40px;
    display: flex; justify-content: center; align-items: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.feature-text h3 { margin: 0 0 5px; font-size: 1.1rem; }
.feature-text p { margin: 0; color: #b3b3b3; font-size: 0.85rem; line-height: 1.4; }

.primary-btn {
    background: var(--accent-color, #16A34A);
    color: black;
    border: none;
    padding: 12px;
    width: 100%;
    border-radius: 24px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.2s;
}
.primary-btn:hover { transform: scale(1.03); }
#fullscreen-artist:hover, #player-song-artist:hover, .card-info p:hover {
    text-decoration: underline;
    text-decoration-color: white;
    cursor: pointer;
}

.fullscreen-player-ui {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    overflow: hidden;
    align-items: center;
    gap: 30px;
    width: 100%;
    max-width: 600px;
    margin-top: 20px;
}
.fs-player-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
}
.fs-progress-bar-container {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 15px;
    color: #b3b3b3;
    font-size: 0.9rem;
}
.fs-progress-bar-container .progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.fs-progress-bar-container .progress {
    height: 100%;
    background: var(--accent-color, #16A34A);
    width: 0%;
    transition: width 0.2s ease;
}
.fs-heart {
    font-size: 1.8rem;
}
.fs-player-options .control-button {
    transform: scale(1.2);
}

.search-highlight {
    background: rgba(50, 205, 50, 0.4);
    color: lime;
    border-radius: 2px;
}
#search-container {
    transition: all 0.3s ease;
}

.total-time, .fs-total-time {
    cursor: pointer;
    user-select: none;
}

.song-info-text {
    overflow: hidden;
    white-space: nowrap;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}
#player-song-title, #fs-song-title, #lyrics-title {
    display: inline-block;
    white-space: nowrap;
}
.marquee {
    padding-right: 50px;
    animation: marquee-scroll 10s linear infinite;
}
.marquee:hover {
    animation-play-state: paused;
}
@keyframes marquee-scroll {
    0%   { transform: translateX(0); }
    10%  { transform: translateX(0); }
    90%  { transform: translateX(calc(-100% + 120px)); }
    100% { transform: translateX(calc(-100% + 120px)); }
}

/* ---- Viral-locked badge ---- */
.viral-skip-wrapper {
    position: relative;
}
.viral-repeat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 9px;
    color: var(--accent-color, #16A34A);
    line-height: 1;
    pointer-events: none;
}
#viral-skip-btn.viral-locked, #fs-viral-skip-btn.viral-locked, #mob-viral-btn.viral-locked {
    color: var(--accent-color, #16A34A);
    filter: drop-shadow(0 0 4px var(--accent-color, #16A34A));
}
#viral-skip-btn.viral-locked .viral-repeat-badge, #fs-viral-skip-btn.viral-locked .viral-repeat-badge, #mob-viral-btn.viral-locked .viral-repeat-badge {
    display: inline !important;
}

/* ---- Mobile overflow and queue button ---- */
.mobile-overflow-btn, .mobile-queue-btn {
    display: flex;
}
@media (min-width: 600px) {
    .mobile-overflow-btn, .mobile-queue-btn { display: none !important; }
}

/* Mobile overlay panel */
.mobile-controls-overlay {
    position: fixed;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20,20,20,0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    padding: 14px 20px;
    display: flex;
    gap: 22px;
    align-items: center;
    z-index: 1200;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    animation: slideUpFadeIn 0.25s ease-out;
}
.mobile-controls-overlay .control-button {
    color: #b3b3b3;
    font-size: 1rem;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    overflow: hidden;
    align-items: center;
    gap: 4px;
    min-width: 44px;
}
.mobile-controls-overlay .control-button:hover { color: #fff; }
.mobile-controls-overlay .control-button.active, #mob-mixer-btn.active { color: var(--accent-color, #16A34A) !important; }
.mobile-controls-overlay.hidden {
    display: none;
}

/* Queue Panel Styles */
.queue-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    overflow: hidden;
    padding: 20px;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(25, 25, 25, 0.4);
    backdrop-filter: blur(40px) saturate(200%) brightness(120%);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(120%);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    color: white;
}

@media (max-width: 600px) {
    .queue-panel {
        right: 0;
        bottom: -100%;
        top: auto;
        width: 100%;
        height: 85vh;
        border-radius: 24px 24px 0 0;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        transition: bottom 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    }
    .queue-panel.open {
        bottom: 0 !important;
        right: 0 !important;
    }
}

.queue-panel.open {
    right: 0;
}

.queue-panel.hidden {
    display: flex; /* Override default hidden so animation works */
    pointer-events: none;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.queue-header h2 { margin: 0; font-size: 1.5rem; font-weight: 700; }

.queue-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}
.queue-tab {
    background: none; border: none; color: #b3b3b3;
    font-size: 1rem; font-weight: 600; cursor: pointer; padding: 5px 10px;
}
.queue-tab.active {
    color: white;
    border-bottom: 2px solid white;
}

.queue-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    overflow: hidden;
    gap: 10px;
}

/* Queue Items */
.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
    cursor: grab;
}
.queue-item:active { cursor: grabbing; }
.queue-item:hover { background: rgba(255, 255, 255, 0.1); }
.queue-item.playing { border-left: 3px solid var(--accent-color, #16A34A); background: rgba(255, 255, 255, 0.1); }
.queue-item img {
    width: 40px; height: 40px; border-radius: 6px; object-fit: cover;
}
.queue-item-info {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}
.queue-item-info h4 { margin: 0; font-size: 0.95rem; text-overflow: ellipsis; overflow: hidden; }
.queue-item-info p { margin: 0; font-size: 0.8rem; color: #b3b3b3; text-overflow: ellipsis; overflow: hidden; }

.queue-item-drag {
    color: #b3b3b3;
    padding: 10px; /* larger hit area */
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 599px) {
    .queue-item {
        padding: 14px 10px; /* larger touch target */
    }
    .queue-more-btn {
        padding: 10px;
    }
}

.add-queue-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}
.song-card:hover .add-queue-btn { opacity: 1; }
.add-queue-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.1); }

/* Drag and Drop styling */
.queue-item.dragging {
    opacity: 0.5;
    background: rgba(255,255,255,0.2);
}

/* Mixxer Survey */
.mixxer-survey {
    position: fixed;
    bottom: calc(var(--player-height) + 40px); /* Just above the miniplayer */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(40px) saturate(200%) brightness(120%);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(120%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    color: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mixxer-survey p { margin: 0; font-weight: 600; font-size: 0.95rem; white-space: nowrap; }

.mixxer-survey.visible {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateX(-50%) translateY(0) !important;
}

.survey-btns { display: flex; gap: 10px; }
.survey-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 36px; height: 36px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s, background 0.2s;
    padding: 0;
}
.survey-btn:hover { transform: scale(1.1); background: rgba(255,255,255,0.2); }

@media (max-width: 600px) {
    .mixxer-survey {
        bottom: calc(var(--player-height) + 90px); /* A bit higher on mobile if needed */
        width: 90%;
        max-width: 320px;
        justify-content: space-between;
    }
}

/* Song Context Menu */
.song-context-menu {
    position: absolute;
    width: 200px;
    background: rgba(25, 25, 25, 0.6);
    backdrop-filter: blur(40px) saturate(200%) brightness(120%);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(120%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    overflow: hidden;
    padding: 8px;
    opacity: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(0);
}

.song-context-menu.hidden {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
}

.context-menu-item {
    background: none;
    border: none;
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.card-more-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.2s, background 0.2s;
    font-weight: bold;
    font-size: 1.2rem;
    padding-bottom: 8px;
}
.card-more-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.1); }
.queue-more-btn {
    font-size: 24px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    user-select: none;
    touch-action: none; /* Crucial for pointer events on mobile */
}

.queue-more-btn:hover {
    opacity: 1;
}

.queue-more-btn:active {
    transform: scale(0.9);
}

/* Recommended Container Limits */
#container-recommended .music-card { display: none; }
@media (max-width: 599px) { #container-recommended .music-card { display: flex; } }
@media (min-width: 600px) { #container-recommended .music-card:nth-child(-n+10) { display: flex; } }
#container-recommended.expanded .music-card { display: flex !important; }

.show-more-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 15px;
    font-weight: bold;
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: background 0.2s;
}
.show-more-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 599px) {
    .show-more-btn { display: none !important; }
}

/* Paint spill effect */
.paint-spill-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0; /* Behind everything */
    background: radial-gradient(circle at -10% 50%, rgba(255, 20, 147, 0.8) 0%, transparent 50%),
                radial-gradient(circle at 110% 50%, rgba(255, 105, 180, 0.8) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.5s ease;
    mix-blend-mode: screen;
    filter: blur(20px) contrast(1.5);
}

.paint-spill-effect.active {
    opacity: 1;
}

.paint-spill-effect.beat {
    animation: paintBeat 0.3s ease-out;
}

@keyframes paintBeat {
    0% {
        transform: scale(1) rotate(0deg);
        filter: blur(20px) contrast(1.1) brightness(1);
        opacity: 0.3;
    }
    20% {
        transform: scale(1.05) rotate(1deg);
        filter: blur(15px) contrast(1.3) brightness(1.2);
        opacity: 0.6;
    }
    100% {
        transform: scale(1) rotate(0deg);
        filter: blur(20px) contrast(1.1) brightness(1);
        opacity: 0.3;
    }
}
    20% {
        transform: scale(1.2) rotate(2deg);
        filter: blur(10px) contrast(3) brightness(3);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        filter: blur(20px) contrast(1.5) brightness(1);
        opacity: 0.6;
    }
}
    20% {
        transform: scale(1.2) rotate(2deg);
        filter: blur(10px) contrast(3) brightness(3);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        filter: blur(20px) contrast(1.5) brightness(1);
        opacity: 0.6;
    }
}
    20% {
        transform: scale(1.05) rotate(1deg);
        filter: blur(15px) contrast(1.3) brightness(1.2);
        opacity: 0.6;
    }
    100% {
        transform: scale(1) rotate(0deg);
        filter: blur(20px) contrast(1.1) brightness(1);
        opacity: 0.3;
    }
}
    20% {
        transform: scale(1.2) rotate(2deg);
        filter: blur(10px) contrast(3) brightness(3);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        filter: blur(20px) contrast(1.5) brightness(1);
        opacity: 0.6;
    }
}
    30% {
        transform: scale(1.15);
        filter: blur(10px) contrast(2.5) brightness(2.5);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        filter: blur(20px) contrast(1.5) brightness(1);
        opacity: 0.6;
    }
}
    50% {
        transform: scale(1.05);
        filter: blur(10px) contrast(2) brightness(1.5);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        filter: blur(20px) contrast(1.5) brightness(1);
        opacity: 0.8;
    }
}
.paint-spill-effect.hidden {
    display: none;
}


.title-marquee {
    width: 150px;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.title-marquee p {
    display: inline-block;
    min-width: 100%;
    animation: scroll-left 8s linear infinite;
}

@keyframes scroll-left {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}
.fullscreen-marquee {
    width: 80%;
    max-width: 300px;
    margin: 0 auto;
}
.fullscreen-marquee h1 {
    display: inline-block;
    min-width: 100%;
    animation: scroll-left 12s linear infinite;
    white-space: nowrap;
}

/* Leaderboard */
.leaderboard-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.leaderboard-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.1);
}
.leaderboard-rank {
    font-size: 1.2rem;
    font-weight: bold;
    width: 30px;
    color: #fff;
}
.leaderboard-trend {
    width: 20px;
    margin-right: 15px;
    font-size: 1.2rem;
}
.trend-up { color: var(--accent-green, #1db954); }
.trend-down { color: #ff4d4d; }
.trend-flat { color: #888; }

.leaderboard-art {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin-right: 15px;
    object-fit: cover;
}
.leaderboard-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.leaderboard-title {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}
.leaderboard-artist {
    font-size: 0.8rem;
    color: #b3b3b3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.leaderboard-views {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 600;
}

/* TikTok scaling for mobile and desktop */
.tiktok-card {
    flex: 0 0 325px;
    max-width: 325px;
    min-width: 325px;
    border-radius: 12px;
    overflow: hidden;
    background: #0f0f0f;
    box-shadow: 0 6px 24px rgba(0,0,0,0.5);
    transition: transform 0.2s ease;
}
.tiktok-card:hover {
    transform: translateY(-2px);
}
.tiktok-embed {
    margin: 0 !important;
    min-width: 325px !important;
    max-width: 325px !important;
}
@media (max-width: 599px) {
    .tiktok-card {
        flex: 0 0 285px;
        max-width: 285px;
        min-width: 285px;
    }
    .tiktok-embed {
        transform: scale(0.875);
        transform-origin: top left;
        width: 325px !important;
    }
}

@media (max-width: 599px) {
    .controls {
        gap: 8px !important;
    }
}

/* ===== Viral Song Stats Popup ===== */
.viral-stats-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 20px;
}
.viral-stats-overlay.hidden { display: none; }

@keyframes viralPopIn {
    from { opacity: 0; transform: scale(0.88) translateY(20px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.viral-stats-popup {
    position: relative;
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(16, 16, 16, 0.85);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 24px 64px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.04);
    animation: viralPopIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Blurred album-art background */
.viral-stats-bg {
    position: absolute;
    inset: -10%;
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.25) saturate(1.4);
    z-index: 0;
    pointer-events: none;
}

/* Close button */
.viral-stats-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.viral-stats-close:hover { background: rgba(255,255,255,0.18); color: #fff; }

/* Header: art + meta */
.viral-stats-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 28px 24px 20px;
}
.viral-stats-art {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    flex-shrink: 0;
}
.viral-stats-meta { flex: 1; min-width: 0; }
.viral-stats-rank-badge {
    display: inline-block;
    background: linear-gradient(135deg, #1db954, #00d4aa);
    color: #000;
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    padding: 3px 9px;
    border-radius: 20px;
    margin-bottom: 6px;
}
.viral-stats-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.viral-stats-artist {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
    margin-top: 3px;
}

/* Divider */
.viral-stats-popup::after {
    content: '';
    display: block;
    position: relative;
    z-index: 2;
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 0 24px;
}

/* Stats grid */
.viral-stats-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: rgba(255,255,255,0.05);
    margin: 0 24px 20px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}
.viral-stat-card {
    background: rgba(255,255,255,0.03);
    padding: 14px 16px;
    text-align: center;
    transition: background 0.15s;
}
.viral-stat-card:hover { background: rgba(255,255,255,0.07); }
.viral-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}
.viral-stat-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Play button */
.viral-stats-play-btn {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: calc(100% - 48px);
    margin: 0 24px 24px;
    padding: 14px;
    border-radius: 50px;
    border: none;
    background: linear-gradient(135deg, #1db954, #00d4aa);
    color: #000;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 20px rgba(29,185,84,0.4);
}
.viral-stats-play-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 28px rgba(29,185,84,0.6);
}
.viral-stats-play-btn:active { transform: scale(0.97); }

/* ===== Lexi Mixxer Blob & States ===== */
.lexi-mixer-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    touch-action: none; /* For dragging */
}

.lexi-mixxer-blob {
    width: 20px;
    height: 20px;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; background-size: 200% 200%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.15), transparent 60%), linear-gradient(45deg, #ff007f 0%, #7f00ff 50%, #007fff 100%);
    box-shadow: inset 0 0 4px 1px rgba(0,0,0,0.3), inset 1px 1px 2px rgba(255,255,255,0.2), 0 0 10px rgba(59, 130, 246, 0.7);
    animation: blob-shape 10s ease-in-out infinite, color-cycle 15s ease-in-out infinite;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, filter 0.3s ease;
    cursor: grab;
    position: absolute;
    z-index: 50;
}
.lexi-mixxer-blob:active {
    cursor: grabbing;
}

.lexi-mixer-wrapper:hover .lexi-mixxer-blob {
    transform: scale(1.18);
    box-shadow: inset 0 0 5px 1px rgba(255,255,255,0.3), 0 0 15px rgba(59, 130, 246, 0.9);
}

/* Landing Pop Animation for when Lexi arrives */
@keyframes lexi-blob-landing {
    0% {
        transform: scale(0);
        opacity: 0;
        filter: brightness(2.2) drop-shadow(0 0 15px #00ffcc);
    }
    50% {
        transform: scale(1.45);
        opacity: 1;
        filter: brightness(1.8) drop-shadow(0 0 20px #3b82f6);
    }
    75% {
        transform: scale(0.92);
        filter: brightness(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
        filter: brightness(1);
    }
}

.lexi-mixxer-blob.landing-animate {
    animation: lexi-blob-landing 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, blob-shape 10s ease-in-out infinite 0.7s !important;
}

/* States */
/* 1. Default (Not playing) is Blue (base state above) */

/* 2. Listening (Playing, Mixer OFF) -> Pulse White with blob morph */
.lexi-mixer-wrapper.state-listening .lexi-mixxer-blob {
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #9ca3af 100%);
    box-shadow: inset 0 0 4px 1px rgba(255,255,255,0.5), 0 0 16px rgba(255, 255, 255, 0.85);
    animation: blob-shape 8s ease-in-out infinite, pulse-white 2s infinite ease-in-out, color-cycle 15s ease-in-out infinite;
}

/* 3. Mixxing (Mixer ON) -> Pulse Green with blob morph */
.lexi-mixer-wrapper.state-mixxing .lexi-mixxer-blob {
    background: radial-gradient(circle at 30% 30%, #4ade80 0%, #166534 100%);
    box-shadow: inset 0 0 4px 1px rgba(74, 222, 128, 0.5), 0 0 18px rgba(74, 222, 128, 0.9);
    animation: blob-shape 6s ease-in-out infinite, pulse-green 1.5s infinite ease-in-out, color-cycle 15s ease-in-out infinite;
}

/* 4. Deactivated -> Red */
.lexi-mixer-wrapper.state-deactivated .lexi-mixxer-blob {
    background: radial-gradient(circle at 30% 30%, #ef4444 0%, #7f1d1d 100%);
    box-shadow: inset 0 0 4px 1px rgba(239, 68, 68, 0.5), 0 0 12px rgba(239, 68, 68, 0.7);
    animation: blob-shape 10s ease-in-out infinite, color-cycle 15s ease-in-out infinite;
}

@keyframes pulse-white {
    0%, 100% { box-shadow: inset 0 0 4px 1px rgba(255,255,255,0.4), 0 0 10px rgba(255,255,255,0.6); filter: brightness(1); }
    50% { box-shadow: inset 0 0 6px 2px rgba(255,255,255,0.7), 0 0 20px rgba(255,255,255,1); filter: brightness(1.2); }
}

@keyframes pulse-green {
    0%, 100% { box-shadow: inset 0 0 4px 1px rgba(74,222,128,0.4), 0 0 10px rgba(74,222,128,0.6); filter: brightness(1); }
    50% { box-shadow: inset 0 0 6px 2px rgba(74,222,128,0.7), 0 0 22px rgba(74,222,128,1); filter: brightness(1.25); }
}

/* ===== Entry Animation Background Glow ===== */
.player-glow-overlay {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.4), transparent);
    z-index: -1;
    border-radius: 20px;
    pointer-events: none;
}
.player-glow-overlay.animate {
    animation: player-glow-spread 1.5s ease-out forwards;
}

@keyframes player-glow-spread {
    0% { width: 0; opacity: 1; }
    50% { width: 100%; opacity: 0.8; }
    100% { width: 100%; opacity: 0; }
}

/* ===== Drag Menu ===== */
.lexi-drag-menu {
    position: fixed;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 10px;
    z-index: 10000;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.2s, transform 0.2s;
}
.lexi-drag-menu.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}
.lexi-action-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.lexi-action-pill:hover {
    background: rgba(255,255,255,0.2);
}

/* Add Lexi spinning glow to harmonytunes small blob */
@keyframes spinGlowAngleHT {
    0% { --glow-angle: 0deg; }
    100% { --glow-angle: 360deg; }
}
.lexi-mixer-wrapper { position: relative; }
.lexi-mixer-wrapper::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% + 15px);
    height: calc(100% + 15px);
    border-radius: 50px;
    background: conic-gradient(
        from var(--glow-angle, 0deg),
        rgba(255, 0, 127, 0.8), 
        rgba(127, 0, 255, 0.2), 
        rgba(0, 127, 255, 0.8), 
        rgba(0, 255, 127, 0.2), 
        rgba(255, 127, 0, 0.8), 
        rgba(255, 0, 127, 0.8)
    );
    filter: blur(8px);
    z-index: 10; /* Put behind the blob which has z-index 50 */
    opacity: 0.8;
    pointer-events: none;
    animation: spinGlowAngleHT 3s linear infinite;
}
@property --glow-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* Fix iOS Safari SVG click bug where clicks on SVGs within buttons don't bubble correctly */
.control-button svg, .control-button span {
    pointer-events: none;
}
/* Ensure the mixxer blob remains grabbable */
.lexi-mixxer-blob {
    pointer-events: auto !important;
}

/* Increase mobile touch targets significantly */
@media (max-width: 599px) {
    .control-button {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 5px !important;
    }
    .play-pause-btn {
        min-width: 50px !important;
        min-height: 50px !important;
    }
    .controls {
        gap: 4px !important;
    }
}

/* Version Dropdown styling */
.version-select {
    width: 100%;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 0.75rem;
    outline: none;
    cursor: pointer;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.version-select option {
    background: #1e1e1e;
    color: #fff;
}

.music-card {
    padding-bottom: 12px; /* ensure space for select if it wraps */
}

.modal-overlay.hidden { display: none !important; }
