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

body {
    background-color: #000000;
    color: #e2ede5;
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Fullscreen Viewport wrapper */
.viewport {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Art Canvas */
#art-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block;
}

/* Floating Audio Player HUD */
.audio-hud {
    position: absolute;
    bottom: calc(40px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: calc(100% - 80px);
    max-width: 620px;
    
    background: rgba(4, 8, 5, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 
                inset 0 1px 0 rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(25px) saturate(110%);
    -webkit-backdrop-filter: blur(25px) saturate(110%);
    border-radius: 100px;
    padding: 10px 24px;
    
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.audio-hud:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    background: rgba(4, 8, 5, 0.55);
}

/* HUD Buttons */
.hud-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.hud-btn:hover {
    background: #ffffff;
    color: #030604;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    border-color: #ffffff;
}

.hud-btn:active {
    transform: scale(0.96);
}

/* HUD Text Block */
.hud-track-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.hud-title {
    font-family: 'Cinzel', serif;
    font-weight: 500;
    font-size: 1.05rem;
    letter-spacing: 1.5px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.hud-meta {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 400;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-separator {
    opacity: 0.25;
}

/* Timeline Progress Thread at the very bottom */
.timeline-container {
    position: absolute;
    bottom: env(safe-area-inset-bottom);
    left: 0;
    width: 100%;
    height: 12px; /* Taller hover area */
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
}

.timeline-track {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    transition: height 0.2s ease;
}

.timeline-container:hover .timeline-track {
    height: 6px;
}

.timeline-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.7));
    position: relative;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .audio-hud {
        bottom: calc(45px + env(safe-area-inset-bottom));
        left: 20px;
        right: 20px;
        width: auto;
        transform: none;
        padding: 8px 16px;
        gap: 12px;
        border-radius: 20px;
    }
    
    .hud-title {
        font-size: 0.92rem;
    }
    
    .hud-meta {
        font-size: 0.68rem;
    }
}

/* Ambient Background Glow Orbs (GPU Hardware-Accelerated) */
.glow-orb {
    position: absolute;
    width: min(50vw, 500px);
    height: min(50vw, 500px);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0; /* Sits behind art-canvas (z-index: 1) */
    filter: blur(140px);
    mix-blend-mode: screen;
    will-change: transform, opacity, left, top;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.glow-bass {
    background: radial-gradient(circle, hsla(125, 80%, 45%, 0.65) 0%, rgba(0,0,0,0) 70%);
}

.glow-mids {
    background: radial-gradient(circle, hsla(55, 95%, 50%, 0.65) 0%, rgba(0,0,0,0) 70%);
}

.glow-treble {
    background: radial-gradient(circle, hsla(0, 95%, 50%, 0.75) 0%, rgba(0,0,0,0) 70%);
}

/* Film Grain Overlay with Flickering Animation */
.film-grain {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    z-index: 999;
    pointer-events: none;
    opacity: 0.55; /* Visible but elegant, matching a 35mm film stock */
    animation: grain-flicker 0.15s steps(4) infinite;
}

@keyframes grain-flicker {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-0.5%, -0.5%); }
    20% { transform: translate(-1%, 0.5%); }
    30% { transform: translate(0.5%, -1%); }
    40% { transform: translate(-0.5%, 1.5%); }
    50% { transform: translate(-1%, 0.5%); }
    60% { transform: translate(1.5%, -0.5%); }
    70% { transform: translate(1%, 0.5%); }
    80% { transform: translate(-1.5%, -1%); }
    90% { transform: translate(0.5%, 1%); }
    100% { transform: translate(0, 0); }
}

