/* Flyer de club : nuit violette, projecteurs qui dérivent, titres très larges, pochettes en vedette. */
@font-face { font-family: "Unbounded"; src: url("/fonts/unbounded-latin-wght-normal.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/fonts/manrope-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  color-scheme: dark;
  --night: #0e0820;
  --ink: #fff6ea;
  --muted: #bcaedb;
  --hot: #ff3d7f;
  --sun: #ffb238;
  --volt: #5a5cff;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-2: rgba(255, 255, 255, 0.13);
  --line: rgba(255, 255, 255, 0.16);
  --cta-ink: #24092a;
  --danger: #ff8597;
  --fire: linear-gradient(100deg, var(--sun), var(--hot));
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body { margin: 0; color: var(--ink); font: 500 1rem/1.5 var(--body); min-height: 100dvh; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
p, h1, h2, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

/* Projecteurs */
.lights { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--night); }
.lights i { position: absolute; width: 95vmax; height: 95vmax; border-radius: 50%; }
.lights i:nth-child(1) { background: radial-gradient(circle, rgba(255, 61, 127, 0.55), transparent 62%); top: -48vmax; left: -42vmax; }
.lights i:nth-child(2) { background: radial-gradient(circle, rgba(90, 92, 255, 0.6), transparent 62%); bottom: -50vmax; right: -45vmax; }
.lights i:nth-child(3) { background: radial-gradient(circle, rgba(255, 178, 56, 0.28), transparent 60%); width: 60vmax; height: 60vmax; top: 30%; right: -34vmax; }
@media (prefers-reduced-motion: no-preference) {
  .lights i:nth-child(1) { animation: drift-a 22s ease-in-out infinite alternate; }
  .lights i:nth-child(2) { animation: drift-b 26s ease-in-out infinite alternate; }
  .lights i:nth-child(3) { animation: drift-a 30s ease-in-out infinite alternate-reverse; }
}
@keyframes drift-a { to { transform: translate(14vmax, 10vmax) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-12vmax, -14vmax) scale(1.1); } }

/* Structure */
.app { max-width: 31rem; margin: 0 auto; padding-inline: 1.25rem; padding-block: 1.25rem 7rem; display: flex; flex-direction: column; gap: 1.75rem; }
.app.wide { max-width: 50rem; padding-block-end: 3rem; }
.view { display: flex; flex-direction: column; gap: 1.25rem; }
.mast { display: flex; align-items: center; gap: 0.6rem; font: 600 0.72rem/1.6 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.mast .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mast .mf { flex: none; height: 1.7rem; width: auto; opacity: 0.92; }
.mast .eq { margin-left: auto; }
.venue { align-self: center; width: min(100%, 21rem); height: auto; filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.55)); }
.venue.small { align-self: flex-start; width: 12rem; }
.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; flex: none; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: var(--fire); transform-origin: bottom; transform: scaleY(0.5); }
.eq i:nth-child(2) { transform: scaleY(1); } .eq i:nth-child(3) { transform: scaleY(0.35); } .eq i:nth-child(4) { transform: scaleY(0.75); }
@media (prefers-reduced-motion: no-preference) {
  .eq i { animation: eq 0.9s ease-in-out infinite alternate; }
  .eq i:nth-child(2) { animation-delay: -0.3s; } .eq i:nth-child(3) { animation-delay: -0.6s; } .eq i:nth-child(4) { animation-delay: -0.15s; }
}
@keyframes eq { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }

h1 { font: 800 clamp(2.15rem, 10.5vw, 3.5rem)/0.98 var(--display); letter-spacing: -0.035em; text-wrap: balance; }
h1 em, .fire { font-style: normal; background: var(--fire); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 26rem; }
.error { color: var(--danger); font-weight: 700; }

/* Champs */
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-weight: 700; font-size: 0.85rem; }
.field label small { font-weight: 500; color: var(--muted); }
input[type="text"], input[type="search"], input[type="password"] {
  width: 100%; font: 600 1.05rem/1.3 var(--body); color: var(--ink); background: var(--glass);
  border: 1.5px solid var(--line); border-radius: 1rem; padding: 0.9rem 1.1rem; -webkit-appearance: none; appearance: none;
}
input::placeholder { color: #9486b8; font-weight: 500; }
input:focus { outline: none; border-color: var(--sun); background: var(--glass-2); }

.search { position: relative; display: block; }
.search svg { position: absolute; left: 1.1rem; top: 50%; translate: 0 -50%; width: 1.35rem; height: 1.35rem; color: var(--sun); pointer-events: none; }
.search input { font-size: 1.2rem; padding: 1.15rem 1.1rem 1.15rem 3.2rem; border-radius: 1.25rem; box-shadow: 0 12px 40px -18px rgba(255, 61, 127, 0.7); }

/* Pochettes */
.cover { flex: none; width: 3.25rem; height: 3.25rem; border-radius: 0.6rem; object-fit: cover; background: var(--glass-2); display: grid; place-items: center; color: var(--muted); }
.cover svg { width: 45%; height: 45%; }

/* Résultats de recherche */
.results { display: flex; flex-direction: column; gap: 0.35rem; }
.results button { width: 100%; display: flex; align-items: center; gap: 0.85rem; text-align: left; padding: 0.5rem; border-radius: 0.95rem; background: var(--glass); border: 1.5px solid transparent; }
.results button:hover, .results button:focus-visible { border-color: var(--line); background: var(--glass-2); }
.txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; flex: 1; }
.txt strong, .txt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txt strong { font-weight: 800; font-size: 1.02rem; }
.txt small { color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.results .free { border: 1.5px dashed var(--line); background: transparent; color: var(--muted); padding: 0.85rem 1rem; }
.results .free b { color: var(--ink); overflow-wrap: anywhere; }
.hint { color: var(--muted); font-size: 0.9rem; }

/* Titre choisi */
.ticket { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: 1.4rem; background: var(--glass); border: 1.5px solid var(--line); }
.disc { position: relative; flex: none; width: 6.25rem; height: 6.25rem; margin-right: 1.6rem; }
.disc .cover { position: relative; z-index: 1; width: 100%; height: 100%; border-radius: 0.8rem; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.7); }
.vinyl { position: absolute; inset: 4% auto 4% 36%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--hot) 0 17%, #0b0714 18% 21%, #1d1630 22% 100%); }
.vinyl::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 20deg, transparent 0 20%, rgba(255, 255, 255, 0.16) 25%, transparent 30% 70%, rgba(255, 255, 255, 0.12) 75%, transparent 80%); }
@media (prefers-reduced-motion: no-preference) { .vinyl { animation: spin 4s linear infinite; } }
@keyframes spin { to { rotate: 360deg; } }
.ticket .txt strong { font: 700 1.05rem/1.2 var(--display); letter-spacing: -0.01em; white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ticket .txt small { font-size: 0.95rem; margin-top: 0.3rem; white-space: normal; }
.link { align-self: flex-start; margin-top: 0.5rem; font-weight: 700; font-size: 0.85rem; color: var(--sun); text-decoration: underline; text-underline-offset: 3px; padding: 0.2rem 0; }

form { display: flex; flex-direction: column; gap: 1.1rem; }
.cta { font: 800 0.98rem/1 var(--display); letter-spacing: -0.01em; color: var(--cta-ink); background: var(--fire); border-radius: 1.15rem; padding: 1.25rem 1.4rem; box-shadow: 0 16px 36px -14px rgba(255, 61, 127, 0.9); }
.cta:disabled { opacity: 0.6; cursor: wait; }
.btn { font-weight: 700; font-size: 0.9rem; border: 1.5px solid var(--line); border-radius: 99px; padding: 0.55rem 1rem; background: var(--glass); }
.btn:hover { background: var(--glass-2); }
.btn.solid { background: var(--ink); color: var(--night); border-color: var(--ink); }
.btn.danger { color: var(--danger); }
@media (prefers-reduced-motion: no-preference) {
  .cta, .btn, .results button, .cand { transition: transform 0.12s, background-color 0.15s, border-color 0.15s; }
  .cta:active, .btn:active, .cand:active { transform: scale(0.975); }
}

/* Confirmation */
.sent { align-items: flex-start; }
.stamp { width: 4.5rem; height: 4.5rem; border-radius: 50%; background: var(--fire); color: var(--cta-ink); display: grid; place-items: center; box-shadow: 0 0 0 10px rgba(255, 178, 56, 0.14), 0 0 0 22px rgba(255, 61, 127, 0.08); margin: 1rem 0 0.75rem 0.75rem; }
.stamp svg { width: 2.2rem; height: 2.2rem; }
@media (prefers-reduced-motion: no-preference) { .stamp { animation: pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both; } }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* Vote */
.ballot { display: flex; flex-direction: column; gap: 0.5rem; }
.cand { position: relative; overflow: hidden; width: 100%; display: flex; align-items: center; gap: 0.8rem; text-align: left; padding: 0.55rem 0.7rem 0.55rem 0.55rem; border-radius: 1.1rem; background: var(--glass); border: 1.5px solid transparent; }
.cand::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--share, 0) * 100%); background: linear-gradient(90deg, rgba(255, 178, 56, 0.2), rgba(255, 61, 127, 0.3)); transition: width 0.5s; }
.cand > * { position: relative; }
.cand[aria-pressed="true"] { border-color: var(--hot); }
.rank { flex: none; width: 1.6rem; text-align: center; font: 800 0.95rem/1 var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }
.cand:first-child .rank { color: var(--sun); }
.tally { flex: none; display: flex; align-items: center; gap: 0.35rem; font: 800 0.9rem/1 var(--display); font-variant-numeric: tabular-nums; padding: 0.55rem 0.75rem; border-radius: 99px; background: var(--glass-2); }
.tally svg { width: 1.05rem; height: 1.05rem; }
.cand[aria-pressed="true"] .tally { background: var(--fire); color: var(--cta-ink); }
.empty { border: 1.5px dashed var(--line); border-radius: 1.2rem; padding: 2rem 1.25rem; text-align: center; color: var(--muted); }

/* Navigation Proposer / Voter */
.nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 0.75rem 1.25rem calc(0.9rem + env(safe-area-inset-bottom, 0px)); pointer-events: none; }
.nav div { pointer-events: auto; display: flex; gap: 0.25rem; padding: 0.3rem; border-radius: 99px; background: rgba(24, 14, 48, 0.82); border: 1.5px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7); }
.nav button { font: 700 0.78rem/1 var(--display); padding: 0.85rem 1.4rem; border-radius: 99px; color: var(--muted); }
.nav button[aria-pressed="true"] { background: var(--fire); color: var(--cta-ink); }

/* ---------- Régie ---------- */
.panel { display: flex; flex-direction: column; gap: 1.1rem; padding: 1.1rem; border-radius: 1.4rem; background: var(--glass); border: 1.5px solid var(--line); }
.switches { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.6rem; }
.switch { display: flex; gap: 0.8rem; align-items: flex-start; text-align: left; padding: 0.85rem; border-radius: 1rem; background: var(--glass); border: 1.5px solid transparent; }
.switch[aria-checked="true"] { border-color: var(--sun); }
.knob { flex: none; width: 2.7rem; height: 1.55rem; border-radius: 99px; background: var(--glass-2); position: relative; margin-top: 0.1rem; }
.knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: calc(1.55rem - 6px); aspect-ratio: 1; border-radius: 50%; background: var(--muted); transition: translate 0.18s, background-color 0.18s; }
.switch[aria-checked="true"] .knob { background: var(--fire); }
.switch[aria-checked="true"] .knob::after { translate: 1.15rem 0; background: #fff; }
.switch b { display: block; font-weight: 800; }
.switch small { color: var(--muted); font-size: 0.82rem; line-height: 1.35; display: block; }
.tools { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tabs { display: flex; gap: 0.25rem; align-self: flex-start; padding: 0.3rem; border-radius: 99px; background: var(--glass); border: 1.5px solid var(--line); }
.tabs button { font: 700 0.74rem/1 var(--display); padding: 0.7rem 1.1rem; border-radius: 99px; color: var(--muted); }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--night); }
.tabs .count { margin-left: 0.4rem; font-variant-numeric: tabular-nums; opacity: 0.7; }

.list { display: flex; flex-direction: column; gap: 0.6rem; }
.song { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.9rem; border-radius: 1.2rem; background: var(--glass); border: 1.5px solid transparent; }
.song.in-vote { border-color: rgba(255, 178, 56, 0.45); }
.song.is-done { opacity: 0.55; }
.song .head { display: flex; gap: 0.85rem; align-items: center; }
.song .cover { width: 3.75rem; height: 3.75rem; }
.song .txt strong { font: 700 1rem/1.25 var(--display); letter-spacing: -0.01em; white-space: normal; overflow-wrap: anywhere; }
.song .txt small { white-space: normal; }
.song .meta { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; margin-top: 0.15rem; }
.song .meta b { color: var(--sun); }
.row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.chip { color: var(--ink); text-decoration: none; font-size: 0.8rem; font-weight: 700; border: 1.5px solid var(--line); border-radius: 99px; padding: 0.3rem 0.75rem; }
.chip:hover { border-color: var(--sun); }
.row .btn { font-size: 0.82rem; padding: 0.45rem 0.85rem; }
.btn[aria-pressed="true"] { background: var(--fire); color: var(--cta-ink); border-color: transparent; }
.spacer { flex: 1; }

/* Affiche QR */
#poster { background: #fff; color: #170b2e; border-radius: 1.4rem; padding: 1.75rem 1.25rem; display: flex; flex-direction: column; align-items: center; gap: 0.9rem; text-align: center; }
#poster .p-venue { align-self: stretch; display: grid; place-items: center; padding: 1.25rem; border-radius: 1rem; background: #0e0820; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#poster .p-venue img { width: min(100%, 19rem); height: auto; }
#poster .p-mf { height: 1.7rem; width: auto; }
#poster .p-event { font: 700 0.75rem/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: #6b5a8f; }
#poster .p-title { font: 800 1.9rem/1 var(--display); letter-spacing: -0.03em; text-wrap: balance; }
#poster .p-title span { color: #e6226a; }
#poster .qr { width: min(100%, 17rem); }
#poster .qr svg { width: 100%; height: auto; display: block; }
#poster .p-how { font-weight: 700; max-width: 22rem; }
#poster .p-url { font-size: 0.85rem; color: #6b5a8f; overflow-wrap: anywhere; }
#poster .btn { background: #170b2e; color: #fff; border-color: #170b2e; }

@media print {
  html, body { background: #fff; }
  .lights, .app > *:not(#poster), #poster .btn { display: none !important; }
  .app { max-width: none; padding: 0; }
  #poster { display: flex !important; border-radius: 0; padding: 0.5cm 0 0; gap: 0.7cm; }
  #poster .p-venue { padding: 0.8cm; border-radius: 0.5cm; }
  #poster .p-venue img { width: 11cm; }
  #poster .p-title { font-size: 3rem; }
  #poster .qr { width: 11cm; }
  #poster .p-mf { height: 1cm; }
  #poster .p-how { font-size: 1.5rem; max-width: 15cm; }
  #poster .p-event, #poster .p-url { font-size: 1.05rem; }
}
