/* === Variables de style === */
:root {
  --couleur-fond: #f9f9f9;
  --couleur-principale: #187adc;
  --texte-principal: #222;
  --fond-carte: #fff;
  --bordure-carte: #ccc;
}


body {
  font-family: sans-serif;
  background-color: var(--couleur-fond);
  color: var(--texte-principal);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header, footer {
  background-color: var(--couleur-principale);
  color: white;
  padding: 0.3rem;
  text-align: center;
}

main {
 flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#aide-bienvenue {
padding: 1rem; background-color: #e6f2ff; border-left: 5px solid #3399ff; margin: 1rem; font-weight: bold; font-size: 1rem; border-radius: 8px; color: #003366;}



#flashcard-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 500px;
}
.carte {
  width: 100%;
  height:325px;
  background-color: var(--fond-carte);
  font-size: 1.2rem; /* 🆙 taille générale */
  line-height: 1.4;
  border: 1px solid var(--bordure-carte);
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.3s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.carte {
  position: relative; /* essentiel pour que ::before fonctionne */
}
.carte.sue::before {
  content: "✅";
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.5rem;
  color: green;
  opacity: 0.8;
  z-index: 10;
}
#flashcard-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.zone-carte {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.carte {
  margin: 1rem auto;
  max-width: 600px;
  width: 100%;
  box-sizing: border-box;
}
.carte .verso {
  display: none;
}
.carte.revelee .recto {
  display: none;
}
.carte.revelee .verso {
  display: block;
}


.actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.actions button {
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background-color: #3399ff;
  color: white;
  cursor: pointer;
  flex: 1 1 auto;
  max-width: 160px;
}

.actions button:hover {
  background-color: #2a7fd0;
}
#media img, #media video, #media iframe {
max-height: 200px;       /* Limite la hauteur */
  max-width: 100%;         /* Ne dépasse pas la largeur */
  width: auto;             /* Respecte le ratio */
  object-fit: contain;     /* Maintient l’image dans le cadre */
  margin-top: 1rem;
  border-radius: 8px;
}

@media (max-width: 480px) {
  .carte {
    font-size: 0.95rem;
    padding: 0.75rem;
	min-height:280px;
  }
  @media (max-width: 600px) {
  .carte {
    font-size: 1.1rem;
  }
}
.actions button {
    width: 100%;
    margin-top: 0.5rem;
  }
}

.menu-fixe {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--couleur-principale);
  color: white;
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0;
  list-style: none;
  margin: 0;
  z-index: 10;
}
.menu-fixe a {
  color: white;
  text-decoration: none;
}
.menu-fixe a.active {
  font-weight: bold;
  text-decoration: underline;
}

.choix.vertical {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  animation: fadeInSlide 0.4s ease;
}
.choix.vertical a {
  padding: 0.75rem 1rem;
  width: 200px;
  background: linear-gradient(135deg, var(--couleur-principale), #2a9df4);
  color: white;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  border-radius: 12px;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}
.choix.vertical a:hover {
  transform: scale(1.05);
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


body.nuit {
  background-color: #121212;
  color: #f0f0f0;
}
body.nuit header,
body.nuit footer,
body.nuit .menu-fixe {
  background-color: #222;
  color: #f0f0f0;
}
body.nuit .carte {
  background-color: #1e1e1e;
  border-color: #333;
}
body.nuit .choix.vertical a,
body.nuit .actions button {
  background: linear-gradient(135deg, #555, #333);
  color: white;
}
.choix a.actif {
  border: 2px solid white;
  box-shadow: 0 0 10px #fff;
}

body.nuit #resume-choix {
  background-color: #1e1e1e;
  color: #ffffff;
  border-bottom: 1px solid #444;
}

body.nuit .etiquette-face {
  background-color: #1e1e1ecc;
  color: #87cefa;
}

body.nuit #aide-bienvenue{
  background-color: #1e1e2e;
  border-left: 5px solid #87cefa;
  color: #d0e7ff;
}

.popup {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000; /* très au-dessus */
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-contenu {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  max-width: 90%;
  width: 400px;
  position: relative;
  color: #000;
}

.fermer {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Mode nuit */
body.nuit .popup-contenu {
  background-color: #1e1e2e;
  color: #d0e7ff;
}
