/* ============================================
   DUAL EMPIRES - Tutoriel interactif (plateau.html?tutoriel=1)
   ============================================
   Bulle de guidage, mise en évidence de la zone à utiliser et écran de fin.
   Sans effet hors tutoriel : ces éléments n'existent que si js/tutoriel.js
   les crée (Tutoriel.actif). */

#tuto-coach {
  position: fixed;
  left: 14px;
  top: 50%;
  z-index: 10000;
  width: min(340px, calc(100vw - 28px));
  padding: 0.85rem 1rem 0.9rem;
  color: #f5e6c8;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.97) 0%, rgba(30, 41, 59, 0.96) 100%);
  border: 1px solid #d4a574;
  border-radius: 12px;
  /* Pas de transition de position : la bulle ne doit jamais glisser sous
     le curseur au moment d'un clic. */
  box-shadow:
    0 0 0 1px rgba(103, 232, 249, 0.12) inset,
    0 14px 34px rgba(0, 0, 0, 0.6);
}

.tuto-entete {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tuto-badge {
  color: #67e8f9;
  font-weight: 700;
}

.tuto-etape {
  color: #d4a574;
}

.tuto-progression {
  height: 4px;
  margin: 0.45rem 0 0.6rem;
  background: rgba(212, 165, 116, 0.18);
  border-radius: 2px;
  overflow: hidden;
}

.tuto-progression span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #d4a574, #67e8f9);
  transition: width 0.3s ease;
}

.tuto-titre {
  margin: 0 0 0.4rem;
  font-size: 1.08rem;
  color: #e8c87a;
}

.tuto-texte {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #e8dcc4;
}

.tuto-texte strong {
  color: #fff3d6;
}

.tuto-liste {
  display: block;
  margin-bottom: 0.25rem;
}

.tuto-objectif {
  margin: 0.65rem 0 0;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #a5f3fc;
  background: rgba(8, 47, 73, 0.55);
  border: 1px solid rgba(103, 232, 249, 0.45);
  border-radius: 8px;
}

.tuto-alerte {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #fcd34d;
}

.tuto-alerte[hidden] {
  display: none;
}

.tuto-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.tuto-btn {
  padding: 0.45rem 0.8rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #f5e6c8;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 1px solid rgba(212, 165, 116, 0.6);
  border-radius: 7px;
  cursor: pointer;
}

.tuto-btn:hover {
  border-color: #67e8f9;
  box-shadow: 0 0 12px rgba(103, 232, 249, 0.35);
}

.tuto-btn-principal {
  color: #1a2332;
  background: linear-gradient(135deg, #b98a55 0%, #e8c87a 100%);
  border-color: #e8c87a;
}

.tuto-btn-discret {
  font-weight: 500;
  font-size: 0.78rem;
  color: #cbd5e1;
  background: transparent;
  border-color: rgba(203, 213, 225, 0.3);
}

/* Zone que le joueur doit utiliser */
.tuto-cible {
  outline: 3px solid #67e8f9 !important;
  outline-offset: 2px;
  border-radius: 6px;
  animation: tuto-pulse 1.4s ease-in-out infinite;
}

@keyframes tuto-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(103, 232, 249, 0.55);
  }
  50% {
    box-shadow: 0 0 18px 6px rgba(103, 232, 249, 0.45);
  }
}

/* Clic hors de l'étape : la bulle le signale */
.tuto-secoue {
  animation: tuto-secoue 0.35s ease;
}

@keyframes tuto-secoue {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

/* Écran de fin du tutoriel */
.tuto-fin {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.78);
}

.tuto-fin-boite {
  width: min(520px, 100%);
  padding: 1.6rem 1.6rem 1.4rem;
  text-align: center;
  color: #f5e6c8;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.97) 100%);
  border: 1px solid #d4a574;
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65);
}

.tuto-fin-icone {
  font-size: 2.6rem;
}

.tuto-fin-titre {
  margin: 0.3rem 0 0.6rem;
  color: #e8c87a;
  font-size: 1.5rem;
}

.tuto-fin-texte {
  margin: 0 0 1.1rem;
  line-height: 1.5;
  color: #e8dcc4;
}

.tuto-fin-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.tuto-fin-actions .tuto-btn {
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
}

@media (prefers-reduced-motion: reduce) {
  .tuto-cible,
  .tuto-secoue {
    animation: none;
  }
}
