/* ===== SOUNDSCAPE CREATOR ===== */

.creator-main { padding: 2rem 0 6rem; }

/* ---- Toolbar ---- */
.creator-toolbar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto 2rem;
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.creator-master-vol {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 140px;
}

.creator-master-vol input { flex: 1; accent-color: var(--accent); }

/* ---- Layer grid ---- */
.creator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

/* ---- Layer card ---- */
.cr-layer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: border-color 0.2s;
}

.cr-layer-card.active { border-color: rgba(139,124,248,0.4); }

.cr-layer-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.cr-layer-icon { font-size: 1.5rem; flex-shrink: 0; cursor: pointer; }

.cr-layer-info { flex: 1; min-width: 0; }
.cr-layer-name { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-layer-type { font-size: 0.72rem; color: var(--muted); }

.cr-layer-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}
.cr-layer-remove:hover { color: var(--text); }

/* ---- Level bars ---- */
.cr-level-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.cr-level-bars span {
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  animation: crBar 0.7s ease-in-out infinite alternate;
}
.cr-level-bars.stopped span { animation: none; height: 2px !important; }
.cr-level-bars span:nth-child(1){ animation-delay:0s;    animation-duration:0.7s; }
.cr-level-bars span:nth-child(2){ animation-delay:0.1s;  animation-duration:0.9s; }
.cr-level-bars span:nth-child(3){ animation-delay:0.05s; animation-duration:0.65s;}
.cr-level-bars span:nth-child(4){ animation-delay:0.2s;  animation-duration:0.85s;}
.cr-level-bars span:nth-child(5){ animation-delay:0.15s; animation-duration:0.75s;}
@keyframes crBar { from{height:2px} to{height:14px} }

/* ---- Vol row ---- */
.cr-vol-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.cr-vol-row input { flex: 1; accent-color: var(--accent); }

/* ---- Pick button ---- */
.cr-pick-btn {
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  text-align: center;
}
.cr-pick-btn:hover { border-color: var(--accent); color: var(--text); }

/* ---- Add layer placeholder ---- */
.cr-add-card {
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
  min-height: 130px;
  transition: border-color 0.2s, color 0.2s;
}
.cr-add-card:hover { border-color: rgba(139,124,248,0.4); color: var(--text); }

/* ---- Saved mixes ---- */
.creator-section-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.creator-saved {
  max-width: 900px;
  margin: 2.5rem auto 0;
}

.creator-saved-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cr-saved-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cr-saved-name { flex: 1; font-size: 0.9rem; }
.cr-saved-meta { font-size: 0.74rem; color: var(--muted); }
.cr-saved-load { font-size: 0.78rem; }
.cr-saved-del  { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.9rem; }
.cr-saved-del:hover { color: var(--text); }

/* ---- Sound picker modal ---- */
.cr-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,4,13,0.85);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cr-picker {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: crFadeIn 0.25s ease;
}

@keyframes crFadeIn { from{opacity:0;transform:scale(0.94)} to{opacity:1;transform:scale(1)} }

.cr-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid var(--border);
}

.cr-picker-head h3 { font-family: var(--font-serif); font-size: 1.1rem; }

.cr-picker-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.3rem;
}
.cr-picker-close:hover { color: var(--text); }

.cr-picker-search { padding: 0.8rem 1.4rem; border-bottom: 1px solid var(--border); }
.cr-picker-search input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.5rem 0.9rem;
}
.cr-picker-search input:focus { outline: none; border-color: rgba(139,124,248,0.5); }

.cr-picker-grid {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.6rem;
  align-content: start;
}

.cr-picker-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 0.5rem;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  transition: border-color 0.2s, background 0.2s;
}
.cr-picker-item:hover { border-color: rgba(139,124,248,0.4); background: rgba(139,124,248,0.06); }
.cr-picker-item-icon  { font-size: 1.4rem; }
.cr-picker-item-name  { font-size: 0.74rem; color: var(--muted); }

/* ---- Save modal ---- */
.cr-save-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4,4,13,0.8);
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cr-save-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cr-save-modal h3 { font-family: var(--font-serif); font-size: 1.15rem; }

.cr-save-modal input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  padding: 0.65rem 0.9rem;
}
.cr-save-modal input:focus { outline: none; border-color: rgba(139,124,248,0.5); }

.cr-save-actions { display: flex; gap: 0.7rem; }
