:root {
  --bg: #08080c;
  --panel: #12121a;
  --accent: #ff2ec4;
  --accent2: #2effe6;
  --accent3: #ffe600;
  --text: #f4f4ff;
  --dim: #8a8aa0;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255,46,196,0.10), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(46,255,230,0.10), transparent 45%);
}

/* ---------- GLITCH TEXT ---------- */
.glitch {
  position: relative;
  font-family: 'Bungee', cursive;
  letter-spacing: 1px;
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0;
  width: 100%; overflow: hidden;
}
.glitch::before { color: var(--accent2); animation: glitchA 2.4s infinite linear alternate; }
.glitch::after  { color: var(--accent);  animation: glitchB 3.1s infinite linear alternate; }
@keyframes glitchA {
  0%{clip-path:inset(0 0 85% 0);transform:translate(-2px,-1px);}
  25%{clip-path:inset(60% 0 10% 0);transform:translate(2px,1px);}
  50%{clip-path:inset(20% 0 55% 0);transform:translate(-1px,2px);}
  75%{clip-path:inset(80% 0 5% 0);transform:translate(1px,-1px);}
  100%{clip-path:inset(40% 0 40% 0);transform:translate(-2px,1px);}
}
@keyframes glitchB {
  0%{clip-path:inset(70% 0 10% 0);transform:translate(2px,1px);}
  30%{clip-path:inset(10% 0 75% 0);transform:translate(-2px,-1px);}
  60%{clip-path:inset(45% 0 30% 0);transform:translate(1px,2px);}
  100%{clip-path:inset(5% 0 85% 0);transform:translate(-1px,-2px);}
}

/* ---------- MOBILE BLOCKER ---------- */
#mobile-block {
  display: none;
  position: fixed; inset: 0;
  flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 14px;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.02) 0 2px, transparent 2px 4px),
    radial-gradient(circle at 50% 30%, #1a1130, #05050a 70%);
  z-index: 9999;
}
.mascot-wrap { animation: bob 2.2s ease-in-out infinite; }
.mascot {
  height: 170px; width: auto;
  filter: drop-shadow(0 0 18px rgba(46,255,230,0.4));
}
@keyframes bob { 0%,100%{transform:translateY(0) rotate(-3deg);} 50%{transform:translateY(-14px) rotate(3deg);} }
#mobile-block h1 { font-size: 2rem; margin-top: 8px; }
.block-msg { font-size: 1.05rem; line-height: 1.5; max-width: 340px; color: var(--text); }
.block-sub { font-size: .85rem; color: var(--dim); max-width: 320px; }

/* ---------- APP LAYOUT ---------- */
#app { display: none; flex-direction: column; min-height: 100vh; }

header { text-align: center; padding: 28px 16px 10px; }
.title { font-size: clamp(2rem, 6vw, 4rem); }
.subtitle { color: var(--dim); margin-top: 8px; font-size: .95rem; }

main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  padding: 20px clamp(16px, 4vw, 48px);
  align-items: start;
}
@media (max-width: 980px) {
  main { grid-template-columns: 1fr; }
}

/* ---------- STAGE ---------- */
.stage { min-width: 0; }
.drop-zone {
  border: 3px dashed var(--accent);
  border-radius: 16px;
  padding: 70px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: rgba(255,46,196,0.04);
}
.drop-zone:hover, .drop-zone.drag-over {
  background: rgba(46,255,230,0.08);
  border-color: var(--accent2);
  transform: scale(1.01);
}
.drop-big { font-size: 1.5rem; font-family: 'Bungee', cursive; }
.rgb {
  background: linear-gradient(90deg, #ff2ec4, #ffe600, #2effe6, #ff2ec4);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shift 2s linear infinite;
}
@keyframes shift { to { background-position: 300% 0; } }
.drop-small { color: var(--dim); margin-top: 12px; }

.player-wrap { display: flex; flex-direction: column; gap: 12px; }
#canvas {
  width: 100%; border-radius: 12px;
  background: #000;
  border: 2px solid #24243a;
  box-shadow: 0 0 40px rgba(255,46,196,0.15);
}
.transport {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.scrub { flex: 1; min-width: 120px; accent-color: var(--accent); }
.time { color: var(--dim); font-size: .8rem; }
.tbtn {
  background: #1c1c2a; color: var(--text);
  border: 2px solid #33334d; border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-family: inherit;
  font-weight: 700; transition: all .15s;
}
.tbtn:hover { border-color: var(--accent2); transform: translateY(-1px); }
.tbtn.rec { border-color: var(--accent); }
.tbtn.recording { background: var(--accent); color: #000; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.rec-status { font-size: .8rem; color: var(--accent2); }

/* ---------- PANEL ---------- */
.panel {
  background: var(--panel);
  border: 2px solid #22223a;
  border-radius: 16px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.panel-title {
  font-family: 'Bungee', cursive;
  font-size: .95rem;
  margin-top: 8px;
  color: var(--accent3);
  border-bottom: 1px solid #2a2a44;
  padding-bottom: 6px;
}
.fx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fx-btn {
  background: #1a1a28; color: var(--text);
  border: 2px solid #30304a; border-radius: 8px;
  padding: 9px 6px; cursor: pointer; font-family: inherit;
  font-size: .78rem; font-weight: 700; transition: all .15s;
}
.fx-btn:hover { border-color: var(--accent2); transform: translateY(-1px); }
.fx-btn.active {
  background: var(--accent); color: #000; border-color: var(--accent);
  box-shadow: 0 0 12px rgba(255,46,196,0.5);
}
.fx-btn.sfx:active { transform: scale(0.94); background: var(--accent3); color:#000; }

.slider-row { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; }
.slider-row label { display: flex; justify-content: space-between; color: var(--dim); }
.slider-row label span { color: var(--accent2); font-weight: 700; }
.slider-row input[type=range] { accent-color: var(--accent); width: 100%; }

.big-btn {
  background: linear-gradient(90deg, var(--accent), var(--accent3));
  color: #000; border: none; border-radius: 10px;
  padding: 12px; cursor: pointer; font-family: 'Bungee', cursive;
  font-size: .9rem; transition: transform .12s;
}
.big-btn:hover { transform: scale(1.03) rotate(-0.5deg); }
.big-btn.ghost {
  background: transparent; color: var(--dim);
  border: 2px solid #33334d; font-family: 'JetBrains Mono', monospace; font-weight: 700;
}
.big-btn.ghost:hover { color: var(--text); border-color: var(--accent2); transform: none; }

/* ---------- FOOTER ---------- */
footer {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-top: 1px solid #1e1e30;
  font-size: .8rem; color: var(--dim);
}
.remix-link {
  color: var(--accent2); text-decoration: none;
  border: 1px solid var(--accent2); border-radius: 6px;
  padding: 5px 12px; font-weight: 700; transition: all .15s;
}
.remix-link:hover { background: var(--accent2); color: #000; }

.hidden { display: none !important; }