/* aide.css — infobulle #tip, carte d'aide « ? », surcouche d'annotations, Guide, tutoriel (lot C).
   z-index uniques (spec §8.6) : #overlay 50 · #fly 55 · #tuto 57 · carte d'aide 58 · surcouche 59 · #toasts 60 · #tip 65. */
[data-tip] { -webkit-touch-callout: none; }
button[data-tip], [role=button][data-tip], .g-mark[data-tip] { -webkit-user-select: none; user-select: none; }

#tip.aide-tip {
  position: fixed; left: 0; top: 0; z-index: 65; pointer-events: none;
  max-width: min(260px, calc(100vw - 32px)); padding: 8px 11px; border-radius: 10px;
  background: rgba(3, 6, 16, 0.97); color: #eaf3ff; border: 1px solid rgba(127, 240, 255, 0.45);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55); font: 500 14px/1.4 'Space Grotesk', system-ui, sans-serif;
  opacity: 0; transition: opacity 120ms;
}
#tip.aide-tip.on { opacity: 1; }
#tip.aide-tip b { display: block; font-weight: 700; color: #fff; }
#tip.aide-tip span { display: block; color: #c8d6f0; margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { #tip.aide-tip { transition: none; } }

/* ---------------------------------------------------------------- carte d'aide « ? » */
.aide-card {
  position: fixed; z-index: 58; right: 16px; top: 76px; width: 360px; max-height: 76vh; display: flex; flex-direction: column;
  background: rgba(3, 6, 16, 0.97); color: #eaf3ff; border: 1px solid rgba(127, 240, 255, 0.4); border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); font: 400 15px/1.45 'Space Grotesk', system-ui, sans-serif;
  animation: aide-in 160ms ease-out;
}
@keyframes aide-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* N02 — fiche déjà ouverte, recliquée depuis la carte : petit rappel visuel */
.aide-card.aide-nudge { animation: aide-nudge 420ms ease-out; }
@keyframes aide-nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-10px); } 60% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .aide-card, .aide-card.aide-nudge { animation: none; } }
.aide-card-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 8px 14px; border-bottom: 1px solid rgba(127, 240, 255, 0.15); }
.aide-card-title { flex: 1; margin: 0; font: 700 17px/1.25 'Unbounded', system-ui, sans-serif; letter-spacing: 0.01em; }
.aide-card-pic { width: 56px; height: 56px; flex: none; color: #bfefff; display: grid; place-items: center; }
.aide-card-pic:empty { display: none; }
.aide-card-pic svg { width: 56px; height: 56px; }
.aide-card-body { overflow: auto; padding: 10px 16px 16px; overscroll-behavior: contain; }
.aide-x, .aide-back {
  flex: none; min-width: 44px; height: 44px; border-radius: 22px; border: 1px solid rgba(234, 243, 255, 0.25); background: rgba(255, 255, 255, 0.04);
  color: #eaf3ff; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 10px; cursor: pointer; font: 600 13px system-ui, sans-serif;
}
.aide-x svg { width: 18px; height: 18px; }
.aide-x:hover, .aide-back:hover { border-color: #7ff0ff; }
.aide-sec { margin: 10px 0; }
.aide-sec h3, .aide-sec summary { margin: 0 0 4px; font: 700 12px/1.3 'Unbounded', system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.06em; color: #7ff0ff; }
.aide-sec p { margin: 0 0 6px; }
.aide-sec ul { margin: 0 0 6px; padding-left: 18px; }
.aide-meta, .aide-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #c8d6f0; font-size: 14px; }
.aide-shape { width: 20px; height: 20px; flex: none; }
.aide-state { margin-top: 4px; }
.aide-st-found > span:first-child { color: #8cff6b; }
.aide-finders { display: inline-flex; align-items: center; gap: 4px; }
.aide-finder { width: 24px; height: 24px; border-radius: 50%; display: inline-block; overflow: hidden; }
.aide-finder svg { width: 24px; height: 24px; }
.aide-btn {
  min-height: 44px; padding: 8px 16px; border-radius: 22px; border: 1px solid rgba(127, 240, 255, 0.5); background: rgba(127, 240, 255, 0.08);
  color: #eaf3ff; font: 600 15px system-ui, sans-serif; cursor: pointer; margin: 4px 6px 4px 0;
}
.aide-btn:hover { background: rgba(127, 240, 255, 0.18); }
.aide-yes { background: #7ff0ff; color: #02121a; border-color: #7ff0ff; }
.aide-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.aide-confirm span { flex: 1 1 100%; color: #ffd27a; }
.aide-actions { display: flex; gap: 8px; margin: 4px 0 8px; }
.aide-play { font-size: 17px; padding: 10px 28px; }
.aide-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: 20px; border: 1px solid rgba(234, 243, 255, 0.25); background: none; color: #eaf3ff; cursor: pointer; margin: 4px 6px 0 0; font: 500 14px system-ui, sans-serif; }
.aide-prog { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.aide-dots { display: inline-flex; gap: 4px; }
.aide-dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #7ff0ff; }
.aide-dots i.on { background: #7ff0ff; }
.aide-col h4 { margin: 6px 0 2px; font-size: 14px; color: #ffd27a; }
.aide-note { color: #c8d6f0; font-style: italic; }
.aide-mouse { width: 18px; height: 26px; vertical-align: middle; flex: none; }
.aide-mouse-on { fill: #ffd27a; }
.aide-mouse-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: #c8d6f0; }
.aide-mouse-line span { margin-right: 10px; }
.aide-sub { margin: 14px 0 4px; color: #7ff0ff; }
@media (max-width: 900px) {
  .aide-card { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 82vh; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
}
@media (max-height: 500px) and (orientation: landscape) {
  .aide-card { left: auto; right: 0; top: 0; bottom: 0; width: 50vw; max-height: none; border-radius: 16px 0 0 16px; }
}

/* ---------------------------------------------------------------- surcouche d'annotations */
.aide-annot { position: fixed; inset: 0; z-index: 59; }
.aide-annot-dim { position: absolute; inset: 0; background: rgba(2, 3, 10, 0.55); }
.aide-annot-pins { position: absolute; inset: 0; pointer-events: none; }
.aide-pin {
  position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; pointer-events: auto; cursor: pointer;
  background: #ffd27a; color: #1a1200; font: 800 12px/22px 'JetBrains Mono', monospace; text-align: center; box-shadow: 0 0 0 2px #02030a, 0 0 10px rgba(255, 210, 122, 0.7);
}
.aide-pin.on { background: #7ff0ff; transform-origin: center; }
.aide-hl { outline: 3px solid #7ff0ff !important; outline-offset: 3px; border-radius: 6px; }
.aide-annot-legend {
  position: absolute; right: 12px; top: 12px; bottom: 12px; width: 320px; overflow: auto; background: rgba(3, 6, 16, 0.97); color: #eaf3ff;
  border: 1px solid rgba(127, 240, 255, 0.4); border-radius: 16px; padding: 12px 14px; font: 400 14px/1.4 'Space Grotesk', system-ui, sans-serif;
}
.aide-annot-head { display: flex; align-items: center; gap: 8px; }
.aide-annot-head h2 { flex: 1; margin: 0; font: 700 16px 'Unbounded', system-ui, sans-serif; }
.aide-annot-d { color: #c8d6f0; }
.aide-legend-list { list-style: none; margin: 8px 0; padding: 0; }
.aide-legend-list li { display: flex; gap: 8px; padding: 6px 4px; border-radius: 8px; cursor: default; }
.aide-legend-list li:hover, .aide-legend-list li:focus { background: rgba(127, 240, 255, 0.1); outline: none; }
.aide-num { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #ffd27a; color: #1a1200; font: 800 12px/22px 'JetBrains Mono', monospace; text-align: center; }
.aide-li-t span { color: #c8d6f0; }
.aide-annot-foot { border-top: 1px solid rgba(127, 240, 255, 0.15); padding-top: 8px; color: #c8d6f0; }
@media (max-width: 900px) {
  .aide-annot-legend { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 45vh; border-radius: 16px 16px 0 0; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .aide-annot-legend { left: auto; right: 0; top: 0; bottom: 0; width: 45vw; height: auto; border-radius: 16px 0 0 16px; }
}

/* ---------------------------------------------------------------- Guide des énigmes */
.aide-egglist { color: #eaf3ff; font: 400 15px/1.4 'Space Grotesk', system-ui, sans-serif; }
.aide-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.aide-filter { min-height: 40px; padding: 6px 14px; border-radius: 20px; border: 1px solid rgba(234, 243, 255, 0.25); background: none; color: #eaf3ff; cursor: pointer; }
.aide-filter.on { background: rgba(127, 240, 255, 0.18); border-color: #7ff0ff; }
.aide-branch { margin: 12px 0 4px; font: 700 12px 'Unbounded', system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.06em; color: #7ff0ff; }
.aide-eggrow {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 10px; margin: 3px 0; border-radius: 12px;
  border: 1px solid rgba(234, 243, 255, 0.14); background: rgba(255, 255, 255, 0.03); color: #eaf3ff; text-align: left; cursor: pointer; font: inherit;
}
.aide-eggrow:hover { border-color: #7ff0ff; }
.aide-eggrow .g-ico { width: 22px; height: 22px; }
.aide-eggname { flex: 1; }
.aide-eggst { color: #c8d6f0; font-size: 13px; }
.aide-st-found .aide-eggst { color: #8cff6b; }
.aide-q { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #7ff0ff; color: #7ff0ff; display: grid; place-items: center; font: 800 14px 'Unbounded', system-ui, sans-serif; flex: none; }

/* ---------------------------------------------------------------- tutoriel (tuto.js) */
#tuto { position: fixed; inset: 0; z-index: 57; pointer-events: none; }
#tuto.hide { opacity: 0; }
.tuto-hole { position: absolute; left: 0; top: 0; border-radius: 14px; box-shadow: 0 0 0 200vmax rgba(2, 3, 10, 0.62); pointer-events: none; transition: transform 160ms, width 160ms, height 160ms; }
.tuto-hole.round { border-radius: 50%; }
.tuto-hole.none { box-shadow: 0 0 0 200vmax rgba(2, 3, 10, 0.4); width: 0 !important; height: 0 !important; }
.tuto-bub {
  position: absolute; left: 0; top: 0; width: min(340px, calc(100vw - 32px)); pointer-events: auto; padding: 14px 16px 12px;
  background: rgba(3, 6, 16, 0.98); color: #eaf3ff; border: 1px solid rgba(127, 240, 255, 0.55); border-radius: 16px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.6); font: 400 15px/1.45 'Space Grotesk', system-ui, sans-serif;
}
.tuto-top { display: flex; align-items: center; gap: 8px; }
.tuto-top h2 { flex: 1; margin: 0; font: 700 16px/1.25 'Unbounded', system-ui, sans-serif; }
.tuto-n { color: #c8d6f0; font: 600 12px 'JetBrains Mono', monospace; }
.tuto-txt { margin: 8px 0 10px; }
.tuto-mouse { display: flex; align-items: center; gap: 6px; color: #c8d6f0; font-size: 13px; margin-bottom: 8px; }
.tuto-mouse .aide-mouse { width: 22px; height: 30px; }
.tuto-btns { display: flex; justify-content: flex-end; gap: 8px; }
.tuto-btns button { min-height: 44px; min-width: 44px; padding: 8px 16px; border-radius: 22px; border: 1px solid rgba(127, 240, 255, 0.5); background: none; color: #eaf3ff; font: 600 15px system-ui, sans-serif; cursor: pointer; }
.tuto-btns .tuto-next { background: #7ff0ff; color: #02121a; border-color: #7ff0ff; }
.tuto-pill { position: fixed; right: 16px; bottom: 96px; z-index: 57; pointer-events: auto; min-height: 44px; padding: 8px 16px; border-radius: 22px; border: 1px solid #7ff0ff; background: rgba(3, 6, 16, 0.95); color: #eaf3ff; font: 600 14px system-ui, sans-serif; cursor: pointer; }
@media (max-width: 900px) { .tuto-bub { width: calc(100vw - 32px); } }
@media (max-height: 500px) and (orientation: landscape) { .tuto-bub { width: min(320px, 45vw); font-size: 14px; } }
