/* ============================================================
   SpotiMilf — Style global (refonte « panneaux »)
   Couleurs d'origine : fond #0d0d10, accent orange #df5e02.
   Thèmes : sombre (défaut), clair, ou auto (suit l'appareil).
   ============================================================ */

/* ------------------------------------------------------------ Polices (auto-hébergées)
   Fichiers attendus dans assets/fonts/ ; sans eux, repli propre sur les polices système. */
@font-face {
  font-family: 'Figtree';
  src: url('../fonts/Figtree-Variable.woff2') format('woff2');
  font-weight: 300 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('../fonts/BricolageGrotesque-Variable.woff2') format('woff2');
  font-weight: 200 800; font-style: normal; font-display: swap;
}

/* ------------------------------------------------------------ Jetons */
:root {
  --accent: #df5e02;
  --accent-hover: #f06b0a;
  --on-accent: #0d0d10;          /* texte/icône posé SUR l'orange (contraste 5,3:1) */
  --tint-default: #6e2a0c;       /* teinte d'en-tête par défaut (dérivée de l'orange) */
  --radius: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --gap: 8px;
  --side-w: 300px;
  --now-w: 340px;
  --player-h: 84px;
  --tabbar-h: 64px;
  --transition: 160ms ease;
  --font: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Bricolage Grotesque', 'Figtree', ui-sans-serif, system-ui, sans-serif;
  --shadow-lg: 0 12px 32px rgba(0,0,0,.35);
}

/* Thème sombre (par défaut) */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0d0d10;
  --panel: #16161c;
  --card: #1d1d25;
  --hover: #23232c;
  --line: rgba(255,255,255,.07);
  --line2: rgba(255,255,255,.14);
  --text: #ececf0;
  --muted: #9a9aa6;
  --dim: #8b8b97;
  --accent-text: #f07420;          /* texte orange : contraste ≥ 4,7:1 sur les fonds sombres */
  --accent-soft: rgba(223,94,2,.16);
  --track: #34343f;
  --glow: rgba(223,94,2,.16);
  --btn-bg: rgba(0,0,0,.35);
  --shadow: 0 4px 16px rgba(0,0,0,.4);
  --pub: #4ade80;  --pub-bg: rgba(74,222,128,.14);    /* visibilité : public (vert) */
  --priv: #b79cff; --priv-bg: rgba(167,139,250,.18);  /* visibilité : privé (violet) */
}

[data-theme="light"] {
  color-scheme: light;
  --ground: #f3f3f6;
  --panel: #ffffff;
  --card: #fafafb;
  --hover: #ececf0;
  --line: rgba(0,0,0,.08);
  --line2: rgba(0,0,0,.16);
  --text: #16161c;
  --muted: #5b5b66;
  --dim: #6b6b76;
  --accent-text: #b04800;
  --accent-soft: rgba(223,94,2,.12);
  --track: #d9d9e0;
  --glow: rgba(223,94,2,.12);
  --btn-bg: rgba(0,0,0,.06);
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --pub: #166534;  --pub-bg: rgba(22,101,52,.12);
  --priv: #6d28d9; --priv-bg: rgba(109,40,217,.12);
}

/* Thème automatique : aucun choix enregistré → suit le réglage de l'appareil */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --ground: #f3f3f6; --panel: #ffffff; --card: #fafafb; --hover: #ececf0;
    --line: rgba(0,0,0,.08); --line2: rgba(0,0,0,.16);
    --text: #16161c; --muted: #5b5b66; --dim: #6b6b76;
    --accent-text: #b04800; --accent-soft: rgba(223,94,2,.12);
    --track: #d9d9e0; --glow: rgba(223,94,2,.12); --btn-bg: rgba(0,0,0,.06);
    --shadow: 0 4px 16px rgba(0,0,0,.08);
    --pub: #166534; --pub-bg: rgba(22,101,52,.12);
    --priv: #6d28d9; --priv-bg: rgba(109,40,217,.12);
  }
}

/* Anciens noms de variables encore utilisés dans quelques styles en ligne */
:root {
  --bg: var(--ground); --bg-elev: var(--panel); --bg-elev-2: var(--card); --bg-hover: var(--hover);
  --border: var(--line); --border-strong: var(--line2);
  --text-muted: var(--muted); --text-dim: var(--dim);
}

/* ------------------------------------------------------------ Base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { --player-space: 0px; }
html.has-player { --player-space: var(--player-h); }
[hidden] { display: none !important; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--ground);
  padding-bottom: var(--player-space);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-text); }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 16px; }
h1 { font-family: var(--font-display); font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
h2 { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -.015em; margin-top: 32px; }
h3 { font-size: 17px; font-weight: 700; }
.display { font-family: var(--font-display); letter-spacing: -.02em; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.tnum { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.section { margin-bottom: 40px; }
.pre { white-space: pre-wrap; }

/* ------------------------------------------------------------ Icônes */
.ic {
  width: 20px; height: 20px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.icf { fill: currentColor; stroke: none; }

/* Bascules d'icônes pilotées par des classes */
html:not(.is-playing) .i-pause, html.is-playing .js-playstate .i-play { display: none; }
.js-like .i-heart-fill { display: none; }
.js-like.is-liked .i-heart { display: none; }
.js-like.is-liked .i-heart-fill { display: block; }
.js-mute .i-mute { display: none; }
.js-mute.is-muted .i-volume { display: none; }
.js-mute.is-muted .i-mute { display: block; }
[data-theme-toggle] .i-sun { display: none; }
[data-theme="light"] [data-theme-toggle] .i-sun { display: block; }
[data-theme="light"] [data-theme-toggle] .i-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) [data-theme-toggle] .i-sun { display: block; }
  :root:not([data-theme]) [data-theme-toggle] .i-moon { display: none; }
}

/* ------------------------------------------------------------ Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 18px;
  border-radius: 999px; border: 1px solid transparent;
  background: var(--card); color: var(--text);
  font-weight: 700; font-size: 14px; line-height: 1.2;
  transition: background-color var(--transition), transform var(--transition), border-color var(--transition);
  text-decoration: none;
}
.btn:hover { background: var(--hover); color: var(--text); }
.btn .ic { width: 18px; height: 18px; }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-hover); color: var(--on-accent); transform: scale(1.02); }
.btn-ghost { background: transparent; border-color: var(--line2); }
.btn-ghost:hover { border-color: var(--text); background: transparent; }
.btn-danger { background: #b53636; color: #fff; }
.btn-danger:hover { background: #c43e3e; color: #fff; }
.btn-sm { min-height: 32px; padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* Bouton-icône rond */
.ibtn, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; flex-shrink: 0;
  border: 0; border-radius: 999px;
  background: transparent; color: var(--muted);
  transition: color var(--transition), background-color var(--transition), transform var(--transition);
}
.ibtn:hover, .icon-btn:hover { color: var(--text); background: var(--hover); }
.ibtn.sm, .icon-btn { width: 32px; height: 32px; }
.ibtn.lg { width: 48px; height: 48px; }
.ibtn.lg .ic { width: 24px; height: 24px; }
.ibtn.on, .ibtn.is-active, .icon-btn.is-active, .js-like.is-liked { color: var(--accent-text); }
.ibtn.soft { background: var(--btn-bg); }

/* Gros bouton lecture orange */
.play-big {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; padding: 0; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 8px 24px rgba(223,94,2,.3);
  transition: transform var(--transition), background-color var(--transition);
}
.play-big:hover { background: var(--accent-hover); transform: scale(1.05); }
.play-big .ic { width: 24px; height: 24px; }

/* Puces de filtre */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 16px; border-radius: 999px; border: 0;
  background: var(--card); color: var(--text);
  font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background-color var(--transition), color var(--transition);
}
.chip:hover { background: var(--hover); color: var(--text); }
.chip.on { background: var(--text); color: var(--ground); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------ Structure */
.shell {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  gap: var(--gap);
  padding: var(--gap);
  align-items: start;
}
.panel { background: var(--panel); border-radius: var(--radius); }

/* Barre latérale */
.sidebar {
  position: sticky; top: var(--gap);
  height: calc(100vh - 2 * var(--gap) - var(--player-space));
  display: flex; flex-direction: column; gap: var(--gap);
  min-height: 0;
}
.side-nav { padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 14px; margin-bottom: 6px; }
.brand:hover { color: var(--text); }
.brand-mark {
  display: block; width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  box-shadow: 0 4px 12px var(--accent-soft);
  transition: transform .2s ease;
}
.brand:hover .brand-mark, .main-brand:hover .brand-mark { transform: rotate(-6deg) scale(1.06); }
.brand-name { font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.brand-accent { color: var(--accent-text); }
@media (prefers-reduced-motion: reduce) { .brand-mark { transition: none; } }
.side-link {
  display: flex; align-items: center; gap: 14px;
  height: 44px; padding: 0 14px; border-radius: var(--radius-md);
  color: var(--muted); font-weight: 600; font-size: 15px;
  transition: color var(--transition), background-color var(--transition);
}
.side-link:hover { color: var(--text); background: var(--hover); }
.side-link.is-active { color: var(--text); background: var(--card); }
.side-link.is-active .ic { color: var(--accent-text); }

.side-lib { flex: 1; min-height: 0; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.side-lib-head { display: flex; align-items: center; gap: 12px; padding: 4px 4px 0 14px; color: var(--muted); }
.side-lib-head h2 { margin: 0; flex: 1; font-family: var(--font); font-size: 15px; font-weight: 700; letter-spacing: 0; }
.side-lib-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.lib-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px; border-radius: var(--radius-md);
  transition: background-color var(--transition);
}
.lib-item:hover { background: var(--hover); color: var(--text); }
.lib-item.is-active { background: var(--card); }
.lib-item-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.lib-item-title { font-weight: 600; font-size: 15px; }
.lib-item-sub { font-size: 13px; color: var(--muted); }
.lib-item.is-playing .lib-item-title { color: var(--accent-text); }
.lib-cta { background: var(--card); border-radius: var(--radius-md); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.lib-cta p { margin: 0; font-size: 14px; color: var(--muted); }
.lib-cta strong { font-size: 15px; }
.side-foot { display: flex; gap: 14px; flex-wrap: wrap; padding: 4px 14px 2px; font-size: 12px; color: var(--muted); }
.side-foot a:hover { color: var(--text); text-decoration: underline; }

/* Zone principale */
.main {
  min-width: 0;
  min-height: calc(100vh - 2 * var(--gap) - var(--player-space));
  position: relative;
  padding: 16px 28px 48px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, var(--glow) 0px, var(--panel) 300px);
}
.main:focus { outline: none; }
.hero-kicker .ic { width: 14px; height: 14px; }
.main-top {
  position: relative; z-index: 20;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  min-height: 48px; margin-bottom: 24px;
}
.main-top .grow { flex: 1; }
.main-brand { display: none; }
.search-field {
  flex: 0 1 440px; min-width: 200px; height: 44px;
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  color: var(--muted);
  transition: border-color var(--transition), background-color var(--transition);
}
.search-field:hover { border-color: var(--line2); }
.search-field:focus-within { border-color: var(--accent); background: var(--panel); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; }
.search-field input::placeholder { color: var(--muted); }
.search-field.big { flex: 1 1 100%; max-width: 640px; height: 52px; border-width: 2px; }
.search-field.big input { font-size: 17px; font-weight: 500; }

.avatar {
  width: 40px; height: 40px; border-radius: 999px; border: 0; flex-shrink: 0;
  background: var(--accent); color: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
}
.acct-menu { position: relative; }
.acct-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  min-width: 220px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.acct-dropdown a, .acct-dropdown button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; color: var(--text); }
.acct-dropdown button { width: 100%; border: 0; background: transparent; text-align: left; font-family: inherit; }
.acct-dropdown form { margin: 0; }
.acct-dropdown a:hover, .acct-dropdown button:hover { background: var(--hover); color: var(--text); }
.acct-dropdown .ic { width: 18px; height: 18px; color: var(--muted); }
.acct-dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.acct-name { padding: 8px 12px 6px; font-size: 13px; color: var(--muted); }

/* Messages flash */
.flash {
  margin: 0 0 16px; padding: 12px 18px;
  border-radius: var(--radius-md); border: 1px solid var(--line);
  font-weight: 500;
}
.flash-success { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.4); }
.flash-error   { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); }
.toast {
  position: fixed; top: calc(20px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 1000;
  width: max-content; max-width: calc(100vw - 32px);
  padding: 12px 20px; border-radius: 22px; background: var(--text); color: var(--ground);
  font-weight: 700; font-size: 14px; text-align: center; box-shadow: var(--shadow-lg);
}

/* ------------------------------------------------------------ En-têtes de section */
.page-head, .section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.page-head h1 { margin-bottom: 8px; }
.section-head { margin: 36px 0 14px; }
.section-head h2 { margin: 0; }
.section-head > a { color: var(--muted); font-weight: 700; font-size: 14px; }
.section-head > a:hover { color: var(--text); text-decoration: underline; }
.greeting { margin: 0 0 16px; font-size: 40px; }

/* ------------------------------------------------------------ Pochettes */
.cover {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--card); color: var(--muted);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-empty { background: linear-gradient(135deg, #2a2a35, #1d1d25); color: #8b8b97; }
.cover-liked { background: var(--accent); color: var(--on-accent); }
.cover-playlist { background: linear-gradient(135deg, #6e2a0c, #df5e02); color: #fff; }
.cover-xs { width: 40px; height: 40px; }
.cover-sm { width: 48px; height: 48px; }
.cover-md { width: 56px; height: 56px; }
.cover-xs .ic, .cover-sm .ic, .cover-md .ic { width: 20px; height: 20px; }

/* ------------------------------------------------------------ Accès rapide (tuiles) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 8px; margin-bottom: 8px; }
.tile {
  position: relative; display: flex; align-items: center; gap: 12px;
  height: 60px; padding-right: 12px; border-radius: var(--radius-md); overflow: hidden;
  background: var(--card); font-weight: 700; font-size: 14px;
  transition: background-color var(--transition);
}
.tile:hover { background: var(--hover); color: var(--text); }
.tile .cover { width: 60px; height: 60px; border-radius: 0; }
.tile-title { flex: 1; min-width: 0; }
.hover-play {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 999px; border: 0; padding: 0;
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
  opacity: 0; transform: translateY(6px);
  transition: opacity .18s, transform .18s, background-color var(--transition);
}
.hover-play .ic { width: 16px; height: 16px; }
.tile:hover .hover-play, .tile:focus-within .hover-play,
.card:hover .hover-play, .card:focus-within .hover-play { opacity: 1; transform: none; }
.hover-play:hover { background: var(--accent-hover); }
.hover-play.js-playstate { opacity: 1; transform: none; } /* contenu en cours de lecture : bouton toujours visible */

/* ------------------------------------------------------------ Cartes */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(176px, 100%), 1fr)); gap: 8px; margin: 0 -12px; }
.shelf { grid-template-rows: auto; grid-auto-rows: 0; overflow: hidden; row-gap: 0; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 12px; border-radius: 10px;
  transition: background-color var(--transition);
  cursor: pointer;
}
.card:hover { background: var(--card); color: var(--text); }
.card-cover {
  position: relative; display: block; aspect-ratio: 1 / 1;
  border-radius: var(--radius-md); overflow: hidden;
  background: var(--card); box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-cover-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.75); }
.card-cover-placeholder .ic { width: 40%; height: 40%; stroke-width: 1.4; }
.card-cover .hover-play, .card-play {
  position: absolute; right: 8px; bottom: 8px; width: 48px; height: 48px;
}
.card-cover .hover-play .ic, .card-play .ic { width: 20px; height: 20px; }
.card-title { font-weight: 700; font-size: 15px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
a.card-title:hover { color: var(--accent-text); text-decoration: underline; }
.card-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-actions { display: flex; gap: 6px; position: relative; z-index: 2; }
/* Lien « étiré » : toute la carte / tuile est cliquable, le bouton ▶ reste au-dessus */
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.tile .hover-play, .card .hover-play { z-index: 2; }
.tile .hover-play { position: relative; }
.card-title .ic, .tl-artist .ic { width: 13px; height: 13px; vertical-align: -2px; color: var(--muted); }

/* ------------------------------------------------------------ Visibilité : vert = public, violet = privé */
.vis {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 1; letter-spacing: 0; white-space: nowrap;
  vertical-align: middle; flex-shrink: 0;
}
.vis .ic { width: 13px; height: 13px; color: inherit; stroke-width: 2.2; vertical-align: 0; }
.vis-public { color: var(--pub); background: var(--pub-bg); }
.vis-private { color: var(--priv); background: var(--priv-bg); }
/* Icône seule (listes de morceaux, bibliothèque, tuiles) */
.vis-icon { width: 18px; height: 18px; padding: 0; gap: 0; justify-content: center; border-radius: 5px; vertical-align: -4px; margin-right: 6px; }
.vis-icon .ic { width: 12px; height: 12px; }
.tile .vis-icon { margin: 0; }
/* Sur une pochette ou un en-tête teinté : fond sombre et couleurs fixes, lisibles dans les deux thèmes */
.card-cover .vis {
  position: absolute; top: 8px; left: 8px; z-index: 2; pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.card-cover .vis-public, .hero .vis-public { color: #6ee7a0; background: rgba(8,28,17,.78); }
.card-cover .vis-private, .hero .vis-private { color: #d4bfff; background: rgba(26,14,44,.8); }
.hero .vis, .now-badges .vis { height: 26px; }
/* Morceau privé dans une liste : liseré violet à gauche */
.track-row.is-private { box-shadow: inset 3px 0 0 var(--priv); }
/* Admin : liseré coloré en début de ligne et bouton de bascule aux couleurs de l'état */
.admin-table tr.vis-row-public td:first-child { box-shadow: inset 3px 0 0 var(--pub); }
.admin-table tr.vis-row-private td:first-child { box-shadow: inset 3px 0 0 var(--priv); }
.btn.vis-public, .btn.vis-public:hover { color: var(--pub); background: var(--pub-bg); }
.btn.vis-private, .btn.vis-private:hover { color: var(--priv); background: var(--priv-bg); }
.btn.vis-public:hover, .btn.vis-private:hover { box-shadow: inset 0 0 0 1px currentColor; }
.vis-legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------ Liste de morceaux (tableau) */
.track-list { display: flex; flex-direction: column; margin: 0 -12px; }
.tl-head, .track-row {
  display: grid; align-items: center; gap: 14px;
  grid-template-columns: 32px minmax(0, 1fr) minmax(0, .8fr) 96px 52px;
  padding: 6px 12px; border-radius: var(--radius-md);
}
.track-list.no-album .tl-head, .track-list.no-album .track-row { grid-template-columns: 32px minmax(0, 1fr) 96px 52px; }
.tl-head {
  color: var(--muted); font-size: 13px; font-weight: 600;
  border-bottom: 1px solid var(--line); border-radius: 0;
  padding-bottom: 10px; margin-bottom: 8px;
}
.tl-head .ic { width: 16px; height: 16px; }
.track-row { min-height: 56px; cursor: pointer; transition: background-color var(--transition); }
.track-row:hover { background: var(--hover); }
.tl-num {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 32px; color: var(--muted); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.tl-play { position: absolute; inset: 0; margin: auto; width: 28px; height: 28px; color: var(--text); opacity: 0; }
.tl-play .ic { width: 16px; height: 16px; }
.track-row:hover .tl-n, .track-row:hover .tl-eq,
.track-row:focus-within .tl-n, .track-row:focus-within .tl-eq { visibility: hidden; }
.track-row:hover .tl-play, .track-row:focus-within .tl-play { opacity: 1; }
.tl-eq { display: none; }
.track-row.is-playing .tl-n { display: none; }
.track-row.is-playing .tl-eq { display: inline-flex; }
html:not(.is-playing) .track-row.is-playing .tl-eq { display: none; }
html:not(.is-playing) .track-row.is-playing .tl-n { display: inline; color: var(--accent-text); }
.tl-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tl-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tl-title { font-weight: 600; font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-row.is-playing .tl-title { color: var(--accent-text); }
.tl-artist { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-album { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-album a:hover { color: var(--text); text-decoration: underline; }
.tl-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.tl-actions .ibtn { opacity: 0; }
.track-row:hover .tl-actions .ibtn, .tl-actions .ibtn:focus-visible, .tl-actions .js-like.is-liked { opacity: 1; }
.tl-dur { text-align: right; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.tl-empty { color: var(--muted); padding: 12px 0; }

/* Égaliseur animé (morceau en cours) */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq i { display: block; width: 3px; height: 8px; border-radius: 1px; background: var(--accent); animation: eq .9s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -.35s; }
.eq i:nth-child(3) { animation-delay: -.7s; }
@keyframes eq { from { height: 3px; } to { height: 14px; } }

/* ------------------------------------------------------------ En-tête de page (album, playlist, morceau) */
.main.has-hero { background: var(--panel); }
.hero {
  --hero-tint: var(--page-tint, var(--tint-default));
  margin: -88px -28px 0; padding: 88px 28px 28px;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 28px;
  color: #fff;
  background: var(--hero-tint);
  background: linear-gradient(180deg, var(--hero-tint) 0%, color-mix(in srgb, var(--hero-tint) 70%, #000) 100%);
}
.main.has-hero .main-top .ibtn { color: rgba(255,255,255,.85); background: rgba(0,0,0,.35); }
.main.has-hero .main-top .ibtn:hover { color: #fff; }
.main.has-hero .main-top .search-field { background: rgba(0,0,0,.35); border-color: rgba(255,255,255,.12); color: rgba(255,255,255,.8); }
.main.has-hero .main-top .search-field input { color: #fff; }
.main.has-hero .main-top .search-field input::placeholder { color: rgba(255,255,255,.75); }
.hero-cover {
  position: relative; width: 232px; max-width: 100%; aspect-ratio: 1 / 1; flex-shrink: 0;
  border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.25); color: rgba(255,255,255,.8);
  box-shadow: 0 20px 48px rgba(0,0,0,.5);
}
.hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.hero-cover > .ic { width: 40%; height: 40%; stroke-width: 1.3; }
.hero-info { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.hero-kicker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 700; }
.hero-title {
  margin: 0; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(36px, 5.2vw, 84px); line-height: 1; letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
.hero-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; color: rgba(255,255,255,.8); }
.hero-meta strong, .hero-meta a { color: #fff; font-weight: 700; }
.hero-meta a:hover { text-decoration: underline; }
.hero .ai-badge { background: rgba(0,0,0,.35); color: #ffd2ad; }
.hero .tag-chip { background: rgba(0,0,0,.3); color: #fff; }
.hero .tag-chip:hover { background: rgba(0,0,0,.5); color: #fff; }
.mini-avatar {
  width: 24px; height: 24px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 800;
}
.hero-after {
  margin: 0 -28px; padding: 20px 28px 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--page-tint, var(--tint-default)) 30%, transparent) 0px, transparent 220px);
}
.action-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } /* compat */

/* ------------------------------------------------------------ Tags & badges */
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--card); color: var(--muted);
  font-size: 13px; font-weight: 600;
  transition: background-color var(--transition), color var(--transition);
}
.tag-chip:hover { background: var(--accent-soft); color: var(--accent-text); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud .tag-chip { padding: 7px 14px; font-size: 14px; color: var(--text); background: transparent; border: 1px solid var(--line2); }
.tag-cloud .tag-chip:hover { border-color: var(--accent); color: var(--accent-text); }
.ai-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 12px; font-weight: 700;
}
.ai-badge .ic { width: 14px; height: 14px; }
.badge-soft { background: var(--card); color: var(--muted); }

/* ------------------------------------------------------------ Genres (tuiles colorées) */
.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 16px; }
.genre-tile {
  position: relative; display: block; height: 120px; padding: 16px;
  border-radius: 10px; overflow: hidden;
  color: #fff; font-weight: 800; font-size: 20px; line-height: 1.15;
  transition: transform var(--transition);
}
.genre-tile:hover { transform: scale(1.02); color: #fff; }
.genre-tile span { position: relative; z-index: 1; }
.genre-tile small { display: block; font-size: 13px; font-weight: 600; opacity: .85; margin-top: 4px; }
.genre-tile .ic { position: absolute; right: -10px; bottom: -14px; width: 92px; height: 92px; opacity: .35; transform: rotate(18deg); stroke-width: 1.2; }

/* ------------------------------------------------------------ Recherche */
.best-card {
  position: relative; display: flex; flex-direction: column; gap: 16px;
  padding: 20px; border-radius: var(--radius); background: var(--card);
  transition: background-color var(--transition);
}
.best-card:hover { background: var(--hover); color: var(--text); }
.best-card .cover { width: 96px; height: 96px; border-radius: var(--radius-md); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.best-card .hover-play { position: absolute; right: 20px; bottom: 20px; width: 52px; height: 52px; }
.best-card:hover .hover-play { opacity: 1; transform: none; }
.best-title { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.search-cols { display: flex; flex-wrap: wrap; gap: 24px; }
.search-cols > section { min-width: 0; }

/* ------------------------------------------------------------ Formulaires */
.form-card {
  max-width: 440px; margin: 40px auto; padding: 32px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.form-card h1 { text-align: center; margin-bottom: 24px; font-size: 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px;
  background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius-md);
  color: var(--text); outline: none;
  transition: border-color var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 84px; }
.field-check { display: flex; align-items: center; gap: 10px; }
.field-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-foot { margin-top: 20px; text-align: center; color: var(--muted); font-size: 14px; }
.form-foot a { color: var(--accent-text); font-weight: 600; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------------------ Admin / Studio */
.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
.admin-side {
  background: var(--card); border-radius: var(--radius); padding: 10px;
  height: fit-content; display: flex; flex-direction: column; gap: 2px;
}
.admin-side a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-md);
  color: var(--muted); font-weight: 600; font-size: 14px;
}
.admin-side a .ic { width: 18px; height: 18px; }
.admin-side a:hover { color: var(--text); background: var(--hover); }
.admin-side a.is-active { color: var(--accent-text); background: var(--accent-soft); }
.admin-main { min-width: 0; }
.admin-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.admin-table tr:hover td { background: var(--hover); }
.admin-table .ic { width: 16px; height: 16px; }
.dropzone {
  display: block; padding: 50px 20px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line2); border-radius: var(--radius); color: var(--muted);
  transition: border-color var(--transition), background-color var(--transition), color var(--transition);
}
.dropzone strong { display: block; margin-bottom: 4px; color: var(--text); }
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat-num { font-family: var(--font-display); font-size: 30px; font-weight: 800; }
.stat-lbl { color: var(--muted); font-size: 13px; margin-top: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; }
.tab .ic { width: 18px; height: 18px; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--accent-text); border-bottom-color: var(--accent); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.status-pill .ic { width: 16px; height: 16px; }

/* ------------------------------------------------------------ Divers contenus */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 24px; }
.sort-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sort-bar select { background: var(--card); border: 1px solid var(--line2); color: var(--text); border-radius: var(--radius-md); padding: 7px 12px; }
.track-details { max-width: 820px; display: grid; gap: 14px; margin-top: 28px; }
.track-details details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.track-details summary { cursor: pointer; font-weight: 700; }
.track-details .pre { line-height: 1.65; margin: 12px 0 2px; }
.empty-state { padding: 40px 0; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------ Panneau « En cours de lecture » */
.now-panel {
  display: none;
  position: sticky; top: var(--gap);
  height: calc(100vh - 2 * var(--gap) - var(--player-space));
  overflow-y: auto; scrollbar-width: thin;
  padding: 16px; flex-direction: column; gap: 16px;
}
.now-head { display: flex; align-items: center; gap: 8px; }
.now-head .now-context { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; }
.now-cover {
  position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden;
  background: var(--card); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
}
.now-cover img { width: 100%; height: 100%; object-fit: cover; }
.now-cover .ic { width: 35%; height: 35%; stroke-width: 1.3; }
.now-title-row { display: flex; align-items: flex-start; gap: 6px; }
.now-title { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; display: block; }
.now-title:hover { text-decoration: underline; color: var(--text); }
.now-artist { color: var(--muted); font-size: 15px; }
.now-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.now-card { background: var(--card); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.now-card h3 { margin: 0; font-size: 15px; }
.now-lyrics { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.55; white-space: pre-line; max-height: 300px; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.now-lyrics.is-open { max-height: none; -webkit-mask-image: none; mask-image: none; }
.now-desc { margin: 0; font-size: 14px; color: var(--muted); white-space: pre-line; }
.now-next { display: flex; align-items: center; gap: 12px; padding: 6px; margin: 0 -6px; border-radius: var(--radius-md); border: 0; background: transparent; color: inherit; text-align: left; width: calc(100% + 12px); }
.now-next:hover { background: var(--hover); }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.link-btn:hover { color: var(--text); text-decoration: underline; }

/* ------------------------------------------------------------ Barre de lecture */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: var(--player-h);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  align-items: center; gap: 16px; padding: 0 16px;
  background: var(--ground);
}
.player-track { display: flex; align-items: center; gap: 12px; min-width: 0; position: relative; }
.player-cover { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; background: var(--card); flex-shrink: 0; }
.player-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.player-title { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.player-title:hover { text-decoration: underline; color: var(--text); }
.player-artist { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-open { display: none; }
.player-center { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.player-controls { display: flex; align-items: center; gap: 8px; }
.player-controls .ibtn .ic { width: 18px; height: 18px; }
.play-btn {
  width: 40px !important; height: 40px !important;
  background: var(--text) !important; color: var(--ground) !important;
}
.play-btn:hover { transform: scale(1.06); }
.play-btn .ic { width: 20px !important; height: 20px !important; }
.repeat-one-dot { position: absolute; top: 4px; right: 3px; font-size: 9px; font-weight: 800; line-height: 1; }
#btn-repeat, #fp-repeat { position: relative; }
.ibtn:not(.is-one) .repeat-one-dot { display: none; }
#fp-repeat .repeat-one-dot { top: 8px; right: 8px; }
.player-progress { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 640px; }
.time { color: var(--muted); font-size: 12px; min-width: 36px; text-align: center; font-variant-numeric: tabular-nums; }
.progress {
  position: relative; flex: 1; height: 16px; cursor: pointer;
  display: flex; align-items: center; touch-action: none;
}
.progress::before { content: ""; position: absolute; left: 0; right: 0; height: 4px; border-radius: 999px; background: var(--track); }
.progress-bar { position: relative; height: 4px; width: 0%; border-radius: 999px; background: var(--text); }
.progress-bar::after {
  content: ""; position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  border-radius: 999px; background: var(--text); opacity: 0; transition: opacity var(--transition);
}
.progress:hover .progress-bar { background: var(--accent); }
.progress:hover .progress-bar::after { opacity: 1; }
.player-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.player-right .ibtn .ic { width: 18px; height: 18px; }
.volume-wrap { display: flex; align-items: center; gap: 4px; }
#volume {
  width: 100px; height: 4px; -webkit-appearance: none; appearance: none;
  background: linear-gradient(to right, var(--text) var(--vol, 80%), var(--track) var(--vol, 80%));
  border-radius: 999px; outline: none; cursor: pointer;
}
#volume:hover { background: linear-gradient(to right, var(--accent) var(--vol, 80%), var(--track) var(--vol, 80%)); }
#volume::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--text); }
#volume::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--text); }

/* File d'attente */
.queue-panel {
  position: fixed; right: 12px; bottom: calc(var(--player-space) + 12px); z-index: 45;
  width: 380px; max-height: 60vh;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
}
.queue-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.queue-head h3 { margin: 0; }
.queue-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.queue-list li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--radius-md); cursor: pointer; font-size: 14px; }
.queue-list li:hover { background: var(--hover); }
.queue-list li.is-current { color: var(--accent-text); }
.queue-list img, .queue-list .q-cover { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; background: var(--panel); flex-shrink: 0; }
.queue-list li:has(.q-item) { padding: 0; }
.q-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border: 0; border-radius: inherit; background: transparent; color: inherit; font: inherit; text-align: left; }
html.fp-open .queue-panel { z-index: 90; bottom: 12px; }

/* Modale (ajout à une playlist) */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,.6); }
.modal-card { width: 100%; max-width: 420px; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.modal-card h3 { margin-bottom: 16px; }
#playlist-modal-list { max-height: 260px; overflow-y: auto; margin-bottom: 16px; }
#playlist-modal-list .pl-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); cursor: pointer; }
#playlist-modal-list .pl-item:hover { background: var(--hover); }
.playlist-new { display: flex; gap: 8px; margin-bottom: 14px; }
.playlist-new input { flex: 1; min-width: 0; padding: 9px 14px; background: var(--panel); border: 1px solid var(--line2); border-radius: 999px; color: var(--text); outline: none; }
.playlist-new input:focus { border-color: var(--accent); }

/* ------------------------------------------------------------ Barre d'onglets (mobile) */
.tabbar { display: none; }

/* ------------------------------------------------------------ Lecteur plein écran (mobile) */
.fullplayer {
  --full-tint: var(--tint-default);
  position: fixed; inset: 0; z-index: 80;
  overflow-y: auto; color: #fff;
  background: linear-gradient(180deg, var(--full-tint) 0%, #0d0d10 100%);
  background: linear-gradient(180deg, var(--full-tint) 0%, color-mix(in srgb, var(--full-tint) 55%, #000) 50%, #0d0d10 100%);
  animation: sheetUp .25s ease-out;
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.fp-inner { max-width: 480px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top, 0px)) 24px calc(40px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 20px; }
.fp-top { display: flex; align-items: center; gap: 4px; margin: 0 -12px; }
.fp-context { flex: 1; min-width: 0; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.fp-context small { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.75); }
.fp-context span { font-size: 14px; font-weight: 700; }
.fullplayer .ibtn { color: rgba(255,255,255,.85); width: 48px; height: 48px; }
.fullplayer .ibtn:hover { color: #fff; background: rgba(255,255,255,.08); }
.fullplayer .ibtn.on, .fullplayer .js-like.is-liked { color: #ff9a52; }
.fp-cover {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.25); box-shadow: 0 24px 56px rgba(0,0,0,.5);
}
.fp-cover img { width: 100%; height: 100%; object-fit: cover; }
.fp-cover .ic { width: 35%; height: 35%; stroke-width: 1.2; }
.fp-title-row { display: flex; align-items: center; gap: 4px; }
.fp-title { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.fp-artist { font-size: 16px; color: rgba(255,255,255,.75); }
.fp-progress { position: relative; height: 20px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.fp-progress::before { content: ""; position: absolute; left: 0; right: 0; height: 4px; border-radius: 999px; background: rgba(255,255,255,.25); }
.fp-progress-bar { position: relative; height: 4px; width: 0%; border-radius: 999px; background: #fff; }
.fp-progress-bar::after { content: ""; position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 999px; background: #fff; }
.fp-times { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255,255,255,.75); font-variant-numeric: tabular-nums; margin-top: -10px; }
.fp-controls { display: flex; align-items: center; justify-content: space-between; }
.fp-controls .ibtn.big-skip .ic { width: 30px; height: 30px; }
.fp-play {
  width: 72px; height: 72px; border: 0; border-radius: 999px; padding: 0;
  background: var(--accent); color: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.fp-play .ic { width: 30px; height: 30px; }
.fp-bottom { display: flex; align-items: center; justify-content: space-between; margin: -6px -12px 0; }
.fp-bottom .ai-badge { margin-left: 12px; background: rgba(0,0,0,.3); color: #ffd2ad; height: 30px; }
.fp-card { border-radius: 12px; background: rgba(0,0,0,.28); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.fp-card h2 { margin: 0; font-family: var(--font); font-size: 16px; letter-spacing: 0; }
.fp-lyrics { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.45; white-space: pre-line; }
.fp-desc { margin: 0; font-size: 14px; line-height: 1.55; color: rgba(255,255,255,.85); white-space: pre-line; }
html.fp-open { overflow: hidden; }

/* ------------------------------------------------------------ Autoplay bloqué / chargement */
.hero-cover.autoplay-prompt { cursor: pointer; }
.hero-cover.autoplay-prompt::before { content: ""; position: absolute; inset: 0; z-index: 1; background: rgba(0,0,0,.45); backdrop-filter: blur(2px); }
.hero-cover.autoplay-prompt::after {
  content: ""; position: absolute; z-index: 2; left: 50%; top: 50%;
  width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 999px;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%230d0d10' d='M8 5.14v13.72a1 1 0 0 0 1.52.85l11.12-6.86a1 1 0 0 0 0-1.7L9.52 4.29A1 1 0 0 0 8 5.14z'/%3E%3C/svg%3E") center / 38px no-repeat;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  animation: autoplayBeat 1.4s ease-in-out infinite;
}
@keyframes autoplayBeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.autoplay-toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 60;
  padding: 10px 18px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 14px; pointer-events: none; box-shadow: 0 8px 28px rgba(223,94,2,.45);
}
html.is-loading::before {
  content: ""; position: fixed; top: 0; left: 0; z-index: 9999;
  width: 100%; height: 2px; background: var(--accent);
  animation: pjaxLoad 1.2s linear infinite;
}
@keyframes pjaxLoad { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ------------------------------------------------------------ Grand écran : panneau « En cours de lecture » */
@media (min-width: 1200px) {
  .shell.has-now { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--now-w); }
  .shell.has-now .now-panel { display: flex; }
}

/* ------------------------------------------------------------ Tablette */
@media (max-width: 1100px) {
  :root { --side-w: 240px; }
  .search-field { flex-basis: 280px; }
}

/* ------------------------------------------------------------ Mobile (≤ 900 px) */
@media (max-width: 900px) {
  :root { --player-h: 66px; }
  html { --player-space: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  html.has-player { --player-space: calc(var(--tabbar-h) + var(--player-h) + 8px + env(safe-area-inset-bottom, 0px)); }

  .shell { display: block; padding: 0; }
  .sidebar { display: none; }
  .now-panel { display: none !important; }
  .main {
    min-height: 100vh; border-radius: 0;
    padding: 12px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px));
  }
  /* La barre d'onglets propose déjà « Connexion » : en-tête sur une seule ligne */
  .main-top > .btn { display: none; }
  .main-top { margin-bottom: 16px; gap: 8px; }
  .main-top .nav-arrows, .main-top .search-field { display: none; }
  .main-brand { display: flex; align-items: center; gap: 10px; }
  .main-brand .brand-name { font-size: 18px; }
  .greeting { font-size: 28px; }
  h1 { font-size: 26px; }
  h2 { font-size: 21px; }

  .hero { margin: -76px -16px 0; padding: 76px 16px 24px; justify-content: center; text-align: center; }
  .hero-cover { width: min(240px, 70vw); }
  .hero-info { flex-basis: 100%; align-items: center; }
  .hero-kicker, .hero-meta { justify-content: center; }
  .hero-after { margin: 0 -16px; padding: 16px 16px 0; }
  .action-bar { justify-content: center; }

  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); margin: 0 -8px; }
  .card { padding: 8px; }
  .shelf { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; margin: 0 -16px; padding: 0 8px; }
  .shelf::-webkit-scrollbar { display: none; }
  .shelf .card { flex: 0 0 152px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { height: 56px; font-size: 13px; }
  .tile .cover { width: 56px; height: 56px; }
  .tile .hover-play { display: none; }
  .hover-play { opacity: 1; transform: none; }
  .tile-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }

  .track-list { margin: 0 -8px; }
  .tl-head { display: none; }
  .track-row, .track-list.no-album .track-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 6px 8px; }
  .track-row .tl-num, .track-row .tl-album, .track-row .tl-dur { display: none; }
  .tl-actions .ibtn { opacity: 1; }
  .tl-actions .tl-hide-sm { display: none; }

  .admin-layout { grid-template-columns: 1fr; gap: 16px; }
  .admin-side { flex-direction: row; overflow-x: auto; padding: 6px; }
  .admin-side a { white-space: nowrap; }
  .admin-card { overflow-x: auto; padding: 18px; }
  .form-card { margin: 16px auto; padding: 24px 20px; }
  input, select, textarea { font-size: 16px; } /* évite le zoom automatique d'iOS */

  /* Mini-lecteur au-dessus de la barre d'onglets */
  .player {
    left: max(8px, env(safe-area-inset-left, 0px)); right: max(8px, env(safe-area-inset-right, 0px));
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 4px);
    height: var(--player-h); border-radius: 10px;
    grid-template-columns: minmax(0, 1fr) auto; gap: 4px; padding: 0 6px 0 8px;
    background: var(--player-tint, #4a1d09); color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    overflow: hidden;
  }
  .player-cover { width: 46px; height: 46px; }
  .player-artist { color: rgba(255,255,255,.75); }
  .player-track .ibtn:not(#player-like) { display: none; }
  #player-like { color: rgba(255,255,255,.85); }
  #player-like.is-liked { color: #ff9a52; }
  .player-open { display: block; position: absolute; inset: 0; z-index: 1; border: 0; background: transparent; }
  #player-like { position: relative; z-index: 2; }
  .player-center { flex-direction: row; }
  .player-controls > :not(#btn-play) { display: none; }
  .play-btn { background: transparent !important; color: #fff !important; width: 44px !important; height: 44px !important; }
  .play-btn .ic { width: 24px !important; height: 24px !important; }
  .player-progress { position: absolute; left: 8px; right: 8px; bottom: 0; max-width: none; gap: 0; pointer-events: none; }
  .player-progress .time { display: none; }
  .progress { height: 2px; }
  .progress::before { height: 2px; background: rgba(255,255,255,.25); }
  .progress-bar { height: 2px; background: #fff !important; }
  .progress-bar::after { display: none; }
  .player-right { display: none; }

  .queue-panel { left: 8px; right: 8px; width: auto; }

  /* Barre d'onglets */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    /* + la hauteur de l'indicateur d'accueil des iPhone récents */
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding: 4px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    background: linear-gradient(180deg, transparent 0%, var(--ground) 35%);
  }
  .tabbar-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: 11px; font-weight: 600;
  }
  .tabbar-item .ic { width: 24px; height: 24px; }
  .tabbar-item.is-active { color: var(--text); }
  .tabbar-item:hover { color: var(--text); }
}

@media (max-width: 520px) {
  .greeting { font-size: 26px; }
  .best-title { font-size: 24px; }
}

/* ------------------------------------------------------------ Écrans tactiles */
@media (hover: none) {
  .tl-actions .ibtn { opacity: 1; }
  .card .hover-play, .best-card .hover-play { opacity: 1; transform: none; }
  .volume-wrap { display: none; }
}

/* ------------------------------------------------------------ Mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .eq i { animation: none; height: 8px; }
}

/* ------------------------------------------------------------ Phase 3 : lisibilité et accessibilité */
/* Textes longs (liens, prompts, paroles) : coupés proprement au lieu de déborder */
.pre, .now-desc, .now-lyrics, .fp-desc, .fp-lyrics, .now-title, .best-title, .hero-title, .track-details { overflow-wrap: anywhere; }

/* Lien « Aller au contenu » : invisible jusqu'à ce qu'on y arrive au clavier */
.skip-link {
  position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); left: 8px; z-index: 2000;
  padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-weight: 700; transform: translateY(-300%);
}
.skip-link:focus { transform: none; color: var(--on-accent); }

/* Focus visibles partout, y compris sur le volume et sur les boutons ▶ qui n'apparaissent qu'au survol */
#volume:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.best-card:focus-within .hover-play { opacity: 1; transform: none; }
/* Sur les fonds teintés (en-têtes, plein écran), l'anneau orange manque de contraste : blanc cerné de noir */
.hero :focus-visible, .fullplayer :focus-visible { outline-color: #fff; box-shadow: 0 0 0 4px rgba(0,0,0,.55); }

/* Proposition de reprise de la lecture après un rechargement */
.resume-pill {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  bottom: calc(var(--player-space) + 16px);
  max-width: calc(100vw - 32px); padding: 10px 18px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-lg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Barre de lecture entre 900 et 1 280 px : de la place pour le titre (ajout et partage restent
   disponibles dans le panneau et sur la page du morceau) */
@media (min-width: 901px) and (max-width: 1279px) {
  #player-add, #player-share { display: none !important; }
  .player { grid-template-columns: minmax(200px, 1fr) minmax(0, 2fr) minmax(0, 1fr); }
}
@media (min-width: 901px) and (max-width: 1099px) {
  #volume { display: none; } /* le bouton « couper le son » reste */
}
@media (max-width: 900px) {
  .player :focus-visible { outline-color: #fff; box-shadow: 0 0 0 4px rgba(0,0,0,.55); }
}
