@import url('fonts.css');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'DeterminationMono', 'DeterminationSans', monospace !important;
}

button, input, select, textarea {
  font-family: 'DeterminationMono', 'DeterminationSans', monospace !important;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

button:focus,
button:focus-visible,
button:active,
*:focus-visible {
  outline: none !important;
}

:root {
  --bg-primary: #000000;
  --bg-surface: #121218;
  --bg-elevated: #1a1a24;
  --bg-card: rgba(26, 26, 36, 0.65);
  
  --soul-red: #ff2a2a;
  --soul-red-glow: rgba(255, 42, 42, 0.35);
  --save-gold: var(--soul-red);
  --save-gold-glow: var(--soul-red-glow);
  
  --text-primary: #ffffff;
  --text-secondary: #a3a3b8;
  --text-muted: #6b6b80;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 42, 42, 0.6);
  --border-pixel: 2px solid var(--border-subtle);
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  background-color: #000000;
  background: #000000;
}

body {
  background-color: #000000;
  background-image: none;
  background: #000000;
  color: var(--text-primary);
  font-family: var(--font-mono);
  min-height: 100vh;
  line-height: 1.5;
  letter-spacing: 0.5px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #000000;
}
::-webkit-scrollbar-thumb {
  background: #252535;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--soul-red);
}

/* Container */
.app-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 180px 20px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.soul-heart-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--soul-red-glow));
  animation: pulse-soul 2.5s infinite ease-in-out;
  display: block;
}

@keyframes pulse-soul {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 6px var(--soul-red-glow)); }
  50% { transform: scale(1.12); filter: drop-shadow(0 0 14px rgba(255, 42, 42, 0.6)); }
}

.brand-title {
  font-size: 1.5rem;
  font-weight: normal;
  letter-spacing: 2px;
  color: #fff;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-left: 8px;
  letter-spacing: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Network / Quality Badge */
.quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.quality-badge:hover {
  border-color: var(--soul-red);
  color: #fff;
}

.quality-badge .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 6px #00ff88;
}

.quality-badge.data-saver .status-dot {
  background: var(--soul-red);
  box-shadow: 0 0 6px var(--soul-red);
}

.quality-badge .badge-label {
  letter-spacing: 1px;
}

/* Search & Filter Bar */
.search-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px 12px 42px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  transition: var(--transition-fast);
  outline: none;
}

.search-input:focus {
  border-color: var(--soul-red);
  box-shadow: 0 0 0 2px rgba(255, 42, 42, 0.2);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.filter-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.filter-btn:hover, .filter-btn.active {
  border-color: var(--soul-red);
  color: #fff;
}

.filter-btn.active {
  background: rgba(255, 42, 42, 0.12);
}

.btn-text-mobile {
  display: none;
}

/* Tracklist */
.tracklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.track-row {
  display: grid;
  grid-template-columns: 48px 54px 1fr 100px 90px;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  cursor: pointer;
  user-select: none;
}

.track-row:hover {
  background: var(--bg-elevated);
  border-color: rgba(255, 255, 255, 0.12);
}

.track-row.active {
  background: rgba(255, 42, 42, 0.08);
  border-color: var(--border-active);
  box-shadow: 0 0 12px rgba(255, 42, 42, 0.15);
}

.track-number-col {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hover-play-icon {
  display: none !important;
  width: 14px;
  height: 14px;
  fill: var(--soul-red);
}

.track-row:not(.active):hover .track-number-col .num-text {
  display: none !important;
}

.track-row:not(.active):hover .track-number-col .hover-play-icon {
  display: block !important;
}

/* While listening/active: ALWAYS hide triangle and number, ALWAYS show equalizer */
.track-row.active .hover-play-icon,
.track-row.active:hover .hover-play-icon,
.track-row.active .track-number-col .hover-play-icon,
.track-row.active:hover .track-number-col .hover-play-icon {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.track-row.active .num-text,
.track-row.active:hover .num-text {
  display: none !important;
}

.track-row.active .playing-anim,
.track-row.active:hover .playing-anim {
  display: flex !important;
}

.playing-anim {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.playing-anim span {
  width: 3px;
  background: var(--soul-red);
  animation: equalize 0.8s infinite ease-in-out alternate;
  animation-play-state: paused;
}
.playing-anim span:nth-child(1) { height: 60%; animation-delay: 0.1s; }
.playing-anim span:nth-child(2) { height: 100%; animation-delay: 0.3s; }
.playing-anim span:nth-child(3) { height: 40%; animation-delay: 0.2s; }

.track-row.active.playing .playing-anim span {
  animation-play-state: running;
}

@keyframes equalize {
  0% { height: 20%; }
  100% { height: 100%; }
}

.track-thumb-col img {
  width: 42px;
  height: 41px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  object-fit: cover;
  display: block;
}

.track-info-col {
  padding: 0 12px;
  overflow: hidden;
}

.track-title {
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-row.active .track-title {
  color: var(--soul-red);
  text-shadow: 0 0 8px rgba(255, 42, 42, 0.4);
}

.track-artist {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.track-duration-col {
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.track-actions-col {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.action-btn {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.action-btn:hover {
  color: #fff;
  background: transparent !important;
  transform: scale(1.15);
}

.action-btn:focus,
.action-btn:focus-visible,
.action-btn:active {
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.action-btn.saved {
  color: var(--text-secondary);
}

.action-btn.saved:hover {
  color: #fff;
}

.action-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  shape-rendering: crispEdges;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state h3 {
  color: #fff;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

/* ===============================================
   NOW PLAYING FLOATING PLAYER (Sticky Bottom)
   =============================================== */
.player-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 1260px;
  background: rgba(18, 18, 24, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 42, 42, 0.3);
  box-shadow: 
    0 12px 36px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(255, 42, 42, 0.15);
  border-radius: var(--radius-lg);
  padding: 12px 28px;
  display: grid;
  grid-template-columns: 290px 1fr auto;
  align-items: center;
  gap: 20px;
  z-index: 100;
  transition: var(--transition-smooth);
}

/* Player Left: Now Playing Info */
.player-track-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
}

.player-cover-art {
  width: 52px;
  height: 50px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 42, 42, 0.4);
  box-shadow: 0 0 10px rgba(255, 42, 42, 0.25);
  object-fit: cover;
  flex-shrink: 0;
}

.player-text-details {
  overflow: hidden;
}

.player-track-number {
  font-size: 0.7rem;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.player-track-title {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

/* Player Center: Controls & Progress */
.player-center-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.player-buttons {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.ctrl-btn:hover {
  color: #fff;
  transform: scale(1.08);
}

.ctrl-btn.active {
  color: var(--soul-red);
}

.repeat-badge {
  position: absolute;
  top: 0px;
  right: -1px;
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--soul-red);
  line-height: 1;
  pointer-events: none;
  min-width: 8px;
  text-align: center;
}

.ctrl-btn {
  position: relative;
}

.ctrl-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.play-pause-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--soul-red);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px var(--soul-red-glow);
  transition: var(--transition-fast);
  position: relative;
}

.play-pause-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 24px rgba(255, 42, 42, 0.6);
}

.play-pause-btn .play-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}

/* Loading spinner circle animation inside red circle */
.play-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: play-spin 0.7s linear infinite;
  box-sizing: border-box;
}

@keyframes play-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.play-pause-btn.is-loading .play-spinner {
  display: block;
}

.play-pause-btn.is-loading .play-icon {
  display: none;
}

/* Progress bar */
.progress-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.progress-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
  position: relative;
}

.progress-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--soul-red);
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.progress-slider::-webkit-slider-thumb:hover {
  transform: scale(1.4);
}

/* Player Right: Volume & Extra */
.player-right-options {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.volume-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 110px;
}

.volume-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--soul-red);
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.quality-toggle-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.quality-toggle-pill:hover {
  border-color: var(--soul-red);
  color: #fff;
}

/* Keyboard hint toast */
.keyboard-hints {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 32px;
  letter-spacing: 0.8px;
}

.keyboard-hints kbd {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 2px 6px;
  color: #fff;
}

/* Responsive adjustments */
@media (max-width: 860px), (hover: none) and (pointer: coarse) {
  .keyboard-hints {
    display: none !important;
  }
}

@media (max-width: 860px) {
  .player-bar {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px)) 14px;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    border-top: 1px solid rgba(255, 42, 42, 0.4);
    border-left: none;
    border-right: none;
    border-bottom: none;
    gap: 6px;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.7);
  }
  
  .player-cover-art {
    width: 38px;
    height: 38px;
  }

  .player-track-meta {
    gap: 10px;
  }

  .player-track-number {
    font-size: 0.65rem;
  }

  .player-track-title {
    font-size: 0.85rem;
  }

  .player-center-controls {
    gap: 2px;
  }

  .player-buttons {
    gap: 12px;
  }

  .play-pause-btn {
    width: 34px;
    height: 34px;
  }

  .play-pause-btn .play-icon {
    width: 16px;
    height: 16px;
  }

  .play-spinner {
    width: 15px;
    height: 15px;
    border-width: 2px;
  }

  .ctrl-btn {
    padding: 4px;
  }

  .ctrl-btn svg {
    width: 15px;
    height: 15px;
  }

  .progress-bar-row {
    font-size: 0.75rem;
    gap: 8px;
  }

  .player-right-options {
    justify-content: flex-start;
    gap: 10px;
    padding-top: 2px;
  }

  .volume-wrapper {
    flex: 1;
    width: auto;
  }

  .volume-slider {
    width: 100%;
  }

  .quality-toggle-pill {
    padding: 3px 8px;
    font-size: 0.75rem;
  }

  .track-row {
    grid-template-columns: 36px 44px 1fr 70px 40px;
    padding: 6px 8px;
  }
  
  .brand-title {
    font-size: 1.2rem;
  }
}

/* Mobile Mode: Buttons display ALL and OFFLINE */
@media (max-width: 768px) {
  .btn-text-desktop {
    display: none !important;
  }
  .btn-text-mobile {
    display: inline !important;
  }
  .filter-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
  }
}

/* ===============================================
   SOUND LAB & AMBIENCE FX SYSTEM
   =============================================== */

/* FX Button in Bottom Bar */
.sound-fx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 26px;
  padding: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

.sound-fx-btn:hover {
  border-color: var(--soul-red);
  color: #fff;
  background: rgba(255, 42, 42, 0.12);
  box-shadow: 0 0 10px rgba(255, 42, 42, 0.25);
}

.sound-fx-btn.panel-active {
  border-color: var(--soul-red);
  color: #fff;
  background: rgba(255, 42, 42, 0.22);
  box-shadow: 0 0 14px rgba(255, 42, 42, 0.4);
}

.sound-fx-btn.has-active-fx {
  border-color: rgba(255, 42, 42, 0.7);
}

.fx-icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

.fx-active-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
  transition: var(--transition-fast);
}

.fx-active-dot.active {
  background: var(--soul-red);
  box-shadow: 0 0 6px #ff2a2a, 0 0 12px #ff2a2a;
  animation: soulPulse 1.8s infinite ease-in-out;
}

@keyframes soulPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* Sound Lab Floating Panel */
.sound-lab-panel {
  position: fixed;
  bottom: 104px;
  right: max(24px, calc(50% - 630px + 24px));
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  background: rgba(14, 14, 18, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 42, 42, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.9),
    0 0 30px rgba(255, 42, 42, 0.18);
  z-index: 120;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.22s ease, visibility 0.22s;
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sound-lab-panel.hidden {
  transform: translateY(16px) scale(0.96);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Sound Lab Header */
.sound-lab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(22, 22, 30, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sound-lab-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sound-lab-heart-icon {
  width: 14px;
  height: 14px;
}

.sound-lab-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
}

.sound-lab-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--soul-red);
  color: #fff;
  letter-spacing: 0.5px;
}

.sound-lab-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fx-action-btn {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.fx-action-btn:hover {
  border-color: var(--soul-red);
  color: #fff;
  background: rgba(255, 42, 42, 0.12);
}

.sound-lab-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.sound-lab-close-btn:hover {
  color: var(--soul-red);
  transform: scale(1.15);
}

/* Sound Lab Content */
.sound-lab-content {
  padding: 16px 18px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

.sound-lab-content::-webkit-scrollbar {
  width: 6px;
}
.sound-lab-content::-webkit-scrollbar-track {
  background: #0e0e12;
}
.sound-lab-content::-webkit-scrollbar-thumb {
  background: #252535;
  border-radius: 3px;
}

/* Sound Lab section dividers */
.sound-lab-section {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sound-lab-section:last-of-type {
  margin-bottom: 8px;
  border-bottom: none;
  padding-bottom: 0;
}

/* Ambience Grid */
.ambience-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.ambience-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.ambience-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.22);
}

.ambience-card.active {
  background: rgba(255, 42, 42, 0.12);
  border-color: var(--soul-red);
  box-shadow: 0 0 14px rgba(255, 42, 42, 0.25);
}

.ambience-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
}

.ambience-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s ease;
}

.ambience-card.active .ambience-icon {
  stroke: var(--soul-red);
}

/* Fill-based icon variant (cat) — paths use fill=currentColor → set `color` */
.ambience-icon.ambience-icon-fill {
  color: var(--text-secondary);
  fill: none;
  stroke: none !important;
  transition: color 0.2s ease;
}

.ambience-card.active .ambience-icon.ambience-icon-fill {
  color: var(--soul-red);
  fill: none;
  stroke: none !important;
}

/* Standalone cat icon — not a child of .ambience-icon, no rule conflicts */
.cat-icon {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.ambience-card.active .cat-icon {
  color: var(--soul-red);
}

.ambience-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.ambience-card.active .ambience-label {
  color: #fff;
  font-weight: 700;
}

.ambience-indicator {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
}

.ambience-card.active .ambience-indicator {
  background: var(--soul-red);
  box-shadow: 0 0 6px #ff2a2a;
}

/* Per-sound volume controls */
.ambience-vol-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
  overflow: hidden;
}

.avol-row {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: avol-in 0.18s ease forwards;
}

.avol-row.avol-exit {
  animation: avol-out 0.18s ease forwards;
}

@keyframes avol-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes avol-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-4px); }
}

.avol-icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: stroke 0.15s;
}

.avol-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}

.avol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--soul-red);
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.avol-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* Control Rows (Sliders + Number Input) */
.fx-control-row {
  display: grid;
  grid-template-columns: 105px 1fr 62px;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.fx-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.fx-range-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}

.fx-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--soul-red);
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.fx-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.fx-num-input {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-align: center;
  padding: 4px 6px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fx-num-input:focus {
  border-color: var(--soul-red);
  outline: none;
  box-shadow: 0 0 8px rgba(255, 42, 42, 0.35);
}

.fx-num-input.sm {
  width: 44px;
  padding: 2px 4px;
  font-size: 0.75rem;
}

/* Sub-row for Pitch presets & max */
.fx-sub-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: -4px;
  margin-bottom: 14px;
  padding-left: 0;
}

.pitch-presets {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.pitch-chip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pitch-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.pitch-chip.active {
  background: var(--soul-red);
  border-color: var(--soul-red);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 6px rgba(255, 42, 42, 0.4);
}

/* Stereo Pan Presets */
.pan-presets-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-top: -4px;
  margin-bottom: 10px;
  padding-left: 0;
}

.pan-chip {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pan-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.pan-chip.active {
  background: var(--soul-red);
  border-color: var(--soul-red);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 6px rgba(255, 42, 42, 0.4);
}

/* Responsive Overrides for Sound Lab */
@media (max-width: 860px) {
  .sound-lab-panel {
    bottom: 162px;
    right: 10px;
    left: 10px;
    width: calc(100% - 20px);
    max-width: 100%;
    max-height: 72vh;
  }

  .fx-control-row {
    grid-template-columns: 90px 1fr 54px;
    gap: 8px;
  }

  .fx-sub-row {
    padding-left: 0;
    justify-content: space-between;
  }

  .pan-presets-row {
    padding-left: 0;
  }

  .player-right-options {
    gap: 8px;
  }

  .volume-wrapper {
    width: 80px;
  }
}

