/* Secret Santa — même charte que Communes en commun et Stations en commun. */

@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/barlow-condensed-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --rouge: #c8102e;
  --rouge-fonce: #9e0c24;
  --rouge-pale: #fbe9ec;
  --fond: #f4f2ee;
  --carte: #ffffff;
  --texte: #1d1d1f;
  --discret: #6b6b70;
  --bord: #dcd8d0;
  --champ: #ffffff;
  --vert: #1f7a4a;
  --ombre: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .05);
  --titre: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", "DejaVu Sans Condensed", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --rouge: #e5384f;
    --rouge-fonce: #ff6b7d;
    --rouge-pale: #3a1820;
    --fond: #141416;
    --carte: #1e1e21;
    --texte: #ececee;
    --discret: #a0a0a8;
    --bord: #37373c;
    --champ: #26262a;
    --vert: #4cc38a;
    --ombre: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  border-top: 4px solid var(--rouge);
  min-height: 100vh;
}
a { color: var(--rouge); }
a:hover { color: var(--rouge-fonce); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- En-tête */

.barre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 16px 0;
}
.marque {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--titre);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--texte);
  text-decoration: none;
}
.marque:hover { color: var(--rouge); }
.ruban {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background:
    linear-gradient(var(--carte), var(--carte)) center / 4px 100% no-repeat,
    linear-gradient(var(--carte), var(--carte)) center / 100% 4px no-repeat,
    var(--rouge);
  flex: none;
}
.langues { display: flex; gap: 4px; }
.langues a {
  font-family: var(--titre);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .04em;
  text-decoration: none;
  color: var(--discret);
  padding: 2px 9px;
  border: 1px solid var(--bord);
  border-radius: 999px;
}
.langues a[aria-current] { color: #fff; background: var(--rouge); border-color: var(--rouge); }
.langues a:not([aria-current]):hover { color: var(--rouge); border-color: var(--rouge); }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px 48px;
}

/* ---------------------------------------------------------------- Titres et blocs */

h1, h2 {
  font-family: var(--titre);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .01em;
}
h1 { font-size: 2.3rem; margin: 18px 0 8px; text-transform: uppercase; }
h2 { font-size: 1.45rem; margin: 0 0 8px; }

.carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 12px;
  box-shadow: var(--ombre);
  padding: 20px;
  margin: 16px 0;
}
.carte > :last-child { margin-bottom: 0; }
.chapeau { font-size: 1.1rem; margin: 0 0 10px; }
.etapes { margin: 0 0 8px; padding-left: 1.3em; color: var(--discret); }
.etapes li { margin: 4px 0; }
.discret, .aide { color: var(--discret); font-size: .92rem; }
.aide { display: block; margin: 0 0 6px; }
.centre { text-align: center; }
.facultatif { font-family: system-ui, sans-serif; font-weight: 400; font-size: .8rem; color: var(--discret); text-transform: none; letter-spacing: 0; }

.erreur {
  color: var(--rouge-fonce);
  background: var(--rouge-pale);
  border-left: 4px solid var(--rouge);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0 0 14px;
}
.avertissement {
  border-left: 4px solid var(--rouge);
  padding: 2px 0 2px 12px;
}

/* ---------------------------------------------------------------- Formulaires */

.champ { display: block; margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.etiquette {
  display: block;
  font-family: var(--titre);
  font-weight: 600;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin: 0 0 4px;
  padding: 0;
}
input[type=text], input[type=date], textarea, select {
  width: 100%;
  font: inherit;
  color: var(--texte);
  background: var(--champ);
  border: 1px solid var(--bord);
  border-radius: 8px;
  padding: 9px 11px;
  min-width: 0;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--rouge);
  outline-offset: 1px;
}
.compte { display: block; margin-top: 4px; color: var(--discret); font-size: .9rem; min-height: 1.3em; }
.rangee { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  padding: 9px 16px;
  border: 1px solid var(--bord);
  background: var(--champ);
  color: var(--texte);
}
button:disabled { opacity: .55; cursor: default; }
button.principal {
  display: block;
  width: 100%;
  font-family: var(--titre);
  font-weight: 700;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #fff;
  background: var(--rouge);
  border-color: var(--rouge);
  padding: 11px 18px;
  margin: 8px 0 6px;
}
button.principal:not(:disabled):hover { background: var(--rouge-fonce); border-color: var(--rouge-fonce); }
button.secondaire:not(:disabled):hover { border-color: var(--rouge); color: var(--rouge); }
button.fait { color: var(--vert); border-color: var(--vert); }
.lien-bouton {
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--rouge);
  text-decoration: underline;
  font-size: .92rem;
}

.exclusions { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; }
.exclusion {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto auto;
  align-items: center;
  gap: 8px;
}
.exclusion .lien-mot { color: var(--discret); font-size: .9rem; white-space: nowrap; }
.exclusion .case { font-size: .9rem; color: var(--discret); white-space: nowrap; }
.exclusion .retirer {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--discret);
}
.exclusion .retirer:hover { color: var(--rouge); border-color: var(--rouge); }

/* ---------------------------------------------------------------- Santa : en-tête, infos */

.entete-santa h1 { margin-bottom: 4px; overflow-wrap: anywhere; }
.infos { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 6px 0; }
.infos div { display: flex; gap: 6px; }
.infos dt { color: var(--discret); }
.infos dt::after { content: " :"; }
html[lang=en] .infos dt::after { content: ":"; }
.infos dd { margin: 0; font-weight: 600; }
.note {
  margin: 10px 0 0;
  padding: 10px 14px;
  background: var(--carte);
  border: 1px dashed var(--bord);
  border-radius: 10px;
}
.note-titre { margin: 0 0 2px; color: var(--discret); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.note-texte { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- Organisateur */

.liens { list-style: none; margin: 14px 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.lien-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.lien-nom { font-family: var(--titre); font-weight: 700; font-size: 1.25rem; overflow-wrap: anywhere; }
.lien-statut { color: var(--discret); font-size: .88rem; white-space: nowrap; }
.lien.ouvert .lien-statut { color: var(--vert); }
.lien.ouvert .url { color: var(--discret); text-decoration: line-through; }
.lien-ligne { display: flex; gap: 8px; }
.lien-ligne .url { flex: 1; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85rem; }
.lien-ligne button { flex: none; }

/* ---------------------------------------------------------------- Administration du Secret Santa */

.garde { border-color: var(--rouge); }
.entete-santa .modifier { margin-top: 10px; padding: 5px 14px; font-size: .92rem; }
.entete-santa .succes { margin: 12px 0 0; }
.infos-form .actions .principal { margin: 8px 0; }
.garde h2 { font-size: 1.2rem; margin-bottom: 4px; }
.garde p { margin: 0; }
.pastille {
  display: inline-block;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--rouge);
  color: #fff;
  font-family: system-ui, sans-serif;
  font-size: .75rem;
  font-weight: 600;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.lien.nouveau { padding: 10px; margin: -10px; border-radius: 10px; background: var(--rouge-pale); }
.lien-ajoute { margin: 4px 0 0; font-size: .85rem; }
.succes {
  color: var(--vert);
  border-left: 4px solid var(--vert);
  padding: 2px 0 2px 12px;
  margin: 0 0 14px;
  font-weight: 600;
}
.case-ligne { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.case-ligne input { width: 18px; height: 18px; margin: 0; flex: none; }
.resume { min-height: 1.5em; margin: 0 0 6px; }
.coches { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.coches .case-ligne { font-weight: 400; flex-wrap: wrap; }
.coche-note { font-size: .85rem; }
.attente { border-color: var(--rouge); }
.attente-liste { list-style: none; padding: 0; margin: 10px 0 14px; display: flex; flex-direction: column; gap: 6px; }
.attente-liste li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid var(--bord); border-radius: 8px; }
.attente-liste .attente-nom { font-weight: 600; }
.attente-liste .attente-etat { color: var(--discret); font-size: .9rem; }
.attente-liste li.pret .attente-etat { color: var(--vert); }
.attente .secondaire { margin-bottom: 4px; }

/* ---------------------------------------------------------------- Participant */

.tirage { text-align: center; padding: 26px 20px 30px; border-top: 4px solid var(--rouge); }
.tu-offres { margin: 0 0 6px; color: var(--discret); font-size: 1.05rem; }
.change {
  margin: -6px 0 18px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--rouge-pale);
  color: var(--texte);
  font-size: .95rem;
}
.cible {
  margin: 0;
  font-family: var(--titre);
  font-weight: 700;
  font-size: clamp(2.6rem, 11vw, 4.2rem);
  line-height: 1;
  text-transform: uppercase;
  color: var(--rouge);
  overflow-wrap: anywhere;
}
.attente-titre { font-size: clamp(2rem, 8vw, 2.8rem); color: var(--discret); }
.attente-texte { margin: 14px 0 0; color: var(--discret); }
.devoile .cible { animation: devoile .9s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes devoile {
  from { opacity: 0; transform: scale(.6); letter-spacing: .3em; filter: blur(6px); }
  to { opacity: 1; transform: none; letter-spacing: normal; filter: none; }
}
@media (prefers-reduced-motion: reduce) { .attente-titre { font-size: clamp(2rem, 8vw, 2.8rem); color: var(--discret); }
.attente-texte { margin: 14px 0 0; color: var(--discret); }
.devoile .cible { animation: none; } }

.message-texte {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  margin: 6px 0;
  padding: 10px 14px;
  background: var(--rouge-pale);
  border-radius: 10px;
}
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions .principal { width: auto; margin: 8px 0; }
.actions .statut { margin: 0; }
.permanent.insiste { border-color: var(--rouge); }
.permanent .lien-ligne { margin: 10px 0 4px; }
.confirmer .principal { margin-top: 14px; }
.participants { margin-top: 20px; }

.message-page h1 { font-size: 1.9rem; margin-top: 0; }

/* ---------------------------------------------------------------- Administration */

.admin-santa h2 { overflow-wrap: anywhere; }
.admin-noms { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.admin-noms li { padding: 2px 10px; border: 1px solid var(--bord); border-radius: 999px; font-size: .9rem; }
.admin-noms li.ouvert { border-color: var(--vert); color: var(--vert); }

/* ---------------------------------------------------------------- Téléphone */

@media (max-width: 560px) {
  h1 { font-size: 1.9rem; }
  .carte { padding: 16px; }
  .rangee { grid-template-columns: 1fr; }
  .exclusion {
    grid-template-columns: 1fr 34px;
    grid-template-areas: "a x" "mot mot" "b b" "case case";
    padding: 10px;
    border: 1px solid var(--bord);
    border-radius: 10px;
    gap: 6px;
  }
  .exclusion select:first-of-type { grid-area: a; }
  .exclusion .lien-mot { grid-area: mot; }
  .exclusion select:last-of-type { grid-area: b; }
  .exclusion .case { grid-area: case; }
  .exclusion .retirer { grid-area: x; }
  .lien-tete { flex-direction: column; gap: 0; }
}
