* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a0f;
  min-height: 100vh;
  color: #fff;
  background-image: 
    radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
}

.header-gradient {
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #f59e0b 100%);
  box-shadow: 0 4px 30px rgba(236, 72, 153, 0.3);
}

.beat-cell {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.beat-cell:hover {
  transform: scale(1.15) !important;
  border-color: rgba(255, 255, 255, 0.3);
}

.beat-cell.active {
  animation: pulse-glow 0.5s ease-out;
}

.beat-cell.current::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.3);
  animation: beat-flash 0.1s ease-out;
}

@keyframes pulse-glow {
  0% {
    transform: scale(1.3);
    filter: brightness(1.5);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes beat-flash {
  0% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
  }
}

.play-button {
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.4);
  animation: button-breathe 2s ease-in-out infinite;
}

.play-button:hover {
  animation: none;
}

@keyframes button-breathe {
  0%, 100% {
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
  }
  50% {
    box-shadow: 0 0 50px rgba(34, 197, 94, 0.6);
  }
}

textarea {
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.6;
}

textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

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

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: currentColor;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px currentColor;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: currentColor;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px currentColor;
}

select {
  cursor: pointer;
}

select option {
  background: #1f2937;
  color: #fff;
}

/* Disco mode easter egg */
.disco-mode {
  animation: disco-bg 0.5s linear infinite;
}

.disco-mode .beat-cell.active {
  animation: disco-cell 0.3s linear infinite;
}

@keyframes disco-bg {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

@keyframes disco-cell {
  0% { filter: hue-rotate(0deg) brightness(1.2); }
  50% { filter: hue-rotate(180deg) brightness(1.5); }
  100% { filter: hue-rotate(360deg) brightness(1.2); }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .beat-cell {
    min-width: 24px;
    min-height: 24px;
  }
  
  .play-button {
    animation: none;
  }
}

/* Focus states for accessibility */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #06b6d4;
  outline-offset: 2px;
}