:root {
  --nuit: #0b0d2a;
  --nuit-2: #1a1446;
  --papier: #f4ead5;
  --encre: #2b2140;
  --or: #f5c96a;
  --rose: #ff9ecf;
  --texte: #e9e6ff;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background: radial-gradient(ellipse at top, var(--nuit-2), var(--nuit) 70%);
  color: var(--texte);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
  overflow-x: hidden;
}

#ciel {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.entete, main, footer {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
  pointer-events: none; /* laisse passer les clics vers le ciel */
}

.entete { padding-top: 12vh; text-align: center; }

.guichet {
  display: inline-block;
  font-size: .8rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--or);
  border: 1px dashed var(--or);
  padding: .2rem .8rem;
  border-radius: 999px;
}

h1 {
  font-size: clamp(2.2rem, 7vw, 4rem);
  margin: .4em 0 .2em;
  background: linear-gradient(90deg, var(--or), var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.accroche { font-style: italic; opacity: .85; }

section {
  margin: 3.5rem 0;
  padding: 1.5rem;
  background: rgba(20, 16, 60, .55);
  border: 1px solid rgba(245, 201, 106, .25);
  border-radius: 14px;
  backdrop-filter: blur(4px);
}

section h2 { margin-top: 0; color: var(--or); font-weight: normal; }

button, input, a, dialog, #liste { pointer-events: auto; }

.bouton {
  font: inherit;
  cursor: pointer;
  color: var(--nuit);
  background: var(--or);
  border: 0;
  padding: .6rem 1.2rem;
  border-radius: 999px;
  transition: transform .15s, box-shadow .15s;
}
.bouton:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245, 201, 106, .4); }

#liste { list-style: none; padding: 0; margin: 0; }
#liste li {
  padding: .6rem 0;
  border-bottom: 1px dotted rgba(233, 230, 255, .2);
  animation: arrive .5s ease-out;
}
#liste li:last-child { border-bottom: 0; }
#liste .vide { opacity: .6; font-style: italic; }
#liste .num { color: var(--rose); font-family: monospace; margin-right: .5rem; }

form#formulaire { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
form#formulaire label { width: 100%; }
#souvenir {
  flex: 1 1 220px;
  font: inherit;
  padding: .6rem .9rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 201, 106, .4);
  background: rgba(0, 0, 0, .3);
  color: var(--texte);
}
.reponse { min-height: 1.6em; color: var(--rose); font-style: italic; }

/* L'étiquette : un vieux ticket de consigne */
dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(420px, calc(100% - 32px));
}
dialog::backdrop { background: rgba(5, 5, 20, .7); backdrop-filter: blur(3px); }
dialog article {
  background: var(--papier);
  color: var(--encre);
  padding: 1.6rem 1.6rem 1.2rem;
  border-radius: 6px;
  transform: rotate(-1.5deg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  position: relative;
}
dialog article::before { /* trou de l'étiquette */
  content: "";
  position: absolute;
  top: 14px; right: 14px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--nuit);
}
dialog[open] article { animation: tombe .4s ease-out; }
.numero { font-family: monospace; font-size: .85rem; margin: 0; opacity: .7; }
dialog h3 { margin: .3rem 0 1rem; font-size: 1.4rem; }
dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: 0 0 1rem; }
dt { font-weight: bold; }
dd { margin: 0; }
.note { font-style: italic; border-top: 1px dashed var(--encre); padding-top: .8rem; }
dialog .bouton { background: var(--encre); color: var(--papier); }

footer { text-align: center; padding-bottom: 3rem; opacity: .6; font-size: .9rem; }

@keyframes arrive { from { opacity: 0; transform: translateX(-10px); } }
@keyframes tombe { from { opacity: 0; transform: translateY(-30px) rotate(6deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
