:root {
    --player-height: 80px;
    --card-bg: #121212;
    --card-bg-hover: #1f1f1f;
    --accent-green: #1ed760;
}

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

.spotify-layout {
    display: flex;
    flex-direction: column;
    padding-top: 64px;
    min-height: 100vh;
}


.harmony-main {
    flex-grow: 1;
    background: #0A0A0A;
    padding: 16px;
    width: 100%;
}

.search-container {
    display: none; /* Hidden by default, toggled via JS */
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    align-items: center;
    background-color: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 10px 20px;
    width: 300px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.search-container.active {
    display: flex;
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.search-container:focus-within {
    border-color: var(--accent-green);
    background-color: #242424;
}
.search-input {
    background: transparent;
    border: none;
    color: white;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    width: 100%;
    margin-left: 10px;
    outline: none;
}
.search-input::placeholder {
    color: #b3b3b3;
}

@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-green);
    color: black;
    border-color: var(--accent-green);
}


.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;
    
    /* 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%;
    aspect-ratio: 1/1;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.8);
    border-radius: 4px;
    overflow: hidden;
}

.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-green);
    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 {
    background-color: transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    width: 325px; /* updated for embeds */
    flex-shrink: 0;
    scroll-snap-align: start;
    position: relative;
}

.tiktok-card:hover { transform: scale(1.02); }

.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;
    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-green);
    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;
    justify-content: center;
    align-items: center;
    color: white;
}
.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;
}
.fullscreen-content {
    position: relative;
    z-index: 5;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.fullscreen-art {
    width: 300px; height: 300px;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    object-fit: cover;
}
.fullscreen-content h1 {
    font-size: 2rem; margin: 10px 0 0;
}
.fullscreen-content h2 {
    font-size: 1.2rem; color: #b3b3b3; margin: 0; cursor: pointer;
}
.fullscreen-controls {
    display: flex; align-items: center; gap: 30px; margin-top: 20px;
}

/* Artist Profile */
.artist-profile {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2100;
    background: #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-green);
}
.song-table .playing .song-title { color: var(--accent-green); }


.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;
    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-green) !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-green); }

.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-green) !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;
    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;
    overflow: hidden;
}

.lyrics-bg {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(0,0,0,0.1), rgba(0,0,0,0.85));
    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 {
    color: #fff;
    transform: scale(1.02);
    text-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.lyric-word {
    display: inline-block;
    transition: color 0.1s ease;
}

.lyric-word.active-word {
    color: #fff;
}
.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-green);
    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;
    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-green);
    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-green);
    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-green);
    filter: drop-shadow(0 0 4px var(--accent-green));
}
#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;
    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-green) !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;
    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;
    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-green); 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;
    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; }
}
