:root {
    --neon-pink: #ff007f;
    --neon-blue: #00f2ff;
    --neon-green: #39ff14;
    --neon-purple: #bc13fe;
    --bg-dark: #020205;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    display: flex;
    height: 100vh;
}

#main-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    background: linear-gradient(45deg, #050510, #1a0020, #001020);
    background-size: 400% 400%;
    animation: menu-bg-flow 15s ease infinite;
}

@keyframes menu-bg-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#side-panel {
    width: 450px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(40px);
    border-right: 1px solid var(--glass-border);
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 100;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 20px 0 50px rgba(0,0,0,0.5);
}

#game-view {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 64px;
    font-weight: 900;
    margin: 0;
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-pink));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(0, 242, 255, 0.4);
    letter-spacing: -3px;
    line-height: 0.9;
}

.subtitle {
    font-size: 14px;
    opacity: 0.5;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 10px;
    margin-bottom: 50px;
}

.input-group {
    margin-bottom: 35px;
}

label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--neon-blue);
    margin-bottom: 12px;
}

input[type="file"] {
    width: 100%;
    padding: 18px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: #fff;
    cursor: pointer;
    transition: 0.4s;
}

input[type="file"]:hover {
    border-color: var(--neon-blue);
    background: rgba(0, 242, 255, 0.08);
}

.difficulty-selector {
    display: flex;
    gap: 12px;
}

.diff-btn {
    flex: 1;
    padding: 14px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: #fff;
    font-family: 'Orbitron';
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    letter-spacing: 1px;
}

.diff-btn.active {
    border-color: var(--neon-pink);
    background: rgba(255, 0, 127, 0.2);
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.4);
}

#start-btn {
    margin-top: 30px;
    padding: 24px;
    width: 100%;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    border: none;
    border-radius: 16px;
    color: #fff;
    font-family: 'Orbitron';
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.5s;
    text-transform: uppercase;
    letter-spacing: 3px;
}

#start-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.secondary-btn {
    flex: 1;
    padding: 14px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: #fff;
    font-family: 'Orbitron';
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    letter-spacing: 1px;
}

.secondary-btn:hover {
    border-color: var(--neon-blue);
    background: rgba(0, 242, 255, 0.1);
}

/* --- ALBUM HEADER --- */
.album-header {
    display: flex;
    gap: 14px;
    align-items: center;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
}

.album-cover {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.album-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.album-title {
    font-family: 'Orbitron';
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-artist {
    font-size: 11px;
    opacity: 0.6;
}

.album-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.genre-tag {
    font-family: 'Orbitron';
    font-size: 8px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 50px;
    border: 1px solid;
    letter-spacing: 0.5px;
}

/* --- TRACK LIST --- */
.track-list {
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-pink) transparent;
}

.track-list::-webkit-scrollbar { width: 3px; }
.track-list::-webkit-scrollbar-track { background: transparent; }
.track-list::-webkit-scrollbar-thumb { background: var(--neon-pink); border-radius: 3px; }

.track-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid transparent;
}

.track-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.track-row.active {
    background: rgba(0, 242, 255, 0.07);
    border-color: var(--neon-blue);
}

.track-num {
    font-family: 'Orbitron';
    font-size: 10px;
    font-weight: 900;
    min-width: 22px;
}

.track-name {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-bpm {
    font-family: 'Orbitron';
    font-size: 11px;
    font-weight: 700;
    opacity: 0.7;
    flex-shrink: 0;
}

.track-genre-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}

/* --- HUD & JUICE --- */
#hud {
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    padding: 0 60px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: 100;
}

.hud-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hud-center {
    display: flex;
    justify-content: center;
    position: relative;
    top: 50vh; /* Places PFC badge towards the bottom */
}

.stat-card {
    position: relative;
    background: rgba(5, 10, 20, 0.4);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 20px 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
}

#combo-container {
    animation: multiplier-pulse 0.5s infinite alternate;
}

@keyframes multiplier-pulse {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    100% {
        transform: scale(1.05);
        filter: brightness(1.3);
    }
}

#progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 10px;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-pink), var(--neon-blue));
    background-size: 200% 100%;
    width: 0%;
    box-shadow: 0 0 20px var(--neon-blue);
    transition: width 0.1s linear;
    animation: neon-flow 2s linear infinite;
}

@keyframes neon-flow {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 200% 0%;
    }
}

.multiplier-badge {
    position: absolute;
    top: -20px;
    right: -20px;
    background: var(--neon-pink);
    color: #fff;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 0 20px var(--neon-pink);
}

.stat-value {
    font-family: 'Orbitron';
    font-size: 52px;
    font-weight: 900;
    line-height: 1;
}

#end-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(50px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.grade {
    font-family: 'Orbitron';
    font-size: 180px;
    font-weight: 900;
    background: linear-gradient(var(--neon-blue), var(--neon-pink));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(0, 242, 255, 0.5));
}

/* --- PAUSE OVERLAY --- */

#pause-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 400;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pause-btn {
    width: 300px;
    margin: 10px;
    padding: 20px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: #fff;
    font-family: 'Orbitron';
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
}

.pause-btn:hover {
    border-color: var(--neon-pink);
    background: rgba(255, 0, 127, 0.1);
}

/* --- VIGNETTE --- */
#game-view::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.3s ease;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    filter: brightness(1.1) contrast(1.1);
}

.chromatic-aberration {
    animation: pulse-ca 0.2s ease-out;
}

@keyframes pulse-ca {
    0% {
        filter: contrast(1.2) drop-shadow(2px 0 0 rgba(255, 0, 0, 0.5)) drop-shadow(-2px 0 0 rgba(0, 0, 255, 0.5));
    }

    100% {
        filter: none;
    }
}

/* --- SETTINGS OVERLAY --- */
#settings-overlay, #tracks-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    z-index: 600;
    align-items: center;
    justify-content: center;
}

#settings-panel {
    background: rgba(5, 5, 16, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 50px;
    width: 480px;
    max-width: 90vw;
    box-shadow: 0 0 80px rgba(0, 242, 255, 0.1);
}

#tracks-panel {
    background: rgba(5, 5, 16, 0.97);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    width: 620px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 0 80px rgba(188, 19, 254, 0.15);
    scrollbar-width: thin;
    scrollbar-color: var(--neon-pink) transparent;
}

#tracks-panel::-webkit-scrollbar { width: 4px; }
#tracks-panel::-webkit-scrollbar-thumb { background: var(--neon-pink); border-radius: 4px; }

.settings-row {
    margin-bottom: 30px;
}

.settings-row label {
    color: var(--neon-blue);
    margin-bottom: 10px;
}