/* Jeu : La chaîne des accords (refonte du 19/11/2026) */

.accords__filtres {
  justify-content: center;
}

.accords__jeu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--espace-4);
  width: 100%;
  max-width: 54rem;
  margin: 0 auto;
}

/* ---------- Les cartes (Cible à accorder & Jumelle de comparaison) ---------- */

.accords__carte {
  width: 100%;
  padding: var(--espace-4) var(--espace-5);
  border-radius: var(--rayon-grand);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), inset 0 0 0 2px var(--trait);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--espace-3);
  transition: transform var(--duree), box-shadow var(--duree);
}

.accords__carte--cible {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), inset 0 0 0 2px color-mix(in srgb, var(--accent) 45%, var(--trait));
}
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .accords__carte--cible { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), inset 0 0 0 2px var(--trait); }
}

.accords__carte--jumelle {
  background: var(--surface-2);
  box-shadow: inset 0 0 0 2px var(--trait);
  animation: accords-glisse-jumelle 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes accords-glisse-jumelle {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Bandeau d'état de la chaîne d'accord en haut de la carte */
.accords__chaine-etat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1.5px solid var(--trait);
  color: var(--encre-2);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
}

.accords__chaine-icone {
  font-size: 1.1rem;
  line-height: 1;
}

/* Ligne principale : médaillon illustré à gauche + vraie ligne de mots à droite */
.accords__carte-ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--espace-4);
  width: 100%;
}

/* Médaillon illustré (1 seul vs plusieurs) */
.accords__medaillon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.55rem 0.85rem;
  border-radius: 18px;
  background: var(--surface-2);
  border: 2px solid var(--trait);
  flex-shrink: 0;
}

.accords__medaillon--plusieurs {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--trait));
}

.accords__medaillon--un {
  border-color: color-mix(in srgb, var(--bleu) 55%, var(--trait));
}

.accords__medaillon-icones {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
}

.accords__medaillon-icones > .icone {
  width: 2.55rem;
  height: 2.55rem;
}

.accords__medaillon--un .accords__medaillon-icones > .icone {
  width: 2.9rem;
  height: 2.9rem;
}

.accords__medaillon-badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--encre);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1.5px var(--trait);
}

/* Vraie ligne de lecture naturelle */
.accords__ligne-mots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: clamp(1.45rem, 1.15rem + 1.5vw, 2.05rem);
  font-weight: 700;
  line-height: 1.2;
}

/* Le premier mot (chef de la chaîne d'accord, entouré de son verre de lunettes) */
.accords__chef {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  padding: 0.35rem 0.85rem 0.38rem;
  border-radius: 16px;
  border: 2.5px solid var(--trait);
  background: var(--surface-2);
  color: var(--encre);
  font: inherit;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.accords__chef:hover {
  transform: translateY(-2px);
}

.accords__chef.est-identifie.accords__chef--plusieurs {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.accords__chef.est-identifie.accords__chef--un {
  border-color: var(--bleu);
  background: color-mix(in srgb, var(--bleu) 13%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bleu) 22%, transparent);
}

.accords__chef-mot {
  font-weight: 800;
  line-height: 1.15;
}

.accords__chef-role {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--encre-2);
  letter-spacing: 0.02em;
}

/* Le pont lumineux entre deux mots de la chaîne */
.accords__pont {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15ch;
  color: var(--encre-2);
  font-size: 1.45rem;
  font-weight: 800;
  opacity: 0.45;
  transition: transform 0.22s ease, color 0.22s ease, opacity 0.22s ease;
}

.accords__pont.est-actif {
  color: var(--accent);
  opacity: 0.85;
}

.accords__pont.est-allume {
  color: var(--vert);
  opacity: 1;
  transform: translateY(-3px) scale(1.18);
}

/* Chaque mot qui marche avec le premier mot */
.accords__mot-carte {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  padding: 0.35rem 0.78rem 0.38rem;
  border-radius: 16px;
  border: 2.5px solid var(--trait);
  background: var(--surface);
  color: var(--encre);
  font: inherit;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.accords__mot-carte:hover {
  transform: translateY(-2px);
}

.accords__mot-carte.est-cible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.accords__mot-carte.est-accroche {
  border-color: var(--vert);
  background: color-mix(in srgb, var(--vert) 8%, var(--surface));
}

.accords__mot-corps {
  display: inline-flex;
  align-items: baseline;
  gap: 0.03em;
  line-height: 1.15;
}

.accords__mot-role {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--encre-2);
}

.accords__mot-carte.est-accroche .accords__mot-role {
  color: var(--fn-juste-texte, #166534);
  font-weight: 800;
}

/* La case [ ? ] au bout du mot et la marque posée */
.accords__trou {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5ch;
  height: 1.2em;
  margin-left: 0.08em;
  padding: 0 0.15em;
  border-radius: 6px;
  border: 2px dashed var(--encre-2);
  color: var(--encre-2);
  font-weight: 800;
  opacity: 0.7;
}

.accords__trou.est-actif {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  opacity: 1;
  animation: accords-pouls 1.7s ease-in-out infinite;
}

@keyframes accords-pouls {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.09); }
}

.accords__marque {
  display: inline-flex;
  align-items: baseline;
  margin-left: 0.04em;
  animation: accords-marque-pop 340ms cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

.accords__marque-lettre {
  display: inline-block;
  min-width: 0.85em;
  padding: 0 0.14em;
  border-radius: 6px;
  background: var(--accent);
  color: var(--sur-accent);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22);
  text-align: center;
  line-height: 1.12;
}

.accords__marque--rien {
  display: inline-grid;
  place-items: center;
  min-width: 1.25em;
  margin-left: 0.12em;
  padding: 0 0.2em;
  border-radius: 6px;
  background: var(--vert);
  color: var(--sur-vert);
  font-size: 0.78em;
  line-height: 1.2;
}

.accords__muette {
  font-size: 0.65em;
  margin-left: 0.14em;
  opacity: 0.88;
}

@keyframes accords-marque-pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ---------- Le plateau de choix directs (1 seul clic, sans quai ni caisses) ---------- */

.accords__choix {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--espace-3);
  width: 100%;
  padding: var(--espace-3) var(--espace-4);
  border-radius: var(--rayon-grand);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 2px var(--trait);
}

.accords__choix-titre {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--encre);
  text-align: center;
}

.accords__choix-boutons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--espace-3);
}

.accords__bouton-nombre {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 3.6rem;
  padding: 0.5rem 1.25rem;
  border: 2px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--surface);
  color: var(--encre);
  font-family: var(--police-texte);
  font-size: 1.15rem;
  font-weight: 800;
  box-shadow: 0 3px 0 var(--trait), 0 5px 10px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform var(--duree), border-color var(--duree);
}

.accords__bouton-nombre:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.accords__bouton-nombre .icone {
  width: 1.65rem;
  height: 1.65rem;
}

.accords__mini-icones {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
}

.accords__bouton-choix {
  min-width: 5.4rem;
  height: 3.9rem;
  padding: 0 1.15rem;
  border: 2px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--surface);
  color: var(--encre);
  font: inherit;
  font-weight: 800;
  font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.75rem);
  box-shadow: 0 3px 0 var(--trait), 0 5px 10px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform var(--duree), box-shadow var(--duree), border-color var(--duree);
}

.accords__bouton-choix--rien {
  font-size: 1.08rem;
  padding: 0 1.1rem;
}

.accords__bouton-choix:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 5px 0 var(--trait), 0 8px 14px rgba(0, 0, 0, 0.12);
}

/* Jeton volant qui voyage en arc depuis le premier mot jusqu'à la fin du mot accordé */
.accords__jeton-volant {
  position: fixed;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 0.25rem 0.72rem;
  height: 2.4rem;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: var(--accent);
  color: var(--sur-accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  font-family: var(--police-texte);
  font-size: 1.25rem;
  font-weight: 800;
  pointer-events: none;
  animation: accords-vol-pont 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes accords-vol-pont {
  0% {
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 1;
  }
  50% {
    transform: translate(calc(-50% + var(--dx) * 0.5), calc(-50% + var(--dy) * 0.5 - 32px)) scale(1.22);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1);
    opacity: 0.95;
  }
}

.accords__message {
  max-width: 38rem;
  min-height: 1.6em;
  font-size: 1.08rem;
  text-align: center;
  margin: 0;
}

.accords__message .bouton-voix {
  vertical-align: middle;
  margin-block: -0.75rem;
}

/* ---------- Comparaison 1 seul <-> plusieurs (en fin de manche) ---------- */

.accords__comp-rang {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: var(--espace-3);
  width: 100%;
}

.accords__comp-carte {
  flex: 1 1 18rem;
  padding: var(--espace-3) var(--espace-4);
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), inset 0 0 0 2px var(--trait);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: var(--espace-2);
  text-align: center;
}

.accords__comp-carte--active {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), inset 0 0 0 3px var(--accent);
}

.accords__comp-texte {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 1.32rem;
  font-weight: 700;
}

.accords__comp-texte > .icone {
  width: 1.8rem;
  height: 1.8rem;
}

.accords__comp-marque {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.accords__comp-legende {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--encre-2);
}

.accords__truc {
  display: grid;
  justify-items: center;
  gap: var(--espace-3);
  width: 100%;
}

.accords__actions {
  min-height: 2.8rem;
}

/* L'affiche de l'accueil : la marque du pluriel, bien visible sur le rouge */
.accords__glyphe-s {
  background: var(--jaune);
  color: var(--sur-jaune);
  box-shadow: inset 0 -6px 0 color-mix(in srgb, var(--jaune) 60%, #000);
}

@media (max-width: 560px) {
  .accords__carte {
    padding: var(--espace-3);
  }
  .accords__carte-ligne {
    gap: var(--espace-3);
  }
  .accords__medaillon-icones > .icone {
    width: 2rem;
    height: 2rem;
  }
}
