/* =========================================================
   Auraly — thème sombre « aurore »
   ========================================================= */
:root {
  --bg: #0b0716;
  --bg-2: #120c22;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f4f1ff;
  --muted: #a69fc2;
  --faint: #6e6790;
  --violet: #9b5cff;
  --pink: #ff5ca8;
  --cyan: #3ee0d0;
  --accent: #9b5cff;
  --accent-2: #ff5ca8;
  --grad: linear-gradient(120deg, var(--accent), var(--accent-2));
  --radius: 18px;
  --radius-sm: 12px;
  --player-h: 92px;
  --side-w: 248px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill { fill: currentColor; stroke: none; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
kbd { font: 600 11px/1 inherit; padding: 4px 6px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* Défilement discret */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }

/* ---------- Halos d'arrière-plan ---------- */
.aura { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aura span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: 0.32; mix-blend-mode: screen; transition: background 1.2s var(--ease); animation: drift 28s ease-in-out infinite alternate; }
.aura span:nth-child(1) { background: var(--accent); top: -25vmax; left: -15vmax; }
.aura span:nth-child(2) { background: var(--accent-2); bottom: -30vmax; right: -20vmax; animation-duration: 34s; animation-delay: -8s; }
.aura span:nth-child(3) { background: var(--cyan); top: 30%; left: 45%; width: 35vmax; height: 35vmax; opacity: 0.14; animation-duration: 40s; }
body.is-playing .aura span { animation-duration: 14s; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }

/* ---------- Structure ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--side-w) 1fr; height: calc(100dvh - var(--player-h)); }
.side { display: flex; flex-direction: column; gap: 22px; padding: 22px 16px; border-right: 1px solid var(--line); background: rgba(11, 7, 22, 0.55); backdrop-filter: blur(20px); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px; font-weight: 800; font-size: 22px; letter-spacing: -0.03em; }
.brand img { border-radius: 11px; box-shadow: 0 8px 24px -6px var(--accent); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; transition: background .2s, color .2s; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.is-on { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav a.is-on svg { color: var(--accent); }
.side-card { margin-top: auto; padding: 18px; border-radius: var(--radius); background: linear-gradient(160deg, rgba(155,92,255,.22), rgba(255,92,168,.12)); border: 1px solid var(--line-2); }
.side-card-title { font-weight: 700; }
.side-card-text { color: var(--muted); font-size: 13px; margin: 4px 0 14px; }
.install { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: 12px; border: 1px dashed var(--line-2); background: transparent; color: var(--muted); font-weight: 600; }
.install:hover { color: var(--text); border-color: var(--accent); }

.main { overflow-y: auto; padding: 0 clamp(16px, 3vw, 40px) 48px; scroll-behavior: smooth; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 18px 0; margin-bottom: 8px; background: linear-gradient(var(--bg) 55%, transparent); }
.search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); transition: border-color .2s, background .2s; }
.search:focus-within { border-color: var(--accent); background: var(--panel-2); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }
.search svg { color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang { height: 40px; padding: 0 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.lang option, .select option { background: var(--bg-2); }
.account { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px 0 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; }
.account:hover { background: var(--panel-2); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; font-size: 13px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; font-weight: 700; white-space: nowrap; transition: transform .15s var(--ease), background .2s, box-shadow .2s, border-color .2s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -10px var(--accent); }
.btn-primary:hover { box-shadow: 0 14px 36px -8px var(--accent); }
.btn-ghost { background: var(--panel); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-soft { background: rgba(255,255,255,.12); }
.btn-soft:hover { background: rgba(255,255,255,.2); }
.btn-light { background: #fff; color: #170d2e; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.danger { color: #ff7a9a !important; }
.link { color: var(--muted); font-weight: 600; font-size: 14px; background: none; border: 0; padding: 0; }
.link:hover { color: var(--text); }
.icon-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); transition: color .2s, background .2s, transform .15s; }
.icon-btn:hover:not(:disabled) { color: var(--text); background: var(--panel-2); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.is-on { color: var(--accent); }
.icon-btn.big svg { width: 26px; height: 26px; }
.like.is-on { color: var(--pink); }
.like.is-on svg { fill: currentColor; }
.like.pop { animation: pop .35s var(--ease); }
@keyframes pop { 40% { transform: scale(1.35); } }
.badge-one { position: absolute; top: 5px; right: 4px; font-size: 9px; font-weight: 800; color: var(--accent); display: none; }
#pRepeat.is-one .badge-one { display: block; }
.play-btn { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #fff; color: #120a24; transition: transform .15s var(--ease), box-shadow .2s; }
.play-btn:hover { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(255,255,255,.08); }
.play-btn svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.play-btn.big { width: 68px; height: 68px; }
.play-btn.big svg { width: 30px; height: 30px; }
.play-btn .i-pause, body.is-playing .play-btn .i-play { display: none; }
body.is-playing .play-btn .i-pause { display: block; }

/* ---------- Vues ---------- */
.view { animation: rise .45s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 22px; }
.view-head .muted { margin-top: 6px; }
.view-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sub { margin: 26px 0 10px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .12em; }

/* Accueil */
.hero { position: relative; display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 24px; padding: clamp(24px, 4vw, 48px); border-radius: 28px; background: linear-gradient(135deg, rgba(155,92,255,.18), rgba(255,92,168,.08) 60%, rgba(62,224,208,.08)); border: 1px solid var(--line-2); overflow: hidden; }
.hero h1 { font-size: clamp(40px, 6vw, 72px); line-height: .95; margin: 10px 0 16px; background: linear-gradient(180deg, #fff 30%, #d7c8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: var(--muted); font-size: 17px; max-width: 460px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-orb { display: grid; place-items: center; }
.hero-orb canvas { width: min(100%, 380px); aspect-ratio: 1; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 8px; }
.stat { padding: 18px 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.stat strong { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: 13px; }
.block { margin-top: 34px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.cards { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(160px, 190px); gap: 16px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; }
.card { scroll-snap-align: start; padding: 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); text-align: left; transition: background .25s, transform .25s var(--ease); cursor: pointer; }
.card:hover { background: var(--panel-2); transform: translateY(-3px); }
.card .cover { position: relative; aspect-ratio: 1; border-radius: 14px; margin-bottom: 12px; }
.card strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card span { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-play { position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s var(--ease); box-shadow: 0 10px 24px -6px rgba(0,0,0,.6); }
.card-play svg { fill: currentColor; stroke: none; }
.card:hover .card-play, .card.is-current .card-play { opacity: 1; transform: none; }
.card-rank { position: absolute; left: 10px; top: 8px; font-weight: 800; font-size: 26px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.empty-inline { color: var(--muted); padding: 14px 0; }
.mix-banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-top: 40px; padding: 30px; border-radius: 24px; background: var(--grad); box-shadow: 0 30px 60px -30px var(--accent); }
.mix-banner .eyebrow { color: rgba(255,255,255,.8); }
.mix-banner h2 { margin: 6px 0; font-size: 26px; }
.mix-banner p:not(.eyebrow) { color: rgba(255,255,255,.85); max-width: 520px; }

/* Pochettes générées */
.cover { background: var(--c, linear-gradient(135deg, #9b5cff, #ff5ca8)); background-size: cover; background-position: center; overflow: hidden; }
.cover::after { content: attr(data-letter); position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 2.4em; color: rgba(255,255,255,.85); mix-blend-mode: overlay; }
.cover.has-img::after { content: none; }

/* Listes de titres */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-weight: 600; transition: all .2s; }
.chip:hover { color: var(--text); }
.chip.is-on { background: #fff; color: #150c2a; border-color: #fff; }
.select { height: 38px; padding: 0 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-2); }
.tracklist { display: flex; flex-direction: column; gap: 2px; }
.row { display: grid; grid-template-columns: 28px 48px minmax(0, 1fr) auto 56px auto; align-items: center; gap: 14px; padding: 8px 10px; border-radius: 14px; transition: background .2s; }
.row:hover { background: var(--panel); }
.row.is-current { background: var(--panel-2); }
.row.is-current .row-title { color: var(--accent); }
.row-num { color: var(--faint); text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.row:hover .row-num span { display: none; }
.row-num button { display: none; border: 0; background: none; color: var(--text); padding: 0; }
.row-num button svg { fill: currentColor; stroke: none; width: 16px; height: 16px; }
.row:hover .row-num button { display: inline-grid; }
.row .cover { position: relative; width: 48px; height: 48px; border-radius: 10px; font-size: 9px; }
.row-text { min-width: 0; cursor: pointer; }
.row-title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: rgba(62,224,208,.14); color: var(--cyan); }
.tag-local { background: rgba(155,92,255,.16); color: #c6a6ff; }
.row-dur { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.row-actions { display: flex; gap: 2px; opacity: .0; transition: opacity .2s; }
.row:hover .row-actions, .row .like.is-on { opacity: 1; }
.row-actions .like.is-on { opacity: 1; }
.row .like { opacity: 1; }
.row-plays { color: var(--faint); font-size: 12px; }
.eq-bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq-bars i { width: 3px; background: var(--accent); border-radius: 2px; animation: bar 0.9s ease-in-out infinite; }
.eq-bars i:nth-child(2) { animation-delay: -.3s; } .eq-bars i:nth-child(3) { animation-delay: -.6s; }
body:not(.is-playing) .eq-bars i { animation-play-state: paused; }
@keyframes bar { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.row.dragging { opacity: .4; }
.row.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.handle { cursor: grab; color: var(--faint); }

.empty { text-align: center; padding: 60px 20px; }
.empty-art { width: 120px; height: 120px; margin: 0 auto 20px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff4, transparent 40%), var(--grad); filter: drop-shadow(0 20px 40px rgba(155,92,255,.5)); animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.07); } }
.empty h3 { font-size: 22px; margin-bottom: 6px; }
.empty p { color: var(--muted); margin-bottom: 20px; }

/* Playlists */
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.pl-card { padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); text-align: left; transition: background .2s, transform .25s var(--ease); }
.pl-card:hover { background: var(--panel-2); transform: translateY(-3px); }
.pl-card .mosaic { aspect-ratio: 1; border-radius: 14px; margin-bottom: 12px; }
.pl-card strong { display: block; }
.pl-card span { color: var(--muted); font-size: 13px; }
.pl-new { display: grid; place-items: center; gap: 8px; min-height: 220px; border-style: dashed; color: var(--muted); font-weight: 600; }
.pl-new svg { width: 34px; height: 34px; }
.mosaic { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; background: var(--grad); }
.mosaic .cover { position: relative; font-size: 10px; }
.mosaic.single { grid-template-columns: 1fr; }
.back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); font-weight: 600; padding: 0; margin-bottom: 18px; }
.pl-head { display: flex; gap: 28px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 28px; }
.pl-cover { width: 200px; height: 200px; border-radius: 20px; box-shadow: var(--shadow); }
.pl-head h1 { margin: 6px 0; }

/* Mon Auraly */
.wrapped { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.w-card { padding: 22px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); }
.w-card strong { display: block; font-size: 40px; font-weight: 800; letter-spacing: -.04em; margin-top: 6px; }
.w-card span { color: var(--muted); }
.w-big { grid-column: span 2; background: var(--grad); border: 0; }
.w-big .eyebrow, .w-big span { color: rgba(255,255,255,.85); }
.w-big strong { font-size: 64px; }
.w-wide { grid-column: span 2; }
.w-top { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: top; display: flex; flex-direction: column; gap: 10px; }
.w-top li { counter-increment: top; display: flex; align-items: center; gap: 12px; }
.w-top li::before { content: counter(top); width: 18px; font-weight: 800; color: var(--accent); }
.w-top .cover { position: relative; width: 40px; height: 40px; border-radius: 9px; font-size: 8px; flex: none; }
.w-top div { min-width: 0; }
.w-top b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-top small { color: var(--muted); }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); align-items: end; gap: 3px; height: 110px; margin: 16px 0 10px; }
.hours i { display: block; border-radius: 4px 4px 2px 2px; background: linear-gradient(var(--accent-2), var(--accent)); min-height: 3px; opacity: .85; }

/* Aide */
.help-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: start; }
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { border-radius: 16px; background: var(--panel); border: 1px solid var(--line); padding: 4px 18px; }
.faq summary { padding: 14px 0; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 16px; }
.chat { position: sticky; top: 90px; display: flex; flex-direction: column; height: 460px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line-2); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.chat-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); display: inline-block; flex: none; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; background: var(--panel-2); font-size: 14px; animation: rise .3s var(--ease); }
.msg.me { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { border-bottom-left-radius: 4px; }
.msg.typing { color: var(--muted); }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-2); outline: none; }
.chat-form input:focus { border-color: var(--accent); }
.shortcuts { margin-top: 30px; padding: 22px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); }
.shortcuts dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 24px; margin: 14px 0 0; }
.shortcuts dl div { display: flex; align-items: center; gap: 12px; }
.shortcuts dt { min-width: 100px; }
.shortcuts dd { margin: 0; color: var(--muted); }

/* ---------- Lecteur ---------- */
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: var(--player-h); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; gap: 20px; padding: 0 20px; background: rgba(13, 9, 26, 0.82); backdrop-filter: blur(24px) saturate(1.4); border-top: 1px solid var(--line); }
.p-now { display: flex; align-items: center; gap: 14px; min-width: 0; }
.p-cover { position: relative; width: 58px; height: 58px; border-radius: 12px; border: 0; padding: 0; flex: none; font-size: 10px; box-shadow: 0 8px 24px -8px rgba(0,0,0,.7); transition: transform .2s; }
.p-cover:hover { transform: scale(1.05); }
.p-meta { min-width: 0; }
.p-meta strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-meta span { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.p-controls { display: flex; align-items: center; gap: 10px; }
.p-progress { width: 100%; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.p-progress span { width: 40px; }
.p-progress span:first-child { text-align: right; }
.p-right { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.mini-viz { width: 80px; height: 28px; margin-right: 6px; opacity: .9; }
.volume { display: flex; align-items: center; }
.volume input { width: 90px; }
#pMute.is-muted .waves { opacity: 0; }
.p-mobile-bar { display: none; }

/* Curseurs */
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; height: 16px; background: transparent; cursor: pointer; --p: 0%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, #fff var(--p), rgba(255,255,255,.18) var(--p)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255,255,255,.18); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: #fff; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: #fff; opacity: 0; transition: opacity .2s; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; opacity: 0; }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:focus-visible::-webkit-slider-thumb { opacity: 1; }
input[type=range]:hover::-moz-range-thumb { opacity: 1; }
input[type=range]:hover::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--accent) var(--p), rgba(255,255,255,.18) var(--p)); }

/* ---------- Plein écran ---------- */
.stage { position: fixed; inset: 0; z-index: 40; background: radial-gradient(120% 90% at 20% 10%, color-mix(in srgb, var(--accent) 45%, #0b0716), #0b0716 70%); animation: stageIn .5s var(--ease); overflow: hidden; }
@keyframes stageIn { from { opacity: 0; transform: translateY(40px); } }
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-inner { position: relative; display: flex; flex-direction: column; height: 100%; padding: max(16px, env(safe-area-inset-top)) clamp(16px, 4vw, 56px) max(20px, env(safe-area-inset-bottom)); }
.stage-top { display: flex; align-items: center; justify-content: space-between; }
.stage-body { flex: 1; display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); align-items: center; min-height: 0; }
.stage-left { display: flex; flex-direction: column; gap: 20px; }
.stage-cover { position: relative; width: 100%; aspect-ratio: 1; border-radius: 26px; font-size: 26px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.08); transform: scale(calc(1 + var(--beat, 0) * 0.04)); transition: transform .08s linear; }
.stage-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stage-meta h2 { font-size: clamp(22px, 3vw, 30px); }
.stage-meta p { color: var(--muted); margin-top: 4px; }
.stage-controls { justify-content: space-between; }
.stage-lyrics { height: 100%; min-height: 0; overflow: hidden; -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); }
.lyrics-scroll { height: 100%; overflow-y: auto; padding: 30vh 0; scrollbar-width: none; }
.lyrics-scroll::-webkit-scrollbar { display: none; }
.lyrics-scroll p { font-size: clamp(22px, 2.8vw, 36px); font-weight: 800; line-height: 1.3; letter-spacing: -.02em; color: rgba(255,255,255,.28); margin: 0 0 18px; transition: color .35s, transform .35s var(--ease); transform-origin: left center; cursor: pointer; }
.lyrics-scroll p.is-now { color: #fff; transform: scale(1.03); }
.lyrics-scroll p.is-past { color: rgba(255,255,255,.5); }
.lyrics-scroll.plain p { color: rgba(255,255,255,.75); cursor: default; font-size: clamp(18px, 2.2vw, 26px); }
.lyrics-empty { color: var(--muted) !important; font-size: 20px !important; font-weight: 600 !important; }

/* ---------- Fenêtres ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(5, 3, 12, .6); backdrop-filter: blur(8px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: relative; width: min(100%, 440px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 28px; border-radius: 26px; background: #150e29; border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: rise .35s var(--ease); }
.sheet-wide { width: min(100%, 640px); }
.sheet h2 { margin-bottom: 6px; }
.sheet-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--panel-2); font-size: 22px; line-height: 1; color: var(--muted); }
.sheet-close:hover { color: var(--text); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 20px 0; border-radius: 14px; background: var(--panel); }
.seg button { height: 38px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-weight: 700; }
.seg button.is-on { background: var(--panel-2); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, textarea, .pick-new input { height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); color: var(--text); font-size: 15px; font-weight: 500; outline: none; transition: border-color .2s; }
.field input:focus, textarea:focus, .pick-new input:focus { border-color: var(--accent); }
textarea { width: 100%; height: auto; padding: 14px; margin: 16px 0 8px; resize: vertical; line-height: 1.6; font-family: inherit; }
.form-msg { min-height: 20px; font-size: 14px; color: #ff8fab; }
.form-msg.ok { color: var(--cyan); }
.row-btns { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.profile-head h2 { margin: 0; }
.pill { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--grad); }
.sync-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
details.more summary { cursor: pointer; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
details.more .field { margin-top: 10px; }
.field-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); font-weight: 600; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.presets button { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-weight: 600; }
.presets button.is-on { background: var(--grad); border-color: transparent; color: #fff; }
.eq { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.eq label { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.eq input { writing-mode: vertical-lr; direction: rtl; width: 16px; height: 130px; flex: none; }
.eq input::-webkit-slider-runnable-track { width: 4px; height: 100%; background: linear-gradient(0deg, var(--accent) var(--p), rgba(255,255,255,.18) var(--p)); }
.eq input::-webkit-slider-thumb { opacity: 1; margin-top: 0; margin-left: -4px; }
.eq input::-moz-range-thumb { opacity: 1; }
.eq output { font-variant-numeric: tabular-nums; color: var(--text); }
.pick-list { display: flex; flex-direction: column; gap: 4px; margin: 16px 0; max-height: 300px; overflow-y: auto; }
.pick-list button { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; border: 0; background: none; text-align: left; font-weight: 600; }
.pick-list button:hover { background: var(--panel-2); }
.pick-list .mosaic { width: 44px; height: 44px; border-radius: 8px; flex: none; }
.pick-list small { display: block; color: var(--muted); font-weight: 500; }
.pick-new { display: flex; gap: 8px; }
.pick-new input { flex: 1; min-width: 0; }
.sync-bar { display: flex; align-items: center; gap: 10px; padding: 12px; margin: 8px 0; border-radius: 14px; background: var(--panel-2); }
.sync-line-now { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Menu contextuel */
.menu { position: fixed; z-index: 70; min-width: 220px; padding: 6px; border-radius: 16px; background: #1b1233; border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: fade .15s; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; text-align: left; font-weight: 600; font-size: 14px; }
.menu button:hover { background: var(--panel-2); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

.dropzone { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(11,7,22,.75); backdrop-filter: blur(10px); }
.dropzone div { display: grid; place-items: center; gap: 12px; padding: 60px 80px; border-radius: 30px; border: 2px dashed var(--accent); font-size: 22px; font-weight: 800; }
.dropzone svg { width: 56px; height: 56px; color: var(--accent); animation: breathe 1.6s ease-in-out infinite; }
.upload-bar { position: fixed; left: 50%; bottom: calc(var(--player-h) + 16px); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 16px; background: #1b1233; border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; }
.upload-bar i { width: 140px; height: 6px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; }
.upload-bar b { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }
.toast { position: fixed; left: 50%; bottom: calc(var(--player-h) + 16px); z-index: 90; transform: translate(-50%, 20px); padding: 12px 20px; border-radius: 14px; background: #fff; color: #150c2a; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.admin-only { display: none !important; }
body.is-admin .admin-only { display: inline-flex !important; }
body.is-admin span.admin-only { display: inline-block !important; }

/* ---------- Tablette ---------- */
@media (max-width: 1100px) {
  :root { --side-w: 84px; }
  .side { align-items: center; padding: 22px 10px; }
  .brand span, .nav a span, .side-card, .install span { display: none; }
  .nav a { justify-content: center; padding: 12px; }
  .wrapped { grid-template-columns: repeat(2, 1fr); }
  .help-grid { grid-template-columns: 1fr; }
  .chat { position: static; }
  .mini-viz { display: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  :root { --player-h: 64px; --tab-h: 62px; }
  body { font-size: 14px; }
  .app { grid-template-columns: 1fr; height: calc(100dvh - var(--player-h) - var(--tab-h) - env(safe-area-inset-bottom)); }
  .side { display: none; }
  .main { padding: 0 16px 32px; }
  .top { padding: 12px 0; gap: 10px; }
  .search { height: 42px; }
  .search kbd, .account-name { display: none; }
  .account { padding: 0 4px; height: 42px; }
  .lang { height: 38px; padding: 0 6px; }
  .hero { grid-template-columns: 1fr; padding: 24px 20px; border-radius: 22px; }
  .hero-orb { display: none; }
  .hero h1 { font-size: 44px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat strong { font-size: 22px; }
  .cards { grid-auto-columns: 148px; gap: 12px; }
  .row { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; padding: 6px 4px; }
  .row-num, .row-dur, .row-plays { display: none; }
  .row .cover { width: 44px; height: 44px; }
  .row-actions { opacity: 1; }
  .row-actions .hide-m { display: none; }
  .wrapped { grid-template-columns: 1fr 1fr; gap: 10px; }
  .w-big, .w-wide { grid-column: span 2; }
  .w-big strong { font-size: 48px; }
  .pl-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .pl-cover { width: 140px; height: 140px; }
  .mix-banner { padding: 22px; }

  .player { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); left: 8px; right: 8px; height: var(--player-h); grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 0 8px; border-radius: 16px; border: 1px solid var(--line-2); }
  .p-cover { width: 46px; height: 46px; border-radius: 10px; }
  .p-center { flex-direction: row; }
  .p-controls { gap: 0; }
  #pShuffle, #pRepeat, #pPrev, .player .p-progress, .p-right { display: none; }
  .play-btn { width: 42px; height: 42px; }
  .p-mobile-bar { display: block; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden; }
  .p-mobile-bar span { display: block; height: 100%; width: 0; background: #fff; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 19; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(11,7,22,.92); backdrop-filter: blur(20px); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 10.5px; font-weight: 700; }
  .tabbar a.is-on { color: var(--text); }
  .tabbar a.is-on svg { color: var(--accent); }
  .toast, .upload-bar { bottom: calc(var(--player-h) + var(--tab-h) + 20px + env(safe-area-inset-bottom)); }

  .stage-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; gap: 16px; padding-top: 10px; overflow-y: auto; }
  .stage-cover { width: min(100%, 52vh); margin: 0 auto; border-radius: 20px; }
  .stage-lyrics { height: 34vh; }
  .lyrics-scroll { padding: 12vh 0; }
  .sheet { padding: 22px; border-radius: 22px; }
  .modal { align-items: end; padding: 0; }
  .modal .sheet { width: 100%; border-radius: 24px 24px 0 0; max-height: 90dvh; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
}
@media (min-width: 761px) { .tabbar { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Artistes ---------- */
.artists { display: grid; grid-auto-flow: column; grid-auto-columns: 140px; gap: 18px; overflow-x: auto; padding-bottom: 10px; }
.artist-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: var(--radius); background: transparent; text-align: center; transition: background .2s; }
.artist-card:hover { background: var(--panel); }
.artist-card .cover { position: relative; width: 112px; height: 112px; border-radius: 50%; font-size: 14px; box-shadow: 0 14px 30px -14px rgba(0,0,0,.8); transition: transform .25s var(--ease); }
.artist-card:hover .cover { transform: scale(1.05); }
.artist-card strong { font-size: 14px; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist-card span { color: var(--muted); font-size: 12px; margin-top: -8px; }
.artist-head { display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap; margin: 8px 0 28px; padding: 28px; border-radius: 28px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%); border: 1px solid var(--line); }
.artist-photo { position: relative; width: 190px; height: 190px; border-radius: 50%; font-size: 30px; box-shadow: var(--shadow); flex: none; }
.artist-head h1 { font-size: clamp(34px, 6vw, 64px); margin: 6px 0; }
.artist-link { cursor: pointer; }
.artist-link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Hors ligne ---------- */
.tag-off { background: rgba(255,255,255,.1); color: var(--text); }

/* ---------- Tableau de bord admin ---------- */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 26px; }
.admin-stats .stat strong { font-size: 26px; }
.admin-stats .stat small { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.admin-table { display: flex; flex-direction: column; gap: 6px; }
.a-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 90px 90px auto; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.a-row .cover { position: relative; width: 56px; height: 56px; border-radius: 12px; font-size: 10px; border: 0; padding: 0; cursor: pointer; }
.a-row .cover::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h3l2-3h6l2 3h3v13H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E") center / 22px no-repeat; opacity: 0; transition: opacity .2s; z-index: 1; }
.a-row .cover:hover::before { opacity: 1; }
.a-row strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-row small { color: var(--muted); }
.a-num { text-align: right; font-variant-numeric: tabular-nums; }
.a-num b { display: block; font-size: 16px; }
.a-num span { color: var(--faint); font-size: 12px; }
.a-actions { display: flex; gap: 2px; }
.a-empty { color: var(--muted); padding: 20px 0; }
@media (max-width: 760px) {
  .a-row { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .a-row .cover { width: 48px; height: 48px; }
  .a-num { display: none; }
  .artist-head { padding: 20px; gap: 18px; }
  .artist-photo { width: 120px; height: 120px; }
  .artists { grid-auto-columns: 116px; gap: 10px; }
  .artist-card .cover { width: 96px; height: 96px; }
}
