:root {
  --fond: #f4f1e8;
  --texte: #2b3a2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
}

.entete {
  padding: 1.5rem 1rem 0.5rem;
  text-align: center;
}

.entete h1 {
  margin: 0;
  font-size: 2rem;
}

.entete p {
  margin: 0.25rem 0 0;
  opacity: 0.7;
}

.catalogue {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.milieu {
  margin-top: 2rem;
}

.milieu__titre {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}

.milieu__cartes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

/* Une carte : un conteneur dont toutes les tailles dépendent de sa largeur (unité cqw) */
.carte {
  container-type: inline-size;
  position: relative;
  aspect-ratio: 2 / 3;
}

.carte__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 5cqw;
  background: var(--couleur);
  box-shadow: 0 0.6cqw 2cqw rgba(0, 0, 0, 0.25);
}

.carte__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Les trois zones vides des images : même position sur toutes les cartes */
.carte__force,
.carte__icone,
.carte__icone2,
.carte__nom {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carte__force {
  left: 6.1%;
  top: 3.8%;
  width: 20.8%;
  height: 14%;
  border-radius: 50%;
  font-size: 11cqw;
  font-weight: 800;
}

.carte__icone {
  left: 83.5%;
  top: 3.8%;
  width: 10.6%;
  height: 7.1%;
  border-radius: 50%;
  font-size: 6cqw;
}

.carte__nom {
  left: 6.6%;
  top: 83.4%;
  width: 86.7%;
  height: 12.3%;
  padding: 0 2%;
  border-radius: 2cqw;
  font-size: 6.2cqw;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

/* Pastille du second milieu (cartes polyvalentes, force 1 à 3) */
.carte__icone2 {
  left: 84.5%;
  top: 12.6%;
  width: 8.6%;
  height: 5.8%;
  border-radius: 50%;
  font-size: 4.4cqw;
  background: var(--couleur2, #fff);
  border: 0.7cqw solid #fff;
  box-shadow: 0 0 0 0.35cqw rgba(0, 0, 0, 0.35);
}

/* En partie, la pastille ne sert qu'en mode difficile */
body.jeu:not(.mode-difficile) .carte__icone2 {
  display: none;
}

/* Carte sans image : on redessine les zones blanches nous-mêmes */
.carte--provisoire .carte__force,
.carte--provisoire .carte__icone,
.carte--provisoire .carte__nom {
  background: #fff;
  border: 0.9cqw solid rgba(0, 0, 0, 0.35);
}

.carte__provisoire {
  position: absolute;
  inset: 25% 10% auto;
  text-align: center;
  font-size: 6cqw;
  opacity: 0.55;
}
