/* ============================================
   Neon Sprites — Sprunki-inspired Music Toy
   Vibrant dark theme with neon
   ============================================ */

:root {
  --neon-cyan: #67f6ff;
  --neon-magenta: #ff67e8;
  --neon-lime: #c2ff6b;
  --neon-violet: #a78bff;
  --bg-deep: #0b0718;
  --stage-bg: #110c22;
  --card-bg: #1a1433;
}

/* Base */
body {
  font-feature-settings: "ss01", "ss02";
  overscroll-behavior: none;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
}

#search-input {
  font-size: 16px !important;
  min-height: 44px;
}

#tempo-slider {
  height: 44px;
}

/* Custom Scrollbar */
.custom-scroll::-webkit-scrollbar {
  width: 6px;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.3);
}

/* Stage */
.stage {
  background: 
    linear-gradient(145deg, #110c22 0%, #1a1433 100%),
    radial-gradient(circle at 30% 20%, rgba(103, 246, 255, 0.06) 0%, transparent 50%);
  box-shadow: inset 0 0 80px rgba(0,0,0,0.6);
  transition: background 400ms ease, box-shadow 400ms ease;
}

.stage-bg {
  background-image: 
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.stage-glow {
  background: radial-gradient(circle at 50% 40%, rgba(167, 139, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
  transition: opacity 300ms ease;
}

/* Character Cards (Library) */
.char-card {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.15s cubic-bezier(0.23, 1, 0.32, 1);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.char-card {
  min-height: 88px;
  touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine) {
  .char-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.4);
  }
}

.char-card:active {
  transform: scale(0.96);
}

.char-card .emoji {
  font-size: 2.25rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.char-card:hover .emoji {
  transform: scale(1.1) rotate(2deg);
}

.char-card .role-pill {
  font-size: 9px;
  letter-spacing: 0.5px;
  padding: 1px 7px;
  border-radius: 9999px;
  background: rgba(255,255,255,0.08);
}

/* Active Stage Avatars */
.stage-avatar {
  background: #1f183d;
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 8px 25px -5px rgb(0 0 0 / 0.3);
  position: relative;
}

.stage-avatar.playing {
  animation: avatar-dance 480ms infinite ease-in-out;
  border-color: var(--accent, #67f6ff);
  box-shadow: 0 0 0 1px var(--accent, #67f6ff),
              0 0 30px -4px var(--accent, #67f6ff);
}

.stage-avatar.playing .emoji {
  animation: emoji-bob 480ms infinite ease-in-out;
}

@keyframes avatar-dance {
  0%, 100% { transform: translateY(0) rotate(-0.8deg); }
  50% { transform: translateY(-7px) rotate(0.8deg); }
}

@keyframes emoji-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Buttons & Sliders */
button {
  transition: transform 80ms ease, background-color 120ms ease, border-color 120ms ease;
}

button:active {
  transform: scale(0.965);
}

/* Tempo Slider */
#tempo-slider {
  accent-color: #67f6ff;
}

/* Saved Mix Chips */
.stage-actions {
  display: flex;
  gap: 6px;
  width: 100%;
}

.stage-btn {
  flex: 1;
  min-height: 44px;
  font-size: 16px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  touch-action: manipulation;
}

.stage-btn.is-muted {
  background: rgba(244, 63, 94, 0.75);
}

.saved-mix {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 16px;
  transition: all 0.1s ease;
}
.saved-mix:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
}

/* Category headers in character library */
#library-grid > div.col-span-full {
  grid-column: 1 / -1;
  font-size: 10px;
  padding-top: 8px;
}

/* Subtle particle container for future canvas */
.particle-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

/* Responsive tweaks */
@media (prefers-reduced-motion: reduce) {
  .stage-avatar.playing,
  .stage-avatar.playing .emoji {
    animation: none;
  }
}

@media (max-width: 640px) {
  .stage {
    min-height: 280px;
  }
  .char-card .emoji {
    font-size: 1.85rem;
  }
}
