/* Joue ma toune — feuille de style unique.
   Aucun framework : la page invité doit se charger d'un coup sur un téléphone,
   au fond d'une salle de réception au Wi-Fi saturé. */

/* L'attribut hidden doit toujours gagner sur les règles display écrites ici. */
[hidden] { display: none !important; }

/* Polices servies par le site lui-même, et non par Google Fonts : une police
   tierce transmettrait l'adresse IP de chaque invité. Sous-ensemble latin.
   Unbounded est variable : un seul fichier pour toutes les graisses. */
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap; src: url(/assets/polices/Unbounded.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/polices/Barlow-400.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/polices/Barlow-500.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/polices/Barlow-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/polices/Barlow-700.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/polices/BarlowCondensed-600.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/polices/BarlowCondensed-700.woff2) format('woff2'); }

/* Direction « club / néon ». Deux accents, comme sur pooldehockey : une couleur
   assez foncée pour porter du texte blanc dans un bouton est trop foncée pour se
   lire en texte sur fond sombre. --accent peint les aplats (blanc dessus : 5,0:1),
   --accent-lien écrit sur le fond (7,2:1 en sombre, 5,9:1 en clair). --neon et
   --cyan ne servent qu'au décor et aux très gros caractères, jamais au texte
   courant. */
:root {
  color-scheme: light dark;

  --nuit: #0A0A12;
  --nuit-2: #14141F;
  --neon: #FF2E88;
  --cyan: #22D3EE;
  --accent: #D6146E;
  --accent-lien: #C2105F;
  --accent-doux: #FCE7F1;
  --succes: #0E7C66;
  --succes-doux: #DDF5EF;
  --danger: #B42318;

  --fond: #F4F3F8;
  --surface: #FFFFFF;
  --surface-2: #ECEAF2;
  --bord: #D8D5E2;
  --texte: #0A0A12;
  --texte-doux: #5B5870;

  --r: 0;
  --gouttiere: 16px;
  --police: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --police-titre: 'Unbounded', 'Arial Black', Impact, sans-serif;
  --police-etiquette: 'Barlow Condensed', 'Arial Narrow', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0A0A12;
    --surface: #12121E;
    --surface-2: #1A1A2A;
    --bord: #2A2A40;
    --texte: #F5F4FA;
    --texte-doux: #A6A3B8;
    --accent-lien: #FF6FB0;
    --accent-doux: #2A0E1E;
    --succes: #34D3B0;
    --succes-doux: #0D2621;
    --danger: #FF8A80;
  }
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --fond: #0A0A12;
  --surface: #12121E;
  --surface-2: #1A1A2A;
  --bord: #2A2A40;
  --texte: #F5F4FA;
  --texte-doux: #A6A3B8;
  --accent-lien: #FF6FB0;
  --accent-doux: #2A0E1E;
  --succes: #34D3B0;
  --succes-doux: #0D2621;
  --danger: #FF8A80;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.5;
  background: var(--fond);
  color: var(--texte);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.1; }
h1, h2 { font-family: var(--police-titre); font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); }
h2 { font-size: clamp(1.2rem, 3.6vw, 1.5rem); }
h3 { font-family: var(--police-etiquette); font-weight: 700; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .06em; }

a { color: var(--accent-lien); }
p { margin: 0 0 1rem; }

.muet { color: var(--texte-doux); }
.petit { font-size: .875rem; }

.etiquette {
  font-family: var(--police-etiquette); font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; font-size: .8rem;
}

/* ---------------- barre de marque ---------------- */

.barre {
  position: sticky; top: 0; z-index: 20;
  background: var(--nuit); color: #F5F4FA;
  border-bottom: 2px solid var(--neon);
}
.barre-int {
  max-width: 1100px; margin: 0 auto; padding: 10px var(--gouttiere);
  display: flex; align-items: center; gap: 12px;
}
.barre nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.barre a { color: #F5F4FA; text-decoration: none; }
.barre .lien-barre {
  font-family: var(--police-etiquette); font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 8px 10px; font-size: .9rem;
}
.barre .lien-barre:hover { color: #FF6FB0; }

/* Mot-symbole en TEXTE HTML, comme sur pooldehockey : un SVG chargé en image
   ne verrait pas les polices de la page. */
.marque { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.marque-logo { width: 38px; height: 38px; flex: none; }
.marque-mot {
  font-family: var(--police-titre); font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em;
  white-space: nowrap; line-height: 1;
}
.marque-mot em { font-style: normal; color: var(--neon); }

.choix-langue { display: inline-flex; border: 1px solid #3A3A55; }
.choix-langue button {
  background: transparent; color: #A6A3B8; border: 0; padding: 6px 9px; cursor: pointer;
  font-family: var(--police-etiquette); font-weight: 700; font-size: .85rem; letter-spacing: .06em;
}
.choix-langue button[aria-pressed="true"] { background: #F5F4FA; color: var(--nuit); }

/* ---------------- mise en page ---------------- */

.page { max-width: 1100px; margin: 0 auto; padding: 24px var(--gouttiere) 64px; }
.page-etroite { max-width: 480px; }
.rangee { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rangee-fin { margin-left: auto; }
.pile > * + * { margin-top: 14px; }

.carte {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r);
  padding: 20px;
}

/* ---------------- boutons ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  font: 700 1rem/1 var(--police-etiquette); text-transform: uppercase; letter-spacing: .06em;
  border: 2px solid var(--bord); background: var(--surface); color: var(--texte);
  border-radius: var(--r); cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--texte-doux); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, .choix-langue button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--cyan); outline-offset: 2px;
}
.btn-principal { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.btn-principal:hover { background: #B80F5E; border-color: #B80F5E; }
.btn-fantome { background: transparent; }
.btn-danger { color: var(--danger); }
.btn-plein { width: 100%; }
.btn-grand { min-height: 56px; font-size: 1.15rem; }
.btn-petit { min-height: 36px; padding: 6px 12px; font-size: .9rem; }

/* ---------------- formulaires ---------------- */

.champ { display: block; }
.champ > span { display: block; margin-bottom: 6px; }
.champ small { display: block; margin-top: 4px; color: var(--texte-doux); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  font: 400 1rem var(--police); color: var(--texte);
  background: var(--surface); border: 2px solid var(--bord); border-radius: var(--r);
}
textarea { min-height: 84px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--texte-doux); opacity: .8; }

.avis { padding: 12px 14px; border-left: 4px solid var(--accent); background: var(--accent-doux); }
.avis-succes { border-color: var(--succes); background: var(--succes-doux); }
.erreur { color: var(--danger); font-weight: 600; margin: 0; }

/* ---------------- tableau de bord DJ ---------------- */

.grille-evenements { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.carte-evenement {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--bord); padding: 16px;
  border-top: 4px solid var(--bord);
}
.carte-evenement.ouvert { border-top-color: var(--neon); }
.carte-evenement:hover { border-color: var(--texte-doux); }
.carte-evenement h2 { font-size: 1.1rem; margin: 6px 0; word-break: break-word; }
.code {
  font-family: var(--police-titre); font-weight: 700; letter-spacing: .12em;
}
.pastille {
  display: inline-block; padding: 2px 8px; font: 700 .75rem/1.4 var(--police-etiquette);
  text-transform: uppercase; letter-spacing: .08em; background: var(--surface-2); color: var(--texte-doux);
}
.pastille-vive { background: var(--accent); color: #FFFFFF; }
.pastille-ok { background: var(--succes-doux); color: var(--succes); }

/* En-tête d'un événement : nom, état, commandes. */
.entete-ev { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.entete-ev h1 { margin: 0; word-break: break-word; }
.compteurs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 18px; }
.compteur { background: var(--surface); border: 1px solid var(--bord); padding: 8px 14px; min-width: 96px; }
.compteur b { display: block; font: 800 1.6rem/1 var(--police-titre); }
.compteur.vif b { color: var(--accent-lien); }

.bascule {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  font: 700 .95rem var(--police-etiquette); text-transform: uppercase; letter-spacing: .06em;
}
.bascule input { width: 22px; height: 22px; accent-color: var(--accent); }

.section-demandes { margin-top: 28px; }
.section-demandes > header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.section-demandes > header h2 { margin: 0; }
.nb { font: 800 1rem var(--police-titre); color: var(--texte-doux); }

.liste-demandes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.demande {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--bord); border-left: 4px solid var(--bord);
  padding: 10px;
}
.demande.epinglee { border-left-color: var(--neon); background: var(--accent-doux); }
.demande.nouvelle { animation: arrivee 1.6s ease-out; }
@keyframes arrivee { from { box-shadow: inset 0 0 0 3px var(--cyan); } to { box-shadow: inset 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { .demande.nouvelle { animation: none; } }
.pochette {
  width: 64px; height: 64px; object-fit: cover; background: var(--nuit-2); display: block;
}
.pochette-vide { display: grid; place-items: center; }
.pochette-vide img { width: 40px; height: 40px; opacity: .8; }
.demande-texte { min-width: 0; }
.demande-titre { font-weight: 700; font-size: 1.1rem; line-height: 1.2; word-break: break-word; }
.demande-artiste { color: var(--texte-doux); }
.demande-message { margin-top: 4px; font-style: italic; word-break: break-word; }
.demande-heure { font-size: .8rem; color: var(--texte-doux); }
.demande-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.demande-actions .btn { min-height: 48px; min-width: 48px; padding: 8px 12px; }
.btn-jouer { background: var(--succes-doux); border-color: var(--succes); color: var(--succes); }
.btn-epingle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #FFF; }
.section-jouees .demande, .section-rejetees .demande { opacity: .85; }
.section-rejetees .demande-titre { text-decoration: line-through; text-decoration-thickness: 1px; }

@media (max-width: 640px) {
  .demande { grid-template-columns: 52px 1fr; }
  .pochette { width: 52px; height: 52px; }
  .demande-actions { grid-column: 1 / -1; justify-content: stretch; }
  .demande-actions .btn { flex: 1; }
}

details.repli > summary { cursor: pointer; list-style: none; }
details.repli > summary::-webkit-details-marker { display: none; }
details.repli > summary h2::after { content: ' ▾'; font-size: .8em; color: var(--texte-doux); }
details.repli:not([open]) > summary h2::after { content: ' ▸'; }

.vide { padding: 28px 16px; text-align: center; color: var(--texte-doux); border: 1px dashed var(--bord); }

/* Fenêtre (réglages, nouvel événement) : <dialog> natif. */
dialog {
  border: 1px solid var(--bord); border-top: 4px solid var(--neon); border-radius: var(--r);
  background: var(--surface); color: var(--texte); padding: 22px; width: min(480px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(5, 5, 10, .7); }

/* ---------------- page invité ---------------- */

.invite { min-height: 100svh; display: flex; flex-direction: column; }
.invite-tete { background: var(--nuit); color: #F5F4FA; padding: 22px var(--gouttiere) 26px; text-align: center; border-bottom: 2px solid var(--neon); }
.invite-tete .marque { justify-content: center; margin-bottom: 14px; }
.invite-tete h1 { margin: 0; word-break: break-word; }
.invite-tete .dj { color: #FF6FB0; font: 700 1rem var(--police-etiquette); text-transform: uppercase; letter-spacing: .1em; }

.suggestions { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--bord); background: var(--surface); max-height: 360px; overflow-y: auto; }
.suggestions li button {
  display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: center; width: 100%;
  text-align: left; padding: 8px; background: transparent; border: 0; border-bottom: 1px solid var(--bord);
  color: var(--texte); font: inherit; cursor: pointer;
}
.suggestions li button:hover, .suggestions li button:focus-visible { background: var(--surface-2); }
.suggestions img { width: 48px; height: 48px; object-fit: cover; background: var(--nuit-2); }
.suggestions .t { font-weight: 700; display: block; line-height: 1.2; }
.suggestions .a { color: var(--texte-doux); font-size: .9rem; }

.choix-chanson {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center;
  border: 2px solid var(--neon); padding: 8px; background: var(--surface);
}
.compte-rebours { font: 800 3rem/1 var(--police-titre); color: var(--accent-lien); text-align: center; margin: 12px 0; }

/* ---------------- administration ---------------- */

.tuiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 20px; }
.tuile { background: var(--surface); border: 1px solid var(--bord); padding: 12px 14px; }
.tuile b { display: block; font: 800 1.5rem/1.1 var(--police-titre); margin-top: 4px; }
.liste-admin { display: grid; gap: 8px; }
.ligne-admin { background: var(--surface); border: 1px solid var(--bord); padding: 14px; display: grid; gap: 8px; }
.ligne-admin.inactif { opacity: .6; }
.ligne-admin .nom { font-weight: 700; font-size: 1.05rem; }

/* ---------------- pied de page ---------------- */

.pied { border-top: 1px solid var(--bord); padding: 24px var(--gouttiere); text-align: center; color: var(--texte-doux); font-size: .9rem; }
.pied a { color: var(--texte-doux); }

/* Événement archivé : même carte, en retrait. */
.carte-evenement.archive { opacity: .7; border-top-style: dashed; }
