/* Jeu : vrai truc ou blague ? */

/* Repli pour les navigateurs sans color-mix() (Safari avant 16.2, vieux iPad) : sous chaque règle qui mélange
   des couleurs, un petit bloc @supports not redonne une couleur simple de base.css (la plus présente du mélange).
   Une ligne de repli écrite juste avant ne suffirait pas : une valeur qui contient var() est jugée trop tard,
   elle devient « unset » (le noir d'un SVG, un fond transparent). */

.vob__choix-marche {
  justify-content: center;
}

/* ---------- Le mot ---------- */

.vob__carte-mot {
  display: grid;
  justify-items: center;
  gap: var(--espace-3);
  width: 100%;
  max-width: 40rem;
  padding: var(--espace-5) var(--espace-3);
  border-radius: var(--rayon-grand);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 2px var(--trait);
  scroll-margin-top: 5rem;
}

.vob__carte-mot > * {
  min-width: 0;
  max-width: 100%;
}

.vob__haut {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--espace-4);
  max-width: 100%;
}

.vob__image {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  background: var(--bois);
  box-shadow: inset 0 -4px 0 var(--bois-flanc);
  font-size: 2rem;
}

.vob__image > .icone {
  width: 2.2rem;
  height: 2.2rem;
}

.vob__mot {
  min-width: 0;
}

.vob__lettres {
  --taille: min(3.3rem, calc((100vw - 11rem) / var(--n, 6)));
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 4px;
}

.vob__lettres .vob__tuile {
  --taille: inherit;
  min-width: 0;
  width: var(--taille);
  padding: 0;
}

/* le piège dont parle le renard : entouré de pointillés, puis allumé quand la blague est démasquée */
.vob__piege {
  outline: 3px dashed var(--accent);
  outline-offset: 2px;
}

.vob__piege.tuile--allumee {
  outline-color: transparent;
}

/* Le piège allumé (dans le mot, le mot qui le montre et le carnet) : le jaune surligné du code des couleurs (22/10/2026).
   Sur des tuiles de bois, ce jaune pâle se distingue mal : un cadre foncé l'accompagne (un signe de forme). */
.vob__tuile.tuile--allumee,
.vob__lettres--mini .vob__tuile.tuile--allumee {
  background: var(--fn-piege);
  color: var(--fn-piege-texte);
  box-shadow: inset 0 0 0 2px var(--fn-piege-texte), inset 0 -5px 0 var(--fn-piege-texte);
}

.vob__lettres--petites {
  --taille: min(2.3rem, calc((100vw - 9rem) / var(--n, 6)));
}

.vob__lettres--mini {
  --taille: 1.6rem;
  gap: 2px;
}

.vob__lettres--mini .vob__tuile {
  border-radius: 6px;
  box-shadow: inset 0 -3px 0 var(--bois-flanc);
}

.vob__lettres--mini .tuile--allumee {
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
}

.vob__dire {
  display: flex;
  align-items: center;
  gap: var(--espace-3);
  max-width: 34rem;
}

.vob__phrase {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
}

/* ---------- Le renard ---------- */

.vob__terrier {
  display: flex;
  align-items: center;
  gap: var(--espace-4);
  width: 100%;
  max-width: 40rem;
}

.vob__renard {
  display: grid;
  place-items: center;
  flex: none;
  width: 3.4rem;
  height: 3.4rem;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent);
  font-size: 2.2rem;
  transition: transform var(--duree);
}

.vob__renard > .icone {
  width: 2.4rem;
  height: 2.4rem;
}
@supports not (color: color-mix(in srgb, red 50%, blue)) { .vob__renard { background: var(--surface); } }

.vob__renard:hover {
  transform: rotate(-6deg);
}

.vob__renard.est-content {
  animation: vob-hop 420ms cubic-bezier(0.3, 1.6, 0.5, 1);
}

.vob__renard.est-grille {
  animation: vob-grille 600ms ease;
}

@keyframes vob-hop {
  0%, 100% { transform: none; }
  40% { transform: translateY(-10px) rotate(4deg); }
}

@keyframes vob-grille {
  0%, 100% { transform: none; }
  20% { transform: rotate(-14deg) scale(0.94); }
  45% { transform: rotate(10deg); }
  70% { transform: rotate(-5deg); }
}

.vob__bulle {
  position: relative;
  flex: 1;
  min-width: 0;
  display: grid;
  gap: var(--espace-1);
  padding: var(--espace-4) var(--espace-5);
  border-radius: var(--rayon-grand);
  background: var(--accent);
  color: var(--sur-accent);
}

/* la pointe de la bulle, vers le renard */
.vob__bulle::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  width: 22px;
  height: 22px;
  background: inherit;
  transform: translateY(-50%) rotate(45deg);
  border-radius: 4px;
}

.vob__question {
  position: relative;
  font-size: var(--t-grand);
  font-weight: 700;
  line-height: 1.3;
}

.vob__consigne {
  position: relative;
  font-size: 1rem;
  line-height: 1.4;
  opacity: 0.92;
}

/* ---------- Les deux raisons ---------- */

.vob__raisons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--espace-4);
  width: 100%;
  max-width: 46rem;
}

.vob__raisons.est-fini {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 640px) {
  .vob__raisons {
    grid-template-columns: minmax(0, 1fr);
  }
}

.vob__boite {
  position: relative;
  display: grid;
  gap: var(--espace-3);
  align-content: start;
  min-width: 0;
}

.vob__raison {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 7rem;
  padding: var(--espace-5) 3.9rem var(--espace-5) var(--espace-5);
  border: 0;
  border-radius: var(--rayon-grand);
  background: var(--surface);
  color: var(--encre);
  text-align: left;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: inset 0 0 0 3px var(--trait), inset 0 -6px 0 var(--trait);
  transition: transform var(--duree), box-shadow var(--duree), background var(--duree);
}

.vob__raison:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 3px var(--accent), inset 0 -6px 0 color-mix(in srgb, var(--accent) 60%, var(--trait));
}

.vob__voix {
  position: absolute;
  top: var(--espace-3);
  right: var(--espace-3);
}

/* La vraie, touchée trop tôt : un tampon « Vrai » */
.vob__tampon {
  position: absolute;
  right: 3.6rem;
  bottom: -0.7rem;
  padding: 0.1rem 0.7rem;
  border-radius: 8px;
  border: 3px solid var(--vert);
  background: var(--surface);
  color: var(--vert);
  font-family: var(--police-titre);
  font-size: 1rem;
  letter-spacing: 0.08em;
  transform: rotate(-8deg) scale(0.4);
  opacity: 0;
  pointer-events: none;
  transition: transform 260ms cubic-bezier(0.3, 1.6, 0.5, 1), opacity 160ms;
}

.vob__boite.est-verifiee .vob__tampon {
  opacity: 1;
  transform: rotate(-8deg);
}

.vob__boite.est-verifiee .vob__raison {
  box-shadow: inset 0 0 0 3px var(--vert), inset 0 -6px 0 color-mix(in srgb, var(--vert) 60%, var(--trait));
}

/* La blague démasquée part en fumée */
.vob__boite.est-en-fumee .vob__raison {
  animation: vob-fumer 650ms ease-in forwards;
  pointer-events: none;
}

.vob__boite.est-en-fumee .vob__voix,
.vob__boite.est-en-fumee .vob__tampon {
  opacity: 0;
  transition: opacity 200ms;
}

@keyframes vob-fumer {
  0% { transform: none; filter: none; opacity: 1; }
  30% { transform: scale(1.03) rotate(-1deg); }
  100% { transform: translateY(-18px) scale(1.12); filter: blur(10px); opacity: 0; }
}

.vob__nuage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.vob__nuage i {
  position: absolute;
  bottom: 20%;
  width: 3rem;
  height: 3rem;
  margin-left: -1.5rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--encre-2) 45%, transparent);
  transform: scale(0.2);
  opacity: 0;
  animation: vob-bouffee 900ms ease-out var(--d, 0ms) forwards;
}
@supports not (color: color-mix(in srgb, red 50%, blue)) { .vob__nuage i { background: transparent; } }

@keyframes vob-bouffee {
  0% { transform: translate(0, 0) scale(0.2); opacity: 0; }
  25% { opacity: 0.8; }
  100% { transform: translate(var(--x, 0), -5rem) scale(calc(var(--t, 1) * 1.6)); opacity: 0; }
}

/* La vraie raison reste, en grand */
.vob__boite.est-gagnante {
  grid-column: 1 / -1;
  padding: var(--espace-4);
  border-radius: calc(var(--rayon-grand) + 6px);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-2));
  box-shadow: inset 0 0 0 3px var(--accent);
  animation: entrer 420ms cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
@supports not (color: color-mix(in srgb, red 50%, blue)) { .vob__boite.est-gagnante { background: var(--surface-2); } }

.vob__boite.est-gagnante .vob__raison {
  min-height: 0;
  padding: var(--espace-4) var(--espace-5);
  font-size: var(--t-grand);
  box-shadow: none;
  cursor: default;
}

.vob__boite.est-gagnante .vob__raison:hover {
  transform: none;
}

.vob__boite.est-gagnante .vob__voix {
  top: auto;
  position: static;
  justify-self: start;
}

.vob__boite.est-gagnante .vob__tampon {
  display: none;
}

.vob__vrai-titre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--espace-2) var(--espace-3);
}

.vob__vrai-titre .etiquette {
  color: var(--accent);
}

.vob__sorte {
  background: var(--accent);
  color: var(--sur-accent);
}

.vob__suite {
  display: grid;
  gap: var(--espace-3);
  min-width: 0;
}

.vob__suite:empty {
  display: none;
}

.vob__appui {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--espace-3);
  min-width: 0;
}

.vob__appui-dit {
  font-weight: 700;
  font-size: 1.1rem;
}

.vob__appui-bouton {
  min-width: 0;
  max-width: 100%;
  padding: var(--espace-2);
  border: 0;
  border-radius: var(--rayon);
  background: transparent;
}

.vob__appui-bouton:hover .vob__tuile {
  transform: translateY(-2px);
}

/* ---------- Le mot du renard sur sa blague ---------- */

.vob__message {
  display: grid;
  justify-items: center;
  width: 100%;
}

.vob__message:empty {
  display: none;
}

.vob__note {
  display: grid;
  gap: var(--espace-2);
  width: 100%;
  max-width: 40rem;
  padding: var(--espace-4) var(--espace-5);
  border-radius: var(--rayon-grand);
  border: 3px dashed var(--trait);
  animation: entrer 420ms cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

/* Une note d'astuce, en gris : le jaune pâle est réservé au piège (code des couleurs, 22/10/2026) */
.vob__note--aide {
  border-color: var(--encre-2);
  background: var(--surface-2);
}

.vob__note-blague {
  display: flex;
  align-items: flex-start;
  gap: var(--espace-2);
  color: var(--encre-2);
  font-style: italic;
}

.vob__note-blague .icone {
  font-size: 1.5rem;
  margin-top: 0.1rem;
}

.vob__note-titre {
  font-weight: 700;
  font-size: 1.1rem;
}

.vob__garder {
  justify-self: start;
  background: var(--jaune);
  color: var(--sur-jaune);
}

/* ---------- Le truc et le carnet ---------- */

.vob__truc {
  display: grid;
  justify-items: center;
  width: 100%;
}

.vob__carnet {
  display: grid;
  gap: var(--espace-3);
  width: 100%;
  max-width: 46rem;
  padding-top: var(--espace-4);
  border-top: 2px dashed var(--trait);
}

.vob__carnet-titre {
  font-family: var(--police-titre);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}

.vob__pages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--espace-3);
}

.vob__page-bouton {
  display: grid;
  gap: var(--espace-2);
  justify-items: start;
  width: 100%;
  height: 100%;
  padding: var(--espace-3) var(--espace-4);
  border: 0;
  border-radius: var(--rayon);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 2px var(--trait);
  color: var(--encre);
  text-align: left;
}

/* La page qui vient d'entrer dans le carnet : le contour bleu (« ce qui vient de changer ») */
.vob__page.est-neuve .vob__page-bouton {
  box-shadow: inset 0 0 0 3px var(--fn-change);
  animation: entrer 420ms cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.vob__page-texte {
  font-size: 0.98rem;
  line-height: 1.4;
}

/* L'affiche */
.vob__glyphe-piege {
  background: var(--fn-piege);
  color: var(--fn-piege-texte);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2);
}

@media (max-width: 520px) {
  /* sur téléphone, l'image au-dessus du mot : les longs mots gardent de grosses lettres */
  .vob__haut {
    flex-direction: column;
    gap: var(--espace-3);
  }

  .vob__lettres {
    --taille: min(3.3rem, calc((100vw - 8.5rem) / var(--n, 6)));
  }

  .vob__lettres--petites {
    --taille: min(2.3rem, calc((100vw - 8rem) / var(--n, 6)));
  }

  .vob__renard {
    width: 3rem;
    height: 3rem;
    font-size: 2rem;
  }

  .vob__renard > .icone {
    width: 2.1rem;
    height: 2.1rem;
  }

  .vob__bulle {
    padding: var(--espace-3) var(--espace-4);
  }

  .vob__question {
    font-size: 1.15rem;
  }

  .vob__raison {
    min-height: 5.5rem;
    font-size: 1.08rem;
  }
}
