/* Jeu : la phrase qui grandit */

.grandit__jeu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--espace-3);
  width: 100%;
}

.grandit__feuille {
  position: relative;
  width: 100%;
  max-width: 40rem;
  min-height: 12rem;
  padding: var(--espace-6) var(--espace-5);
  border-radius: var(--rayon-grand);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 3px var(--trait);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--espace-4);
}

.grandit__feuille.est-complete {
  box-shadow: inset 0 0 0 3px var(--accent);
}

.grandit__phrase {
  margin: 0;
  font-family: var(--police-texte);
  font-weight: 700;
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.3rem);
  line-height: 1.6;
  text-align: center;
}

.grandit__bout {
  white-space: nowrap;
  padding: 0.05em 0.15em;
  border-radius: 8px;
  transition: background-color 520ms ease, box-shadow 520ms ease;
}

/* Le bout qui vient d'arriver : le contour bleu du code des couleurs (« ce qui vient de changer », 22/10/2026).
   Avant, un fond jaune : on l'aurait pris pour le surlignage du piège. */
.grandit__bout--neuf {
  box-shadow: 0 0 0 3px var(--fn-change);
  animation: grandit-arrive 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes grandit-arrive {
  0% { opacity: 0; transform: translateY(0.4em); }
  100% { opacity: 1; transform: none; }
}

/* Le surligneur de « Je relis » : un trait épais sous le groupe, sans changer la couleur des lettres */
.grandit__bout--lu {
  box-shadow: inset 0 -0.5em 0 color-mix(in srgb, var(--accent) 80%, transparent);
}
@supports not (color: color-mix(in srgb, red 50%, blue)) { .grandit__bout--lu { box-shadow: inset 0 -0.5em 0 var(--accent); } }
.grandit__bout--neuf.grandit__bout--lu {
  box-shadow: 0 0 0 3px var(--fn-change), inset 0 -0.5em 0 color-mix(in srgb, var(--accent) 80%, transparent);
}
@supports not (color: color-mix(in srgb, red 50%, blue)) { .grandit__bout--neuf.grandit__bout--lu { box-shadow: 0 0 0 3px var(--fn-change), inset 0 -0.5em 0 var(--accent); } }

.grandit__invite {
  margin: 0.5rem auto 0;
  max-width: 34rem;
  text-align: center;
  font-weight: 700;
}

.grandit__chute {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 5rem;
}

.grandit__chute:empty {
  display: none;
}

.grandit__choix {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--espace-3);
  margin-top: var(--espace-2);
}

.grandit__image-choix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.1rem;
  border: 0;
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: inset 0 0 0 3px var(--trait), 0 4px 0 var(--ombre);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.grandit__image-choix:hover,
.grandit__image-choix:focus-visible {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 3px var(--accent), 0 6px 0 var(--ombre);
}

.grandit__duo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.grandit__duo-sujet .icone {
  width: 2.2rem;
  height: 2.2rem;
  opacity: 0.85;
}

.grandit__duo-detail .icone {
  width: 2.8rem;
  height: 2.8rem;
}

.grandit__chute .grandit__duo {
  animation: grandit-chute 600ms cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes grandit-chute {
  0% { transform: scale(0) rotate(-20deg); }
  100% { transform: none; }
}

.grandit__glyphe {
  font-family: var(--police-texte);
  font-weight: 700;
  font-size: 1.15em;
}

.grandit__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;
}

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

@media (prefers-reduced-motion: reduce) {
  .grandit__bout--neuf, .grandit__chute .icone { animation: none; }
}
