
:root {
  --sidebar-bg: #0a0a0c;
  --toolbar-bg: rgba(20, 20, 22, 0.85);
  --content-bg-top: #1c1c1e;
  --content-bg-bottom: #0f0f11;
  --row-hover: rgba(255, 255, 255, 0.06);
  --row-active: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.08);
  --text-hi: #f5f5f7;
  --text-mid: #9d9da3;
  --text-low: #6e6e73;
  --accent: #fa2d48;
  --accent-hover: #ff4a63;
  --danger: #ff5c5c;
  --ok: #33d17a;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  /* Palette extraite de la pochette (mise à jour en JS) */
  --alb-1: #3a3a44;
  --alb-2: #23232a;
  --alb-3: #4a4a58;
  --alb-deep: #0b0b0d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }
body {
  background: var(--content-bg-bottom); color: var(--text-hi); font-family: var(--font);
  font-size: 14.5px; -webkit-font-smoothing: antialiased; user-select: none;
}
.app { display: flex; height: 100vh; overflow: hidden; }

/* Troncature fiable des textes longs */
.suggest-card-title, .suggest-card-sub,
.playlist-card-name, .playlist-card-count,
.np-title, .np-artist {
  display: block;
  width: 100%;
}
.playlist-nav-name { min-width: 0; flex: 1; }

/* ================= SIDEBAR ================= */
.sidebar {
  width: 258px; flex-shrink: 0; background: var(--sidebar-bg);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  padding: 20px 12px; -webkit-app-region: drag;
}
.sidebar-brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px 20px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #ff7a8a);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; color: var(--text-hi); }
.sidebar-nav { display: flex; flex-direction: column; gap: 1px; -webkit-app-region: no-drag; }
.nav-item {
  display: flex; align-items: center; gap: 10px; background: none; border: none;
  color: var(--text-mid); font-size: 14.5px; font-weight: 500; padding: 9px 12px;
  border-radius: 8px; cursor: pointer; text-align: left; width: 100%;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item svg { flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-hi); }
.nav-item.active { background: var(--accent); color: white; }
.nav-item.active svg { opacity: 1; }
.nav-section-label {
  margin: 20px 12px 7px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-low);
}
.playlists-nav-list { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; -webkit-app-region: no-drag; }
.playlist-nav-item {
  display: flex; align-items: center; gap: 8px; background: none; border: none;
  color: var(--text-mid); font-size: 13.5px; padding: 7px 12px; border-radius: 8px;
  cursor: pointer; text-align: left; width: 100%;
  transition: background 0.15s ease, color 0.15s ease;
}
.playlist-nav-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-hi); }
.playlist-nav-cover {
  width: 26px; height: 26px; border-radius: 4px; flex-shrink: 0; object-fit: cover;
  background: linear-gradient(135deg, #3a3a3e, #202022);
}
.playlist-nav-cover.empty { display: flex; align-items: center; justify-content: center; }
.playlist-nav-cover.empty::before { content: '♪'; color: var(--text-low); font-size: 11px; }

.sidebar-footer { margin-top: auto; padding: 10px 8px 2px; border-top: 1px solid var(--border); }
.source-badge { font-size: 10.5px; color: var(--text-low); line-height: 1.4; }

/* ================= MAIN ================= */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.toolbar {
  display: flex; align-items: center; gap: 22px; padding: 13px 22px;
  background: var(--toolbar-bg); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border); -webkit-app-region: drag; flex-shrink: 0;
}
.transport { display: flex; align-items: center; gap: 6px; -webkit-app-region: no-drag; flex-shrink: 0; }
.transport-btn {
  width: 35px; height: 35px; border-radius: 50%; border: none; background: none;
  color: var(--text-hi); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}
.transport-btn:hover { background: rgba(255, 255, 255, 0.08); transform: scale(1.05); }
.transport-btn:active { transform: scale(0.95); }
.transport-btn:disabled { opacity: 0.3; cursor: default; }
.transport-btn:disabled:hover { background: none; transform: none; }
.play-btn { width: 39px; height: 39px; color: var(--text-hi); }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.now-playing-lcd { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 520px; -webkit-app-region: no-drag; }
.np-cover-btn { background: none; border: none; padding: 0; cursor: pointer; flex-shrink: 0; border-radius: 4px; }
.np-cover {
  width: 42px; height: 42px; border-radius: 6px; background: var(--content-bg-top);
  object-fit: cover; flex-shrink: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); transition: opacity 0.2s ease;
}
.np-cover-placeholder { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2a2a2e, #1a1a1c); }
.np-cover-placeholder::before { content: '♪'; color: var(--text-low); font-size: 15px; }
.np-meta { display: flex; flex-direction: column; min-width: 90px; overflow: hidden; flex-shrink: 1; }
.np-title { font-size: 13.5px; font-weight: 600; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.np-artist { font-size: 12.5px; color: var(--text-mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }

.heart-btn {
  background: none; border: none; color: var(--text-mid); cursor: pointer; display: flex;
  align-items: center; justify-content: center; padding: 4px; border-radius: 50%; flex-shrink: 0;
  transition: color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.heart-btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; }
.heart-btn:hover { color: var(--accent-hover); background: rgba(250, 45, 72, 0.1); }
.heart-btn:disabled { opacity: 0.3; cursor: default; }
.heart-btn.liked { color: var(--accent); }
.heart-btn.liked svg { fill: var(--accent); stroke: var(--accent); }
.heart-btn.pulse { animation: heartPulse 0.35s ease; }
@keyframes heartPulse { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

.scrub-wrap { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 120px; -webkit-app-region: no-drag; }
.scrub-wrap.buffering #scrub { opacity: 0.55; }
.time-label { font-size: 12px; color: var(--text-low); font-variant-numeric: tabular-nums; width: 42px; flex-shrink: 0; text-align: center; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 5px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.15); outline: none; flex: 1; cursor: pointer;
}
input[type="range"]:disabled { cursor: wait; opacity: 0.5; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: white; cursor: pointer; box-shadow: 0 0 2px rgba(0, 0, 0, 0.4); opacity: 0; transition: opacity 0.15s ease;
}
.scrub-wrap:hover input[type="range"]::-webkit-slider-thumb,
.fs-progress-wrap:hover input[type="range"]::-webkit-slider-thumb,
.volume-wrap:hover input[type="range"]::-webkit-slider-thumb,
.fs-volume-row:hover input[type="range"]::-webkit-slider-thumb { opacity: 1; }
#scrub, #fs-scrub { background: linear-gradient(to right, var(--text-hi) 0%, rgba(255,255,255,0.15) 0%); }
#volume, #fs-volume { background: linear-gradient(to right, var(--text-hi) 80%, rgba(255,255,255,0.15) 80%); }

.toolbar-right { display: flex; align-items: center; gap: 16px; -webkit-app-region: no-drag; flex-shrink: 0; }
.volume-wrap { display: flex; align-items: center; gap: 8px; width: 138px; }
.icon-btn { background: none; border: none; color: var(--text-mid); cursor: pointer; display: flex; padding: 2px; flex-shrink: 0; transition: color 0.15s ease; }
.icon-btn:hover { color: var(--text-hi); }
#volume { width: 100px; }

/* ---------- Content ---------- */
.content { flex: 1; overflow-y: auto; background: linear-gradient(to bottom, var(--content-bg-top), var(--content-bg-bottom) 420px); padding: 24px 30px 48px; }
.view { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.page-title { font-size: 33px; font-weight: 800; margin: 0 0 20px; letter-spacing: -0.02em; }
.section-title { font-size: 21px; font-weight: 700; margin: 30px 0 14px; letter-spacing: -0.01em; }
.section-title:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.text-btn { background: none; border: none; color: var(--text-mid); font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--font); }
.text-btn:hover { color: var(--text-hi); text-decoration: underline; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 44vh; color: var(--text-low); text-align: center; gap: 4px; }
.empty-state.small { height: 20vh; }
.empty-state p:first-child { font-size: 17px; font-weight: 600; color: var(--text-mid); }
.empty-state .hint { font-size: 13.5px; color: var(--text-low); }
.hint { font-size: 13.5px; color: var(--text-low); }

.np-hero {
  display: flex; align-items: center; gap: 18px; padding: 18px; margin-bottom: 22px; border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--alb-1) 45%, transparent), rgba(255,255,255,0.03));
  border: 1px solid var(--border); transition: background 0.6s ease;
}
.np-hero-cover-btn { background: none; border: none; padding: 0; cursor: pointer; flex-shrink: 0; border-radius: 10px; }
.np-hero-cover { width: 104px; height: 104px; border-radius: 10px; object-fit: cover; box-shadow: 0 6px 20px rgba(0,0,0,0.4); display: block; }
.np-hero-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.np-hero-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }
.np-hero-info h1 { font-size: 27px; margin: 0; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 480px; }
.np-hero-info p { font-size: 15px; margin: 0; color: var(--text-mid); }

/* ---------- Carrousels horizontaux ---------- */
.home-section { margin-bottom: 30px; }
.home-section-title { font-size: 24px; font-weight: 800; margin: 0 0 14px; letter-spacing: -0.01em; }
.hscroll { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x proximity; }
.hscroll::-webkit-scrollbar { height: 8px; }
.hscroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
.hscroll-round .suggest-card-cover { border-radius: 50%; }

.suggest-card { flex: 0 0 178px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; scroll-snap-align: start; transition: transform 0.15s ease; overflow: hidden; }
.suggest-card:hover { transform: translateY(-3px); }
.suggest-card-cover {
  width: 178px; height: 178px; border-radius: 8px; object-fit: cover; background: linear-gradient(135deg, #3a3a3e, #1a1a1c);
  box-shadow: 0 8px 22px rgba(0,0,0,0.4); position: relative; flex-shrink: 0;
}
.suggest-card-cover.empty { display: flex; align-items: center; justify-content: center; }
.suggest-card-cover.empty::before { content: '♪'; color: var(--text-low); font-size: 34px; }
.suggest-card-cover.empty.artist-placeholder::before { content: '👤'; font-size: 40px; }
.suggest-card-title { font-size: 14px; font-weight: 600; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-card-sub { font-size: 12.5px; color: var(--text-mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =======================================================================
   RECHERCHE — refonte (inspirée Spotify / Apple Music)
   ======================================================================= */
.search-hero { position: sticky; top: -20px; z-index: 30; padding: 6px 0 14px; margin: -6px 0 6px; background: linear-gradient(to bottom, var(--content-bg-top) 72%, transparent); }
.search-page-bar {
  position: relative; display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.08); border: 1px solid transparent; border-radius: 999px;
  padding: 14px 20px; max-width: 700px; transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.search-page-bar:focus-within { background: rgba(255,255,255,0.13); border-color: rgba(255,255,255,0.22); box-shadow: 0 6px 26px rgba(0,0,0,0.35); }
.search-page-icon { color: var(--text-mid); flex-shrink: 0; }
.search-page-bar input {
  flex: 1; background: none; border: none; outline: none; color: var(--text-hi);
  font-size: 17px; font-weight: 500; font-family: var(--font); min-width: 0;
}
.search-page-bar input::placeholder { color: var(--text-low); font-weight: 400; }
.search-clear { background: rgba(255,255,255,0.12); border: none; color: var(--text-hi); width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.search-clear:hover { background: rgba(255,255,255,0.22); }

.search-filters { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.filter-chip {
  background: rgba(255,255,255,0.08); border: none; color: var(--text-hi); font-size: 14px; font-weight: 600;
  padding: 9px 18px; border-radius: 999px; cursor: pointer; font-family: var(--font); transition: background 0.15s ease, color 0.15s ease;
}
.filter-chip:hover { background: rgba(255,255,255,0.16); }
.filter-chip.active { background: var(--text-hi); color: #111; }

.search-suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: 420px; overflow-y: auto;
  background: #17171a; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 22px 50px rgba(0,0,0,0.6);
  z-index: 60; padding: 8px;
}
.search-suggest::-webkit-scrollbar { width: 8px; }
.search-suggest::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 4px; }
.suggest-group-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-low); padding: 8px 10px 5px; }
.search-suggest-item { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 9px; cursor: pointer; transition: background 0.12s ease; }
.search-suggest-item:hover, .search-suggest-item.hl { background: rgba(255,255,255,0.09); }
.search-suggest-cover { width: 44px; height: 44px; border-radius: 5px; object-fit: cover; background: linear-gradient(135deg,#3a3a3e,#1c1c1e); flex-shrink: 0; }
.search-suggest-cover.round { border-radius: 50%; }
.search-suggest-info { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.search-suggest-title { font-size: 14.5px; font-weight: 500; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-suggest-artist { font-size: 12.5px; color: var(--text-mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-suggest-hint { padding: 12px 10px; font-size: 12px; color: var(--text-low); }
.suggest-term { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; cursor: pointer; color: var(--text-hi); font-size: 13.5px; }
.suggest-term:hover, .suggest-term.hl { background: rgba(255,255,255,0.09); }
.suggest-term svg { color: var(--text-low); flex-shrink: 0; }

.recent-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.recent-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px; cursor: pointer; transition: background 0.14s ease; }
.recent-item:hover { background: rgba(255,255,255,0.06); }
.recent-item-icon { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; color: var(--text-mid); flex-shrink: 0; }
.recent-item-text { flex: 1; font-size: 15px; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item-remove { background: none; border: none; color: var(--text-low); cursor: pointer; padding: 4px; border-radius: 50%; display: flex; opacity: 0; }
.recent-item:hover .recent-item-remove { opacity: 1; }
.recent-item-remove:hover { color: var(--text-hi); background: rgba(255,255,255,0.1); }

.browse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 18px; padding-bottom: 20px; }
.browse-card {
  position: relative; aspect-ratio: 16/10; border-radius: 12px; overflow: hidden; cursor: pointer;
  display: flex; align-items: flex-start; padding: 14px; border: none; text-align: left;
  font-family: var(--font); font-size: 19px; font-weight: 800; color: #fff; letter-spacing: -0.01em;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.browse-card:hover { transform: translateY(-3px); filter: brightness(1.1); }
.browse-card::after {
  content: ''; position: absolute; right: -14px; bottom: -14px; width: 74px; height: 74px;
  border-radius: 8px; background: rgba(0,0,0,0.28); transform: rotate(25deg); box-shadow: 0 8px 18px rgba(0,0,0,0.3);
}

.search-split { display: grid; grid-template-columns: minmax(280px, 1.05fr) 1.35fr; gap: 26px; align-items: start; }
@media (max-width: 1080px) { .search-split { grid-template-columns: 1fr; } }
.split-col { min-width: 0; }
.top-card {
  background: rgba(255,255,255,0.045); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; cursor: pointer; display: flex; flex-direction: column; gap: 14px;
  transition: background 0.16s ease; position: relative; overflow: hidden;
}
.top-card:hover { background: rgba(255,255,255,0.085); }
.top-card-cover { width: 130px; height: 130px; border-radius: 8px; object-fit: cover; box-shadow: 0 10px 26px rgba(0,0,0,0.5); background: linear-gradient(135deg,#3a3a3e,#1a1a1c); }
.top-card-cover.round { border-radius: 50%; }
.top-card-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.top-card-sub { font-size: 14px; color: var(--text-mid); margin-top: 6px; }
.top-card-badge { display: inline-block; background: rgba(255,255,255,0.12); color: var(--text-hi); font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; margin-top: 10px; }
.top-card-play {
  position: absolute; right: 18px; bottom: 18px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none; display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transform: translateY(8px); transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.top-card:hover .top-card-play { opacity: 1; transform: translateY(0); }

.mini-list { display: flex; flex-direction: column; gap: 2px; }
.mini-row { display: grid; grid-template-columns: 50px 1fr auto auto; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 8px; cursor: pointer; transition: background 0.14s ease; }
.mini-row:hover { background: var(--row-hover); }
.mini-row.playing .mini-title { color: var(--accent); }
.mini-cover { width: 50px; height: 50px; border-radius: 5px; object-fit: cover; background: linear-gradient(135deg,#3a3a3e,#1a1a1c); }
.mini-info { min-width: 0; display: flex; flex-direction: column; }
.mini-title { font-size: 15px; font-weight: 500; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-artist { font-size: 12.5px; color: var(--text-mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-dur { font-size: 11.5px; color: var(--text-low); font-variant-numeric: tabular-nums; }
.mini-heart { background: none; border: none; color: var(--text-low); cursor: pointer; padding: 4px; display: flex; opacity: 0; }
.mini-heart svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
.mini-row:hover .mini-heart, .mini-heart.liked { opacity: 1; }
.mini-heart.liked { color: var(--accent); }
.mini-heart.liked svg { fill: var(--accent); stroke: var(--accent); }

/* ---------- En-têtes de colonnes ---------- */
.results-header.apple-header {
  display: grid; grid-template-columns: 48px 1fr 230px 70px 78px; gap: 16px;
  padding: 0 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
}
.results-col { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-low); }
.results-col-duration { text-align: right; }
.results { display: flex; flex-direction: column; }

/* ---------- Ligne de piste ---------- */
.track-row {
  display: grid; grid-template-columns: 48px 1fr 230px 70px 78px; align-items: center;
  gap: 16px; padding: 10px 12px; border-radius: 10px; cursor: pointer; transition: background 0.15s ease;
}
.track-row:hover { background: var(--row-hover); }
.track-row.playing { background: var(--row-active); }
.track-row.loading-track { opacity: 0.6; }

.track-index {
  color: var(--text-low); font-size: 13.5px; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center; position: relative; width: 24px; height: 24px;
}
.track-index-number { display: block; }
.track-index-play, .track-index-pause { display: none; color: var(--text-hi); }
.track-index-eq { display: none; align-items: flex-end; justify-content: center; gap: 2px; height: 13px; }
.track-index-spinner { display: none; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,0.2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }

/* survol d'une ligne non lue : triangle */
.track-row:hover .track-index-number { display: none; }
.track-row:hover .track-index-play { display: flex; }
/* ligne en cours : barres d'égaliseur */
.track-row.playing .track-index-number { display: none; }
.track-row.playing .track-index-play { display: none; }
.track-row.playing .track-index-eq { display: flex; }
/* survol de la ligne en cours : icône pause */
.track-row.playing:hover .track-index-eq { display: none; }
.track-row.playing:hover .track-index-pause { display: flex; }
/* la lecture est en pause : l'égaliseur se fige */
body.is-paused .track-index-eq span { animation-play-state: paused; }

.track-index-eq span { width: 2.5px; background: var(--accent); border-radius: 1px; animation: eqBounce 0.9s ease-in-out infinite; }
.track-index-eq span:nth-child(1) { height: 40%; animation-delay: -0.6s; }
.track-index-eq span:nth-child(2) { height: 100%; animation-delay: -0.3s; }
.track-index-eq span:nth-child(3) { height: 65%; animation-delay: 0s; }
@keyframes eqBounce { 0%, 100% { height: 25%; } 50% { height: 100%; } }

.track-row.loading-track .track-index-spinner { display: block; }
.track-row.loading-track .track-index-number,
.track-row.loading-track .track-index-play,
.track-row.loading-track .track-index-pause,
.track-row.loading-track .track-index-eq { display: none !important; }

.track-title-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.track-cover { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--content-bg-top); flex-shrink: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); cursor: pointer; }
.track-info { display: flex; flex-direction: column; overflow: hidden; min-width: 0; gap: 1px; }
.track-title { color: var(--text-hi); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.track-row.playing .track-title { color: var(--accent); }
.track-artist, .track-album {
  color: var(--text-mid); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: none; border: none; padding: 0; text-align: left; cursor: pointer; font-family: var(--font);
}
.track-album { font-size: 13.5px; }
.track-artist:hover, .track-album:hover { color: var(--text-hi); text-decoration: underline; }
.track-duration { color: var(--text-low); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }

.track-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.row-heart-btn {
  background: none; border: none; color: var(--text-low); cursor: pointer; display: flex;
  padding: 4px; border-radius: 50%; opacity: 0; transition: opacity 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.row-heart-btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
.track-row:hover .row-heart-btn, .row-heart-btn.liked { opacity: 1; }
.row-heart-btn:hover { color: var(--accent-hover); transform: scale(1.15); }
.row-heart-btn.liked { color: var(--accent); }
.row-heart-btn.liked svg { fill: var(--accent); stroke: var(--accent); }
.row-menu-btn {
  background: none; border: none; color: var(--text-low); cursor: pointer; display: flex;
  padding: 4px; border-radius: 50%; opacity: 0; transition: opacity 0.15s ease, color 0.15s ease;
}
.track-row:hover .row-menu-btn { opacity: 1; }
.row-menu-btn:hover { color: var(--text-hi); background: rgba(255,255,255,0.08); }

.player-status { font-size: 12.5px; color: var(--text-low); padding: 4px 24px; flex-shrink: 0; }
.player-status.error { color: var(--danger); }
.player-status.ok { color: var(--ok); }
.player-status.loading { color: var(--text-mid); }

/* ---------- Playlists ---------- */
.playlists-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.pill-btn {
  background: var(--accent); color: white; border: none; border-radius: 24px; padding: 11px 22px;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: var(--font);
  transition: background 0.15s ease, transform 0.1s ease;
}
.pill-btn:hover { background: var(--accent-hover); }
.pill-btn:active { transform: scale(0.97); }
.pill-btn.ghost { background: rgba(255,255,255,0.08); color: var(--text-hi); }
.pill-btn.ghost:hover { background: rgba(255,255,255,0.14); }
.pill-btn.danger { background: rgba(255,92,92,0.15); color: var(--danger); }
.pill-btn.danger:hover { background: rgba(255,92,92,0.28); }

.playlists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px; }
.playlist-card {
  background: rgba(255,255,255,0.03); border: 1px solid transparent; border-radius: 10px; padding: 10px;
  cursor: pointer; transition: background 0.15s ease, transform 0.15s ease; display: flex; flex-direction: column; gap: 8px; overflow: hidden;
}
.playlist-card:hover { background: rgba(255,255,255,0.07); transform: translateY(-3px); }
.playlist-card-cover {
  width: 100%; aspect-ratio: 1; border-radius: 8px; display: grid; grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr; overflow: hidden; background: var(--content-bg-top); box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.playlist-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.playlist-card-cover.empty { display: flex; align-items: center; justify-content: center; }
.playlist-card-cover.empty::before { content: '♪'; color: var(--text-low); font-size: 30px; }
.playlist-card-name { font-size: 15px; font-weight: 600; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playlist-card-count { font-size: 12.5px; color: var(--text-mid); }

.back-btn { background: none; border: none; color: var(--text-mid); cursor: pointer; font-size: 14px; padding: 6px 0 16px; transition: color 0.15s ease; font-family: var(--font); }
.back-btn:hover { color: var(--text-hi); }

.detail-hero { display: flex; align-items: center; gap: 18px; padding: 18px 4px 26px; }
.detail-cover {
  width: 132px; height: 132px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #3a3a3e, #1a1a1c); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); overflow: hidden;
}
.detail-cover::before { content: '♪'; color: var(--text-low); font-size: 34px; }
.detail-cover.has-covers::before { content: ''; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-cover.round { border-radius: 50%; }
.artist-hero .detail-cover::before { content: '👤'; font-size: 30px; }
.detail-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.detail-info h1 { font-size: 34px; margin: 0; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-chip-static { font-size: 15px; color: var(--text-mid); margin: 0; }

/* ---------- Modales ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex;
  align-items: center; justify-content: center; z-index: 400; animation: fadeIn 0.15s ease;
}
.modal-card {
  background: #1c1c1e; border: 1px solid var(--border); border-radius: 12px; padding: 20px;
  width: 360px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.modal-card h3 { margin: 0 0 4px; font-size: 17px; }
.playlist-picker-list { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.playlist-picker-item {
  display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.05);
  border: none; border-radius: 6px; padding: 8px 10px; color: var(--text-hi); cursor: pointer;
  font-size: 12.5px; transition: background 0.15s ease; font-family: var(--font);
}
.playlist-picker-item:hover { background: rgba(255,255,255,0.1); }
.playlist-picker-item.added { color: var(--ok); }

.text-prompt-input {
  background: rgba(255,255,255,0.08); border: 1px solid var(--border); border-radius: 7px;
  padding: 12px 14px; color: var(--text-hi); font-size: 15px; outline: none;
  transition: border-color 0.15s ease, background 0.15s ease; font-family: var(--font);
}
.text-prompt-input:focus { border-color: var(--accent); background: rgba(255,255,255,0.1); }
.text-prompt-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ---------- Scrollbar ---------- */
.content::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }

/* =======================================================================
   LECTEUR PLEIN ÉCRAN
   ======================================================================= */
.fs-overlay {
  position: fixed; inset: 0; z-index: 300; overflow: hidden;
  background: var(--alb-deep);
  display: flex; flex-direction: column;
  animation: fsFadeIn 0.28s ease;
}
@keyframes fsFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Fond animé aux couleurs de l'album --- */
.fs-bg { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.fs-bg::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(160deg, var(--alb-2), var(--alb-deep) 78%);
  transition: background 0.9s ease;
}
.fs-blob {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.62;
  will-change: transform; transition: background 0.9s ease;
}
.fs-blob-1 { width: 62vw; height: 62vw; background: var(--alb-1); top: -18vw; left: -12vw; animation: blobDrift1 26s ease-in-out infinite; }
.fs-blob-2 { width: 52vw; height: 52vw; background: var(--alb-3); bottom: -20vw; right: -10vw; animation: blobDrift2 32s ease-in-out infinite; }
.fs-blob-3 { width: 44vw; height: 44vw; background: var(--alb-2); bottom: -12vw; left: 12vw; animation: blobDrift3 38s ease-in-out infinite; opacity: 0.5; }
.fs-blob-4 { width: 34vw; height: 34vw; background: var(--alb-1); top: 6vh; right: 14vw; animation: blobDrift4 30s ease-in-out infinite; opacity: 0.4; }
@keyframes blobDrift1 {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  33% { transform: translate3d(9vw, 7vh, 0) scale(1.16); }
  66% { transform: translate3d(-5vw, 12vh, 0) scale(0.92); }
}
@keyframes blobDrift2 {
  0%, 100% { transform: translate3d(0,0,0) scale(1.05); }
  40% { transform: translate3d(-11vw, -9vh, 0) scale(0.9); }
  70% { transform: translate3d(4vw, -14vh, 0) scale(1.2); }
}
@keyframes blobDrift3 {
  0%, 100% { transform: translate3d(0,0,0) scale(0.95); }
  50% { transform: translate3d(14vw, -8vh, 0) scale(1.22); }
}
@keyframes blobDrift4 {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(-9vw, 10vh, 0) scale(1.18); }
}
/* Le fond se fige quand la lecture est en pause */
body.is-paused .fs-blob { animation-play-state: paused; }

.fs-grain {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 40%, transparent 20%, rgba(0,0,0,0.45) 100%);
}

/* --- Barre du haut --- */
.fs-top {
  position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; flex-shrink: 0; -webkit-app-region: drag;
}
.fs-top-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: rgba(255,255,255,0.65); }
.fs-icon-btn {
  background: rgba(255,255,255,0.12); border: none; color: #fff; -webkit-app-region: no-drag;
  width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; backdrop-filter: blur(10px); transition: background 0.15s ease, transform 0.15s ease;
}
.fs-icon-btn:hover { background: rgba(255,255,255,0.24); transform: scale(1.07); }

/* --- Scène --- */
.fs-stage {
  position: relative; z-index: 2; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5vw 4vh; overflow: hidden;
}
/* En mode paroles, on réserve la moitié droite de l'écran : la colonne
   de gauche reste ainsi centrée dans l'espace restant. */
.fs-stage[data-mode="lyrics"] { padding-right: calc(min(720px, 48%) + 9vw); }

.fs-left {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; width: 100%; max-width: 460px; max-height: 100%;
}
.fs-cover-wrap { display: flex; justify-content: center; width: 100%; }
.fs-cover {
  width: min(380px, 46vh); height: min(380px, 46vh); border-radius: 14px; object-fit: cover;
  box-shadow: 0 34px 70px rgba(0,0,0,0.55); background: linear-gradient(135deg, #3a3a3e, #1a1a1c);
  animation: fsCoverFloat 7s ease-in-out infinite;
  transition: width 0.4s ease, height 0.4s ease;
}
body.is-paused .fs-cover { animation-play-state: paused; transform: scale(0.955); }
@keyframes fsCoverFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-9px) scale(1.012); }
}

.fs-meta { text-align: center; width: 100%; min-width: 0; }
.fs-meta h1 { font-size: 31px; margin: 0 0 5px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-meta p { margin: 0; font-size: 17px; color: rgba(255,255,255,0.66); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fs-progress-wrap { width: 100%; display: flex; align-items: center; gap: 10px; }
.fs-progress-wrap .time-label { width: 40px; font-size: 11.5px; color: rgba(255,255,255,0.55); }
#fs-scrub { height: 5px; }

.fs-controls { display: flex; align-items: center; justify-content: center; gap: 16px; width: 100%; }
.fs-round-btn {
  background: none; border: none; color: rgba(255,255,255,0.62); cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.fs-round-btn:hover { color: #fff; background: rgba(255,255,255,0.12); transform: scale(1.06); }
.fs-round-btn.active { color: #fff; background: rgba(255,255,255,0.16); }
.fs-round-btn.active::after {
  content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: #fff;
}
.fs-round-btn { position: relative; }
.fs-heart { width: 38px; height: 38px; color: rgba(255,255,255,0.62); }
.fs-heart:hover { color: var(--accent-hover); }
.fs-transport-btn { width: 44px; height: 44px; color: #fff; }
.fs-play-btn { width: 62px; height: 62px; background: #fff; color: #111; box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.fs-play-btn:hover { background: #fff; transform: scale(1.06); }
.fs-volume-row { display: flex; align-items: center; gap: 8px; width: 190px; }
.fs-volume-row .icon-btn { color: rgba(255,255,255,0.6); }
.fs-volume-row .icon-btn:hover { color: #fff; }

/* --- Colonne paroles --- */
.fs-right {
  /* Haut ET bas fixés : la hauteur ne dépend plus d'aucun calcul de flex,
     donc la zone de défilement est toujours bornée à l'écran. C'était la
     cause du panneau qui refusait de défiler en grand format. */
  position: absolute; top: 0; bottom: 2vh; right: 5vw;
  width: min(720px, 48%);
}
.fs-stage[data-mode="player"] .fs-right { display: none; }
.fs-stage[data-mode="player"] .fs-left { max-width: 520px; }
.fs-stage[data-mode="lyrics"] .fs-cover { width: min(300px, 34vh); height: min(300px, 34vh); }
.fs-stage[data-mode="lyrics"] .fs-left { max-width: 400px; gap: 18px; }
.fs-stage[data-mode="lyrics"] .fs-meta h1 { font-size: 22px; }



.fs-lyrics-scroll {
  position: absolute; inset: 0;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none;
  mask-image: linear-gradient(to bottom, black 0%, black 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 82%, transparent 100%);
}
.fs-lyrics-scroll::-webkit-scrollbar { width: 0; height: 0; }
.fs-lyrics-list { display: flex; flex-direction: column; gap: 22px; width: 100%; padding: 4px 10px 62vh; }
.fs-lyrics-list p {
  margin: 0; font-size: 35px; font-weight: 800; line-height: 1.28; letter-spacing: -0.015em;
  color: rgba(255,255,255,0.26); cursor: pointer; transform-origin: left center; padding: 2px 6px; border-radius: 8px;
  transition: color 0.3s ease, opacity 0.3s ease, transform 0.3s cubic-bezier(0.2,0.7,0.3,1), background 0.2s ease;
}
.fs-lyrics-list p:hover { color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.06); }
.fs-lyrics-list p.active { color: #fff; transform: scale(1.035); text-shadow: 0 2px 24px rgba(0,0,0,0.35); }
.fs-lyrics-list p.past { color: rgba(255,255,255,0.34); }
.fs-lyrics-list p.plain { cursor: default; font-size: 26px; font-weight: 700; color: rgba(255,255,255,0.62); }
.fs-lyrics-list p.plain:hover { background: none; color: rgba(255,255,255,0.62); }
.fs-lyrics-hint { font-size: 16px !important; font-weight: 500 !important; color: rgba(255,255,255,0.5) !important; cursor: default !important; }

/* Écrans étroits / fenêtres réduites */
@media (max-width: 1100px) {
  .fs-stage { gap: 3vw; padding: 0 3vw 3vh; }
  .fs-lyrics-list p { font-size: 26px; }
  .fs-stage[data-mode="lyrics"] .fs-left { max-width: 320px; }
  .fs-stage[data-mode="lyrics"] .fs-cover { width: min(230px, 28vh); height: min(230px, 28vh); }
}
@media (max-width: 820px) {
  .fs-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 0 20px 16px; overflow-y: auto; }
  .fs-left { height: auto; }
  .fs-stage[data-mode="lyrics"] .fs-left { max-width: 100%; max-height: none; }
  .fs-stage[data-mode="lyrics"] { padding-right: 20px; }
  .fs-right { position: static; width: 100%; max-width: 100%; height: 46vh; }
  .fs-lyrics-list { padding: 4px 6px 40vh; }
  .fs-lyrics-list p { font-size: 22px; }
}
@media (max-height: 720px) {
  .fs-stage[data-mode="lyrics"] .fs-cover { width: min(200px, 26vh); height: min(200px, 26vh); }
  .fs-left { gap: 14px; }
}

/* ---------- Badge « explicite » ---------- */
.track-title-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.track-title-line .track-title, .track-title-line .mini-title { min-width: 0; }
.explicit-badge {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 4px; background: rgba(255,255,255,0.28);
  color: #0d0d0f; font-size: 11px; font-weight: 800; line-height: 1; letter-spacing: 0;
}

/* ---------- Accueil : sections de suggestions ---------- */
.home-section-sub { margin: -8px 0 12px; font-size: 12px; color: var(--text-low); }
.home-skeleton { display: flex; gap: 16px; }
.home-skeleton span {
  width: 178px; height: 212px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(100deg, rgba(255,255,255,0.04) 30%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 70%);
  background-size: 240% 100%; animation: skeletonSweep 1.3s ease-in-out infinite;
}
@keyframes skeletonSweep { from { background-position: 160% 0; } to { background-position: -60% 0; } }
.artist-card .suggest-card-cover { border-radius: 50%; }

/* ---------- Pochettes de discographie ---------- */
.cover-wrap { position: relative; display: block; width: 178px; height: 178px; flex-shrink: 0; }
.cover-explicit {
  position: absolute; left: 8px; bottom: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 4px; background: rgba(0,0,0,0.72);
  color: #fff; font-size: 10.5px; font-weight: 800; line-height: 1;
  backdrop-filter: blur(4px);
}

/* ---------- Compte ---------- */
.sidebar-footer { margin-top: auto; padding: 12px 4px 2px; border-top: 1px solid var(--border); }
.account-btn {
  display: flex; align-items: center; gap: 11px; width: 100%; background: none; border: none;
  padding: 9px 10px; border-radius: 10px; cursor: pointer; text-align: left; font-family: var(--font);
  transition: background 0.15s ease; -webkit-app-region: no-drag;
}
.account-btn:hover { background: rgba(255,255,255,0.06); }
.account-btn.disabled { opacity: 0.55; }
.account-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1); color: var(--text-mid);
  font-size: 14px; font-weight: 700;
}
.account-btn.connected .account-avatar { background: linear-gradient(135deg, var(--accent), #ff7a8a); color: #fff; }
.account-labels { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.account-name { font-size: 13.5px; font-weight: 600; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-sub { font-size: 11.5px; color: var(--text-low); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.auth-card { width: 400px; gap: 12px; }
.auth-tabs { display: flex; gap: 6px; background: rgba(255,255,255,0.06); padding: 4px; border-radius: 12px; margin-bottom: 4px; }
.auth-tab {
  flex: 1; background: none; border: none; color: var(--text-mid); font-family: var(--font);
  font-size: 13.5px; font-weight: 600; padding: 9px 10px; border-radius: 9px; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.auth-tab.active { background: rgba(255,255,255,0.14); color: var(--text-hi); }
.auth-message { margin: 0; font-size: 13px; padding: 9px 12px; border-radius: 9px; background: rgba(255,255,255,0.06); color: var(--text-mid); }
.auth-message.error { background: rgba(255,92,92,0.14); color: #ff9d9d; }
.auth-message.ok { background: rgba(51,209,122,0.14); color: #7ee2a8; }
.auth-hint { margin: 2px 0 0; font-size: 12px; color: var(--text-low); line-height: 1.5; }

/* =====================================================================
   INTERFACE MOBILE — inspirée d'Apple Music sur iPhone
   Barre d'onglets en bas, mini-lecteur flottant au-dessus, lecteur
   plein écran au toucher. Le point de bascule à 820 px couvre aussi les
   petites fenêtres de bureau.
   ===================================================================== */
@media (max-width: 820px) {

  body { overscroll-behavior-y: none; }
  .app { flex-direction: column; height: 100dvh; }

  /* ---------- Barre d'onglets ---------- */
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; height: auto; flex-direction: row; align-items: stretch;
    border-right: none; border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(12,12,14,0.86); backdrop-filter: saturate(180%) blur(28px);
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom, 0px));
    z-index: 120;
  }
  .sidebar-brand, .nav-section-label, .playlists-nav-list { display: none !important; }
  .sidebar-nav { flex-direction: row; flex: 1; gap: 0; }
  .nav-item {
    flex: 1; flex-direction: column; justify-content: center; gap: 4px;
    font-size: 10.5px; font-weight: 500; padding: 5px 2px; border-radius: 10px;
  }
  .nav-item svg { width: 23px; height: 23px; opacity: 1; }
  .nav-item:hover { background: none; }
  .nav-item.active { background: none; color: var(--accent); }
  .sidebar-footer { margin: 0; padding: 0; border: none; width: 64px; display: flex; }
  .account-btn { flex-direction: column; justify-content: center; gap: 4px; padding: 5px 2px; }
  .account-labels { display: none; }
  .account-avatar { width: 23px; height: 23px; font-size: 11px; }
  /* Libellé fixe : le nom du compte serait trop long pour un onglet. */
  .account-btn::after {
    content: 'Compte'; font-size: 10.5px; font-weight: 500; color: var(--text-mid); line-height: 1;
  }
  .account-btn.connected::after { color: var(--accent); }

  /* ---------- Mini-lecteur flottant ---------- */
  .toolbar {
    position: fixed; left: 8px; right: 8px;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    padding: 8px 10px; gap: 10px; border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(30,30,32,0.9); backdrop-filter: saturate(180%) blur(28px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.45); z-index: 110;
  }
  .scrub-wrap, .toolbar-right, #prev-btn, #np-expand-icon-btn { display: none !important; }
  .now-playing-lcd { flex: 1; max-width: none; gap: 11px; cursor: pointer; }
  .np-cover { width: 44px; height: 44px; }
  .np-title, .np-artist { max-width: none; }
  .np-title { font-size: 14px; }
  .np-artist { font-size: 12.5px; }
  .transport { order: 3; gap: 2px; }
  .transport-btn { width: 40px; height: 40px; }
  .play-btn { width: 42px; height: 42px; }
  #np-heart-btn { display: none; }

  /* ---------- Contenu ---------- */
  .main { padding: 0; }
  .content {
    padding: max(14px, env(safe-area-inset-top, 0px)) 16px 210px;
    background: linear-gradient(to bottom, var(--content-bg-top), var(--content-bg-bottom) 300px);
  }
  .player-status { display: none; }

  .page-title { font-size: 30px; margin-bottom: 16px; }
  .section-title { font-size: 20px; margin: 24px 0 12px; }
  .home-section-title { font-size: 21px; }
  .home-section { margin-bottom: 24px; }

  /* Carrousels : format pochette d'Apple Music */
  .suggest-card { flex: 0 0 150px; }
  .suggest-card-cover { width: 150px; height: 150px; }
  .cover-wrap { width: 150px; height: 150px; }
  .home-skeleton span { width: 150px; height: 182px; }
  .hscroll { gap: 13px; scroll-snap-type: x mandatory; }

  /* ---------- Listes de titres ---------- */
  .results-header { display: none !important; }
  .track-row {
    grid-template-columns: 1fr auto; gap: 10px; padding: 8px 4px; border-radius: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .track-index, .track-album, .track-duration { display: none !important; }
  .track-cover { width: 52px; height: 52px; }
  .track-title { font-size: 15.5px; }
  .track-artist { font-size: 13px; }
  .track-row-actions .row-heart-btn,
  .track-row-actions .row-menu-btn { opacity: 1; padding: 8px; }

  .mini-row { grid-template-columns: 50px 1fr auto; padding: 8px 4px; }
  .mini-row .mini-heart { display: none; }

  /* ---------- Recherche ---------- */
  .search-hero { top: 0; margin: 0 0 6px; padding: 6px 0 12px; }
  .search-page-bar { padding: 12px 16px; border-radius: 12px; }
  .search-page-bar input { font-size: 16px; } /* < 16px déclenche le zoom auto sur iOS */
  .search-filters { gap: 7px; margin-top: 12px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .search-filters::-webkit-scrollbar { display: none; }
  .filter-chip { flex-shrink: 0; }
  .search-suggest { max-height: 60vh; }
  .search-split { grid-template-columns: 1fr; gap: 18px; }
  .top-card { padding: 16px; }
  .top-card-cover { width: 96px; height: 96px; }
  .top-card-title { font-size: 22px; }
  .browse-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .browse-card { font-size: 16px; padding: 12px; }

  /* ---------- Pages détail ---------- */
  .detail-hero { flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 6px 0 20px; }
  .detail-cover { width: min(230px, 62vw); height: min(230px, 62vw); }
  .detail-info { align-items: center; }
  .detail-info h1 { font-size: 25px; white-space: normal; text-align: center; }
  .np-hero { flex-direction: column; text-align: center; align-items: center; }
  .np-hero-info h1 { max-width: 100%; white-space: normal; }
  .playlists-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .playlists-header { flex-direction: column; align-items: flex-start; gap: 12px; }

  .modal-card { width: calc(100vw - 32px); max-width: 380px; }
  .auth-card { width: calc(100vw - 32px); }

  /* ---------- Lecteur plein écran ---------- */
  .fs-overlay { height: 100dvh; }
  .fs-top { padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 8px; }
  .fs-icon-btn { width: 36px; height: 36px; }
  #fullscreen-native { display: none; } /* pas de plein écran réel sur iOS */

  .fs-stage {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; padding: 0 22px calc(16px + env(safe-area-inset-bottom, 0px));
    overflow: hidden;
  }
  .fs-stage[data-mode="lyrics"] { padding-right: 22px; }
  .fs-left { max-width: 100%; height: auto; max-height: 100%; gap: 18px; flex-shrink: 0; }
  .fs-cover, .fs-stage[data-mode="lyrics"] .fs-cover { width: min(320px, 74vw); height: min(320px, 74vw); }
  .fs-meta { padding: 0 6px; }
  .fs-meta h1, .fs-stage[data-mode="lyrics"] .fs-meta h1 { font-size: 21px; }
  .fs-meta p { font-size: 15px; }
  .fs-controls { gap: 10px; }
  .fs-transport-btn { width: 50px; height: 50px; }
  .fs-play-btn { width: 68px; height: 68px; }
  .fs-round-btn, .fs-heart { width: 44px; height: 44px; }
  .fs-volume-row { width: 100%; max-width: 320px; }
  .fs-progress-wrap .time-label { width: 44px; }

  /* En mode paroles, la pochette laisse la place au texte, comme sur iOS */
  .fs-stage[data-mode="lyrics"] .fs-cover-wrap { display: none; }
  .fs-stage[data-mode="lyrics"] .fs-volume-row { display: none; }
  .fs-stage[data-mode="lyrics"] .fs-left { max-width: 100%; gap: 12px; }
  /* Grille en deux rangées : la première, en minmax(0,1fr), a une hauteur
     définie et bornée à l'écran — c'est ce qui rend les paroles réellement
     défilables. En flex, la colonne de contrôles imposait sa hauteur et le
     panneau débordait sous l'écran. */
  .fs-stage[data-mode="lyrics"] {
    display: grid; grid-template-rows: minmax(0, 1fr) auto;
    align-items: stretch; justify-items: center;
  }
  .fs-stage[data-mode="lyrics"] .fs-right { grid-row: 1; }
  .fs-stage[data-mode="lyrics"] .fs-left { grid-row: 2; width: 100%; }
  .fs-right {
    position: static; width: 100%; max-width: 100%;
    min-height: 0; height: 100%; padding-top: 0;
    display: flex; flex-direction: column;
  }
  .fs-lyrics-scroll { position: relative; inset: auto; flex: 1 1 0; min-height: 0; }
  .fs-lyrics-list { padding: 6px 2px 30vh; gap: 18px; }
  .fs-lyrics-list p { font-size: 25px; line-height: 1.3; }
  .fs-lyrics-list p.plain { font-size: 21px; }
}

/* Très petits écrans (iPhone SE et similaires) */
@media (max-width: 380px) {
  .suggest-card, .suggest-card-cover, .cover-wrap { flex-basis: 136px; width: 136px; }
  .suggest-card-cover, .cover-wrap { height: 136px; }
  .page-title { font-size: 26px; }
  .fs-lyrics-list p { font-size: 22px; }
  .fs-play-btn { width: 62px; height: 62px; }
  .browse-grid { grid-template-columns: 1fr; }
}

/* Appareils tactiles : les actions masquées au survol doivent rester
   accessibles, puisqu'il n'y a pas de survol. */
@media (hover: none) {
  .row-heart-btn, .row-menu-btn, .mini-heart { opacity: 1; }
  input[type="range"]::-webkit-slider-thumb { opacity: 1; }
  .top-card-play { opacity: 1; transform: none; }
}
