:root {
  --fond: #1c1c2b;
  --or: #d4af37;
  --violet: #4b2e83;
}
#instruction {
  font-size: clamp(1rem, 2vw, 1.5rem);
  color: #f5f5dc;
  text-align: center;
  padding: 40px;
  width: 80%;
  margin: 40px auto;
  animation: pulseEffect 2s infinite ease-in-out;
  animation-play-state: running; /* Permet à l'animation de continuer même lors du changement de texte */
}
@keyframes pulseEffect {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1); /* Agrandir légèrement */
  }
  100% {
    transform: scale(1);
  }
}
/* ===============================
   GRILLE
================================ */
.grille {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: clamp(6px, 1vw, 14px);
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 6px;
  justify-items: center; /* Centrer toutes les cartes */
}
/* Centrer la dernière carte sur la 4ème ligne */
.grille > .carte:nth-last-child(1) {
  grid-column: 4 / span 1;
}
/* ===============================
   CARTE
================================ */
.carte {
  width: 100%;
  max-width: 110px;
  aspect-ratio: 1 / 2;
  margin: auto;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s ease, box-shadow 0.4s ease;
  cursor: pointer;
  border-radius: clamp(8px, 1vw, 12px);
}
/* Hover desktop */
@media (hover: hover) {
  .carte:hover {
    transform: translateY(-5px) scale(1.04);
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.45);
  }
}
/* Faces communes */
.carte > div {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  overflow: hidden;
}
/* === DOS === */
.dos {
  background:
    width: 100%;
    height: 100%;
    background: 
      linear-gradient(145deg, #4b2e83, #2a1748), 
      radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 40%), 
      radial-gradient(circle at bottom right, rgba(0, 0, 0, 0.3), transparent 45%);
    border: 1.5px solid rgba(212, 175, 55, 0.65);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 0 18px rgba(0, 0, 0, 0.35), 0 6px 12px rgba(0, 0, 0, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
	
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.05),
    inset 0 0 18px rgba(0,0,0,0.35),
    0 6px 12px rgba(0,0,0,0.45);

  font-size: clamp(1rem, 2.2vw, 1.7rem);
  position: relative;
}
.signature {
    position: absolute;
    bottom: 10px;
    font-size: clamp(0.45rem, 0.9vw, 0.6rem);
    letter-spacing: 0.12em;
    color: rgba(212, 175, 55, 0.65);
  }


.dos::before {
    content: "✶";
    position: absolute;
    font-size: 1.9em;
    color: rgba(212, 175, 55, 0.7);
    text-shadow: 0 0 6px rgba(212, 175, 55, 0.35);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .dos::after {
    content: "";
    position: absolute;
    inset: 5px;
    border: 2px solid rgba(212, 175, 55, 0.65);
    border-radius: 10px;
  }

  .rond {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.7);
    transform: translate(-50%, -50%);
  }

/* === FACE === */
.face {
  background: #f5f5dc;
  transform: rotateY(180deg);
  padding: 2px;
}
.face img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
/* Retournement */
.carte.retournee {
  transform: rotateY(180deg);
}
/* Cartes inactives */
.carte.inactive {
  opacity: 0.25;
  pointer-events: none;
}
/* ===============================
   STYLE DES CARTES CLONÉES
================================ */
/* Container des cartes sélectionnées */
#cartes-selectionnees {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 30px;
  max-width: 800px;
  margin: 30px auto;
  flex-wrap: wrap;
  padding: 10px;
}
/* Style des cartes clonées */
#cartes-selectionnees .carte {
  width: 160px;
  text-align: center;
  display: flex;
  flex-direction: column; /* Aligner l'image et le nom verticalement */
  align-items: center;
  margin: 10px; /* Espacement autour des cartes clonées */
  position: relative; /* Pour éviter les superpositions */
  background-color: #4b2e83; /* Couleur de fond des cartes clonées */
  border-radius: 8px; /* Optionnel, mais pour adoucir les coins */
}
/* Image des cartes clonées */
#cartes-selectionnees .carte img {
  width: 100%;
  height: auto;
  object-fit: contain; /* Ajuste l'image sans déformation */
  margin-bottom: 8px; /* Ajoute un espacement sous l'image */
}
/* Style du nom sous l'image */
#cartes-selectionnees .nom-carte {
  font-size: 1rem;
  color: #f5f5dc;
  text-align: center;
  padding: 4px;
  width: 100%; /* Largeur maximale pour le texte sous l'image */
  margin-top: 8px; /* Ajout d'un espacement entre le texte et l'image */
}
/* ===============================
   STYLE DES NOMS DES CARTES
================================ */
#noms-cartes-selectionnees {
  display: flex; /* Utilisation de flexbox pour aligner les éléments en ligne */
  justify-content: center; /* Centrer les éléments horizontalement */
  gap: 35px; /* Espacement entre les éléments */
  text-align: center;
  color: #f5f5dc;
  width: 80%;
  margin: 30px auto;
}
/* Liste des noms des cartes */
#noms-cartes-selectionnees .nom-carte {
  margin-bottom: 10px;
  font-size: 1.4rem;
  color: #d4af37;
}
@media (max-width: 600px) {
  .grille {
    grid-template-columns: repeat(5, 1fr);
  }
  .carte {
    max-width: 70px;
  }
  /* Les 2 dernières cartes centrées */
  .grille > .carte:nth-last-child(-n+2) {
    grid-column: span 2;
    justify-self: center;
  }
  /* Carte centrale ne force plus la colonne */
  .carte-centrale {
    grid-column: auto;
  }
  #noms-cartes-selectionnees .nom-carte {
    font-size: 1rem;
  }
}
@media (max-width: 360px) {
  .carte {
    max-width: 60px;
  }
}
}

/* Zone de texte d'interprétation des cartes */
#significations-cartes { 
  margin-top: 30px;
  text-align: left;
  line-height: 1.6;
  background-color: #f5f5dc; /* Fond beige clair pour mieux contraster */
  padding: 20px; /* Un peu de padding pour rendre le texte aéré */
  border-radius: 8px; /* Coins arrondis */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Ombre douce pour un effet de profondeur */
  max-width: 800px; /* Limiter la largeur */
  margin: 30px auto; /* Centrer le div */
}

/* Paragraphe à l'intérieur des définitions */
#significations-cartes p { 
  margin-bottom: 20px;
  font-size: 1.1rem; /* Taille du texte un peu plus grande pour les définitions */
}

/* Titre de la carte */
#significations-cartes .titre {
  font-weight: bold;
  font-size: 1.3rem;
  color: #4b2e83; /* Couleur violette pour le titre */
  margin-bottom: 10px;
}
