/* Mixtape — design system */

:root {
  --bg: #0b0c10;
  --surface: #14161d;
  --surface-2: #1c1f29;
  --surface-3: #252936;
  --border: #262a36;
  --text: #eef0f6;
  --muted: #8b90a1;
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --grad: linear-gradient(135deg, #8b5cf6, #ec4899);
  --radius: 16px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .45);
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(139, 92, 246, .14), transparent 60%),
    radial-gradient(700px 400px at -10% 20%, rgba(236, 72, 153, .08), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input { font: inherit; }
img { display: block; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 28px;
  background: rgba(11, 12, 16, .8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--grad);
  display: grid; place-items: center;
  font-size: 21px;
  box-shadow: 0 4px 18px rgba(139, 92, 246, .4);
}
.brand-logo .vinyl {
  width: 30px; height: 30px;
  animation: vinyl-spin 4s linear infinite;
  animation-play-state: paused;
}
body.has-player .brand-logo .vinyl { animation-play-state: running; }
.modal-hero .vinyl { width: 40px; height: 40px; }
@keyframes vinyl-spin { to { transform: rotate(360deg); } }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand-tag { font-size: 11.5px; color: var(--muted); }

.tabs { display: flex; gap: 4px; margin-left: auto; }
.tabs a {
  padding: 9px 16px; border-radius: 999px;
  font-size: 14.5px; font-weight: 600; color: var(--muted);
  transition: all .15s;
}
.tabs a:hover { color: var(--text); background: var(--surface-2); }
.tabs a.active { color: #fff; background: var(--surface-3); }

.me-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
  transition: border-color .15s;
}
.me-chip:hover { border-color: var(--accent); }

/* ---------- avatars ---------- */

.avatar, .mini-avatar {
  display: inline-grid; place-items: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.mini-avatar { width: 26px; height: 26px; font-size: 14px; }
.avatar { width: 44px; height: 44px; font-size: 22px; }
.avatar.lg { width: 64px; height: 64px; font-size: 32px; }
.avatar.xl { width: 88px; height: 88px; font-size: 44px; }

/* ---------- layout ---------- */

.view { flex: 1; overflow-y: auto; }
.page { max-width: 980px; margin: 0 auto; padding: 34px 28px 60px; }
body.has-player .page { padding-bottom: 130px; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 24px;
}
.page-head h2 { font-size: 30px; letter-spacing: -.03em; }
.page-sub { color: var(--muted); font-size: 14.5px; margin-top: 6px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.section-title { font-size: 19px; letter-spacing: -.02em; margin: 34px 0 14px; }

.listen-cta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 14px 20px; margin-bottom: 8px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(139, 92, 246, .16), rgba(236, 72, 153, .09));
  border: 1px solid rgba(139, 92, 246, .32);
  font-size: 14.5px; font-weight: 600;
}

.empty {
  padding: 34px; text-align: center; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
  font-size: 14.5px;
}
.empty a { color: var(--accent); font-weight: 600; }

/* ---------- buttons & inputs ---------- */

.btn {
  padding: 10px 18px; border-radius: 999px;
  font-weight: 700; font-size: 14px;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 4px 16px rgba(139, 92, 246, .35); }
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn:disabled:not(.added) {
  opacity: .4; cursor: not-allowed;
  filter: grayscale(.6); box-shadow: none; transform: none;
}
.btn-ghost { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn.added { color: #6ad4a8; border-color: rgba(106, 212, 168, .3); }
.btn.wide { width: 100%; padding: 13px; }

.search-input {
  padding: 10px 18px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); outline: none; min-width: 240px;
  transition: border-color .15s;
}
.search-input:focus { border-color: var(--accent); }
.search-input.big { width: 100%; padding: 15px 22px; font-size: 16px; border-radius: 18px; }
.search-input::placeholder { color: var(--muted); }
.search-wrap { margin-bottom: 16px; }

/* ---------- song rows ---------- */

.song-list, .search-results { display: flex; flex-direction: column; gap: 6px; }
.search-results:not(:empty) { margin-bottom: 8px; }

.song-row, .result-row {
  display: grid;
  grid-template-columns: 40px 48px 1fr auto auto auto auto;
  align-items: center; gap: 14px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 14px;
  transition: background .15s, border-color .15s;
}
.result-row { grid-template-columns: 40px 48px 1fr auto auto; }
.song-row:hover, .result-row:hover { background: var(--surface-2); }
.song-row.now-playing {
  background: linear-gradient(90deg, rgba(139, 92, 246, .16), rgba(236, 72, 153, .07));
  border-color: rgba(139, 92, 246, .35);
}

.row-play {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-3); font-size: 13px;
  transition: all .15s;
}
.song-row:hover .row-play, .result-row:hover .row-play,
.song-row.now-playing .row-play { background: var(--grad); color: #fff; }

.row-art { width: 48px; height: 48px; border-radius: 9px; object-fit: cover; background: var(--surface-3); }

.row-main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.row-title { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-playing .row-title { color: #c4b5fd; }
.row-artist { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.row-genre {
  font-size: 11.5px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 999px;
}
.row-dur { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.contrib-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
  transition: border-color .15s;
  max-width: 170px;
}
.contrib-chip:hover { border-color: var(--accent); }
.contrib-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.like-btn {
  display: flex; align-items: center; gap: 5px;
  font-size: 17px; color: var(--muted);
  padding: 6px 8px; border-radius: 999px;
  transition: all .15s;
}
.like-btn:hover { color: #ec4899; }
.like-btn.liked { color: #ec4899; }
.like-count { font-size: 12.5px; font-weight: 700; }

.remove-btn {
  color: var(--muted); font-size: 13px; padding: 8px;
  border-radius: 50%; transition: color .15s;
}
.remove-btn:hover { color: #f76a6a; }

/* ---------- people ---------- */

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.person-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 26px 18px 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: all .18s;
}
.person-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, .5);
  box-shadow: var(--shadow);
}
.person-name { font-weight: 700; font-size: 16.5px; margin-top: 4px; }
.person-role { color: var(--muted); font-size: 13.5px; }
.person-songs { color: var(--muted); font-size: 12px; margin-top: 6px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.tag {
  font-size: 11.5px; font-weight: 600;
  padding: 4px 11px; border-radius: 999px;
  background: rgba(139, 92, 246, .13);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, .25);
}

/* ---------- profile ---------- */

.back-link { color: var(--muted); font-size: 13.5px; font-weight: 600; display: inline-block; margin-bottom: 20px; }
.back-link:hover { color: var(--text); }

.profile-head { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 20px; }
.profile-info h2 { font-size: 28px; letter-spacing: -.03em; }
.profile-info .tag-row { justify-content: flex-start; margin-top: 12px; }
.profile-bio { color: var(--muted); margin-top: 10px; max-width: 60ch; line-height: 1.5; }
.you-badge {
  font-size: 11px; vertical-align: middle;
  background: var(--grad); color: #fff;
  padding: 3px 10px; border-radius: 999px; margin-left: 6px;
}

.common-ground {
  padding: 15px 20px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(139, 92, 246, .14), rgba(236, 72, 153, .08));
  border: 1px solid rgba(139, 92, 246, .3);
  font-size: 14.5px; line-height: 1.5;
  margin: 8px 0 4px;
}

/* ---------- player bar ---------- */

.player-bar[hidden] { display: none; }

.player-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 18px;
  padding: 12px 24px;
  background: rgba(17, 18, 25, .92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
}

.pb-track { display: flex; align-items: center; gap: 13px; min-width: 0; }
.pb-art { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.pb-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pb-title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-artist { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-contrib {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); font-weight: 600;
  margin-top: 2px; padding: 0;
}
.pb-contrib:hover { color: var(--text); }
.pb-contrib .mini-avatar { width: 18px; height: 18px; font-size: 10px; }

.pb-center { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 320px; }
.pb-controls { display: flex; align-items: center; gap: 16px; }
.icon-btn { font-size: 17px; color: var(--muted); transition: color .15s; }
.icon-btn:hover { color: var(--text); }
.pb-mini { font-size: 15px; position: relative; }
.pb-mini-spacer { width: 15px; } /* keeps the play button visually centered */
.icon-btn.on { color: #c4b5fd; }
.icon-btn.on::after {
  content: ''; position: absolute; left: 50%; bottom: -5px;
  width: 4px; height: 4px; border-radius: 50%;
  transform: translateX(-50%);
  background: var(--accent);
}
.pb-play {
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; color: #0b0c10;
  display: grid; place-items: center; font-size: 15px;
  transition: transform .12s;
}
.pb-play:hover { transform: scale(1.07); }

.pb-progress { display: flex; align-items: center; gap: 10px; width: 100%; }
.pb-time { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; width: 34px; }
.pb-rail { flex: 1; height: 5px; border-radius: 99px; background: var(--surface-3); cursor: pointer; overflow: hidden; }
.pb-fill { height: 100%; width: 0; background: var(--grad); border-radius: 99px; }

.pb-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.pb-preview-note { font-size: 11px; color: var(--muted); border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px; }
.pb-full { padding: 9px 16px; font-size: 13px; }

/* ---------- mini-dock ---------- */

.mini-dock[hidden] { display: none; }
.mini-dock {
  position: fixed; right: 16px; bottom: 90px; z-index: 48;
  width: 324px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dock-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px 7px 14px;
}
.dock-label { font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; flex: 1; }
.dock-btn { font-size: 13px; padding: 3px 6px; }
#dock-body { padding: 0 8px 8px; }
#dock-body iframe { width: 100%; border: 0; border-radius: 10px; display: block; }
#dock-body .fp-mount iframe { border-radius: 10px; }

@media (max-width: 860px) {
  .mini-dock { right: 8px; left: 8px; width: auto; }
}

/* ---------- full-song panel ---------- */

.full-panel[hidden] { display: none; }
.full-panel {
  position: fixed; left: 0; right: 0; bottom: 76px; z-index: 49;
  max-width: 720px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px 18px 0 0; border-bottom: none;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .55);
  padding: 14px 18px 16px;
}
.fp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.fp-title { font-weight: 800; font-size: 14px; white-space: nowrap; }
.fp-tabs { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; }
.fp-tab {
  padding: 6px 13px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  transition: all .12s;
}
.fp-tab:hover { color: var(--text); }
.fp-tab.sel { background: var(--grad); color: #fff; border-color: transparent; }
.fp-close { flex-shrink: 0; }
.fp-embed { width: 100%; border: 0; border-radius: 12px; display: block; }
.fp-note { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.fp-note strong { color: var(--text); }
.fp-open { color: #c4b5fd; font-weight: 700; }
.fp-playing-note {
  padding: 18px 20px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(139, 92, 246, .14), rgba(236, 72, 153, .08));
  border: 1px solid rgba(139, 92, 246, .3);
  font-size: 14px; line-height: 1.55; color: var(--text);
}
.fp-playing-note strong { color: #c4b5fd; }

.fp-attach { padding: 4px 0; }
.fp-attach-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.fp-attach-input { flex: 1; min-width: 200px; }

.fp-audio {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.fp-mount.audio { width: 200px; height: 200px; flex-shrink: 0; }
.fp-mount.audio iframe { border-radius: 12px; }
.fp-audio-info { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 180px; }
.fp-audio-title { font-weight: 750; font-size: 16px; }
.fp-audio-artist { font-size: 13.5px; color: var(--muted); }
.fp-audio-info .fp-note { margin-top: 8px; }

/* ---------- modal / onboarding ---------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 6, 10, .7);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  padding: 20px;
  overflow-y: auto;
}
.modal {
  width: 100%; max-width: 470px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px; padding: 30px;
  box-shadow: var(--shadow);
  text-align: center;
  margin: auto;
}
.modal-hero {
  width: 64px; height: 64px; margin: 0 auto 14px;
  border-radius: 18px; background: var(--grad);
  display: grid; place-items: center; font-size: 30px;
  box-shadow: 0 6px 24px rgba(139, 92, 246, .45);
}
.modal h2 { font-size: 24px; letter-spacing: -.02em; }
.modal-sub { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 8px 0 22px; }

.ob-label { font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.ob-sub { color: var(--muted); font-size: 13px; line-height: 1.5; margin: -6px 0 14px; }

.platform-hint {
  font-size: 12.5px; color: var(--muted); line-height: 1.5;
  text-align: left;
  padding: 10px 14px; margin-top: 10px;
  background: rgba(139, 92, 246, .1);
  border: 1px solid rgba(139, 92, 246, .22);
  border-radius: 11px;
  min-height: 40px;
}
.platform-hint a { color: #c4b5fd; font-weight: 700; }
.ob-people {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px; margin-bottom: 16px;
}
.ob-person {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 8px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
  transition: all .15s;
}
.ob-person:hover { border-color: var(--accent); transform: translateY(-2px); }

.ob-form { text-align: left; display: flex; flex-direction: column; gap: 13px; }
.ob-form label { font-size: 13px; font-weight: 700; display: flex; flex-direction: column; gap: 6px; }
.ob-form input {
  padding: 11px 14px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); outline: none; font-weight: 400;
}
.ob-form input:focus { border-color: var(--accent); }

.emoji-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-opt {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 19px; display: grid; place-items: center;
  transition: all .12s;
}
.emoji-opt:hover { transform: scale(1.1); }
.emoji-opt.sel { border-color: var(--accent); background: rgba(139, 92, 246, .18); }

.platform-row { display: flex; flex-wrap: wrap; gap: 7px; }
.platform-opt {
  padding: 8px 15px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--muted);
  transition: all .12s;
}
.platform-opt.sel { border-color: var(--accent); color: var(--text); background: rgba(139, 92, 246, .18); }

.ob-form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

/* ---------- me menu ---------- */

.me-menu {
  position: fixed; top: 66px; right: 24px; z-index: 90;
  width: 240px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 8px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.me-menu-head { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.me-menu-head small { color: var(--muted); }
.me-menu-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px 4px; }
.me-menu-item {
  text-align: left; padding: 9px 10px; border-radius: 9px;
  font-size: 13.5px; font-weight: 600;
  transition: background .12s;
}
.me-menu-item:hover { background: var(--surface-2); }
.me-menu-item.sel { color: #c4b5fd; }
.me-menu-item.danger { color: #f76a6a; border-top: 1px solid var(--border); margin-top: 6px; border-radius: 0 0 9px 9px; }

/* ---------- toasts ---------- */

.toast {
  position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%) translateY(16px);
  z-index: 120;
  background: var(--surface-3); border: 1px solid rgba(139, 92, 246, .4);
  color: var(--text); font-size: 14px; font-weight: 600;
  padding: 12px 22px; border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0; transition: all .25s;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 10px 16px; padding: 12px 16px; }
  .brand-tag { display: none; }
  .tabs { order: 3; width: 100%; justify-content: center; margin-left: 0; }
  .me-chip { margin-left: auto; }
  .page { padding: 22px 16px 60px; }

  .song-row { grid-template-columns: 38px 44px 1fr auto auto; gap: 10px; }
  .row-genre, .row-dur, .song-row .contrib-chip .contrib-name { display: none; }
  .contrib-chip { padding: 4px; max-width: none; }
  .result-row { grid-template-columns: 38px 44px 1fr auto; }
  .result-row .row-dur { display: none; }

  .player-bar { grid-template-columns: 1fr; gap: 8px; padding: 10px 14px 12px; }
  .pb-center { min-width: 0; width: 100%; }
  .pb-right { justify-content: center; }
  .pb-preview-note { display: none; }
  body.has-player .page { padding-bottom: 210px; }
  .full-panel { max-width: none; border-radius: 18px 18px 0 0; }
}
