:root {
  --bg: #0b0b0d;
  --card: #141418;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f2f0ec;
  --muted: #8d8a93;
  --gold: #e8c26b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: 560px; margin: 0 auto; padding: calc(20px + env(safe-area-inset-top)) 16px 40px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.empty { text-align: center; margin-top: 30vh; }

/* ---------- Notes ---------- */
.score {
  flex: none;
  min-width: 2.6em;
  padding: 3px 8px;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--h) 75% 68%);
  background: hsl(var(--h) 60% 50% / 0.14);
}
.score.none { color: var(--muted); background: rgba(255, 255, 255, 0.04); }
.score.big { font-size: 18px; padding: 6px 10px; }
.score.huge { font-size: 40px; line-height: 1; padding: 8px 14px; border-radius: 14px; min-width: 0; }

/* ---------- Accueil ---------- */
.home-head h1 { margin: 8px 0 0; font-size: 32px; letter-spacing: -0.02em; }
.home-head p { margin: 0 0 20px; }
.albums { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.album-card {
  display: flex; align-items: center; gap: 14px;
  padding: 10px; border-radius: 14px; background: var(--card); text-decoration: none;
}
.album-card img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: #222; }
.album-card .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.album-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Album (format capture d'écran) ---------- */
.sheet { background: var(--card); border-radius: 20px; padding: 18px 16px 8px; }
.album-head { display: flex; gap: 16px; align-items: center; }
.cover { width: 132px; height: 132px; flex: none; border-radius: 12px; object-fit: cover; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.head-text { min-width: 0; }
.kicker { margin: 0; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.album-head h1 { margin: 2px 0 10px; font-size: 28px; line-height: 1.1; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.avg { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; }
.avg .of { color: var(--muted); font-weight: 600; }
.avg .small { flex-basis: 100%; }
.review { margin: 16px 0 4px; white-space: pre-wrap; color: #d9d6d0; }

.tracks { list-style: none; margin: 14px 0 0; padding: 0; }
.track { padding: 11px 0; border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; }
.num { flex: none; width: 1.6em; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.title { font-weight: 600; }
.feat { font-size: 12px; color: var(--muted); }
.comment { margin: 6px 0 0 31px; color: #cfccc6; font-size: 14px; white-space: pre-wrap; }
.prod { margin: 4px 0 0 31px; font-size: 12px; color: var(--muted); }
.prod span { color: var(--gold); font-style: italic; }
/* Crédits en bas de la fiche */
.credits { margin-top: 6px; padding: 14px 0 10px; border-top: 1px solid var(--line); font-size: 13px; }
.credits h2 { margin: 0 0 8px; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.producers { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 3px; }
.producers li { display: flex; gap: 10px; justify-content: space-between; }
.producers .who { font-weight: 600; }
.producers .on { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.credits .role { margin: 2px 0 0; color: #cfccc6; }
.credits .role span { color: var(--muted); }
.credits .role span::after { content: ' · '; }
.back { text-align: center; margin-top: 20px; font-size: 13px; }
.back a { color: var(--muted); text-decoration: none; }

@media (max-width: 380px) {
  .cover { width: 104px; height: 104px; }
  .album-head h1 { font-size: 23px; }
  .score.huge { font-size: 32px; }
}

/* ---------- Admin ---------- */
.adm-title { font-size: 22px; margin: 4px 0 16px; }
.adm input, .adm textarea {
  width: 100%; font: inherit; color: var(--text); background: #0f0f12;
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
}
.adm input:focus, .adm textarea:focus { outline: none; border-color: var(--gold); }
.adm textarea { resize: vertical; margin-top: 8px; }
.adm .ed-track input:not(.rating) { margin-top: 6px; font-size: 13px; }
.adm input.rating { width: 4.2em; flex: none; text-align: center; font-weight: 700; }
.adm input.invalid { border-color: #e5484d; }
.adm-add { display: flex; gap: 8px; }
.btn {
  flex: none; display: inline-block; font: inherit; font-weight: 600; color: #1a1408; background: var(--gold);
  border: 0; border-radius: 10px; padding: 9px 14px; cursor: pointer; text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: #ff8080; border: 1px solid rgba(255, 90, 90, 0.35); }
.adm .albums { margin-top: 12px; }
.adm .album-card { width: 100%; border: 1px solid transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.adm .album-card img { width: 44px; height: 44px; }
.adm .album-card.active { border-color: var(--gold); }
#editor { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.ed-head { display: flex; gap: 14px; align-items: center; }
.ed-head h2 { margin: 0; font-size: 20px; }
.ed-head p { margin: 0; }
.small-cover { width: 72px; height: 72px; }
.ed-track { padding: 12px 0; border-top: 1px solid var(--line); }
.ed-credits { margin-top: 12px; }
.ed-credits p { margin: 6px 0 0; }
.adm .btn:disabled { opacity: 0.5; cursor: wait; }
.ed-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-top: 16px; }
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: #24242a; padding: 8px 14px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #4a1d20; }
