@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&display=swap');

:root {
  --bg-color: #030008; /* Deep space dark navy/black */
  --glass-bg: rgba(20, 20, 30, 0.4);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-primary: #eee;
  --text-secondary: #aaa;
  --accent-color: #a388e8; /* Soft lavender */
  --btn-hover: rgba(255, 255, 255, 0.15);
}

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
}

#canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none; /* Let clicks pass through except on glass-panel */
  transition: opacity 1s ease-in-out;
}

.glass-panel {
  pointer-events: auto;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

h1 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #a388e8, #88e8c8); /* Lavender to mint green */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(163, 136, 232, 0.3);
}

p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  line-height: 1.5;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn:active {
  transform: translateY(0px);
}

.status-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 300;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Range sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: rgba(139, 74, 74, 0.25);
  border-radius: 1px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #8b4a4a;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: -4px;
}

input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: #8b4a4a;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 1px;
}

input[type="range"]:hover::-webkit-slider-thumb {
  background: #a85e5e;
}

/* Live audio-modulated slider values */
.live-val {
  color: #f0a030;
  margin-left: 4px;
  min-width: 36px;
}

/* Bottom-left now playing */
#now-playing {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 200;
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: rgba(0, 0, 0, 0.4);
  line-height: 1;
  transition: opacity 0.8s ease;
}

/* Corner UI: mute, what's this, dev */
#corner-ui {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: rgba(0, 0, 0, 0.4);
  line-height: 1;
}

#corner-ui button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

#corner-ui button:hover {
  color: rgba(0, 0, 0, 0.8);
}

#whats-this-btn {
  border-bottom: 1px dashed rgba(0,0,0,0.3) !important;
  padding-bottom: 1px !important;
}

#whats-this-btn:hover {
  border-bottom-color: rgba(0,0,0,0.7) !important;
}

#mute-btn {
  font-size: 1rem;
  line-height: 1;
}

#dev-btn {
  border-bottom: 1px dashed rgba(0,0,0,0.3) !important;
  padding-bottom: 1px !important;
}

#dev-btn:hover {
  border-bottom-color: rgba(0,0,0,0.7) !important;
}

#dev-btn.active {
  color: rgba(0, 0, 0, 0.8);
  border-bottom-style: solid !important;
}

/* What's this popover */
#whats-this-panel {
  position: fixed;
  bottom: 52px;
  right: 20px;
  z-index: 200;
  width: min(420px, 90vw);
  padding: 18px 20px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  line-height: 1.65;
  color: #333;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  transition: opacity 0.25s ease;
}

#whats-this-panel p + p {
  margin-top: 10px;
}

#whats-this-panel a {
  color: #111;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Dev mode panel */
#dev-mode-panel canvas {
  width: 100%;
  display: block;
}

#dev-mode-panel {
  position: fixed;
  bottom: 52px;
  right: 20px;
  z-index: 199;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  padding: 12px 14px;
  transition: opacity 0.3s;
  color: #333;
}

#visualizer-canvas {
  background: #eee;
  border-radius: 4px;
}

/* Click-to-start splash */
#start-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.8s ease;
}

#start-splash span {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: lowercase;
  color: #999;
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.9; }
}

#start-splash.hidden {
  opacity: 0;
  pointer-events: none;
}
