/* Page d'accueil — même univers que le jeu (Outfit, indigo, cases arrondies), fond de tuiles de lettres. */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: #e6e9f3;
  font-family: "Outfit", system-ui, sans-serif;
  color: #1b1d36;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 20px 8px;
  flex: 1;
}

/* ---------- Fond : tuiles de lettres ---------- */
.tuiles-fond {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  /* grille très légère en fond, comme une grille de mots fléchés */
  background-image:
    linear-gradient(rgba(27, 29, 54, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 29, 54, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center center;
}
/* position : pilotée par le script (transform seulement, au sous-pixel près) */
.tf-pos {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}
/* arrivée à l'ouverture, centrée sur la position */
.tf-arr {
  position: absolute;
  transform: translate(-50%, -50%);
  animation: arrivee 1.4s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
@keyframes arrivee {
  from {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(-25deg) scale(0.7);
  }
}
.tf {
  position: relative;
  width: var(--t);
  height: var(--t);
  border-radius: 11px;
  font-family: "Fredoka", "Outfit", sans-serif;
  background: #fff;
  color: #c5c9e0;
  font-weight: 600;
  font-size: calc(var(--t) * 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 63, 115, 0.08);
  transform: rotate(var(--r));
  will-change: transform;
  /* rotation lente et continue : un tour en 20 à 45 s selon la tuile (--d), sens alterné */
  animation: tourne var(--d, 60s) linear infinite;
}
.tf.inverse {
  animation-direction: reverse;
}
.tf.def {
  background: #fff3cf;
  color: #e3b54a;
  font-size: calc(var(--t) * 0.4);
}
@keyframes tourne {
  from {
    transform: rotate(var(--r));
  }
  to {
    transform: rotate(calc(var(--r) + 360deg));
  }
}
@media (prefers-reduced-motion: reduce) {
  .tf,
  .tf-arr,
  .logo .lt {
    animation: none !important;
    transform: rotate(var(--r, 0deg));
  }
  .m2::before {
    animation: none;
  }
}

/* ---------- Logo : monogramme IF + nom ----------
   Couleurs « du jeu » (version A, validée) : la tuile I prend le jaune de la case active,
   la tuile F le crème du mot en cours ; le nom et les lettres sont en encre. */
.hero {
  text-align: center;
  margin-bottom: 36px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: clamp(12px, 2vw, 20px);
}
.paire {
  display: flex;
  gap: 5px;
  padding: 6px;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(59, 63, 115, 0.12);
}
.t {
  position: relative;
  width: clamp(54px, 8vw, 76px);
  aspect-ratio: 1;
  border-radius: 18px;
  font-family: "Fredoka", "Outfit", sans-serif;
  background: #fff3cf; /* crème du mot en cours */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(32px, 5vw, 46px);
  font-weight: 700;
  color: #1b1d36;
}
.t.prim {
  background: #ffcb45; /* jaune de la case active */
}
.coin {
  position: absolute;
  top: 9px;
  left: 10px;
  border-top: 9px solid #1b1d36;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
}
.mots {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}
.mots {
  font-family: "Fredoka", "Outfit", sans-serif;
}
.m1 {
  font-size: clamp(28px, 4.4vw, 42px);
  font-weight: 500;
  color: #1b1d36;
}
/* « Fléché » : moins gras, avec un trait de surligneur jaune derrière (proposition 5, labo/fleche.html) */
.m2 {
  position: relative;
  font-size: clamp(33px, 5.3vw, 52px);
  font-weight: 500;
  color: #1b1d36;
  padding: 0 0.12em;
  margin-left: -0.06em;
}
.m2::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.08em;
  height: 44%;
  background: #ffcb45;
  border-radius: 0.16em;
  transform: rotate(-1.5deg);
  transform-origin: left center;
  animation: surligne 0.55s 1.25s cubic-bezier(0.3, 1.2, 0.5, 1) both; /* le trait se dessine après le rebond des lettres */
}
.m2 .lt {
  position: relative;
  z-index: 1;
}
@keyframes surligne {
  from {
    transform: rotate(-1.5deg) scaleX(0);
  }
  to {
    transform: rotate(-1.5deg) scaleX(1);
  }
}
.logo .lt {
  display: inline-block;
  animation: pop 0.6s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
/* rebond à l'arrivée ; chaque lettre finit légèrement de travers (--r) */
@keyframes pop {
  0% {
    transform: scale(0.3) rotate(0deg);
    opacity: 0;
  }
  45% {
    transform: translateY(-8px) scale(1.25) rotate(var(--r, 0deg));
    opacity: 1;
  }
  75% {
    transform: translateY(1px) scale(0.96) rotate(var(--r, 0deg));
  }
  100% {
    transform: rotate(var(--r, 0deg));
  }
}
.accroche {
  margin: 18px 0 0;
  font-size: clamp(16px, 2.2vw, 20px);
  color: #6b7096;
}

/* ---------- Reprendre ---------- */
.reprendre {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 520px;
  margin: 0 auto 32px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid #e3e6f2;
  border-left: 4px solid #ffcb45;
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.reprendre[hidden] {
  display: none;
}
.reprendre:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(59, 63, 115, 0.12);
}
.reprendre > .ti:first-child {
  font-size: 22px;
  color: #e0a800;
}
.reprendre strong {
  display: block;
  font-weight: 500;
}
.reprendre span span {
  font-size: 14px;
  color: #6b7096;
}
.reprendre .fleche {
  margin-left: auto;
  color: #6b7096;
}

/* ---------- Choix de la Force ---------- */
h2 {
  font-size: 20px;
  font-weight: 500;
  text-align: center;
  margin: 0 0 18px;
}
.forces {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 16px;
}
.carte {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: #f6f7fb;
  border-radius: 18px;
  border: 2px solid transparent;
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1),
    box-shadow 0.25s,
    border-color 0.25s;
}
a.carte:hover,
a.carte:focus-visible {
  transform: translateY(-5px);
  border-color: var(--coul);
  box-shadow: 0 14px 30px rgba(59, 63, 115, 0.14);
  outline: none;
}
.carte .haut {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.carte .num {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--fond);
  color: var(--coul);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
}
.points {
  display: flex;
  gap: 5px;
}
.pt {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dce0ee;
}
.pt.on {
  background: var(--coul);
}
.nom {
  font-size: 18px;
  font-weight: 500;
}
.desc {
  margin: 0;
  color: #6b7096;
  font-size: 15px;
  line-height: 1.45;
  flex: 1;
}
.bas {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #e3e6f2;
  font-size: 14px;
}
.statut {
  color: #8a8fb3;
}
.jouer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  color: var(--coul);
}
.carte.bientot {
  opacity: 0.55;
  cursor: default;
}

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: #8a8fb3;
}

/* ---------- Grilles du jour : titre, date, série ---------- */
.titre-jour {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px 14px;
  margin-bottom: 18px;
}
.titre-jour h2 {
  margin: 0;
}
.date-jour {
  color: #6b7096;
  font-size: 15px;
}
.date-jour::first-letter {
  text-transform: uppercase;
}
.serie {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: #c2410c;
  background: #ffedd5;
  padding: 4px 11px;
  border-radius: 999px;
}
.serie.vide {
  color: #6b7096;
  background: #eceef7;
}
.statut .ti {
  vertical-align: -2px;
}
.carte.finie .statut {
  color: #1f7a52;
  font-weight: 500;
}

/* ---------- Archives ---------- */
.archives {
  margin-top: 40px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.archives h2 {
  margin-bottom: 2px;
}
.sous-titre {
  text-align: center;
  color: #6b7096;
  margin: 0 0 14px;
}
.jour {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #f6f7fb;
  border-radius: 14px;
  margin-bottom: 8px;
}
.jour-date::first-letter {
  text-transform: uppercase;
}
.chips {
  display: flex;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 46px;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--coul);
  background: #fff;
  border: 1.5px solid var(--fond);
  transition: transform 0.15s;
}
.chip:hover {
  transform: translateY(-2px);
  border-color: var(--coul);
}
.chip.encours {
  background: var(--fond);
}
.chip.fini {
  background: var(--coul);
  color: #fff;
  border-color: var(--coul);
}
.chip.sol {
  opacity: 0.55;
}
.archives .vide {
  text-align: center;
  color: #8a8fb3;
}
footer a {
  color: inherit;
}

/* Texte visible seulement par Google et les lecteurs d'écran */
.lecteur {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* ---------- Présentation (bas de page) ---------- */
.apropos {
  margin: 56px auto 0;
  max-width: 640px;
  box-sizing: border-box;
  background: rgba(246, 247, 251, 0.92);
  border-radius: 18px;
  padding: 24px 26px;
  color: #3b3f73;
  font-size: 15px;
  line-height: 1.6;
}
.apropos h2 {
  margin-bottom: 10px;
}
.apropos h3 {
  font-size: 16px;
  font-weight: 500;
  color: #1b1d36;
  margin: 18px 0 4px;
}
.apropos p {
  margin: 0 0 8px;
}
.apropos ul {
  margin: 0;
  padding-left: 20px;
}
.apropos strong {
  font-weight: 500;
  color: #1b1d36;
}
.toutes-archives {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  margin: 14px auto 0;
  padding: 9px 18px;
  border-radius: 999px;
  background: #fff3cf;
  color: #6b4a00;
  font-weight: 500;
  text-decoration: none;
  font-size: 15px;
}
.toutes-archives:hover {
  background: #ffe08a;
}
/* l'en-tête et le pied de page passent au-dessus du fond de tuiles */
.site-tete {
  z-index: 40;
}
/* animations réduites : le surligneur de « Fléché » est affiché d'emblée (règle placée après .m2::before) */
@media (prefers-reduced-motion: reduce) {
  .m2::before {
    animation: none;
  }
}
