/* Le Père Noël secret — styles communs (SPEC §14) : gros caractères, contrastes AA, thème sombre. */
:root {
  --fond: #fbf8f3;
  --carte: #ffffff;
  --texte: #1f1d1a;
  --doux: #5c564d;
  --accent: #a3192b;
  --accent-texte: #ffffff;
  --vert: #1d6b3f;
  --bord: #d9d2c5;
  --alerte: #8a5a00;
  --alerte-fond: #fff4dc;
  --erreur: #a3192b;
  --rayon: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #16130f;
    --carte: #221e19;
    --texte: #f3eee6;
    --doux: #c2b9ab;
    --accent: #e0566a;
    --accent-texte: #16130f;
    --vert: #6fcf97;
    --bord: #4a433a;
    --alerte: #ffd27a;
    --alerte-fond: #3a2e14;
    --erreur: #ff8a99;
  }
}
* {
  box-sizing: border-box;
}
html {
  font-size: 112.5%;
}
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  line-height: 1.5;
}
main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}
main.large {
  max-width: 60rem;
}
h1 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0.5rem 0 0.25rem;
}
h2 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.5rem;
}
p {
  margin: 0.5rem 0;
}
a {
  color: var(--accent);
}
.doux {
  color: var(--doux);
}
.carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 1rem 1.1rem;
  margin: 1rem 0;
}
.entete {
  text-align: center;
}
.entete .sapin {
  font-size: 2.5rem;
}
label {
  display: block;
  font-weight: 600;
  margin: 1rem 0 0.3rem;
}
.aide {
  font-size: 0.9rem;
  color: var(--doux);
  margin: 0.2rem 0 0;
}
input,
textarea,
select {
  width: 100%;
  font: inherit;
  padding: 0.7rem 0.8rem;
  min-height: 48px;
  border: 2px solid var(--bord);
  border-radius: 10px;
  background: var(--carte);
  color: var(--texte);
}
textarea {
  min-height: 5rem;
  resize: vertical;
}
input:focus,
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
button,
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  border: 2px solid var(--accent);
  background: var(--carte);
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}
button.principal,
.bouton.principal {
  background: var(--accent);
  color: var(--accent-texte);
}
button.grand {
  width: 100%;
  font-size: 1.2rem;
  min-height: 64px;
  margin-top: 1rem;
}
button.lien {
  border: none;
  background: none;
  padding: 0.3rem;
  min-height: 0;
  text-decoration: underline;
  font-weight: 400;
  color: var(--doux);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}
.message {
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin: 1rem 0;
}
.message.erreur {
  background: var(--alerte-fond);
  color: var(--erreur);
  font-weight: 600;
}
.message.info {
  background: var(--alerte-fond);
  color: var(--alerte);
}
.message.ok {
  color: var(--vert);
  font-weight: 600;
}
.receveur {
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
  margin: 0.5rem 0;
  overflow-wrap: anywhere;
}
.centre {
  text-align: center;
}
.liste {
  list-style: none;
  padding: 0;
  margin: 0;
}
.liste li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--bord);
}
.liste li:last-child {
  border-bottom: none;
}
.pastille {
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--bord);
  color: var(--doux);
}
.pastille.drawn,
.pastille.archived {
  color: var(--vert);
  border-color: var(--vert);
}
.pastille.open {
  color: var(--accent);
  border-color: var(--accent);
}
.qr {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0.5rem auto;
  background: #fff;
  border-radius: 8px;
}
.secret {
  font-family: ui-monospace, monospace;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}
dialog {
  border: none;
  border-radius: var(--rayon);
  max-width: min(30rem, 92vw);
  background: var(--carte);
  color: var(--texte);
  padding: 1.2rem;
}
dialog::backdrop {
  background: rgb(0 0 0 / 55%);
}
footer {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--doux);
  text-align: center;
}
.plein-ecran {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 2vh;
}
.plein-ecran img {
  width: min(80vh, 90vw);
  height: auto;
}
.plein-ecran p {
  color: #000;
  font-size: 2rem;
  margin: 1rem;
  text-align: center;
}
.cache,
[hidden] {
  display: none !important;
}
.impression {
  display: none;
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
  body.imprime main,
  body.imprime footer {
    display: none;
  }
  body.imprime .impression {
    display: block;
  }
  .affiche {
    text-align: center;
    padding-top: 2cm;
  }
  .affiche h1 {
    font-size: 32pt;
  }
  .affiche img {
    width: 12cm;
    height: 12cm;
  }
  .affiche p {
    font-size: 16pt;
  }
  .cartes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }
  .cartes .fiche {
    height: 13.5cm;
    border: 1px dashed #999;
    display: grid;
    grid-template-rows: 1fr 1fr;
    page-break-inside: avoid;
  }
  .fiche .dehors,
  .fiche .dedans {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5cm;
  }
  .fiche .dedans {
    transform: rotate(180deg);
    border-top: 1px dotted #999;
  }
  .fiche .nom {
    font-size: 22pt;
    font-weight: 800;
  }
}
