/* ============================================================
   AubeMusic — UI premium (inspirations: Deezer · Apple Music · Spotify)
   Palette signée Aube : aube orangée sur nuit profonde
   ============================================================ */

:root {
  /* === THÈME CLAIR par défaut : éditorial papier, ouvert et accessible === */
  --bg: #f5f1ea;          /* papier chaud */
  --bg-sidebar: #fffdf9;  /* crème */
  --bg-elev: #ffffff;     /* cartes */
  --bg-elev-2: #efe9df;   /* champs */
  --bg-elev-3: #e5ddd0;
  --bg-hover: rgba(40, 28, 16, .05);
  --bg-active: rgba(40, 28, 16, .09);
  --bg-glass: rgba(255, 253, 249, .82);  /* topbar translucide */

  --fg: #211b14;          /* encre quasi-noire chaude */
  --fg-mid: #4a4239;
  --muted: #756c60;
  --muted-2: #a89e90;

  --aube-1: #ffb347; /* aube claire */
  --aube-2: #ff7a59; /* aube orangée */
  --aube-3: #d94f3a; /* horizon */
  --accent: #c43d28; /* horizon foncé : contraste AA sur papier (texte/liens/actifs) */
  --danger: #c81e4a;
  --success: #1f8f4e;

  --gradient-aube: linear-gradient(135deg, #ffb347 0%, #ff7a59 55%, #d94f3a 100%);
  --gradient-night: linear-gradient(180deg, #fffdf9 0%, #f5f1ea 100%);

  --border: rgba(40, 28, 16, .12);
  --border-strong: rgba(40, 28, 16, .20);
  --shadow-1: 0 1px 2px rgba(60,40,20,.08);
  --shadow-2: 0 8px 24px rgba(60,40,20,.12);
  --shadow-3: 0 20px 60px rgba(60,40,20,.18);

  --on-fg: #ffffff;       /* texte/contenu sur surface --fg (boutons play) */
  --tint-1: rgba(40, 28, 16, .05);
  --tint-2: rgba(40, 28, 16, .08);
  --tint-strong: rgba(40, 28, 16, .14);
  --scrollbar: rgba(40, 28, 16, .22);
  --scrollbar-hover: rgba(40, 28, 16, .36);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --sidebar-w: 264px;
  --player-h: 96px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", Roboto, sans-serif;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

/* === THÈME SOMBRE (toggle, persistant) === */
:root[data-theme="dark"] {
  --bg: #07080b;
  --bg-sidebar: #0d0e12;
  --bg-elev: #121319;
  --bg-elev-2: #1a1c25;
  --bg-elev-3: #232633;
  --bg-hover: rgba(255, 255, 255, .06);
  --bg-active: rgba(255, 255, 255, .1);
  --bg-glass: rgba(7, 8, 11, .78);

  --fg: #f3f5fa;
  --fg-mid: #cfd4e0;
  --muted: #8b91a3;
  --muted-2: #5d6273;

  --accent: #ff7a59;
  --danger: #ff4d6d;
  --success: #4ade80;

  --gradient-night: linear-gradient(180deg, #0d0e12 0%, #07080b 100%);

  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .12);
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 8px 24px rgba(0,0,0,.45);
  --shadow-3: 0 20px 60px rgba(0,0,0,.55);

  --on-fg: #07080b;
  --tint-1: rgba(255, 255, 255, .05);
  --tint-2: rgba(255, 255, 255, .09);
  --tint-strong: rgba(255, 255, 255, .16);
  --scrollbar: rgba(255, 255, 255, .08);
  --scrollbar-hover: rgba(255, 255, 255, .18);
}

/* Le lecteur plein écran reste immersif sombre dans les 2 thèmes (cinéma) */
.now-fullscreen {
  --fg: #f3f5fa;
  --fg-mid: #cfd4e0;
  --muted: #9aa0b0;
  --muted-2: #5d6273;
  --bg-hover: rgba(255, 255, 255, .08);
  --border: rgba(255, 255, 255, .12);
  --on-fg: #07080b;
  --accent: #ff9d7a;
  --gradient-night: linear-gradient(180deg, #15171f 0%, #0a0b0f 100%);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "liga", "ss01";
}
button { font-family: inherit; }
::selection { background: rgba(255,122,89,.4); color: #fff; }

/* ---------- Scrollbars dark ---------- */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); background-clip: padding-box; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-body {
  display: flex; align-items: center; justify-content: center;
  height: 100vh;
  background:
    radial-gradient(800px 600px at 80% -10%, rgba(255,122,89,.18), transparent 60%),
    radial-gradient(700px 500px at 10% 110%, rgba(217,79,58,.12), transparent 60%),
    var(--bg);
}
.auth-wrap { width: 100%; max-width: 440px; padding: 24px; }
.auth-card {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(14px);
}
.auth-card h2 { margin: 16px 0 6px; font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.auth-card .subtitle { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-disc {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient-aube);
  box-shadow:
    inset 0 0 0 5px var(--bg-sidebar),
    0 0 0 2px rgba(255,122,89,.4),
    0 8px 24px rgba(255,122,89,.25);
  position: relative;
}
.logo-disc::after {
  content: ""; position: absolute; inset: 14px; border-radius: 50%;
  background: var(--bg-sidebar);
}
.logo-text { font-weight: 800; letter-spacing: -.3px; font-size: 18px; }

.field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.field input {
  background: var(--bg-elev-2);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px; outline: none;
  transition: border-color .15s, background .15s;
}
.field input:focus {
  border-color: var(--accent);
  background: var(--bg-elev);
}
.btn {
  width: 100%; padding: 13px;
  border: 0; border-radius: 999px;
  font-size: 14px; font-weight: 700;
  cursor: pointer; letter-spacing: .3px;
}
.btn-primary {
  background: var(--gradient-aube);
  color: #1a0f05;
  padding: 11px 22px; border: 0;
  border-radius: 999px;
  font-weight: 700; cursor: pointer; font-size: 14px;
  letter-spacing: .2px;
  box-shadow: 0 6px 22px rgba(255,122,89,.35);
  transition: transform .12s, filter .15s, box-shadow .15s;
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-ghost {
  background: var(--tint-1);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px; cursor: pointer; width: 100%;
  text-align: left;
  display: flex; align-items: center; gap: 10px;
  transition: background .15s, border-color .15s;
}
.btn-ghost:hover { background: var(--tint-2); border-color: var(--border-strong); }
.btn-ghost svg { width: 16px; height: 16px; flex-shrink: 0; }

.error {
  background: rgba(200,30,74,.12);
  border: 1px solid rgba(200,30,74,.32);
  color: var(--danger);
  padding: 12px 14px; border-radius: 10px;
  font-size: 13px; margin-bottom: 16px;
}
.hint { color: var(--muted); font-size: 13px; margin-top: 8px; }
.hint code { background: var(--tint-1); padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr var(--player-h);
  grid-template-areas:
    "sidebar content"
    "player  player";
  height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 22px 12px 14px;
  display: flex; flex-direction: column; gap: 16px;
  overflow: hidden;
}
.sidebar .logo { padding: 0 10px 4px; }
.sidebar nav { display: flex; flex-direction: column; gap: 1px; padding: 0 4px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer; text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: color .12s, background .12s;
}
.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-link:hover { color: var(--fg); background: var(--bg-hover); }
.nav-link.active { color: var(--fg); background: var(--bg-active); font-weight: 600; }
.nav-link.active svg { color: var(--accent); }

.sidebar-section {
  display: flex; flex-direction: column; gap: 8px;
  padding: 0 6px;
}
.sidebar-section .head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 6px 4px;
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.sidebar-section .head button {
  background: transparent; border: 0;
  color: var(--muted); cursor: pointer;
  padding: 2px 6px; font-size: 14px;
  border-radius: 4px; display: inline-flex; align-items: center;
  transition: color .12s, background .12s;
}
.sidebar-section .head button:hover { color: var(--fg); background: var(--bg-hover); }
.sidebar-section .head button svg { width: 14px; height: 14px; }

.sidebar-playlists {
  display: flex; flex-direction: column; gap: 1px;
  overflow-y: auto;
  max-height: 36vh;
  padding: 0 6px 8px;
}
.sidebar-playlists .pl {
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .12s, background .12s;
}
.sidebar-playlists .pl:hover { color: var(--fg); background: var(--bg-hover); }
.sidebar-playlists .pl.active { color: var(--accent); background: var(--bg-hover); }

.sidebar-foot {
  margin-top: auto;
  padding: 12px;
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.sidebar-foot .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gradient-aube);
  display: flex; align-items: center; justify-content: center;
  color: #1a0f05; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.sidebar-foot .user-info { flex: 1; min-width: 0; }
.sidebar-foot .user {
  color: var(--fg); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-foot .logout {
  color: var(--muted); font-size: 11px;
  text-decoration: none;
  transition: color .12s;
}
.sidebar-foot .logout:hover { color: var(--accent); }

/* ---------- Content ---------- */
.content {
  grid-area: content;
  overflow-y: auto;
  position: relative;
  background:
    radial-gradient(1400px 800px at 50% -20%, var(--ambient-tint, rgba(255,122,89,.07)) 0%, transparent 60%),
    var(--bg);
  transition: background .8s ease;
}

.topbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg-glass);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  display: flex; gap: 12px; align-items: center;
  padding: 14px 28px; border-bottom: 1px solid var(--border);
}
.topbar .search-wrap {
  position: relative; flex: 1; max-width: 540px;
}
.topbar .search-wrap svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted);
  pointer-events: none;
}
.topbar input.search {
  width: 100%;
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px 10px 40px;
  font-size: 14px; outline: none;
  transition: border-color .15s, background .15s;
}
.topbar input.search:focus {
  border-color: var(--accent);
  background: var(--bg-elev-2);
}
.topbar select {
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.topbar select:hover { background: var(--bg-elev-2); }

.view { padding: 26px 32px 60px; }

/* ---------- Section headers ---------- */
.section-title {
  font-size: 22px; font-weight: 800; margin: 28px 0 14px;
  letter-spacing: -.3px;
  display: flex; align-items: center; gap: 12px;
}
.section-title .badge {
  background: var(--bg-elev);
  color: var(--muted); font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
}
.section-title .see-all {
  margin-left: auto; font-size: 13px; color: var(--muted);
  cursor: pointer; font-weight: 500;
  transition: color .12s;
}
.section-title .see-all:hover { color: var(--fg); }

.hero-greet {
  font-size: 34px; font-weight: 800; letter-spacing: -.7px;
  margin: 8px 0 0;
  background: linear-gradient(180deg, #fff, #b8bdcd);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub { color: var(--muted); margin: 4px 0 18px; font-size: 14px; }

/* ---------- Quick links (Apple Music style "made for you") ---------- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.quick {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-elev);
  border-radius: 8px;
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  position: relative; overflow: hidden;
  transition: background .15s;
}
.quick:hover { background: var(--bg-elev-2); }
.quick .cov-mini {
  width: 56px; height: 56px; border-radius: 6px;
  background: var(--gradient-aube);
  background-size: cover; background-position: center;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #1a0f05; font-weight: 700;
}
.quick .title {
  flex: 1; min-width: 0;
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quick .play-mini {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient-aube); color: #1a0f05;
  border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateX(4px);
  transition: opacity .15s, transform .15s;
}
.quick:hover .play-mini { opacity: 1; transform: translateX(0); }

/* ---------- Cards (album / artist / playlist) ---------- */
.h-scroll {
  display: flex; gap: 16px; overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.h-scroll .card { flex: 0 0 200px; scroll-snap-align: start; }
.h-scroll::-webkit-scrollbar { height: 6px; }

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.card {
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  position: relative;
  transition: background .18s, transform .18s;
}
.card:hover { background: var(--bg-elev-2); }
.cover {
  aspect-ratio: 1/1;
  border-radius: 8px;
  margin-bottom: 12px;
  background: var(--gradient-aube);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: #1a0f05; font-weight: 800;
  box-shadow: var(--shadow-2);
  position: relative;
  overflow: hidden;
}
.cover.has-img { background-color: var(--bg-elev-3); }
.cover-round { border-radius: 50%; }
.cover-lg {
  width: 220px; height: 220px;
  font-size: 72px; margin: 0;
  flex-shrink: 0;
}
.cover-xl {
  width: 280px; height: 280px;
  font-size: 96px; margin: 0;
  flex-shrink: 0;
}
.card .title {
  font-size: 14px; font-weight: 600; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card .meta {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cover-wrap { position: relative; }
.card-play {
  position: absolute; right: 8px; bottom: 8px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gradient-aube);
  color: #1a0f05; border: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(8px) scale(.9);
  transition: opacity .2s, transform .2s, filter .15s;
  box-shadow: 0 8px 22px rgba(255,122,89,.4);
}
.card-play svg { width: 18px; height: 18px; }
.card:hover .card-play { opacity: 1; transform: translateY(0) scale(1); }
.card-play:hover { filter: brightness(1.1); }

.playlist-card { position: relative; }
.card-del {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,.7); color: var(--fg);
  border: 0; width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.card-del svg { width: 14px; height: 14px; }
.card:hover .card-del { opacity: 1; }
.card-del:hover { background: var(--danger); }

/* ---------- Track list ---------- */
.track-list { display: flex; flex-direction: column; }
.track-head {
  display: grid;
  grid-template-columns: 36px 48px 1fr 170px 70px 60px 36px 36px;
  gap: 14px; align-items: center;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.track-row {
  display: grid;
  grid-template-columns: 36px 48px 1fr 170px 70px 60px 36px 36px;
  align-items: center; gap: 14px;
  padding: 8px 14px;
  border-radius: 8px; cursor: pointer;
  font-size: 14px;
  transition: background .12s;
}
.track-row:hover { background: var(--bg-hover); }
.track-row.playing { background: rgba(255,122,89,.08); }
.track-row.playing .tmeta .t1 { color: var(--accent); }
.track-row .idx {
  color: var(--muted); font-size: 13px;
  text-align: right;
  display: flex; align-items: center; justify-content: flex-end;
}
.track-row:hover .idx-num { display: none; }
.track-row:hover .idx-play { display: inline-flex; }
.track-row .idx-play { display: none; align-items: center; justify-content: center; }
.track-row .idx-play svg { width: 14px; height: 14px; color: var(--fg); }
.track-row .cov {
  width: 48px; height: 48px; border-radius: 6px;
  background: var(--gradient-aube); background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #1a0f05; font-weight: 700;
  flex-shrink: 0;
  box-shadow: var(--shadow-1);
}
.track-row .cov.has-img { background-color: var(--bg-elev-3); }
.track-row .tmeta { min-width: 0; }
.track-row .tmeta .t1 {
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 14px;
}
.track-row .tmeta .t2 {
  color: var(--muted); font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-row .al {
  color: var(--muted); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-row .plays {
  color: var(--muted); font-size: 12px; text-align: right;
}
.track-row .dur {
  color: var(--muted); font-size: 12px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.track-row .tr-like,
.track-row .tr-menu {
  background: transparent; border: 0;
  color: var(--muted); cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .12s, background .12s, color .12s;
}
.track-row .tr-like svg, .track-row .tr-menu svg { width: 16px; height: 16px; }
.track-row .tr-like[data-liked="1"] { opacity: 1; color: var(--accent); }
.track-row:hover .tr-like,
.track-row:hover .tr-menu { opacity: 1; }
.track-row .tr-like:hover,
.track-row .tr-menu:hover { color: var(--fg); background: var(--bg-hover); }

@media (max-width: 1080px) {
  .track-head, .track-row {
    grid-template-columns: 32px 48px 1fr 60px 32px 32px;
  }
  .track-row .al, .track-row .plays,
  .track-head .al, .track-head .plays { display: none; }
}

/* ---------- Context menu ---------- */
.ctx-menu {
  position: fixed; z-index: 200;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  min-width: 230px; max-height: 400px; overflow-y: auto;
  padding: 6px;
  backdrop-filter: blur(20px);
}
.ctx-section {
  font-size: 11px; color: var(--muted);
  padding: 8px 12px 4px;
  text-transform: uppercase; letter-spacing: 1px;
}
.ctx-item {
  padding: 9px 12px;
  font-size: 13px; border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .1s, color .1s;
}
.ctx-item svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--muted); }
.ctx-item:hover { background: var(--bg-hover); }
.ctx-item:hover svg { color: var(--fg); }
.ctx-item.disabled { color: var(--muted); cursor: default; }
.ctx-item.disabled:hover { background: transparent; }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger svg { color: var(--danger); }
.ctx-item.danger:hover { background: rgba(255,77,109,.12); }
.ctx-sep { height: 1px; background: var(--border); margin: 4px 8px; }

/* ---------- Detail head ---------- */
.detail-head {
  display: flex; gap: 28px; align-items: flex-end;
  padding: 28px 0 32px;
  margin-bottom: 8px;
}
.detail-head .head-info { flex: 1; min-width: 0; }
.detail-head .kicker {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.detail-head h1 {
  margin: 0 0 8px;
  font-size: 56px; line-height: 1.05;
  font-weight: 800; letter-spacing: -1.5px;
  background: linear-gradient(180deg, #fff 0%, #c8cdda 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.detail-head .bio {
  color: var(--fg-mid); margin: 0 0 16px;
  max-width: 720px; line-height: 1.55; font-size: 14px;
}
.detail-head .meta-row {
  color: var(--muted); margin: 8px 0 18px;
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.detail-head .meta-row .dot { color: var(--muted-2); }
.detail-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-ghost-inline {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border-strong);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, border-color .15s;
}
.btn-ghost-inline:hover { background: var(--bg-hover); border-color: var(--fg); }
.btn-ghost-inline svg { width: 14px; height: 14px; }

.empty {
  padding: 60px 20px; text-align: center; color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  margin: 12px 0;
}
.empty p { margin: 8px 0 0; font-size: 14px; }
.empty .big { font-size: 16px; color: var(--fg-mid); font-weight: 600; }
.loading { padding: 60px 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: calc(var(--player-h) + 20px);
  left: 50%; transform: translateX(-50%);
  background: var(--bg-elev-2);
  color: var(--fg);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow-3);
  border: 1px solid var(--border-strong);
  z-index: 1000;
  animation: toast-in .2s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Queue panel ---------- */
.queue-panel {
  position: fixed;
  right: 14px; top: 14px;
  bottom: calc(var(--player-h) + 14px);
  width: 340px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  z-index: 20;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: queue-in .22s ease-out;
}
@keyframes queue-in {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}
.queue-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.queue-head strong { font-size: 14px; font-weight: 700; }
.queue-list { flex: 1; overflow-y: auto; padding: 6px; }
.queue-item {
  display: grid;
  grid-template-columns: 36px 1fr 40px;
  gap: 10px; align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background .12s;
}
.queue-item:hover { background: var(--bg-hover); }
.queue-item.active { background: rgba(255,122,89,.1); }
.queue-item.active .qi-title { color: var(--accent); }
.queue-item .qi-cov {
  width: 36px; height: 36px; border-radius: 4px;
  background: var(--gradient-aube); background-size: cover; background-position: center;
  flex-shrink: 0;
}
.queue-item .qi-cov.has-img { background-color: var(--bg-elev-3); }
.qi-title {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qi-sub {
  color: var(--muted); font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qi-dur { color: var(--muted); font-size: 11px; text-align: right; }

/* ---------- Upload modal ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-inner {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  min-width: 480px; max-width: 92vw;
  box-shadow: var(--shadow-3);
}
.modal-inner h3 { margin: 0 0 18px; font-size: 18px; font-weight: 700; }
#upload-list { max-height: 320px; overflow-y: auto; margin-bottom: 18px; }
.up-row {
  display: flex; justify-content: space-between; gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  background: var(--bg-elev-2);
  margin-bottom: 6px;
}
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.up-status { color: var(--muted); font-size: 12px; }
.up-status.ok { color: var(--success); }
.up-status.ko { color: var(--danger); }
.up-status.dup { color: var(--aube-1); }

/* ---------- Player (bottom) ---------- */
.player {
  grid-area: player;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  gap: 16px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
  padding: 0 20px;
  position: relative;
  z-index: 30;
}
.player::before {
  content: ""; position: absolute; inset: 0;
  background: var(--player-tint, transparent);
  opacity: .35; pointer-events: none;
  transition: background 1s ease;
}
.player > * { position: relative; z-index: 1; }

.now {
  display: flex; align-items: center; gap: 14px;
  min-width: 0;
  cursor: pointer;
}
.now-cover {
  width: 60px; height: 60px;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--gradient-aube); background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #1a0f05; font-weight: 700;
  box-shadow: var(--shadow-1);
}
.now-cover.has-img { background-color: var(--bg-elev-3); }
.now-meta { min-width: 0; flex: 1; }
.now-title {
  font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.now-artist {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.now-actions {
  display: flex; align-items: center; gap: 4px;
  flex-shrink: 0;
}

.controls {
  display: flex; flex-direction: column;
  gap: 6px; align-items: center;
}
.ctrl-row {
  display: flex; gap: 10px; align-items: center;
}
.icon-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: color .12s, background .12s;
  padding: 0;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--fg); }
.icon-btn.active { color: var(--accent); }
.icon-btn.active::after {
  content: ""; width: 4px; height: 4px;
  border-radius: 50%; background: var(--accent);
  position: absolute; bottom: -4px;
}
.icon-btn { position: relative; }

.play-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--on-fg);
  border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s, background .12s;
}
.play-btn svg { width: 16px; height: 16px; }
.play-btn:hover { transform: scale(1.05); filter: brightness(1.08); }

.progress-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 620px;
  font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.progress-row input[type=range] { flex: 1; }

.extras {
  display: flex; align-items: center; gap: 4px;
  justify-content: flex-end;
}
.extras .vol-wrap {
  display: flex; align-items: center; gap: 8px;
  width: 120px;
}
.extras input[type=range] { flex: 1; }

/* ---------- Range slider ---------- */
input[type=range] {
  -webkit-appearance: none; appearance: none;
  height: 4px;
  background: var(--bg-elev-3);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  position: relative;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--fg);
  cursor: pointer;
  transition: transform .12s, background .12s;
  margin-top: 0;
}
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.15); background: var(--accent); }
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; border: 0;
  background: var(--fg); cursor: pointer;
}
input[type=range]:hover::-moz-range-thumb { background: var(--accent); }

.range-filled {
  --pct: 0%;
  background: linear-gradient(to right, var(--accent) var(--pct), var(--bg-elev-3) var(--pct));
}

/* ============================================================
   NOW-PLAYING — vue plein écran (Apple Music style)
   ============================================================ */
.now-fullscreen {
  position: fixed; inset: 0;
  background: var(--np-bg, var(--gradient-night));
  background-size: cover; background-position: center;
  z-index: 60;
  display: flex; flex-direction: column;
  animation: np-in .35s ease-out;
}
@keyframes np-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.now-fullscreen::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,8,11,.55), rgba(7,8,11,.85));
  backdrop-filter: blur(40px) saturate(140%);
  -webkit-backdrop-filter: blur(40px) saturate(140%);
}
.np-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-rows: auto 1fr auto;
  height: 100%;
  padding: 22px 36px 30px;
  max-width: 980px; margin: 0 auto; width: 100%;
}
.np-top {
  display: flex; justify-content: space-between; align-items: center;
}
.np-close, .np-more {
  background: rgba(255,255,255,.08);
  border: 0;
  color: var(--fg);
  cursor: pointer;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.np-close:hover, .np-more:hover { background: rgba(255,255,255,.18); }
.np-close svg, .np-more svg { width: 18px; height: 18px; }
.np-body {
  display: flex; align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 28px;
}
.np-cover {
  width: min(380px, 60vh); aspect-ratio: 1/1;
  border-radius: var(--radius-lg);
  background: var(--gradient-aube);
  background-size: cover; background-position: center;
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  font-size: 96px; color: #1a0f05; font-weight: 800;
}
.np-cover.has-img { background-color: var(--bg-elev-3); }
.np-info {
  text-align: center;
  max-width: 580px;
}
.np-title {
  font-size: 26px; font-weight: 800; letter-spacing: -.5px;
  margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.np-artist {
  color: var(--fg-mid); margin: 4px 0 0;
  font-size: 16px;
}
.np-controls {
  display: flex; flex-direction: column; gap: 14px;
}
.np-seek-row {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.np-seek-row input[type=range] { flex: 1; height: 5px; }
.np-ctrl-row {
  display: flex; align-items: center; justify-content: center;
  gap: 28px;
}
.np-ctrl-row .icon-btn { width: 44px; height: 44px; }
.np-ctrl-row .icon-btn svg { width: 22px; height: 22px; }
.np-play {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--fg); color: var(--on-fg);
  border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s;
}
.np-play svg { width: 28px; height: 28px; }
.np-play:hover { transform: scale(1.04); }
.np-bottom-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding-top: 8px;
}
.np-vol { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 180px; }
.np-vol input[type=range] { flex: 1; }

@media (max-width: 720px) {
  .np-inner { padding: 16px 18px 22px; }
  .np-cover { width: min(280px, 50vh); font-size: 72px; }
  .np-title { font-size: 22px; }
}

/* ---------- Search results layout ---------- */
.search-section { margin-bottom: 24px; }
.search-section .section-title { margin-top: 16px; }

/* ---------- Skeleton loading ---------- */
.skel {
  background: linear-gradient(90deg, var(--bg-elev) 0%, var(--bg-elev-2) 50%, var(--bg-elev) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Mobile responsive (web) ---------- */
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; --player-h: 70px; }
  .app {
    grid-template-columns: 1fr;
    grid-template-areas: "content" "player";
  }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 280px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .topbar { padding: 12px 16px; }
  .view { padding: 16px; }
  .detail-head { flex-direction: column; align-items: flex-start; }
  .detail-head .cover-lg, .detail-head .cover-xl { width: 200px; height: 200px; font-size: 56px; }
  .detail-head h1 { font-size: 36px; }
  .player { padding: 0 12px; grid-template-columns: 1fr auto; }
  .player .extras { display: none; }
  .progress-row { display: none; }
  .now-actions .icon-btn:nth-child(n+2) { display: none; }
  .ctrl-row { gap: 6px; }
}

/* ---------- Burger menu (mobile) ---------- */
.burger {
  display: none;
  background: var(--bg-elev);
  border: 0;
  color: var(--fg);
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  align-items: center; justify-content: center;
}
.burger svg { width: 18px; height: 18px; }
@media (max-width: 860px) {
  .burger { display: inline-flex; }
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 45;
}
.sidebar-overlay.show { display: block; }

/* ============================================================
   LOT 1 — Flow/Radio · Paroles synchronisées · File avancée · Albums aimés
   ============================================================ */

/* ---- Accueil : bouton Flow ---- */
.hero-cta {
  display: flex; align-items: center; gap: 16px;
  margin: 2px 0 24px; flex-wrap: wrap;
}
.btn-flow { display: inline-flex; align-items: center; gap: 8px; }
.btn-flow svg { width: 16px; height: 16px; }
.hero-cta-note { color: var(--muted); font-size: 13px; }

/* ---- Now Playing : scène cover ⇄ paroles ---- */
.np-stage {
  position: relative; min-height: 0;
  display: flex; align-items: center; justify-content: center;
}
.np-lyrics {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; overflow-y: auto;
  padding: 6px 4px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 9%, #000 90%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 9%, #000 90%, transparent);
}
.lrc-lines { display: flex; flex-direction: column; gap: 4px; padding: 16vh 8px; }
.lrc-lines.synced { text-align: center; }
.lrc-line {
  margin: 0; padding: 6px 12px;
  font-size: 22px; font-weight: 700; line-height: 1.32; letter-spacing: -.3px;
  color: rgba(243,245,250,.32); border-radius: 8px; cursor: pointer;
  transition: color .25s ease, transform .25s ease, background .15s;
}
.lrc-lines.synced .lrc-line:hover { background: rgba(255,255,255,.05); }
.lrc-line.active { color: var(--fg); transform: scale(1.015); }
.lrc-line.static {
  font-size: 16px; font-weight: 500; color: var(--fg-mid);
  cursor: default; text-align: center; padding: 2px 12px;
}
.lrc-lines.plain { padding: 22px 8px; }
.lrc-empty {
  margin: auto; text-align: center; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px;
}
.lrc-empty-big { font-size: 20px; font-weight: 700; color: var(--fg-mid); }
.lrc-foot { display: flex; justify-content: center; padding: 14px 0 6px; }
.lrc-edit {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.08); color: var(--fg);
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.lrc-edit:hover { background: rgba(255,255,255,.16); }
.lrc-edit svg { width: 15px; height: 15px; }
#np-lyrics-btn.active { color: var(--accent); }

/* ---- File d'attente : poignée + retrait + glisser-déposer ---- */
.queue-head-actions { display: flex; align-items: center; gap: 8px; }
.queue-clear {
  background: none; border: 0; color: var(--muted);
  font-size: 12px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
  transition: color .15s, background .15s;
}
.queue-clear:hover { color: var(--danger); background: rgba(255,77,109,.1); }
.queue-item { grid-template-columns: 16px 36px 1fr auto 26px; }
.qi-meta { min-width: 0; }
.qi-grip {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2); cursor: grab;
}
.qi-grip svg { width: 14px; height: 14px; }
.qi-remove {
  background: none; border: 0; color: var(--muted-2); cursor: pointer;
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .12s, color .12s, background .12s;
}
.queue-item:hover .qi-remove { opacity: 1; }
.qi-remove:hover { color: var(--danger); background: rgba(255,77,109,.12); }
.qi-remove svg { width: 13px; height: 13px; }
.queue-item.dragging { opacity: .4; }
.queue-item.drop-target { box-shadow: inset 0 2px 0 var(--accent); }

/* ---- Modale paroles ---- */
.modal-hint { color: var(--muted); font-size: 13px; margin: -8px 0 14px; line-height: 1.5; }
.modal-hint code {
  background: var(--bg-elev-2); padding: 2px 6px; border-radius: 5px;
  font-size: 12px; color: var(--aube-1);
}
.lyrics-textarea {
  width: 100%; min-height: 260px; resize: vertical;
  background: var(--bg-elev-2); color: var(--fg);
  border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 14px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px; line-height: 1.6;
}
.lyrics-textarea:focus { outline: none; border-color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

@media (max-width: 720px) {
  .lrc-line { font-size: 19px; }
  .queue-panel { left: 14px; width: auto; }
  .modal-inner { min-width: auto; width: 92vw; }
}

/* ---- Admin · catalogue ---- */
.nav-admin svg { color: var(--aube-1); }
.admin-bar { display: flex; gap: 12px; align-items: center; margin: 4px 0 18px; flex-wrap: wrap; }
.admin-search {
  flex: 1; min-width: 200px;
  background: var(--bg-elev-2); border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 10px 16px; color: var(--fg); font-size: 13px;
}
.admin-search:focus { outline: none; border-color: var(--accent); }
.admin-scroll { overflow-x: auto; }
.admin-table { min-width: 720px; }
.admin-head, .admin-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr .8fr 40px 104px 76px;
  gap: 8px; align-items: center;
}
.admin-head {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted);
  padding: 0 8px 8px; border-bottom: 1px solid var(--border);
}
.admin-row { padding: 6px 8px; border-radius: 8px; transition: background .3s; }
.admin-row:hover { background: var(--bg-hover); }
.admin-row.saved { background: rgba(74,222,128,.14); }
.admin-row input, .adm-vis {
  background: var(--bg-elev-2); border: 1px solid transparent;
  border-radius: 6px; padding: 7px 9px; color: var(--fg); font-size: 13px;
  width: 100%; font-family: inherit;
}
.admin-row input:focus, .adm-vis:focus { outline: none; border-color: var(--accent); background: var(--bg-elev); }
.adm-exp { display: flex; justify-content: center; }
.adm-exp input { width: 16px; height: 16px; accent-color: var(--accent); }
.adm-vis { font-size: 12px; padding: 7px 6px; }
.adm-actions { display: flex; gap: 6px; justify-content: flex-end; }
.adm-save, .adm-del {
  border: 0; cursor: pointer; width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s; flex-shrink: 0;
}
.adm-save { background: rgba(74,222,128,.16); color: var(--success); }
.adm-save:hover { background: rgba(74,222,128,.28); }
.adm-del { background: var(--bg-elev-2); color: var(--muted); }
.adm-del:hover { background: rgba(255,77,109,.16); color: var(--danger); }
.adm-save svg, .adm-del svg { width: 16px; height: 16px; }

/* Titres éditoriaux en serif (display) */
.hero-greet, .section-title, .detail-head h1, .auth-card h2 {
  font-family: var(--display);
  letter-spacing: -.2px;
}
