/* AOOTE — Feuille de style du jeu
 * Les couleurs principales sont regroupées ici : modifiez-les pour changer l'identité visuelle.
 */
:root {
  --nuit: #0f1b3d;
  --nuit-2: #17264f;
  --nuit-3: #22346a;
  --or: #f2b41b;
  --or-clair: #ffd76a;
  --or-fonce: #c98a00;
  --creme: #fffaf0;
  --papier: #fff6e3;
  --encre: #1c2236;
  --encre-douce: #5a6178;
  --ligne: #eadfc6;
  --ok: #1f9d55;
  --ko: #d64545;
  --rayon: 18px;
  --ombre: 0 10px 30px rgba(5, 10, 30, .35);
  --titre: 'Fraunces', Georgia, 'Times New Roman', serif;
  --texte: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--texte);
  font-size: 16px;
  line-height: 1.55;
  color: var(--creme);
  background: radial-gradient(1200px 600px at 20% -10%, #2a3f80 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 10%, #4a2f12 0%, transparent 55%),
              var(--nuit);
  background-attachment: fixed;
}
h1, h2, h3 { font-family: var(--titre); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 .8em; }
a { color: var(--or-fonce); }
img { max-width: 100%; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .7em 1.3em; border-radius: 999px; border: 2px solid currentColor;
  background: transparent; color: inherit; font-weight: 700; text-decoration: none;
  transition: transform .15s, background .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-or { background: linear-gradient(180deg, var(--or-clair), var(--or)); color: #2a1c00; border-color: var(--or); box-shadow: 0 4px 0 var(--or-fonce); }
.btn-or:hover { box-shadow: 0 6px 0 var(--or-fonce); }
.btn-or:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--or-fonce); }
.btn:disabled { opacity: .45; transform: none; box-shadow: none; }
.btn.grand { font-size: 1.08rem; padding: .85em 1.6em; }
.btn.plein { width: 100%; }
.lien { background: none; border: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; padding: .3em .2em; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-top: 1rem; }
.actions.centre, .centre { justify-content: center; text-align: center; }

/* ---------- En-tête et pied ---------- */
.barre-haut { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem clamp(1rem, 3vw, 2rem); }
.marque { display: flex; align-items: center; gap: .6rem; color: var(--creme); text-decoration: none; }
.marque b { display: block; font-family: var(--titre); font-size: 1.25rem; letter-spacing: .08em; }
.marque small { display: block; font-size: .75rem; opacity: .75; }
.logo { width: 40px; height: 40px; flex: none; }
.logo.petit { width: 22px; height: 22px; vertical-align: middle; }
.logo.grand { width: 96px; height: 96px; filter: drop-shadow(0 8px 24px rgba(242, 180, 27, .35)); }
.bandeau-apercu { background: var(--or); color: #2a1c00; text-align: center; padding: .5rem 1rem; font-weight: 700; font-size: .9rem; }
.pied { margin-top: 3rem; padding: 1.5rem clamp(1rem, 3vw, 2rem) 2rem; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .9rem; opacity: .85; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.pied-liens { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.pied a { color: var(--creme); }

/* ---------- Pages ---------- */
.page { width: min(1100px, 100%); margin: 0 auto; padding: 1rem clamp(1rem, 3vw, 2rem); }
.page.etroite { width: min(560px, 100%); }
.carte {
  background: var(--creme); color: var(--encre); border-radius: var(--rayon);
  padding: clamp(1.1rem, 3vw, 1.8rem); box-shadow: var(--ombre); margin-bottom: 1.2rem;
  position: relative;
}
.carte a { color: var(--or-fonce); }
.discret { color: var(--encre-douce); font-size: .92rem; }
.page > h1, .page > .sous-titre { text-align: center; }
.sous-titre { opacity: .85; }
.sur-titre { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 800; color: var(--or-clair); margin-bottom: .3rem; }
.note { background: #fff1c7; border-left: 4px solid var(--or); padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; color: var(--encre); }
.erreur { color: var(--ko); font-weight: 700; min-height: 1em; }
.succes { color: var(--ok); font-weight: 700; }

/* Accueil */
.heros { text-align: center; padding: 2rem 0 1rem; max-width: 760px; margin: 0 auto; }
.heros h1 { font-size: clamp(3rem, 10vw, 5.5rem); letter-spacing: .12em; margin: .2em 0 0; color: var(--or-clair); text-shadow: 0 4px 30px rgba(242, 180, 27, .35); }
.heros .sous-titre { font-size: clamp(1.05rem, 2.5vw, 1.3rem); font-weight: 700; }
.heros .intro { opacity: .9; margin: 1.2rem auto; }
.lettres { display: flex; gap: .5rem; justify-content: center; margin: 1rem 0; }
.lettre-chip { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 12px; background: var(--nuit-3); border: 2px solid var(--or); color: var(--or-clair); font-family: var(--titre); font-weight: 800; flex: none; }
.apercu-regles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-top: 2rem; }
.tuile { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--rayon); padding: 1.1rem; }
.tuile > span:first-child { font-size: 1.8rem; display: block; }
.tuile b { display: block; font-size: 1.05rem; }
.tuile p { opacity: .8; font-size: .92rem; margin: .3rem 0 0; }

/* Formulaires */
.formulaire { display: grid; gap: .9rem; }
.formulaire label { display: grid; gap: .3rem; font-weight: 700; font-size: .92rem; }
.formulaire input, .formulaire select, .formulaire textarea, #saisie {
  width: 100%; font: inherit; padding: .7rem .85rem; border-radius: 12px; border: 2px solid var(--ligne); background: #fff; color: var(--encre);
}
.formulaire input:focus, .formulaire select:focus, .formulaire textarea:focus, #saisie:focus { outline: none; border-color: var(--or); box-shadow: 0 0 0 4px rgba(242, 180, 27, .2); }
.formulaire fieldset { border: 2px solid var(--ligne); border-radius: 12px; padding: .8rem; margin: 0; }
.formulaire legend { font-weight: 800; padding: 0 .3rem; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.ligne-atout { display: grid; grid-template-columns: 1fr auto; gap: .5rem; margin-bottom: .5rem; }
.choix-emoji { display: flex; flex-wrap: wrap; gap: .3rem; }
.choix-emoji label { display: block; }
.choix-emoji input { position: absolute; opacity: 0; }
.choix-emoji span { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; font-size: 1.5rem; border-radius: 10px; border: 2px solid var(--ligne); background: #fff; cursor: pointer; }
.choix-emoji input:checked + span { border-color: var(--or); background: #fff1c7; }
.choix-emoji input:focus-visible + span { outline: 3px solid var(--or); }

/* Hub */
.hub h1 { text-align: left; }
.en-cours { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.en-cours > div:nth-child(2) { flex: 1; min-width: 180px; }
.en-cours h3 { margin: 0; }
.en-cours small { text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--or-fonce); }
.en-cours .actions { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: 1.2rem 0; }
.stats .tuile { text-align: center; }
.stats b { font-size: 2rem; font-family: var(--titre); color: var(--or-clair); }
.stats span { font-size: .85rem; opacity: .85; }
.progression { height: 14px; border-radius: 999px; background: #efe5cf; overflow: hidden; margin: .6rem 0 .3rem; }
.progression span { display: block; height: 100%; background: linear-gradient(90deg, var(--or), var(--ok)); border-radius: 999px; }
.mentors-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: .8rem; margin: .8rem 0; }
.mentor-mini { background: linear-gradient(160deg, var(--nuit-2), var(--nuit-3)); color: var(--creme); border: 2px solid var(--or); border-radius: 14px; padding: .9rem .7rem; text-align: center; display: grid; gap: .25rem; justify-items: center; }
.mentor-mini.verrou { border-color: #8a8fa3; filter: grayscale(1); opacity: .6; }
.mentor-mini .mentor-emoji { font-size: 2rem; }
.mentor-mini .mentor-emoji img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.mentor-mini small { font-size: .75rem; opacity: .85; line-height: 1.3; }
.historique { display: grid; gap: .5rem; }
.ligne-hist { display: grid; grid-template-columns: auto 1fr auto auto; gap: .7rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--ligne); }
.ligne-hist small { display: block; color: var(--encre-douce); }
.badge { font-size: .75rem; font-weight: 800; padding: .2em .7em; border-radius: 999px; }
.badge.ok { background: #d9f5e4; color: var(--ok); }
.badge.ko { background: #fde2e2; color: var(--ko); }
.score-mini { font-family: var(--titre); font-weight: 800; color: #fff; background: var(--c); border-radius: 10px; min-width: 2.6em; text-align: center; padding: .2em .4em; }
.note-invite { text-align: center; }

/* Portraits */
.portrait { display: inline-grid; place-items: center; flex: none; width: 3rem; height: 3rem; font-size: 1.7rem; border-radius: 50%; background: linear-gradient(160deg, #fff3d1, #ffd98a); border: 3px solid var(--or); overflow: hidden; line-height: 1; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait.petit { width: 2.1rem; height: 2.1rem; font-size: 1.2rem; border-width: 2px; }
.portrait.moyen { width: 4rem; height: 4rem; font-size: 2.3rem; }
.portrait.grand { width: 5rem; height: 5rem; font-size: 2.9rem; }
.portrait.geant { width: 7rem; height: 7rem; font-size: 4rem; }

/* Choix d'avatar */
.grille-avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.carte-avatar { position: relative; background: var(--creme); color: var(--encre); border: 3px solid transparent; border-radius: var(--rayon); padding: 1.2rem 1rem; text-align: center; display: grid; justify-items: center; gap: .3rem; box-shadow: var(--ombre); transition: transform .15s, border-color .15s; }
.carte-avatar:hover, .carte-avatar:focus-visible { transform: translateY(-4px); border-color: var(--or); outline: none; }
.carte-avatar b { font-family: var(--titre); font-size: 1.3rem; }
.carte-avatar small { color: var(--encre-douce); font-weight: 700; }
.carte-avatar p { font-size: .88rem; color: var(--encre-douce); margin: .3rem 0 0; text-align: left; }
.carte-avatar.nouveau { border: 3px dashed var(--or); background: rgba(255, 250, 240, .92); }
.badge-score { position: absolute; top: .6rem; right: .6rem; background: var(--c); color: #fff; font-weight: 800; font-size: .8rem; border-radius: 999px; padding: .15em .6em; }
.badge-perso { position: absolute; top: .6rem; left: .6rem; background: var(--nuit-3); color: var(--or-clair); font-weight: 800; font-size: .7rem; border-radius: 999px; padding: .2em .6em; }
.fiche-avatar { text-align: center; }
.fiche-avatar p { text-align: left; }

/* Règles */
.liste-jauges { list-style: none; padding: 0; display: grid; gap: .8rem; }
.liste-jauges li { display: flex; gap: .8rem; }
.liste-jauges .jauge-ico { font-size: 1.6rem; }
.liste-jauges p { margin: 0; color: var(--encre-douce); }
.pastille { display: inline-block; width: .8em; height: .8em; border-radius: 50%; background: var(--c); vertical-align: middle; }
.paliers { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 1rem; }
.paliers th, .paliers td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--ligne); vertical-align: top; }
.regle-etape { display: flex; gap: .9rem; padding: .7rem 0; border-bottom: 1px solid var(--ligne); }
.regle-etape p { margin: .2rem 0; }
.regle-etape small { color: var(--encre-douce); }
.contact p { font-size: 1.05rem; }

/* ---------- Écran de jeu ---------- */
.jeu { min-height: 100vh; display: flex; flex-direction: column; }
.jeu-haut { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: .6rem clamp(.8rem, 3vw, 1.5rem); background: rgba(15, 27, 61, .92); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.calendrier { display: grid; gap: .25rem; justify-items: center; font-size: .95rem; }
.calendrier b { color: var(--or-clair); font-size: 1.15rem; }
.calendrier .temps { width: min(260px, 100%); height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.calendrier .temps span { display: block; height: 100%; background: linear-gradient(90deg, var(--or-clair), var(--ko)); transition: width .6s; }
.qui { display: flex; align-items: center; gap: .5rem; }
.jeu-corps { flex: 1; display: grid; grid-template-columns: 300px 1fr; gap: clamp(1rem, 3vw, 2rem); padding: clamp(.8rem, 3vw, 1.6rem); width: min(1200px, 100%); margin: 0 auto; align-items: start; }
.tableau { position: sticky; top: 5rem; display: grid; gap: 1rem; }
.scene { min-width: 0; max-width: 760px; }

/* Piste des 5 vases */
.piste { display: flex; justify-content: space-between; gap: .3rem; background: rgba(255, 255, 255, .05); border-radius: var(--rayon); padding: .6rem .7rem; }
.vase { display: grid; justify-items: center; gap: .1rem; font-family: var(--titre); font-weight: 800; }
.vase svg { width: 38px; height: 46px; }
.vase-fond { fill: rgba(255, 255, 255, .08); }
.vase-huile { fill: var(--or); transition: y .8s; }
.vase-contour { fill: none; stroke: rgba(255, 255, 255, .45); stroke-width: 2; }
.vase.fait .vase-contour, .vase.actuel .vase-contour { stroke: var(--or-clair); }
.vase.actuel span { color: var(--or-clair); }
.vase.actuel svg { filter: drop-shadow(0 0 8px rgba(242, 180, 27, .7)); }
.vase.futur { opacity: .55; }

/* Jauges */
.jauges { display: grid; gap: .55rem; }
.jauge { position: relative; display: grid; gap: .25rem; text-align: left; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; padding: .55rem .7rem; color: var(--creme); }
.jauge:hover { border-color: var(--c); }
.jauge-tete { display: flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .92rem; }
.jauge-nom { flex: 1; }
.jauge-val { font-family: var(--titre); font-size: 1.1rem; color: var(--c); }
.jauge-barre { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.jauge-barre span { display: block; height: 100%; border-radius: 999px; background: var(--c); transition: width .9s cubic-bezier(.2, .8, .2, 1), background .6s; }
.jauge-palier { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.delta { position: absolute; right: .6rem; top: -.6rem; font-weight: 800; font-size: .85rem; padding: .05em .5em; border-radius: 999px; animation: monte 1.6s ease-out both; }
.delta.plus { background: var(--ok); color: #fff; }
.delta.moins { background: var(--ko); color: #fff; }
@keyframes monte { 0% { opacity: 0; transform: translateY(8px); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: .85; } }

/* Cartes de jeu */
.anim-entree { animation: entree .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes entree { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.scene .carte { padding: clamp(1.2rem, 4vw, 2.2rem); }
.carte-emoji { font-size: 3rem; line-height: 1; margin-bottom: .4rem; }
.texte-carte { font-size: 1.1rem; }
.choix { display: grid; gap: .7rem; margin-top: 1.2rem; }
.btn-choix { display: flex; align-items: flex-start; gap: .8rem; width: 100%; text-align: left; background: #fff; color: var(--encre); border: 2px solid var(--ligne); border-radius: 14px; padding: .9rem 1rem; font-weight: 600; transition: border-color .15s, transform .15s, background .15s; }
.btn-choix:hover, .btn-choix:focus-visible { border-color: var(--or); background: #fffbef; transform: translateX(3px); outline: none; }
.lettre-choix { flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 8px; background: var(--nuit-2); color: var(--or-clair); font-weight: 800; font-family: var(--titre); }
.paquet-entete { display: flex; flex-wrap: wrap; gap: .5rem 1rem; justify-content: space-between; font-weight: 800; font-size: .88rem; color: var(--encre-douce); margin-bottom: 1rem; padding-bottom: .7rem; border-bottom: 2px dashed var(--ligne); }
.paquet-entete .ventes { color: var(--ok); }

.scene-intro { text-align: center; }
.scene-intro .histoire { text-align: left; font-size: 1.02rem; }
.mission { background: var(--nuit-2); color: var(--creme); border-radius: 14px; padding: 1rem; margin: 1rem 0; text-align: left; }
.mission b { color: var(--or-clair); }
.mission p { margin: .3rem 0 0; }
.regle-or { font-size: .9rem; color: var(--encre-douce); font-style: italic; }

.etape-entete { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.etape-lettre { display: grid; place-items: center; width: 4.2rem; height: 4.2rem; flex: none; border-radius: 18px; background: linear-gradient(160deg, var(--nuit-2), var(--nuit-3)); color: var(--or-clair); font-family: var(--titre); font-size: 2.6rem; font-weight: 800; border: 3px solid var(--or); }
.etape-entete small { text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: var(--or-fonce); }
.etape-entete h2 { margin: 0; letter-spacing: .06em; }
.etape-entete p { margin: 0; color: var(--encre-douce); font-weight: 700; }
blockquote { margin: 0 0 1rem; padding: .8rem 1rem; border-left: 4px solid var(--or); background: #fff3d6; border-radius: 0 12px 12px 0; font-style: italic; font-family: var(--titre); }
.fiche { display: grid; gap: .2rem .8rem; margin: 0 0 1rem; }
.fiche dt { font-weight: 800; margin-top: .5rem; }
.fiche dd { margin: 0; color: #3a4058; }
.astuces { background: #eef6ff; border-radius: 14px; padding: .8rem 1rem; margin-bottom: 1.2rem; }
.astuces ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.astuces li { margin-bottom: .3rem; }

.compteur { font-weight: 700; }
.grille-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; margin: 1rem 0 1.4rem; }
.mini-carte { position: relative; min-height: 120px; display: grid; align-content: start; gap: .4rem; text-align: left; padding: .8rem; border-radius: 14px; border: 2px solid var(--ligne); background: linear-gradient(170deg, #fff, #fff6e1); color: var(--encre); transition: transform .15s, border-color .15s, box-shadow .15s; animation: tirage .5s both; }
.mini-carte:nth-child(2) { animation-delay: .05s; } .mini-carte:nth-child(3) { animation-delay: .1s; } .mini-carte:nth-child(4) { animation-delay: .15s; }
.mini-carte:nth-child(5) { animation-delay: .2s; } .mini-carte:nth-child(6) { animation-delay: .25s; } .mini-carte:nth-child(7) { animation-delay: .3s; } .mini-carte:nth-child(n+8) { animation-delay: .35s; }
@keyframes tirage { from { opacity: 0; transform: rotateY(90deg); } to { opacity: 1; transform: none; } }
.mini-carte:hover { transform: translateY(-3px); border-color: var(--or); }
.mini-carte.choisie { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(31, 157, 85, .25); background: linear-gradient(170deg, #f0fff5, #ddf7e7); }
.mini-carte.choisie::after { content: '✓'; position: absolute; top: .4rem; right: .5rem; width: 1.5rem; height: 1.5rem; display: grid; place-items: center; border-radius: 50%; background: var(--ok); color: #fff; font-weight: 800; font-size: .85rem; }
.mini-carte.ecartee { opacity: .5; filter: grayscale(1); }
.mini-carte .cat { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--or-fonce); }
.mini-carte .lbl { font-weight: 700; line-height: 1.3; }
.mini-carte .perso { font-size: .72rem; font-weight: 800; color: var(--nuit-3); background: #fff1c7; border-radius: 6px; padding: .1em .4em; justify-self: start; }
.tampon { position: absolute; bottom: .5rem; right: .5rem; transform: rotate(-8deg); border: 2px solid var(--ko); color: var(--ko); font-weight: 800; font-size: .75rem; padding: 0 .4em; border-radius: 4px; text-transform: uppercase; }

.verdict { font-family: var(--titre); font-size: 1.4rem; font-weight: 800; margin-bottom: .6rem; }
.verdict.ok { color: var(--ok); }
.verdict.ko { color: var(--ko); }
.verdict.neutre { color: var(--nuit-3); }
.scene-feedback.ok { border-top: 6px solid var(--ok); }
.scene-feedback.ko { border-top: 6px solid var(--ko); }
.rappel { font-style: italic; color: var(--encre-douce); }
.texte-feedback { font-size: 1.1rem; }
.details { padding-left: 1.2rem; }
.details li { margin-bottom: .35rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.chip { font-size: .85rem; font-weight: 800; padding: .3em .8em; border-radius: 999px; }
.chip.plus { background: #d9f5e4; color: #146c3b; }
.chip.moins { background: #fde2e2; color: #a52a2a; }
.chip.temps { background: #e6ecff; color: var(--nuit-3); }
.bulle { position: relative; display: grid; gap: .1rem; background: #fff; border: 2px solid var(--c); border-radius: 16px; padding: .7rem .9rem; margin: .8rem 0; box-shadow: 0 4px 0 var(--c); }
.bulle::before { content: ''; position: absolute; left: 1.4rem; top: -10px; width: 16px; height: 16px; background: #fff; border-left: 2px solid var(--c); border-top: 2px solid var(--c); transform: rotate(45deg); }
.bulle b { color: var(--c); filter: brightness(.8); }

.grand-emoji { font-size: 3.5rem; line-height: 1; display: block; margin-bottom: .4rem; }
.scene-bilan { text-align: center; }
.scene-bilan.ok { border-top: 6px solid var(--ok); }
.scene-bilan.ko { border-top: 6px solid var(--ko); }
.conditions { list-style: none; padding: 0; text-align: left; display: grid; gap: .5rem; margin: 1rem 0; }
.autres-retours { margin-top: 1rem; }
.autres-retours summary { cursor: pointer; color: var(--encre-douce); font-weight: 700; }
.conditions li { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem .8rem; border-radius: 12px; }
.conditions li.ok { background: #e7f8ee; }
.conditions li.ko { background: #fdecec; }
.conditions li > span { font-weight: 800; font-size: 1.2rem; }
.conditions li.ok > span { color: var(--ok); }
.conditions li.ko > span { color: var(--ko); }
.conditions p { margin: .2rem 0 0; font-size: .9rem; }
.conditions small { color: var(--encre-douce); }

.scene-mentor { text-align: center; perspective: 1000px; }
.carte-mentor { margin: 1rem auto 1.4rem; max-width: 380px; animation: retourne 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes retourne { from { transform: rotateY(180deg) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.mentor-face { background: radial-gradient(circle at 50% 0%, #34508f, var(--nuit-2) 70%); border: 3px solid var(--or); border-radius: 22px; padding: 1.8rem 1.4rem; box-shadow: 0 0 0 6px rgba(242, 180, 27, .15), var(--ombre); }
.mentor-face .mentor-emoji { font-size: 4rem; display: block; }
.mentor-face .mentor-emoji img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 3px solid var(--or); }
.mentor-face h2 { color: var(--or-clair); margin: .4rem 0 .2rem; }
.mentor-titre { font-weight: 700; opacity: .9; }
.lecon { font-family: var(--titre); font-style: italic; font-size: 1.05rem; }
.scene-mentor .chips { justify-content: center; }
.scene-mentor .bulle { text-align: left; color: var(--encre); }

.scene-fin { text-align: center; overflow: hidden; }
.scene-fin.victoire { border-top: 6px solid var(--ok); }
.scene-fin.defaite { border-top: 6px solid var(--ko); }
.score-final { display: inline-grid; justify-items: center; margin: 1rem 0; padding: 1rem 2rem; border-radius: 22px; background: var(--c); color: #fff; box-shadow: 0 6px 0 rgba(0, 0, 0, .15); }
.score-final span { font-family: var(--titre); font-size: 3.5rem; font-weight: 800; line-height: 1; }
.scene-fin .cadeau { text-align: left; box-shadow: none; border: 2px solid var(--ligne); }
.confettis { position: absolute; inset: 0; pointer-events: none; }
.confettis i { position: absolute; top: -10px; width: 8px; height: 14px; background: var(--or); border-radius: 2px; animation: tombe 3s linear infinite; opacity: .85; }
.confettis i:nth-child(3n) { background: var(--ok); } .confettis i:nth-child(4n) { background: #3b82f6; } .confettis i:nth-child(5n) { background: var(--ko); }
.confettis i:nth-child(1) { left: 4%; animation-delay: .1s; } .confettis i:nth-child(2) { left: 12%; animation-delay: 1.2s; } .confettis i:nth-child(3) { left: 20%; animation-delay: .5s; }
.confettis i:nth-child(4) { left: 28%; animation-delay: 2s; } .confettis i:nth-child(5) { left: 36%; animation-delay: .8s; } .confettis i:nth-child(6) { left: 44%; animation-delay: 1.6s; }
.confettis i:nth-child(7) { left: 52%; animation-delay: .3s; } .confettis i:nth-child(8) { left: 60%; animation-delay: 2.4s; } .confettis i:nth-child(9) { left: 68%; animation-delay: 1s; }
.confettis i:nth-child(10) { left: 76%; animation-delay: .2s; } .confettis i:nth-child(11) { left: 84%; animation-delay: 1.8s; } .confettis i:nth-child(12) { left: 92%; animation-delay: .6s; }
.confettis i:nth-child(n+13) { animation-duration: 4s; } .confettis i:nth-child(13) { left: 8%; } .confettis i:nth-child(14) { left: 24%; } .confettis i:nth-child(15) { left: 40%; }
.confettis i:nth-child(16) { left: 56%; } .confettis i:nth-child(17) { left: 72%; } .confettis i:nth-child(18) { left: 88%; } .confettis i:nth-child(19) { left: 16%; animation-delay: 2.2s; }
.confettis i:nth-child(20) { left: 48%; animation-delay: 2.8s; } .confettis i:nth-child(21) { left: 64%; animation-delay: 1.4s; } .confettis i:nth-child(22) { left: 80%; animation-delay: 2.6s; } .confettis i:nth-child(23) { left: 96%; animation-delay: .9s; }
@keyframes tombe { to { transform: translateY(110vh) rotate(720deg); } }

/* Modale et toast */
.modal-fond { position: fixed; inset: 0; z-index: 100; background: rgba(5, 10, 30, .7); display: grid; place-items: center; padding: 1rem; animation: fondu .2s both; }
@keyframes fondu { from { opacity: 0; } }
.modal { position: relative; background: var(--creme); color: var(--encre); border-radius: var(--rayon); padding: 1.6rem; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--ombre); animation: entree .3s both; }
.modal-fermer { position: absolute; top: .5rem; right: .7rem; background: none; border: 0; font-size: 1.8rem; line-height: 1; color: var(--encre-douce); }
.modal .actions { justify-content: flex-end; }
.liste-cadeaux { display: grid; gap: .7rem; }
.info-jauge { text-align: center; }
.info-jauge .bulle { text-align: left; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 150%); z-index: 200; background: var(--nuit-3); color: var(--creme); padding: .8rem 1.2rem; border-radius: 14px; box-shadow: var(--ombre); transition: transform .3s; max-width: calc(100% - 2rem); font-weight: 700; }
.toast.visible { transform: translate(-50%, 0); }
.toast.alerte { background: var(--ko); }
.toast.succes { background: var(--ok); }
.chargement { min-height: 80vh; display: grid; place-content: center; justify-items: center; text-align: center; padding: 1rem; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .jeu-corps { grid-template-columns: 1fr; }
  .tableau { position: static; }
  .jauges { grid-template-columns: repeat(5, 1fr); gap: .35rem; }
  .jauge { padding: .4rem .35rem; justify-items: center; text-align: center; }
  .jauge-tete { flex-direction: column; gap: 0; font-size: .7rem; }
  .jauge-nom { font-size: .62rem; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
  .jauge-barre { width: 100%; height: 7px; }
  .jauge-palier { display: none; }
  .delta { top: -.5rem; right: -.2rem; font-size: .72rem; }
  .vase svg { width: 30px; height: 36px; }
  .scene { max-width: none; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .marque small { display: none; }
  .qui b { display: none; }
  .jeu-haut { gap: .5rem; }
  .stats b { font-size: 1.5rem; }
  .deux { grid-template-columns: 1fr; }
  .grille-cartes { grid-template-columns: 1fr 1fr; }
  .mini-carte { min-height: 100px; padding: .6rem; font-size: .9rem; }
  .ligne-hist { grid-template-columns: auto 1fr auto; }
  .ligne-hist .badge { display: none; }
  .pied { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
