/* Lánzate : identité de Marc (communication/identite.md). Couleurs vérifiées par tests/suite-statique.js. */
:root {
  --fond: #F4F6FB;
  --bulle: #FFFFFF;
  --texte: #14204A;
  --texte2: #4A5578;
  --accent: #1F3FB5;
  --sur-accent: #FFFFFF;
  --socle: #1F3FB5;
  --sur-socle: #FFFFFF;
  --micro: #F5B014;
  --sur-micro: #14204A;
  --secondaire: #E3E8F7;
  --sur-secondaire: #14204A;
  --contour: #4A5578;
  --focus: #1F3FB5;
  --focus-socle: #FFFFFF;
  --anneau: #FFFFFF;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0F1738;
    --bulle: #1B2550;
    --texte: #F2F5FC;
    --texte2: #B4BEDD;
    --accent: #8FA8FF;
    --sur-accent: #0F1738;
    --socle: #1B2550;
    --sur-socle: #F2F5FC;
    --micro: #F9BE30;
    --sur-micro: #0F1738;
    --secondaire: #27336A;
    --sur-secondaire: #F2F5FC;
    --contour: #B4BEDD;
    --focus: #8FA8FF;
    --focus-socle: #F2F5FC;
    --anneau: #F2F5FC;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: "Avenir Next", -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}

.racine {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
}

.ecran {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.defile {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top));
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

h1, h2, p { margin: 0; }

h1 { font-size: 26px; font-weight: 700; line-height: 1.2; }
h1:focus { outline: none; }
h2 { font-size: 19px; font-weight: 600; margin: 24px 0 8px; }

.marque {
  font-family: Charter, Georgia, serif;
  font-weight: 900;
  font-size: 40px;
  line-height: 1.1;
}

.es {
  font-family: Charter, Georgia, serif;
  font-weight: 900;
}

.secondaire { color: var(--texte2); }
.espace { margin-top: 12px; }
.espace-grand { margin-top: 24px; }

.invisible {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Boutons */
.bouton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--accent);
  color: var(--sur-accent);
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.bouton-secondaire {
  background: var(--secondaire);
  color: var(--sur-secondaire);
  border-color: var(--contour);
}

.bouton-secours {
  background: var(--sur-socle);
  color: var(--socle);
}

.bouton[disabled] { opacity: 0.55; cursor: default; }

.rangee {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.rangee .bouton { flex: 1 1 0; min-width: 0; }

.pile > * + * { margin-top: 8px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.socle :focus-visible {
  outline-color: var(--focus-socle);
}

/* Bulle de phrase */
.bulle {
  margin-top: 12px;
  padding: 20px;
  background: var(--bulle);
  border-radius: 28px;
}

.bulle-autre { border-bottom-left-radius: 6px; }
.bulle-moi { border-bottom-right-radius: 6px; }

.bulle .phrase {
  font-family: Charter, Georgia, serif;
  font-weight: 900;
  font-size: 34px;
  line-height: 1.15;
  text-align: left;
  overflow-wrap: anywhere;
}

.bulle .traduction { margin-top: 10px; color: var(--texte2); }

.bulle-reconnue { background: var(--accent); color: var(--sur-accent); }
.bulle-reconnue .traduction { color: var(--sur-accent); }

.coche {
  display: block;
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.a-reprendre {
  background: var(--secondaire);
  color: var(--sur-secondaire);
  border-radius: 6px;
  padding: 0 4px;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

.bulle .phrase.moyenne { font-size: 24px; }

/* Interlocuteur : un carreau et un prénom */
.personne { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-weight: 600; }

.carreau-initiale {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--secondaire);
  color: var(--sur-secondaire);
  font-weight: 600;
}

/* Barre du haut */
.haut { display: flex; align-items: center; gap: 12px; }
.haut .avancement { flex: 1 1 auto; min-width: 0; }
.bouton-fermer { width: auto; min-width: 88px; min-height: 44px; padding: 6px 12px; }

.segments { display: flex; gap: 3px; height: 8px; }
.segments span { flex: 1 1 0; border-radius: 3px; background: var(--secondaire); }
.segments span.plein { background: var(--accent); }
.compteur { margin-top: 4px; font-size: 15px; color: var(--texte2); }

/* Messages */
.message {
  margin-top: 12px;
  padding: 12px 16px;
  border: 2px solid var(--contour);
  border-radius: 14px;
}

.message-titre {
  font-family: Charter, Georgia, serif;
  font-weight: 900;
  font-size: 24px;
}

/* Socle et micro */
.socle {
  flex: 0 0 auto;
  background: var(--socle);
  color: var(--sur-socle);
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  text-align: center;
}

.barre {
  flex: 0 0 auto;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.micro {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--micro);
  color: var(--sur-micro);
  touch-action: manipulation;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.micro svg { width: 44px; height: 44px; fill: currentColor; }

.micro-libelle { margin-top: 4px; font-weight: 600; }

.micro.ecoute::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 3px solid var(--anneau);
  border-radius: 50%;
  animation: anneau 1.4s ease-out infinite;
}

@keyframes anneau {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(1.22); opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .micro.ecoute::after { animation: none; }
}

.socle .bouton-secours { margin-top: 8px; }

/* Mur de la série */
.mur {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  max-width: 224px;
  margin-top: 12px;
}

.mur span {
  aspect-ratio: 1;
  border: 2px solid var(--contour);
  border-radius: 4px;
}

.mur span.pose { background: var(--accent); border-color: var(--accent); }

/* Cartes et champs */
.carte {
  margin-top: 12px;
  padding: 16px;
  background: var(--bulle);
  border-radius: 14px;
}

.etat-etape { font-size: 15px; color: var(--texte2); margin-bottom: 4px; }

.champ-libelle { display: block; margin-bottom: 8px; }

.champ {
  width: 100%;
  min-height: 52px;
  padding: 12px;
  border: 2px solid var(--contour);
  border-radius: 14px;
  background: var(--bulle);
  color: var(--texte);
  font: inherit;
}

.lien { color: var(--accent); font-weight: 600; }

/* Page de test du micro */
.diagnostic { margin: 12px 0 0; padding: 0; }

.diagnostic > div {
  padding: 12px 0;
  border-bottom: 1px solid var(--contour);
}

.diagnostic dt { font-weight: 600; }
.diagnostic dd { margin: 2px 0 0; color: var(--texte2); overflow-wrap: anywhere; }

.socle-test {
  margin-top: 12px;
  padding: 16px;
  border-radius: 14px;
  background: var(--socle);
  color: var(--sur-socle);
  text-align: center;
}

.socle-test :focus-visible { outline-color: var(--focus-socle); }

.verdict {
  margin-top: 12px;
  padding: 16px;
  border: 2px solid var(--contour);
  border-radius: 14px;
  font-weight: 600;
}

.verdict.reussi {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--sur-accent);
}

.texte-reconnu {
  font-family: Charter, Georgia, serif;
  font-weight: 900;
  font-size: 24px;
  overflow-wrap: anywhere;
}

[hidden] { display: none; }
