/* boucle.css — la carte, la route, la salle, ouvrir.
   Mêmes jetons que app.css. Le texte posé sur l'image tient par une ombre,
   pas par un panneau : la scène reste entière derrière. */

.boucle {
  position: relative;
  overflow: hidden;
  margin: -14px calc(-1 * var(--gouttiere)) 0;
  background: #1A1813;
}
@media (min-width: 761px) { .boucle { margin: -14px 0 0; border-radius: var(--r); } }
.boucle-vide { height: 100%; display: grid; place-content: center; gap: 14px; text-align: center; color: var(--texte-2); padding: 24px; }

.visage {
  flex: none; width: var(--t); height: var(--t); border-radius: 999px;
  display: grid; place-items: center; font-weight: 800; color: var(--texte);
  font-size: calc(var(--t) * 0.4); border: 2px solid #14130F;
}
.visage.parle { box-shadow: 0 0 0 2px var(--or); }
.sur-image, .ligne-chat, .salle-sous .lieu-ouvert, .scene-salle .nom {
  text-shadow: 0 1px 3px rgba(0,0,0,.95), 0 0 10px rgba(0,0,0,.6);
}
.erreur { color: #E8A08A; font-size: 13px; font-weight: 600; margin: 8px 0 0; }
.note { font-size: 12px; font-weight: 600; color: var(--texte-3); line-height: 1.45; margin: 8px 0 0; }
.note.bleue { color: #CFD9E8; background: #191C22; border: 1px solid #2A3240; border-radius: 12px; padding: 10px 12px; }
.sous-titre { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--texte-3); margin: 14px 0 8px; display: flex; justify-content: space-between; }
.sous-titre .vert { color: var(--vert); letter-spacing: 0; font-weight: 700; }
.sous-titre span { letter-spacing: 0; font-weight: 700; }
.bouton.large { display: flex; width: 100%; justify-content: center; align-items: center; gap: 8px; margin-top: 12px; padding: 14px; font-size: 15px; }
.fermer { width: 36px; height: 36px; border-radius: 999px; background: var(--surface-3); font-size: 20px; line-height: 1; flex: none; }
.lecteur { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* =============================================================== la carte */

.plan { position: absolute; inset: 0; }
.rues { position: absolute; inset: 0; width: 100%; height: 100%; }
.rues line { stroke: #2A2720; stroke-width: 7px; }
.moi-point {
  position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 999px;
  background: #8FB4E0; border: 3px solid #14130F; box-shadow: 0 0 0 8px rgba(143,180,224,.18);
}
.epingle {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0;
}
.epingle .visages { display: flex; align-items: center; }
.epingle .visage.petit { margin-left: -9px; }
.epingle.ouverte .visages > .visage:first-child { border-color: var(--vert); }
.epingle.top .visages > .visage:first-child { border-color: var(--or); box-shadow: 0 0 0 5px rgba(232,182,30,.25); }
.epingle.touchee .etiquette { background: var(--or); color: var(--fond); }
.point-ferme { width: 12px; height: 12px; border-radius: 999px; background: #3A352B; border: 2px solid #14130F; }
.etiquette {
  font-size: 11px; font-weight: 800; white-space: nowrap; color: var(--texte);
  background: rgba(20,19,15,.85); padding: 3px 8px; border-radius: 999px;
}
.epingle:not(.ouverte) .etiquette { font-weight: 600; color: var(--texte-3); font-size: 10px; }

.carte-haut {
  position: absolute; left: 0; right: 0; top: 0; padding: 14px 14px 18px;
  background: linear-gradient(#14130F 70%, rgba(20,19,15,0));
}
.carte-titre { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.carte-titre strong { display: block; font-size: 18px; font-weight: 800; }
.carte-titre span { display: block; font-size: 12px; font-weight: 600; color: var(--vert); margin-top: 2px; }
.carte-titre .pilule { text-decoration: none; color: var(--texte); white-space: nowrap; }
.carte-haut .pilules { padding: 12px 0 0; }
.bandeau-route {
  display: block; margin-top: 8px; text-decoration: none; font-size: 13px; font-weight: 800;
  color: var(--fond); background: var(--or); border-radius: 12px; padding: 10px 12px;
}
.bandeau-route.calme { background: var(--surface-2); color: var(--texte); border: 1px solid var(--bord); }
.bandeau-route.erreur { background: #2A1C17; color: #E8A08A; border: 1px solid #5A3A2A; }

/* --- la feuille d'un lieu */
.feuille {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 82%; overflow-y: auto;
  background: #1A1813; border-top: 1px solid #2E2B24; border-radius: 22px 22px 0 0;
  padding: 10px 16px 20px; box-shadow: 0 -18px 40px rgba(0,0,0,.45);
}
.poignee { width: 40px; height: 4px; border-radius: 999px; background: #3A352B; margin: 0 auto 12px; }
.feuille-haut { display: flex; align-items: flex-start; gap: 10px; }
.feuille-haut > div { flex: 1; min-width: 0; }
.feuille-haut h2 { margin: 0; font-size: 18px; font-weight: 800; }
.feuille-haut p { margin: 4px 0 0; font-size: 12.5px; font-weight: 600; color: var(--texte-3); line-height: 1.4; }
.feuille-haut .distance { font-size: 12px; font-weight: 700; color: var(--texte-2); padding-top: 4px; white-space: nowrap; }
.feuille-vide { color: var(--texte-2); font-size: 14px; margin: 14px 0 0; }

.hotes { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.ligne-hote {
  display: flex; align-items: center; gap: 11px; text-align: left; width: 100%;
  background: var(--surface); border: 1px solid #2E2B24; border-radius: 15px; padding: 10px 11px;
}
.ligne-hote.choisie { background: var(--surface-2); border: 1.5px solid var(--or); }
.ligne-hote .texte { flex: 1; min-width: 0; }
.ligne-hote .nom { display: block; font-size: 14px; font-weight: 800; }
.ligne-hote .stats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; font-weight: 700; color: var(--texte-3); margin-top: 4px; }
.ligne-hote .stats b { color: var(--texte); }
.ligne-hote .stats b.or { color: var(--or); }
.ligne-hote .action { font-size: 12px; font-weight: 800; color: var(--or); }
.ligne-hote .action.calme { color: var(--texte-2); }
.marque-or { font-size: 9.5px; font-weight: 800; color: var(--fond); background: var(--or); padding: 2px 6px; border-radius: 999px; margin-left: 4px; vertical-align: 2px; }

.transports { display: flex; flex-direction: column; gap: 7px; }
.transport {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: var(--surface); border: 1px solid #2E2B24; border-radius: 14px; padding: 11px;
}
.transport.choisi { background: var(--surface-2); border: 1.5px solid var(--or); }
.transport .ic { flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; }
.transport .texte { flex: 1; }
.transport .nom { display: block; font-size: 14px; font-weight: 800; }
.transport .detail { display: block; font-size: 12px; font-weight: 600; color: var(--texte-3); }
.transport .prix { font-size: 13px; font-weight: 800; color: var(--or); }
.transport .prix.gratuit { color: var(--vert); }

/* ============================================================== la route */

.route { height: 100%; display: flex; flex-direction: column; }
.route-scene { flex: 1; position: relative; background: linear-gradient(#1A2433, #8A4A2A 70%, #C0532F); }
.route-rue {
  position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  background: repeating-linear-gradient(90deg, #3A352B 0 40px, #33302A 40px 80px);
  border-top: 6px solid #2A2620;
}
.route-rue::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 3px dashed rgba(232,182,30,.55); }
.route-mobile {
  position: absolute; top: 50%; transform: translate(-50%, -60%); width: 54px; height: 54px; border-radius: 999px;
  background: var(--or); color: var(--fond); display: grid; place-items: center; transition: left .5s linear;
  box-shadow: 0 6px 20px rgba(0,0,0,.4); z-index: 1;
}
.route-but { position: absolute; right: 6%; top: 50%; transform: translateY(-60%); }
.route-texte { padding: 20px 18px 26px; }
.route-texte .sur { font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--or); text-transform: uppercase; }
.route-texte h2 { margin: 6px 0 2px; font-size: 22px; font-weight: 800; }
.route-texte p { margin: 4px 0 0; color: var(--texte-2); font-size: 14px; font-weight: 600; }
.barre { height: 6px; border-radius: 999px; background: var(--surface-3); margin-top: 16px; overflow: hidden; }
.barre span { display: block; height: 100%; background: var(--or); border-radius: 999px; transition: width .5s linear; }
.route-texte .reste { color: var(--texte); font-weight: 800; }

/* ============================================================== la salle */

.salle { position: relative; height: 100%; }
.scene-salle { position: absolute; inset: 0; overflow: hidden; background: #A9A396; }
.scene-salle .mur { position: absolute; left: 0; right: 0; top: 0; height: 44%; background: linear-gradient(#EDE7D8, #CFC3A6); }
.scene-salle .rayons {
  position: absolute; left: 18%; right: 18%; top: 14%; height: 22%;
  background: repeating-linear-gradient(90deg, #EDE8DA 0 12px, #2F7D4F 12px 20px, #D8DEE4 20px 32px, #C0532F 32px 40px, #E6E2D6 40px 52px),
              #C2B698;
  background-size: 100% 26%;
  background-repeat: repeat-y;
  border-top: 5px solid #8A5A3C; border-bottom: 5px solid #8A5A3C;
  opacity: .9;
}
.scene-salle .sol { position: absolute; left: 0; right: 0; top: 44%; bottom: 0; background: linear-gradient(#C6C0B0, #8A8274); }
.scene-salle .comptoir { position: absolute; left: 8%; right: 8%; top: 46%; height: 9%; background: linear-gradient(#C8A478 0 45%, #A07849 45%); border-radius: 4px; }
.scene-salle::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: linear-gradient(transparent, rgba(14,13,10,.82)); pointer-events: none; }
.scene-salle::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 130px; background: linear-gradient(rgba(14,13,10,.7), transparent); z-index: 2; pointer-events: none; }

.hote { position: absolute; left: 50%; top: 27%; transform: translateX(-50%); width: 60px; height: 110px; z-index: 1; }
.hote .tete, .spectateur .tete { position: absolute; left: 50%; transform: translateX(-50%); border-radius: 999px; background: #5A4030; }
.hote .tete { top: 14px; width: 30px; height: 30px; }
.hote .corps { position: absolute; left: 50%; top: 44px; transform: translateX(-50%); width: 46px; height: 44px; border-radius: 16px 16px 6px 6px; background: var(--c); }
.hote .halo { position: absolute; left: 50%; top: 40%; width: 170px; height: 170px; transform: translate(-50%, -50%); border-radius: 999px; background: radial-gradient(rgba(242,204,84,.5), rgba(242,204,84,0) 70%); animation: halo 1.8s ease-in-out infinite; }
@keyframes halo { 50% { transform: translate(-50%, -50%) scale(1.12); opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .hote .halo { animation: none; } }
.hote .couronne { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); }
.hote .nom { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 800; color: var(--or); display: flex; gap: 4px; align-items: center; }

.tas { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; z-index: 1; }
.tas b { font-size: 11px; font-weight: 800; color: #F2CC54; text-shadow: 0 1px 3px rgba(0,0,0,.95); }

.spectateur { position: absolute; width: 30px; height: 56px; transform: translateX(-50%); }
.spectateur .tete { top: 0; width: 18px; height: 18px; }
.spectateur .corps { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); width: 26px; height: 36px; border-radius: 11px 11px 5px 5px; background: var(--c); }
.spectateur.main::after { content: ""; position: absolute; right: -6px; top: -10px; width: 6px; height: 26px; border-radius: 4px; background: var(--c); transform: rotate(18deg); }
.spectateur.main { transform: translateX(-50%) translateY(-8px); }
.spectateur .nom { position: absolute; left: 50%; top: -18px; transform: translateX(-50%); white-space: nowrap; font-size: 10.5px; font-weight: 800; color: #8FB4E0; }
.spectateur.parle .nom { color: var(--or); }

.salle-haut { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; align-items: center; gap: 9px; z-index: 3; }
.rond-verre { flex: none; width: 34px; height: 34px; border-radius: 999px; background: rgba(20,19,15,.66); color: var(--texte); display: grid; place-items: center; }
.puce-hote { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: rgba(20,19,15,.72); border-radius: 999px; padding: 4px 6px 4px 4px; }
.puce-hote .texte { flex: 1; min-width: 0; }
.puce-hote strong { display: block; font-size: 12.5px; font-weight: 800; }
.puce-hote .texte span { display: block; font-size: 10.5px; font-weight: 600; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suivre { flex: none; font-size: 11.5px; font-weight: 800; padding: 7px 13px; border-radius: 999px; background: var(--or); color: var(--fond); }
.suivre.suivi { background: var(--surface-3); color: var(--texte); }
.compte { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; background: rgba(20,19,15,.72); padding: 9px 11px; border-radius: 999px; }
.compte .pt { width: 6px; height: 6px; border-radius: 999px; background: var(--vert); }

.salle-sous { position: absolute; left: 14px; right: 12px; top: 56px; display: flex; justify-content: space-between; align-items: center; z-index: 3; }
.lieu-ouvert { font-size: 11.5px; font-weight: 700; color: var(--vert); }
.autres-puce { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; background: rgba(20,19,15,.72); border: 1px solid rgba(245,241,232,.2); border-radius: 999px; padding: 6px 11px; }

.epingle-salle {
  position: absolute; left: 12px; right: 12px; top: 92px; z-index: 3;
  display: flex; gap: 8px; align-items: center; color: var(--or);
  background: rgba(30,26,14,.85); border: 1px solid rgba(232,182,30,.5); border-radius: 12px; padding: 8px 10px;
}
.epingle-salle span { font-size: 12px; font-weight: 600; color: var(--texte); line-height: 1.35; }
.epingle-salle b { color: var(--or); }

.chat-salle {
  position: absolute; left: 14px; bottom: 110px; width: min(62%, 420px); max-height: 36%;
  overflow: hidden; display: flex; flex-direction: column; gap: 8px; z-index: 3;
  -webkit-mask-image: linear-gradient(transparent, #000 30%); mask-image: linear-gradient(transparent, #000 30%);
}
.ligne-chat { font-size: 13px; line-height: 1.38; color: #FFF; }
.ligne-chat b { font-weight: 800; }
.ligne-chat.systeme { color: #F2E7C8; font-style: italic; }
.ligne-chat.epinglee { color: #F7E08A; }

.colonne-gestes { position: absolute; right: 14px; bottom: 120px; display: flex; flex-direction: column; gap: 10px; z-index: 3; }
.geste { width: 48px; height: 48px; border-radius: 999px; background: rgba(20,19,15,.7); color: var(--texte); display: grid; place-items: center; }
.geste.or { background: var(--or); color: var(--fond); }
.geste.actif { background: #8FB4E0; color: var(--fond); }

.barre-salle {
  position: absolute; left: 12px; right: 12px; bottom: 34px; z-index: 4;
  display: flex; align-items: center; gap: 8px; background: rgba(22,21,18,.92);
  border: 1px solid rgba(245,241,232,.16); border-radius: 999px; padding: 6px 6px 6px 16px;
}
.barre-salle input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 14px; }
.barre-salle input::placeholder { color: var(--texte-3); }
.barre-salle .rond.or { color: var(--fond); }
.non-branche { position: absolute; left: 0; right: 0; bottom: 10px; margin: 0; text-align: center; font-size: 11px; font-weight: 600; color: var(--texte-2); z-index: 4; text-shadow: 0 1px 3px rgba(0,0,0,.9); }
.erreur.flottante { position: absolute; left: 12px; right: 12px; bottom: 84px; z-index: 5; background: #2A1C17; border: 1px solid #5A3A2A; border-radius: 12px; padding: 9px 12px; }

/* --- l'hôte : son pupitre */
.pupitre {
  /* en haut : le bas de l'écran appartient au chat, que l'hôte doit lire */
  position: absolute; right: 12px; top: 92px; width: min(300px, calc(100% - 24px)); z-index: 4;
  background: rgba(20,19,15,.88); border: 1px solid #2E2B24; border-radius: 16px; padding: 10px;
}
.pupitre-haut { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.etat-voix { flex: 1 1 100%; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--texte-2); }
.etat-voix.on { color: var(--or); }
.petit-bouton { font-size: 12px; font-weight: 800; padding: 7px 11px; border-radius: 999px; background: var(--or); color: var(--fond); }
.petit-bouton.danger { background: transparent; border: 1px solid #5A3A2A; color: #E8A08A; margin-left: auto; }
.mains { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.main-levee { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.main-levee > span:not(.visage) { flex: 1; }
.salle .ligne-chat[data-ligne] { cursor: default; }
.epingle-note { color: var(--or); display: flex; gap: 5px; align-items: baseline; }

/* --- les tiroirs : cadeaux, autres lieux */
.tiroir {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; max-height: 78%; overflow-y: auto;
  background: #1A1813; border-top: 1px solid #2E2B24; border-radius: 22px 22px 0 0; padding: 14px 16px 22px;
  box-shadow: 0 -18px 40px rgba(0,0,0,.5);
}
.tiroir-haut { display: flex; justify-content: space-between; align-items: center; }
.tiroir-haut strong { font-size: 17px; font-weight: 800; }
.cadeaux-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.cadeau { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--surface); border: 1px solid #2E2B24; border-radius: 14px; padding: 12px 4px; }
.cadeau span { font-size: 12.5px; font-weight: 800; }
.cadeau b { font-size: 11px; font-weight: 700; color: var(--or); }

/* ============================================================== ouvrir */

.conditions { display: flex; flex-direction: column; gap: 8px; }
.condition { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid #2E2B24; border-radius: 14px; padding: 12px; }
.condition.ok { background: #1B2A1C; border-color: #2E4A30; }
.condition .coche { flex: none; width: 26px; height: 26px; border-radius: 999px; border: 2px solid #3A352B; display: grid; place-items: center; font-weight: 800; color: var(--fond); }
.condition.ok .coche { background: var(--vert); border-color: var(--vert); }
.condition .texte { flex: 1; font-size: 14px; font-weight: 700; }
.condition b { font-size: 12px; color: var(--or); }
.jauge { display: block; height: 5px; border-radius: 999px; background: var(--surface-3); margin-top: 7px; }
.jauge span { display: block; height: 100%; border-radius: 999px; background: var(--or); }
.lieux-ouvrir { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.lieu-ouvrir { text-align: left; background: var(--surface); border: 1px solid #2E2B24; border-radius: 14px; padding: 12px; }
.lieu-ouvrir:not(:disabled):hover { border-color: var(--or); }
.lieu-ouvrir:disabled { opacity: .5; cursor: not-allowed; }
.lieu-ouvrir .nom { display: block; font-size: 14px; font-weight: 800; }
.lieu-ouvrir .detail { display: block; font-size: 12px; font-weight: 600; color: var(--texte-3); margin-top: 3px; }

/* acheter chez l'hôte : le verbe du lieu sous l'icône */
.geste.acheter { background: #FBFAF7; color: #1D2433; display: flex; flex-direction: column; gap: 0; font-size: 18px; line-height: 1; }
.geste.acheter small { font-size: 8.5px; font-weight: 800; letter-spacing: .02em; margin-top: 2px; }
/* une commande dans le chat : l'hôte doit la voir */
.ligne-chat.commande { border: 1.5px solid var(--or); background: rgba(232, 182, 30, .14); }
