/* Bulle « Pas besoin d'appuyer plein de fois » (25/11/2026, client/js/conseil-maintien.js) : en haut au milieu, dans le cadre
   fin du HUD (bord bleu clair, coins dorés en pixels). La touche (ou le bouton, ou le rond tactile) s'enfonce trois fois puis
   reste tenue et brille ; une petite jauge dorée montre le temps qui reste. Entrée : descend avec un petit rebond ; sortie : remonte. */
#hud .conseil-maintien { position: absolute; left: 50%; top: 46px; transform: translateX(-50%); z-index: 7; pointer-events: none;
  animation: cm-entre .5s cubic-bezier(.2, 1.5, .4, 1) both; }
#hud:has(#h-boss:not(.hidden)) .conseil-maintien { top: 84px; } /* sous la barre du chef */
#hud .conseil-maintien.sort { animation: cm-sort .4s ease-in forwards; }
#hud .cm-cadre { position: relative; display: flex; align-items: center; gap: 12px; padding: 7px 16px 10px 10px; max-width: min(620px, calc(92vw / var(--hud, 1)));
  border: 1px solid rgba(143,184,255,.7); border-radius: 2px;
  background: linear-gradient(180deg, rgba(20,38,92,.9), rgba(6,12,34,.86));
  box-shadow: 0 0 0 1px rgba(2,5,15,.85), inset 0 0 0 1px rgba(2,5,15,.55), inset 0 1px 0 rgba(255,255,255,.12), 0 4px 14px rgba(0,0,0,.45); }
#hud .cm-cadre::before { content: ''; position: absolute; inset: -2px; pointer-events: none;
  background:
    linear-gradient(#ffd35c, #ffd35c) left top / 5px 1px no-repeat, linear-gradient(#ffd35c, #ffd35c) left top / 1px 5px no-repeat,
    linear-gradient(#ffd35c, #ffd35c) right top / 5px 1px no-repeat, linear-gradient(#ffd35c, #ffd35c) right top / 1px 5px no-repeat,
    linear-gradient(#ffd35c, #ffd35c) left bottom / 5px 1px no-repeat, linear-gradient(#ffd35c, #ffd35c) left bottom / 1px 5px no-repeat,
    linear-gradient(#ffd35c, #ffd35c) right bottom / 5px 1px no-repeat, linear-gradient(#ffd35c, #ffd35c) right bottom / 1px 5px no-repeat; }
#hud .cm-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
#hud .cm-t { font-family: 'PMD Font', 'Pixelify', sans-serif; font-size: 16px; color: var(--gold); letter-spacing: .5px; white-space: nowrap;
  text-shadow: 0 2px 0 #6b3b00, 0 0 10px rgba(255,200,80,.35); }
#hud .cm-s { font-size: 16px; color: #dfe9ff; line-height: 1.15; }
/* jauge du temps qui reste (6 s, comme DUREE dans conseil-maintien.js) */
#hud .cm-jauge { position: absolute; left: 10px; right: 10px; bottom: 3px; height: 2px; background: linear-gradient(90deg, #f0a830, #ffd35c);
  transform-origin: left center; animation: cm-jauge 6s linear forwards; opacity: .85; }

/* La touche du clavier, ou le bouton de la manette */
#hud .cm-touche { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 32px; padding: 0 8px;
  font-family: 'PMD Font', 'Pixelify', sans-serif; font-size: 16px; color: #fff4c8;
  background: linear-gradient(180deg, #3b5aa8, #22386f); border: 1px solid #9fc0ff; border-radius: 3px;
  box-shadow: 0 4px 0 #0c1736, 0 5px 0 rgba(0,0,0,.5); animation: cm-appui 2.4s steps(1, end) .35s both; }
#hud .cm-manette .cm-touche { padding: 0 3px; min-width: 32px; background: none; border: 0; box-shadow: none; filter: drop-shadow(0 3px 0 rgba(0,0,0,.55)); animation-name: cm-appui-pad; }
#hud .cm-touche .pad-btn, #hud .cm-touche .tv { display: inline-flex; align-items: center; }
/* (les 3 premiers appuis, puis tenue : la touche reste enfoncée et brille) */
@keyframes cm-appui {
  0%, 12%, 24% { transform: translateY(4px); box-shadow: 0 0 0 #0c1736, 0 1px 0 rgba(0,0,0,.5); }
  6%, 18%, 30% { transform: none; box-shadow: 0 4px 0 #0c1736, 0 5px 0 rgba(0,0,0,.5); }
  36%, 100% { transform: translateY(4px); box-shadow: 0 0 0 #0c1736, 0 1px 0 rgba(0,0,0,.5), 0 0 12px rgba(255,211,92,.75); border-color: #ffd35c; color: #ffd35c; }
}
@keyframes cm-appui-pad {
  0%, 12%, 24% { transform: translateY(3px) scale(.92); }
  6%, 18%, 30% { transform: none; }
  36%, 100% { transform: translateY(3px) scale(.92); filter: drop-shadow(0 0 6px rgba(255,211,92,.9)); }
}

/* Tactile : un rond d'attaque, le doigt posé dessus, avec un halo qui reste */
#hud .cm-doigt { position: relative; flex: none; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: 'PMD Font', 'Pixelify', sans-serif; font-size: 16px; color: #fff4c8; text-shadow: 0 1px 0 #000;
  background: radial-gradient(circle at 40% 35%, #6f8fe0, #2a428c 70%); border: 2px solid #9fc0ff; box-shadow: 0 3px 0 rgba(0,0,0,.5);
  animation: cm-appui-pad 2.4s steps(1, end) .35s both; }
#hud .cm-doigt::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(255,211,92,.85); opacity: 0;
  animation: cm-halo 1.2s ease-out 1.3s infinite; }

@keyframes cm-halo { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes cm-entre { 0% { opacity: 0; transform: translate(-50%, -26px) scale(.9); } 100% { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes cm-sort { 0% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -22px); } }
@keyframes cm-jauge { from { transform: scaleX(1); } to { transform: scaleX(0); } }

body.is-touch #hud .conseil-maintien { top: 40px; } /* sous la pastille de l'étage (en haut au milieu sur téléphone) */
body.is-touch #hud:has(#h-boss:not(.hidden)) .conseil-maintien { top: 64px; }
body.is-touch #hud .cm-cadre { gap: 8px; padding: 4px 10px 7px 6px; max-width: min(460px, calc(62vw / var(--hud, 1))); }
body.is-touch #hud .cm-t, body.is-touch #hud .cm-s { font-size: 14px; }
@media (prefers-reduced-motion: reduce) {
  #hud .conseil-maintien, #hud .cm-touche, #hud .cm-doigt, #hud .cm-doigt::after { animation-duration: .01s; animation-iteration-count: 1; }
}
