:root {
  --gold:       #D4AF37;
  --gold-2:     #F5D77A;
  --gold-deep:  #A07F1E;
  --red:        #B4141A;
  --red-2:      #E23E45;
  --white:      #FFFFFF;
  --ink:        #0B0B0D;
  --ink-2:      #16161A;
  --ink-3:      #1F1F25;
  --line:       rgba(212,175,55,0.18);
  --line-2:     rgba(255,255,255,0.06);
  --txt:        #EDEAE3;
  --txt-dim:    #9A958C;
  --radius:     16px;
  --shadow:     0 10px 40px rgba(0,0,0,0.45);
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(212,175,55,0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(180,20,26,0.14), transparent 55%),
    var(--ink);
  color: var(--txt);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,11,13,0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .row {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: .3px; font-size: 20px;
  color: var(--white);
}
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--ink); font-weight: 800;
  box-shadow: 0 4px 14px rgba(212,175,55,0.35);
}
.nav { display: flex; align-items: center; gap: 18px; }
.nav a, .nav button {
  color: var(--txt-dim); font-size: 14px; font-weight: 500;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.nav a:hover, .nav button:hover { color: var(--gold-2); text-decoration: none; }
.nav .user { color: var(--txt); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; font-family: inherit;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(212,175,55,0.32);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(212,175,55,0.45); text-decoration: none; }
.btn-danger {
  background: linear-gradient(135deg, var(--red-2), var(--red));
  color: var(--white);
  box-shadow: 0 6px 18px rgba(180,20,26,0.32);
}
.btn-danger:hover { text-decoration: none; }
.btn-ghost {
  background: rgba(255,255,255,0.04);
  border-color: var(--line-2); color: var(--txt);
}
.btn-ghost:hover { border-color: var(--line); color: var(--gold-2); text-decoration: none; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 40px 20px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: linear-gradient(180deg, rgba(31,31,37,0.9), rgba(22,22,26,0.95));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 30px;
}
.auth-card .logo {
  text-align: center; margin-bottom: 24px;
}
.auth-card .logo .mark {
  width: 54px; height: 54px; border-radius: 14px;
  display: inline-grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--ink); font-weight: 800; font-size: 24px;
  box-shadow: 0 8px 22px rgba(212,175,55,0.4);
}
.auth-card h1 { font-size: 24px; color: var(--white); margin-top: 14px; }
.auth-card p.sub { color: var(--txt-dim); font-size: 14px; margin-top: 6px; }

.field { margin-bottom: 16px; }
.field label { display:block; font-size: 13px; color: var(--txt-dim); margin-bottom: 6px; font-weight: 500; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--line-2);
  color: var(--txt); font-family: inherit; font-size: 15px;
  transition: border .15s ease, box-shadow .15s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.15);
}
.field input::placeholder { color: #5e5852; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--txt-dim); }

.alert {
  padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-error { background: rgba(180,20,26,0.14); border-color: rgba(180,20,26,0.5); color: #FAD4D6; }
.alert-ok    { background: rgba(212,175,55,0.12); border-color: rgba(212,175,55,0.4); color: var(--gold-2); }

/* ---------- Dashboard layout ---------- */
.dash { padding: 28px 0 120px; }
.dash-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.dash-head h2 { font-size: 26px; color: var(--white); }
.dash-head p { color: var(--txt-dim); font-size: 14px; margin-top: 4px; }

.tabs {
  display: flex; gap: 6px; margin-bottom: 22px; padding: 6px;
  background: rgba(0,0,0,0.3); border: 1px solid var(--line-2);
  border-radius: 12px; width: fit-content;
}
.tab {
  padding: 9px 18px; border-radius: 8px; cursor: pointer; font-weight: 600;
  font-size: 14px; color: var(--txt-dim); border: none; background: none; font-family: inherit;
}
.tab.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--ink);
}

.grid { display: grid; gap: 18px; }
.cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card {
  background: linear-gradient(180deg, rgba(31,31,37,0.85), rgba(22,22,26,0.9));
  border: 1px solid var(--line-2);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .15s ease, border .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--line); box-shadow: var(--shadow); }
.card .cover {
  aspect-ratio: 1; background: linear-gradient(135deg, #2a2a30, #16161a);
  position: relative; overflow: hidden;
}
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card .cover .ph { display: grid; place-items: center; width:100%; height:100%; color: #3a3631; }
.card .body { padding: 14px 16px 16px; }
.card .body h3 { font-size: 16px; color: var(--white); margin-bottom: 4px; }
.card .body p { font-size: 13px; color: var(--txt-dim); overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- Track list ---------- */
.track-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line-2);
  margin-bottom: 8px; transition: border .15s ease, background .15s ease;
}
.track-row:hover { border-color: var(--line); background: rgba(212,175,55,0.06); }
.track-row.playing { border-color: var(--gold); background: rgba(212,175,55,0.1); }
.track-row .idx { width: 28px; text-align: center; color: var(--txt-dim); font-size: 14px; }
.track-row .play-mini {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: var(--ink);
  border: none; flex-shrink: 0;
}
.track-row .info { flex: 1; min-width: 0; }
.track-row .info .t { color: var(--white); font-weight: 600; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-row .info .d { color: var(--txt-dim); font-size: 12px; }
.track-row .row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line-2);
  color: var(--txt-dim); display: grid; place-items: center; font-family: inherit;
}
.icon-btn:hover { color: var(--gold-2); border-color: var(--line); }
.drag-handle { cursor: grab; color: #4a463f; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px); display: none; place-items: center; z-index: 100; padding: 20px;
}
.modal-bg.show { display: grid; }
.modal {
  width: 100%; max-width: 520px;
  background: linear-gradient(180deg, rgba(31,31,37,0.96), rgba(22,22,26,0.98));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 24px;
  max-height: 90vh; overflow-y: auto;
}
.modal h3 { font-size: 20px; color: var(--white); margin-bottom: 18px; }
.modal .close-x {
  float: right; cursor: pointer; color: var(--txt-dim);
  background: none; border: none; font-size: 22px; line-height: 1;
}
.modal .close-x:hover { color: var(--gold-2); }

/* ---------- Player bar ---------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(11,11,13,0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 12px 20px;
  transform: translateY(110%);
  transition: transform .3s ease;
}
.player.show { transform: translateY(0); }
.player .inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center;
}
.player .now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player .now .cov {
  width: 50px; height: 50px; border-radius: 8px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, #2a2a30, #16161a);
}
.player .now .cov img { width: 100%; height: 100%; object-fit: cover; }
.player .now .meta { min-width: 0; }
.player .now .meta .t { color: var(--white); font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .now .meta .s { color: var(--txt-dim); font-size: 12px; }

.player .ctl { display: flex; align-items: center; gap: 10px; justify-content: center; }
.p-btn {
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line-2);
  color: var(--txt); display: grid; place-items: center; font-family: inherit;
}
.p-btn:hover { border-color: var(--line); color: var(--gold-2); }
.p-btn.main {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: var(--ink);
  border: none;
}
.p-btn.main:hover { color: var(--ink); }

.player .vol { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.player .vol input[type=range] { width: 110px; }

.progress {
  display: flex; align-items: center; gap: 10px; margin-top: 6px;
  grid-column: 1 / -1; width: 100%;
}
.progress .bar {
  flex: 1; height: 5px; background: rgba(255,255,255,0.1); border-radius: 3px; cursor: pointer;
  position: relative; overflow: hidden;
}
.progress .bar .fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 3px;
  width: 0%;
}
.progress .time { font-size: 12px; color: var(--txt-dim); min-width: 80px; text-align: right; }

/* ---------- Share page ---------- */
.share-page { min-height: 100vh; padding: 40px 0 140px; }
.share-hero {
  display: flex; gap: 24px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 30px;
}
.share-hero .cov {
  width: 200px; height: 200px; border-radius: 16px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, #2a2a30, #16161a);
  box-shadow: var(--shadow);
}
.share-hero .cov img { width: 100%; height: 100%; object-size: cover; }
.share-hero h1 { font-size: 34px; color: var(--white); margin-bottom: 8px; }
.share-hero p { color: var(--txt-dim); max-width: 600px; }

/* ---------- Range inputs ---------- */
input[type=range] {
  -webkit-appearance: none; appearance: none; height: 5px; border-radius: 3px;
  background: rgba(255,255,255,0.12); outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--ink);
  box-shadow: 0 0 0 2px rgba(212,175,55,0.4);
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--ink);
}

/* ---------- Misc ---------- */
.empty {
  text-align: center; padding: 60px 20px; color: var(--txt-dim);
}
.empty .big { font-size: 40px; margin-bottom: 10px; opacity: .4; }
.spinner {
  width: 22px; height: 22px; border: 2px solid rgba(212,175,55,0.3);
  border-top-color: var(--gold); border-radius: 50%;
  animation: spin 0.8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.muted { color: var(--txt-dim); }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.items-center { align-items: center; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.mb-20 { margin-bottom: 20px; }
.text-sm { font-size: 13px; }
.text-center { text-align: center; }
.upload-drop {
  border: 2px dashed var(--line); border-radius: 12px; padding: 26px;
  text-align: center; color: var(--txt-dim); cursor: pointer;
  transition: border .15s ease, background .15s ease;
}
.upload-drop:hover { border-color: var(--gold); background: rgba(212,175,55,0.05); }
.upload-drop.has { border-color: var(--gold); color: var(--gold-2); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .player .inner { grid-template-columns: 1fr; gap: 8px; }
  .player .vol { justify-content: flex-start; }
  .player .vol input[type=range] { width: 90px; }
  .share-hero .cov { width: 140px; height: 140px; }
  .share-hero h1 { font-size: 26px; }
  .dash-head h2 { font-size: 22px; }
  .topbar .row { height: 58px; }
}
