:root {
  --bg: #0d0b14;
  --card: #18152366;
  --card-solid: #181523;
  --line: #ffffff17;
  --fg: #f4f1fa;
  --muted: #a39db3;
  --accent: #ff4f8b;
  --accent2: #8b5cf6;
  --accent3: #ffb547;
  --good: #22c58b;
  --bad: #ef4565;
  --grad: linear-gradient(120deg, var(--accent), var(--accent2) 55%, var(--accent3));
  --radius: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Ubuntu, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }

.cover { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: #ffffff10; flex: none; }
.cover.empty { display: grid; place-items: center; color: var(--muted); font-size: 22px; }
.muted { color: var(--muted); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

.btn {
  border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 650;
  background: #ffffff14; transition: transform .1s, background .2s;
}
.btn:hover { background: #ffffff22; }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--grad); color: #fff; }
.btn.danger { background: #ef456533; color: #ffb3c0; }
.btn:disabled { opacity: .4; cursor: default; transform: none; }

input[type=text], input[type=search], input[type=number], input[type=password], select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #ffffff0d; outline: none;
}
input:focus, select:focus { border-color: var(--accent2); }

.progress { height: 4px; border-radius: 4px; background: #ffffff1a; overflow: hidden; }
.progress > div { height: 100%; background: var(--grad); width: 0; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0;
  background: #2a2438; border: 1px solid var(--line); padding: 12px 18px; border-radius: 14px;
  transition: all .25s; z-index: 100; max-width: calc(100% - 32px); text-align: center;
  pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }
#toast.error { background: #4a1d2a; }

body.offline::before {
  content: "Connexion perdue… reconnexion"; position: fixed; top: 0; left: 0; right: 0;
  background: var(--bad); color: #fff; text-align: center; padding: 6px; z-index: 200; font-size: 14px;
}

.overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 24px;
  background: radial-gradient(circle at 50% 30%, #3b1d5c, var(--bg) 70%);
}
canvas.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

.choice {
  display: flex; align-items: center; gap: 12px; border: 0; border-radius: 16px; color: #fff;
  padding: 16px; text-align: left; font-weight: 650; min-height: 72px;
}
.choice .shape { font-size: 22px; opacity: .9; flex: none; }
.choice small { display: block; font-weight: 450; opacity: .85; }
.choice.dim { opacity: .25; }
.choice.picked { outline: 4px solid #fff; }

@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes glow { 50% { filter: brightness(1.25) drop-shadow(0 0 30px #ff4f8b88); } }

.icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.icon.src { width: .95em; height: .95em; vertical-align: -0.12em; margin-right: .3em; }
.brand-spotify { color: #1ed760; }
.brand-youtube { color: #ff2e3e; }
.title-icon { color: var(--accent); margin-right: .35em; }
