/* Jeu : le mot jumeau */

.jumeau__cadre {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--espace-2);
  width: 100%;
  max-width: 30rem;
  padding: var(--espace-4);
  border-radius: var(--rayon-grand);
  background: var(--surface-2);
  cursor: pointer;
  /* une bande en haut, pas un contour : le contour bleu est réservé à « ce qui vient de changer » (22/10/2026) */
  box-shadow: inset 0 6px 0 var(--accent), inset 0 0 0 2px var(--trait);
}

.jumeau__etiquette {
  margin: 0;
}

.jumeau__modele {
  font-family: var(--police-texte);
  font-weight: 700;
  font-size: clamp(2.4rem, 1.8rem + 3vw, 3.4rem);
  letter-spacing: 0.06em;
  line-height: 1.1;
}

.jumeau__ranges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--espace-2);
  min-height: 1.8rem;
}

.jumeau__range {
  /* le code des couleurs : un jumeau trouvé est juste, vert pâle avec une coche */
  padding: 0.1em 0.6em;
  border-radius: 999px;
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
  box-shadow: inset 0 0 0 2px var(--fn-juste-texte);
  font-weight: 700;
  font-size: var(--t-texte);
}

.jumeau__compteur {
  font-weight: 700;
  font-size: var(--t-grand);
  text-align: center;
  min-height: 1.4em;
}

.jumeau__piste {
  position: relative;
  width: 100%;
  max-width: 40rem;
  padding-top: 2.6rem;
}

.jumeau__rangee {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(0.4rem, 1.6vw, 0.8rem);
}

.jumeau__mot {
  min-height: 3.4rem;
  padding: 0.25em 0.6em;
  border: 0;
  border-radius: var(--rayon);
  background: var(--bois);
  color: var(--bois-encre);
  box-shadow: inset 0 -5px 0 var(--bois-flanc);
  font-family: var(--police-texte);
  font-weight: 700;
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
  letter-spacing: 0.04em;
  cursor: pointer;
}

.jumeau__range::after {
  content: '\00a0\2713';
  font-weight: 800;
}

.jumeau__mot {
  position: relative;
}

.jumeau__mot.est-trouve {
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
  box-shadow: inset 0 -5px 0 color-mix(in srgb, var(--fn-juste-texte) 35%, var(--fn-juste));
}

@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .jumeau__mot.est-trouve { box-shadow: inset 0 0 0 2px var(--fn-juste-texte); }
}

/* la coche, posée sur le coin : le mot ne s'élargit pas, ses voisins ne bougent pas */
.jumeau__mot.est-trouve::after {
  content: '\2713';
  position: absolute;
  top: -0.55rem;
  right: -0.45rem;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
  box-shadow: 0 0 0 2px var(--fn-juste-texte);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
}

.jumeau__lettre--autre {
  display: inline-block;
  padding: 0 0.06em;
  border-radius: 6px;
  /* pas de rouge : la lettre qui n'est pas la même est surlignée en jaune (le piège) */
  background: var(--fn-piege);
  color: var(--fn-piege-texte);
  box-shadow: inset 0 -2px 0 var(--fn-piege-texte);
}

.jumeau__manque {
  display: inline-block;
  width: 0.3em;
  height: 0.9em;
  margin: 0 0.04em;
  border-radius: 4px;
  background: var(--fn-piege);
  box-shadow: inset 0 0 0 2px var(--fn-piege-texte);
  vertical-align: -0.05em;
}

.jumeau__loupe {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2.4rem;
  height: 2.4rem;
  transform: translate(-50%, -100%);
  opacity: 0;
  pointer-events: none;
  transition: left 480ms cubic-bezier(0.22, 1, 0.36, 1), top 480ms cubic-bezier(0.22, 1, 0.36, 1), opacity 250ms ease;
}

.jumeau__loupe.est-posee {
  opacity: 1;
}

.jumeau__loupe .icone {
  width: 100%;
  height: 100%;
}

.jumeau__glyphe {
  font-family: var(--police-texte);
  font-weight: 700;
  font-size: 1.45rem;
}

.jumeau__truc {
  display: flex;
  flex-direction: column;
  gap: var(--espace-4);
  width: 100%;
  max-width: 34rem;
}

@media (prefers-reduced-motion: reduce) {
  .jumeau__loupe { transition: none; }
}

/* La zone du jeu : le modèle, la rangée et ses boutons, d'un seul regard */
.jumeau__jeu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: inherit;
  width: 100%;
}
