:root {
  --bg: #0d0b1e;
  --bg2: #15122e;
  --surface: #1b1740;
  --surface2: #241f52;
  --line: #342d6e;
  --text: #f4f1ff;
  --muted: #a8a3d1;
  --pink: #ff3d9a;
  --pink2: #ff7ac0;
  --cyan: #29d3ff;
  --gold: #ffc94d;
  --ok: #3ddc97;
  --err: #ff6b6b;
  --radius: 16px;
  --gutter: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -200px, #3a1d6e 0%, transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}
a { color: var(--cyan); }
h1, h2, h3 { line-height: 1.15; margin: 0; }
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- en-tête ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(13, 11, 30, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.15rem; letter-spacing: .2px; }
.brand { background: #fff; border-radius: 12px; padding: 3px 12px; }
.brand img { height: 46px; width: auto; display: block; }
.brand b { background: linear-gradient(90deg, var(--pink), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top nav { margin-left: auto; display: flex; gap: 6px; }
.top nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.top nav a[aria-current="page"], .top nav a:hover { color: var(--text); background: var(--surface); }

/* ---------- accueil ---------- */
.hero { padding: 36px 0 18px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 8vw, 3.2rem); font-weight: 900; letter-spacing: -.5px; }
.hero h1 span { background: linear-gradient(90deg, var(--pink), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); margin: 10px auto 0; max-width: 34ch; font-size: 1.05rem; }

.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 2px solid var(--line); border-radius: 999px;
  padding: 0 18px; height: 54px; margin: 22px 0 6px;
}
.search:focus-within { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255, 61, 154, .18); }
.search svg { flex: none; width: 20px; height: 20px; color: var(--muted); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; height: 100%; font-size: 1.05rem; }
.search input::placeholder { color: var(--muted); }
.search .clear { background: none; border: 0; color: var(--muted); font-size: 1.4rem; cursor: pointer; padding: 4px 6px; display: none; }
.search.has-text .clear { display: block; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.event { display: flex; gap: 14px; align-items: center; margin: 18px 0; background: linear-gradient(135deg, #3a1d6e, #1b1740 70%); border-color: #5a3aa8; }
.event .ico { font-size: 2rem; }
.event .when { font-size: 1.15rem; font-weight: 800; }
.event .where { color: var(--muted); font-size: .95rem; }
.event .tag { color: var(--gold); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

.section-title { font-size: 1.05rem; font-weight: 800; margin: 26px 0 10px; color: var(--pink2); text-transform: uppercase; letter-spacing: .06em; }
.groups { display: grid; gap: 14px; }
.group h3 { font-size: .95rem; color: var(--muted); font-weight: 700; margin: 0 0 8px 2px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile {
  display: block; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  min-height: 74px; transition: transform .12s, border-color .12s, background .12s;
}
.tile:hover, .tile:focus-visible { border-color: var(--pink); background: var(--surface2); transform: translateY(-2px); outline: 0; }
.tile strong { display: block; font-size: .98rem; }
.tile small { color: var(--muted); }

.how { display: grid; gap: 10px; counter-reset: s; margin: 0; padding: 0; list-style: none; }
.how li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.how li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--pink); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .9rem; }
.how b { color: var(--text); }

footer { margin: 40px 0 30px; text-align: center; color: var(--muted); font-size: .88rem; }
footer a { color: var(--muted); }

/* ---------- catalogue ---------- */
.tools { position: sticky; top: 58px; z-index: 15; background: linear-gradient(var(--bg) 85%, transparent); padding: 10px 0 6px; }
.tools .search { margin: 0 0 10px; height: 48px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding-left: var(--gutter); padding-right: var(--gutter); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 8px 14px; font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--pink); border-color: var(--pink); color: #fff; }
.select {
  width: 100%; height: 48px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--text);
  padding: 0 14px; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.select:focus { outline: 0; border-color: var(--pink); }
.select option, .select optgroup { background: var(--bg2); color: var(--text); }
/* alphabet : toutes les lettres visibles, qui passent à la ligne (jamais de défilement latéral) */
.letters { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.letters button { min-width: 38px; height: 38px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font-weight: 700; cursor: pointer; }
.letters button.wide { padding: 0 14px; }
.letters button:hover { border-color: var(--cyan); }
.letters button[aria-pressed="true"] { background: var(--cyan); border-color: var(--cyan); color: #06222b; }
.count { color: var(--muted); font-size: .88rem; margin: 6px 2px 8px; }

.artist { margin: 14px 0 6px; padding: 0 2px; display: flex; align-items: baseline; gap: 8px; }
.artist h3 { font-size: 1.02rem; color: var(--gold); }
.artist small { color: var(--muted); }
.songs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.song {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 10px 14px; min-height: 52px; cursor: pointer;
}
.song:hover, .song:focus-visible { border-color: var(--pink); background: var(--surface2); outline: 0; }
.song .t { flex: 1; min-width: 0; }
.song .t b { display: block; font-weight: 700; overflow-wrap: anywhere; }
.song .t small { color: var(--muted); display: block; }
.song .go { flex: none; background: var(--pink); color: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: .85rem; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.more { display: block; margin: 16px auto; background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 12px 22px; font-weight: 700; cursor: pointer; }

.fab {
  position: fixed; right: 14px; bottom: 14px; z-index: 30;
  background: var(--cyan); color: #06222b; border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 800;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45); cursor: pointer; display: none;
}
.fab.show { display: block; }

.banner { margin: 10px 0; padding: 10px 14px; border-radius: 12px; font-size: .92rem; border: 1px solid; }
.banner.warn { background: rgba(255, 201, 77, .1); border-color: rgba(255, 201, 77, .5); color: var(--gold); }
.banner.closed { background: rgba(255, 107, 107, .1); border-color: rgba(255, 107, 107, .5); color: var(--err); }

/* ---------- fenêtre de demande ---------- */
dialog {
  border: 1px solid var(--line); background: var(--bg2); color: var(--text);
  border-radius: 22px; padding: 0; width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 24px);
}
dialog::backdrop { background: rgba(5, 4, 15, .72); backdrop-filter: blur(3px); }
.sheet { padding: 22px 20px 20px; }
.sheet h2 { font-size: 1.25rem; margin-bottom: 4px; }
.sheet .song-name { color: var(--gold); font-weight: 800; font-size: 1.1rem; overflow-wrap: anywhere; }
.sheet .song-artist { color: var(--muted); margin-bottom: 16px; }
.sheet label { display: block; font-weight: 700; margin-bottom: 6px; }
.sheet input[type=text] { width: 100%; height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); padding: 0 16px; font-size: 1.1rem; outline: 0; }
.sheet input[type=text]:focus { border-color: var(--pink); }
.sheet .hint { color: var(--muted); font-size: .85rem; margin-top: 6px; }
.sheet .err { color: var(--err); min-height: 1.3em; margin-top: 8px; font-weight: 600; }
.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 15px; font-weight: 800; font-size: 1.05rem; cursor: pointer; background: linear-gradient(90deg, var(--pink), #c93dff); color: #fff; margin-top: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); font-weight: 700; }
.done { text-align: center; padding: 8px 0 4px; }
.done .big { font-size: 3rem; }
.done h2 { margin: 6px 0; }
.done p { color: var(--muted); margin: 6px 0; }
.done p.ask { color: var(--text); font-weight: 700; margin-top: 16px; }
.mine { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.mine li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; }
.mine .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mine .t small { color: var(--muted); display: block; }
.st { flex: none; font-size: .78rem; font-weight: 800; border-radius: 999px; padding: 4px 10px; }
.st.new { background: rgba(255, 201, 77, .15); color: var(--gold); }
.st.queued { background: rgba(61, 220, 151, .15); color: var(--ok); }
.st.refused { background: rgba(255, 107, 107, .15); color: var(--err); }

@media (min-width: 700px) {
  .tools { top: 58px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- mentions légales ---------- */
.legal { padding-top: 24px; padding-bottom: 10px; line-height: 1.6; }
.legal h1 { font-size: 1.8rem; margin: 0 0 12px; }
.legal h2 { font-size: 1.1rem; color: var(--pink2); margin: 26px 0 8px; }
.legal h3 { font-size: 1rem; margin: 16px 0 6px; }
.legal p, .legal li { color: var(--muted); }
.legal b { color: var(--text); }
.legal ul { padding-left: 20px; margin: 6px 0; }
.legal .back { margin-top: 28px; text-align: center; }
.legal .back .btn { display: inline-block; text-decoration: none; width: auto; padding: 10px 20px; }

.event .ev + .ev { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------- suivi des demandes : attente estimée, annulation ---------- */
.mine .right { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.st.playing { background: rgba(255, 61, 154, .2); color: var(--pink2); }
.st.done { background: rgba(168, 163, 209, .15); color: var(--muted); }
.st.cancelled, .st.removed, .st.cancel_asked { background: rgba(168, 163, 209, .15); color: var(--muted); }
.mine .cancel { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 3px 12px; font-size: .78rem; font-weight: 700; cursor: pointer; }
.mine .cancel.armed { border-color: var(--err); color: var(--err); }

/* ---------- filtres par étiquettes, stars ---------- */
.filter-btn { width: 100%; height: 48px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--text); padding: 0 14px;
  font-size: 1rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: space-between; text-align: left; }
.filter-btn[aria-expanded="true"] { border-color: var(--pink); }
.filter-btn b { background: var(--pink); color: #fff; border-radius: 999px; min-width: 24px; height: 24px; display: grid; place-items: center; font-size: .85rem; padding: 0 7px; }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 0 0 8px; display: grid; gap: 12px; }
.filters[hidden] { display: none; }
.fam h4 { font-size: .8rem; color: var(--pink2); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px; }
.famchips { display: flex; flex-wrap: wrap; gap: 8px; }
.famchips .chip, .active-filters .chip { flex: none; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; }
.active-filters:empty { display: none; }
.chip.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.stargrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px 8px; }
.star { display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; color: var(--text); gap: 4px; padding: 6px 2px; border-radius: 14px; }
.star:hover, .star:focus-visible { background: var(--surface); outline: 0; }
.star img, .star .initials { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); background: var(--surface2); }
.star .initials { display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; color: var(--pink2); }
.star strong { font-size: .85rem; line-height: 1.15; }
.star small { color: var(--muted); font-size: .75rem; }
.credits { list-style: none; padding: 0; display: grid; gap: 10px; }
.credits li { color: var(--muted); font-size: .92rem; }
.credits b { color: var(--text); }

/* ---------- icônes SVG des styles ---------- */
.tile { display: flex; align-items: center; gap: 12px; }
.tile .ico-wrap { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .06); color: var(--pink2); }
.tile .ico-wrap .ic { width: 24px; height: 24px; }
.tile-txt { min-width: 0; }
.tile[data-fam="epoque"] .ico-wrap { color: var(--gold); }
.tile[data-fam="genre"] .ico-wrap { color: var(--cyan); }
.tile[data-fam="voix"] .ico-wrap { color: var(--ok); }
.tile[data-fam="diff"] .ico-wrap { color: #ff9a5c; }
.tile[data-fam="divers"] .ico-wrap { color: var(--gold); }
.tile:hover .ico-wrap, .tile:focus-visible .ico-wrap { background: rgba(255, 255, 255, .12); }
.chip .ic { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
