/* LireFacile — feuille unique.
   Public : adultes qui lisent peu ou pas. Tout est gros, contrasté, sans piège. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-400.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: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-400-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: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/atkinson-700.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: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/atkinson-700-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;
}

:root {
  color-scheme: light;
  /* Fonds et textes à la manière d'iOS : gris groupé, cartes blanches. */
  --papier: #f2f2f7;
  --papier-2: #e5e5ea;
  --carte: #ffffff;
  --encre: #1c1c1e;
  --encre-douce: #5b5b61;
  --bord: #d8d8de;
  --barre: rgba(246, 246, 250, 0.82);
  --remplissage: rgba(118, 118, 128, 0.12);
  /* Une couleur par action, la même partout (contraste glyphe blanc ≥ 3:1). */
  --vert: #248a3d;
  --vert-texte: #1f7a36;
  --vert-clair: #e2f4e7;
  --bleu: #0a6fe0;
  --bleu-texte: #0a5cc0;
  --bleu-clair: #e3eefc;
  --terre: #d9530b;
  --terre-texte: #b8460a;
  --terre-clair: #fdebdf;
  --prune: #8944c4;
  --prune-texte: #7a39b3;
  --prune-clair: #f1e7fa;
  --rouge: #d70015;
  --rouge-clair: #fde5e7;
  --gris-tuile: #e3e3e8;
  --gris-glyphe: #1c1c1e;
  --surligne: #ffd24d;
  --surligne-doux: #fff3c9;
  --focus: #0a6fe0;
  --ombre: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  --ombre-petite: 0 1px 4px rgba(0, 0, 0, 0.08);
  --ombre-ico: 0 6px 16px rgba(0, 0, 0, 0.14), 0 1px 2px rgba(0, 0, 0, 0.1);
  --r: 22px;
  --r-petit: 14px;
  --appui: transform 0.1s ease-out;
  --app-h: 100dvh;
  --texte-lecture: 30px;
}

[data-theme="nuit"] {
  color-scheme: dark;
  --papier: #000000;
  --papier-2: #1c1c1e;
  --carte: #1c1c1e;
  --encre: #ffffff;
  --encre-douce: #a7a7ae;
  --bord: #38383a;
  --barre: rgba(22, 22, 24, 0.8);
  --remplissage: rgba(118, 118, 128, 0.24);
  --vert: #2a9a47;
  --vert-texte: #4cd06e;
  --vert-clair: #12301b;
  --bleu: #0a74e8;
  --bleu-texte: #5aa9ff;
  --bleu-clair: #11243c;
  --terre: #d9530b;
  --terre-texte: #ff9f5a;
  --terre-clair: #3a2112;
  --prune: #9150cf;
  --prune-texte: #d2a8ff;
  --prune-clair: #2a1c38;
  --rouge: #e0241f;
  --rouge-clair: #3a1416;
  --gris-tuile: #2c2c2e;
  --gris-glyphe: #ffffff;
  --surligne: #c9a227;
  --surligne-doux: #3a3218;
  --focus: #5aa9ff;
  --ombre: 0 10px 30px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
  --ombre-petite: 0 1px 4px rgba(0, 0, 0, 0.4);
  --ombre-ico: 0 6px 16px rgba(0, 0, 0, 0.5);
}

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

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 20px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

a {
  color: inherit;
}

svg {
  display: block;
  flex: none;
}

:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
  border-radius: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- coquille */

.app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--app-h, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--papier);
}

/* Première visite : le temps que la bannière d'accueil soit posée. */
.premiere-visite body {
  background: var(--papier);
}
.premiere-visite .app {
  visibility: hidden;
}

/* Barre du haut : matière translucide façon iOS, le contenu passe dessous. */
.barre {
  flex: none;
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 72px;
  padding: 6px 10px;
  padding-top: calc(6px + env(safe-area-inset-top));
  background: var(--barre);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 0.5px 0 var(--bord);
  color: var(--encre);
}

.marque {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-right: auto;
  padding-left: 4px;
  color: var(--encre);
  text-decoration: none;
}

.marque-ico {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(180deg, #2fa353, var(--vert));
  color: #fff;
  box-shadow: var(--ombre-petite);
}

.marque-ico svg {
  width: 25px;
  height: 25px;
}

.marque-nom {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.titre-ecran {
  flex: 1;
  min-width: 0;
  margin: 0 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Boutons de la barre : icône dans un carré arrondi, petit nom dessous. */
.barre-bt {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 58px;
  padding: 2px 2px;
  color: var(--vert-texte);
}

.barre-bt .tuile-ico {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--remplissage);
  box-shadow: none;
  transition: var(--appui);
}

.barre-bt .tuile-ico svg {
  width: 25px;
  height: 25px;
}

.barre-bt .tuile-nom {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--encre);
}

.barre-bt:active .tuile-ico {
  transform: scale(0.9);
}

/* Voix des menus coupée : rouge et haut-parleur barré, bien visible. */
.bouton-voix-menus.est-coupe .tuile-ico {
  background: var(--rouge-clair);
  color: var(--rouge);
}

.ecran {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px calc(30px + env(safe-area-inset-bottom));
}

.ecran.ecran-lecture {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.vue {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

/* ----------------------------------------------------------------- accueil */

/* L'accueil comme l'écran d'accueil d'un iPhone : de grandes icônes d'appli,
   un seul mot dessous. La couleur dit ce que fait l'icône. */
.ecran.ecran-accueil {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.accueil {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px 16px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.appli {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--encre);
  text-decoration: none;
  -webkit-touch-callout: none;
}

.appli-ico {
  width: min(132px, 34vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 23%;
  color: #fff;
  box-shadow: var(--ombre-ico);
  transition: var(--appui);
}

.appli-ico svg {
  width: 52%;
  height: 52%;
}

.appli:active .appli-ico {
  transform: scale(0.94);
}

.appli-nom {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.appli--photo .appli-ico {
  background: linear-gradient(180deg, #2fa353, var(--vert));
}
.appli--texte .appli-ico {
  background: linear-gradient(180deg, #3a8ef5, var(--bleu));
}
.appli--parler .appli-ico {
  background: linear-gradient(180deg, #e6661f, var(--terre));
}
.appli--mot .appli-ico {
  background: linear-gradient(180deg, #a466dc, var(--prune));
}

.accueil-note {
  max-width: 34ch;
  margin: 36px auto 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--encre-douce);
  text-align: center;
}

/* ---------------------------------------------------------------- éléments */

.consigne {
  margin: 0 0 18px;
  max-width: 32ch;
  font-size: 22px;
  line-height: 1.45;
  color: var(--encre-douce);
}

.consigne strong {
  color: var(--encre);
}

/* Tuile : grosse icône dans un carré arrondi, petit nom dessous.
   C'est la seule forme de bouton de l'appli. */
.tuiles {
  display: grid;
  gap: 14px 10px;
  margin-top: 20px;
  justify-items: center;
}

.tuiles--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tuiles--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tuile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 2px;
  color: var(--encre);
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.tuile-ico {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  box-shadow: var(--ombre-ico);
  transition: var(--appui);
}

.tuile-ico svg {
  width: 38px;
  height: 38px;
}

.tuile--grande .tuile-ico {
  width: min(116px, 30vw);
  height: min(116px, 30vw);
  border-radius: 27px;
}

.tuile--grande .tuile-ico svg {
  width: 50%;
  height: 50%;
}

.tuile-nom {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.tuile--grande .tuile-nom {
  font-size: 18px;
}

/* Réponse dès l'appui, pas au relâchement. */
.tuile:active .tuile-ico {
  transform: scale(0.92);
}

.tuile:focus-visible {
  outline: none;
}

.tuile:focus-visible .tuile-ico {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

.tuile:disabled {
  opacity: 0.4;
  cursor: default;
}

.tuile--seule {
  margin: 4px auto 18px;
}

.t-vert .tuile-ico {
  background: linear-gradient(180deg, #2fa353, var(--vert));
  color: #fff;
}
.t-bleu .tuile-ico {
  background: linear-gradient(180deg, #3a8ef5, var(--bleu));
  color: #fff;
}
.t-orange .tuile-ico {
  background: linear-gradient(180deg, #e6661f, var(--terre));
  color: #fff;
}
.t-violet .tuile-ico {
  background: linear-gradient(180deg, #a466dc, var(--prune));
  color: #fff;
}
.t-rouge .tuile-ico {
  background: linear-gradient(180deg, #f2343f, var(--rouge));
  color: #fff;
}
.t-gris .tuile-ico {
  background: var(--gris-tuile);
  color: var(--gris-glyphe);
  box-shadow: var(--ombre-petite);
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.texte-noscript {
  margin-top: 24px;
  font-size: 22px;
}

/* Présent dans la page (pas display:none) : Safari iOS ouvre alors
   l'appareil photo de façon fiable depuis un geste de l'utilisateur. */
.champ-fichier {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.astuce {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 15px 17px;
  border-radius: 18px;
  background: var(--papier-2);
  color: var(--encre-douce);
  font-size: 18px;
  line-height: 1.35;
}

.astuce svg {
  width: 26px;
  height: 26px;
  margin-top: 1px;
  color: var(--vert-texte);
}

.astuce p {
  margin: 0;
}

/* -------------------------------------------------------------------- photo */



/* ------------------------------------------------------------------- texte */

.etiquette {
  display: block;
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
}

.zone-texte,
.zone-dictee,
.champ-mot {
  width: 100%;
  border: 1px solid var(--bord);
  border-radius: 16px;
  background: var(--carte);
  color: var(--encre);
  padding: 16px 18px;
  font-size: 22px;
  line-height: 1.55;
  caret-color: var(--vert);
}

.zone-texte {
  min-height: 220px;
  resize: vertical;
}

.zone-dictee {
  min-height: 160px;
  font-size: 25px;
  line-height: 1.5;
  resize: vertical;
}

.zone-texte:focus,
.zone-dictee:focus,
.champ-mot:focus {
  outline: 4px solid var(--focus);
  outline-offset: 2px;
  border-color: transparent;
}

::placeholder {
  color: var(--encre-douce);
  opacity: 1;
}

/* ------------------------------------------------------------------ dicter */

.dictee {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.micro {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 168px;
  height: 168px;
  margin: 8px auto 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #e6661f, var(--terre));
  color: #fff;
  box-shadow: 0 14px 30px rgba(217, 83, 11, 0.3);
  transition: background 0.2s ease, transform 0.12s ease;
}

.micro:active {
  transform: scale(0.97);
}

.micro svg {
  width: 56px;
  height: 56px;
}

.micro-label {
  font-size: 19px;
  font-weight: 700;
}

.micro[aria-pressed="true"] {
  background: linear-gradient(180deg, #f2343f, var(--rouge));
}

.micro[aria-pressed="true"]::before,
.micro[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 4px solid rgba(215, 0, 21, 0.4);
  animation: pouls 1.6s ease-out infinite;
}

.micro[aria-pressed="true"]::after {
  animation-delay: 0.8s;
}

@keyframes pouls {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.onde {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  margin-top: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}

.onde.actif {
  opacity: 1;
}

.onde span {
  width: 5px;
  height: 8px;
  border-radius: 3px;
  background: var(--rouge);
  animation: onde 0.9s ease-in-out infinite alternate;
}

.onde span:nth-child(2) {
  animation-delay: 0.12s;
}
.onde span:nth-child(3) {
  animation-delay: 0.24s;
}
.onde span:nth-child(4) {
  animation-delay: 0.36s;
}
.onde span:nth-child(5) {
  animation-delay: 0.48s;
}

@keyframes onde {
  from {
    height: 7px;
  }
  to {
    height: 26px;
  }
}

.interim {
  min-height: 1.5em;
  margin: 8px 2px 0;
  font-size: 21px;
  line-height: 1.4;
  color: var(--encre-douce);
  font-style: italic;
}

.transcription {
  width: 100%;
  margin-top: 16px;
}

.compteur {
  margin: 8px 0 0;
  font-size: 16px;
  color: var(--encre-douce);
  text-align: right;
}

/* -------------------------------------------------------------- dictionnaire */

.recherche-mot {
  display: grid;
  gap: 10px;
}

.champ-mot {
  min-height: 62px;
}

.fiche-mot {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--bord);
  border-radius: 26px;
  background: var(--carte);
  box-shadow: var(--ombre);
}

.fiche-mot h2 {
  margin: 0;
  font-size: clamp(32px, 9vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.nature {
  margin: 6px 0 16px;
  font-size: 18px;
  font-style: italic;
  color: var(--encre-douce);
}

.definitions {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.definition {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 28px;
  align-items: start;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--bord);
  border-radius: 16px;
  background: var(--papier);
  color: var(--encre);
  font-size: 21px;
  line-height: 1.5;
  text-align: left;
  transition: background 0.12s ease;
}

.definition:active {
  background: var(--surligne-doux);
}

.definition .num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--prune-clair);
  color: var(--prune-texte);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.definition .txt {
  min-width: 0;
  overflow-wrap: anywhere;
}

.definition svg {
  width: 26px;
  height: 26px;
  margin-top: 3px;
  color: var(--prune-texte);
}

.synonymes-titre {
  margin: 18px 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--encre-douce);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--bleu-clair);
  color: var(--bleu-texte);
  font-size: 18px;
  font-weight: 700;
}

.chip:active {
  transform: scale(0.97);
}

.message-mot {
  margin-top: 18px;
  padding: 20px;
  border-radius: 20px;
  background: var(--papier-2);
  font-size: 22px;
  line-height: 1.4;
}

.message-mot strong {
  display: block;
  margin-bottom: 6px;
  font-size: 24px;
}

.message-mot .tuile {
  margin: 16px auto 0;
}

/* ------------------------------------------------------------------ lecteur */

.lecture-texte {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 24px 18px 28px;
  font-size: var(--texte-lecture);
  line-height: 1.72;
  letter-spacing: 0.004em;
}

.lecture-texte .contenu {
  max-width: 1040px;
  margin: 0 auto;
}

.lecture-texte.taille-1 {
  --texte-lecture: 26px;
}
.lecture-texte.taille-2 {
  --texte-lecture: 30px;
}
.lecture-texte.taille-3 {
  --texte-lecture: 36px;
}

.phrase {
  border-radius: 10px;
  transition: background 0.18s ease, box-shadow 0.18s ease;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.phrase.active {
  background: var(--surligne-doux);
  box-shadow: 0 0 0 5px var(--surligne-doux);
}

.mot {
  border-radius: 6px;
  padding: 1px 0;
  transition: background 0.1s ease, box-shadow 0.1s ease, color 0.1s ease;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.mot:active {
  background: var(--bleu-clair);
}

.mot.actif {
  background: var(--surligne);
  box-shadow: 0 0 0 4px var(--surligne);
  color: #15201e;
}

.mot.choisi {
  background: var(--bleu-clair);
  box-shadow: 0 0 0 4px var(--bleu-clair);
}

/* ---- lecture d'une photo : surlignage sur la photo elle-même */

.lecture-haut {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.lecture-texte.mode-photo {
  overflow: auto;
  padding: 14px 14px 76px;
  background: var(--papier-2);
}

.photo-cadre {
  position: relative;
  width: 100%;
  margin: 0 auto;
  line-height: 0;
  border-radius: var(--r-petit);
  overflow: hidden;
  box-shadow: var(--ombre-petite);
  transition: width 0.25s ease;
}

.photo-cadre.zoom-1 {
  max-width: 1040px;
}
.photo-cadre.zoom-2 {
  width: 170%;
}
.photo-cadre.zoom-3 {
  width: 250%;
}

.photo-lue {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.photo-calque {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.photo-calque polygon {
  fill: transparent;
  stroke: none;
  cursor: pointer;
  transition: fill 0.12s ease, stroke 0.12s ease;
  vector-effect: non-scaling-stroke;
}

.photo-calque polygon.phrase {
  fill: rgba(255, 210, 77, 0.28);
}

/* Pas de mélange avec la photo : sur un fond sombre, il rendait le jaune
   brun. Un jaune franc et un bord vif restent visibles sur tout fond. */
.photo-calque polygon.actif {
  fill: rgba(255, 210, 77, 0.42);
  stroke: #ffd24d;
  stroke-width: 4px;
}

.photo-calque polygon.choisi {
  fill: rgba(29, 78, 137, 0.28);
  stroke: var(--bleu);
  stroke-width: 3px;
}

/* Bascule photo / texte : tuile en verre posée sur la photo. */
.bouton-bascule {
  position: absolute;
  right: 12px;
  bottom: 10px;
}

.bouton-bascule[hidden] {
  display: none;
}

.t-verre .tuile-ico {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: rgba(28, 28, 30, 0.62);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  color: #fff;
}

.t-verre .tuile-ico svg {
  width: 30px;
  height: 30px;
}

.t-verre .tuile-nom {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(28, 28, 30, 0.62);
  color: #fff;
  font-size: 14px;
}

.lecture-texte.avec-bascule:not(.mode-photo) {
  padding-bottom: 110px;
}

.lecture-bas {
  flex: none;
  padding: 10px 14px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: var(--barre);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 -0.5px 0 var(--bord);
}

.progression {
  max-width: 1040px;
  height: 6px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: var(--papier-2);
  overflow: hidden;
}

.progression span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--vert);
  transition: width 0.3s ease;
}

.commandes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  justify-items: center;
  max-width: 520px;
  margin: 0 auto;
}

.commandes .tuile--grande .tuile-ico {
  width: 92px;
  height: 92px;
  border-radius: 26px;
}

.joue .tuile-ico {
  background: linear-gradient(180deg, #e6661f, var(--terre));
}

/* Vitesse : contrôle segmenté d'iOS. */
.vitesses {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  max-width: 520px;
  margin: 12px auto 0;
  padding: 3px;
  border-radius: 12px;
  background: var(--remplissage);
}

.vitesses button {
  min-height: 44px;
  border-radius: 10px;
  color: var(--encre);
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.vitesses button.actif {
  background: var(--carte);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

/* ------------------------------------------------------------------ réglages */

.voile {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}

.feuille {
  width: 100%;
  max-width: 560px;
  max-height: 92%;
  overflow-y: auto;
  padding: 14px 18px calc(24px + env(safe-area-inset-bottom));
  border-radius: 34px 34px 0 0;
  background: var(--papier);
  color: var(--encre);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.3);
  animation: monte 0.36s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes monte {
  from {
    transform: translateY(100%);
    opacity: 1;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.feuille-titre {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
}

.feuille-titre .barre-bt {
  margin-left: auto;
}

.groupe-titre {
  margin: 26px 0 0;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--encre-douce);
}

.groupe-titre + .tuiles {
  margin-top: 12px;
}

.groupe-suivant {
  margin-top: 28px;
}

/* Les trois tailles : la même icône, de plus en plus grande. */
.tuile.taille-1 .tuile-ico svg {
  width: 26px;
  height: 26px;
}
.tuile.taille-3 .tuile-ico svg {
  width: 48px;
  height: 48px;
}

.note {
  margin: 26px 0 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--encre-douce);
  text-align: center;
}

/* ------------------------------------------------------------------- toast */

.toast {
  position: fixed;
  top: calc(84px + env(safe-area-inset-top));
  left: 50%;
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 14px 22px;
  border-radius: 999px;
  background: rgba(28, 28, 30, 0.86);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -18px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------- chargement */

.chargement {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  background: var(--papier);
  text-align: center;
}

.chargement .rond {
  width: 76px;
  height: 76px;
  border: 7px solid var(--bord);
  border-top-color: var(--vert);
  border-radius: 50%;
  animation: tourne 0.9s linear infinite;
}

@keyframes tourne {
  to {
    transform: rotate(360deg);
  }
}

.chargement p {
  max-width: 20ch;
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.3;
}

.chargement small {
  max-width: 28ch;
  font-size: 17px;
  color: var(--encre-douce);
}


/* ------------------------------------------------------------------ bienvenue */

.bienvenue {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
  background: var(--papier);
  color: var(--encre);
  text-align: center;
}

.bienvenue-logo {
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  border-radius: 27px;
  background: linear-gradient(180deg, #2fa353, var(--vert));
  color: #fff;
  box-shadow: var(--ombre-ico);
}

.bienvenue-logo svg {
  width: 64px;
  height: 64px;
}

.bienvenue h1 {
  margin: 6px 0 0;
  font-size: clamp(36px, 11vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.bienvenue p {
  max-width: 24ch;
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
  color: var(--encre-douce);
}

.bienvenue .tuiles {
  width: 100%;
  max-width: 340px;
  margin-top: 18px;
}

/* ------------------------------------------------------------------ écrans */

.chargement .tuile {
  margin-top: 6px;
}





/* ------------------------------------------------------------- adaptations */

@media (min-width: 760px) {
  .accueil {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 760px;
  }
  .appli-ico {
    width: 140px;
  }
  .ecran {
    padding: 28px 26px calc(34px + env(safe-area-inset-bottom));
  }
  .vue {
    max-width: 640px;
  }
}

@media (max-width: 374px) {
  .marque-nom {
    display: none;
  }
  .barre-bt {
    min-width: 54px;
  }
}

@media (max-width: 390px) {
  .definition {
    font-size: 19px;
    grid-template-columns: 28px minmax(0, 1fr) 24px;
  }
  .tuile-ico {
    width: 70px;
    height: 70px;
    border-radius: 20px;
  }
}

@media (max-height: 560px) {
  .bienvenue {
    gap: 10px;
    padding-top: 12px;
  }
  .bienvenue-logo {
    width: 74px;
    height: 74px;
    border-radius: 18px;
  }
  .bienvenue-logo svg {
    width: 42px;
    height: 42px;
  }
  .bienvenue h1 {
    font-size: 30px;
  }
  .bienvenue p {
    font-size: 18px;
  }
  .micro {
    width: 128px;
    height: 128px;
  }
  .micro svg {
    width: 42px;
    height: 42px;
  }
}

/* Moins de mouvement : fondus courts, pas de glissement ni de rebond. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Moins de transparence : barres et verre deviennent pleins. */
@media (prefers-reduced-transparency: reduce) {
  .barre,
  .lecture-bas {
    background: var(--carte);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .t-verre .tuile-ico,
  .t-verre .tuile-nom,
  .toast {
    background: #1c1c1e;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root:not([data-theme="nuit"]) {
    --bord: #6e6e73;
    --encre-douce: #2c2c2e;
  }
  [data-theme="nuit"] {
    --bord: #8e8e93;
    --encre-douce: #e5e5ea;
  }
  .t-gris .tuile-ico,
  .definition,
  .zone-texte,
  .zone-dictee,
  .champ-mot {
    border: 2px solid var(--bord);
  }
}
