/* Jeu : les lettres acrobates */

.acrobates__jeu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: inherit;
  width: 100%;
}

.acrobates__salles {
  justify-content: flex-start;
  justify-content: safe center;
}

.acrobates__tete {
  display: flex;
  align-items: center;
  gap: var(--espace-3);
  width: 100%;
  max-width: 36rem;
}

.acrobates__consigne {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: var(--t-texte);
  line-height: 1.4;
  text-align: center;
  min-height: 2.8em;
  display: grid;
  place-items: center;
}

/* ---------- Le chapiteau et ses trapèzes ---------- */

.acrobates__chapiteau {
  display: grid;
  grid-template-columns: repeat(var(--colonnes, 3), minmax(0, 1fr));
  gap: var(--espace-2);
  width: 100%;
  max-width: 36rem;
  padding: 0 var(--espace-1) var(--espace-3);
  border-radius: var(--rayon-grand) var(--rayon-grand) var(--rayon) var(--rayon);
  background: repeating-linear-gradient(90deg, var(--surface-2) 0 2.2rem, var(--surface) 2.2rem 4.4rem);
  box-shadow: inset 0 6px 0 var(--accent);
}

.acrobates__colonne {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--espace-1);
  min-width: 0;
}

.acrobates__trapeze {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  min-height: 9.5rem;
  padding: 0 var(--espace-1) var(--espace-2);
  border: 0;
  border-radius: 0 0 var(--rayon) var(--rayon);
  background: transparent;
  color: var(--encre);
  cursor: pointer;
  transform-origin: 50% 0;
  transition: background var(--duree);
}

.acrobates__trapeze:hover,
.acrobates__trapeze.est-survole {
  background: var(--surface);
}

/* Les deux cordes, puis la barre où l'acrobate se pose */
.acrobates__cordes {
  position: absolute;
  top: 0;
  left: 28%;
  right: 28%;
  height: 4.6rem;
  border-left: 2px solid var(--encre-2);
  border-right: 2px solid var(--encre-2);
}

.acrobates__barre {
  position: absolute;
  top: 4.6rem;
  left: 22%;
  right: 22%;
  height: 7px;
  border-radius: 999px;
  background: var(--bois-flanc);
}

.acrobates__perche {
  position: absolute;
  top: 1.4rem;
  left: 0;
  right: 0;
  height: 3.2rem;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.acrobates__modele {
  display: block;
  max-width: 100%;
  font-weight: 700;
  font-size: clamp(1rem, 0.7rem + 1.4vw, 1.35rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: center;
}

.acrobates__etiquette-son {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--trait);
  color: var(--encre-2);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.acrobates__modele b,
.acrobates__liste b,
.acrobates__mot b {
  /* Le code des couleurs (22/10/2026) : la lettre-piège, celle qui change de son, en jaune surligné */
  background: var(--fn-piege);
  color: var(--fn-piege-texte);
  border-radius: 0.2em;
}

.acrobates__voisine {
  text-decoration: underline;
  text-decoration-thickness: 0.14em;
  text-underline-offset: 0.14em;
  color: var(--accent);
}

.acrobates__repere {
  width: 100%;
  margin: 0;
  padding: var(--espace-1) var(--espace-3);
  border-radius: var(--rayon);
  background: var(--surface);
  border: 2px solid var(--trait);
  font-weight: 700;
  font-size: 0.98rem;
  text-align: center;
  color: var(--encre);
}

.acrobates__trapeze.est-indice .acrobates__barre {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--surface);
}

.acrobates__trapeze.est-indice {
  animation: acrobates-appel 1.6s ease-in-out infinite;
}

@keyframes acrobates-appel {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(3deg); }
  75% { transform: rotate(-3deg); }
}

.acrobates__trapeze.est-bon {
  animation: acrobates-balance 1.4s ease-in-out;
}

@keyframes acrobates-balance {
  0% { transform: rotate(0); }
  30% { transform: rotate(7deg); }
  60% { transform: rotate(-5deg); }
  100% { transform: rotate(0); }
}

.acrobates__liste {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.1rem 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 700;
  font-size: var(--t-petit);
  text-align: center;
}

/* ---------- L'acrobate et ses figures ---------- */

.acrobates__acrobate,
.acrobates__figure {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.acrobates__acrobate {
  min-width: 5rem;
  min-height: 5rem;
  padding: var(--espace-2);
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--sur-accent);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2), 0 3px 0 var(--ombre);
  cursor: grab;
  touch-action: none;
  transition: opacity var(--duree);
}

.acrobates__acrobate .icone {
  width: 2.4rem;
  height: 2.4rem;
}

.acrobates__acrobate.est-tenu {
  cursor: grabbing;
  z-index: 5;
  transition: none;
}

.acrobates__badge {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  height: 2rem;
  margin-top: 0.15rem;
  padding: 0 0.3rem;
  border-radius: 8px;
  background: var(--bois);
  color: var(--bois-encre);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 -3px 0 var(--bois-flanc);
}

.acrobates__acrobate.est-montre {
  animation: acrobates-sautille 1.2s ease-in-out infinite;
}

@keyframes acrobates-sautille {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Dans le filet : il tombe, rebondit, et revient */
.acrobates__acrobate.est-tombe {
  animation: acrobates-filet 700ms ease;
}

@keyframes acrobates-filet {
  0% { transform: translateY(0); }
  35% { transform: translateY(14px) scaleY(0.85); }
  60% { transform: translateY(-10px); }
  100% { transform: none; }
}

.acrobates__acrobate.est-parti {
  opacity: 0.25;
  pointer-events: none;
}

.acrobates__figure .icone {
  width: 2rem;
  height: 2rem;
}

.acrobates__figure .acrobates__badge {
  min-width: 1.6rem;
  height: 1.6rem;
  font-size: 1.1rem;
}

/* ks : un double salto */
.acrobates__figure--salto { animation: acrobates-salto 900ms ease-in-out both; }
@keyframes acrobates-salto {
  0% { transform: translateY(2.4rem) rotate(0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: rotate(720deg); }
}

/* gz ou z : une vrille, comme une abeille qui tourne */
.acrobates__figure--vrille { animation: acrobates-vrille 900ms ease-in-out both; }
@keyframes acrobates-vrille {
  0% { transform: translateY(2.4rem) scaleX(1); opacity: 0; }
  30% { opacity: 1; transform: translateY(0) scaleX(-1); }
  60% { transform: scaleX(1); }
  80% { transform: scaleX(-1); }
  100% { transform: none; }
}

/* s ou i : il se balance, tout droit */
.acrobates__figure--balance { animation: acrobates-se-balance 1s ease-in-out both; transform-origin: 50% 0; }
@keyframes acrobates-se-balance {
  0% { transform: translateY(2.4rem); opacity: 0; }
  40% { transform: rotate(14deg); opacity: 1; }
  70% { transform: rotate(-10deg); }
  100% { transform: none; }
}

/* le x qui se tait : il s'endort sur la barre */
.acrobates__figure--dodo { animation: acrobates-dodo 900ms ease both; }
@keyframes acrobates-dodo {
  0% { transform: translateY(2.4rem); opacity: 0; }
  60% { transform: rotate(0); opacity: 1; }
  100% { transform: rotate(-80deg) translateX(0.6rem); }
}

.acrobates__zz {
  position: absolute;
  top: -0.6rem;
  right: -1.2rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--encre-2);
  transform: rotate(80deg);
}

/* le y qui vaut deux i : il se dédouble */
.acrobates__figure--deux { animation: acrobates-deux 900ms ease both; }
@keyframes acrobates-deux {
  0% { transform: translateY(2.4rem) scaleX(0.5); opacity: 0; }
  60% { transform: scaleX(1.3); opacity: 1; }
  100% { transform: none; }
}

/* le tréma : le grand écart */
.acrobates__figure--ecart { animation: acrobates-ecart 900ms ease both; }
@keyframes acrobates-ecart {
  0% { transform: translateY(2.4rem) scale(0.8, 1); opacity: 0; }
  50% { transform: scale(1.5, 0.75); opacity: 1; }
  100% { transform: none; }
}

/* ---------- La piste : le mot ---------- */

.acrobates__piste {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--espace-4);
  width: 100%;
  max-width: 36rem;
  padding: var(--espace-4) var(--espace-3);
  border-radius: var(--rayon-grand);
  background: var(--surface-2);
  box-shadow: inset 0 -6px 0 var(--trait);
}

.acrobates__carte {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--espace-3);
  min-width: 0;
  cursor: pointer;
}

.acrobates__image {
  width: 2.8rem;
  height: 2.8rem;
  font-size: 2.8rem;
  line-height: 1;
  flex: none;
}

.acrobates__image > .icone {
  width: 2.8rem;
  height: 2.8rem;
}

.acrobates__image.est-vide {
  display: none;
}

.acrobates__ligne {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--espace-2);
  min-width: 0;
}

.acrobates__mot {
  font-weight: 700;
  font-size: clamp(1.6rem, 1rem + 2.6vw, 2.4rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
  padding: var(--espace-1) var(--espace-2);
  border-radius: var(--rayon);
  transition: background 320ms ease, box-shadow 320ms ease;
}

.acrobates__mot.est-revele {
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.acrobates__trou {
  display: inline-block;
  min-width: 0.9em;
  margin: 0 0.05em;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--accent);
  color: var(--encre-2);
  text-align: center;
}

.acrobates__mot.est-revele b {
  display: inline-block;
  padding: 0 0.06em;
  animation: acrobates-pose 500ms cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

@keyframes acrobates-pose {
  from { transform: translateY(-0.6em) scale(0.5); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ---------- Sous la piste ---------- */

.acrobates__phrase {
  max-width: 36rem;
  min-height: 1.6em;
  text-align: center;
}

.acrobates__truc {
  display: grid;
  gap: var(--espace-4);
  width: 100%;
  max-width: 36rem;
}

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

.acrobates__glyphe b {
  /* La lettre qui compte : la couleur du texte de l'affiche, avec un trait épais dessous.
     Avant, la couleur du jeu, la même que le fond de l'affiche : elle disparaissait (audit sur tablette du 22/10/2026) */
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.12em;
}

@media (max-width: 420px) {
  .acrobates__trapeze {
    min-height: 8.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .acrobates__figure,
  .acrobates__trapeze,
  .acrobates__acrobate,
  .acrobates__mot.est-revele b {
    animation: none !important;
  }
  .acrobates__figure--dodo {
    transform: rotate(-80deg);
  }
}

/* « Encore » : le mot se fait répéter (règle 14, jeux d'écoute) */
.acrobates__encore {
  flex: none;
}

.acrobates__actions {
  min-height: 2.8rem;
}
