/* L'Abécédaire : tuiles de lettres dorées, grille de choix A à Z, introduction du génie présentateur. */

/* Vignette de l'écran Jeux : tuiles de lettres qui tombent et rebondissent */
.vignette-abecedaire .vignette-decor { display: flex; align-items: center; justify-content: center; gap: 10px; }
.abv-tuile, .ab-lettre, .ab-intro-lettre {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(160deg, #f7d873, #c9962f);
  color: #2a1a08;
  font-family: "Cinzel", serif;
  font-weight: 700;
  box-shadow: 0 4px 0 #8a5d14, 0 8px 16px rgba(0, 0, 0, 0.35);
}
.abv-tuile { width: 44px; height: 44px; font-size: 1.5rem; animation: abv-rebond 3.2s ease-in-out infinite; }
.abv-tuile.t2 { animation-delay: 0.2s; }
.abv-tuile.t3 { animation-delay: 0.4s; }
.abv-tuile.t4 { animation-delay: 0.9s; margin-left: 14px; }
@keyframes abv-rebond { 0%, 60%, 100% { transform: translateY(0); } 70% { transform: translateY(-14px) rotate(-6deg); } 80% { transform: translateY(0) rotate(3deg); } }

/* Choix de la lettre */
.ab-choix-lettre { border: none; padding: 0; margin: 18px 0; }
.ab-choix-lettre legend { font-weight: 700; margin-bottom: 6px; }
.ab-lettres { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.ab-lettre-choix {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 10px;
  border: 2px solid var(--bord);
  background: var(--fond);
  color: var(--texte);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.ab-lettre-choix:hover { border-color: var(--or); transform: translateY(-2px); }
.ab-lettre-choix:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
.ab-lettre-choix[aria-pressed="true"] { border-color: var(--or); background: rgba(245, 197, 66, 0.15); box-shadow: 0 0 0 1px var(--or); }
.ab-lettre-choix.gagnee .ab-lettre-grande { color: var(--or); }
.ab-lettre-choix.hasard { grid-column: span 2; }
.ab-lettre-grande { font-family: "Cinzel", serif; font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.ab-lettre-choix small { font-size: 0.72rem; color: var(--texte-doux); }

/* Plateau */
.ab-lettre { align-self: center; width: 64px; height: 64px; font-size: 2.3rem; }
.ab-tour { margin-left: auto; color: var(--or); font-weight: 700; font-size: 0.95rem; }
.ab-niveau { background: rgba(245, 197, 66, 0.15); color: var(--or); }
.ab-plateau[data-palier="4"] .ab-niveau { background: rgba(255, 93, 93, 0.18); color: var(--rouge); }
.ab-question { font-size: 1.35rem; font-weight: 600; line-height: 1.4; margin: 16px 0 6px; }
.ab-indice { margin: 0 0 12px; color: var(--or); font-family: "Cinzel", serif; font-weight: 700; letter-spacing: 0.04em; }
.ab-plateau #ab-form { margin-top: 10px; }

/* Introduction : le génie présentateur annonce la lettre */
.ab-intro { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 0 8px; text-align: center; }
.ab-intro-genie .genie-choix { display: block; }
.ab-intro-genie .genie-portrait { font-size: 16px; animation: ab-presente 2.4s ease-in-out infinite; }
@keyframes ab-presente { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-3deg); } }
.ab-intro-bulle {
  position: relative;
  max-width: 460px;
  margin: 0;
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--texte);
  color: var(--fond);
  font-weight: 600;
  line-height: 1.4;
  animation: ab-bulle 0.4s ease-out;
}
.ab-intro-bulle::before { content: ""; position: absolute; top: -9px; left: 50%; border: 9px solid transparent; border-top: 0; border-bottom-color: var(--texte); transform: translateX(-50%); }
.ab-intro-lettre { width: 110px; height: 110px; font-size: 4.2rem; transition: transform 0.3s; }
.ab-intro.revelee .ab-intro-lettre { animation: ab-revele 0.7s ease-out; box-shadow: 0 4px 0 #8a5d14, 0 0 40px rgba(245, 197, 66, 0.75); }
@keyframes ab-bulle { from { opacity: 0; transform: translateY(6px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes ab-revele { 0% { transform: scale(0.6) rotate(-12deg); } 60% { transform: scale(1.18) rotate(4deg); } 100% { transform: scale(1); } }

body.en-pause .ab-question, body.en-pause .ab-indice { visibility: hidden; }

@media (max-width: 560px) {
  .ab-lettres { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
  .ab-lettre { width: 48px; height: 48px; font-size: 1.7rem; }
  .ab-question { font-size: 1.15rem; }
  .ab-intro-lettre { width: 88px; height: 88px; font-size: 3.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .abv-tuile, .ab-intro-bulle, .ab-intro.revelee .ab-intro-lettre, .ab-intro-genie .genie-portrait { animation: none; }
  .ab-lettre-choix { transition: none; }
}
