/* ============================================================
   styles.css — Style « cartoon pastel » pour enfants de 6–9 ans
   Règles : grandes zones tactiles (≥ 64 px), couleurs douces,
   coins arrondis, fonctionne en portrait et en paysage.
   ============================================================ */

:root {
  --mint: #7ad7c9;
  --mint-d: #3fb9a6;
  --sky: #bfe6ff;
  --sky-d: #5ab6ef;
  --cream: #fff7ed;
  --sun: #ffd166;
  --sun-d: #b98600;
  --coral: #ff8a80;
  --grape: #b39ddb;
  --ink: #264653;
  --ink-soft: #54707c;
  --shadow: 0 10px 30px rgba(38, 70, 83, 0.18);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: ui-rounded, "Comic Sans MS", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #d8f3ee, #cdeafe 60%, #e7dcff);
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

/* ---------- Écrans (un seul visible à la fois) ---------- */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  overflow-y: auto;
  text-align: center;
}
.screen.active { display: flex; }

.hidden { display: none !important; }

h1 { font-size: clamp(26px, 6vw, 40px); margin: 0; line-height: 1.2; }
h2 { font-size: clamp(22px, 5vw, 32px); margin: 0; }
p.sub { font-size: clamp(16px, 3.6vw, 20px); color: var(--ink-soft); margin: 0; line-height: 1.5; }

/* ---------- Boutons : zone tactile ≥ 64 px ---------- */
.btn {
  border: none;
  border-radius: 999px;
  min-height: 64px;
  padding: 14px 30px;
  font: inherit;
  font-weight: 700;
  font-size: clamp(18px, 4vw, 22px);
  color: #fff;
  background: var(--mint-d);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12); }
.btn:focus-visible { outline: 4px solid var(--sun); outline-offset: 2px; }
.btn.sun { background: var(--sun); color: #7a5800; }
.btn.sky { background: var(--sky-d); }
.btn.ghost { background: #ffffffcc; color: var(--ink); box-shadow: 0 6px 0 #d6e2e6; }
.btn.xl { min-height: 76px; padding: 18px 44px; font-size: clamp(22px, 5vw, 28px); }

/* ---------- Boutons flottants (retour, 🔊, engrenage) ---------- */
.fab {
  position: fixed;
  z-index: 30;
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 50%;
  font-size: 28px;
  background: #ffffffe6;
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fab:active { transform: scale(0.92); }
#btn-back { top: 14px; left: 14px; }
#btn-speaker { top: 14px; right: 14px; background: var(--sun); }
#btn-speaker:active { animation: pulse 0.4s; }
@keyframes pulse { 50% { transform: scale(1.15); } }

/* Musique : petit bouton discret en bas à gauche */
.fab-music {
  top: auto;
  bottom: 14px;
  left: 14px;
  width: 52px;
  height: 52px;
  font-size: 22px;
  background: #ffffffb3;
  opacity: 0.8;
}
.fab-music.off, #btn-speaker.off { opacity: 0.45; filter: grayscale(1); }
/* sur les écrans avec bulle/indice en bas (clinique, brossage),
   le bouton musique remonte pour ne rien recouvrir */
.fab-music.hud-lift { bottom: 132px; }

/* Engrenage discret (accès adultes) : petit et semi-transparent */
#btn-gear {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 30;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.35);
  opacity: 0.55;
  cursor: pointer;
}

/* ---------- Écran de démarrage ---------- */
.logo-tooth {
  font-size: clamp(70px, 18vw, 120px);
  line-height: 1;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-14px) rotate(4deg); }
}

.tts-warning {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--ink-soft);
  box-shadow: var(--shadow);
  max-width: 90vw;
  z-index: 40;
}

/* ---------- Écran d'accueil : dentiste + bulle ---------- */
.welcome-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 900px;
}

.dentist-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Avatar 3D de l'écran d'accueil (fond transparent) */
.welcome-avatar {
  width: min(56vw, 270px);
  height: min(38vh, 300px);
  display: block;
}

.badge-pill {
  background: #ffffffcc;
  border-radius: 999px;
  padding: 10px 22px;
  font-weight: 700;
  font-size: 17px;
  box-shadow: var(--shadow);
}

/* Portrait cartoon du vrai dentiste (photo → dessin) */
.welcome-portrait {
  width: min(56vw, 260px);
  height: min(56vw, 260px);
  max-height: 40vh;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid #fff;
  box-shadow: var(--shadow);
  background: #eafaf6;
  animation: bob 3s ease-in-out infinite;
}

.bubble {
  background: #fff;
  border: 4px solid var(--sky);
  border-radius: 24px;
  padding: 16px 22px;
  font-size: clamp(17px, 4vw, 22px);
  line-height: 1.5;
  box-shadow: var(--shadow);
  max-width: 560px;
  position: relative;
}
.bubble::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  border: 10px solid transparent;
  border-bottom-color: var(--sky);
}

/* En paysage : dentiste à gauche, bulle à droite */
@media (orientation: landscape) and (max-height: 560px) {
  .screen { gap: 10px; padding: 14px; }
  .welcome-wrap { flex-direction: row; }
  .welcome-avatar { width: min(26vw, 180px); height: min(52vh, 210px); }
  .btn.xl { min-height: 64px; padding: 12px 36px; }
  .bubble::before {
    top: 50%;
    left: -18px;
    transform: translateY(-50%);
    border: 10px solid transparent;
    border-right-color: var(--sky);
  }
}


/* Étoiles de renforcement positif */
.star-pop {
  position: fixed;
  z-index: 60;
  font-size: 30px;
  pointer-events: none;
  animation: starfly 1.2s ease-out forwards;
}
@keyframes starfly {
  from { opacity: 1; transform: translateY(0) scale(0.6); }
  to { opacity: 0; transform: translateY(-130px) scale(1.5); }
}

/* ---------- Écran réglages (adultes) ---------- */
.setup-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 26px;
  width: min(560px, 94vw);
  max-height: 92dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.setup-card h2 { text-align: center; font-size: 24px; }
.setup-card label { font-weight: 700; font-size: 15px; color: var(--ink-soft); }
.setup-card input[type="text"] {
  font: inherit;
  font-size: 18px;
  padding: 12px 16px;
  border: 3px solid var(--mint);
  border-radius: 14px;
  width: 100%;
  outline: none;
}
.setup-card input[type="text"]:focus { border-color: var(--sun); }
.setup-card select {
  font: inherit;
  font-size: 17px;
  padding: 12px 14px;
  border: 3px solid var(--mint);
  border-radius: 14px;
  width: 100%;
  background: #fff;
  color: var(--ink);
}
.setup-card .btn { min-height: 56px; font-size: 17px; }
.setup-row { display: flex; gap: 10px; align-items: center; }
.setup-row input { flex: 1; min-width: 0; }
.setup-note { font-size: 13px; color: var(--ink-soft); text-align: center; margin: 0; }
.setup-session { font-size: 13px; color: var(--ink-soft); background: #f2f7f9; border-radius: 10px; padding: 8px 12px; text-align: center; }

/* ---------- Écran de la clinique 3D ---------- */
.clinic-screen { padding: 0; }
.clinic-screen.active { display: block; }

#clinic-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none; /* le doigt sert à regarder / toucher, pas à défiler */
  transition: filter 0.45s ease, transform 0.45s ease;
}
/* Un outil est présenté : la pièce se floute derrière lui (légèrement
   agrandie, pour que le bord flou ne laisse pas voir le fond). */
#clinic-canvas.flou-outil {
  filter: blur(3.5px) brightness(0.7);   /* flou moitié moins fort, pièce assombrie */
  transform: scale(1.02);
}
/* La vidéo du brossage, en plein écran par-dessus la clinique */
#video-brossage {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px;
  background: rgba(20, 30, 40, 0.88);
}
#video-brossage .pulse { animation: pulse 1s ease-in-out infinite; }
#video-brossage video {
  width: min(100%, 900px);
  max-height: 75vh;
  border-radius: 18px;
  background: #000;
}

#clinic-calque-outil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* Fondu doux entre les deux pièces */
#clinic-fade {
  position: absolute;
  inset: 0;
  background: #dcf0fa;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 5;
}
#clinic-fade.show { opacity: 1; }

/* ---------- Écran de chargement ---------- */
#ecran-chargement {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(160deg, var(--sky) 0%, var(--cream) 100%);
  transition: opacity 0.5s ease;
}
#ecran-chargement.sortie { opacity: 0; pointer-events: none; }
.chg-dent { font-size: 88px; animation: chg-saut 1s ease-in-out infinite; }
@keyframes chg-saut { 50% { transform: translateY(-18px) rotate(-6deg); } }
.chg-titre { margin: 0; font-size: 26px; font-weight: 800; color: var(--ink); text-align: center; }
.chg-barre {
  width: min(80vw, 420px);
  height: 22px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.chg-barre span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 11px;
  background: linear-gradient(90deg, var(--mint), var(--mint-d));
  transition: width 0.25s ease;
}
.chg-pourcent { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink-soft); }

.clinic-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-soft);
  z-index: 6;
}

/* Bulle de dialogue + bouton d'action, par-dessus la 3D */
.clinic-hud {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.clinic-hud .btn { pointer-events: auto; }

.clinic-bubble {
  max-width: 620px;
  width: 100%;
  font-size: clamp(15px, 3.4vw, 19px);
  padding: 12px 18px;
  min-height: 30px;
}
.clinic-bubble::before { display: none; } /* pas de flèche en mode HUD */
.clinic-bubble:empty { opacity: 0; }

/* ---------- Découverte des instruments (Niveau 1) ---------- */
.inst-progress {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  background: #ffffffd9;
  border-radius: 999px;
  padding: 6px 14px;
  display: flex;
  gap: 6px;
  box-shadow: var(--shadow);
}
.inst-dot { font-size: 20px; line-height: 1; opacity: 0.25; }
.inst-dot.cur { opacity: 1; animation: bob 1.2s ease-in-out infinite; }
.inst-dot.done { opacity: 1; }

.inst-card {
  pointer-events: auto;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 14px 18px;
  width: 100%;
  max-width: 620px;
  text-align: center;
  animation: fade-in 0.25s ease;
}
@keyframes fade-in { from { opacity: 0; transform: translateY(14px); } }
.inst-card h3 { margin: 0 0 4px; font-size: clamp(20px, 4.5vw, 26px); }
.inst-card p { margin: 0 0 8px; font-size: clamp(14px, 3.2vw, 17px); color: var(--ink-soft); line-height: 1.35; }
.inst-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.inst-btns .btn { min-height: 56px; font-size: 16px; padding: 10px 18px; }
.inst-btns .btn[disabled] { opacity: 0.45; pointer-events: none; }


/* Quand une carte est ouverte, la bulle du bas se range */
.hud-card-open .clinic-bubble { display: none; }

/* ---------- Mini-jeu du brossage ---------- */
#brush-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.brush-progress { font-size: 22px; }
.brush-progress .ok { filter: none; }
.brush-hint {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffffe6;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 700;
  font-size: clamp(16px, 3.6vw, 20px);
  box-shadow: var(--shadow);
  animation: hint-bob 1.6s ease-in-out infinite;
  pointer-events: none;
  white-space: nowrap;
  z-index: 8;
}
@keyframes hint-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -10px); }
}

/* ---------- Écran de fin : badge + confettis ---------- */
.badge-star {
  font-size: clamp(90px, 22vw, 150px);
  line-height: 1;
  animation: badge-pop 0.9s cubic-bezier(0.2, 1.6, 0.4, 1), bob 2.4s 1s ease-in-out infinite;
  filter: drop-shadow(0 10px 22px rgba(255, 180, 0, 0.45));
}
@keyframes badge-pop {
  from { transform: scale(0) rotate(-120deg); }
  to { transform: scale(1) rotate(0); }
}
.rowbtns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.confetti {
  position: fixed;
  top: -20px;
  z-index: 50;
  width: 12px;
  height: 18px;
  border-radius: 3px;
  pointer-events: none;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.6; }
}

/* ---------- Diplôme de courage (verre) ----------
   Une carte de verre posée sur des taches de couleur floues : le
   verre a quelque chose à montrer derrière lui. */
#screen-diploma {
  background:
    radial-gradient(38vmax 30vmax at 12% 18%, rgba(255, 209, 102, 0.55), transparent 70%),
    radial-gradient(34vmax 28vmax at 88% 30%, rgba(90, 182, 239, 0.45), transparent 70%),
    radial-gradient(40vmax 30vmax at 50% 95%, rgba(122, 215, 201, 0.5), transparent 70%);
}
.diploma {
  position: relative;
  width: min(620px, 92vw);
  padding: clamp(22px, 5vw, 40px) clamp(18px, 5vw, 40px) clamp(18px, 4vw, 28px);
  text-align: center;
  color: var(--ink);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.3);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: var(--verre-flou);
  backdrop-filter: var(--verre-flou);
}
/* la médaille : une dent dans un rond doré */
.diploma-medaille {
  width: clamp(74px, 18vw, 104px);
  height: clamp(74px, 18vw, 104px);
  margin: 0 auto 6px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: clamp(38px, 9vw, 54px);
  background: rgba(255, 209, 102, 0.3);
  border: 3px solid rgba(214, 160, 20, 0.75);
}
.diploma-stars { font-size: clamp(18px, 4.5vw, 26px); letter-spacing: 6px; margin: 0; }
.diploma-title {
  font-size: clamp(28px, 7vw, 44px);
  margin: 4px 0 2px;
  color: #b98600;
}
.diploma-award { margin: 8px 0 2px; color: var(--ink-soft); font-size: clamp(14px, 3.4vw, 18px); }
.diploma-name {
  font-size: clamp(28px, 7vw, 42px);
  font-weight: 800;
  margin: 2px 0 8px;
  padding: 2px 26px 6px;
  display: inline-block;
  border-bottom: 2px solid rgba(214, 160, 20, 0.6);
}
.diploma-reason { font-size: clamp(14px, 3.4vw, 17px); line-height: 1.55; margin: 6px auto 12px; max-width: 460px; }
/* les amis rencontrés pendant la visite */
.diploma-outils { display: flex; justify-content: center; gap: clamp(8px, 3vw, 16px); margin: 4px 0 16px; }
.diploma-outils span {
  width: clamp(40px, 10vw, 52px); height: clamp(40px, 10vw, 52px);
  display: grid; place-items: center; border-radius: 50%;
  font-size: clamp(20px, 5vw, 26px);
  background: rgba(255, 255, 255, 0.3);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
}
.diploma-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: clamp(13px, 3vw, 16px);
  color: var(--ink-soft);
  border-top: 1.5px solid rgba(255, 255, 255, 0.7);
  padding-top: 12px;
}

/* ---------- Rapport pour le dentiste ---------- */
.report-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 26px;
  width: min(680px, 94vw);
  max-height: 92dvh;
  overflow-y: auto;
  text-align: left;
}
.report {
  font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  user-select: text;
}
.report .rp-title { text-align: center; margin: 0 0 6px; font-size: 24px; }
.report .rp-sub { color: var(--ink-soft); font-size: 12.5px; margin: 0 0 8px; text-align: center; }
.report .rp-meta { font-size: 13px; color: var(--ink-soft); text-align: center; border-bottom: 2px solid #e8eef0; padding-bottom: 10px; }
.report h3 { margin: 16px 0 6px; font-size: 16px; border-bottom: 2px solid #e8eef0; padding-bottom: 4px; }
.report ul { margin: 6px 0; padding-left: 20px; }
.report .rp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.report .rp-table th, .report .rp-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #eef2f4; }
.report .rp-table th { color: var(--ink-soft); font-size: 12.5px; }
.report .rp-table tr.warn td { background: #fff4f0; }
.report .rp-table tr.skip td { background: #f7f9fa; color: var(--ink-soft); }
.report .tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef4f6; }
.report .tag.ok { background: #e3f8ec; color: #1d7a4d; }
.report .tag.warn { background: #ffe0db; color: #b23b2c; }
.report .rp-advice {
  background: #f3fbff;
  border-left: 4px solid var(--sky-d);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 6px 0;
  font-size: 14px;
}
.report .rp-disclaimer {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  border-top: 2px solid #e8eef0;
  padding-top: 10px;
  text-align: center;
}
.report .rp-mini { font-size: 13px; color: var(--ink-soft); }
.report .rp-empty { text-align: center; color: var(--ink-soft); padding: 18px 0; }
.report-actions { margin-top: 14px; }

/* Impression : seule la page active (diplôme OU rapport) sort sur papier */
@media print {
  body { background: #fff !important; overflow: visible; }
  .screen, .fab, #btn-gear, .tts-warning,
  .diploma-actions, .report-actions { display: none !important; }
  #screen-diploma.active { display: flex !important; position: static; padding: 0; }
  #screen-diploma { background: none !important; }
  .diploma {
    width: 100%;
    background: #fff !important;
    border: 4px solid #d6a014;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    page-break-inside: avoid;
  }
  #screen-report.active { display: block !important; position: static; padding: 0; }
  .report-card {
    width: 100%;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }
}

/* ---------- Réglages : rangées d'options + aperçu 3D ---------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 3px solid transparent;
  border-radius: 14px;
  background: #eef4f6;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  min-height: 44px;
}
.chip.sel { background: #fff2cf; border-color: var(--sun); }

.swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #d6e2e6;
  cursor: pointer;
  padding: 0;
}
.swatch.sel { box-shadow: 0 0 0 3px var(--ink); }

.setup-preview {
  width: 100%;
  height: 230px;
  display: block;
  background: linear-gradient(160deg, #eafaf6, #e3f2fd);
  border-radius: 18px;
}

/* Enregistrement de la voix du dentiste (écran ⚙️) */
.vrec-script {
  background: #f3fbff;
  border-left: 4px solid var(--sky-d);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
}
.vrec-script p { margin: 6px 0 0; font-style: italic; color: var(--ink-soft); }
.vrec-progress { margin-top: 4px; }
.vrec-bar {
  height: 14px;
  border-radius: 999px;
  background: #e6eef1;
  overflow: hidden;
}
.vrec-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--mint-d);
  transition: width 0.25s ease;
}
.vrec-rec-on { background: var(--coral) !important; animation: pulse 1.2s infinite; }

/* Message d'erreur du micro : doit sauter aux yeux */
.vman-alert {
  background: #fff1f0;
  border: 2px solid var(--coral);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #8a2f28;
}

/* Les phrases clés dites par le dentiste, une par une */
.vman { display: flex; flex-direction: column; gap: 10px; }
.vman-count { margin: 0; text-align: center; font-weight: 700; color: var(--ink-soft); }
.vman-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.vman-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #dbe7ec;
  background: #fff;
  color: var(--ink-soft);
  font: 700 13px/1 inherit;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.vman-dot:hover { transform: scale(1.1); }
.vman-dot.ok { background: var(--mint-d); border-color: var(--mint-d); color: #fff; }
.vman-dot.cur { border-color: var(--sky-d); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06); }
.vman-step { margin: 0; text-align: center; font-size: 13px; color: var(--ink-soft); }
.vman-line {
  margin: 0;
  background: #fffdf3;
  border-left: 4px solid var(--sun);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
}
.vman-line.done { background: #f2fbf6; border-left-color: var(--mint-d); }
.vman-hint { text-align: center; min-height: 1.2em; }
.vman-nav { justify-content: center; }
.vman-nav .btn { flex: 1; }
.vman .btn:disabled { opacity: 0.4; cursor: default; }

.setup-sep { border: none; border-top: 2px solid #eef4f6; margin: 4px 0; }
.setup-h3 { margin: 0; font-size: 18px; text-align: center; }

/* ---------- Mode édition des meubles (?edit, adultes) ---------- */
#edit-panel {
  position: fixed;
  top: 90px;
  left: 12px;
  z-index: 40;
  background: #ffffffef;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px;
  width: 205px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink);
}
#edit-panel #edit-name { font-weight: 700; margin-bottom: 8px; }
#edit-panel .edit-row { display: flex; gap: 6px; margin-bottom: 6px; }
#edit-panel button {
  flex: 1;
  min-height: 40px;
  border: none;
  border-radius: 10px;
  background: #eef4f6;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
#edit-panel button:active { background: var(--sun); }
#edit-panel #edit-info { color: var(--ink-soft); font-size: 11.5px; line-height: 1.4; }

/* ---------- Écran provisoire (fin de phase) ---------- */
.dev-note { font-size: 13px; color: var(--ink-soft); opacity: 0.7; }

/* ---------- Garçon ou fille : deux grandes images ---------- */
.choix-genre {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(14px, 4vw, 36px);
}
.choix-carte {
  width: min(42vw, 280px);
  border: 6px solid transparent;
  border-radius: 28px;
  background: #ffffffe6;
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 14px;
  transition: transform 0.12s;
}
.choix-carte img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 20px; }
.choix-carte span { font-weight: 800; font-size: clamp(18px, 4vw, 24px); }
.choix-carte:active { transform: scale(0.94); }
.choix-carte.sel { border-color: var(--sun); background: #fff7e0; transform: scale(1.05); }
.choix-carte:disabled:not(.sel) { opacity: 0.4; }
@media (orientation: landscape) and (max-height: 560px) {
  .choix-carte { width: min(30vw, 44vh, 200px); }
}

/* ---------- La photo de l'enfant ---------- */
.photo-cadre {
  position: relative;
  width: min(86vw, 58vh, 460px);
  aspect-ratio: 3 / 4;
  border-radius: 28px;
  overflow: hidden;
  background: #1d2b36;
  box-shadow: var(--shadow);
}
.photo-cadre video,
.photo-cadre canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* comme dans une glace : l'enfant se voit en miroir */
.photo-cadre video,
.photo-cadre canvas { transform: scaleX(-1); }
.photo-ovale {
  position: absolute;
  left: 50%; top: 44%;
  width: 58%; height: 56%;
  transform: translate(-50%, -50%);
  border: 5px dashed #ffffffd9;
  border-radius: 50%;
  box-shadow: 0 0 0 999px #00000040;   /* assombrit autour du rond */
  pointer-events: none;
}
.photo-compte {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(90px, 22vw, 160px);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 4px 18px #0008;
  pointer-events: none;
}
.photo-flash {
  position: absolute; inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.photo-flash.flash { animation: photo-flash 0.5s ease-out; }
@keyframes photo-flash { from { opacity: 0.95; } to { opacity: 0; } }
.photo-sans-camera {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 700;
  line-height: 1.5;
}
.photo-boutons { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
@media (orientation: landscape) and (max-height: 560px) {
  #screen-photo { flex-direction: row; flex-wrap: wrap; }
  #screen-photo h2 { width: 100%; }
  .photo-cadre { width: auto; height: 62vh; }
  .photo-boutons { flex-direction: column; }
}

/* ---------- On fabrique ton personnage ---------- */
.fab-image {
  width: min(60vw, 38vh, 300px);
  aspect-ratio: 2 / 3;
  border-radius: 24px;
  background: #ffffffe6;
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.fab-image img { width: 100%; height: 100%; object-fit: contain; animation: fab-apparait 0.8s ease-out; }
@keyframes fab-apparait { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: none; } }
.fab-attente { font-size: clamp(64px, 14vw, 110px); animation: fab-baguette 1.4s ease-in-out infinite; }
@keyframes fab-baguette { 50% { transform: rotate(-18deg) scale(1.1); } }
.fab-barre { width: min(80vw, 420px); }
.fab-pourcent { margin: 0; font-weight: 800; font-size: 20px; }
@media (orientation: landscape) and (max-height: 560px) {
  #screen-fabrication { flex-direction: row; flex-wrap: wrap; }
  #screen-fabrication h2 { width: 100%; }
  .fab-image { width: auto; height: 58vh; }
}

/* ============================================================
   Verre (Aya) : boutons et bulles de texte au fond TRANSPARENT, qui
   laisse voir ce qui est derrière, un peu flouté. Rien d'autre : ni
   ombre, ni reflet, ni liseré, ni halo.
   ============================================================ */
:root { --verre-flou: blur(2px); }
.btn, .fab,
.bubble, .inst-card, .inst-progress, .badge-pill, .tts-warning, .brush-hint,
.choix-carte,
.btn.sun, .btn.sky, .btn.ghost, #btn-speaker,
.choix-carte.sel {
  background: transparent;
  -webkit-backdrop-filter: var(--verre-flou);
  backdrop-filter: var(--verre-flou);
  box-shadow: none;
  text-shadow: none;
  border: 1.5px solid rgba(255, 255, 255, 0.6);   /* un fin contour blanc à 60 % (Aya) */
  color: var(--ink);
}
.btn:active { transform: scale(0.95); box-shadow: none; }
/* leur couleur revient, à 30 % (Aya) */
.btn { background: rgba(63, 185, 166, 0.3); }
/* les boutons sans couleur : comme les bulles de texte (blanc à 30 %) */
.fab { background: rgba(255, 255, 255, 0.3); }
.btn.sun, #btn-speaker { background: rgba(255, 209, 102, 0.3); }
.btn.sky { background: rgba(90, 182, 239, 0.3); }
.btn.ghost { background: rgba(255, 255, 255, 0.3); }
/* bulles et cartes de texte : fond blanc à 30 % (Aya) */
.bubble, .inst-card, .inst-progress, .badge-pill, .tts-warning, .brush-hint { background: rgba(255, 255, 255, 0.3); }
/* les cartes « garçon / fille » : le même fond que les bulles (Aya) */
.choix-carte, .choix-carte.sel { background: rgba(255, 255, 255, 0.3); }
.bubble::before { border-bottom-color: transparent; }
@media (orientation: landscape) and (max-height: 560px) {
  .bubble::before { border-right-color: transparent; }
}
.inst-card p { color: var(--ink); }
/* la carte choisie (garçon / fille, émotion) garde son contour jaune */
.choix-carte.sel { border: 3px solid var(--sun); }

/* « Passer cette étape » (photo) : discret, sous les grands boutons */
.photo-sauter { min-height: 52px; padding: 10px 22px; font-size: clamp(15px, 3.4vw, 18px); }

/* ---------- Téléphone et tablette : boutons plus petits (Aya) ----------
   Toujours ≥ 44 px de haut : un petit doigt les touche encore sans peine. */
@media (max-width: 900px), (pointer: coarse) {
  .btn { min-height: 48px; padding: 10px 22px; font-size: clamp(15px, 3.6vw, 18px); gap: 8px; }
  .btn.xl { min-height: 56px; padding: 12px 30px; font-size: clamp(17px, 4.4vw, 22px); }
  .inst-btns .btn { min-height: 46px; font-size: 15px; padding: 8px 16px; }
  .photo-sauter { min-height: 44px; padding: 8px 18px; font-size: clamp(14px, 3.2vw, 16px); }
  .fab { width: 50px; height: 50px; font-size: 22px; }
  .fab-music { width: 44px; height: 44px; font-size: 19px; }
}

/* Salle de soins : pas de boutons 🔊 ni 🎵 (voir clinic.js, marquerPiece) */
body.en-soins #btn-speaker,
body.en-soins #btn-music { display: none !important; }


/* Choix de la langue, sur le premier écran */
.langues { display: flex; gap: 12px; justify-content: center; margin-top: 6px; }
.langues .btn { min-height: 48px; padding: 8px 22px; font-size: 18px; }
.langues .langue.sel { border: 2px solid var(--sun); background: rgba(255, 209, 102, 0.3); }
/* en arabe, une police qui a de belles lettres arabes */
html[lang="ar"] body { font-family: "Geeza Pro", "Noto Naskh Arabic", "Segoe UI", Tahoma, system-ui, sans-serif; }
