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

:root {
  --cyan: #00ffff;
  --magenta: #ff00ff;
  --lime: #39ff14;
  --hotpink: #ff2d7b;
  --yellow: #ffe600;
  --purple: #b44dff;
  --red: #ff2244;
  --bg: #0a0a0a;
  --bg-light: #111111;
  --border: #222;
}

body {
  background: var(--bg);
  color: #ccc;
  font-family: 'Share Tech Mono', monospace;
  overflow-x: hidden;
  min-height: 100vh;
}

#scanlines {
  pointer-events: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
}

.font-orbitron {
  font-family: 'Orbitron', sans-serif;
}

.font-mono {
  font-family: 'Share Tech Mono', monospace;
}

/* Glitch title */
@keyframes glitch1 {
  0%, 100% { clip-path: inset(0 0 95% 0); transform: translate(-2px, 0); }
  20% { clip-path: inset(30% 0 40% 0); transform: translate(2px, 0); }
  40% { clip-path: inset(60% 0 10% 0); transform: translate(-1px, 0); }
  60% { clip-path: inset(10% 0 70% 0); transform: translate(3px, 0); }
  80% { clip-path: inset(80% 0 5% 0); transform: translate(-3px, 0); }
}

@keyframes glitch2 {
  0%, 100% { clip-path: inset(90% 0 0 0); transform: translate(2px, 0); }
  25% { clip-path: inset(20% 0 50% 0); transform: translate(-3px, 0); }
  50% { clip-path: inset(50% 0 20% 0); transform: translate(1px, 0); }
  75% { clip-path: inset(5% 0 80% 0); transform: translate(-2px, 0); }
}

.glitch-title {
  position: relative;
  display: inline-block;
}

.glitch-title::before,
.glitch-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

.glitch-title::before {
  color: var(--cyan);
  animation: glitch1 3s infinite linear alternate-reverse;
  z-index: -1;
}

.glitch-title::after {
  color: var(--hotpink);
  animation: glitch2 2s infinite linear alternate-reverse;
  z-index: -1;
}

/* Pulsing play button */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px var(--lime), 0 0 15px var(--lime); }
  50% { box-shadow: 0 0 15px var(--lime), 0 0 40px var(--lime), 0 0 60px var(--lime); }
}

.pulse-playing {
  animation: pulse-glow 0.8s infinite ease-in-out;
}

/* Playhead */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.playhead-active {
  animation: flicker 0.15s infinite;
}

/* Grid cell hover */
.grid-cell {
  transition: all 0.05s ease;
  cursor: pointer;
  border: 1px solid #1a1a1a;
}

.grid-cell:hover {
  filter: brightness(1.5);
  transform: scale(1.05);
  z-index: 2;
}

/* Knob/slider styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  height: 20px;
}

input[type="range"]::-webkit-slider-track {
  height: 4px;
  background: #333;
  border: 1px solid #444;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--cyan);
  border: none;
  margin-top: -5px;
  box-shadow: 0 0 6px var(--cyan);
}

input[type="range"]::-moz-range-track {
  height: 4px;
  background: #333;
  border: 1px solid #444;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--cyan);
  border: none;
  border-radius: 0;
  box-shadow: 0 0 6px var(--cyan);
}

/* Neon button */
.neon-btn {
  border: 1px solid;
  background: transparent;
  padding: 6px 14px;
  font-family: 'Share Tech Mono', monospace;
  cursor: pointer;
  transition: all 0.1s;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
}

.neon-btn:hover {
  filter: brightness(1.3);
  box-shadow: 0 0 10px currentColor;
}

.neon-btn:active {
  transform: scale(0.95);
}

/* Preset buttons */
.preset-btn {
  background: #151515;
  border: 1px solid #333;
  color: #888;
  padding: 4px 10px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.1s;
}

.preset-btn:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(0,255,255,0.2);
}

.preset-btn.active {
  color: var(--lime);
  border-color: var(--lime);
  box-shadow: 0 0 8px rgba(57,255,20,0.3);
}

/* Visualizer canvas */
#visualizer {
  image-rendering: pixelated;
}

/* Modifier badge */
.mod-badge {
  font-size: 7px;
  line-height: 1;
  position: absolute;
  bottom: 1px;
  right: 1px;
  color: #fff;
  text-shadow: 0 0 3px #000;
  pointer-events: none;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #111;
}
::-webkit-scrollbar-thumb {
  background: #333;
}
::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .grid-cell {
    min-width: 18px !important;
    min-height: 18px !important;
  }
}