/* Guide du camp (client/js/guide.js, lot I1 du 5/11) : voile, cadre éclairé, boîte de dialogue façon Explorateurs du Ciel. */

/* Le cadre éclairé : un seul bloc dont l'ombre immense assombrit tout le reste. Il ne prend jamais les clics. */
#guide-voile { position: fixed; z-index: 9000; pointer-events: none; border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(3, 6, 20, .62); transition: left .18s, top .18s, width .18s, height .18s; }
#guide-voile::before { content: ''; position: absolute; inset: -4px; border: 8px solid transparent;
  border-image: url('assets/ui/cadres/cadre1_yellow_fin.png') 8 / 8px stretch; image-rendering: pixelated;
  animation: gPulse 1.1s ease-in-out infinite; }
#guide-voile.g-saut::before { animation: gSaut .35s cubic-bezier(.2, 1.6, .4, 1), gPulse 1.1s .35s ease-in-out infinite; }
@keyframes gPulse { 0%, 100% { filter: drop-shadow(0 0 2px #ffd35c); transform: scale(1); } 50% { filter: drop-shadow(0 0 9px #ffd35c); transform: scale(1.03); } }
@keyframes gSaut { from { transform: scale(1.35); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* « ! » doré en pixels, comme sur le tableau des quêtes */
#guide-voile .g-mark { position: absolute; right: -10px; top: -22px; width: 18px; height: 26px; font: 26px/26px 'PMD Font', monospace; font-style: normal;
  color: #ffe14a; text-align: center; text-shadow: 2px 0 #5a3a00, -2px 0 #5a3a00, 0 2px #5a3a00, 0 -2px #5a3a00, 2px 2px #5a3a00; animation: gBob .8s ease-in-out infinite; }
/* Flèche en pixels (triangle à paliers) qui montre le bouton */
#guide-voile .g-fleche { position: absolute; top: 50%; left: -34px; width: 24px; height: 24px; margin-top: -12px; image-rendering: pixelated;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' shape-rendering='crispEdges'%3E%3Cpath d='M1 0h2v1h2v1h2v1h2v1h2v4h-2v1h-2v1h-2v1H3v1H1z' fill='%235a3a00'/%3E%3Cpath d='M2 1h1v1h2v1h2v1h2v1h1v2H9v1H7v1H5v1H3v1H2z' fill='%23ffd35c'/%3E%3Cpath d='M2 1h1v1h2v1h2v1H5V3H3V2H2z' fill='%23fff3b0'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: gPointe .7s ease-in-out infinite; }
#guide-voile .g-fleche.g-droite { left: auto; right: -34px; transform: scaleX(-1); animation-name: gPointeD; }
@keyframes gBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
@keyframes gPointe { 0%, 100% { translate: 0 0; } 50% { translate: 6px 0; } }
@keyframes gPointeD { 0%, 100% { translate: 0 0; } 50% { translate: -6px 0; } }

/* La boîte de dialogue : cadre bleu de la ROM, portrait de l'habitant, texte qui défile. */
#guide-dlg { position: fixed; z-index: 9001; left: 50%; bottom: 12px; width: min(820px, calc(100vw - 16px)); transform: translateX(-50%);
  display: flex; gap: 12px; align-items: flex-start; padding: 6px 10px; color: #fff; text-shadow: 0 2px 0 #000;
  border: 16px solid transparent; border-image: url('assets/ui/cadres/cadre1_blue.png') 8 fill / 16px stretch; image-rendering: pixelated;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .55)); font-size: 20px; line-height: 1.35; cursor: default; }
#guide-dlg.g-haut { bottom: auto; top: 12px; }
#guide-dlg[hidden] { display: none; }
#guide-dlg.g-in { animation: gIn .32s cubic-bezier(.2, 1.4, .4, 1); }
#guide-dlg.g-in .g-port img { animation: gHop .45s .1s steps(4); }
@keyframes gIn { from { transform: translate(-50%, 18px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
#guide-dlg.g-haut.g-in { animation-name: gInHaut; }
@keyframes gInHaut { from { transform: translate(-50%, -18px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
@keyframes gHop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
/* Écran de fin d'expédition (guide.js, placer) : boîte en bas, à gauche du bouton « Retour au camp », plus petite, pour
   laisser voir le titre « Expédition réussie » et les déblocages. Sans place à gauche, au-dessus du bouton. */
#guide-dlg.g-fin { bottom: auto; }
#guide-dlg.g-cote { transform: none; font-size: 16px; line-height: 1.3; gap: 8px; border-width: 12px; border-image-width: 12px; padding: 2px 6px; }
#guide-dlg.g-cote.g-in { animation-name: gInCote; }
@keyframes gInCote { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
#guide-dlg.g-fin.g-in:not(.g-cote) { animation-name: gIn; }
#guide-dlg.g-cote .g-port, #guide-dlg.g-cote .g-port img { width: 52px; height: 52px; }
#guide-dlg.g-cote .g-nom { font-size: 16px; }
#guide-dlg.g-cote .g-txt { min-height: 0; margin: 0 0 2px; }
#guide-dlg.g-cote .g-btn { font-size: 14px; padding: 2px 8px; }
#guide-dlg.g-cote .g-bas { font-size: 14px; gap: 6px; }
.g-port { flex: none; width: 80px; height: 80px; padding: 2px; border: 8px solid transparent;
  border-image: url('assets/ui/cadres/cadre1_blue_fin.png') 8 fill / 8px stretch; box-sizing: content-box; margin: -4px 0; }
.g-port img { width: 80px; height: 80px; image-rendering: pixelated; display: block; }
.g-corps { flex: 1; min-width: 0; }
.g-nom { color: var(--gold, #ffd35c); display: block; font-size: 20px; }
.g-txt { margin: 2px 0 4px; min-height: 2.7em; }
.g-or { color: #ffe27a; }
.g-bas, .g-conf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; }
.g-bas[hidden], .g-conf[hidden] { display: none; }
.g-bas .grow { flex: 1; }
.g-aide { color: #9fb4e0; }
.g-conf span { flex: 1 1 260px; color: #ffe27a; }
.g-btn { font: inherit; font-size: 16px; color: #dfe8ff; background: rgba(10, 20, 60, .7); border: 2px solid #7fa6ef; border-radius: 4px; padding: 2px 10px; cursor: pointer; text-shadow: 0 1px 0 #000; }
.g-btn:hover, .g-btn:focus-visible { border-color: #ffd35c; color: #fff; outline: none; }
.g-btn.g-tout { border-color: rgba(127, 166, 239, .45); color: #9fb4e0; }
.g-btn.g-oui { border-color: #ffd35c; color: #ffe27a; }
#guide-dlg.g-bravo { pointer-events: none; }
/* Pendant le guide, les toasts du camp ne passent pas sous le voile */
body.guide-on .toast { z-index: 9002; }

/* Étoiles en pixels quand l'étape est réussie */
.g-etoile { position: fixed; z-index: 9003; width: 6px; height: 6px; margin: -3px 0 0 -3px; pointer-events: none; background: #ffe14a;
  box-shadow: 0 0 0 2px #5a3a00; animation: gEtoile .75s ease-out forwards; }
@keyframes gEtoile { 0% { transform: translate(0, 0) scale(1.4); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(.4); opacity: 0; } }

/* Réglages → « Revoir les conseils » */
.guide-conseils .g-conseils-box { width: min(760px, 94vw); max-height: 88vh; overflow: auto; }
/* Elle s'ouvre par-dessus les Réglages : cadre opaque, le texte des Réglages ne transparaît plus (5/11). */
.guide-conseils .g-conseils-box { border-image-source: url('assets/ui/cadres/cadre1_blue.png'); }
.modal.guide-conseils { background: rgba(3, 6, 20, .78); }
.g-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.g-ligne { display: flex; align-items: center; gap: 8px; text-align: left; font-size: 18px; }
.g-ligne img { width: 40px; height: 40px; image-rendering: pixelated; }
.g-ligne small { display: block; font-size: 14px; }
.g-ligne.g-pasvu { opacity: .45; }
.g-relire { display: flex; gap: 10px; align-items: center; padding: 6px 10px; margin-bottom: 6px; border: 12px solid transparent;
  border-image: url('assets/ui/cadres/cadre1_blue.png') 8 fill / 12px stretch; image-rendering: pixelated; }
.g-relire[hidden] { display: none; }
.g-relire img { width: 56px; height: 56px; image-rendering: pixelated; }
.g-relire p { margin: 0; font-size: 18px; }
.g-relire.g-in { animation: gHop .35s steps(3); }

/* Téléphone : boîte plus basse et plus petite, couché comme debout */
body.is-touch #guide-dlg { font-size: 16px; gap: 8px; border-width: 12px; border-image-width: 12px; padding: 2px 6px; bottom: max(6px, env(safe-area-inset-bottom)); }
body.is-touch #guide-dlg.g-haut { top: 6px; bottom: auto; }
body.is-touch .g-port, body.is-touch .g-port img { width: 52px; height: 52px; }
body.is-touch .g-nom { font-size: 16px; }
body.is-touch .g-txt { min-height: 0; margin: 0 0 2px; }
body.is-touch .g-btn { font-size: 15px; padding: 4px 10px; min-height: 32px; }
@media (max-height: 520px) {
  #guide-dlg { font-size: 16px; width: min(760px, calc(100vw - 120px)); }
  .g-port, .g-port img { width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  #guide-voile::before, #guide-voile .g-mark, #guide-voile .g-fleche, #guide-dlg.g-in, .g-etoile { animation: none; }
}

/* Expédition : « Partir seul » ou « Avec des amis » (recherche du 5/11, 1.1) */
.expe-choix { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 10px; margin: 6px 0 4px; align-items: stretch; }
.expe-solo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 14px 10px; margin: 0;
  border-image-source: url('assets/ui/cadres/cadre1_yellow.png'); }
.expe-solo b { font-size: 28px; color: #ffe27a; }
.expe-solo .es-txt, .expe-amis .es-txt { font-size: 16px; color: #c4cde6; line-height: 1.3; }
.expe-solo .es-ico .pxi { animation: gBob 1.6s ease-in-out infinite; }
.expe-solo:hover .es-ico .pxi, .expe-solo.focus .es-ico .pxi { animation-duration: .7s; }
.expe-amis { padding: 8px 10px; border: 12px solid transparent; border-image: url('assets/ui/cadres/cadre1_blue_fin.png') 8 fill / 12px stretch; image-rendering: pixelated; }
.expe-amis .ea-haut { display: flex; align-items: center; gap: 8px; }
.expe-amis .ea-haut b { font-size: 24px; color: #8fd0ff; }
.expe-amis .salon-types { margin-top: 6px; }
@media (max-width: 720px), (max-height: 520px) {
  .expe-choix { grid-template-columns: 1fr; }
  .expe-solo { flex-direction: row; justify-content: flex-start; text-align: left; padding: 8px 10px; flex-wrap: wrap; }
  .expe-solo b { font-size: 24px; }
  .expe-solo .es-txt { flex: 1 1 200px; }
}
