:root {
    --primary-color: #a855f7;
    /* Neon Purple */
    --secondary-color: #f97316;
    /* Sunset Orange */
    --accent-color: #4338ca;
    /* Deep Indigo */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Outfit', sans-serif;
    --font-lyrics: 'Noto Sans SC', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: #0f0c29;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Prevent body scroll, handle inside containers */
}

/* Dynamic Animated Background */
.background-blur {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, var(--accent-color), transparent 60%),
        radial-gradient(circle at 80% 20%, var(--primary-color), transparent 50%),
        radial-gradient(circle at 20% 80%, var(--secondary-color), transparent 50%);
    filter: blur(80px);
    z-index: -1;
    animation: bg-move 20s ease-in-out infinite alternate;
    opacity: 0.6;
}

@keyframes bg-move {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(-5%, -5%) rotate(5deg);
    }
}

/* Player Container */
.player-container {
    display: flex;
    width: 90vw;
    height: 85vh;
    max-width: 1200px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Left Panel: Cover & Controls */
.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    border-right: 1px solid var(--glass-border);
    position: relative;
}

.cover-art {
    width: 350px;
    height: 350px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    margin-bottom: 40px;
    transition: transform 0.5s ease;
}

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

/* Playing animation for cover */
body.playing .cover-art {
    transform: scale(1.02);
    box-shadow: 0 25px 60px rgba(168, 85, 247, 0.2);
}

.track-info {
    text-align: center;
    margin-bottom: 30px;
}

.song-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.artist-name {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-secondary);
}

/* Controls */
.controls {
    width: 100%;
    max-width: 400px;
}

.progress-container {
    margin-bottom: 25px;
    cursor: pointer;
    padding: 10px 0;
    /* Increase hit area */
    touch-action: none;
    /* Prevent scroll */
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border-radius: 3px;
}

.time-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    transition: transform 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.control-btn.secondary {
    width: 40px;
    height: 40px;
}

.control-btn.secondary svg {
    width: 28px;
    height: 28px;
}

.control-btn.primary {
    width: 64px;
    height: 64px;
    background: white;
    color: black;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.control-btn.primary svg {
    width: 32px;
    height: 32px;
}

.control-btn.primary:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
}

.control-btn.secondary:hover:not(:disabled) {
    color: var(--primary-color);
}

/* Right Panel: Lyrics */
.right-panel {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}

.lyrics-container {
    height: 100%;
    overflow-y: scroll;
    scrollbar-width: none;
    /* Firefox */
}

.lyrics-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.lyrics-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 50vh 0;
    /* Add padding to center active lyric initially */
    transition: transform 0.3s ease-out;
}

.lyric-line {
    font-family: var(--font-lyrics);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.4s ease;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 8px;
    line-height: 1.4;
    max-width: 90%;
}

.lyric-line:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

.lyric-line.active {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
    transform: scale(1.05);
    transform-origin: left center;
}

/* Mobile Responsive */
@media (max-width: 850px) {
    body {
        align-items: flex-start;
        overflow: hidden;
        /* Prevent body scroll, everything fits in 100vh */
    }

    .player-container {
        flex-direction: column;
        width: 100%;
        height: 100vh;
        /* Fill screen */
        min-height: auto;
        border-radius: 0;
        border: none;
        background: transparent;
        overflow: hidden;
    }

    .left-panel {
        padding: 30px 20px 10px;
        /* Reduced padding */
        flex: 0 0 auto;
        /* Don't grow/shrink */
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        background: rgba(0, 0, 0, 0.2);
        display: flex;
        flex-direction: column;
        align-items: center;
        z-index: 2;
    }

    .cover-art {
        width: 180px;
        /* Smaller cover */
        height: 180px;
        margin-bottom: 15px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    }

    .song-title {
        font-size: 1.3rem;
        /* Slightly smaller */
        margin-bottom: 4px;
    }

    .track-info {
        margin-bottom: 15px;
    }

    .controls {
        width: 100%;
        padding: 0 10px;
    }

    .progress-container {
        margin-bottom: 15px;
    }

    .buttons {
        gap: 20px;
    }

    .control-btn.primary {
        width: 50px;
        height: 50px;
    }

    .control-btn.primary svg {
        width: 24px;
        height: 24px;
    }

    .right-panel {
        flex: 1;
        /* Take remaining height */
        padding: 0 20px;
        /* Reduce horizontal padding */
        height: auto;
        /* Let flex handle height */
        mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
        -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
        overflow: hidden;
        /* Container itself doesn't scroll, child does */
        display: flex;
        align-items: center;
        position: relative;
    }

    .lyrics-container {
        width: 100%;
        height: 100%;
        padding-top: 20px;
        /* Slight top padding inside mask */
        position: relative;
    }

    .lyrics-wrapper {
        padding: 50% 0;
        /* Center active lyric */
        gap: 20px;
    }

    .lyric-line {
        font-size: 1rem;
        text-align: center;
        margin: 0 auto;
        padding: 6px 4px;
    }

    .lyric-line.active {
        font-size: 1.3rem;
        transform-origin: center;
    }
}