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

body {
  background: #07070f;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0c0c18; }
::-webkit-scrollbar-thumb { background: #2a2a50; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #06d4b4; }

@keyframes eqBar {
  0%, 100% { height: 4px; }
  50% { height: 18px; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(6, 212, 180, 0); }
  50% { box-shadow: 0 0 12px 2px rgba(6, 212, 180, 0.3); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.eq-bar {
  width: 3px;
  background: #06d4b4;
  border-radius: 2px;
  animation: eqBar 0.6s ease-in-out infinite;
}

.eq-bar:nth-child(2) { animation-delay: 0.1s; }
.eq-bar:nth-child(3) { animation-delay: 0.2s; }
.eq-bar:nth-child(4) { animation-delay: 0.3s; }
.eq-bar:nth-child(5) { animation-delay: 0.15s; }

.track-active {
  animation: pulseGlow 1.5s ease-in-out infinite;
}

.glass {
  background: rgba(22, 22, 45, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: #06d4b4;
  box-shadow: 0 0 20px rgba(6, 212, 180, 0.15);
  background: rgba(6, 212, 180, 0.03);
}

.progress-bar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: visible;
  cursor: pointer;
  position: relative;
}

.progress-bar-fill {
  background: linear-gradient(90deg, #06d4b4, #a855f7);
  height: 100%;
  border-radius: 999px;
  transition: width 0.1s linear;
  pointer-events: none;
}

.loop-region-overlay {
  position: absolute;
  top: -2px;
  bottom: -2px;
  background: rgba(168, 85, 247, 0.2);
  border-left: 2px solid #22c55e;
  border-right: 2px solid #ef4444;
  pointer-events: none;
  border-radius: 2px;
}

.loop-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 22px;
  border-radius: 4px;
  cursor: ew-resize;
  z-index: 10;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
  border: 2px solid transparent;
}

.loop-handle:hover, .loop-handle.dragging {
  transform: translate(-50%, -50%) scaleY(1.2);
}

.loop-handle-start {
  background: #22c55e;
  border-color: #16a34a;
}

.loop-handle-start:hover, .loop-handle-start.dragging {
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
}

.loop-handle-end {
  background: #ef4444;
  border-color: #dc2626;
}

.loop-handle-end:hover, .loop-handle-end.dragging {
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
  background: rgba(255, 255, 255, 0.1);
  height: 4px;
  border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #06d4b4;
  margin-top: -5px;
  box-shadow: 0 0 8px rgba(6, 212, 180, 0.4);
}

input[type="range"]::-moz-range-track {
  background: rgba(255, 255, 255, 0.1);
  height: 4px;
  border-radius: 2px;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #06d4b4;
  border: none;
  box-shadow: 0 0 8px rgba(6, 212, 180, 0.4);
}

.btn-transport {
  transition: all 0.2s ease;
}

.btn-transport:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
}

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

.toast {
  animation: slideInUp 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

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

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

.viz-canvas-container canvas {
  image-rendering: pixelated;
}

.loop-preset-pill {
  background: rgba(22, 22, 45, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid #a855f7;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.loop-preset-pill:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.3);
}

.loop-preset-pill.active {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.2);
}

.loop-time-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 4px 8px;
  width: 80px;
  text-align: center;
  transition: border-color 0.2s;
}

.loop-time-input:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.2);
}

.loop-counter-badge {
  background: rgba(168, 85, 247, 0.3);
  color: #c084fc;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
  position: absolute;
  top: -6px;
  right: -8px;
  font-family: 'JetBrains Mono', monospace;
  min-width: 20px;
  text-align: center;
}