/* ============ Aurora · Audiophile Music ============ */
:root {
  --bg: #0d0f14;
  --bg-2: #12151d;
  --bg-3: #171b25;
  --line: rgba(255, 255, 255, 0.07);
  --text: #e9ecf2;
  --text-2: #9aa3b5;
  --text-3: #626b7e;
  --gold: #e0aa5e;
  --gold-2: #f0c98c;
  --gold-dim: rgba(224, 170, 94, 0.14);
  --red: #e3654f;
  --radius: 14px;
  --sidebar-w: 264px;
  --player-h: 88px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  font-size: 15px;
}

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

html { scrollbar-color: #2a3040 transparent; }

body {
  font-family: "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(224, 170, 94, 0.07), transparent 60%),
    radial-gradient(700px 380px at -10% 0%, rgba(90, 120, 200, 0.05), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); }
button { font-family: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ol { list-style: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--text-2);
  transition: color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.icon-btn.active { color: var(--gold); }

/* ============ Layout ============ */
.app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============ Sidebar ============ */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  padding: 20px 18px calc(var(--player-h) + 18px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid rgba(224, 170, 94, 0.25);
}
.brand-text strong { display: block; font-size: 18px; letter-spacing: 0.4px; }
.brand-text small { color: var(--text-3); font-size: 11.5px; letter-spacing: 1.6px; text-transform: uppercase; }
.sidebar-close { display: none; margin-left: auto; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--text-2);
  font-weight: 500;
  font-size: 14.5px;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.nav-item.active { background: var(--gold-dim); color: var(--gold); }
.nav-badge {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1px 8px;
  color: var(--text-2);
}

.side-section h3 {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--text-3);
  margin-bottom: 10px;
}
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 11px;
  transition: all 0.15s;
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.2); }
.chip.active { background: var(--gold); border-color: var(--gold); color: #14100a; font-weight: 600; }

.side-footer { margin-top: auto; font-size: 12px; color: var(--text-3); line-height: 1.55; }
.side-footer .dim { margin-top: 4px; opacity: 0.75; }

/* ============ Main ============ */
.main {
  flex: 1;
  min-width: 0;
  padding: 22px 30px calc(var(--player-h) + 40px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.topbar { display: flex; align-items: center; gap: 14px; }
.sidebar-open { display: none; }

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  height: 44px;
  width: min(460px, 100%);
  color: var(--text-3);
  transition: border-color 0.15s;
}
.search:focus-within { border-color: rgba(224, 170, 94, 0.5); color: var(--gold); }
.search input {
  flex: 1;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.search input::placeholder { color: var(--text-3); }

.top-stats { margin-left: auto; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }

/* ---- Hero ---- */
.hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(224, 170, 94, 0.13), rgba(224, 170, 94, 0.02) 45%, rgba(90, 110, 180, 0.06)),
    var(--bg-2);
  padding: 40px 42px;
}
.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(520px 240px at 88% 20%, rgba(224, 170, 94, 0.12), transparent 65%);
  pointer-events: none;
}
.hero-text { position: relative; max-width: 560px; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.hero h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.15;
  font-weight: 700;
}
.hero h1 em { color: var(--gold-2); font-style: italic; }
.hero-sub { margin-top: 12px; color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.hero-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 11px;
  padding: 10px 18px;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-solid { background: var(--gold); color: #17110a; }
.btn-solid:hover { background: var(--gold-2); color: #17110a; transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--line); color: var(--text-2); background: rgba(255, 255, 255, 0.03); }
.btn-ghost:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.22); }

/* ---- Grid ---- */
.view-title { font-family: "Playfair Display", serif; font-size: 24px; font-weight: 700; }
.view-title small { font-family: "Be Vietnam Pro"; font-size: 13px; color: var(--text-3); font-weight: 400; margin-left: 10px; }

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

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); border-color: rgba(224, 170, 94, 0.4); box-shadow: var(--shadow); }

.card-cover {
  position: relative;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #232a3a, #171b25);
  overflow: hidden;
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.card-play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: #17110a;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.18s;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}
.card:hover .card-play { opacity: 1; transform: translateY(0); }
.card-play:hover { background: var(--gold-2); }

.card-playing-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  display: none;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(13, 15, 20, 0.72);
  backdrop-filter: blur(6px);
}
.card.playing .card-playing-badge { display: inline-flex; }
.card-playing-badge i {
  width: 3px;
  background: var(--gold);
  border-radius: 2px;
  animation: eq 0.9s ease-in-out infinite;
}
.card-playing-badge i:nth-child(1) { height: 6px; animation-delay: 0s; }
.card-playing-badge i:nth-child(2) { height: 11px; animation-delay: 0.25s; }
.card-playing-badge i:nth-child(3) { height: 8px; animation-delay: 0.5s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1); } }

.card-fav {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(13, 15, 20, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.card:hover .card-fav, .card-fav.faved { opacity: 1; }
.card-fav:hover { color: var(--red); }
.card-fav.faved { color: var(--red); }

.card-body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 4px; }
.card-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.card-sub { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-sub .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

.empty { text-align: center; color: var(--text-3); padding: 60px 0; }
.empty svg { opacity: 0.4; margin-bottom: 12px; }

.main-footer { margin-top: 26px; font-size: 12px; color: var(--text-3); text-align: center; line-height: 1.6; }

/* ============ Album panel ============ */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.6);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 30;
}
.backdrop.show { opacity: 1; pointer-events: auto; }

.album-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: var(--player-h);
  width: min(560px, 94vw);
  background: var(--bg-2);
  border-left: 1px solid var(--line);
  z-index: 40;
  transform: translateX(105%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.album-panel.open { transform: translateX(0); }

.album-head {
  display: flex;
  gap: 20px;
  padding: 26px 24px 20px;
  border-bottom: 1px solid var(--line);
  position: relative;
  background: linear-gradient(180deg, rgba(224, 170, 94, 0.05), transparent);
}
.album-cover {
  width: 148px;
  height: 148px;
  flex: 0 0 148px;
  border-radius: 12px;
  overflow: hidden;
  background: #232a3a;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-meta { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.album-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--gold);
}
.album-meta h2 {
  font-family: "Playfair Display", serif;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 700;
}
.album-desc {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.album-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.album-tags .chip { font-size: 11.5px; padding: 3px 9px; pointer-events: none; }
.album-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.album-actions .btn { padding: 8px 13px; font-size: 12.5px; }
.panel-close { position: absolute; top: 14px; right: 14px; }

.tracklist { flex: 1; overflow-y: auto; padding: 10px 12px 20px; }
.track-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.13s;
}
.track-item:hover { background: rgba(255, 255, 255, 0.05); }
.track-item.current { background: var(--gold-dim); }
.track-num { width: 24px; text-align: center; font-size: 12.5px; color: var(--text-3); flex: 0 0 24px; }
.track-item.current .track-num { color: var(--gold); }
.track-info { flex: 1; min-width: 0; }
.track-info strong {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-item.current .track-info strong { color: var(--gold-2); }
.track-info span { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.track-eq { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.track-item.current .track-eq { display: inline-flex; }
.track-eq i { width: 3px; background: var(--gold); border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.track-eq i:nth-child(1) { height: 7px; }
.track-eq i:nth-child(2) { height: 13px; animation-delay: 0.25s; }
.track-eq i:nth-child(3) { height: 9px; animation-delay: 0.5s; }

/* ============ Queue panel ============ */
.queue-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: var(--player-h);
  width: min(420px, 94vw);
  background: var(--bg-2);
  border-left: 1px solid var(--line);
  z-index: 45;
  transform: translateX(105%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.queue-panel.open { transform: translateX(0); }
.queue-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 18px 8px; }
.queue-head h2 { font-family: "Playfair Display", serif; font-size: 19px; display: flex; align-items: center; gap: 9px; }
.queue-count { font-size: 12.5px; color: var(--text-3); padding: 0 20px 12px; }
.queue-list { flex: 1; overflow-y: auto; padding: 4px 12px 18px; }

/* ============ Player ============ */
.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--player-h);
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(300px, 2fr) minmax(160px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  background: rgba(16, 19, 26, 0.88);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}

.player-now { display: flex; align-items: center; gap: 13px; min-width: 0; }
.player-cover {
  width: 54px;
  height: 54px;
  border-radius: 9px;
  overflow: hidden;
  flex: 0 0 54px;
  background: #232a3a;
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.player-cover img { width: 100%; height: 100%; object-fit: cover; }
.player-info { min-width: 0; }
.player-info strong {
  display: block;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-info span { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
#plFav.faved { color: var(--red); }

.player-center { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.player-controls { display: flex; align-items: center; gap: 6px; }
.play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: #17110a;
  transition: transform 0.12s, background 0.15s;
}
.play-btn:hover { background: var(--gold-2); transform: scale(1.06); }
.icon-btn.on { color: var(--gold); }
.icon-btn.on::after { content: ""; display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); margin: 1px auto 0; }
.rep-one {
  display: none;
  position: absolute;
  right: 5px;
  bottom: 5px;
  font-size: 8.5px;
  font-weight: 800;
  color: #17110a;
  background: var(--gold);
  border-radius: 50%;
  width: 11px;
  height: 11px;
  line-height: 11px;
  text-align: center;
}
#btnRepeat { position: relative; }
#btnRepeat.rep-one-on .rep-one { display: block; }

.seek { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 560px; }
.seek span { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; width: 38px; }
.seek span:last-child { text-align: left; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--gold) var(--fill, 0%), #2a3040 var(--fill, 0%));
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.25); }
input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #fff; border: none; }
#seekBar { flex: 1; }
#volBar { width: 92px; }

.player-right { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }

/* ============ Toast & boot ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--player-h) + 20px);
  transform: translate(-50%, 16px);
  background: #1d222e;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 11px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 60;
  max-width: min(480px, 90vw);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--text-2);
  transition: opacity 0.4s;
}
.boot.hide { opacity: 0; pointer-events: none; }
.boot-spin {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid #2a3040;
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Responsive ============ */
@media (max-width: 1020px) {
  .player { grid-template-columns: 1fr auto; }
  .player-center { display: none; }
  .seek { display: none; }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: var(--player-h);
    z-index: 46;
    transform: translateX(-102%);
    transition: transform 0.28s ease;
    box-shadow: var(--shadow);
    padding-bottom: 20px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: inline-grid; }
  .sidebar-open { display: inline-grid; }
  .main { padding: 16px 18px calc(var(--player-h) + 30px); }
  .hero { padding: 26px 22px; }
  .top-stats { display: none; }
  .album-head { flex-direction: column; }
  .album-cover { width: 120px; height: 120px; flex-basis: 120px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
}

@media (max-width: 560px) {
  .player { grid-template-columns: 1fr auto; padding: 0 12px; gap: 8px; }
  .player-right #volBar { display: none; }
  .player-cover { width: 44px; height: 44px; flex-basis: 44px; }
}
