/* =========================================================================
   Prismatik — feuille de style
   Concept signature : l'atmosphère de toute la page (dégradé animé) se
   métamorphose selon le genre du morceau en lecture.
   Approche mobile-first ; les écrans larges ajoutent des affordances.
   ========================================================================= */

/* ---- Thèmes : un jeu de variables par genre --------------------------- */
:root,
.theme-default {
  --bg: #15122b;
  --g1: #6c5ce7; --g2: #b794f6; --g3: #2d2a55;
  --text: #f3f0ff; --dim: #a9a3c9;
  --accent: #b794f6; --accent-2: #6c5ce7; --on-accent: #14122b;
  --surface: rgba(255,255,255,.06); --surface-2: rgba(255,255,255,.10);
  --border: rgba(255,255,255,.12);
}
.theme-kawaii {            /* pastel doux */
  --bg: #fff0f6;
  --g1: #ffd1e8; --g2: #e0c3fc; --g3: #c2f5e9;
  --text: #5a3a52; --dim: #9a7c92;
  --accent: #ff7eb6; --accent-2: #b388ff; --on-accent: #fff;
  --surface: rgba(255,255,255,.55); --surface-2: rgba(255,255,255,.75);
  --border: rgba(160,90,140,.18);
}
.theme-dubstep-electro {  /* néon sombre */
  --bg: #06060e;
  --g1: #00f0ff; --g2: #ff00d4; --g3: #0a0a1f;
  --text: #eafcff; --dim: #6f8ba0;
  --accent: #00f0ff; --accent-2: #ff00d4; --on-accent: #04040a;
  --surface: rgba(255,255,255,.05); --surface-2: rgba(0,240,255,.10);
  --border: rgba(0,240,255,.22);
}
.theme-celtic-elfique {   /* forêt & or */
  --bg: #0c1f16;
  --g1: #1f7a4d; --g2: #d4af37; --g3: #08160f;
  --text: #eef6ee; --dim: #9bb3a3;
  --accent: #d4af37; --accent-2: #3fa372; --on-accent: #0c1f16;
  --surface: rgba(255,255,255,.05); --surface-2: rgba(212,175,55,.10);
  --border: rgba(212,175,55,.22);
}
.theme-pop {              /* coucher de soleil */
  --bg: #fff5ec;
  --g1: #ff3d77; --g2: #ff8a3d; --g3: #ffd23d;
  --text: #5c2333; --dim: #a06a6a;
  --accent: #ff3d77; --accent-2: #ff8a3d; --on-accent: #fff;
  --surface: rgba(255,255,255,.5); --surface-2: rgba(255,255,255,.72);
  --border: rgba(200,80,90,.18);
}

/* ---- Reset & base ----------------------------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background .8s ease, color .8s ease;
  /* place pour la barre du lecteur en bas */
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}
h1,h2,h3,.logo { font-family: "Space Grotesk", sans-serif; letter-spacing: -.01em; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input { font: inherit; }
a { color: inherit; }
svg { width: 100%; height: 100%; fill: currentColor; display: block; }
img { max-width: 100%; }

/* ---- Fond vivant ------------------------------------------------------ */
.bg-stage { position: fixed; inset: 0; z-index: -1; overflow: hidden; filter: saturate(1.1); }
.bg-blob {
  position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: .8;
  transition: background 1s ease, opacity 1s ease;
  animation: drift 22s ease-in-out infinite;
}
.blob-1 { width: 60vw; height: 60vw; top: -10%; left: -10%; background: var(--g1); }
.blob-2 { width: 55vw; height: 55vw; bottom: -15%; right: -10%; background: var(--g2); animation-delay: -7s; }
.blob-3 { width: 50vw; height: 50vw; top: 30%; left: 35%; background: var(--g3); animation-delay: -14s; }
@keyframes drift {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(6%, -8%) scale(1.1); }
  66%     { transform: translate(-7%, 5%) scale(.95); }
}
@media (prefers-reduced-motion: reduce) {
  .bg-blob { animation: none; }
  body, .bg-blob { transition: none; }
}

/* ---- Barre du haut ---------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1rem; padding-top: calc(.7rem + env(safe-area-inset-top));
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; font-weight: 700; }
.logo-prism {
  width: 18px; height: 18px; border-radius: 5px;
  background: conic-gradient(from .2turn, var(--g1), var(--g2), var(--g3), var(--g1));
  box-shadow: 0 0 14px var(--accent);
}
.search { position: relative; flex: 1; max-width: 520px; }
.search-ico { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--dim); }
.search input {
  width: 100%; padding: .6rem .8rem .6rem 2.3rem;
  border-radius: 999px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); outline: none;
}
.search input:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.topnav { display: flex; gap: .5rem; align-items: center; }

/* boutons génériques */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .9rem; border-radius: 999px; font-weight: 600; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border);
}
.btn:hover { background: var(--surface-2); }
.btn-accent { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn-accent:hover { filter: brightness(1.08); }
.btn:focus-visible, .ctl:focus-visible, .logo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Vue / contenu ---------------------------------------------------- */
.view { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 2rem; }
.page-title { font-size: 1.7rem; margin-bottom: .25rem; }
.page-sub { color: var(--dim); margin-bottom: 1.4rem; }
.section-eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; color: var(--dim); margin-bottom: .6rem; }

/* grille des genres */
.genre-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }
.genre-card {
  position: relative; overflow: hidden; aspect-ratio: 1.4;
  border-radius: 18px; padding: 1rem; text-align: left;
  display: flex; flex-direction: column; justify-content: flex-end;
  border: 1px solid var(--border); color: #fff;
  transition: transform .2s ease, box-shadow .2s ease;
}
.genre-card:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(0,0,0,.35); }
.genre-card h3 { font-size: 1.25rem; position: relative; }
.genre-card .gc-count { font-size: .8rem; opacity: .85; position: relative; }
.genre-card::before { content: ""; position: absolute; inset: 0; opacity: .92; }
.gc-kawaii::before          { background: linear-gradient(135deg,#ffd1e8,#e0c3fc 55%,#c2f5e9); }
.gc-dubstep-electro::before { background: linear-gradient(135deg,#0a0a1f,#00f0ff 130%); }
.gc-celtic-elfique::before  { background: linear-gradient(135deg,#08160f,#1f7a4d 80%,#d4af37); }
.gc-pop::before             { background: linear-gradient(135deg,#ff3d77,#ff8a3d 60%,#ffd23d); }
.gc-default::before         { background: linear-gradient(135deg,#2d2a55,#6c5ce7 70%,#b794f6); }

/* liste des morceaux */
.track-list { display: flex; flex-direction: column; gap: .5rem; }
.track {
  display: flex; align-items: center; gap: .8rem;
  padding: .55rem .7rem; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  transition: background .15s ease;
}
.track:hover { background: var(--surface-2); }
.track.is-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.track-cover {
  width: 48px; height: 48px; border-radius: 10px; flex: none; object-fit: cover;
  background: var(--surface-2); display: grid; place-items: center; color: var(--dim);
}
.track-main { flex: 1; min-width: 0; }
.track-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-meta { font-size: .8rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-tags { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .15rem; }
.chip { font-size: .68rem; padding: .12rem .5rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--dim); }
.chip.lock { color: var(--accent); }
.track-play { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.track-play svg { width: 18px; height: 18px; }
.track-del { color: var(--dim); width: 34px; height: 34px; padding: 7px; flex: none; }
.track-del:hover { color: var(--accent); }

/* formulaires (auth, upload) */
.card { max-width: 480px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.4rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; color: var(--dim); margin-bottom: .35rem; }
.field input[type=text], .field input[type=password], .field input[type=file] {
  width: 100%; padding: .65rem .8rem; border-radius: 12px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); outline: none;
}
.field input:focus-visible { border-color: var(--accent); }
.switch { display: flex; align-items: center; gap: .6rem; }
.hint { font-size: .8rem; color: var(--dim); margin-top: .3rem; }
.msg { padding: .6rem .8rem; border-radius: 10px; margin-bottom: 1rem; font-size: .9rem; }
.msg.err { background: color-mix(in srgb, #ff5a6a 20%, transparent); }
.msg.ok  { background: color-mix(in srgb, #3fd07a 20%, transparent); }
.empty { text-align: center; color: var(--dim); padding: 3rem 1rem; }

/* ====================== LECTEUR PERSISTANT ============================= */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  transition: background .8s ease;
}
.player[data-state="empty"] { transform: translateY(110%); }

.seek { position: relative; height: 4px; cursor: pointer; }
.seek-fill { position: absolute; inset: 0 auto 0 0; width: 0%; background: var(--accent); }
.seek-range { position: absolute; inset: -8px 0; width: 100%; opacity: 0; cursor: pointer; }

.player-inner {
  display: grid; align-items: center; gap: .5rem;
  grid-template-columns: 1fr auto; /* mobile : info + play */
  padding: .55rem .9rem; height: 76px;
}
.np { display: flex; align-items: center; gap: .65rem; min-width: 0; text-align: left; }
.np-cover { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; flex: none; background: var(--surface-2); }
.np-meta { display: flex; flex-direction: column; min-width: 0; }
.np-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { font-size: .8rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.controls { display: flex; align-items: center; gap: .4rem; justify-self: end; }
.ctl { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--text); }
.ctl svg { width: 22px; height: 22px; }
.ctl:hover { background: var(--surface-2); }
.ctl-play { width: 48px; height: 48px; background: var(--accent); color: var(--on-accent); }
.ctl-play:hover { filter: brightness(1.08); background: var(--accent); }
.ico-pause { display: none; }
.player[data-playing="1"] .ico-play { display: none; }
.player[data-playing="1"] .ico-pause { display: block; }

.times { font-size: .78rem; color: var(--dim); display: none; }
.times .sep { margin: 0 .25rem; }
.reacts { display: none; gap: .2rem; }
.react { width: auto; padding: 0 .55rem; gap: .3rem; border-radius: 999px; font-size: .82rem; }
.react svg { width: 18px; height: 18px; }
.react.active[data-kind=like]    { color: var(--accent); }
.react.active[data-kind=dislike] { color: #ff6b6b; }
.volume { display: none; align-items: center; gap: .4rem; }
.volume input[type=range], .seek-range { accent-color: var(--accent); }
#vol { width: 90px; }

/* Now playing plein écran (mobile) */
.np-sheet {
  position: fixed; inset: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 92%, #000);
  backdrop-filter: blur(20px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; padding: 2rem; text-align: center;
  animation: sheetUp .25s ease;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.np-sheet-close { position: absolute; top: calc(1rem + env(safe-area-inset-top)); right: 1.2rem; font-size: 2rem; line-height: 1; color: var(--dim); }
.np-sheet-cover { width: min(70vw, 320px); aspect-ratio: 1; border-radius: 22px; object-fit: cover; box-shadow: 0 24px 60px rgba(0,0,0,.5); background: var(--surface-2); }
.np-sheet h2 { font-size: 1.5rem; }
.np-sheet p { color: var(--dim); }
.np-sheet-tags { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }

/* ====================== RESPONSIVE : écrans larges ===================== */
@media (min-width: 760px) {
  .genre-grid { grid-template-columns: repeat(4, 1fr); }
  .player-inner {
    grid-template-columns: minmax(180px, 1fr) auto auto auto auto;
    gap: 1rem; height: 80px;
  }
  .np { grid-column: 1; }
  .controls { grid-column: 2; justify-self: center; }
  .times { display: flex; grid-column: 3; }
  .reacts { display: flex; grid-column: 4; }
  .volume { display: flex; grid-column: 5; }
  #np-open { cursor: default; }     /* pas besoin du plein écran sur PC */
  .np-sheet { display: none !important; }
}
@media (min-width: 1100px) {
  .player-inner { padding: .55rem 1.5rem; }
}

/* ---- Bouton aléatoire (Azplay) ---------------------------------------- */
.ctl-shuffle { position: relative; }
.ctl-loop { position: relative; }
.ctl.active { color: var(--accent); }
.ctl-shuffle.active::after {
  content: ""; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}

/* =======================================================================
   v2 — Header raffiné, profil, avatars, bouton Google
   (placé en fin de fichier : surcharge les règles précédentes)
   ======================================================================= */

/* ---- Header ---- */
.topbar {
  gap: .6rem;
  padding: .6rem clamp(.8rem, 3vw, 1.6rem);
  padding-top: calc(.6rem + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  box-shadow: 0 1px 0 var(--border), 0 6px 24px -18px rgba(0,0,0,.6);
}
.logo { font-size: 1.22rem; gap: .55rem; flex: none; }
.logo-prism {
  width: 22px; height: 22px; border-radius: 7px;
  background: conic-gradient(from .15turn, var(--g1), var(--g2), var(--g3), var(--accent), var(--g1));
  box-shadow: 0 0 0 1px var(--border), 0 0 16px -2px var(--accent);
}
.search { max-width: 440px; }
.search input {
  padding: .58rem .9rem .58rem 2.4rem; border-radius: 14px;
  background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease;
}
.topnav { gap: .45rem; flex: none; }
.topnav .btn { padding: .48rem .8rem; }

/* Pastille de profil (avatar + pseudo) */
.avatar-pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .25rem .8rem .25rem .3rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-weight: 600;
}
.avatar-pill:hover { background: var(--surface-2); }
.avatar-img, .avatar-fallback {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  object-fit: cover; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent); font-weight: 700; font-size: .9rem; text-transform: uppercase;
}
.icon-only { padding: .48rem .6rem; }

/* Sur petit écran : on garde l'avatar, on masque le texte superflu */
@media (max-width: 560px) {
  .avatar-name { display: none; }
  .avatar-pill { padding: .25rem; }
  .btn-text { display: none; }
  .logo { font-size: 0; gap: 0; }           /* logo réduit au prisme */
  .logo-prism { width: 26px; height: 26px; }
}

/* ---- Page profil ---- */
.profile-head {
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 1.3rem; margin-bottom: 1rem;
}
.profile-ava {
  width: 84px; height: 84px; border-radius: 50%; flex: none; object-fit: cover;
  display: grid; place-items: center; font-size: 2rem; font-weight: 700; text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent);
  box-shadow: 0 8px 30px -10px var(--accent);
}
.profile-id { flex: 1; min-width: 180px; }
.profile-id h1 { font-size: 1.6rem; }
.profile-id .muted { color: var(--dim); font-size: .9rem; }
.stats { display: flex; gap: .7rem; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: .8rem 1.1rem; text-align: center; min-width: 96px;
}
.stat b { display: block; font-family: "Space Grotesk", sans-serif; font-size: 1.5rem; }
.stat span { color: var(--dim); font-size: .8rem; }

details.edit { margin: 1rem 0 1.4rem; }
details.edit > summary {
  cursor: pointer; color: var(--accent); font-weight: 600; list-style: none;
  display: inline-flex; align-items: center; gap: .35rem;
}
details.edit > summary::-webkit-details-marker { display: none; }
details.edit .card { margin: .8rem 0 0; max-width: none; }

/* ---- Séparateur "ou" + zone Google dans l'auth ---- */
.or-sep { display: flex; align-items: center; gap: .8rem; color: var(--dim); margin: 1.1rem 0; font-size: .85rem; }
.or-sep::before, .or-sep::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.google-slot { display: flex; justify-content: center; min-height: 44px; }

/* =======================================================================
   v3 — Lecteur : barre glissable, mini-barre mobile, plein écran
   ======================================================================= */

/* ---- Barre de progression réellement interactive (mini + sheet) ---- */
.seek {
  position: relative; height: 6px; cursor: pointer; touch-action: none;
  background: color-mix(in srgb, var(--text) 14%, transparent);
}
.seek-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  background: var(--accent); border-radius: 0 3px 3px 0; pointer-events: none;
}
.seek-input {
  position: absolute; inset: -8px 0; width: 100%; height: auto; margin: 0;
  -webkit-appearance: none; appearance: none; background: transparent;
  cursor: pointer; opacity: 0;
}
.seek-input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; }
.seek-input::-moz-range-thumb { width: 18px; height: 18px; border: 0; }

/* ---- Icône play/pause pilotée par classe (mini ET sheet) ---- */
.ctl-play .ico-pause { display: none; }
.ctl-play.is-playing .ico-play { display: none; }
.ctl-play.is-playing .ico-pause { display: block; }

.np { cursor: pointer; }

/* ---- Mobile : mini-barre compacte (np + play + suivant) ---- */
@media (max-width: 759px) {
  .controls .desk-only { display: none; }
  .player-inner { grid-template-columns: 1fr auto; gap: .35rem; height: 70px; }
  .controls { gap: .2rem; }
}

/* ---- Lecteur plein écran ---- */
.np-sheet {
  position: fixed; inset: 0; z-index: 60; overflow: auto;
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    color-mix(in srgb, var(--bg) 94%, #000);
  backdrop-filter: blur(24px);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
  animation: sheetUp .25s ease;
}
.np-sheet[hidden] { display: none; }
.np-sheet-close {
  flex: none; align-self: center; margin: .4rem; padding: .4rem .9rem;
  color: var(--dim); border-radius: 999px;
}
.np-sheet-close:hover { background: var(--surface-2); color: var(--text); }
.sheet-body {
  flex: 1; width: 100%; max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.1rem; padding: clamp(1rem, 4vw, 2rem); text-align: center;
}
.sheet-cover {
  width: min(72vw, 340px); aspect-ratio: 1; border-radius: 24px; object-fit: cover;
  background: var(--surface-2); box-shadow: 0 30px 70px -20px rgba(0,0,0,.6);
}
.sheet-meta h2 { font-size: clamp(1.3rem, 5vw, 1.8rem); line-height: 1.15; }
.sheet-meta p { color: var(--dim); margin-top: .2rem; }
.sheet-tags { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; margin-top: .6rem; }

.sheet-seek { width: 100%; height: 8px; border-radius: 4px; overflow: visible; }
.sheet-seek .seek-fill { border-radius: 4px; }
.sheet-seek .seek-fill::after {
  content: ""; position: absolute; right: -7px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent);
}
.sheet-times { width: 100%; display: flex; justify-content: space-between; color: var(--dim); font-size: .8rem; }

.sheet-controls { display: flex; align-items: center; gap: clamp(1rem, 6vw, 1.8rem); margin-top: .4rem; }
.sheet-controls .ctl { width: 52px; height: 52px; }
.sheet-controls .ctl svg { width: 28px; height: 28px; }
.ctl-play.big { width: 68px; height: 68px; }
.ctl-play.big svg { width: 32px; height: 32px; }

.sheet-extra { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; justify-content: center; margin-top: .3rem; }
/* (plus de fond/bulle derrière like et dislike du plein écran) */
.sheet-vol { display: flex; align-items: center; gap: .5rem; }
.sheet-vol input[type=range], .sheet-seek .seek-input { accent-color: var(--accent); }
.sheet-vol input { width: 120px; }

/* Le plein écran est dispo sur PC aussi : on neutralise l'ancien masquage. */
@media (min-width: 760px) {
  .np-sheet:not([hidden]) { display: flex; }
}

/* =======================================================================
   v4 — Disposition de la barre du bas en 3 zones
   (gauche : pochette/titre · centre : transport · droite : temps/likes/volume)
   ======================================================================= */
.player-right { display: flex; align-items: center; gap: 1rem; }

@media (min-width: 760px) {
  .player-inner { grid-template-columns: 1fr auto 1fr; gap: 1rem; height: 80px; }
  .np           { grid-column: 1; justify-self: start; min-width: 0; }
  .controls     { grid-column: 2; justify-self: center; }
  .player-right { grid-column: 3; justify-self: end; }
  .times, .reacts, .volume { display: flex; }
}
@media (max-width: 759px) {
  .player-inner { grid-template-columns: 1fr auto; gap: .35rem; height: 70px; }
  .player-right { display: none; }          /* dispo dans le plein écran */
  .controls .desk-only { display: none; }    /* mini-barre = play + suivant */
}

/* =======================================================================
   v5 — Header retravaillé (lisibilité tous thèmes, alignement, sans soulignement)
   ======================================================================= */

/* Plus aucun soulignement de lien nulle part */
a { text-decoration: none; }

/* ---- Barre du haut : logo | recherche | actions (à droite) ---- */
.topbar { flex-wrap: nowrap; }
.search { min-width: 0; }                 /* la recherche se comprime au lieu de pousser */
.topnav { flex: none; margin-left: auto; gap: .5rem; }

/* ---- Boutons : couleurs explicites (jamais d'héritage hasardeux) ---- */
.btn {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}
.btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--text) 18%, var(--border));
}
.btn-accent, .btn-accent:hover { color: var(--on-accent); border-color: transparent; }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 86%, #000); filter: none; }

/* ---- Pastille de profil (avatar + pseudo) ---- */
.avatar-pill { color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.avatar-pill:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 10%, var(--surface));
}
.avatar-name { color: var(--text); }
.icon-only { color: var(--text); }
.icon-only:hover { color: var(--text); background: color-mix(in srgb, var(--text) 10%, var(--surface)); }

/* ---- Tuiles de styles : texte blanc toujours lisible, sans soulignement ---- */
.genre-card { color: #fff; }
.genre-card h3, .genre-card .gc-count { text-shadow: 0 1px 10px rgba(0,0,0,.45); }
.genre-card::after {              /* voile sombre en bas pour le contraste du texte */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.4), transparent 55%);
}

/* ---- Liens texte (ex. « Inscris-toi ») : accent, lisibles, gras au survol ---- */
.card a { color: var(--accent); font-weight: 600; }
.card a:hover { text-decoration: none; opacity: .85; }

/* Ordre d'empilement des tuiles : dégradé < voile < texte */
.genre-card::before { z-index: 0; }
.genre-card::after  { z-index: 1; }
.genre-card h3, .genre-card .gc-count { position: relative; z-index: 2; }

/* =======================================================================
   v6 — Bouton d'édition + aperçu d'affiche (édition de morceau)
   ======================================================================= */
.track-edit { color: var(--dim); width: 34px; height: 34px; padding: 7px; flex: none; }
.track-edit:hover { color: var(--accent); }
.edit-cover { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.edit-cover img {
  width: 76px; height: 76px; border-radius: 14px; object-fit: cover;
  background: var(--surface-2); border: 1px solid var(--border);
}

/* =======================================================================
   v7 — Nouveaux styles (Chill, Phonk) + bouton "+" à droite de la recherche
   ======================================================================= */

/* Thèmes */
.theme-chill {
  --bg: #121a2b;
  --g1: #5b8fb0; --g2: #9db4d6; --g3: #1a2740;
  --text: #eef2fb; --dim: #9aa6c4;
  --accent: #8fc8dc; --accent-2: #6c7fb0; --on-accent: #0e1626;
  --surface: rgba(255,255,255,.06); --surface-2: rgba(143,200,220,.12);
  --border: rgba(143,200,220,.20);
}
.theme-phonk {
  --bg: #0a0710;
  --g1: #b5179e; --g2: #6e2594; --g3: #160611;
  --text: #f6e9ff; --dim: #9a7fae;
  --accent: #e0479e; --accent-2: #7b2cbf; --on-accent: #0a0710;
  --surface: rgba(255,255,255,.05); --surface-2: rgba(224,71,158,.12);
  --border: rgba(224,71,158,.22);
}

/* Tuiles des nouveaux styles */
.gc-chill::before  { background: linear-gradient(135deg,#1a2740,#5b8fb0 85%,#9db4d6); }
.gc-phonk::before  { background: linear-gradient(135deg,#160611,#6e2594 65%,#b5179e); }

/* Bouton "+" à droite du champ de recherche */
.add-btn {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); border: 1px solid transparent;
}
.add-btn svg { width: 22px; height: 22px; fill: currentColor; }
.add-btn:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }
.add-btn[hidden] { display: none; }

/* =======================================================================
   v8 — Icône aléatoire (emoji) + transport centré dans le plein écran
   ======================================================================= */
.emoji { font-size: 18px; line-height: 1; }
.sheet-controls .emoji { font-size: 24px; }

/* Le plein écran : aléatoire à gauche, prev/play/next parfaitement centrés */
.sheet-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; gap: 0; }
.sheet-controls #s-shuffle { grid-column: 1; justify-self: end; }
.sheet-controls .transport { grid-column: 2; display: flex; align-items: center; gap: clamp(1rem, 6vw, 1.8rem); }

/* Pastille de couleur des styles dans la liste admin */
.admin-swatch { width: 48px; height: 48px; border-radius: 10px; flex: none; }

/* =======================================================================
   v9 — Logo-maison · bouton "réduire" visible · transport recentré
   ======================================================================= */

/* Logo = bouton accueil : maison blanche centrée sur le prisme dégradé */
.logo-prism { display: grid; place-items: center; }
.logo-prism svg { width: 14px; height: 14px; fill: #fff; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }

/* Bouton "réduire le lecteur" : vrai bouton en haut à droite */
.np-sheet-close {
  position: absolute; top: .8rem; right: .8rem; left: auto; z-index: 3;
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 0;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.np-sheet-close svg { width: 24px; height: 24px; fill: currentColor; }
.np-sheet-close:hover { background: color-mix(in srgb, var(--text) 12%, var(--surface-2)); }

/* Plein écran : prev / play / next réellement centrés (shuffle est passé en bas) */
.sheet-controls { display: flex; justify-content: center; align-items: center; gap: clamp(1rem, 7vw, 2rem); width: 100%; }
.sheet-extra { display: flex; justify-content: center; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.sheet-extra .emoji { font-size: 22px; }

/* =======================================================================
   v10 — Plein écran mobile : tout tient sans scroll
   ======================================================================= */
@media (max-width: 759px) {
  /* hauteur = zone réellement visible (gère la barre d'adresse) + pas de scroll */
  .np-sheet { height: 100dvh; min-height: 100dvh; overflow: hidden; }

  .sheet-body {
    justify-content: center;
    gap: clamp(.4rem, 1.6vh, 1rem);
    padding: clamp(.6rem, 2vh, 1.3rem);
    padding-top: max(.8rem, env(safe-area-inset-top));
  }

  /* la pochette est plafonnée AUSSI par la hauteur de l'écran */
  .sheet-cover { width: min(70vw, 300px, 36vh); border-radius: 18px; }

  .sheet-meta h2 { font-size: clamp(1.05rem, 4.4vw, 1.45rem); }
  .sheet-tags { margin-top: .3rem; }

  .sheet-controls .ctl { width: 48px; height: 48px; }
  .sheet-controls .ctl svg { width: 26px; height: 26px; }
  .ctl-play.big { width: 60px; height: 60px; }
  .ctl-play.big svg { width: 28px; height: 28px; }
}

/* =======================================================================
   v11 — Aperçu anti-doublon dans le formulaire d'ajout
   ======================================================================= */
.dup-hint { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid var(--border); border-radius: 12px; padding: .7rem .8rem; margin-bottom: 1rem; }
.dup-title { font-size: .85rem; color: var(--text); margin-bottom: .5rem; font-weight: 600; }
.dup-item { display: flex; align-items: center; gap: .6rem; padding: .25rem 0; font-size: .85rem; color: var(--dim); }
.dup-item img { width: 32px; height: 32px; border-radius: 7px; object-fit: cover; flex: none; background: var(--surface-2); }
.dup-item b { color: var(--text); }

/* =======================================================================
   v12 — Compteur de titres par style
   ======================================================================= */
.gc-num {
  position: relative; z-index: 2; align-self: flex-start;
  margin-top: .4rem; font-size: .72rem; font-weight: 700; color: #fff;
  background: rgba(0,0,0,.34); padding: .14rem .55rem; border-radius: 999px;
  text-shadow: none;
}

@media (max-width: 759px) {
}

/* =======================================================================
   v13 — Repeat · tuiles (contour + lisibilité) · téléchargement · tri · users
   ======================================================================= */
/* Repeat : même pastille d'activation que l'aléatoire */
.ctl-loop.active::after {
  content: ""; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}

/* Tuiles de style : suppression du contour "verre" + texte bien lisible sur image */
.genre-card { border: none; }
.genre-card::after {
  background: linear-gradient(to top, rgba(0,0,0,.68), rgba(0,0,0,.10) 45%, rgba(0,0,0,.30));
}
.genre-card h3, .genre-card .gc-count { text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 2px 14px rgba(0,0,0,.6); }
.genre-card .gc-count { opacity: 1; }

/* Bouton téléchargement (affiché en recherche) */
.track-dl { color: var(--dim); width: 34px; height: 34px; padding: 7px; flex: none; display: grid; place-items: center; }
.track-dl:hover { color: var(--accent); }
.track-dl svg { width: 20px; height: 20px; fill: currentColor; }

/* Barre de tri */
.listbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.sortbar { font-size: .8rem; color: var(--dim); display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.sortbar select { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: .3rem .5rem; font: inherit; }

/* Résultats utilisateurs (recherche) */
.user-results { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 1rem; }
.user-card { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.user-card:hover { background: color-mix(in srgb, var(--text) 10%, var(--surface)); }
.user-ava { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; color: var(--text); }
.user-name { font-weight: 600; color: var(--text); }
.user-count { font-size: .78rem; color: var(--dim); }

/* =======================================================================
   v14 — État ACTIF des boutons emoji (aléatoire / repeat) bien visible
   ======================================================================= */
.ctl-shuffle.active, .ctl-loop.active {
  background: color-mix(in srgb, var(--accent) 32%, transparent);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.ctl-shuffle.active:hover, .ctl-loop.active:hover {
  background: color-mix(in srgb, var(--accent) 42%, transparent);
}
/* le point n'est plus utile : l'icône se recolore en accent + fond + anneau */
.ctl-shuffle.active::after, .ctl-loop.active::after { display: none; }

/* =======================================================================
   v15 — Playlists (tuiles, page, sélecteur modal, toast)
   ======================================================================= */
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin: .3rem 0 1.6rem; }
.pl-card {
  position: relative; aspect-ratio: 1.15; border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  background-size: cover; background-position: center; color: #fff;
  transition: transform .2s ease, box-shadow .2s ease;
}
.pl-card:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(0,0,0,.35); }
.pl-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,.05) 55%, rgba(0,0,0,.25)); }
.pl-info { position: relative; z-index: 1; padding: .7rem; }
.pl-info h3 { font-size: 1.02rem; line-height: 1.2; text-shadow: 0 1px 3px rgba(0,0,0,.9); }
.pl-info span { font-size: .76rem; opacity: .95; text-shadow: 0 1px 3px rgba(0,0,0,.9); }
.pl-create {
  align-items: center; justify-content: center; gap: .3rem; color: var(--dim);
  background: var(--surface); border: 1.5px dashed var(--border);
}
.pl-create::after { display: none; }
.pl-create:hover { color: var(--accent); border-color: var(--accent); }
.pl-plus { font-size: 2rem; line-height: 1; font-weight: 300; }
.pl-create span { font-size: .8rem; padding: 0 .5rem; text-align: center; }

.pl-head { display: flex; gap: 1.2rem; align-items: flex-end; margin-bottom: 1.4rem; flex-wrap: wrap; }
.pl-cover { width: 150px; height: 150px; border-radius: 16px; background-size: cover; background-position: center; flex: none; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.pl-cover-default { display: grid; place-items: center; font-size: 3.2rem; color: #fff; background: linear-gradient(135deg, var(--accent), var(--surface-2)); }
.pl-head-info { flex: 1; min-width: 220px; }
.pl-actions { display: flex; gap: .6rem; margin-top: .8rem; flex-wrap: wrap; }
.btn-danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-danger:hover { filter: brightness(1.08); }

/* Sélecteur d'ajout à une playlist */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 200; padding: 1rem; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1rem; width: 100%; max-width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.modal-head { font-weight: 700; font-size: 1.05rem; margin-bottom: .7rem; }
.modal-list { display: flex; flex-direction: column; gap: .4rem; max-height: 50vh; overflow: auto; margin-bottom: .5rem; }
.modal-item {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem; width: 100%;
  padding: .65rem .8rem; border-radius: 12px; background: var(--surface-2); color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.modal-item:hover { background: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); }
.modal-new { justify-content: center; font-weight: 600; color: var(--accent); }
.modal-close { width: 100%; justify-content: center; margin-top: .5rem; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 12px);
  background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 999px;
  font-size: .85rem; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.35);
  opacity: 0; transition: opacity .25s ease, transform .25s ease; z-index: 250; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =======================================================================
   v16 — Sélecteur de styles en vignettes (ajout / modification d'un morceau)
   ======================================================================= */
.hint-inline { font-weight: 400; font-size: .8rem; color: var(--dim); }
.gpick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: .5rem; margin: .5rem 0 .2rem; }
.gpick {
  position: relative; aspect-ratio: 1.25; border-radius: 12px; overflow: hidden; cursor: pointer;
  background-size: cover; background-position: center; color: #fff;
  display: flex; align-items: flex-end;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.gpick::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,.1) 60%, rgba(0,0,0,.3)); }
.gpick-name { position: relative; z-index: 1; padding: .4rem .5rem; font-size: .78rem; font-weight: 600; line-height: 1.15; text-shadow: 0 1px 3px rgba(0,0,0,.9); }
.gpick-check {
  position: absolute; top: 6px; right: 6px; z-index: 2; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center; font-size: .8rem; font-weight: 700;
  opacity: 0; transform: scale(.5); transition: opacity .15s ease, transform .15s ease; box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.gpick:not(.selected) { filter: grayscale(.3) brightness(.8); }   /* non sélectionné = visiblement en retrait */
.gpick:hover { transform: translateY(-2px); filter: none; }
.gpick.selected { box-shadow: 0 0 0 3px var(--accent), 0 8px 20px rgba(0,0,0,.3); filter: none; }
.gpick.selected .gpick-check { opacity: 1; transform: scale(1); }

/* v16b — pastille de dégradé dans la liste admin des styles */
.g-swatch { width: 30px; height: 44px; border-radius: 9px; flex: none; margin-right: .2rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
