/**
 * Outzer Game · /css/pwa-tuto.css (LOT 3)
 *
 * Bouton « Installer l'appli » + modale tutoriel d'installation.
 * BEM : blocs .pwa-installer (bouton) et .tuto-pwa (modale).
 * Charte sombre vert forêt — lisible sur la vitrine ET les pages /game/.
 */

/* ══ Bouton d'appel ═════════════════════════════════════════════════════ */

/* Variante injectée dans un header existant (topbar game, nav vitrine) */
.pwa-installer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0, 255, 65, 0.08);
  border: 1px solid rgba(0, 255, 65, 0.35);
  border-radius: 999px;
  color: #c8e6c9;
  font: 600 12px/1 system-ui, -apple-system, sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.pwa-installer:hover {
  background: rgba(0, 255, 65, 0.16);
  border-color: rgba(0, 255, 65, 0.7);
}
.pwa-installer__icone { font-size: 14px; }

/* Sur petit écran : icône seule (le libellé passe en aria-label) */
@media (max-width: 640px) {
  .pwa-installer__libelle { display: none; }
  .pwa-installer { padding: 6px 9px; }
}

/* Variante flottante (pages sans header reconnu) */
.pwa-installer--flottant {
  position: fixed;
  left: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 8000;
  padding: 9px 14px;
  background: #121f12;
  border: 1px solid rgba(0, 255, 65, 0.45);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

/* ══ Modale tutoriel ════════════════════════════════════════════════════ */

.tuto-pwa {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 0;
}
@media (min-width: 640px) {
  .tuto-pwa { align-items: center; padding: 24px; }
}

.tuto-pwa__boite {
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  background: #0d160d;
  border: 1px solid #1e3a1e;
  border-radius: 18px 18px 0 0;
  color: #c8e6c9;
  font-family: system-ui, -apple-system, sans-serif;
  overflow: hidden;
}
@media (min-width: 640px) {
  .tuto-pwa__boite { border-radius: 18px; }
}

/* ── En-tête ── */
.tuto-pwa__entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #1e3a1e;
}
.tuto-pwa__titre {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f1eadd;
}
.tuto-pwa__fermer {
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid #1e3a1e;
  border-radius: 50%;
  background: #121f12;
  color: #c8e6c9;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.tuto-pwa__fermer:hover { border-color: #00ff41; color: #00ff41; }

/* ── Onglets appareil ── */
.tuto-pwa__onglets {
  display: flex;
  gap: 6px;
  padding: 10px 16px 0;
}
.tuto-pwa__onglet {
  flex: 1;
  padding: 8px 4px;
  background: #121f12;
  border: 1px solid #1e3a1e;
  border-radius: 8px;
  color: #81c784;
  font: 600 11px/1.2 system-ui, sans-serif;
  text-align: center;
  cursor: pointer;
}
.tuto-pwa__onglet--actif {
  background: rgba(0, 255, 65, 0.1);
  border-color: #00ff41;
  color: #f1eadd;
}

/* ── Étape (carrousel) ── */
.tuto-pwa__contenu {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 6px;
  text-align: center;
}
.tuto-pwa__image {
  width: auto;
  max-width: 100%;
  max-height: 260px;
  margin: 0 auto 10px;
  display: block;
  border-radius: 12px;
}
.tuto-pwa__image--large { max-height: 200px; }
.tuto-pwa__texte {
  margin: 0 auto;
  max-width: 340px;
  font-size: 14px;
  line-height: 1.5;
}
.tuto-pwa__note {
  margin: 8px auto 0;
  max-width: 340px;
  font-size: 12px;
  color: #81c784;
}

/* ── Navigation du carrousel ── */
.tuto-pwa__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
}
.tuto-pwa__fleche {
  width: 40px;
  height: 40px;
  border: 1px solid #1e3a1e;
  border-radius: 50%;
  background: #121f12;
  color: #c8e6c9;
  font-size: 18px;
  cursor: pointer;
}
.tuto-pwa__fleche:disabled { opacity: 0.25; cursor: default; }
.tuto-pwa__fleche:not(:disabled):hover { border-color: #00ff41; }
.tuto-pwa__compteur {
  font: 700 12px/1 ui-monospace, monospace;
  letter-spacing: 0.15em;
  color: #81c784;
}

/* ── Pied : actions ── */
.tuto-pwa__pied {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #1e3a1e;
}
.tuto-pwa__action {
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 10px;
  background: #00c932;
  color: #06140a;
  font: 800 14px/1 system-ui, sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
}
.tuto-pwa__action:hover { background: #00ff41; }
.tuto-pwa__action--secondaire {
  background: #121f12;
  border: 1px solid #1e3a1e;
  color: #c8e6c9;
}
.tuto-pwa__action--secondaire:hover { background: #1a2a1a; border-color: #00ff41; }
.tuto-pwa__action:disabled { opacity: 0.45; cursor: default; }

/* ── Messages d'état (accordé / refusé / attente) ── */
.tuto-pwa__message {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}
.tuto-pwa__message--succes {
  background: rgba(0, 255, 65, 0.1);
  border: 1px solid rgba(0, 255, 65, 0.4);
  color: #b9f6ca;
}
.tuto-pwa__message--erreur {
  background: rgba(255, 45, 85, 0.1);
  border: 1px solid rgba(255, 45, 85, 0.45);
  color: #ffb3c0;
}
.tuto-pwa__message--info {
  background: #121f12;
  border: 1px solid #1e3a1e;
  color: #c8e6c9;
}

/* ══ Cadeau "installation PWA + notifications" ══════════════════════════ */

/* Bouton doré dans la modale (après activation des notifications) */
.tuto-pwa__action--cadeau {
  background: #ffd700;
  color: #231a00;
  margin-top: 8px;
}
.tuto-pwa__action--cadeau:hover { background: #ffe44d; }

/* Bannière flottante dans l'appli installée : « Un cadeau t'attend ! » */
.cadeau-pwa {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #1a1400, #0d1a0d);
  border: 2px solid #ffd700;
  border-radius: 14px;
  box-shadow: 0 6px 30px rgba(255, 215, 0, 0.35);
  color: #ffe9a8;
  text-decoration: none;
  animation: cadeau-pwa-arrivee 0.5s ease;
}
.cadeau-pwa__icone {
  font-size: 30px;
  line-height: 1;
  animation: cadeau-pwa-remue 1.6s ease-in-out infinite;
}
.cadeau-pwa__texte {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font: 700 15px/1.2 system-ui, -apple-system, sans-serif;
}
.cadeau-pwa__texte strong { color: #ffd700; }
.cadeau-pwa__texte small {
  font-weight: 500;
  font-size: 12px;
  color: #ffe9a8;
  opacity: 0.85;
}
@keyframes cadeau-pwa-arrivee {
  from { transform: translateY(80px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@keyframes cadeau-pwa-remue {
  0%, 60%, 100% { transform: rotate(0); }
  70% { transform: rotate(-12deg) scale(1.08); }
  80% { transform: rotate(10deg) scale(1.08); }
  90% { transform: rotate(-6deg); }
}
@media (min-width: 640px) {
  .cadeau-pwa { left: auto; right: 20px; max-width: 340px; }
}
