/* ==========================================================
   Jukebox — styles partagés
   ========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@500;700;800&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,700&display=swap');

:root {
  --bg: #0b0816;
  --bg2: #120d24;
  --card: #1b1433;
  --card2: #241b45;
  --card3: #2e2457;
  --line: rgba(255, 255, 255, .09);
  --text: #f6f1ff;
  --muted: #a99fcb;
  --dim: #6f6596;
  --pink: #ff3d9a;
  --violet: #8b5cf6;
  --cyan: #2be2e8;
  --yellow: #ffd23f;
  --green: #45e08a;
  --red: #ff5a64;
  --orange: #ff9a3d;
  --grad: linear-gradient(135deg, #ff3d9a 0%, #a24dff 55%, #4f6bff 100%);
  --grad-warm: linear-gradient(135deg, #ffd23f 0%, #ff7a3d 50%, #ff3d9a 100%);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font-title: 'Unbounded', system-ui, sans-serif;
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
body.party-bg {
  background:
    radial-gradient(600px 400px at 0% 0%, rgba(255, 61, 154, .22), transparent 60%),
    radial-gradient(500px 380px at 100% 20%, rgba(43, 226, 232, .14), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(139, 92, 246, .25), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--cyan); }
h1, h2, h3, .title-font { font-family: var(--font-title); letter-spacing: -.01em; }


/* ---------- Primitives ---------- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0)) , var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }
.section-title {
  font-family: var(--font-title); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  margin: 18px 2px 8px; display: flex; align-items: center; gap: 8px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: 14px; font-weight: 700;
  background: var(--card2); border: 1px solid var(--line);
  transition: transform .08s ease, filter .15s;
  min-height: 44px;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); border: 0; box-shadow: 0 6px 22px rgba(255, 61, 154, .35); }
.btn-warm { background: var(--grad-warm); color: #1a0f00; border: 0; }
.btn-danger { background: rgba(255, 90, 100, .14); color: #ff8b92; border-color: rgba(255, 90, 100, .35); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 11px; min-height: 34px; border-radius: 10px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .4; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--card2); border: 1px solid var(--line); white-space: nowrap;
}
.chip-pink { background: rgba(255, 61, 154, .16); color: #ff7fbd; border-color: rgba(255, 61, 154, .3); }
.chip-cyan { background: rgba(43, 226, 232, .13); color: var(--cyan); border-color: rgba(43, 226, 232, .3); }
.chip-yellow { background: rgba(255, 210, 63, .14); color: var(--yellow); border-color: rgba(255, 210, 63, .3); }
.chip-green { background: rgba(69, 224, 138, .13); color: var(--green); border-color: rgba(69, 224, 138, .3); }
.chip-red { background: rgba(255, 90, 100, .14); color: #ff8b92; border-color: rgba(255, 90, 100, .3); }

.input {
  width: 100%; padding: 14px 16px; border-radius: 14px;
  background: var(--bg2); border: 1px solid var(--line); outline: none;
  font-size: 16px; /* évite le zoom iOS */
}
.input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 61, 154, .2); }

/* Pochette fictive générée */
.cover {
  flex: none; border-radius: 10px; position: relative; overflow: hidden;
  display: grid; place-items: center;
  font-family: var(--font-title); font-weight: 800; color: rgba(255,255,255,.92);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.cover::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 25%, rgba(255,255,255,.35), transparent 45%);
}

.progress { height: 6px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }

/* Interrupteur */
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; border-radius: 99px; background: var(--card3);
  transition: .2s; border: 1px solid var(--line);
}
.switch span::before {
  content: ""; position: absolute; width: 24px; height: 24px; left: 2px; top: 2px;
  border-radius: 50%; background: #fff; transition: .2s;
}
.switch input:checked + span { background: var(--pink); }
.switch input:checked + span::before { transform: translateX(20px); }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; width: min(400px, calc(100% - 32px)); pointer-events: none; }
.toast {
  padding: 12px 14px; border-radius: 14px; font-weight: 500; font-size: 14.5px;
  background: #2a2150; border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; gap: 10px; align-items: flex-start;
  animation: toastIn .25s ease;
}
.toast.err { background: #3a1630; border-color: rgba(255, 90, 100, .45); }
.toast.ok { background: #123629; border-color: rgba(69, 224, 138, .45); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* Feuille modale (bottom sheet) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(5, 3, 12, .65); z-index: 150;
  display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(4px); }
.sheet {
  width: min(480px, 100%); max-height: 88dvh; overflow: auto;
  background: var(--bg2); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 24px 24px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  animation: sheetIn .25s ease;
}
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--card3); margin: 0 auto 12px; }
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } }

/* QR fictif */
.qr { background: #fff; padding: 8px; border-radius: 12px; display: inline-block; line-height: 0; }
.qr svg { display: block; width: 100%; height: 100%; }

.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none;
  box-shadow: 0 0 0 0 rgba(69, 224, 138, .6); animation: pulse 1.8s infinite; }
.pulse-dot.red { background: var(--red); box-shadow: 0 0 0 0 rgba(255, 90, 100, .6); }
.pulse-dot.orange { background: var(--orange); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(69, 224, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(69, 224, 138, 0); } }

/* Égaliseur animé */
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: var(--cyan); border-radius: 2px; animation: eq 1s infinite ease-in-out; }
.eq i:nth-child(2) { animation-delay: -.4s; }
.eq i:nth-child(3) { animation-delay: -.7s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
