:root {
  --bg-color: #06070c;
  --surface-glass: rgba(18, 22, 36, 0.7);
  --surface-glass-hover: rgba(28, 34, 56, 0.9);
  --surface-border: rgba(255, 255, 255, 0.14);
  --surface-border-active: rgba(0, 242, 254, 0.55);
  --text-main: #f0f4fc;
  --text-muted: #8c9bb5;
  --accent-cyan: #00f2fe;
  --accent-magenta: #fe019a;
  --accent-purple: #7928ca;
  --accent-gold: #ffb703;
  --accent-red: #ff3366;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

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

/* App Viewport Container */
#app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, #0d111e 0%, #05060a 100%);
  overflow: hidden;
}

/* Aspect Ratio Canvas Wrapper */
#canvas-wrapper {
  position: relative;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

#canvas-wrapper.ratio-full {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  box-shadow: none;
  border: none;
}

#canvas-wrapper.ratio-9-16 {
  height: min(92vh, 880px);
  width: calc(min(92vh, 880px) * (9 / 16));
  border-radius: var(--radius-lg);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--surface-border);
}

#canvas-wrapper.ratio-16-9 {
  width: min(92vw, 1100px);
  height: calc(min(92vw, 1100px) * (9 / 16));
  border-radius: var(--radius-lg);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--surface-border);
}

#canvas-wrapper.ratio-1-1 {
  height: min(85vh, 85vw, 720px);
  width: min(85vh, 85vw, 720px);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--surface-border);
}

#canvas-wrapper {
  cursor: grab;
}

#render-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

body.canvas-dragging,
body.canvas-dragging *,
body.canvas-dragging #render-canvas,
body.canvas-dragging #canvas-wrapper {
  cursor: grabbing !important;
}

/* Drag & Drop Visual Indicator */
#dropzone-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 30, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  border: 3px dashed var(--accent-cyan);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

#dropzone-overlay.drag-active {
  opacity: 1;
  pointer-events: all;
}

#dropzone-overlay .drop-icon {
  font-size: 56px;
  color: var(--accent-cyan);
  animation: pulse-bounce 1.5s infinite ease-in-out;
}

#dropzone-overlay h3 {
  font-size: 24px;
  margin-top: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

#dropzone-overlay p {
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 14px;
}

@keyframes pulse-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.05); }
}

/* HUD System */
.hud-element {
  position: absolute;
  z-index: 100;
  transition: opacity var(--transition-smooth), transform var(--transition-smooth);
}

#hud-reveal-trigger {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  z-index: 950;
  pointer-events: all;
}

body.hud-hidden .hud-element {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-8px);
}

body.hud-hidden #bottom-hud {
  transform: translateY(8px) translateX(-50%) !important;
}

/* When recording is active, hide all normal HUD bars so canvas capture is 100% pristine */
body.recording-active #top-hud,
body.recording-active #bottom-hud,
body.recording-active .drawer-panel,
body.recording-active #help-modal,
body.recording-active #render-modal {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Top Navigation Bar */
#top-hud {
  top: 18px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

#top-hud > * {
  pointer-events: all;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
}

.brand-badge .brand-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: audio-glow 1.5s infinite alternate;
}

.brand-badge h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #fff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Aspect Ratio Switcher */
.aspect-selector {
  display: flex;
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.aspect-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.aspect-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.aspect-btn.active {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
}

/* Glass Buttons */
.glass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.glass-btn:hover {
  background: var(--surface-glass-hover);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

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

.glass-btn.accent {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.25), rgba(121, 40, 202, 0.25));
  border-color: rgba(0, 242, 254, 0.4);
}

.glass-btn.accent:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 18px rgba(0, 242, 254, 0.35);
}

.glass-btn.record {
  background: linear-gradient(135deg, rgba(255, 51, 102, 0.25), rgba(254, 1, 154, 0.25));
  border-color: rgba(255, 51, 102, 0.5);
  color: #fff;
}

.glass-btn.record:hover {
  border-color: var(--accent-red);
  box-shadow: 0 0 18px rgba(255, 51, 102, 0.4);
}

.glass-btn.active {
  border-color: var(--accent-magenta);
  background: rgba(254, 1, 154, 0.22);
  box-shadow: 0 0 14px rgba(254, 1, 154, 0.35);
  color: #fff;
}

.glass-btn.live-active {
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.3), rgba(0, 242, 254, 0.3));
  border-color: #00ff87;
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 255, 135, 0.4);
}

.glass-btn.lock-pill {
  font-size: 11px;
  padding: 7px 11px;
}

.glass-btn.locked {
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.28), rgba(255, 80, 0, 0.25));
  border-color: #ffb703;
  color: #ffde59;
  box-shadow: 0 0 16px rgba(255, 183, 3, 0.45);
}

.sync-sound-btn {
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.25), rgba(0, 242, 254, 0.2));
  border-color: rgba(29, 185, 84, 0.45);
  color: #fff;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.sync-sound-btn:hover {
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.4), rgba(0, 242, 254, 0.35));
  border-color: #1DB954;
  box-shadow: 0 0 18px rgba(29, 185, 84, 0.4);
}

.sync-sound-btn.synced {
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.35), rgba(29, 185, 84, 0.35));
  border-color: #00ff87;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(0, 255, 135, 0.5);
  animation: sync-glow-pulse 2s infinite alternate ease-in-out;
}

@keyframes sync-glow-pulse {
  0% { box-shadow: 0 0 12px rgba(0, 255, 135, 0.35); }
  100% { box-shadow: 0 0 24px rgba(0, 255, 135, 0.7); }
}

.color-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.color-picker-row span {
  font-size: 12px;
  color: var(--text-muted);
}

.color-picker-row input[type="color"] {
  -webkit-appearance: none;
  border: 1px solid var(--surface-border);
  width: 42px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  padding: 2px;
}

/* Bottom Player & Mode Switcher HUD */
#bottom-hud {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  max-width: 98vw;
}

/* 7 Mode Pills Scrollable Container */
.mode-pills-container {
  overflow-x: auto;
  max-width: 58vw;
  scrollbar-width: none;
}

.mode-pills-container::-webkit-scrollbar {
  display: none;
}

.mode-pills {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}

.mode-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.mode-pill:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.mode-pill.active {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #fff;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.35);
}

.hud-divider {
  width: 1px;
  height: 24px;
  background: var(--surface-border);
  flex-shrink: 0;
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.play-pause-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border: none;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.4);
}

.play-pause-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 24px rgba(0, 242, 254, 0.6);
}

.playback-step-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.playback-step-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.1);
  color: #fff;
}

.playback-step-btn:active {
  transform: scale(0.94);
}

.track-source-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(29, 185, 84, 0.2);
  border: 1px solid rgba(29, 185, 84, 0.4);
  color: #1DB954;
  margin-bottom: 2px;
  width: fit-content;
}

.track-info-pill {
  display: flex;
  flex-direction: column;
  max-width: 150px;
  overflow: hidden;
}

.track-title {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: #fff;
}

.track-artist {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Floating Recording Active Banner */
#recording-banner {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: rgba(14, 18, 30, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 51, 102, 0.4);
  border-radius: var(--radius-lg);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 900;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 51, 102, 0.2);
  transition: transform var(--transition-smooth);
  pointer-events: none;
}

body.recording-active #recording-banner {
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

.rec-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-red);
  letter-spacing: 1px;
}

.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 10px var(--accent-red);
  animation: rec-blink 1s infinite alternate ease-in-out;
}

@keyframes rec-blink {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0.3; transform: scale(0.85); }
}

.rec-progress-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
}

.rec-time-text {
  font-size: 11px;
  font-family: monospace;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
}

.rec-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.rec-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-red), var(--accent-cyan));
  transition: width 0.15s ease;
}

/* Modal Dialogs */
.modal-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--surface-glass);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  transform: scale(0.95);
  transition: transform var(--transition-fast);
}

.modal-overlay.open .modal-content {
  transform: scale(1);
}

.render-option-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.render-option-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.render-option-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.render-option-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Drawer Panels */
.drawer-panel {
  position: absolute;
  top: 72px;
  right: 20px;
  width: 330px;
  max-height: calc(100vh - 160px);
  background: var(--surface-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65);
  padding: 18px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px) scale(0.96);
  transition: all var(--transition-smooth);
  z-index: 200;
}

.drawer-panel.open {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0) scale(1);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--surface-border);
}

.drawer-header h3 {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
}

.close-btn:hover {
  color: #fff;
}

/* Control Group */
.control-group {
  margin-bottom: 16px;
}

#mode-inspector-container {
  background: rgba(0, 242, 254, 0.04);
  border: 1px solid rgba(0, 242, 254, 0.18);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.control-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 700;
}

.control-item {
  margin-bottom: 12px;
}

.control-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--text-main);
}

.control-label-row span:last-child {
  color: var(--accent-cyan);
  font-family: monospace;
}

/* Text Input & Dropdown Selects */
.styled-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: #fff;
  outline: none;
  font-size: 13px;
  transition: border-color var(--transition-fast);
}

.styled-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
}

.styled-textarea {
  font-family: inherit;
  resize: vertical;
  min-height: 72px;
  line-height: 1.4;
}

.styled-select {
  width: 100%;
  background: #0d1222;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: #fff;
  outline: none;
  font-size: 12px;
  cursor: pointer;
}

/* Freeform Color Pickers Grid */
.color-pickers-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.color-picker-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
}

.color-picker-box span {
  font-size: 11px;
  color: var(--text-muted);
}

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 36px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
}

/* Range Sliders */
input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Checkbox Toggle Row */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 8px;
}

.toggle-switch {
  position: relative;
  width: 38px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 20px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--accent-cyan);
}

input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

/* Theme Palette Picker */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.palette-btn {
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.palette-btn:hover {
  transform: scale(1.05);
}

.palette-btn.active {
  border: 2px solid #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

/* Preset Cards List */
.presets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.preset-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.preset-card.active {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
}

.preset-name {
  font-size: 13px;
  font-weight: 500;
}

.preset-del-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 4px;
}

.preset-del-btn:hover {
  color: #ff4757;
  background: rgba(255, 71, 87, 0.15);
}

/* Audio Spectrum Monitor */
#spectrum-canvas {
  width: 100%;
  height: 38px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: block;
}

/* Hotkey Help Overlay Modal */
#help-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--surface-glass);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 380px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-smooth);
  z-index: 300;
}

#help-modal.open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.hotkey-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.hotkey-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.key-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 11px;
  color: var(--accent-cyan);
}

/* Toast Notifications */
#toast-container {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: rgba(18, 22, 36, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border-active);
  color: #fff;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1), toast-out 0.3s 2.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-12px); }
}

/* Custom Scrollbar */
.drawer-panel::-webkit-scrollbar, #help-modal::-webkit-scrollbar {
  width: 5px;
}
.drawer-panel::-webkit-scrollbar-track, #help-modal::-webkit-scrollbar-track {
  background: transparent;
}
.drawer-panel::-webkit-scrollbar-thumb, #help-modal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Spotify Live Connect & Now Playing Pill */
.badge-offline {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-online {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(29, 185, 84, 0.15);
  color: #1DB954;
  border: 1px solid rgba(29, 185, 84, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-online::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1DB954;
  box-shadow: 0 0 6px #1DB954;
  animation: spotify-pulse 1.8s infinite;
}

@keyframes spotify-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Floating Spotify Now Playing Pill */
.spotify-pill {
  position: absolute;
  top: 72px;
  left: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 10px;
  background: rgba(14, 18, 30, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(29, 185, 84, 0.35);
  border-radius: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 15px rgba(29, 185, 84, 0.15);
  cursor: pointer;
  transition: all var(--transition-normal);
  max-width: 320px;
  user-select: none;
}

.spotify-pill:hover {
  background: rgba(20, 26, 42, 0.85);
  border-color: rgba(29, 185, 84, 0.65);
  transform: translateY(-2px);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(29, 185, 84, 0.3);
}

.spotify-pill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spotify-pill-thumb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: none;
  animation: spin-thumb 16s linear infinite;
}

@keyframes spin-thumb {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spotify-pill-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.spotify-pill-title {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  letter-spacing: 0.3px;
}

.spotify-pill-artist {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.spotify-pill-eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.spotify-pill-eq span {
  width: 2px;
  height: 100%;
  background: #1DB954;
  border-radius: 1px;
  animation: eq-bounce 0.8s ease-in-out infinite alternate;
}
.spotify-pill-eq span:nth-child(1) { animation-delay: 0.1s; height: 60%; }
.spotify-pill-eq span:nth-child(2) { animation-delay: 0.3s; height: 100%; }
.spotify-pill-eq span:nth-child(3) { animation-delay: 0.2s; height: 40%; }

@keyframes eq-bounce {
  from { height: 20%; }
  to { height: 100%; }
}

/* Creator Card in Settings Drawer */
.creator-card {
  margin-top: 14px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.08) 0%, rgba(254, 1, 154, 0.08) 100%);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.creator-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.creator-avatar {
  width: 32px;
  height: 32px;
  background: rgba(0, 242, 254, 0.2);
  border: 1px solid var(--accent-cyan);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
}

.creator-info {
  display: flex;
  flex-direction: column;
}

.creator-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.4px;
}

.creator-role {
  font-size: 10px;
  color: var(--text-muted);
}

.creator-link-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid rgba(0, 242, 254, 0.4);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.creator-link-btn:hover {
  background: rgba(0, 242, 254, 0.3);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.5);
  transform: translateY(-1px);
}

.external-arrow {
  font-size: 12px;
  color: var(--accent-cyan);
  transition: transform var(--transition-fast);
}

.creator-link-btn:hover .external-arrow {
  transform: translate(2px, -2px);
}
