:root {
  --primaire: #12264d;
  --bleu: #1d4ed8;
  --accent: #f2b705;
  --fond: #e9f1fa;
  --carte: #ffffff;
  --texte: #12264d;
  --doux: #5a6c8a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--fond);
  color: var(--texte);
}
header { text-align: center; padding: 20px 16px 4px; }
header img.photo {
  display: block;
  width: 100%;
  height: auto; /* photo ENTIÈRE, ratio natif 3:4, aucun recadrage */
  max-width: 420px;
  margin: 0 auto;
  border: 4px solid var(--accent);
  border-radius: 20px;
}
h1 { font-size: 1.55rem; margin: 14px 0 2px; color: var(--primaire); }
.sous-titre { color: var(--doux); margin: 0 0 8px; font-style: italic; }
main { max-width: 640px; margin: 0 auto; padding: 12px 16px 48px; }
.carte {
  background: var(--carte);
  border-radius: 16px;
  padding: 18px;
  margin: 14px 0;
  box-shadow: 0 2px 10px rgba(18, 38, 77, 0.08);
}
button {
  font: inherit;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  cursor: pointer;
  background: var(--primaire);
  color: #fff;
  min-height: 48px;
}
button.accent { background: var(--accent); color: var(--primaire); font-weight: bold; }
button.secondaire { background: #dbe7f7; color: var(--primaire); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.petit { padding: 8px 14px; min-height: 40px; font-size: 0.92rem; }
input, textarea, select {
  font: inherit;
  width: 100%;
  padding: 12px;
  border: 2px solid #c4d5ee;
  border-radius: 12px;
  margin: 6px 0 14px;
  background: #fbfdff;
  color: var(--texte);
}
input[type="color"] { width: 72px; height: 48px; padding: 4px; }
input[type="file"] { border: none; padding: 6px 0; }
label { font-weight: bold; font-size: 0.95rem; }
.aide { color: var(--doux); font-size: 0.9rem; }
.erreur { color: #b3261e; }
.succes { color: #146c2e; }
nav.choix { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.code-geant {
  font-family: "Courier New", monospace;
  font-size: 1.5rem;
  letter-spacing: 1px;
  text-align: center;
  background: #fff8db;
  border: 2px dashed var(--accent);
  border-radius: 12px;
  padding: 14px 8px;
  word-break: break-all;
}
.compte-rebours { font-variant-numeric: tabular-nums; font-weight: bold; color: var(--bleu); }
.sceau {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent); color: var(--primaire);
  font-size: 1.4rem; border: 3px solid var(--primaire);
  flex: none;
}
.ligne-lettre { display: flex; gap: 12px; align-items: center; }
.ligne-lettre .infos { flex: 1; min-width: 0; }
.lecture {
  background: #fffdf4;
  border: 1px solid #eadfae;
  border-radius: 12px;
  padding: 18px;
  white-space: pre-wrap;
  line-height: 1.55;
}
audio { width: 100%; margin: 8px 0; }
/* --- Mini-jeu « smiley à relier » (v3.2) --- */
.smiley-svg { display: block; width: 100%; max-width: 320px; margin: 6px auto; touch-action: manipulation; }
.smiley-svg .trait { stroke: var(--primaire); stroke-width: 3.5; fill: none; stroke-linecap: round; }
.smiley-svg .point-pastille { fill: #ffffff; stroke: var(--primaire); stroke-width: 2.5; }
.smiley-svg .point-groupe.fait .point-pastille { fill: var(--accent); }
.smiley-svg .point-groupe.oeil.fait .point-pastille { fill: var(--primaire); }
.smiley-svg .point-groupe.oeil.fait .point-numero { fill: var(--accent); }
.smiley-svg .point-numero {
  fill: var(--primaire); font-family: Georgia, "Times New Roman", serif;
  font-size: 10px; font-weight: bold; text-anchor: middle; pointer-events: none;
}
.smiley-svg .point-groupe { cursor: pointer; transform-box: fill-box; }
.smiley-svg .point-groupe.tremble { animation: jeu-tremble 0.4s ease; }
@keyframes jeu-tremble {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
#jeu-smiley.celebre .smiley-svg { animation: jeu-celebre 0.85s ease; }
@keyframes jeu-celebre {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(242, 183, 5, 0)); }
  45% { transform: scale(1.05); filter: drop-shadow(0 0 14px rgba(242, 183, 5, 0.95)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 5px rgba(242, 183, 5, 0.55)); }
}
.cache { display: none !important; }
.grille-boutons { display: flex; gap: 10px; flex-wrap: wrap; }
#btn-install { margin: 8px auto; display: block; }
h2 { margin-top: 0; font-size: 1.25rem; }
h3 { margin-bottom: 6px; }
