/* Direction : « une seule forme vivante ». Tout le parcours tient dans un cercle qui se transforme :
   il respire, bat au rythme de la voix, puis la couleur de la réponse inonde l'écran depuis le centre,
   et l'aiguille du logo devient une boussole vers le centre de santé.
   Aplats, gros gestes à pictogrammes, un signe par niveau (barres), titres en serif chaleureux.
   Pensé pour une personne qui lit peu. */

/* Noto Sans et Noto Serif (licence OFL), embarquées : les polices système n'ont pas toujours les lettres du fon
   (ɛ ɔ ɖ) et les remplacent par des capitales (Ɛ Ɔ Ð). Fonctionne aussi hors ligne. */
@font-face { font-family: "Noto Sans OVCS"; font-weight: 400 900; font-display: swap;
  src: url(fonts/noto-sans-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: "Noto Sans OVCS"; font-weight: 400 900; font-display: swap;
  src: url(fonts/noto-sans-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 OVCS"; font-weight: 400 900; font-display: swap;
  src: url(fonts/noto-sans-vietnamese.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Noto Serif OVCS"; font-weight: 400 900; font-display: swap;
  src: url(fonts/noto-serif-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: "Noto Serif OVCS"; font-weight: 400 900; font-display: swap;
  src: url(fonts/noto-serif-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 Serif OVCS"; font-weight: 400 900; font-display: swap;
  src: url(fonts/noto-serif-vietnamese.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }

:root {
  --creme: #fbf3e4;
  --creme-f: #eedfc2;
  --encre: #2b2118;
  /* Couleurs vives : seulement pour les petits éléments (orbe, pictogramme, aiguille, boutons) */
  --vert: #3a8f6a;
  --vert-f: #24694b;
  --jaune: #f1d27a;
  --rouge: #d8604c;
  --rouge-f: #a8442f;
  --ambre: #f2b950;
  --ambre-f: #a8741f;
  --ardoise: #5f6b76;
  --ardoise-f: #46515b;
  /* Couleurs claires : le grand fond de la réponse */
  --rouge-clair: #f8d3ca;
  --ambre-clair: #fbe6b8;
  --vert-clair: #d3ebdd;
  --ardoise-clair: #e1e5e9;
  --niveau: 0;
  /* couleur de la réponse (changée selon le niveau) */
  --fond: var(--ardoise-clair);
  --fond-f: var(--ardoise-f);
  --halo-a: #f4f6f8;
  --halo-b: #fbf3e4;
  --texte: var(--encre);
  --serif: "Noto Serif OVCS", "Noto Serif", Georgia, serif;
}
body[data-niveau="urgent"] { --fond: var(--rouge-clair); --fond-f: var(--rouge-f); --halo-a: #fff0ec; --halo-b: #fbe6b8; }
body[data-niveau="consulter"] { --fond: var(--ambre-clair); --fond-f: var(--ambre-f); --halo-a: #fff6df; --halo-b: #f8d3ca; }
body[data-niveau="surveiller"] { --fond: var(--vert-clair); --fond-f: var(--vert-f); --halo-a: #f1faf4; --halo-b: #fbe6b8; }
body[data-niveau="inconnu"], body[data-niveau="centres"] { --fond: var(--ardoise-clair); --fond-f: var(--ardoise-f); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  font-family: "Noto Sans OVCS", "Noto Sans", system-ui, sans-serif;
  color: var(--encre);
  background: var(--creme);
}
button { font-family: inherit; }
/* La couleur de la réponse inonde l'écran depuis le centre, avec deux halos doux */
.cadre::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(circle at 100% 0, var(--halo-a) 0, transparent 62%), radial-gradient(circle at 0 100%, var(--halo-b) 0, transparent 62%), var(--fond);
  clip-path: circle(0 at 50% 40%); transition: clip-path .7s cubic-bezier(.6, 0, .2, 1);
}
body[data-etat="resultat"] .cadre::before { clip-path: circle(150% at 50% 40%); }

/* Un fin liseré aux couleurs du drapeau */
.liseré { position: fixed; z-index: 6; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--vert) 0 33.3%, var(--jaune) 33.3% 66.6%, var(--rouge) 66.6%); }

main { width: 100%; max-width: 480px; margin: 0 auto; padding: 24px 20px 0; text-align: center; }
.ecran { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100dvh - 24px); padding-bottom: 28px; }
.ecran > * { position: relative; z-index: 1; }

/* ----- 1. Accueil ----- */
/* Le ruban aux couleurs du drapeau passe derrière le cercle ; il s'intensifie quand on parle */
.ruban-app { position: absolute !important; z-index: 0 !important; left: -20px; width: calc(100% + 40px); top: 110px; height: 420px; pointer-events: none; transition: filter .4s; }
body[data-etat="ecoute"] .ruban-app { filter: saturate(1.7); }


.zone-orbe { position: relative; width: min(66vw, 280px); aspect-ratio: 1; display: grid; place-items: center; }
.anneau { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.anneau-fond { fill: none; stroke: var(--creme-f); stroke-width: 3; }
.anneau-temps { fill: none; stroke: var(--rouge-f); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 590.6; stroke-dashoffset: 590.6; opacity: 0; }

.onde { position: absolute; inset: 14%; border-radius: 50%; border: 2px solid var(--vert); opacity: 0; pointer-events: none; }
body[data-etat="repos"] .onde { animation: appel 3.6s ease-out infinite; }
body[data-etat="repos"] .o2 { animation-delay: 1.2s; }
body[data-etat="repos"] .o3 { animation-delay: 2.4s; }
body[data-etat="ecoute"] .onde { border-color: var(--rouge); opacity: calc(.15 + var(--niveau) * .6);
  transform: scale(calc(1.05 + var(--niveau) * .35)); transition: transform .08s linear, opacity .08s linear; }
body[data-etat="ecoute"] .o2 { transform: scale(calc(1.18 + var(--niveau) * .5)); }
body[data-etat="ecoute"] .o3 { transform: scale(calc(1.3 + var(--niveau) * .65)); }
@keyframes appel { 0% { transform: scale(.95); opacity: .45; } 100% { transform: scale(1.5); opacity: 0; } }

/* L'aiguille du logo passe derrière le cercle : seules ses pointes dépassent, jusqu'à l'anneau */
.aiguille { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.aiguille-nord { fill: var(--rouge); }
.aiguille-sud { fill: var(--vert-f); }
body[data-etat="repos"] .aiguille { animation: cherche 3.6s ease-in-out infinite alternate; }
body[data-etat="ecoute"] .aiguille { transform: scale(calc(1 + var(--niveau) * .14)); transition: transform .06s linear; }
body[data-etat="analyse"] .aiguille { animation: trouve 1.6s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes cherche { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
@keyframes trouve { to { transform: rotate(360deg); } }

.orbe {
  position: relative; width: 68%; aspect-ratio: 1; border: 0; border-radius: 50%; color: #fff;
  display: grid; place-items: center; cursor: pointer;
  background: var(--vert);
  box-shadow: 0 18px 40px -12px #1f5a4180, inset 0 -8px 18px #0002;
  transition: transform .12s, background .3s;
}
.orbe:active { transform: scale(.96); }
.orbe::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; border: 2px solid #ffffff38; pointer-events: none; }
.orbe .picto { width: 42%; height: 42%; }
body[data-etat="repos"] .orbe { animation: respire 3.6s ease-in-out infinite; }
body[data-etat="ecoute"] .orbe { background: var(--rouge); box-shadow: 0 18px 40px -12px #8a3a3280, inset 0 -8px 18px #0002;
  transform: scale(calc(1 + var(--niveau) * .14)); transition: transform .06s linear, background .3s; }
body[data-etat="analyse"] .orbe { background: var(--ambre); }
body[data-etat="analyse"] .orbe::after { border: 2px solid transparent; border-top-color: #fff; animation: tourne 1.1s linear infinite; }
body[data-etat="analyse"] .orbe .picto { animation: respire 1s ease-in-out infinite; }
@keyframes respire { 50% { transform: scale(1.04); } }
@keyframes tourne { to { transform: rotate(360deg); } }

/* Titre de l'accueil, en serif ; la ligne en fon dessous (message de Prince, déjà dans l'appli) */
.titre-accueil { margin-top: 22px; }
#etat { margin: 0; min-height: 1.2em; font-family: var(--serif); font-size: 1.85rem; font-weight: 700; line-height: 1.2; color: var(--vert-f); }
.fon-ligne { margin: 10px 0 0; font-size: 1rem; line-height: 1.5; color: #5b5045; }
/* Écoute : le texte reste pour les lecteurs d'écran, mais on ne le voit pas ; l'écran parle par l'image */
body[data-etat="ecoute"] #etat, body[data-etat="ecoute"] .fon-ligne { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body[data-etat="analyse"] #etat { font-size: 1.4rem; }
body:not([data-etat="repos"]) .fon-ligne { display: none; }

/* Écoute : forme d'onde, pictogramme du bruit, arrêt */
.ecoute-extras { display: none; }
body[data-etat="ecoute"] .ecoute-extras { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 10px; }
.barres { display: flex; align-items: center; justify-content: center; gap: 5px; height: 84px; }
.barres i { width: 5px; border-radius: 3px; background: var(--rouge-f); transition: height .08s linear;
  height: calc(var(--h) * (.35 + var(--niveau) * 1.3) * 1px); }
.bruit { display: flex; align-items: center; gap: 14px; }
.bruit-rond { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--ambre); color: var(--encre);
  box-shadow: 0 0 0 7px #f2b95044; }
.bruit-rond.clair { background: #fff; color: var(--vert-f); box-shadow: inset 0 0 0 2px var(--creme-f); }
.bruit-rond svg { width: 34px; height: 34px; }
.bruit-fleche { width: 40px; height: 30px; color: var(--encre); }
.stop { width: 76px; height: 76px; border-radius: 50%; border: 3px solid var(--rouge-f); background: #fff; display: grid; place-items: center;
  cursor: pointer; box-shadow: 0 4px 0 #e3a99b; }
.stop span { width: 26px; height: 26px; border-radius: 6px; background: var(--rouge-f); }
.stop:active { transform: translateY(2px); box-shadow: 0 2px 0 #e3a99b; }

/* Trois gros gestes à pictogramme, comme les boutons d'un mobile money */
.actions { display: flex; justify-content: center; gap: 12px; width: 100%; margin-top: 26px; }
.actions .carte-act { flex: 0 1 190px; }
.carte-act { flex: 1; min-width: 0; height: 96px; border-radius: 24px; border: 2px solid var(--creme-f); background: #fff; color: var(--encre);
  box-shadow: 0 4px 0 var(--creme-f); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-size: .9rem; font-weight: 700; cursor: pointer; }
.carte-act svg { width: 32px; height: 32px; }
.carte-act.actif { border-color: var(--vert); background: var(--vert-clair); box-shadow: 0 4px 0 var(--vert); color: var(--vert-f); }
.carte-act:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--creme-f); }
body:not([data-etat="repos"]) .actions { display: none; }

/* ----- 2. Réponse ----- */
.ecran-resultat { display: flex; flex-direction: column; align-items: stretch; gap: 18px; padding: 14px 0 0; text-align: left; color: var(--texte);
  min-height: calc(100dvh - 24px); }
.niveau-ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* Le signe de niveau : barres, comme le signal d'un téléphone (1 = surveiller, 2 = consulter, 3 = urgent) */
.pastille-niveau { display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px 9px 12px; border-radius: 999px;
  font-size: 1rem; font-weight: 800; background: var(--ardoise-f); color: #fff; }
.pastille-niveau svg { width: 22px; height: 22px; flex: none; }
body[data-niveau="surveiller"] .niveau-ligne .pastille-niveau { background: var(--vert-f); color: #fff; }
body[data-niveau="consulter"] .niveau-ligne .pastille-niveau { background: var(--ambre); color: var(--encre); }
body[data-niveau="urgent"] .niveau-ligne .pastille-niveau { background: var(--rouge-f); color: #fff; }
body[data-niveau="urgent"] .niveau-ligne .pastille-niveau svg { animation: alerte .7s ease-in-out infinite; }
@keyframes alerte { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
/* Parler de nouveau : le cercle revient, petit, en haut à droite */
.reparler { flex: none; width: 56px; height: 56px; border-radius: 50%; border: 2px solid #fff; background: #ffffffb3; color: var(--fond-f);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 0 #0001; }
.reparler svg { width: 28px; height: 28px; }
.reparler:active { transform: translateY(2px); }

.reponse { display: grid; justify-items: start; gap: 10px; margin-top: 6px; animation: monte .55s .2s cubic-bezier(.2, 1.2, .4, 1) both; }
@keyframes monte { from { transform: translateY(22px) scale(.96); opacity: 0; } }
#message { margin: 0; max-width: 16em; font-family: var(--serif); font-size: clamp(1.9rem, 9vw, 2.5rem); font-weight: 700; line-height: 1.2; }
#message:empty { display: none; }
/* Le nom du centre, dit en français dans la phrase fon : en pastille */
.pastille-centre { margin: 0; display: inline-block; max-width: 100%; padding: 2px 20px 6px; border-radius: 999px; background: var(--vert-clair);
  border: 2.5px solid var(--vert); font-family: var(--serif); font-size: clamp(1.7rem, 8vw, 2.3rem); font-weight: 700; line-height: 1.2; color: var(--vert-f); overflow-wrap: anywhere; }
/* Le français reste disponible (agent de santé, proche non fonophone), mais il est rangé derrière un petit bouton */
.lien-fr { padding: 8px 2px; border: 0; background: none; color: inherit; font-size: .85rem; font-weight: 700; text-decoration: underline; opacity: .8; cursor: pointer; }
#francais { margin: 0; max-width: 38ch; padding: 10px 14px; border-radius: 14px; background: #ffffff8c; font-size: .98rem; font-weight: 600; line-height: 1.4; }
#brouillon { margin: 0; max-width: 40ch; font-size: .78rem; line-height: 1.35; opacity: .85; font-style: italic; }
#brouillon:empty { display: none; }

/* Surveiller : trois gestes, sans mot */
.gestes { display: none; gap: 12px; }
body[data-niveau="surveiller"] .gestes { display: flex; }
.gestes > div { flex: 1; height: 96px; border-radius: 24px; background: #fff; box-shadow: 0 4px 0 #a9ccb8; display: grid; place-items: center; color: var(--vert-f); }
.gestes svg { width: 46px; height: 46px; }

/* La boussole : l'aiguille du logo, large, dépasse du cercle pour montrer la direction du centre */
.chemin { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: monte .55s .4s cubic-bezier(.2, 1.2, .4, 1) both; }
.message-suite { display: none; margin: 0; font-family: var(--serif); font-size: 1.3rem; font-weight: 600; line-height: 1.35; }
.chemin-ligne { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.boussole { position: relative; width: 184px; height: 184px; margin: 58px; }
.boussole-nord { display: none; }
.boussole-aiguille { position: absolute; inset: -58px; transition: transform .25s linear; pointer-events: none; }
.boussole-aiguille svg { display: block; width: 100%; height: 100%; }
.boussole-centre { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; border-radius: 50%;
  background: var(--creme); border: 3px solid #fff; box-shadow: 0 16px 32px -14px #7a5a1f88; }
#proche-dist { font-family: var(--serif); font-size: 2.2rem; font-weight: 700; line-height: 1; letter-spacing: -.01em; color: var(--encre); }
.marche { display: flex; align-items: center; gap: 4px; font-size: .85rem; font-weight: 600; color: #4a4036; }
.marche svg { width: 16px; height: 16px; }
.chemin-info { display: grid; justify-items: center; gap: 4px; text-align: center; }
.chemin-info .pastille-centre { display: none; }
.chemin-nom { max-width: 30ch; font-size: .9rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.chemin-cap { font-size: .76rem; opacity: .8; }
/* Urgent : deux cercles d'alerte autour de l'aiguille */
body[data-niveau="urgent"] .boussole::before, body[data-niveau="urgent"] .boussole::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
body[data-niveau="urgent"] .boussole::before { inset: -48px; border: 2px solid #a8442f55; }
body[data-niveau="urgent"] .boussole::after { inset: -32px; border: 2px solid #a8442f88; }
.autre { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--encre);
  font-size: 1rem; font-weight: 700; cursor: pointer; }
.autre:active { transform: scale(.96); }
.points { letter-spacing: 3px; font-size: .7rem; color: var(--vert-f); }
.lien { background: none; border: 0; color: inherit; font-weight: 700; font-size: .9rem; text-decoration: underline; padding: 8px; }

/* Surveiller : la boussole devient un petit panneau, « si cela dure, allez au centre » */
body[data-niveau="surveiller"] .chemin { align-items: stretch; padding: 22px; border-radius: 28px; background: #ffffffb3; border: 2px solid #fff; gap: 0; }
body[data-niveau="surveiller"] .message-suite { display: block; }
body[data-niveau="surveiller"] .chemin-ligne { flex-direction: row; align-items: center; gap: 12px; margin-top: 10px; }
body[data-niveau="surveiller"] .boussole { width: 84px; height: 84px; margin: 22px; flex: none; }
body[data-niveau="surveiller"] .boussole-aiguille { inset: -22px; }
body[data-niveau="surveiller"] #proche-dist { font-size: 1.15rem; }
body[data-niveau="surveiller"] .marche { display: none; }
body[data-niveau="surveiller"] .chemin-info { justify-items: start; text-align: left; }
body[data-niveau="surveiller"] .chemin-info .pastille-centre { display: inline-block; font-size: 1.5rem; padding: 2px 16px 4px; border-width: 2px; }
body[data-niveau="surveiller"] .chemin-cap { display: none; }
body[data-niveau="surveiller"] .autre { align-self: center; }
body[data-niveau="surveiller"] .reponse .pastille-centre { display: none; }

/* Bas d'écran : réécouter, et « Y aller » (plein pour consulter et urgent, contour pour surveiller) */
.actions-bas { position: sticky; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 5; display: flex; align-items: center; gap: 14px;
  margin-top: auto; padding-top: 14px; }
.sceau { flex: none; width: 72px; height: 72px; border-radius: 50%; border: 2px solid #fff; background: var(--creme); color: var(--vert-f);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 0 #0002; }
.sceau svg { width: 34px; height: 34px; }
.sceau:active { transform: translateY(2px); }
.go { flex: 1; min-width: 0; height: 72px; border-radius: 999px; background: var(--vert-f); color: #fff; box-shadow: 0 5px 0 #17492f;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; text-decoration: none; font-size: 1.4rem; font-weight: 800; }
.go svg { width: 26px; height: 26px; }
.go:active { transform: translateY(2px); box-shadow: 0 3px 0 #17492f; }
body[data-niveau="surveiller"] .go { background: transparent; color: var(--vert-f); border: 3px solid var(--vert-f); box-shadow: 0 4px 0 #a9ccb8; }

/* Choix de la commune : discret, il n'apparaît que si la position manque */
.position { width: 100%; background: #ffffffa8; color: var(--encre); border-radius: 20px; padding: 14px 16px; text-align: left; box-shadow: inset 0 0 0 1.5px #2b211822; }
.position p { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font-size: .98rem; font-weight: 800; }
.position p svg { width: 20px; height: 20px; color: var(--rouge-f); }
.position-champs { display: flex; gap: 8px; }
.position select { flex: 1; min-width: 0; font: inherit; font-size: 1rem; padding: 11px 38px 11px 12px; border-radius: 12px; border: 1.5px solid var(--creme-f); color: var(--encre);
  appearance: none; background: var(--creme) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%232b2118' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 13px center / 12px; }
.position button { font: inherit; font-size: 1rem; font-weight: 800; padding: 0 24px; border: 0; border-radius: 12px; background: var(--vert-f); color: #fff; cursor: pointer; }

#technique { width: 100%; text-align: left; font-size: .78rem; opacity: .85; }
#technique summary { padding: 8px 2px; font-size: .9rem; font-weight: 700; opacity: .85; cursor: pointer; }

#test { display: flex; gap: 8px; margin-top: 16px; }
#test input { flex: 1; padding: 12px; font-size: 1rem; border-radius: 12px; border: 1.5px solid var(--creme-f); background: #fff; }
#test button { border: 0; border-radius: 12px; background: var(--vert); color: #fff; padding: 0 16px; font-weight: 700; }

/* Avertissement permanent (aussi dans l'APK) */

/* ----- Habillage du site web : absent de l'APK (classe « appli ») ----- */
.appli .web-seulement { display: none !important; }
.site { display: none; }
.page { position: relative; display: flex; flex-direction: column; }
.scene { order: 1; }
.ruban-site, .boussole3d { display: none; }
@media (max-width: 959px) {
  /* petit écran : pendant la réponse, rien d'autre que la réponse */
  body[data-etat="resultat"] .presentation, body[data-etat="resultat"] .site-corps { display: none; }
}
.presentation { order: 2; max-width: 560px; margin: 0 auto; padding: 8px 24px 40px; text-align: center; }
.etiquette { display: inline-block; margin: 0; padding: 8px 16px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 2px var(--creme-f);
  font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--vert-f); }
.presentation h1 { margin: .5em 0 .4em; font-family: var(--serif); font-size: clamp(2.1rem, 7vw, 3.4rem); font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.chapeau { margin: 0 0 24px; font-size: 1.15rem; line-height: 1.55; color: #4a4036; }
.boutons-hero { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.bouton-plein, .bouton-contour { display: inline-flex; align-items: center; gap: 12px; height: 60px; padding: 0 30px; border-radius: 999px; text-decoration: none;
  font-size: 1.15rem; font-weight: 800; }
.bouton-plein { background: var(--vert-f); color: #fff; box-shadow: 0 5px 0 #17492f; }
.bouton-plein svg { width: 26px; height: 26px; }
.bouton-plein.grand { height: 68px; font-size: 1.25rem; padding: 0 34px; }
.bouton-contour { border: 3px solid var(--vert-f); color: var(--vert-f); padding: 0 28px; }
.savoir { display: inline-block; margin-top: 16px; font-size: .85rem; font-weight: 700; color: var(--vert-f); text-decoration: none; padding: 6px; }

.site-corps h2 { margin: 0; font-family: var(--serif); font-size: clamp(1.9rem, 3.6vw, 2.75rem); font-weight: 700; line-height: 1.15; }
.bloc { padding: 72px 0; }
.bloc.blanc { background: #fff; }
.contenu { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.sous-titre { margin: 16px 0 0; max-width: 40em; font-size: 1.15rem; line-height: 1.55; color: #4a4036; }
.grille-3 { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 44px; }
.grille-3 > * { flex: 1 1 300px; }
.carte-etape, .carte-niveau { padding: 30px; border-radius: 28px; border: 2px solid #fff; }
.sauge { background: var(--vert-clair); }
.miel { background: var(--ambre-clair); }
.rose { background: var(--rouge-clair); }
.etape-tete { display: flex; align-items: center; justify-content: space-between; }
.etape-tete svg { width: 56px; height: 56px; color: var(--vert-f); }
.grand-chiffre { font-family: var(--serif); font-size: 4.5rem; font-weight: 700; line-height: 1; color: var(--vert-f); }
.carte-etape h3 { margin: 18px 0 0; font-size: 1.5rem; font-weight: 800; }
.carte-etape p { margin: 10px 0 0; font-size: 1.1rem; line-height: 1.55; color: #3b3229; }
.carte-niveau .pastille-niveau.vert { background: var(--vert-f); color: #fff; }
.carte-niveau .pastille-niveau.ambre { background: var(--ambre); color: var(--encre); }
.carte-niveau .pastille-niveau.rouge { background: var(--rouge-f); color: #fff; }
.carte-niveau .pastille-niveau { font-size: 1.05rem; }
.carte-niveau .phrase { margin: 20px 0 0; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.35; }
.carte-niveau .detail { margin: 12px 0 0; font-size: 1.05rem; line-height: 1.5; color: #3b3229; }

.bande-projet { background: var(--vert-f); color: #fff; padding: 72px 0; }
.bande-grille { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; }
.bande-grille > div:first-child { flex: 1 1 380px; min-width: 0; }
.bande-grille p { margin: 20px 0 0; max-width: 32em; font-size: 1.15rem; line-height: 1.6; color: #e6f3ec; }
.chiffres { flex: 1 1 360px; display: flex; flex-wrap: wrap; gap: 28px 44px; }
.chiffres b { display: block; font-family: var(--serif); font-size: 4.75rem; font-weight: 700; line-height: 1; color: var(--jaune); }
.chiffres span { display: block; margin-top: 8px; font-size: 1.1rem; font-weight: 700; }

.telechargement { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; }
.telechargement > div:first-child { flex: 1 1 420px; min-width: 0; }
.etiquette-essai { display: inline-block; margin: 0 0 20px; padding: 8px 16px; border-radius: 999px; background: var(--ambre-clair); box-shadow: inset 0 0 0 2px var(--ambre);
  font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.telecharger-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 24px; margin-top: 32px; }
.qr-bloc { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 24px; margin-top: 28px; }
.qr { flex: none; width: 150px; height: 150px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 2px var(--creme-f); }
.qr-bloc .adresse-apk { flex: 1 1 240px; }
.adresse-apk { margin: 0; font-size: .9rem; line-height: 1.6; color: #5b5045; }
.etapes-apk { flex: 1 1 400px; display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.etapes-apk li { display: flex; align-items: center; gap: 18px; padding: 20px 24px; border-radius: 24px; background: var(--creme); }
.etapes-apk .grand-chiffre { flex: none; width: 36px; font-size: 2.75rem; }
.etapes-apk li > svg { flex: none; width: 44px; height: 44px; color: var(--vert-f); }
.etapes-apk b { display: block; font-size: 1.25rem; font-weight: 800; }
.etapes-apk li span:not(.grand-chiffre) { display: block; margin-top: 4px; font-size: 1rem; line-height: 1.5; color: #4a4036; }

.pied { max-width: 760px; margin: 0 auto; padding: 24px 24px 48px; text-align: center; font-size: .85rem; line-height: 1.55; color: #6b5a49; }
.pied p { margin: 0 0 8px; }
.pied a { color: var(--vert-f); font-weight: 700; }
.pied .credits { font-size: .78rem; }

/* Grand écran : texte à gauche, l'appli dans un cadre de téléphone qui se redresse quand on la touche */
@media (min-width: 960px) {
  html:not(.appli) body { background: var(--creme); }
  .site { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; max-width: 1200px; margin: 0 auto; padding: 22px 32px; }
  .marque { display: inline-flex; align-items: center; gap: 12px; color: var(--vert-f); text-decoration: none; }
  .marque b { font-family: var(--serif); font-size: 1.7rem; letter-spacing: .02em; }
  .site nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 26px; }
  .site nav a { color: var(--encre); font-size: 1rem; font-weight: 700; text-decoration: none; }
  .site nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

  .page { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 64px; align-items: center; max-width: 1200px; margin: 0 auto; padding: 24px 32px 80px; overflow-x: clip; }
  .ruban-site { display: block; position: absolute; right: 0; top: -40px; width: 100%; max-width: 1200px; height: calc(100% + 40px); pointer-events: none; }
  .presentation { position: relative; order: 1; max-width: none; margin: 0; padding: 0; text-align: left; }
  .presentation h1 { font-size: clamp(2.6rem, 4.6vw, 4rem); }
  .chapeau { max-width: 34em; font-size: 1.25rem; }
  .boutons-hero { justify-content: flex-start; }
  .savoir { display: none; }

  .scene { order: 2; position: relative; width: 400px; perspective: 1100px; transform-style: preserve-3d; }
  .cadre { --h-cadre: max(640px, min(800px, calc(100dvh - 150px)));
    position: relative; width: 400px; height: var(--h-cadre); overflow: hidden; border: 9px solid var(--encre); border-radius: 46px; background: var(--creme);
    /* le cadre est un peu incliné ; il se redresse quand on le touche. Le transform garde aussi les éléments « fixed » dans le cadre */
    transform: rotateX(3deg) rotateY(-7deg); transition: transform .5s ease-out;
    box-shadow: 0 40px 80px -30px #2b211880; }
  .scene:hover .cadre, .scene:focus-within .cadre { transform: none; }
  .defile { height: 100%; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; border-radius: 36px; }
  .defile::-webkit-scrollbar { display: none; }
  .cadre .ecran { min-height: calc(var(--h-cadre) - 36px); }
  .cadre main { padding-top: 14px; }
  .cadre .ecran-resultat { min-height: calc(var(--h-cadre) - 36px); gap: 12px; }
  .cadre #message { font-size: 2rem; }
  .cadre .pastille-centre { font-size: 1.7rem; }
  .cadre .boussole { width: 148px; height: 148px; margin: 46px; }
  .cadre .boussole-aiguille { inset: -46px; }
  .cadre #proche-dist { font-size: 1.8rem; }
  .cadre .go, .cadre .sceau { height: 64px; }
  .cadre .sceau { width: 64px; }

  /* La boussole en volume, devant le coin du téléphone : plusieurs disques à des profondeurs différentes */
  .boussole3d { display: block; position: absolute; left: -52px; top: 330px; width: 112px; height: 112px; pointer-events: none; z-index: 3;
    transform-style: preserve-3d; transform: rotateX(3deg) rotateY(-7deg) translateZ(130px); transition: transform .5s ease-out; }
  .scene:hover .boussole3d, .scene:focus-within .boussole3d { transform: translateZ(130px); }
  .boussole3d i { position: absolute; inset: 0; border-radius: 50%; }
  .boussole3d .b3-ombre { left: 8px; right: 8px; top: auto; bottom: -22px; height: 22px; background: var(--encre); opacity: .22; filter: blur(9px); }
  .boussole3d .b3-e1 { background: #17492f; transform: translateZ(-16px); }
  .boussole3d .b3-e2 { background: #1d5a3d; transform: translateZ(-11px); }
  .boussole3d .b3-e3 { background: #24694b; transform: translateZ(-7px); }
  .boussole3d .b3-e4 { background: #2e7d58; transform: translateZ(-3px); }
  .boussole3d .b3-face { background: var(--creme); border: 7px solid var(--vert); }
  .boussole3d .aiguille3d { position: absolute; inset: 12px; width: 88px; height: 88px; transform: translateZ(10px); animation: oscille3d 3.6s ease-in-out infinite alternate; }
  .boussole3d .b3-pivot { inset: auto; left: 50px; top: 50px; width: 12px; height: 12px; background: var(--creme); border: 3px solid var(--vert-f); transform: translateZ(16px); }
  @keyframes oscille3d { from { transform: translateZ(10px) rotate(-16deg); } to { transform: translateZ(10px) rotate(16deg); } }

  .bloc, .bande-projet { padding: 88px 0; }
  .contenu { padding: 0 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .cadre, .boussole3d { transform: none; }
}

/* « Je n'ai pas compris » : un grand cercle vert pour parler encore, et « Écouter » écrit en toutes lettres */
.parole-grand, .sceau-mot { display: none; }
body[data-niveau="inconnu"] .parole-grand { display: grid; justify-items: center; gap: 22px; margin: 34px 0 0; }
body[data-niveau="inconnu"] .reparler { display: none; }
.parole-cercle { width: 190px; height: 190px; border-radius: 50%; border: 0; background: var(--vert); color: #fff; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 9px 0 var(--vert-f), 0 0 0 26px #3a8f6a14, 0 0 0 28px #3a8f6a66, 0 22px 40px -14px #24694b99; }
.parole-cercle svg { width: 84px; height: 84px; }
.parole-cercle:active { transform: translateY(3px); }
.parole-grand p { margin: 8px 0 0; font-size: 1.4rem; font-weight: 800; color: var(--vert-f); }
body[data-niveau="inconnu"] .actions-bas { justify-content: center; }
body[data-niveau="inconnu"] .sceau { display: inline-flex; align-items: center; gap: 12px; width: auto; padding: 0 30px; border-radius: 99px; font-size: 1.1rem; font-weight: 800; }
body[data-niveau="inconnu"] .sceau-mot { display: inline; }
@media (min-width: 960px) { .cadre .parole-cercle { width: 150px; height: 150px; } .cadre .parole-cercle svg { width: 64px; height: 64px; } }
/* « Je n'ai pas compris » : seulement le message en fon, sans pastille ni français */
body[data-niveau="inconnu"] .niveau-ligne { display: none !important; }
/* Plus de traduction française dans les réponses : tout est dit en fon */
#voir-fr, #francais { display: none !important; }
/* « Je n'ai pas compris » : le message et le grand cercle descendent au milieu de l'écran */
body[data-niveau="inconnu"] .reponse { margin-top: auto; }
