:root {
  --fond: #121016;
  --fond-2: #1b1820;
  --or: #d4af37;
  --or-clair: #e8c05a;
  --jaune: #f5d33f;
  --blanc: #f3efe6;
  --gris: #a29d94;
  --rouge: #ff8a7a;
  --rayon: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% -10%, #2a2330 0%, var(--fond) 60%) fixed, var(--fond);
  color: var(--blanc);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--or-clair); }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- Barre du haut ---------- */
.barre {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; max-width: 860px; margin: 0 auto;
}
.logo img { height: 40px; width: auto; display: block; }
.bouton-icone {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid rgba(212, 175, 55, .45); color: var(--or-clair); cursor: pointer;
}
.bouton-icone svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.bouton-icone:hover, .bouton-icone[aria-expanded="true"] { background: rgba(212, 175, 55, .15); }

.recherche { max-width: 860px; margin: 0 auto; padding: 0 16px 8px; }
.recherche input {
  width: 100%; padding: 12px 16px; font-size: 16px; border-radius: 999px;
  background: var(--fond-2); color: var(--blanc); border: 1px solid var(--or);
}

/* ---------- Accueil ---------- */
.accueil { text-align: center; padding: 8px 16px 28px; max-width: 860px; margin: 0 auto; }
.accueil h1 { margin: 0; }
.titre { width: min(560px, 92%); height: auto; display: block; margin: 0 auto; }
.sous-titre { margin: 18px 0 2px; font-size: 1.15rem; font-style: italic; color: var(--blanc); }
.accroche { margin: 0; color: var(--gris); }
.invitation { margin: 26px 0 12px; color: var(--or-clair); }

.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.bouton {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 10px 22px; border-radius: 999px;
  font: inherit; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--blanc); border: 1px solid rgba(243, 239, 230, .35);
}
.bouton:hover { border-color: var(--blanc); }
.bouton-or { border: 1.5px solid var(--or); color: var(--or-clair); box-shadow: 0 0 0 1px rgba(212, 175, 55, .12) inset; }
.bouton-or:hover { background: rgba(212, 175, 55, .12); border-color: var(--or-clair); }
.bouton:disabled { opacity: .5; cursor: wait; }
.large { width: 100%; }

/* ---------- Le tableau doré ---------- */
.tableau {
  width: calc(100% - 32px); max-width: 860px; margin: 0 auto 40px;
  border: 1.5px solid var(--or); border-radius: var(--rayon);
  background: rgba(18, 16, 22, .7);
}
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { border-bottom: 1px solid rgba(212, 175, 55, .35); }
.liste li:last-child { border-bottom: 0; }
.ligne {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 16px 18px; background: transparent; border: 0; font: inherit; color: inherit;
}
.ligne:hover, .ligne:focus-visible { background: rgba(212, 175, 55, .08); }
.ligne .texte { display: block; color: var(--jaune); font-size: 1.08rem; font-weight: 600; white-space: pre-line; }
.ligne .auteur { display: block; margin-top: 4px; color: var(--blanc); font-size: .9rem; opacity: .9; }
.etat, .vide { margin: 0; padding: 16px 18px; color: var(--gris); text-align: center; }
.plus { display: flex; margin: 12px auto 16px; }
mark { background: rgba(212, 175, 55, .3); color: inherit; border-radius: 3px; }

/* ---------- Fenêtres ---------- */
.fenetre {
  width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px);
  padding: 28px 20px 22px; border-radius: var(--rayon);
  background: var(--fond-2); color: var(--blanc); border: 1.5px solid var(--or);
}
.fenetre::backdrop { background: rgba(0, 0, 0, .72); }
.fenetre h2 { margin: 0 0 12px; color: var(--or-clair); font-size: 1.3rem; padding-right: 36px; }
.fermer {
  position: absolute; top: 8px; right: 10px; width: 40px; height: 40px;
  background: transparent; border: 0; color: var(--gris); font-size: 28px; line-height: 1; cursor: pointer;
}
.fermer:hover { color: var(--blanc); }

.grande { margin: 8px 0 14px; color: var(--jaune); font-size: 1.5rem; font-weight: 700; line-height: 1.35; white-space: pre-line; }
.signature { margin: 0 0 12px; color: var(--blanc); }
.signature a { color: var(--blanc); font-weight: 600; text-decoration-color: var(--or); }
.liens-auteur { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.liens-auteur a {
  display: inline-block; padding: 6px 12px; border-radius: 999px; text-decoration: none;
  border: 1px solid rgba(212, 175, 55, .55); color: var(--or-clair); font-size: .9rem;
}
.liens-auteur a:hover { background: rgba(212, 175, 55, .12); }
.seule .actions { justify-content: flex-start; }

/* ---------- Formulaire ---------- */
form label { display: block; margin: 14px 0 6px; font-weight: 600; }
form input, form textarea {
  width: 100%; padding: 11px 12px; font: inherit; font-size: 16px;
  background: var(--fond); color: var(--blanc); border: 1px solid rgba(243, 239, 230, .25); border-radius: 10px;
}
form input:focus, form textarea:focus { outline: 2px solid var(--or); outline-offset: 1px; border-color: transparent; }
form textarea { resize: vertical; min-height: 110px; }
.aide { margin: 6px 0 0; color: var(--gris); font-size: .88rem; }
.compteur { text-align: right; }
.liens-form { margin: 16px 0 4px; }
.liens-form summary { cursor: pointer; color: var(--or-clair); font-weight: 600; }
.lien-ligne { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 8px; margin-top: 8px; }
.lien-ligne label { margin: 0; font-weight: 400; color: var(--gris); }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.erreur { margin: 12px 0 0; color: var(--rouge); }
#f-envoyer { margin-top: 16px; }
.merci { text-align: center; }

/* ---------- Pied de page ---------- */
.pied { text-align: center; padding: 8px 16px 32px; color: var(--gris); font-size: .9rem; }
.pied a { color: var(--gris); }
.icones { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.bmc-button {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gris); border: 1px solid rgba(162, 157, 148, .35);
}
.bmc-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bmc-button:hover { color: var(--or-clair); border-color: var(--or); }

@media (max-width: 480px) {
  .grande { font-size: 1.3rem; }
  .ligne { padding: 14px 14px; }
  .logo img { height: 34px; }
}

@media (prefers-reduced-motion: no-preference) {
  .fenetre[open] { animation: monter .18s ease-out; }
  @keyframes monter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* ---------- Pages de texte (mentions) ---------- */
.doc { width: calc(100% - 32px); max-width: 720px; margin: 0 auto 48px; }
.doc h1 { color: var(--or-clair); font-size: 1.6rem; }
.doc h2 { color: var(--or-clair); font-size: 1.15rem; margin-top: 28px; }
.doc p, .doc li { color: var(--blanc); }
