/* Introduction des nouveaux joueurs : bouton de l'accueil, diaporama des règles, bulle d'aide des leçons (js/tutorial.js). */

/* ---- Accueil ---- */
.tuto-btn {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  align-items: center;
  text-align: left;
  padding: 10px 14px;
}
.tuto-btn .ic {
  grid-row: span 2;
  width: 24px;
  height: 24px;
}
.tuto-btn small {
  font:
    500 0.8rem/1.3 Barlow,
    system-ui,
    sans-serif;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}
/* premier passage : l'introduction est mise en avant */
.tuto-btn.fresh {
  border-color: var(--accent);
  background: var(--accent-50);
}

/* ---- Diaporama ---- */
.tuto-card {
  max-width: 400px;
  min-height: min(560px, calc(100dvh - 32px));
}
.tuto .invisible {
  visibility: hidden;
}
.tuto.busy .tuto-nav,
.tuto.busy #tutoSkip,
.tuto.busy #tutoClose {
  visibility: hidden;
}
.tuto.busy [data-tlesson] {
  opacity: 0.5;
  pointer-events: none;
}
.tuto-body {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 8px 4px;
}
.tuto-art {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  background: var(--accent);
  margin-bottom: 6px;
  animation: tuto-pop 0.35s ease-out;
}
.tuto-art .ic {
  width: 52px;
  height: 52px;
  stroke-width: 1.6;
}
.tuto-art.tracked {
  background: var(--tracked);
}
.tuto-art.hunter {
  background: var(--hunter);
}
.tuto-art.ink {
  background: var(--ink);
}
.tuto-title {
  margin: 0;
  font: 800 1.7rem/1.1 var(--cond);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.tuto-text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.5;
  max-width: 34ch;
}
.tuto-lessons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}
.tuto-lessons .btn {
  justify-content: center;
}
.tuto-small {
  margin: 0;
  font-size: 0.82rem;
}
.tuto-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tuto-nav #tutoNext {
  min-width: 108px;
}
.tuto-dots {
  display: flex;
  gap: 6px;
}
.tuto-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--line);
  cursor: pointer;
}
.tuto-dot.on {
  background: var(--accent);
  width: 20px;
  border-radius: 4px;
}
@keyframes tuto-rise {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
}
@keyframes tuto-pop {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
}

/* ---- Bulle d'aide pendant une leçon : en bas, au-dessus de la bande d'info (--coach-b, voir sheet.js) ---- */
.tuto-coach {
  position: absolute;
  z-index: 1001;
  bottom: var(--coach-b, calc(var(--tab-h) + 10px));
  left: 12px;
  right: 12px;
  max-width: 536px;
  margin: 0 auto;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: tuto-rise 0.25s ease-out;
}
.replaying .tuto-coach {
  display: none !important;
}
.tuto-coach-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}
.tuto-coach-line .ic {
  flex: none;
  width: 18px;
  height: 18px;
}
.tuto-coach-line > .ic:first-child {
  color: var(--muted);
}
.tuto-count {
  flex: none;
  font: 700 0.78rem var(--cond);
  letter-spacing: 0.06em;
  color: var(--muted);
}
/* vitesse du temps : un appui passe à la suivante (×1, ×2, ×5) */
.tuto-speed {
  flex: none;
  min-width: 40px;
  height: 32px;
  padding: 0 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: 800 0.95rem var(--cond);
  cursor: pointer;
}
.tuto-skip {
  flex: none;
  width: 36px;
  height: 32px;
  border: 1.5px solid var(--text);
}
.tuto-coach-title {
  flex: 1;
  min-width: 0;
  font: 800 1.05rem/1.15 var(--cond);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tuto-coach-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
}
.tuto-coach-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.tuto-coach.open {
  padding-bottom: 12px;
}
.tuto-coach.end .tuto-coach-title {
  font-size: 1.4rem;
  white-space: normal;
}

/* ---- Carte de consigne : la leçon est en pause jusqu'à « Compris » (au-dessus des annonces et des notifications) ---- */
.tuto-step {
  position: fixed;
  inset: 0;
  z-index: 1005;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(14, 14, 14, 0.55);
}
.tuto-step.hidden {
  display: none;
}
.tuto-step-card {
  width: 100%;
  max-width: 420px;
  max-height: 100%;
  overflow: auto;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  animation: tuto-pop 0.22s ease-out;
}
.tuto-step-event {
  --k: var(--ev-reveal);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  background: var(--k);
  color: #fff;
}
.tuto-step-event.k-ok {
  --k: var(--ok);
}
.tuto-step-event.k-power {
  --k: var(--ev-power);
}
.tuto-step-event.k-drop {
  --k: var(--ev-drop);
}
.tuto-step-event b {
  font: 800 1.5rem/1.05 var(--cond);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tuto-step-event span {
  font-size: 0.95rem;
}
.tuto-step-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}
.tuto-step-count {
  font: 700 0.8rem var(--cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.tuto-step-title {
  margin: 0;
  font: 800 1.6rem/1.1 var(--cond);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.tuto-step-card.danger .tuto-step-title {
  color: var(--danger);
}
.tuto-step-text {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.45;
}
.tuto-step-ok {
  width: 100%;
  min-height: 48px;
  font-size: 1.05rem;
}
.tuto-step-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
@media (prefers-reduced-motion: reduce) {
  .tuto-step-card {
    animation: none;
  }
}

/* notifications plus grandes pendant une leçon : le joueur apprend à les remarquer */
body.tutorial .notif {
  padding: 10px 14px 13px;
}
body.tutorial .notif-ic {
  width: 40px;
  height: 40px;
}
body.tutorial .notif-ic .ic {
  width: 24px;
  height: 24px;
}
body.tutorial .notif-tx {
  font-size: 1.02rem;
}
body.tutorial .notif-tx b {
  font-size: 1.18rem;
}

/* point touché sur la carte, vers lequel le joueur marche */
/* cible au bout du trajet : anneau et point central, sans orientation (la flèche semblait indiquer une direction) */
.tuto-dest {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border-radius: 50%;
  border: 3px solid var(--role);
  background: color-mix(in srgb, var(--role) 18%, transparent);
  box-shadow: 0 0 0 2px #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tuto-dest i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--role);
  box-shadow: 0 0 0 2px #fff;
}

/* élément de l'écran à utiliser pour l'étape en cours */
body[data-tuto-spot='powers'] #tabbar [data-tab='powers'],
body[data-tuto-spot='center'] #tabbar [data-center] {
  animation: tuto-spot 1.2s ease-in-out infinite;
}
@keyframes tuto-spot {
  50% {
    box-shadow: 0 0 0 4px var(--accent);
  }
}
@media (prefers-reduced-motion: reduce) {
  body[data-tuto-spot] #tabbar .tab {
    animation: none;
  }
  body[data-tuto-spot='powers'] #tabbar [data-tab='powers'],
  body[data-tuto-spot='center'] #tabbar [data-center] {
    box-shadow: 0 0 0 3px var(--accent);
  }
}
