/* ═══════════════ « Parlons-en » — le jeu sur le VIH (module jeu) ═══════════════
   Classes préfixées .pe- (le jeu, aussi dans le fichier autonome) et .jx- (son écran dans Djouney).
   Jetons d'Encre & Cire repris quand ils existent (porcelaine.css), avec des valeurs de repli pour le
   fichier autonome. Tailles en em : le réglage « Taille du texte » agit sur --pe-echelle.
   Contrastes : texte ≥ 4,5:1 sur le lait et la crème ; l'état d'un choix ne dépend jamais de la seule couleur. */

.pe {
  --pe-papier: var(--porcelain, #F4ECE2);
  --pe-lait: var(--milk, #FCF8F2);
  --pe-relief: var(--relief, #DDCFBF);
  --pe-encre: var(--ink, #2B1D2C);
  --pe-encre-douce: rgba(var(--ink-rgb), .8);
  --pe-encre-pale: rgba(var(--ink-rgb), .58);
  --pe-juste: #2F6143;          /* vert sauge foncé : 6,4:1 sur le lait */
  --pe-juste-fond: #E3EEE5;
  --pe-nuance: #7A4A10;         /* ambre brun : 6,6:1 sur le lait */
  --pe-nuance-fond: #F6EAD6;
  --pe-alerte: var(--carmine, #A3121B);
  --pe-secret: #3F5486;
  --pe-surligne: #F7E27E;
  --pe-n0: #2F6143;
  --pe-n1: #6B6A1E;
  --pe-n2: #A2541A;
  --pe-n3: #A3121B;
  --pe-ombre: var(--emboss-sm, -3px -3px 7px rgba(var(--light-rgb), calc(.88 * var(--hl-a))), 4px 5px 10px rgba(var(--shadow-rgb), .2));
  --pe-ombre-forte: var(--emboss, -7px -7px 16px rgba(var(--light-rgb), calc(.9 * var(--hl-a))), 9px 11px 22px rgba(var(--shadow-rgb), .22));
  --pe-creux: var(--deboss, inset 4px 5px 9px rgba(var(--shadow-rgb), .2), inset -4px -4px 8px rgba(var(--light-rgb), calc(.88 * var(--hl-a))));
  --pe-main: var(--font-hand, "Segoe Print", "Bradley Hand", cursive);
  --pe-serif: var(--font-serif, Georgia, "Times New Roman", serif);
  --pe-ui: var(--font-ui, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  --pe-ease: var(--ease, cubic-bezier(.22, .8, .24, 1));

  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--pe-ui);
  font-size: calc(15px * var(--pe-echelle, 1));
  line-height: 1.5;
  color: var(--pe-encre);
}
/* Remises à zéro sans poids (:where) : la moindre classe du jeu passe devant. */
:where(.pe) *, :where(.pe) *::before, :where(.pe) *::after { box-sizing: border-box; }
:where(.pe) :where(button, input, textarea, select) { font: inherit; color: inherit; }
:where(.pe) button { cursor: pointer; }
.pe q { quotes: "«\00a0" "\00a0»"; }
.pe :focus-visible { outline: 2px solid var(--pe-encre); outline-offset: 3px; border-radius: 8px; }
.pe [tabindex="-1"]:focus { outline: none; }
:where(.pe) :where(p, h1, h2, h3, ul, ol) { margin: 0; }
.pe-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pe [hidden] { display: none !important; }

.pe-icone { display: inline-flex; flex: none; }
.pe-icone svg { width: 1.3em; height: 1.3em; }

/* ─── Barre du haut, défilement ─── */
.pe-barre {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px;
}
.pe-barre__titre { font-family: var(--pe-serif); font-style: italic; font-size: 1em; color: var(--pe-encre-douce); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-icone-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--pe-lait);
  color: var(--pe-encre);
  box-shadow: var(--pe-ombre);
}
.pe-icone-btn:active { box-shadow: var(--pe-creux); }
.pe-icone-btn .pe-icone svg { width: 20px; height: 20px; }
.pe-defile {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: 6px 16px calc(40px + env(safe-area-inset-bottom, 0px));
  scroll-padding: 70px 0 90px;
}
.pe-defile > * + * { margin-top: 18px; }

/* ─── Textes ─── */
.pe-une__titre { font-family: var(--pe-main); font-weight: 500; font-size: 3.2em; line-height: 1; }
.pe-une__sous { margin-top: 6px; font-family: var(--pe-serif); font-style: italic; font-size: 1.1em; color: var(--pe-encre-douce); }
.pe-une .pe-texte { margin-top: 10px; }
.pe-grand-titre { font-family: var(--pe-main); font-weight: 500; font-size: 2.4em; line-height: 1.05; }
.pe-section-titre { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 1em; font-weight: 600; }
.pe-texte { color: var(--pe-encre-douce); line-height: 1.55; }
.pe-aide { font-size: .92em; color: var(--pe-encre-douce); line-height: 1.5; }
.pe-avertissement {
  padding: 12px 14px;
  border-left: 3px solid var(--pe-relief);
  font-family: var(--pe-serif);
  font-style: italic;
  font-size: .92em;
  color: var(--pe-encre-douce);
}
.pe-relecture {
  padding: 6px 10px;
  border-radius: 8px;
  background: #FFF5C9;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .78em;
  color: var(--pe-encre);
  overflow-wrap: anywhere;
}

/* ─── Boutons ─── */
.pe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--pe-lait);
  color: var(--pe-encre);
  box-shadow: var(--pe-ombre);
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  transition: transform .15s var(--pe-ease), box-shadow .25s var(--pe-ease);
}
.pe-btn:active { transform: translateY(1px); box-shadow: var(--pe-creux); }
.pe-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.pe-btn--plein { background: var(--pe-encre); color: var(--pe-lait); box-shadow: 0 6px 16px rgba(var(--ink-rgb), .25); }
.pe-btn--plein:active { box-shadow: 0 2px 6px rgba(var(--ink-rgb), .3); }
.pe-btn--large { width: 100%; min-height: 56px; font-size: 1.05em; }
.pe-btn--bloc { width: 100%; }
.pe-btn--discret { background: transparent; box-shadow: none; text-decoration: underline; text-underline-offset: 4px; min-height: 44px; padding: 6px 10px; }
.pe-btn--discret:active { box-shadow: none; }
.pe-btn--danger { color: var(--pe-alerte); }
.pe-continuer { width: 100%; margin-top: 14px; }
.pe-rangee { display: flex; flex-wrap: wrap; gap: 10px; }
.pe-rangee > * { flex: 1 1 140px; }
.pe-pile { display: flex; flex-direction: column; gap: 10px; padding: 0; list-style: none; }
.pe-pile > li { list-style: none; }

/* ─── Accueil ─── */
.pe-carte-session {
  padding: 18px;
  border-radius: 22px;
  background: var(--pe-lait);
  box-shadow: var(--pe-ombre-forte);
}
.pe-carte-session__titre { font-family: var(--pe-main); font-weight: 500; font-size: 1.9em; line-height: 1.1; }
.pe-carte-session__detail { margin-top: 2px; font-weight: 500; }
.pe-carte-session__rappel { margin: 4px 0 14px; font-family: var(--pe-serif); font-style: italic; color: var(--pe-encre-douce); }
.pe-progres { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 0 4px; font-size: .9em; color: var(--pe-encre-douce); }
.pe-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; padding: 0; list-style: none; margin-top: 8px; }
.pe-tuile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  height: 100%;
  min-height: 104px;
  padding: 14px;
  border: 1.5px solid transparent;
  border-radius: 18px;
  background: var(--pe-lait);
  box-shadow: var(--pe-ombre);
  text-align: left;
}
.pe-tuile:active { box-shadow: var(--pe-creux); }
.pe-tuile__titre { font-weight: 600; line-height: 1.25; }
.pe-tuile__etat { margin-top: auto; font-size: .85em; color: var(--pe-encre-douce); }
.pe-tuile.est-ferme { background: transparent; box-shadow: none; border: 1.5px dashed var(--pe-relief); color: var(--pe-encre-douce); cursor: default; }
.pe-liens { display: flex; flex-direction: column; gap: 8px; }
.pe-lien {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 10px 16px;
  border: 0;
  border-radius: 18px;
  background: var(--pe-lait);
  box-shadow: var(--pe-ombre);
  text-align: left;
}
.pe-lien:active { box-shadow: var(--pe-creux); }
.pe-lien__texte { display: flex; flex-direction: column; min-width: 0; }
.pe-lien__titre { font-weight: 600; }
.pe-lien__detail { font-size: .88em; color: var(--pe-encre-douce); }

/* ─── Activité : en-tête et consigne ─── */
.pe-activite__entete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pe-etapes-session { display: flex; gap: 6px; width: 100%; margin-bottom: 4px; }
.pe-etapes-session span { flex: 1; height: 6px; border-radius: 3px; background: var(--pe-relief); }
.pe-etapes-session .est-fait { background: var(--pe-encre); }
.pe-etapes-session .est-actif { background: linear-gradient(90deg, var(--pe-encre) 50%, var(--pe-relief) 50%); }
.pe-puce {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 8px;
  border-radius: 999px;
  background: var(--pe-lait);
  box-shadow: var(--pe-ombre);
  font-size: .85em;
  font-weight: 500;
}
.pe-puce .pe-icone svg { width: 1.1em; height: 1.1em; }
.pe-puce--rappel { padding-left: 12px; background: var(--pe-nuance-fond); color: var(--pe-nuance); box-shadow: none; }
.pe-consigne { margin: 14px 0 4px; font-family: var(--pe-serif); font-style: italic; font-weight: 400; font-size: 1.15em; line-height: 1.4; }
.pe-scene { margin-top: 12px; }
.pe-zone { margin-top: 12px; }
.pe-contexte {
  display: flex;
  gap: 10px;
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(var(--milk-rgb), .7);
  border-left: 3px solid var(--pe-relief);
  font-family: var(--pe-serif);
  font-style: italic;
  color: var(--pe-encre-douce);
}

/* ─── Conversations ─── */
.pe-tete { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; background: var(--pe-lait); box-shadow: var(--pe-ombre); }
.pe-tete__texte { min-width: 0; }
.pe-tete__nom { font-weight: 600; }
.pe-tete__detail { font-size: .88em; color: var(--pe-encre-douce); }
.pe-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-family: var(--pe-serif);
  font-size: 1.15em;
  color: #fff;
}
.pe-avatars { display: flex; }
.pe-avatars .pe-avatar { width: 34px; height: 34px; font-size: 1em; border: 2px solid var(--pe-lait); }
.pe-avatars .pe-avatar + .pe-avatar { margin-left: -12px; }
.pe-avatar.pe-teinte-0 { background: #8C3B4A; }
.pe-avatar.pe-teinte-1 { background: #3F5486; }
.pe-avatar.pe-teinte-2 { background: #2F6143; }
.pe-avatar.pe-teinte-3 { background: #8A5418; }
.pe-avatar.pe-teinte-4 { background: #5B3F73; }
.pe-bulle__nom.pe-teinte-0 { color: #8C3B4A; }
.pe-bulle__nom.pe-teinte-1 { color: #3F5486; }
.pe-bulle__nom.pe-teinte-2 { color: #2F6143; }
.pe-bulle__nom.pe-teinte-3 { color: #8A5418; }
.pe-bulle__nom.pe-teinte-4 { color: #5B3F73; }

.pe-fil { display: flex; flex-direction: column; gap: 8px; padding: 14px 0 4px; }
.pe-fil--court { padding: 6px 0; }
.pe-bulle {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 18px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  animation: pe-bulle .35s var(--pe-ease);
}
.pe-bulle--eux { align-self: flex-start; border-bottom-left-radius: 6px; background: var(--pe-lait); box-shadow: var(--pe-ombre); }
.pe-bulle--moi { align-self: flex-end; border-bottom-right-radius: 6px; background: var(--pe-encre); color: var(--pe-lait); }
.pe-bulle--recit { align-self: center; max-width: 96%; padding: 6px 8px; background: transparent; font-family: var(--pe-serif); font-style: italic; text-align: center; color: var(--pe-encre-douce); }
.pe-bulle--brouillon { background: transparent; color: var(--pe-encre); border: 1.5px dashed var(--pe-encre-pale); animation: none; }
.pe-bulle--brouillon:empty, .pe-bulle--brouillon .pe-bulle__texte:empty::before { content: '…'; }
.pe-bulle__nom { display: block; margin-bottom: 2px; font-size: .8em; font-weight: 600; }
.pe-bulle--moi .pe-bulle__nom { color: var(--pe-lait); opacity: .85; }
@keyframes pe-bulle { from { opacity: 0; transform: translateY(6px); } }
.pe-ecrit { display: inline-flex; gap: 4px; padding: 14px 16px; }
.pe-ecrit span { width: 7px; height: 7px; border-radius: 50%; background: var(--pe-encre-pale); animation: pe-point 1s infinite ease-in-out; }
.pe-ecrit span:nth-child(2) { animation-delay: .15s; }
.pe-ecrit span:nth-child(3) { animation-delay: .3s; }
@keyframes pe-point { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }

.pe-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  align-self: stretch;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--pe-nuance-fond);
  color: var(--pe-encre);
  font-size: .93em;
  animation: pe-bulle .35s var(--pe-ease);
}
.pe-note .pe-icone { color: var(--pe-nuance); margin-top: 1px; }
.pe-note.est-juste { background: var(--pe-juste-fond); }
.pe-note.est-juste .pe-icone { color: var(--pe-juste); }
.pe-situation { margin-top: 10px; padding: 0 2px; font-weight: 600; }

/* ─── Choix ─── */
.pe-options { display: flex; flex-direction: column; gap: 8px; }
.pe-legende { margin-bottom: 2px; font-size: .9em; font-weight: 600; color: var(--pe-encre-douce); }
.pe-legende--forte { font-size: 1em; color: var(--pe-encre); }
.pe-option {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1.5px solid var(--pe-relief);
  border-radius: 16px;
  background: var(--pe-lait);
  text-align: left;
  line-height: 1.4;
  transition: border-color .2s, background .2s, transform .15s var(--pe-ease);
}
.pe-option:active:not(:disabled) { transform: scale(.99); background: var(--pe-papier); }
.pe-option:disabled { cursor: default; opacity: .55; }
.pe-option.est-choisi { opacity: 1; border: 2px solid var(--pe-encre); background: var(--pe-papier); }
.pe-option.est-detour { opacity: 1; border-style: dashed; color: var(--pe-encre-douce); text-decoration: line-through; text-decoration-thickness: 1px; }
.pe-option--carte { display: flex; flex-direction: column; gap: 2px; }
.pe-option__sur { font-size: .75em; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--pe-encre-douce); }

/* La ligne : quatre crans côte à côte, du plus calme au plus vif. */
.pe-options--ligne { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pe-options--ligne .pe-legende { grid-column: 1 / -1; }
.pe-options--ligne .pe-option { min-height: 66px; padding: 10px 4px; border-top-width: 5px; text-align: center; font-size: .9em; font-weight: 500; hyphens: auto; }
.pe-options--ligne .pe-option:nth-of-type(1) { border-top-color: var(--pe-n0); }
.pe-options--ligne .pe-option:nth-of-type(2) { border-top-color: var(--pe-n1); }
.pe-options--ligne .pe-option:nth-of-type(3) { border-top-color: var(--pe-n2); }
.pe-options--ligne .pe-option:nth-of-type(4) { border-top-color: var(--pe-n3); }

.pe-partie { margin: 0 0 12px; padding: 0; border: 0; }
.pe-radio, .pe-case {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 52px;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1.5px solid var(--pe-relief);
  border-radius: 16px;
  background: var(--pe-lait);
  line-height: 1.4;
  cursor: pointer;
}
.pe-radio input, .pe-case input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--pe-encre); }
.pe-radio:has(input:checked), .pe-case:has(input:checked) { border: 2px solid var(--pe-encre); background: var(--pe-papier); }
.pe-radio:has(input:focus-visible), .pe-case:has(input:focus-visible) { outline: 2px solid var(--pe-encre); outline-offset: 2px; }
.pe-zone > .pe-bulle--brouillon { display: block; margin: 12px 0 12px auto; }
.pe-zone > .pe-btn--plein { width: 100%; }

/* ─── Retour ─── */
.pe-retour {
  padding: 16px 16px 14px;
  border-radius: 20px;
  border-left: 5px solid var(--pe-nuance);
  background: var(--pe-lait);
  box-shadow: var(--pe-ombre);
  animation: pe-bulle .4s var(--pe-ease);
}
.pe-retour.est-juste { border-left-color: var(--pe-juste); }
.pe-retour > * + * { margin-top: 8px; }
.pe-retour__etiquette { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--pe-nuance); }
.pe-retour.est-juste .pe-retour__etiquette { color: var(--pe-juste); }
.pe-retour__fait { font-weight: 600; font-size: 1.05em; line-height: 1.4; }
.pe-retour__expl { color: var(--pe-encre-douce); }
.pe-autre { font-size: .93em; color: var(--pe-encre-douce); }
.pe-autre q { font-style: italic; color: var(--pe-encre); }
.pe-bilan { font-weight: 500; }
.pe-analogie { border-radius: 12px; background: var(--pe-papier); }
.pe-analogie summary { display: flex; align-items: center; min-height: 44px; padding: 0 12px; font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.pe-analogie p { padding: 0 12px 12px; font-family: var(--pe-serif); font-style: italic; color: var(--pe-encre-douce); }

.pe-scores { display: grid; gap: 6px; }
.pe-score { display: grid; grid-template-columns: minmax(0, 9em) 1fr 7.6em; align-items: center; gap: 10px; font-size: .9em; }
.pe-score__barre { height: 8px; border-radius: 4px; background: var(--pe-relief); overflow: hidden; }
.pe-score__barre span { display: block; height: 100%; border-radius: 4px; background: var(--pe-encre); transition: width .6s var(--pe-ease); }
.pe-score__mot { font-weight: 600; text-align: right; }

.pe-notes { display: flex; flex-direction: column; gap: 8px; padding: 0; list-style: none; }
.pe-notes li { padding: 10px 12px; border-radius: 14px; background: var(--pe-papier); font-size: .93em; line-height: 1.45; }
.pe-notes q { font-style: italic; }
.pe-notes__marque { display: block; margin-bottom: 2px; font-size: .85em; font-weight: 600; }
.pe-notes .est-trouve .pe-notes__marque { color: var(--pe-juste); }
.pe-notes .est-manque .pe-notes__marque { color: var(--pe-nuance); }
.pe-notes .est-faux .pe-notes__marque { color: var(--pe-encre-douce); }

/* ─── Rumeur : l'état du groupe ─── */
.pe-groupe { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.pe-groupe__points { display: inline-flex; gap: 4px; }
.pe-groupe__points span { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; }
.pe-groupe__points .est-plein { background: currentColor; }
.pe-groupe--convaincu { color: var(--pe-juste); }
.pe-groupe--hesitant { color: var(--pe-nuance); }
.pe-groupe--braque { color: var(--pe-alerte); }

/* ─── Détective ─── */
.pe-doc {
  display: block;
  padding: 16px 18px 18px;
  border-radius: 6px 6px 18px 18px;
  background: #FFFDF8;
  box-shadow: var(--pe-ombre-forte);
  border-top: 4px solid var(--pe-encre);
}
.pe-doc__type { margin-bottom: 8px; font-size: .78em; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--pe-encre-douce); }
.pe-doc__texte { font-family: var(--pe-serif); font-size: 1.06em; line-height: 1.75; }
.pe-seg {
  padding: 2px 1px;
  border-radius: 4px;
  border-bottom: 2px dotted var(--pe-encre-pale);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  cursor: pointer;
  transition: background .2s;
}
.pe-seg[aria-pressed="true"] { background: var(--pe-surligne); border-bottom: 2px solid var(--pe-encre); }
.pe-seg.est-verifie { cursor: default; border-bottom-color: transparent; }
.pe-seg.est-trouve { background: var(--pe-juste-fond); border-bottom: 2px solid var(--pe-juste); }
.pe-seg.est-manque { background: var(--pe-nuance-fond); border-bottom: 2px dashed var(--pe-nuance); }
.pe-seg.est-faux { background: transparent; text-decoration: line-through; text-decoration-color: var(--pe-encre-pale); }
.pe-compteur { margin: 6px 0 12px; font-size: .9em; color: var(--pe-encre-douce); }
.pe-detective .pe-zone > .pe-btn--plein { width: 100%; }
.pe-detective .pe-notes { margin-bottom: 14px; }

/* ─── Ligne de risque ─── */
.pe-ligne__titre { font-weight: 600; font-size: 1.05em; }
.pe-ligne__progres { margin: 2px 0 10px; font-size: .88em; color: var(--pe-encre-douce); }
.pe-carte {
  padding: 18px;
  border-radius: 18px;
  background: var(--pe-lait);
  box-shadow: var(--pe-ombre-forte);
  font-family: var(--pe-serif);
  font-size: 1.15em;
  line-height: 1.4;
}
.pe-ligne__zone > * + * { margin-top: 12px; }
.pe-correction { padding: 12px 14px; border-radius: 14px; background: var(--pe-nuance-fond); }
.pe-correction.est-juste { background: var(--pe-juste-fond); }
.pe-correction__titre { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-weight: 600; color: var(--pe-nuance); }
.pe-correction.est-juste .pe-correction__titre { color: var(--pe-juste); }
.pe-piste { position: relative; margin-top: 18px; padding-left: 4px; }
.pe-piste::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(var(--pe-n0), var(--pe-n1), var(--pe-n2), var(--pe-n3));
}
.pe-piste__case { position: relative; padding: 8px 0 8px 30px; }
.pe-piste__titre { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .95em; }
.pe-piste__repere { position: absolute; left: 4px; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--pe-papier); }
.pe-niveau-0 .pe-piste__repere { background: var(--pe-n0); }
.pe-niveau-1 .pe-piste__repere { background: var(--pe-n1); }
.pe-niveau-2 .pe-piste__repere { background: var(--pe-n2); }
.pe-niveau-3 .pe-piste__repere { background: var(--pe-n3); }
.pe-piste__cartes { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; padding: 0; list-style: none; }
.pe-piste__cartes li { padding: 6px 10px; border-radius: 10px; border-left: 3px solid var(--pe-juste); background: var(--pe-lait); font-size: .88em; line-height: 1.35; animation: pe-bulle .35s var(--pe-ease); }
.pe-piste__cartes li.est-nuance { border-left-color: var(--pe-nuance); }
.pe-replacee { margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--pe-nuance-fond); color: var(--pe-nuance); font-size: .85em; font-weight: 600; white-space: nowrap; }

/* ─── Parcours ─── */
.pe-parcours__titre { font-weight: 600; font-size: 1.05em; }
.pe-parcours .pe-contexte .pe-icone { color: var(--pe-encre); }
.pe-etapes { counter-reset: pe-etape; display: flex; flex-direction: column; gap: 14px; padding: 0; list-style: none; }
.pe-etape { position: relative; padding-left: 40px; counter-increment: pe-etape; }
.pe-etape::before {
  content: counter(pe-etape);
  position: absolute;
  left: 0;
  top: -2px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pe-encre);
  color: var(--pe-lait);
  font-size: .85em;
  font-weight: 600;
}
.pe-etape:not(:last-child)::after { content: ''; position: absolute; left: 13px; top: 30px; bottom: -14px; width: 2px; background: var(--pe-relief); }
.pe-etape.est-faite::before { background: var(--pe-juste); }
.pe-etape__q { margin-bottom: 8px; font-weight: 600; }
.pe-etape__r { display: flex; align-items: flex-start; gap: 8px; color: var(--pe-juste); font-weight: 500; }
.pe-etape__r .pe-icone { margin-top: 1px; }
.pe-etape__suite { margin-top: 4px; color: var(--pe-encre-douce); font-size: .93em; }
.pe-consequences { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.pe-consequence { padding: 10px 12px; border-radius: 12px; background: var(--pe-nuance-fond); font-size: .93em; animation: pe-bulle .35s var(--pe-ease); }
.pe-etape.est-faite .pe-consequence { background: transparent; padding: 0 0 0 10px; border-radius: 0; border-left: 2px solid var(--pe-nuance-fond); color: var(--pe-encre-douce); }

/* ─── Dilemme ─── */
.pe-jauges {
  position: sticky;
  top: -6px;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 10px -16px 0;
  padding: 10px 16px;
  background: var(--pe-papier);
  box-shadow: 0 8px 12px -10px rgba(var(--shadow-rgb), .35);
}
.pe-jauge { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 8px; }
.pe-jauge__titre { font-size: .85em; font-weight: 600; }
.pe-jauge__valeur { font-variant-numeric: tabular-nums; font-size: .85em; font-weight: 600; }
.pe-jauge__barre { grid-column: 1 / -1; height: 10px; border-radius: 5px; background: var(--pe-relief); overflow: hidden; }
.pe-jauge__rempli { display: block; height: 100%; border-radius: 5px; background: var(--pe-juste); transition: width .7s var(--pe-ease), background .4s; }
.pe-jauge:nth-child(2) .pe-jauge__rempli { background: var(--pe-secret); }
.pe-jauge.est-bas .pe-jauge__rempli { background: var(--pe-alerte); }
.pe-jauge__delta { position: absolute; right: 0; top: -1.2em; font-size: .85em; font-weight: 700; opacity: 0; }
.pe-jauge__delta.est-haut { color: var(--pe-juste); }
.pe-jauge__delta.est-bas { color: var(--pe-alerte); }
.pe-jauge__delta.pe-anime { animation: pe-delta 1.6s var(--pe-ease); }
@keyframes pe-delta { 0% { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; transform: translateY(0); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
.pe-fin { align-self: stretch; padding: 14px 16px; border-radius: 16px; background: var(--pe-lait); box-shadow: var(--pe-ombre); font-family: var(--pe-serif); font-style: italic; line-height: 1.45; border-left: 4px solid var(--pe-nuance); }
.pe-fin.est-juste { border-left-color: var(--pe-juste); }

/* ─── Duel ─── */
.pe-duel > * + * { margin-top: 14px; }
.pe-duel__score { display: flex; justify-content: space-between; gap: 10px; font-size: .85em; color: var(--pe-encre-douce); }
.pe-duel__titre { font-family: var(--pe-main); font-weight: 500; font-size: 2em; line-height: 1.1; }
.pe-attente { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.pe-attente__points { display: inline-flex; gap: 6px; }
.pe-attente__points span { width: 9px; height: 9px; border-radius: 50%; background: var(--pe-encre-pale); animation: pe-point 1.1s infinite ease-in-out; }
.pe-attente__points span:nth-child(2) { animation-delay: .18s; }
.pe-attente__points span:nth-child(3) { animation-delay: .36s; }
.pe-champ {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  background: var(--pe-papier);
  box-shadow: var(--pe-creux);
  font-size: max(16px, 1em); /* 16 px au moins : iOS ne zoome pas sur le champ */
  line-height: 1.45;
  resize: vertical;
}
.pe-champ:focus { outline: 2px solid var(--pe-encre); outline-offset: 2px; }
select.pe-champ { appearance: auto; }
.pe-champ-cadre { display: flex; flex-direction: column; gap: 6px; }
.pe-champ-pied { display: flex; justify-content: space-between; align-items: center; font-size: .88em; color: var(--pe-encre-douce); }
.pe-minuteur { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.1em; color: var(--pe-encre); }
.pe-minuteur.est-presse { color: var(--pe-alerte); }
.pe-compte { font-variant-numeric: tabular-nums; }
.pe-criteres { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }
.pe-criteres li { padding: 4px 12px; border-radius: 999px; background: var(--pe-lait); box-shadow: var(--pe-ombre); font-size: .85em; font-weight: 500; }
.pe-vote { margin-inline: 0; padding: 0; border: 0; min-inline-size: 0; }
.pe-libre { border-radius: 16px; background: var(--pe-lait); box-shadow: var(--pe-ombre); }
.pe-libre summary { display: flex; align-items: center; min-height: 52px; padding: 0 16px; font-weight: 500; cursor: pointer; }
.pe-libre > :not(summary) { margin: 0 14px 12px; }
.pe-libre .pe-btn { width: calc(100% - 28px); }
.pe-libre .pe-compte { display: block; text-align: right; font-size: .85em; color: var(--pe-encre-douce); }
.pe-duo { display: flex; align-items: baseline; gap: 8px; font-family: var(--pe-serif); font-style: italic; color: var(--pe-encre-douce); }
.pe-duo__nombre { font-family: var(--pe-main); font-style: normal; font-size: 3em; line-height: 1; color: var(--pe-encre); }
.pe-bilan-joueur { padding: 12px 14px; border-radius: 16px; background: var(--pe-lait); box-shadow: var(--pe-ombre); }
.pe-bilan-joueur h3 { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 1em; }
.pe-bilan-joueur__total { font-variant-numeric: tabular-nums; }
.pe-bilan-joueur ul { display: flex; flex-direction: column; gap: 4px; padding: 0; list-style: none; }
.pe-bilan-joueur li { display: flex; justify-content: space-between; gap: 10px; font-size: .9em; color: var(--pe-encre-douce); }
.pe-bilan-joueur li.est-plein { color: var(--pe-encre); }
.pe-bilan-joueur li.est-plein .pe-pts { color: var(--pe-juste); font-weight: 700; }
.pe-pts { font-variant-numeric: tabular-nums; }
.pe-local .pe-rangee { margin-bottom: 10px; }
.pe-local > .pe-btn { width: 100%; }

/* ─── Bilan, notions, badges ─── */
.pe-notions { display: flex; flex-direction: column; gap: 10px; padding: 0; list-style: none; }
.pe-notion { padding: 14px 16px; border-radius: 18px; background: var(--pe-lait); box-shadow: var(--pe-ombre); }
.pe-notion > * + * { margin-top: 6px; }
.pe-notion.est-nouvelle { background: transparent; box-shadow: none; border: 1.5px dashed var(--pe-relief); }
.pe-notion__titre { font-weight: 600; }
.pe-notion__phrase { color: var(--pe-encre-douce); line-height: 1.5; }
.pe-notion__retour { display: flex; align-items: center; gap: 10px; font-size: .85em; color: var(--pe-encre-douce); }
.pe-boites { display: inline-flex; gap: 3px; }
.pe-boites span { width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid var(--pe-encre-pale); }
.pe-boites .est-plein { background: var(--pe-encre); border-color: var(--pe-encre); }
.pe-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; padding: 0; list-style: none; }
.pe-badge { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 18px; border: 1.5px dashed var(--pe-relief); color: var(--pe-encre-douce); }
.pe-badge .pe-icone { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--pe-papier); }
.pe-badge.est-gagne { border: 0; background: var(--pe-lait); box-shadow: var(--pe-ombre); color: var(--pe-encre); }
.pe-badge.est-gagne .pe-icone { background: var(--pe-juste-fond); color: var(--pe-juste); }
.pe-badge__titre { font-weight: 600; color: var(--pe-encre); }
.pe-badge__texte { font-size: .88em; line-height: 1.4; }
.pe-ouverture { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--pe-juste-fond); color: var(--pe-juste); font-weight: 600; }

/* ─── Où agir, réglages ─── */
.pe-pays, .pe-reglage { margin-inline: 0; padding: 0; border: 0; min-inline-size: 0; }
.pe-reglage > * + * { margin-top: 8px; }
.pe-reglage .pe-legende { display: flex; align-items: center; gap: 8px; font-size: 1em; color: var(--pe-encre); }
.pe-puces { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pe-puce-choix { position: relative; }
.pe-puce-choix input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pe-puce-choix span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--pe-relief);
  background: var(--pe-lait);
  font-weight: 500;
}
.pe-puce-choix input:checked + span { background: var(--pe-encre); border-color: var(--pe-encre); color: var(--pe-lait); }
.pe-puce-choix input:focus-visible + span { outline: 2px solid var(--pe-encre); outline-offset: 2px; }
.pe-a-valider { padding: 10px 14px; border-radius: 12px; background: var(--pe-nuance-fond); color: var(--pe-nuance); font-weight: 500; font-size: .93em; }
.pe-ressource { padding: 14px 16px; border-radius: 18px; background: var(--pe-lait); box-shadow: var(--pe-ombre); }
.pe-ressource.est-urgence { border-left: 5px solid var(--pe-alerte); }
.pe-ressource__titre { margin-bottom: 6px; font-size: 1em; font-weight: 600; }
.pe-ressource ul { display: flex; flex-direction: column; gap: 6px; padding-left: 1.1em; }
.pe-ressource a { color: var(--pe-encre); font-weight: 600; text-underline-offset: 3px; }
.pe-vie-privee .pe-btn { margin-top: 12px; }

/* ─── Fenêtre de confirmation ─── */
.pe-dialogue {
  width: min(420px, calc(100% - 32px));
  padding: 20px;
  border: 0;
  border-radius: 22px;
  background: var(--pe-lait);
  color: var(--pe-encre);
  box-shadow: 0 20px 50px rgba(var(--ink-rgb), .3);
  font-family: var(--pe-ui);
  font-size: calc(15px * var(--pe-echelle, 1));
}
.pe-dialogue::backdrop { background: rgba(var(--ink-rgb), .35); }
.pe-dialogue__q { margin-bottom: 16px; font-weight: 600; font-size: 1.05em; line-height: 1.4; }

@media (prefers-reduced-motion: reduce) {
  .pe *, .pe *::before, .pe *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  /* Sans animation, l'écart de la jauge reste affiché jusqu'au choix suivant. */
  .pe-jauge__delta.pe-anime { animation: none; opacity: 1; }
}

/* ─── L'espace « Jeux » de Djouney (screens/jeux.js), préfixe .jj- ─── */
.jj-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: calc(6px + var(--safe-top, 0px)) 16px calc(36px + var(--safe-bottom, 0px));
}
.jj-inner { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.jj-head { display: flex; align-items: center; min-height: 52px; margin-left: -8px; }
.jj-back { color: var(--stem, #2A1F24); }
.jj-title { margin: 0; font-family: var(--font-hand); font-weight: 500; font-size: clamp(50px, 14vw, 62px); line-height: 1; color: var(--ink); outline: none; }
.jj-sub { margin: 6px 0 0; font-family: var(--font-serif); font-style: italic; font-size: 15.5px; line-height: 1.45; color: rgba(var(--ink-rgb), .82); }
.jj-section { display: flex; flex-direction: column; gap: 12px; }
.jj-section__title { margin: 0; padding-left: 4px; font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 16px; color: rgba(var(--ink-rgb), .84); }
.jj-note { margin: 0; padding: 0 4px; font-size: 14px; line-height: 1.5; color: rgba(var(--ink-rgb), .8); }
.jj-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  background-color: var(--milk);
  background-image: var(--grain);
  background-size: 180px 180px;
  box-shadow: var(--emboss);
}
.jj-card__head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.jj-card__mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--porcelain);
  box-shadow: var(--deboss);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 19px;
  color: var(--carmine);
}
.jj-card__text { min-width: 0; }
.jj-card__title { margin: 0; font-family: var(--font-hand); font-weight: 500; font-size: 32px; line-height: 1.05; color: var(--ink); }
.jj-card__sub { margin: 2px 0 0; font-family: var(--font-serif); font-style: italic; font-size: 15px; line-height: 1.4; color: rgba(var(--ink-rgb), .84); }
.jj-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.jj-tags li { padding: 4px 12px; border-radius: 999px; background: var(--porcelain); font-size: 13px; font-weight: 500; color: var(--ink); }
.jj-card__status { margin: 0; font-size: 14px; color: rgba(var(--ink-rgb), .82); }
.jj-card__status:empty { display: none; }
.jj-people { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.jj-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  border-radius: 20px;
  background: var(--milk);
  box-shadow: var(--emboss-sm);
}
.jj-person__disc {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--flower);
  color: var(--flower-ink, #fff);
  font-family: var(--font-serif);
  font-size: 18px;
}
.jj-person__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.jj-person__name { font-family: var(--font-hand); font-weight: 500; font-size: 24px; line-height: 1.1; overflow-wrap: anywhere; }
.jj-person__state { font-size: 13px; color: rgba(var(--ink-rgb), .8); }
.jj-person__state:empty { display: none; }
.jj-propose { flex: none; min-height: 44px; padding: 0 18px; font-size: 14px; }
.jj-note[hidden] { display: none; }
.jj-section[hidden] { display: none; }
.jj-cartes, .jj-encours { display: flex; flex-direction: column; gap: 12px; }
.jj-card__mark--mot { font-size: 14px; font-style: normal; font-weight: 600; letter-spacing: .02em; }
.jj-card__actions { display: flex; flex-direction: column; gap: 8px; }
.jj-duel:disabled { opacity: .55; cursor: default; }
/* Dans les feuilles « Avec qui ? » et « Jouer avec … » (hors de .jj : la feuille vit dans body). */
.ns-activite.jj-qui { flex-direction: row; align-items: center; gap: 12px; }
.jj-qui__texte { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.ns-activite:disabled { opacity: .55; cursor: default; box-shadow: none; }

/* ─── L'écran dans Djouney ─── */
.jx { min-height: 0; }
.jx-attente { margin: auto; padding: 24px; font-family: var(--font-serif, Georgia, serif); font-style: italic; color: var(--ink-soft, rgba(var(--ink-rgb), .68)); text-align: center; }
.jx-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 24px 40px; }
