:root {
    --bg-color: #0A0A0A;
    --glass-bg: rgba(20, 20, 20, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0A0;
    --accent: #E53E3E;
    --accent-hover: #FC8181;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Dynamic Animated Background */
.background-blobs {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    width: 40vw; height: 40vw;
    background: radial-gradient(circle, #550000, #ff0040);
    top: -10%; left: -10%;
    animation-duration: 25s;
}

.blob-2 {
    width: 35vw; height: 35vw;
    background: radial-gradient(circle, #2d004d, #8000ff);
    bottom: -10%; right: -5%;
    animation-delay: -5s;
}

.blob-3 {
    width: 25vw; height: 25vw;
    background: radial-gradient(circle, #001a4d, #0055ff);
    bottom: 20%; left: 30%;
    animation-duration: 30s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(10vw, -10vh) scale(1.1); }
    100% { transform: translate(-5vw, 15vh) scale(0.9); }
}

.glass-panel {
    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 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.8s ease-out;
}

.layout-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 30px;
    width: 95%;
    max-width: 900px;
}

/* Quiz Card Container */
.quiz-card {
    padding: 40px;
    flex: 2;
    text-align: center;
}

@media (max-width: 768px) {
    .layout-wrapper {
        flex-direction: column;
        align-items: center;
    }
    .quiz-card, .scoreboard {
        width: 100%;
    }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

header h1 {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 3rem;
    letter-spacing: -1px;
    margin-bottom: 5px;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 15px;
}

}

.hud-streak {
    display: inline-block;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    text-transform: uppercase;
}

/* Controls */
.audio-controls {
    margin: 30px 0;
}

.primary-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 20px -5px rgba(229, 62, 62, 0.4);
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 15px 25px -5px rgba(252, 129, 129, 0.5);
}

.primary-btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
}

.primary-btn:disabled {
    background: rgba(229, 62, 62, 0.4);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    opacity: 0.7;
}

.primary-btn.playing {
    background: #48bb78;
    box-shadow: 0 10px 20px -5px rgba(72, 187, 120, 0.4);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(72, 187, 120, 0); }
    100% { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0); }
}

/* Answer Section & Autocomplete */
.answer-section {
    position: relative;
    margin-bottom: 25px;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.song-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-family: var(--font-body);
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

.song-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.2);
}

.song-input.ghost {
    position: absolute;
    top: 0; left: 0;
    color: var(--text-secondary);
    background: transparent;
    pointer-events: none;
    z-index: 1;
}

.song-input.actual {
    position: relative;
    z-index: 2;
    background: transparent;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: left;
}

.autocomplete-dropdown.hidden {
    display: none;
}

.dropdown-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
    display: flex;
    align-items: center;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item.selected {
    background: rgba(255, 255, 255, 0.15);
}

.dropdown-title {
    font-size: 1.05rem;
    color: var(--text-primary);
    display: block;
}

.dropdown-album {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

/* Cover Image */
.cover-wrapper {
    margin: 0 auto 20px auto;
    width: 200px;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    background: rgba(0,0,0,0.3);
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 1s ease, opacity 0.5s ease;
}

.cover-image.hidden {
    opacity: 0;
}

.cover-image.blurred {
    filter: blur(20px);
    transform: scale(1.1); /* Prevent blurred edges from shrinking inwards */
}

/* Feedback */
.feedback {
    margin-top: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    min-height: 24px;
    transition: all 0.3s;
}

.feedback.success { color: #48bb78; }
.feedback.error { color: #f56565; }

/* Scoreboard */
.scoreboard {
    flex: 1;
    padding: 30px 20px;
    min-width: 250px;
    text-align: left;
}

.scoreboard h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #ddd;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

.score-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 1rem;
    opacity: 0;
    transform: translateX(20px);
    animation: slideInRow 0.5s ease forwards;
}

@keyframes slideInRow {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.score-row:nth-child(1) { animation-delay: 0.05s; }
.score-row:nth-child(2) { animation-delay: 0.10s; }
.score-row:nth-child(3) { animation-delay: 0.15s; }
.score-row:nth-child(4) { animation-delay: 0.20s; }
.score-row:nth-child(5) { animation-delay: 0.25s; }
.score-row:nth-child(6) { animation-delay: 0.30s; }
.score-row:nth-child(7) { animation-delay: 0.35s; }
.score-row:nth-child(8) { animation-delay: 0.40s; }
.score-row:nth-child(9) { animation-delay: 0.45s; }
.score-row:nth-child(10) { animation-delay: 0.50s; }

.score-name { font-weight: 600; color: #fff; }
.score-value { color: var(--accent); font-weight: 700; }

.secondary-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 50px;
    padding: 10px 20px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 1rem;
    transition: all 0.3s;
}

.secondary-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.modal-content {
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.hidden { display: none !important; }
