:root {
  --bg: #12101a;
  --surface: #1c1928;
  --surface-2: #26223a;
  --line: #36304f;
  --text: #f3f0fa;
  --muted: #a69fbf;
  --accent: #ff4f8b;
  --accent-ink: #ffffff;
  --gold: #ffc94d;
  --ok: #3ddc97;
  --danger: #ff6b6b;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}
main.wide { max-width: 1100px; }

h1 { font-size: 1.6rem; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0 0 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.now {
  background: linear-gradient(135deg, #3a1530, #1c1928 70%);
  border-color: #5a2547;
}
.now .label { color: var(--accent); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.now .who { font-size: 1.4rem; font-weight: 700; margin: 4px 0 2px; }

label { display: block; font-weight: 600; margin: 12px 0 6px; }
label .opt { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="number"], input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
/* Champs remplis par la recherche dans le catalogue : non saisissables */
input[readonly] { background: transparent; border-style: dashed; color: var(--text); }
/* Résultats de la recherche dans le catalogue */
ul.results { list-style: none; margin: 8px 0 0; padding: 0; max-height: 50vh; overflow-y: auto; }
ul.results li { border-top: 1px solid var(--line); }
ul.results li:first-child { border-top: 0; }
button.result {
  width: 100%;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  text-align: left;
  font-weight: 400;
  color: var(--text);
  background: transparent;
  border-radius: 0;
}
button.result:hover { background: var(--surface-2); }
input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
}
button:disabled { opacity: 0.5; cursor: default; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); min-height: 36px; padding: 6px 12px; font-size: 0.875rem; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid #5a2a35; min-height: 36px; padding: 6px 12px; font-size: 0.875rem; }
.btn-big { width: 100%; min-height: 56px; font-size: 1.1rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 160px; }
.actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

ol.queue, ul.list { list-style: none; margin: 0; padding: 0; }
ol.queue li, ul.list li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
ol.queue li:first-child, ul.list li:first-child { border-top: 0; }
.pos {
  flex: 0 0 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.875rem;
}
li.mine .pos { background: var(--accent); color: var(--accent-ink); }
li.mine .who-name::after { content: " (toi)"; color: var(--accent); font-weight: 600; }
.item-body { flex: 1; min-width: 0; }
.who-name { font-weight: 700; }
.song { overflow-wrap: anywhere; }
.song-title { font-weight: 500; }
.song-artist, .with { color: var(--muted); font-size: 0.9rem; }
.badge { display: inline-block; font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); margin-left: 6px; font-weight: 600; }
.badge.warn { background: #4a2a10; color: var(--gold); }
.empty { color: var(--muted); padding: 8px 0; }

.hello { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.code-pill { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); padding: 2px 8px; border-radius: 6px; letter-spacing: 0.08em; }

.notice { background: #2a2410; border: 1px solid #5a4a18; color: var(--gold); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 0.925rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 120px);
  max-width: calc(100% - 32px);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 10px;
  transition: transform 0.2s ease;
  z-index: 50;
}
.toast.show { transform: translate(-50%, 0); }
.toast.error { border-color: var(--danger); }
.toast.ok { border-color: var(--ok); }

/* Animateur */
.estimate { margin-top: 12px; padding-top: 10px; border-top: 1px solid #5a2547; }
.est-main { font-weight: 600; }
.margin { margin-top: 6px; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 0.925rem; }
.margin.ok { background: #10301f; color: var(--ok); }
.margin.over { background: #3a2410; color: var(--gold); }
fieldset.switch { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 12px; margin: 0 0 4px; }
fieldset.switch legend { font-weight: 600; padding: 0 4px; }
label.radio { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; margin: 8px 0 0; cursor: pointer; }
label.radio input { margin-top: 4px; accent-color: var(--accent); flex: 0 0 auto; }
label.radio .opt { color: var(--muted); font-weight: 400; }
input[type="time"] { width: 100%; padding: 12px 14px; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
ol.queue li.qitem { flex-direction: column; align-items: stretch; gap: 8px; }
.qhead { display: flex; gap: 12px; align-items: center; cursor: pointer; border-radius: 8px; }
.qactions { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 44px; }
li.selected .qhead { outline: 2px solid var(--gold); outline-offset: 4px; }
li.dim { opacity: 0.45; }
.to-add { border-color: #5a4a18; background: linear-gradient(135deg, #2a2410, #1c1928 70%); }
.to-add .label { color: var(--gold); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.to-add .who { font-size: 1.2rem; font-weight: 700; margin: 4px 0 2px; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid { grid-template-columns: 3fr 2fr; } }
.qr-box { background: #fff; padding: 12px; border-radius: 10px; display: inline-block; }
.qr-box canvas, .qr-box img { display: block; }
.overlay {
  position: fixed; inset: 0; background: rgba(10, 8, 16, 0.96);
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 20px; z-index: 40; padding: 16px; text-align: center;
}
.overlay.show { display: flex; }
.overlay .big-url { font-size: clamp(1.1rem, 3vw, 2rem); font-weight: 700; overflow-wrap: anywhere; }
details summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.stats { font-size: 0.85rem; color: var(--muted); }

/* Petits ajustements d'espacement (à la place des attributs style, que la politique de sécurité interdit) */
.mt-6 { margin: 6px 0 0; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.ml-8 { margin-left: 8px; }
.login-card { max-width: 420px; margin: 40px auto; }
