/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

body {
    font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
    background: #1a1030;
    color: #f0e8ff;
}

/* ===== Screens ===== */
.screen { display: none; width: 100%; height: 100%; position: fixed; inset: 0; }
.screen.active { display: flex; }

/* ===== Picker Screen ===== */
#picker-screen {
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem;
    overflow-y: auto;
    background: linear-gradient(160deg, #2a1848 0%, #1a1040 40%, #1c1848 100%);
}

/* Floating pastel blobs in background */
#picker-screen::before,
#picker-screen::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.25;
    pointer-events: none;
    z-index: 0;
}
#picker-screen::before {
    width: 400px; height: 400px;
    background: #ff9fcf;
    top: -100px; left: -100px;
    animation: floatBlob 12s ease-in-out infinite;
}
#picker-screen::after {
    width: 350px; height: 350px;
    background: #9fdfff;
    bottom: -80px; right: -80px;
    animation: floatBlob 15s ease-in-out infinite reverse;
}
@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 20px); }
}

.picker-header { text-align: center; margin-bottom: 2rem; position: relative; z-index: 1; }

.logo {
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    background: linear-gradient(135deg, #ffb3d9, #b3d4ff, #c9b3ff, #ffb3e6);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s ease-in-out infinite;
}
@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.logo-emoji {
    font-size: 2.2rem;
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
    -webkit-text-fill-color: initial;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.tagline {
    font-size: 0.95rem;
    letter-spacing: 0.15em;
    color: #c0aae0;
    margin-top: 0.3rem;
    font-weight: 600;
}

/* ===== Scene Cards ===== */
.scenes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.4rem;
    width: 100%;
    max-width: 1000px;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.scene-card {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16 / 10;
    transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), box-shadow 0.3s;
    border: 2.5px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
}
.scene-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(180,120,255,0.2);
    border-color: rgba(255,180,220,0.3);
}
.scene-card:active {
    transform: translateY(-2px) scale(0.98);
}

.scene-card canvas.preview {
    width: 100%;
    height: 100%;
    display: block;
}

.scene-card .card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.9rem 1.2rem;
    background: linear-gradient(transparent, rgba(20,10,40,0.9));
}
.scene-card .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #fff;
}
.scene-card .card-emoji {
    margin-right: 0.3rem;
}
.scene-card .card-desc {
    font-size: 0.75rem;
    color: #c8b8e8;
    margin-top: 0.1rem;
    font-weight: 600;
}

/* ===== Import Area ===== */
.import-area {
    text-align: center;
    margin-top: auto;
    padding-top: 1.5rem;
    position: relative;
    z-index: 1;
}
.btn-subtle {
    background: rgba(255,180,220,0.1);
    border: 2px dashed rgba(255,180,220,0.25);
    color: #e0c0f0;
    padding: 0.7rem 1.6rem;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.25s;
}
.btn-subtle:hover {
    background: rgba(255,180,220,0.18);
    border-color: rgba(255,180,220,0.4);
    transform: scale(1.04);
}
.hint { font-size: 0.72rem; color: #8070a0; margin-top: 0.5rem; font-weight: 600; }
.hint code { color: #ffb3d9; background: rgba(255,180,220,0.1); padding: 0.1em 0.4em; border-radius: 4px; }

/* ===== Player Screen ===== */
#player-screen {
    flex-direction: column;
    background: #0a0818;
}

#scene-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.player-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.4rem;
    background: rgba(30,15,50,0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1.5px solid rgba(255,180,220,0.12);
    transition: opacity 0.5s;
    z-index: 10;
}
#player-screen:not(.controls-visible) .player-overlay {
    opacity: 0;
    pointer-events: none;
}
#player-screen.controls-visible .player-overlay {
    opacity: 1;
}

.btn-icon {
    background: rgba(255,180,220,0.12);
    border: 1.5px solid rgba(255,180,220,0.2);
    color: #f0e0ff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    flex-shrink: 0;
    font-family: inherit;
    font-weight: 700;
}
.btn-icon:hover {
    background: rgba(255,180,220,0.22);
    transform: scale(1.1);
}

.player-info {
    flex: 1;
    min-width: 0;
}
.scene-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}
.song-title {
    display: block;
    font-size: 0.72rem;
    color: #b0a0c8;
    font-weight: 600;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.volume-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.volume-wrap .icon { font-size: 0.9rem; }
#volume-slider {
    width: 80px;
    accent-color: #ffb3d9;
}

/* ===== Drag-over feedback ===== */
body.drag-over::after {
    content: 'Drop your song here!';
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30,15,50,0.9);
    color: #ffb3d9;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    z-index: 100;
    pointer-events: none;
    border: 3px dashed rgba(255,180,220,0.4);
    margin: 1rem;
    border-radius: 24px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,180,220,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,180,220,0.25); }
