/* Abonnia : le style des vidéos (texte blanc à gros contour noir, jaune, cartes blanches arrondies), en version téléphone. */
:root {
  --jaune: #ffd23f; --rouge: #fe2c55; --vert: #2fae4e; --encre: #1d1d1d; --creme: #f4efe4;
  --police: "Arial Rounded MT Bold", ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif;
  --haut: env(safe-area-inset-top, 0px); --bas: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #bcdcf3; font-family: var(--police); color: var(--encre); overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
input { -webkit-user-select: text; user-select: text; }
#scene, #scene canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font-family: var(--police); cursor: pointer; color: var(--encre); }

.contour { color: #fff; font-weight: 900; -webkit-text-stroke: 7px var(--encre); paint-order: stroke fill; text-shadow: 0 5px 0 rgba(0, 0, 0, .28); letter-spacing: .5px; }

#chargement { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; background: linear-gradient(#7fbdf0, #bcdcf3 45%, #f3e6cc 75%); z-index: 50; transition: opacity .25s; }
#chargement .contour { font-size: 64px; }
#chargement p { font-weight: 800; margin-top: 8px; }
#chargement.fini { opacity: 0; pointer-events: none; }

.ecran { position: fixed; inset: 0; display: none; pointer-events: none; }
.ecran.actif { display: block; }
.ecran .feuille, .ecran .haut, .ecran .bas, .ecran .barre, .ecran .fiche, .ecran .boutons-carte, .ecran .suggestions, .ecran .centre-b, .ecran .compteur { pointer-events: auto; }

/* boutons façon jeu mobile */
.bouton { font-weight: 900; font-size: 19px; padding: 14px 22px; border-radius: 40px; border: 3px solid var(--encre); box-shadow: 0 5px 0 var(--encre); transition: transform .06s, box-shadow .06s; white-space: nowrap; }
.bouton:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--encre); }
.bouton.grand { font-size: 23px; padding: 17px 30px; }
.jaune { background: var(--jaune); } .blanc { background: #fff; }
.lien { background: none; border: none; font-weight: 900; font-size: 16px; text-decoration: underline; color: #fff; -webkit-text-stroke: 4px var(--encre); paint-order: stroke fill; }
.puce { border: none; background: var(--creme); font-weight: 800; font-size: 15px; padding: 9px 14px; border-radius: 30px; white-space: nowrap; }
.puce.choisi { background: var(--encre); color: #fff; }

/* accueil */
#accueil::before, #accueil::after { content: ''; position: absolute; left: 0; right: 0; pointer-events: none; }
#accueil::before { top: 0; height: 34vh; background: linear-gradient(rgba(127,189,240,.55), rgba(127,189,240,0)); }
#accueil::after { bottom: 0; height: 40vh; background: linear-gradient(rgba(20,30,20,0), rgba(20,30,20,.45)); }
#accueil .haut, #accueil .bas { z-index: 1; }
#accueil .haut { position: absolute; top: calc(var(--haut) + 22px); left: 0; right: 0; text-align: center; }
.pastille-nb { display: inline-block; background: var(--jaune); font-weight: 900; font-size: 18px; padding: 7px 18px 8px; border-radius: 30px; box-shadow: 0 4px 0 rgba(0, 0, 0, .22); }
.titre { font-size: clamp(60px, 18vw, 118px); margin: 10px 0 0; line-height: 1; }
.regle { margin: 6px 0 0; line-height: 1.02; display: flex; flex-direction: column; -webkit-text-stroke-width: 6px; }
.regle .l1 { font-size: clamp(30px, 9vw, 54px); } .regle .l2 { font-size: clamp(30px, 9vw, 54px); color: var(--jaune); }
#accueil .bas { position: absolute; left: 0; right: 0; bottom: calc(var(--bas) + 18px); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 20px; }
#accueil .bas .bouton { width: min(360px, 100%); }
.pied { margin: 2px 0 0; font-size: 13px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.pied a { color: #fff; }

/* la feuille des choix (en bas sur téléphone, à droite sur ordinateur) */
.feuille { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 28px 28px 0 0; padding: 16px 18px calc(var(--bas) + 14px);
  box-shadow: 0 -6px 0 rgba(0, 0, 0, .08), 0 -12px 40px rgba(0, 0, 0, .12); max-height: 58vh; overflow-y: auto; }
#pseudo .feuille { max-height: 86vh; }
.etapes { display: flex; justify-content: space-between; align-items: center; font-weight: 800; color: #777; font-size: 15px; margin-bottom: 4px; }
.etapes b { color: var(--encre); font-size: 18px; }
h2 { font-size: 22px; margin: 10px 0 8px; font-weight: 900; }
h3 { font-size: 16px; margin: 12px 0 8px; font-weight: 900; color: #555; }
.champ { display: flex; align-items: center; gap: 8px; border: 3px solid var(--encre); border-radius: 18px; padding: 4px 14px; background: #fff; }
.champ span { font-weight: 900; font-size: 20px; }
.champ input { flex: 1; min-width: 0; border: none; outline: none; font: 800 19px var(--police); padding: 10px 0; background: none; }
.msg { min-height: 20px; margin: 6px 2px 0; font-weight: 800; font-size: 14px; }
.msg.ok { color: #1f8a3c; } .msg.erreur { color: #d6283f; } .msg.info { color: #2a64c9; }
.aide { font-size: 13px; color: #666; margin: 6px 2px 0; font-weight: 700; }
.avertissement { font-size: 13px; background: #fff4d1; border-radius: 14px; padding: 10px 12px; margin: 12px 0 0; font-weight: 700; line-height: 1.35; }
.actions { display: flex; gap: 10px; margin-top: 14px; }
.actions .bouton { flex: 1; } .actions .bouton.blanc { flex: 0 0 auto; }
.onglets { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.onglets::-webkit-scrollbar { display: none; }
.choix .rang { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.pastilles { display: flex; gap: 10px; flex-wrap: nowrap; overflow-x: auto; margin: 2px -18px 4px; padding: 5px 18px 7px; scrollbar-width: none; }
.pastilles::-webkit-scrollbar { display: none; }
.pastille-c { flex: none; }
.pastille-c { width: 46px; height: 46px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 2px #ddd, 0 3px 0 rgba(0, 0, 0, .15); padding: 0; transition: transform .1s; }
.pastille-c.choisi { box-shadow: 0 0 0 3px var(--encre), 0 3px 0 rgba(0, 0, 0, .15); transform: scale(1.1); }
.cadenas { font-size: 13px; font-weight: 700; color: #666; background: var(--creme); border-radius: 14px; padding: 10px 12px; margin: 12px 0 0; }
.aide-3d { position: absolute; top: calc(var(--haut) + 16px); left: 50%; transform: translateX(-50%); background: rgba(29, 29, 29, .55); color: #fff; font-weight: 800; font-size: 14px; padding: 7px 14px; border-radius: 20px; white-space: nowrap; }
.metiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.metier { border: 3px solid #e6e0d2; background: #fff; border-radius: 16px; padding: 8px 2px 7px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.metier .e { font-size: 28px; line-height: 1.1; }
.metier .n { font-weight: 900; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.phrase-metier { font-weight: 800; font-size: 15px; margin: 12px 2px 0; min-height: 20px; }
.metier.choisi { border-color: var(--encre); background: #fff7d6; box-shadow: 0 4px 0 var(--encre); }

/* bienvenue */
#bienvenue .centre-b { position: absolute; left: 0; right: 0; top: calc(var(--haut) + 40px); text-align: center; padding: 0 20px; display: flex; flex-direction: column; align-items: center; }
.b1 { font-size: 34px; margin: 0; } .b2 { font-size: clamp(56px, 17vw, 104px); margin: 0; line-height: 1; color: var(--jaune); }
.carte-blanche { background: #fff; border-radius: 24px; padding: 16px 20px; margin: 18px 0 18px; box-shadow: 0 8px 0 rgba(0, 0, 0, .18); font-weight: 800; font-size: 18px; line-height: 1.4; max-width: 380px; }
.carte-blanche b { font-size: 22px; }

/* carte */
.barre { position: absolute; top: calc(var(--haut) + 12px); left: 12px; right: 12px; display: flex; gap: 10px; }
.rond { width: 50px; height: 50px; flex: none; border-radius: 50%; border: 3px solid var(--encre); background: #fff; font-size: 22px; box-shadow: 0 4px 0 var(--encre); padding: 0; }
.recherche { flex: 1; display: flex; align-items: center; gap: 6px; background: #fff; border: 3px solid var(--encre); border-radius: 30px; padding: 0 14px; box-shadow: 0 4px 0 var(--encre); }
.recherche input { flex: 1; min-width: 0; border: none; outline: none; font: 800 17px var(--police); padding: 11px 0; background: none; }
.compteur { position: absolute; top: calc(var(--haut) + 74px); left: 50%; transform: translateX(-50%); background: var(--jaune); font-weight: 900; font-size: 15px; padding: 6px 14px; border-radius: 20px; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); white-space: nowrap; }
.suggestions { position: absolute; top: calc(var(--haut) + 70px); left: 72px; right: 12px; margin: 0; padding: 6px; list-style: none; background: #fff; border-radius: 18px; border: 3px solid var(--encre); display: none; z-index: 3; }
.suggestions.ouvert { display: block; }
.suggestions li { padding: 10px 10px; border-radius: 12px; font-weight: 800; font-size: 16px; display: flex; justify-content: space-between; gap: 8px; }
.suggestions li:active, .suggestions li.actif { background: var(--creme); }
.suggestions li small { color: #888; font-weight: 700; }
.suggestions li.vide { display: block; font-size: 14px; color: #555; line-height: 1.35; }
.boutons-carte { position: absolute; left: 12px; right: 12px; bottom: calc(var(--bas) + 14px); display: flex; gap: 10px; justify-content: center; }
.boutons-carte .bouton { flex: 1; max-width: 220px; font-size: 17px; padding: 12px 14px; }
.fiche { position: absolute; left: 12px; right: 12px; bottom: calc(var(--bas) + 84px); background: #fff; border-radius: 22px; border: 3px solid var(--encre); box-shadow: 0 5px 0 var(--encre); padding: 12px 14px; display: none; gap: 12px; align-items: center; max-width: 460px; margin: 0 auto; }
.fiche.ouvert { display: flex; }
.fiche .av { width: 54px; height: 54px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 28px; background: var(--creme); }
.fiche .t { flex: 1; min-width: 0; }
.fiche .t b { display: block; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fiche .t span { font-size: 13px; color: #666; font-weight: 700; }
.fiche .x { border: none; background: none; font-size: 24px; padding: 4px 6px; color: #999; }
.fiche .supprimer { display: block; margin-top: 6px; border: none; background: none; padding: 0; font: 800 13px var(--police); color: #c0392b; text-decoration: underline; }
.fiche .reclamer { margin-top: 6px; font-size: 13px; font-weight: 800; color: #2a64c9; }

/* ordinateur : la feuille passe à droite */
@media (min-width: 821px) {
  .feuille { left: auto; right: 24px; top: 24px; bottom: 24px; width: 400px; border-radius: 28px; max-height: none; padding-bottom: 18px; }
  #pseudo .feuille { max-height: none; }
  .aide-3d { left: calc(50% - 200px); }
  .barre { left: 50%; right: auto; width: 520px; transform: translateX(-50%); }
  .suggestions { left: calc(50% - 200px); right: auto; width: 460px; }
}
