:root {
  --bg: #0b0b0d;
  --surface: #14161b;
  --surface-2: #1b1e25;
  --border: rgba(212, 175, 55, 0.24);
  --border-soft: rgba(255, 255, 255, 0.09);
  --gold: #d4af37;
  --gold-bright: #f3d778;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top right, #1b1609 0%, var(--bg) 42%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(11, 11, 13, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand-group { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.brand-title { font-size: 0.96rem; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 0.72rem; color: var(--gold); letter-spacing: 0.06em; text-transform: uppercase; }

.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  color: var(--text);
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { border-color: var(--gold); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-gold { background: linear-gradient(135deg, var(--gold), #b99322); color: #0b0b0d; border-color: var(--gold); }
.btn-gold:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: rgba(212, 175, 55, 0.35); color: var(--gold-bright); }
.btn-sm { padding: 6px 10px; font-size: 0.78rem; border-radius: 8px; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 135px 16px;
}

.author-hero {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 20px;
  align-items: center;
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(28, 25, 16, 0.75), rgba(20, 22, 27, 0.95));
  border: 1px solid var(--border);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}
.author-photo {
  width: 128px;
  height: 128px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid var(--gold);
}
.author-kicker {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 4px;
}
.author-hero h1 { margin: 0 0 6px 0; font-size: clamp(1.35rem, 2.5vw, 1.95rem); color: #fff; }
.author-bio { margin: 0 0 12px 0; color: #d1d5db; font-size: 0.92rem; max-width: 78ch; }
.cred-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cred-pill {
  font-size: 0.76rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}
.cred-pill strong { color: var(--gold-bright); }

.privacy-bar {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 700;
}
.mode-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
}
.mode-dot.is-full { background: var(--green); }
.mode-dot.is-locked { background: var(--red); }

.toolbar {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 0.8fr auto;
  gap: 10px;
  align-items: center;
}
.input, .select {
  width: 100%;
  background: var(--surface);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
}
.input:focus, .select:focus { outline: none; border-color: var(--gold); }

.locked-vault-banner {
  display: none;
  margin-top: 16px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.28), rgba(20, 22, 27, 0.96));
}
.locked-vault-banner.is-visible { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

.stats-row {
  margin: 14px 0 12px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
}

.songs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.song-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 15px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.song-card:hover { border-color: rgba(212, 175, 55, 0.45); transform: translateY(-1px); }
.song-card.is-playing { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35); }
.song-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.song-title { margin: 0; font-size: 1.02rem; color: #fff; font-weight: 700; }
.song-sub { font-size: 0.8rem; color: var(--gold-bright); margin-top: 2px; }
.song-teaser { font-size: 0.8rem; color: var(--muted); margin: 0; line-height: 1.42; }
.song-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 0.71rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #d1d5db;
}
.tag-hist { background: rgba(212, 175, 55, 0.14); color: var(--gold-bright); border: 1px solid rgba(212, 175, 55, 0.35); }
.tag-lock { background: rgba(239, 68, 68, 0.14); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.35); }
.song-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 4px; }
.fav-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--muted);
  border-radius: 8px;
  padding: 5px 9px;
  cursor: pointer;
  font-size: 0.9rem;
}
.fav-btn.is-fav { color: var(--gold); border-color: var(--gold); }

.bf-callout {
  margin-top: 26px;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(20, 22, 27, 0.96));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.mini-player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  background: rgba(14, 15, 19, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: none;
}
.mini-player.is-visible { display: block; }
.mini-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(240px, 1.4fr) auto;
  gap: 12px;
  align-items: center;
}
.mini-title { font-size: 0.9rem; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-meta { font-size: 0.76rem; color: var(--gold-bright); }
.mini-audio { width: 100%; height: 36px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.is-open { display: flex; }
.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h3 { margin: 0; color: var(--gold-bright); font-size: 1.12rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.field label { font-size: 0.76rem; color: var(--gold); text-transform: uppercase; font-weight: 700; }
.field textarea { min-height: 82px; resize: vertical; }
.hp-hide { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.status-box {
  display: none;
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--gold);
  background: rgba(212, 175, 55, 0.1);
  font-size: 0.88rem;
}

.toast {
  position: fixed;
  top: 66px;
  right: 16px;
  z-index: 70;
  background: #111827;
  color: #fff;
  border: 1px solid var(--gold);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  display: none;
  max-width: 340px;
}

@media (max-width: 820px) {
  .author-hero { grid-template-columns: 1fr; text-align: center; }
  .author-photo { margin: 0 auto; }
  .cred-row { justify-content: center; }
  .toolbar { grid-template-columns: 1fr; }
  .mini-inner { grid-template-columns: 1fr; gap: 8px; }
  .form-row { grid-template-columns: 1fr; }
}
