:root {
    --bg-black: #050505;
    --grid-color: rgba(255, 255, 255, 0.03);
    --accent-glow: rgba(113, 131, 102, 0.15); /* Muted green glow */
    --card-bg: rgba(13, 13, 13, 0.7);
    --text-main: #efefef;
    --text-dim: #999999;
    --progress-bar-bg: rgba(255, 255, 255, 0.08);
    --progress-fill: #718366;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-drag: none;
}

body {
    background-color: #030303;
    /* Ultra-subtle Grid */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    background-attachment: fixed;
    position: relative;
    
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
}

/* Background effects for the 'Spotlight' aesthetic */
body::before, body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

/* 1. Large Top-Centered Spotlight (Matches the screenshot) */
body::before {
    background: radial-gradient(
        circle at 50% -20%, 
        rgba(255, 255, 255, 0.04) 0%, 
        rgba(255, 255, 255, 0.01) 40%, 
        transparent 80%
    );
}

/* 2. Fine Grain for smoother blending */
body::after {
    opacity: 0.15;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.player-card {
    position: relative;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.4) 0%, rgba(10, 10, 10, 0.6) 100%);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 40px;
    padding: 56px 48px;
    width: 100%;
    max-width: 680px;
    overflow: hidden;
    box-shadow: 
        0 40px 100px rgba(0, 0, 0, 0.9),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05); /* Extra crisp edge */
    
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    animation: reveal 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes reveal {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.player-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    /* Transform and shadow are now handled in JS for smooth 3D tilt */
}

.card-backdrop {
    position: absolute;
    inset: -30%; /* Larger bleed for better blur coverage */
    background-size: cover;
    background-position: center;
    filter: blur(70px) brightness(0.8) saturate(2); /* Brighter and more saturated */
    opacity: 0.6; /* Much more visible */
    z-index: 0;
    transition: background-image 1.2s ease;
    pointer-events: none;
}

.content {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 40px;
    align-items: center;
}

.top-left-brand {
    position: fixed;
    top: 40px;
    left: 40px;
    z-index: 1000;
}

.spotify-logo {
    width: 32px;
    height: 32px;
    color: var(--text-main);
    opacity: 0.5;
    transition: all 0.4s ease;
}

.spotify-logo:hover {
    opacity: 1;
    transform: scale(1.1);
}

.album-art-wrapper {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    border-radius: 20px;
    overflow: hidden;
    background: #1a1a1a;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    cursor: default;
}

.album-art-wrapper:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

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

.album-art-wrapper img.hidden {
    display: none;
}

.album-placeholder {
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
}

.album-placeholder.visible {
    display: flex;
}

.album-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

.track-info {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.track-title {
    font-size: 32px;
    line-height: 1.3;
    font-weight: 700;
    margin-top: -6px; /* Shifted slightly up */
    margin-bottom: 2px;
    padding-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Outfit', sans-serif;
    color: #ffffff;
    letter-spacing: -0.02em;
    transition: all 0.3s ease;
    cursor: default;
}

.track-title:hover {
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.track-metadata {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 24px;
    font-weight: 400;
    letter-spacing: 0.01em;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    cursor: default;
}

.track-metadata:hover {
    color: #fff;
    transform: translateX(4px);
}

.progress-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.time-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    min-width: 44px;
    font-family: 'JetBrains Mono', monospace;
}

.progress-bar-container {
    flex-grow: 1;
    height: 4px; /* Slightly thinner for a 'flatter' look */
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--accent-color, #718366); /* Dynamic color with fallback */
    width: 0%;
    border-radius: 0; /* Totally flat edges */
    transition: background-color 1s ease; /* Smooth color transition */
}

@media (max-width: 650px) {
    .container {
        padding: 20px;
    }
    
    .player-card {
        padding: 40px 24px;
        max-width: 100%;
        border-radius: 32px;
    }
    
    .content {
        flex-direction: column;
        text-align: center;
        gap: 32px;
    }
    
    .album-art-wrapper {
        width: 200px;
        height: 200px;
    }
    
    .track-info {
        width: 100%;
    }
    
    .track-title {
        font-size: 28px;
        white-space: normal; /* Allow wrap on mobile */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        margin-top: 0;
    }
    
    .progress-section {
        margin-top: 10px;
        gap: 12px;
    }
    
    .top-left-brand {
        top: 24px;
        left: 24px;
    }
    
    .spotify-logo {
        width: 24px;
        height: 24px;
    }
}
