/* Taddart · identité « Émaux de Beni Yenni » : thème clair, le blanc argenté des bijoux kabyles et leurs émaux
   (bleu, vert, jaune, corail), avec les motifs de la poterie et des tapis (frise de triangles, losanges). */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('polices/bricolage-grotesque-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('polices/bricolage-grotesque-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Noto Sans Tifinagh';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('polices/noto-sans-tifinagh.woff2') format('woff2');
  unicode-range: U+02C7, U+0301-0302, U+0304, U+0306-0309, U+0323, U+0331, U+200C-200D, U+202E, U+25CC, U+2D30-2D7F;
}

:root {
  /* Fonds et surfaces : l'argent des bijoux. */
  --fond: #f6f3ec;
  --surface: #ffffff;
  --surface-2: #efe9dd;
  --bordure: #e6dfd2;
  --bordure-forte: #d6ccb9;
  /* Encres. */
  --encre: #1e2433;
  --encre-2: #3d4456;
  --doux: #5d6475;
  --eteint: #8c909b;
  /* Émaux. */
  --bleu: #1f5fa8;
  --vert: #2e8b57;
  --jaune: #e6b022;
  --orange: #ea8a2e;
  --corail: #d4472c;
  --sur-email: #ffffff;
  --rayon-carte: 12px;
  --rayon-tuile: 4px 4px 16px 16px;
  --court: 150ms;
  --moyen: 250ms;
  --police: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --dents: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='6'><path d='M0 6 L6 0 L12 6Z' fill='%23d4472c'/></svg>");
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--encre);
  font: 600 15px/1.45 var(--police);
  background:
    radial-gradient(120% 40% at 50% 0%, rgba(31, 95, 168, 0.07), transparent 60%) no-repeat,
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28'><path d='M14 2 L26 14 L14 26 L2 14Z' fill='none' stroke='%231e2433' stroke-opacity='.045' stroke-width='1'/></svg>"),
    var(--fond);
}

a { color: var(--bleu); }
button { font: inherit; color: inherit; }
.tifinagh { font-family: 'Noto Sans Tifinagh', var(--police); font-weight: 400; }
/* Bricolage Grotesque n'a pas les lettres kabyles (ɛ, ɣ, ḍ, ṭ, ẓ, ḥ…) : les noms kabyles s'affichent d'un bloc
   dans la police du système, qui les couvre, plutôt que lettre par lettre dans une police de secours. */
.kabyle { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif; }
[hidden] { display: none !important; }
.definitions { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ─── Motifs ─────────────────────────────────────────────────────────────── */

/* Frise de triangles aux quatre émaux, avec un petit creux d'argent au centre. */
.frise {
  position: relative;
  height: 22px;
  overflow: hidden;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='88' height='22'><path d='M0 22 L11 6 L22 22 Z' fill='%231f5fa8'/><path d='M22 22 L33 6 L44 22 Z' fill='%232e8b57'/><path d='M44 22 L55 6 L66 22 Z' fill='%23e6b022'/><path d='M66 22 L77 6 L88 22 Z' fill='%23d4472c'/><path d='M8 22 L11 16 L14 22Z M30 22 L33 16 L36 22Z M52 22 L55 16 L58 22Z M74 22 L77 16 L80 22Z' fill='%23f6f3ec'/></svg>") repeat-x;
}
/* À l'ouverture, la frise se dessine de gauche à droite. */
.frise::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--fond);
  animation: frise-ouverture 450ms ease-out 80ms forwards;
}
@keyframes frise-ouverture { to { transform: translateX(100%); } }

.frise-petite {
  height: 18px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='72' height='18'><path d='M0 18 L9 5 L18 18 Z' fill='%231f5fa8'/><path d='M18 18 L27 5 L36 18 Z' fill='%232e8b57'/><path d='M36 18 L45 5 L54 18 Z' fill='%23e6b022'/><path d='M54 18 L63 5 L72 18 Z' fill='%23d4472c'/></svg>") repeat-x;
}
.frise-petite::after { display: none; }

/* Tuile de poterie : coins inégaux et rangée de petits triangles corail en bas. */
.tuile {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--rayon-tuile);
  box-shadow: inset 0 0 0 1px var(--bordure), 0 1px 2px rgba(30, 36, 51, 0.04);
}
.tuile::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: var(--dents) repeat-x;
  pointer-events: none;
}

/* Étiquette en capitales suivie d'une ligne de losanges. */
.etiquette {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font: 700 10.5px/1.2 var(--police);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--doux);
}
.etiquette::after {
  content: '';
  flex: 1;
  height: 8px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='8'><path d='M0 4 L5 0 L10 4 L5 8Z' fill='none' stroke='%235d6475' stroke-width='1.1'/></svg>") repeat-x center;
  opacity: 0.35;
}

/* ─── Mise en page ───────────────────────────────────────────────────────── */

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Sur téléphone, les colonnes s'effacent : leurs éléments se suivent dans la page. */
.colonne { display: contents; }

.entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.surtitre { margin: 0 0 2px; font: 700 11px/1.3 var(--police); letter-spacing: 0.1em; text-transform: uppercase; color: var(--doux); white-space: nowrap; }
.surtitre .tifinagh { font-size: 15px; letter-spacing: 0.05em; color: var(--bleu); text-transform: none; }
h1 { margin: 0; font: 800 36px/1 var(--police); letter-spacing: -0.035em; }
h1 .numero { color: var(--corail); }
.entete-actions { display: flex; gap: 0; margin-right: -4px; }

/* Bouton en losange (accueil, aide, statistiques). */
.losange-bouton {
  position: relative;
  isolation: isolate;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--encre-2);
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
}
.losange-bouton::before {
  content: '';
  position: absolute;
  inset: 8px;
  z-index: -1;
  transform: rotate(45deg);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--bordure-forte);
  transition: background var(--court);
}
.losange-bouton:hover::before { background: var(--surface-2); }
.losange-bouton svg { width: 20px; height: 20px; }

/* ─── Silhouette ─────────────────────────────────────────────────────────── */

.silhouette { padding: 8px 8px 14px; }
.silhouette svg { display: block; width: 100%; height: auto; }
.silhouette-forme { fill: var(--jaune); }
.silhouette-motif { fill: url(#motif-losanges); }
/* À l'ouverture, la silhouette grandit et son motif se dessine ; ensuite, son halo respire. */
.apparait #silhouette-trace { transform-box: fill-box; transform-origin: center; animation: apparaitre 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes apparaitre { from { opacity: 0; transform: scale(0.92); } }
.apparait .balayage { transform-box: fill-box; transform-origin: 0 0; animation: balayer 900ms ease-out 200ms both; }
@keyframes balayer { from { transform: scaleX(0); } }
.silhouette-halo { fill: var(--lueur); opacity: 0.45; transition: fill 800ms; animation: respirer 3.2s ease-in-out 900ms infinite; }
@keyframes respirer { 50% { opacity: 0.2; } }
/* Le halo se réchauffe avec le meilleur essai. */
#silhouette { --lueur: var(--jaune); }
#silhouette[data-chaleur='chaud'] { --lueur: var(--orange); }
#silhouette[data-chaleur='chaud'] .silhouette-halo { opacity: 0.55; }
#silhouette[data-chaleur='brulant'] { --lueur: var(--corail); }
#silhouette[data-chaleur='brulant'] .silhouette-halo { opacity: 0.6; }
#silhouette[data-chaleur='trouve'] { --lueur: var(--vert); }
#silhouette[data-chaleur='trouve'] .silhouette-halo { opacity: 0.6; }
.chargement {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--doux);
  font-size: 13px;
}
.losange-tournant {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--jaune);
  animation: tourner 1.1s linear infinite;
}
@keyframes tourner { from { transform: rotate(45deg); } to { transform: rotate(405deg); } }
.echelle {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font: 700 10.5px/1 var(--police);
  color: var(--doux);
}
.echelle-barre { display: block; height: 6px; border: 1.5px solid var(--doux); border-top: 0; }

/* ─── Indices ────────────────────────────────────────────────────────────── */

.indices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; perspective: 500px; }
.indice {
  margin: 0;
  min-height: 44px;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--bordure);
  font-size: 12px;
  line-height: 1.3;
  color: var(--doux);
}
.indice b { display: block; font: 700 9.5px/1.4 var(--police); letter-spacing: 0.14em; text-transform: uppercase; color: var(--doux); }
.indice.debloque { box-shadow: inset 0 0 0 1.5px var(--bleu); color: var(--encre); font-weight: 800; font-size: 15px; }
.indice.debloque b { color: var(--bleu); }
/* Verrouillé : un cadenas, puis un petit losange par essai raté à atteindre. */
.verrou { display: flex; align-items: center; gap: 7px; height: 19px; }
.verrou::before {
  content: '';
  width: 11px;
  height: 14px;
  margin-right: 2px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 14'><path d='M2.5 6V4a3 3 0 0 1 6 0v2' fill='none' stroke='%235d6475' stroke-width='1.6'/><rect x='0.5' y='6' width='10' height='7.5' rx='1.5' fill='%235d6475'/></svg>") center / contain no-repeat;
}
.mini-los { width: 7px; height: 7px; transform: rotate(45deg); border-radius: 1px; box-shadow: inset 0 0 0 1.3px var(--bordure-forte); }
.mini-los.rate { background: var(--doux); box-shadow: none; }
/* En s'ouvrant, l'indice bascule vers l'avant, une fois l'essai révélé. */
.indice.bascule { transform-origin: 50% 0; animation: basculer 600ms ease-out 550ms both; }
@keyframes basculer { 0% { transform: rotateX(90deg); } 65% { transform: rotateX(-12deg); } 100% { transform: rotateX(0); } }
.lecteur-seul { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ─── Saisie ─────────────────────────────────────────────────────────────── */

/* « Ta proposition · 2/6 » et les six essais en losanges, colorés selon leur chaleur. */
.saisie-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.saisie-tete .etiquette { display: block; flex: 1; margin: 0; }
.saisie-tete .etiquette::after { display: none; }
.losanges-essais { display: flex; gap: 8px; padding-right: 3px; }
.los { width: 9px; height: 9px; transform: rotate(45deg); border-radius: 1.5px; box-shadow: inset 0 0 0 1.5px var(--bordure-forte); }
.los[class*='chaleur-'] { background: var(--chaleur-plein); box-shadow: none; }
.los.nouveau { animation: remplir 400ms ease-out 500ms both; }
@keyframes remplir { from { background: transparent; box-shadow: inset 0 0 0 1.5px var(--bordure-forte); transform: rotate(45deg) scale(0.5); } }
.champ-boite.tremble { animation: trembler 320ms ease-in-out; }
@keyframes trembler { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.saisie-ligne { display: flex; gap: 8px; align-items: stretch; }
.champ-boite { position: relative; flex: 1; }
#champ {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--bordure-forte);
  color: var(--encre);
  font: 700 16px var(--police);
  outline: none;
  transition: box-shadow var(--court);
}
#champ::placeholder { color: var(--eteint); font-weight: 600; }
#champ:focus { box-shadow: inset 0 0 0 2px var(--bleu), 0 0 0 4px rgba(31, 95, 168, 0.14); }

.suggestions {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--bordure-forte), 0 14px 30px rgba(30, 36, 51, 0.16);
}
.suggestions li {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-height: 44px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}
.suggestions li small { color: var(--doux); font-weight: 600; font-size: 12px; }
.suggestions li[aria-selected='true'], .suggestions li:hover { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--bleu); }
.suggestions li.deja { color: var(--eteint); text-decoration: line-through; text-decoration-color: var(--corail); }

.message { margin: 6px 2px 0; font-size: 13px; color: var(--corail); }
.message:empty { margin: 0; }

/* Bouton principal : émail bleu, rangée de triangles corail au-dessus. */
.bouton-principal, .bouton-secondaire {
  position: relative;
  min-height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font: 800 15px var(--police);
  cursor: pointer;
  transition: transform var(--court), filter var(--court);
}
.bouton-principal { background: var(--bleu); color: var(--sur-email); margin-top: 6px; }
.bouton-principal::before {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  top: -6px;
  height: 6px;
  background: var(--dents) repeat-x;
}
.saisie-ligne .bouton-principal { margin-top: 0; }
.saisie-ligne .bouton-principal::before { display: none; }
.bouton-secondaire { background: var(--surface); color: var(--encre); box-shadow: inset 0 0 0 1.5px var(--bordure-forte); }
.bouton-principal:hover { filter: brightness(1.1); }
.bouton-secondaire:hover { background: var(--surface-2); }
.bouton-principal:active, .bouton-secondaire:active { transform: scale(0.98); }
.bouton-principal:focus-visible, .bouton-secondaire:focus-visible, .losange-bouton:focus-visible, a:focus-visible, .lien:focus-visible {
  outline: 2px solid var(--jaune);
  outline-offset: 3px;
}
.bouton-large { width: 100%; }

/* ─── Essais ─────────────────────────────────────────────────────────────── */

.essais { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.essai, .exemple {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto 28px 54px;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px 0 8px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--bordure);
}
.essai > *, .exemple > * { position: relative; }
/* Barre de chaleur derrière la ligne : sa longueur est la proximité, sa couleur va du bleu (froid) au corail (brûlant). */
.essai-chaleur { position: absolute; top: 0; bottom: 0; left: 0; background: var(--chaleur); }
.chaleur-froid { --chaleur: color-mix(in srgb, var(--bleu) 14%, transparent); --chaleur-texte: var(--bleu); --chaleur-plein: var(--bleu); --chaleur-sur: var(--sur-email); }
.chaleur-tiede { --chaleur: color-mix(in srgb, var(--jaune) 26%, transparent); --chaleur-texte: color-mix(in srgb, var(--jaune) 55%, var(--encre)); --chaleur-plein: var(--jaune); --chaleur-sur: var(--encre); }
.chaleur-chaud { --chaleur: color-mix(in srgb, var(--orange) 28%, transparent); --chaleur-texte: color-mix(in srgb, var(--orange) 70%, var(--encre)); --chaleur-plein: var(--orange); --chaleur-sur: var(--encre); }
.chaleur-brulant { --chaleur: color-mix(in srgb, var(--corail) 34%, transparent); --chaleur-texte: var(--corail); --chaleur-plein: var(--corail); --chaleur-sur: var(--sur-email); }
.chaleur-trouve { --chaleur: transparent; --chaleur-plein: var(--vert); --chaleur-sur: var(--sur-email); }
.essai-nom { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.essai-distance { color: var(--encre-2); font-variant-numeric: tabular-nums; font-size: 14px; white-space: nowrap; }
.essai-prox { color: var(--chaleur-texte, var(--bleu)); font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.essai-rang {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font: 800 11px var(--police);
  color: var(--encre);
}
.essai-rang::before {
  content: '';
  position: absolute;
  inset: 4px;
  z-index: -1;
  transform: rotate(45deg);
  border-radius: 3px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--bordure-forte);
}
.essai.trouve { background: var(--vert); box-shadow: none; color: var(--sur-email); }
.essai.trouve .essai-distance, .essai.trouve .essai-prox { color: var(--sur-email); }
.essai.trouve .essai-rang::before { background: var(--sur-email); box-shadow: none; }
.essai.trouve .essai-rang { color: var(--vert); }
/* Révélation d'un essai : la ligne arrive, la barre se remplit, la flèche part du nord et vise la commune. */
.essai.nouveau { animation: arriver var(--moyen) ease-out; }
@keyframes arriver { from { opacity: 0; transform: translateY(-6px); } }
.essai.nouveau .essai-chaleur { animation: barre 750ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes barre { from { width: 0; } }
.essai.nouveau .fleche { animation: viser 700ms cubic-bezier(0.3, 1.6, 0.5, 1) 100ms both; }
@keyframes viser { from { transform: rotate(0deg); } }

/* Flèche « berbère » : tête en triangle, tournée vers la commune cherchée. */
.fleche {
  width: 24px;
  height: 24px;
  justify-self: center;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2 L19 11 L14.2 11 L14.2 22 L9.8 22 L9.8 11 L5 11 Z' fill='%231e2433'/><path d='M12 6.5 L14.5 9.5 L9.5 9.5Z' fill='%23e6b022'/></svg>") center / contain no-repeat;
  transform: rotate(var(--cap, 0deg));
}
.essai.trouve .fleche {
  transform: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 3 L21 12 L12 21 L3 12Z' fill='%23ffffff'/><path d='M12 8 L16 12 L12 16 L8 12Z' fill='%23e6b022'/></svg>");
}

/* ─── Fin de partie ──────────────────────────────────────────────────────── */

.fin { display: flex; flex-direction: column; gap: 14px; }
.fin-tuile { padding: 16px 16px 22px; }
.fin-tuile p { margin: 0; }
.fin-nom { font: 800 34px/1.05 var(--police); letter-spacing: -0.03em; color: var(--bleu); }
.fin-kabyle { margin-top: 6px !important; font-size: 16px; color: var(--encre-2); }
.fin-kabyle .tifinagh { margin-left: 6px; color: var(--corail); font-size: 17px; }
.fin-details { margin-top: 8px !important; color: var(--doux); font-size: 13px; }
.fin-lien { display: inline-block; margin-top: 10px; font-size: 13px; }
/* Faits sur la commune : petites étiquettes de poterie. */
.fin-faits { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.fin-faits li { padding: 4px 10px; border-radius: 3px 3px 10px 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--bordure); font-size: 12.5px; font-weight: 700; color: var(--encre-2); }
/* La fin de partie arrive en montant, tuile après tuile. */
.fin > * { animation: monter var(--moyen) ease-out both; }
.fin > :nth-child(2) { animation-delay: 90ms; }
.fin > :nth-child(3) { animation-delay: 180ms; }
/* La silhouette révélée à côté du nom : verte si trouvée, jaune sinon. */
.fin-revelation { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.fin-revelation .fin-nom { min-width: 0; font-size: 30px; }
.fin-silhouette { flex: none; width: 72px; height: auto; overflow: visible; }
.fin-forme { fill: var(--vert); }
.fin-halo { fill: var(--vert); opacity: 0.45; }
.fin.perdue .fin-forme, .fin.perdue .fin-halo { fill: var(--jaune); }
.fin.perdue .fin-halo { opacity: 0.35; }

/* « Ton résultat » : l'aperçu de l'image à partager et les chiffres. */
.resultat { display: flex; align-items: center; gap: 14px; padding: 12px 12px 18px; }
.apercu-partage { flex: none; width: 96px; height: 120px; border-radius: 6px; background: var(--fond); box-shadow: 0 0 0 1px var(--bordure-forte); }
.resultat-corps { flex: 1; min-width: 0; }
.resultat-corps .etiquette { margin-bottom: 8px; }
.resultat-chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 8px; }
.resultat-chiffres span { display: block; font: 800 22px/1 var(--police); color: var(--bleu); font-variant-numeric: tabular-nums; }
.resultat-chiffres small { display: block; margin-top: 3px; font: 700 9.5px var(--police); letter-spacing: 0.1em; text-transform: uppercase; color: var(--doux); }
#res-serie::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 7px; vertical-align: 3px; transform: rotate(45deg); background: var(--corail); }
.partage { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.partage .lien { min-height: 32px; font-size: 13px; font-weight: 600; }

.installer { display: flex; flex-direction: column; gap: 8px; }
.installer-ios { margin: 0; font-size: 13px; color: var(--doux); }

/* Célébration de la victoire, par-dessus tout l'écran. */
.celebration { position: fixed; inset: 0; z-index: 20; width: 100%; height: 100%; pointer-events: none; }
.partage-secours {
  width: 100%;
  min-height: 140px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--bleu);
  color: var(--encre);
  font: 600 14px/1.5 var(--police);
}
.rebours-etiquette { margin-bottom: -8px; }
.rebours { margin: 0; font: 800 40px/1 var(--police); letter-spacing: -0.02em; color: var(--bleu); font-variant-numeric: tabular-nums; }
.soutien { margin: 0; font-size: 13px; color: var(--doux); }

/* ─── Carte ──────────────────────────────────────────────────────────────── */

.carte-bloc h2 { margin-bottom: 8px; }
.carte-tuile { padding: 8px 8px 14px; }
#carte, .accueil-carte { display: block; width: 100%; height: auto; }
.carte-wilaya { fill: var(--surface-2); stroke: var(--bordure-forte); stroke-width: 1.2; }
.carte-nom-wilaya {
  fill: var(--doux);
  font: 700 9px var(--police);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-anchor: middle;
  /* Halo d'argent : le nom reste lisible par-dessus une commune colorée. */
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
  stroke-linejoin: round;
}
/* Les communes proposées à leur couleur de chaleur, chacune marquée d'un losange numéroté. */
.carte-essai { fill: var(--chaleur-plein); fill-opacity: 0.75; stroke: var(--surface); stroke-width: 0.7; }
.carte-cible { fill: var(--vert); stroke: var(--surface); stroke-width: 1; }
.carte-cible.ratee { fill: var(--jaune); stroke: var(--encre); stroke-width: 0.6; }
.carte-repere rect { fill: var(--chaleur-plein); stroke: var(--surface); stroke-width: 1.2; }
.carte-repere text { fill: var(--chaleur-sur); font: 800 8.5px var(--police); text-anchor: middle; }
/* Une onde part de la commune cherchée, à la fin. */
.carte-onde { fill: none; stroke: var(--vert); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: onde 1.8s ease-out infinite; }
.carte-onde.ratee { stroke: var(--corail); }
@keyframes onde { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(3.2); opacity: 0; } }

/* ─── Page d'accueil ─────────────────────────────────────────────────────── */

.accueil {
  max-width: 480px;
  margin: 0 auto;
  padding: 26px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.accueil > * { animation: monter 400ms ease-out both; }
.accueil > :nth-child(2) { animation-delay: 80ms; }
.accueil > :nth-child(3) { animation-delay: 160ms; }
.accueil > :nth-child(n + 4) { animation-delay: 240ms; }
.accueil-heros { display: flex; flex-direction: column; align-items: center; text-align: center; }
.accueil-logo { width: 64px; height: 64px; margin-bottom: 14px; }
.accueil-titre { margin: 2px 0 0; font: 800 56px/0.95 var(--police); letter-spacing: -0.045em; }
.accueil-accroche { margin: 10px 0 0; max-width: 30ch; font-size: 16px; line-height: 1.4; color: var(--encre-2); }

.accueil-jour { padding: 14px 14px 20px; display: flex; flex-direction: column; }
.accueil-jour .etiquette { justify-content: space-between; }
.accueil-jour .etiquette::after { display: none; }
.accueil-silhouette { display: block; width: 100%; height: auto; max-height: 190px; margin: 4px 0 8px; overflow: visible; }
.accueil-forme { fill: var(--jaune); }
.accueil-motif { fill: url(#motif-losanges); }
.accueil-halo { fill: var(--jaune); opacity: 0.45; animation: respirer 3.2s ease-in-out infinite; }
.accueil-rebours { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--doux); }
.accueil-rebours b { color: var(--bleu); font-variant-numeric: tabular-nums; }

.accueil-chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.accueil-chiffres div { padding: 10px 6px 12px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--bordure); }
.accueil-chiffres span { display: block; font: 800 24px/1 var(--police); color: var(--bleu); font-variant-numeric: tabular-nums; }
.accueil-chiffres small { display: block; margin-top: 4px; font: 700 9.5px var(--police); letter-spacing: 0.1em; text-transform: uppercase; color: var(--doux); }

.accueil-hier { padding: 14px 14px 20px; }
.hier-corps { display: flex; align-items: center; gap: 14px; }
.hier-silhouette { flex: none; width: 84px; height: auto; overflow: visible; }
.hier-forme { fill: var(--bleu); }
.hier-texte p { margin: 0; }
.hier-nom { font: 800 22px/1.1 var(--police); letter-spacing: -0.02em; color: var(--encre); }
.hier-kabyle { margin-top: 4px !important; font-size: 14px; color: var(--encre-2); }
.hier-kabyle .tifinagh { margin-left: 5px; color: var(--corail); }
.hier-lieu { margin-top: 4px !important; font-size: 12.5px; color: var(--doux); }

/* Les jours passés : une petite tuile par commune, aux émaux en alternance. */
.accueil-passes h2 { margin-bottom: 10px; }
.passes { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.passes li { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 8px 10px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--bordure); text-align: center; }
.passe-silhouette { width: 100%; height: 54px; margin-bottom: 4px; }
.passes li path { fill: var(--bleu); }
.passes li:nth-child(4n + 2) path { fill: var(--vert); }
.passes li:nth-child(4n + 3) path { fill: var(--corail); }
.passes li:nth-child(4n + 4) path { fill: var(--jaune); }
.passes b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.2; }
.passes small { font-size: 10.5px; font-weight: 700; color: var(--doux); }

.accueil-regles h2 { margin-bottom: 10px; }
.etapes { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: etape; }
.etapes li {
  position: relative;
  padding: 12px 14px 12px 50px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--bordure);
  font-size: 14px;
  line-height: 1.4;
  color: var(--encre-2);
  counter-increment: etape;
}
.etapes li b { display: block; color: var(--encre); font-size: 15px; }
/* Le numéro de l'étape dans un losange émaillé. */
.etapes li::before {
  content: counter(etape);
  position: absolute;
  left: 13px;
  top: 14px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font: 800 12px var(--police);
  color: var(--sur-email);
  background: var(--bleu);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.etapes li:nth-child(2)::before { background: var(--vert); }
.etapes li:nth-child(3)::before { background: var(--jaune); color: var(--encre); }
.etapes li:nth-child(4)::before { background: var(--corail); }
.legende-chaleur { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.legende-chaleur span { padding: 2px 8px; border-radius: 3px 3px 8px 8px; font-size: 11.5px; font-weight: 800; background: var(--chaleur-plein); color: var(--chaleur-sur); }

.accueil-kabylie { padding: 14px 14px 20px; }
.accueil-kabylie-chiffres { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin-top: 8px; }
.accueil-kabylie-chiffres span { display: block; font: 800 26px/1 var(--police); color: var(--corail); font-variant-numeric: tabular-nums; }
.accueil-kabylie-chiffres small { display: block; margin-top: 4px; font: 700 9.5px var(--police); letter-spacing: 0.1em; text-transform: uppercase; color: var(--doux); }

.accueil-inviter { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.accueil-inviter p { margin: 0; font-size: 14px; color: var(--encre-2); }

/* ─── Pied de page ───────────────────────────────────────────────────────── */

.pied { max-width: 480px; margin: 0 auto; padding: 0 16px 28px; font-size: 11.5px; line-height: 1.5; color: var(--doux); }
.pied p { margin: 0 0 4px; }
.pied a { color: var(--encre-2); }

/* ─── Dialogues ──────────────────────────────────────────────────────────── */

.dialogue {
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--rayon-tuile);
  background: var(--surface);
  color: var(--encre);
  box-shadow: inset 0 0 0 1px var(--bordure), 0 24px 60px rgba(30, 36, 51, 0.25);
}
.dialogue::backdrop { background: rgba(30, 36, 51, 0.45); }
.dialogue[open] { animation: monter var(--moyen) ease-out; }
@keyframes monter { from { opacity: 0; transform: translateY(12px); } }
.dialogue-corps { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.dialogue h2 { margin: 0; font: 800 26px/1.1 var(--police); letter-spacing: -0.03em; }
.dialogue form { margin: 0; }
.liste-losanges { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; color: var(--encre-2); font-size: 14px; }
.liste-losanges li { position: relative; padding-left: 20px; }
.liste-losanges li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 0.55em;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: var(--corail);
}
.liste-losanges b { color: var(--encre); }
.exemple .fleche { width: 24px; height: 24px; }

.chiffres { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.chiffres span { display: block; font: 800 30px/1 var(--police); color: var(--bleu); font-variant-numeric: tabular-nums; }
.chiffres small { display: block; margin-top: 4px; font: 700 9.5px var(--police); letter-spacing: 0.1em; text-transform: uppercase; color: var(--doux); }
.repartition { margin: -6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.repartition li { display: grid; grid-template-columns: 14px 1fr; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; color: var(--encre-2); }
.repartition .barre {
  min-width: 26px;
  padding: 3px 8px;
  border-radius: 3px 3px 8px 8px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--bordure);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.repartition .actuelle .barre { background: var(--bleu); color: var(--sur-email); box-shadow: none; }

/* ─── Consentement à la mesure d'audience ────────────────────────────────── */

.consentement {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 10;
  width: min(448px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 14px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 0 0 1px var(--bordure-forte), 0 18px 50px rgba(30, 36, 51, 0.22);
  animation: monter var(--moyen) ease-out;
}
.consentement-texte { margin: 0; font-size: 13px; line-height: 1.45; color: var(--encre-2); }
.consentement-texte b { color: var(--encre); }
.consentement-boutons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.consentement .bouton-principal { margin-top: 0; }
.consentement .bouton-principal::before { display: none; }
/* Tant que le bandeau est là, la fin de la page reste accessible au-dessus de lui. */
body:has(.consentement:not([hidden])) { padding-bottom: 200px; }

.lien { padding: 0; border: 0; background: none; color: var(--encre-2); font: inherit; text-decoration: underline; cursor: pointer; }

/* ─── Ordinateur : deux colonnes ─────────────────────────────────────────── */

@media (min-width: 960px) {
  .page {
    max-width: 1040px;
    display: grid;
    grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
    align-items: start;
    gap: 16px 36px;
    padding-top: 22px;
  }
  .entete { grid-column: 1 / -1; }
  .colonne { display: flex; flex-direction: column; gap: 16px; }
  /* La silhouette reste sous les yeux pendant qu'on fait défiler les essais. */
  .colonne-silhouette { position: sticky; top: 16px; }
  .pied { max-width: 1040px; }
  /* L'accueil : le titre en haut, puis deux colonnes qui s'empilent librement, sans trou entre les blocs. */
  .accueil {
    max-width: 1040px;
    display: block;
    columns: 2;
    column-gap: 36px;
    padding-top: 40px;
  }
  .accueil > * { break-inside: avoid; margin-bottom: 22px; }
  .accueil-heros { column-span: all; margin-bottom: 30px; }
  .accueil-titre { font-size: 72px; }
}

/* ─── Mouvements réduits ─────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .frise::after { display: none; }
  .essai.nouveau, .dialogue[open], .consentement, .essai.nouveau .essai-chaleur, .essai.nouveau .fleche, .los.nouveau,
  .indice.bascule, .apparait #silhouette-trace, .apparait .balayage, .silhouette-halo, .champ-boite.tremble, .fin > *, .carte-onde,
  .accueil > *, .accueil-halo { animation: none; }
  .losange-tournant { animation-duration: 3s; }
  * { transition-duration: 0ms !important; }
}
