:root {
    --bg-deep: #0d0d1a;
    --bg-card: rgba(26, 26, 46, 0.72);
    --purple: #7b2ff7;
    --pink: #ff2e97;
    --cyan: #00f5d4;
    --ig: linear-gradient(135deg, #feda75 0%, #fa7e1e 25%, #d62976 50%, #962fbf 75%, #4f5bd5 100%);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background: var(--bg-deep); color: #e0e0f0;
    font-family: 'Bricolage Grotesque', sans-serif;
    min-height: 100vh; overflow-x: hidden;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
body.page-zoom { transform: scale(1.35); transform-origin: 50% 20%; }
body::before {
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(123,47,247,0.09) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(214,41,118,0.09) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 85%, rgba(250,126,30,0.05) 0%, transparent 50%);
}
#root { position: relative; z-index: 1; }
button:disabled { cursor: not-allowed; }
button { cursor: pointer; }
.font-mono { font-family: 'JetBrains Mono', monospace !important; }

.glass {
    background: var(--bg-card);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(123,47,247,0.2); border-radius: 16px;
}
.neon-glow { box-shadow: 0 0 20px rgba(123,47,247,0.4), 0 0 60px rgba(123,47,247,0.1); }
.neon-glow-pink { box-shadow: 0 0 20px rgba(255,46,151,0.45), 0 0 60px rgba(255,46,151,0.12); }
.neon-glow-cyan { box-shadow: 0 0 15px rgba(0,245,212,0.3), 0 0 40px rgba(0,245,212,0.1); }

.studio-badge {
    background: var(--ig); color: #fff; border: none;
    font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 12px;
    letter-spacing: 0.2em; padding: 6px 12px; border-radius: 999px;
    box-shadow: 0 0 20px rgba(214,41,118,0.5);
    transition: transform 0.15s;
}
.studio-badge:active { transform: scale(0.9); }
.ig-text { background: var(--ig); -webkit-background-clip: text; background-clip: text; color: transparent; }

.drop-zone { border: 2px dashed rgba(123,47,247,0.5); transition: all 0.3s ease; position: relative; overflow: hidden; }
.drop-zone:hover, .drop-zone.drag-over { border-color: #ff5fa2; box-shadow: 0 0 30px rgba(255,95,162,0.25); }
.piano-drop {
    background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0 28px, rgba(0,0,0,0.25) 28px 30px);
}

.glitch-title { text-shadow: 2px 0 var(--pink), -2px 0 var(--cyan); animation: glitch 3s infinite; }
.glitch-title:hover { animation-duration: 0.4s; }
@keyframes glitch {
    0%, 90%, 100% { text-shadow: 2px 0 var(--pink), -2px 0 var(--cyan); }
    92% { text-shadow: -3px 1px var(--pink), 3px -1px var(--cyan); }
    94% { text-shadow: 3px -2px var(--pink), -3px 2px var(--cyan); }
    96% { text-shadow: -1px 3px var(--pink), 1px -3px var(--cyan); }
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(214,41,118,0.4), 0 0 60px rgba(150,47,191,0.15); transform: scale(1); }
    50% { box-shadow: 0 0 35px rgba(214,41,118,0.7), 0 0 90px rgba(250,126,30,0.25); transform: scale(1.03); }
}
.pulse-btn { animation: pulse-glow 2s ease-in-out infinite; }

.progress-step { transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.clip-thumb { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.clip-thumb:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(123,47,247,0.3); }
.focus-dot {
    position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px;
    border-radius: 50%; border: 2px solid #fff; background: #ff5fa2;
    box-shadow: 0 0 10px #ff5fa2; pointer-events: none;
}
.focus-dot.big { width: 26px; height: 26px; margin: -13px 0 0 -13px; background: rgba(255,95,162,0.4); animation: pulse-dot 1s infinite; }
@keyframes pulse-dot { 50% { transform: scale(1.3); } }

.preset-card { padding: 8px; border-radius: 14px; border: 2px solid; transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1); }
.preset-card:hover { transform: scale(1.06); }

.crt-frame {
    border-radius: 28px; overflow: hidden;
    border: 3px solid transparent;
    background: linear-gradient(#000,#000) padding-box, var(--ig) border-box;
    box-shadow: 0 0 40px rgba(214,41,118,0.35), inset 0 0 40px rgba(0,0,0,0.8);
    max-width: 420px; margin: 0 auto;
}
.player canvas { border-radius: 14px; }
.player:fullscreen { display: flex; flex-direction: column; justify-content: center; background: #000; }
.player:fullscreen canvas { height: 85vh !important; width: auto !important; }

.hearts-bg { position: absolute; inset: -20px; overflow: hidden; pointer-events: none; z-index: 0; }
.hearts-bg span { position: absolute; bottom: -40px; opacity: 0; animation: heart-rise 8s linear infinite; }
@keyframes heart-rise {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    15% { opacity: 0.35; }
    100% { transform: translateY(-110vh) scale(1.2) rotate(20deg); opacity: 0; }
}

.mini-select {
    background: #0d0d1a; color: #ddd; border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px; font-family: 'JetBrains Mono', monospace; font-size: 10px;
    padding: 2px 3px; flex: 1; min-width: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin 1s linear infinite; }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-slide-in { animation: fadeSlideIn 0.5s ease-out forwards; }
.toast-enter { animation: fadeSlideIn 0.3s ease-out; }

@keyframes confetti-fall {
    0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
.confetti-piece {
    position: fixed; top: 0; width: 10px; height: 10px; z-index: 9999;
    pointer-events: none; animation: confetti-fall 3.2s ease-in forwards;
}

.piano-roll-container { overflow-x: auto; }
.piano-roll-container::-webkit-scrollbar, .timeline-container::-webkit-scrollbar, .clip-strip::-webkit-scrollbar { height: 7px; }
.piano-roll-container::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 4px; }
.timeline-container::-webkit-scrollbar-thumb, .clip-strip::-webkit-scrollbar-thumb { background: #d62976; border-radius: 3px; }

@media (max-width: 768px) {
    .glitch-title { font-size: 2rem !important; }
    .clip-strip { display: grid !important; grid-template-columns: 1fr 1fr; overflow: visible; }
    .clip-strip .clip-thumb { width: 100% !important; }
}