/* Démo : astuces contextuelles et visite guidée (demo-help.js). */

.help-btn {
  margin-left: auto; height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 13px;
  background: none; color: var(--text); font: inherit; font-size: 11.5px; cursor: pointer;
}
.help-btn:hover { background: var(--hover); }

.mh-hint kbd, .mh-tour kbd {
  display: inline-block; padding: 0 5px; border: 1px solid rgba(255,255,255,.25); border-bottom-width: 2px;
  border-radius: 4px; font: 600 11px/16px ui-monospace, Menlo, monospace; color: #fff;
}

/* ---------- Astuce ---------- */
.mh-hint {
  position: absolute; z-index: 30; left: 50%; bottom: 22px; width: min(420px, calc(100% - 32px));
  padding: 12px 14px 10px; border-radius: 12px; background: #0b5fa5; color: #fff;
  font-size: 13px; line-height: 1.45; box-shadow: 0 12px 34px rgba(0,0,0,.5);
  opacity: 0; transform: translate(-50%, 10px); transition: opacity .18s ease, transform .18s ease;
}
.mh-hint.above-ctx { bottom: 92px; }
.mh-hint.show { opacity: 1; transform: translate(-50%, 0); }
.mh-hint__body { display: flex; gap: 12px; align-items: center; }
.mh-hint__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.mh-link { padding: 0; border: 0; background: none; color: inherit; opacity: .7; font: inherit; font-size: 11.5px; text-decoration: underline; cursor: pointer; }
.mh-link:hover { opacity: 1; }
.mh-ok { height: 26px; padding: 0 14px; border: 0; border-radius: 6px; background: #fff; color: #0b5fa5; font: inherit; font-weight: 700; cursor: pointer; }

/* Bouton Fusionner mis en avant */
.ctx .t.mh-pulse { position: relative; color: #fff; }
.ctx .t.mh-pulse span { color: #fff; }
.ctx .t.mh-pulse::after {
  content: ''; position: absolute; inset: 0; border-radius: 8px; box-shadow: 0 0 0 2px var(--accent);
  animation: mh-pulse 1.4s ease-out infinite;
}
@keyframes mh-pulse { 0% { box-shadow: 0 0 0 2px var(--accent); } 70% { box-shadow: 0 0 0 8px rgba(13,153,255,0); } 100% { box-shadow: 0 0 0 2px var(--accent); } }

/* ---------- Animation « fusionner » : grille 3×2 ---------- */
.mh-anim {
  position: relative; flex: none; display: grid; grid-template-columns: repeat(3, 22px); grid-template-rows: repeat(2, 22px); gap: 3px;
  width: 72px; height: 47px;
}
.mh-tour .mh-anim { margin: 4px 0 12px; transform: scale(1.4); transform-origin: left top; height: 66px; }
.mh-anim i { border-radius: 3px; background: rgba(255,255,255,.18); }
.mh-anim .mh-sel, .mh-anim .mh-big { position: absolute; left: 0; top: 0; width: 47px; height: 47px; border-radius: 3px; }
.mh-anim .mh-sel { box-shadow: 0 0 0 2px #fff inset; background: rgba(13,153,255,.35); animation: mh-sel 4s infinite; }
.mh-anim .mh-big { background: linear-gradient(135deg, #ff5f6d, #ffc371); animation: mh-big 4s infinite; }
.mh-anim .mh-cursor {
  position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5);
  animation: mh-cursor 4s infinite;
}
@keyframes mh-sel {
  0%, 10% { opacity: 0; width: 22px; height: 22px; }
  15% { opacity: 1; width: 22px; height: 22px; }
  40%, 55% { opacity: 1; width: 47px; height: 47px; }
  62%, 100% { opacity: 0; width: 47px; height: 47px; }
}
@keyframes mh-big { 0%, 58% { opacity: 0; transform: scale(.9); } 66%, 92% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
@keyframes mh-cursor {
  0% { left: 6px; top: 6px; opacity: 0; }
  10% { left: 6px; top: 6px; opacity: 1; }
  40%, 55% { left: 32px; top: 32px; opacity: 1; }
  65%, 100% { left: 32px; top: 32px; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .mh-anim .mh-sel, .mh-anim .mh-big, .mh-anim .mh-cursor, .ctx .t.mh-pulse::after { animation: none; }
  .mh-anim .mh-big { opacity: 1; }
}

/* ---------- Visite guidée ---------- */
.mh-tour { position: fixed; inset: 0; z-index: 1000; }
.mh-tour__spot {
  position: fixed; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 200vmax rgba(0,0,0,.62), 0 0 0 2px var(--accent);
  transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease;
}
.mh-tour__bubble {
  position: fixed; width: 320px; padding: 16px 18px 14px; border-radius: 12px;
  background: #fff; color: #1d1d1f; font-size: 13.5px; line-height: 1.5; box-shadow: 0 18px 50px rgba(0,0,0,.45);
  transition: left .25s ease, top .25s ease;
}
.mh-tour__bubble h4 { margin: 2px 0 6px; font-size: 15px; }
.mh-tour__bubble p { margin: 0; }
.mh-tour__bubble kbd { color: #1d1d1f; border-color: rgba(0,0,0,.25); }
.mh-tour .mh-anim i { background: #e3e3e6; }
.mh-tour__count { color: #8a8a8e; font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.mh-tour__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.mh-tour__foot .mh-link { color: #6e6e73; }
.mh-tour__foot > span { display: flex; gap: 6px; }
.mh-btn { height: 30px; padding: 0 12px; border: 1px solid #d2d2d7; border-radius: 7px; background: #fff; color: #1d1d1f; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.mh-btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.mh-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ctx.mh-on-top { z-index: 1001; pointer-events: none; }
