/* Kisycolle : style "jouet en plastique".
   Fond jaune soleil, traits épais à l'encre, ombres dures sans flou. */
:root {
  --soleil: #FFCB2E;
  --soleil-fonce: #F2B705;
  --encre: #1D1147;
  --blanc: #FFFFFF;
  --tomate: #FF4D4D;
  --trait: 3px solid var(--encre);
  --ombre: 0 5px 0 var(--encre);
  --police: "Baloo 2", "Fredoka", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--soleil);
  color: var(--encre);
  font-family: var(--police);
  font-size: 17px;
  line-height: 1.4;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--encre); outline-offset: 3px; }
.avatar { display: block; width: 100%; height: 100%; overflow: visible; }

/* ---------- Cadre commun des écrans ---------- */
.ecran {
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(22px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.actions { margin-top: auto; display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }

.bouton {
  width: 100%;
  padding: 15px 18px;
  background: var(--blanc);
  border: var(--trait);
  border-radius: 18px;
  box-shadow: var(--ombre);
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.2;
  transition: transform .06s, box-shadow .06s;
}
.bouton.principal { background: var(--tomate); font-size: 1.3rem; padding: 18px; }
.bouton:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--encre); }

.entete { display: flex; align-items: center; gap: 12px; }
.entete h1 { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.retour, .rond {
  flex: none; width: 46px; height: 46px;
  background: var(--blanc); border: var(--trait); border-radius: 50%;
  box-shadow: 0 3px 0 var(--encre);
  font-size: 1.7rem; font-weight: 800; line-height: 1;
  display: grid; place-items: center; padding: 0 0 3px;
}
.retour:active, .rond:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--encre); }
.rond:disabled { opacity: .35; box-shadow: none; }

/* ---------- Accueil ---------- */
.accueil { justify-content: center; text-align: center; gap: 22px; }
/* Le logo, avec trois petites bêtes qui dépassent de derrière les lettres. */
.logo-zone { position: relative; isolation: isolate; margin-top: auto; padding-top: 1.05em; font-size: clamp(2rem, 9.6vw, 3rem); }
.bestioles { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.bestiole { position: absolute; display: block; aspect-ratio: 1; animation: coucou 2.4s ease-in-out infinite; }
.bestiole svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bestiole.lapin { left: 6%; top: -.05em; width: 1.45em; rotate: -12deg; animation-delay: -.3s; }
.bestiole.licorne { left: 50%; top: -.3em; width: 1.55em; margin-left: -.7em; animation-delay: -1.1s; }
.bestiole.poussin { right: 5%; top: .02em; width: 1.25em; rotate: 10deg; animation-delay: -1.8s; }
/* Le singe pend sous le dernier « e », accroché d'une main, et se balance comme un pendule. */
.logo-zone { padding-bottom: 1.3em; }
.singe { position: absolute; right: .05em; top: 2.1em; z-index: 2; width: 1.22em; aspect-ratio: 100 / 130; transform-origin: 40% 6%; animation: balance 1.9s ease-in-out infinite alternate; pointer-events: none; }
.singe svg { display: block; width: 100%; height: 100%; overflow: visible; }
@keyframes balance { from { rotate: -14deg; } to { rotate: 14deg; } }
/* L'oiseau passe au-dessus de tout le monde. */
.accueil { overflow-x: clip; }
.ciel { position: absolute; left: 50%; top: -.75em; z-index: 3; width: 0; height: 0; pointer-events: none; }
.oiseau { position: absolute; left: -.45em; top: 0; width: .9em; aspect-ratio: 64 / 44; opacity: 0; }
.oiseau svg { display: block; width: 100%; height: 100%; overflow: visible; }
.oiseau .aile { transform-box: fill-box; transform-origin: 50% 100%; animation: battre .16s ease-in-out infinite alternate; }
@keyframes battre { to { scale: 1 -0.6; } }
@keyframes coucou { 0%, 100% { translate: 0 .1em; } 50% { translate: 0 -.06em; } }
.logo {
  position: relative; z-index: 1;
  display: flex; justify-content: center; gap: clamp(1px, .6vw, 4px);
  font-size: clamp(2rem, 9.6vw, 3rem);
  font-weight: 800; line-height: 1;
}
.logo span {
  display: grid; place-items: center;
  width: 1.02em; height: 1.3em;
  background: var(--c, var(--blanc));
  border: 3px solid var(--blanc);
  border-radius: .28em;
  box-shadow: 0 0 0 3px var(--encre), 0 6px 0 3px var(--encre);
  transform: rotate(var(--r, 0deg)) translateY(var(--y, 0));
}
/* Chaque lettre est une gommette collée un peu de travers. */
.logo span:nth-child(1) { --c: #FF4D4D; --r: -7deg; }
.logo span:nth-child(2) { --c: #FFFFFF; --r: 4deg; --y: 5px; }
.logo span:nth-child(3) { --c: #12C4C4; --r: -3deg; }
.logo span:nth-child(4) { --c: #FF8A1F; --r: 6deg; --y: -4px; }
.logo span:nth-child(5) { --c: #FF6FB5; --r: -5deg; --y: 4px; }
.logo span:nth-child(6) { --c: #FFFFFF; --r: 3deg; }
.logo span:nth-child(7) { --c: #1FB86E; --r: -6deg; --y: -3px; }
.logo span:nth-child(8) { --c: #9B5DE5; --r: 5deg; --y: 5px; }
.logo span:nth-child(9) { --c: #2F7BFF; --r: -4deg; }
.accroche { font-size: 1.15rem; max-width: 22em; margin: 6px auto 0; }

.ribambelle { display: flex; justify-content: center; align-items: flex-end; flex-wrap: wrap; gap: 2px; padding: 0 4px; }
.rib { width: clamp(44px, 16vw, 76px); aspect-ratio: 1; animation: sautille 1.1s ease-in-out infinite alternate; }
.rib:nth-child(2n) { animation-delay: -.45s; }
.rib:nth-child(3n) { animation-delay: -.8s; }
@keyframes sautille { from { transform: translateY(0); } to { transform: translateY(-9px); } }

/* ---------- Joueurs ---------- */
.compteur { display: flex; align-items: center; justify-content: center; gap: 18px; }
.compte { font-size: 1.35rem; font-weight: 800; min-width: 6.2em; text-align: center; }
.liste-joueurs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.joueur {
  display: flex; align-items: center; gap: 12px;
  background: var(--blanc); border: var(--trait); border-radius: 20px;
  padding: 6px 12px 6px 8px;
}
.avatar-bouton { flex: none; width: 58px; height: 58px; padding: 0; background: none; border: 0; border-radius: 50%; }
.avatar-bouton:active { transform: scale(.92); }
.joueur input {
  flex: 1; min-width: 0;
  border: 0; border-bottom: 3px dashed rgba(29, 17, 71, .25); border-radius: 0;
  background: none; padding: 8px 2px; font-size: 1.2rem; font-weight: 800;
}
.joueur input:focus { outline: none; border-bottom-color: var(--encre); border-bottom-style: solid; }
.joueur input::placeholder { color: rgba(29, 17, 71, .45); font-weight: 600; }
.astuce { font-size: .95rem; text-align: center; opacity: .8; }

.atelier {
  width: min(430px, calc(100vw - 24px));
  height: min(780px, calc(100vh - 24px)); height: min(780px, calc(100dvh - 24px)); overflow: hidden;
  border: var(--trait); border-radius: 26px; box-shadow: 0 8px 0 var(--encre);
  padding: 0; background: var(--blanc); color: var(--encre);
}
.atelier[open] { display: flex; flex-direction: column; }
.atelier::backdrop { background: rgba(29, 17, 71, .55); }
.atelier-tete { flex: none; padding: 12px 14px 10px; border-bottom: 3px dashed rgba(29, 17, 71, .18); }
.atelier-apercu { width: 124px; height: 124px; margin: -4px auto -2px; }
.atelier-apercu .avatar { animation: pop .28s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { transform: scale(.86); } to { transform: scale(1); } }
.atelier h2 { text-align: center; font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.onglets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 8px; }
.onglet {
  padding: 5px 4px 6px; background: var(--blanc); border: var(--trait); border-radius: 14px;
  box-shadow: 0 3px 0 var(--encre); font-size: .98rem; font-weight: 800; line-height: 1.15;
}
.onglet[aria-selected="true"] { background: var(--soleil); transform: translateY(2px); box-shadow: 0 1px 0 var(--encre); }
.atelier-corps { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 14px; }
.atelier h3 { font-size: 1rem; font-weight: 800; margin: 12px 0 6px; }
.atelier-pied { flex: none; display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; padding: 10px 14px 16px; border-top: 3px dashed rgba(29, 17, 71, .18); }
.atelier-pied .bouton { padding: 13px 10px; font-size: 1.08rem; }
.atelier-pied .bouton.principal { font-size: 1.2rem; }
.pastilles { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; }
.pastilles.autres { margin-top: 9px; }
.pastilles.petites { grid-template-columns: repeat(7, 34px); gap: 10px; margin-top: 4px; justify-content: center; }
.pastille { position: relative; aspect-ratio: 1; border: var(--trait); border-radius: 50%; background: var(--c); padding: 0; }
.pastille[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--blanc), 0 0 0 6px var(--encre); }
/* Couleur déjà prise par un autre joueur : on l'échangera. */
.pastille.prise::after { content: ""; position: absolute; right: -3px; top: -3px; width: 9px; height: 9px; border: 2px solid var(--encre); border-radius: 50%; background: var(--blanc); }
.choix { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.choix.trois { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choix.sept { grid-template-columns: repeat(7, 1fr); gap: 3px; }
.choix.cinq { grid-template-columns: repeat(5, 1fr); gap: 5px; }
.choix.larges { grid-template-columns: repeat(4, 1fr); gap: 4px; }
.choix.larges .vignette { aspect-ratio: 2; }
.choix.familiers { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.vignette { min-width: 0; aspect-ratio: 1; padding: 2px; background: none; border: 3px solid transparent; border-radius: 14px; overflow: hidden; }
.vignette .avatar { overflow: hidden; }
.vignette[aria-pressed="true"] { border-color: var(--encre); background: var(--soleil); }
.vignette.avec-nom { aspect-ratio: auto; display: grid; grid-template-rows: auto auto; justify-items: center; padding: 4px 2px 6px; background: #FFF6D6; border-color: rgba(29, 17, 71, .12); }
.vignette.avec-nom .avatar { width: 100%; height: auto; aspect-ratio: 1; }
.vignette.avec-nom[aria-pressed="true"] { border-color: var(--encre); background: var(--soleil); }
.vignette small { font-size: .9rem; font-weight: 800; line-height: 1.1; }
.familiers .vignette { padding: 6px; }
.familiers .vignette .avatar { overflow: visible; }
.vignette-vide { display: grid; place-items: center; width: 100%; height: 100%; border: 3px dashed rgba(29, 17, 71, .35); border-radius: 50%; font-size: .78rem; font-weight: 800; }

/* ---------- Menu ---------- */
.equipe {
  display: flex; align-items: center; gap: 2px; width: 100%;
  background: var(--soleil-fonce); border: 0; border-radius: 18px; padding: 6px 12px 6px 8px;
}
.mini { flex: none; width: 34px; height: 34px; }
.equipe-lien { margin-left: auto; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.famille h2 { font-size: 1.25rem; font-weight: 800; }
.famille p { font-size: .95rem; margin-bottom: 10px; }
.tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tuile {
  text-align: left; display: flex; flex-direction: column; gap: 4px;
  min-height: 96px; padding: 12px 14px;
  background: var(--blanc); border: var(--trait); border-radius: 20px; box-shadow: var(--ombre);
}
.tuile strong { font-size: 1.15rem; font-weight: 800; line-height: 1.15; }
.tuile span { font-size: .9rem; line-height: 1.25; }
.tuile:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--encre); }
.tuile:disabled { background: transparent; box-shadow: none; border-style: dashed; opacity: .6; }

/* ---------- Avant le jeu ---------- */
.regle { font-size: 1.15rem; }
.preparation .ribambelle { margin: auto 0; }

/* ---------- Écran de jeu ---------- */
.ecran.jeu { height: 100vh; height: 100dvh; gap: 12px; }
.entete-jeu { justify-content: space-between; }
.quitter { background: none; border: 0; padding: 8px 4px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.zone-jeu { flex: 1; min-height: 0; display: flex; }

/* ---------- La course ---------- */
.course { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.annonce {
  min-height: 2.4em; display: grid; place-items: center; text-align: center;
  font-size: 1.5rem; font-weight: 800; line-height: 1.15;
}
.piste {
  --taille: 56px;
  position: relative; flex: 1; min-height: 0; max-height: 620px;
  display: flex; flex-direction: column;
  background: var(--blanc); border: var(--trait); border-radius: 22px; box-shadow: var(--ombre);
  overflow: hidden;
}
.couloir { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; }
.couloir + .couloir { border-top: 2px dashed rgba(29, 17, 71, .18); }
.nom-couloir {
  position: absolute; left: 10px; top: 3px;
  font-size: .72rem; font-weight: 800; opacity: .45; pointer-events: none;
}
.arrivee {
  position: absolute; top: 0; bottom: 0; right: 12px; width: 14px;
  background: conic-gradient(var(--encre) 25%, var(--blanc) 0 50%, var(--encre) 0 75%, var(--blanc) 0) 0 0 / 14px 14px;
  border-left: 2px solid var(--encre); border-right: 2px solid var(--encre);
}
.coureur { position: relative; z-index: 1; width: var(--taille); height: var(--taille); margin-left: 4px; will-change: transform; }
.coureur-corps { width: 100%; height: 100%; transform-origin: 50% 85%; }
.rang {
  position: absolute; right: 34px; top: 50%; translate: 0 -50%;
  width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--soleil); border: var(--trait); border-radius: 50%;
  font-weight: 800; font-size: .95rem; line-height: 1;
}
.rang[hidden] { display: none; }
.bulle {
  position: absolute; left: 100%; top: 0; margin-left: 2px; white-space: nowrap;
  background: var(--encre); color: var(--blanc);
  font-size: .78rem; font-weight: 800; line-height: 1; padding: 4px 7px; border-radius: 9px;
  opacity: 0; pointer-events: none;
}
.bulle.visible { animation: bulle .9s ease-out; }
@keyframes bulle { 0% { opacity: 0; transform: translateY(6px); } 15%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* Échauffement : petits sauts désordonnés. */
.piste[data-phase="echauffement"] .coureur-corps { animation: echauffe .42s ease-in-out infinite alternate; }
.piste[data-phase="echauffement"] .couloir:nth-child(2n) .coureur-corps { animation-duration: .36s; animation-delay: -.2s; }
.piste[data-phase="echauffement"] .couloir:nth-child(3n) .coureur-corps { animation-duration: .5s; animation-delay: -.1s; }
@keyframes echauffe { from { transform: translateY(0) scaleY(.94); } to { transform: translateY(-16%) scaleY(1.04); } }
/* À vos marques : tout le monde se tasse, prêt à bondir. */
.piste[data-phase="depart"] .coureur-corps { transform: scale(1.08, .86) rotate(6deg); transition: transform .25s; }
.piste.coup-de-feu { animation: flash .35s ease-out; }
@keyframes flash { 0% { background: var(--tomate); } 100% { background: var(--blanc); } }

.coureur[data-etat="court"] .coureur-corps { animation: foulee .22s ease-in-out infinite alternate; }
.coureur[data-etat="turbo"] .coureur-corps { animation: foulee .11s ease-in-out infinite alternate; }
@keyframes foulee { from { transform: rotate(4deg) translateY(0); } to { transform: rotate(13deg) translateY(-9%); } }
.coureur[data-etat="turbo"]::before {
  content: ""; position: absolute; right: 88%; top: 28%; width: 60%; height: 44%;
  background: repeating-linear-gradient(to bottom, var(--encre) 0 3px, transparent 3px 9px);
  opacity: .55; border-radius: 3px;
}
.coureur[data-etat="gamelle"] .coureur-corps { transform: rotate(102deg) translateX(8%); transition: transform .18s; }
.coureur[data-etat="arrive"] .coureur-corps { animation: sautille .3s ease-in-out infinite alternate; }

/* ---------- Verdict ---------- */
.verdict { gap: 20px; }
.condamne { text-align: center; padding-top: 6px; }
.condamne-avatar { position: relative; width: 150px; height: 150px; margin: 0 auto 4px; animation: tombe .5s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes tombe { from { transform: translateY(-60px) scale(.6); opacity: 0; } }
.tampon {
  position: absolute; right: -52px; top: 2px;
  background: var(--tomate); border: 3px solid var(--blanc); border-radius: 12px;
  box-shadow: 0 0 0 3px var(--encre), 0 5px 0 3px var(--encre);
  padding: 2px 12px; font-size: 1.25rem; font-weight: 800;
  transform: rotate(12deg);
  animation: colle .3s .45s cubic-bezier(.3, 1.6, .5, 1) both;
}
@keyframes colle { from { transform: rotate(-8deg) scale(2.2); opacity: 0; } }
.condamne h1 { font-size: clamp(1.9rem, 9vw, 2.6rem); font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.classement { list-style: none; margin: 0; padding: 0; background: var(--blanc); border: var(--trait); border-radius: 22px; overflow: hidden; }
.classement li { display: flex; align-items: center; gap: 10px; padding: 7px 14px; }
.classement li + li { border-top: 2px dashed rgba(29, 17, 71, .18); }
.classement .dernier { background: #FFE1E1; }
.place { width: 1.4em; font-weight: 800; font-size: 1.15rem; text-align: center; }
.qui { font-weight: 800; font-size: 1.1rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention.or { background: var(--soleil); }
.mention { margin-left: auto; flex: none; background: var(--blanc); border: 2px solid var(--encre); border-radius: 10px; padding: 0 9px; font-size: .9rem; font-weight: 800; }

.sauves { text-align: center; font-size: 1.1rem; }
.sauves .ribambelle { margin-top: 10px; }
.sauves .rib { width: clamp(40px, 13vw, 60px); }
[hidden] { display: none !important; }
.bouton:disabled { opacity: .45; box-shadow: 0 2px 0 var(--encre); }

/* ---------- Socle commun des mini-jeux ---------- */
.scene { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.terrain {
  position: relative; flex: 1; min-height: 0; max-height: 620px;
  background: var(--blanc); border: var(--trait); border-radius: 22px; box-shadow: var(--ombre);
  overflow: hidden;
}
.terrain.flash { background: #FFF6C9 !important; }
.commandes { display: flex; gap: 10px; padding-bottom: 6px; }
.commandes .bouton { flex: 1; min-width: 0; padding-left: 6px; padding-right: 6px; white-space: nowrap; }
.pion { position: absolute; width: var(--taille, 48px); height: var(--taille, 48px); transform: translate(-50%, -50%); }
.grille .avatar { filter: grayscale(1) brightness(.5); }
.tour-de { display: inline-flex; align-items: center; gap: 8px; }
.tour-de .mini { width: 42px; height: 42px; }
.rideau {
  position: absolute; inset: -4px -4px -10px; z-index: 30;
  background: var(--soleil);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 16px; text-align: center;
}
.rideau-avatar { width: 130px; height: 130px; }
.rideau h2 { font-size: 1.8rem; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.rideau p { font-size: 1.1rem; margin-bottom: 10px; }

/* ---------- Le canon ---------- */
.canon .minicarte { position: relative; flex: none; height: 30px; margin: 4px 18px 0; border-bottom: 3px solid var(--encre); }
.tete { position: absolute; left: 0; bottom: -1px; width: 24px; height: 24px; translate: -50% 0; }
.canon .couloir {
  overflow: hidden; border-top: 2px solid var(--encre);
  background: #D7F0FF radial-gradient(ellipse 70% 60% at 50% 100%, #BDE6CB 99%, transparent 100%) 0 100% / 190px 62% repeat-x;
}
.sol-bande {
  position: absolute; left: 0; right: 0; bottom: 0; height: 9px; border-top: 2px solid var(--encre);
  background: repeating-linear-gradient(90deg, #1FB86E 0 26px, #17A05E 26px 52px);
}
.canon .objets { position: absolute; inset: 0; pointer-events: none; }
.canon .objet { position: absolute; left: 0; bottom: 9px; }
.canon .coureur { position: absolute; left: 0; bottom: 9px; margin: 0; }
.canon .fut { width: calc(var(--taille) * 1.15); height: calc(var(--taille) * .55); background: var(--encre); border-radius: 30% 12% 12% 30%; transform-origin: 20% 80%; }
.canon .arbre { width: calc(var(--taille) * .85); height: calc(var(--taille) * 1.2); }
.canon .arbre::before { content: ""; position: absolute; z-index: 1; left: 0; top: 0; width: 100%; aspect-ratio: 1; background: #1FB86E; border: 3px solid var(--encre); border-radius: 50%; box-sizing: border-box; }
.canon .arbre::after { content: ""; position: absolute; left: 40%; bottom: 0; width: 20%; height: 50%; background: #8A5529; border: 2px solid var(--encre); box-sizing: border-box; }
.canon .arbre.secoue-arbre { animation: tremble .08s linear 6; }
.canon .trampo { width: calc(var(--taille) * .9); height: 8px; background: var(--tomate); border: 2px solid var(--encre); border-radius: 5px; box-sizing: border-box; margin-bottom: 5px; box-shadow: -8px 5px 0 -3px var(--encre), 8px 5px 0 -3px var(--encre); }
.canon .trampo.ecrase { background: var(--soleil); }
.canon .nuage-vol { width: calc(var(--taille) * 1.5); height: calc(var(--taille) * .5); background: var(--blanc); border: 3px solid var(--encre); border-radius: 999px; box-sizing: border-box; }
.canon .nuage-vol.traverse { opacity: .4; }
.canon .oiseau { width: calc(var(--taille) * .75); height: calc(var(--taille) * .38); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 16'%3E%3Cpath d='M2 13 Q9 0 16 11 Q23 0 30 13' fill='none' stroke='%231D1147' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.canon .emporte .coureur::before { content: ""; position: absolute; left: 8%; bottom: 88%; width: 84%; height: 42%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 16'%3E%3Cpath d='M2 13 Q9 0 16 11 Q23 0 30 13' fill='none' stroke='%231D1147' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; animation: sautille .18s ease-in-out infinite alternate; }
.canon .metres { position: absolute; right: 6px; top: 3px; padding: 0 7px; background: rgba(255, 255, 255, .85); border-radius: 9px; font-weight: 800; font-size: .82rem; }
.canon .nom-couloir { opacity: .6; }

/* ---------- Le Plinko ---------- */
.piquet { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--encre); transform: translate(-50%, -50%); }
.cases { position: absolute; left: 0; right: 0; bottom: 0; height: 24%; display: grid; grid-template-columns: repeat(7, 1fr); border-top: var(--trait); }
.case { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 4px; min-width: 0; }
.case + .case { border-left: 2px dashed rgba(29, 17, 71, .3); }
.case strong { font-weight: 800; font-size: .95rem; line-height: 1.2; }
.tas { flex: 1; min-height: 0; display: flex; flex-wrap: wrap-reverse; align-content: flex-start; justify-content: center; overflow: hidden; }
.tas .mini { width: 23px; height: 23px; }
.bille { z-index: 2; transition: left .17s ease-out, top .17s cubic-bezier(.5, -0.4, .8, .6), rotate .17s; }
.bille.penche { rotate: 16deg; }
.bille:not(.penche) { rotate: -16deg; }

/* ---------- La roue ---------- */
.roue-jeu { display: grid; place-items: center; }
.roue-cadre { position: relative; width: min(90%, 54vh); aspect-ratio: 1; }
.roue { position: relative; width: 100%; height: 100%; border-radius: 50%; border: 4px solid var(--encre); }
.sur-roue { transform: translate(-50%, -50%) rotate(var(--a)); transition: scale .3s cubic-bezier(.3, 1.6, .5, 1); }
.sur-roue.designe { scale: 1.4; z-index: 2; }
.moyeu { position: absolute; left: 50%; top: 50%; width: 15%; height: 15%; translate: -50% -50%; background: var(--blanc); border: var(--trait); border-radius: 50%; }
.fleche {
  position: absolute; left: 50%; top: -14px; z-index: 3; translate: -50% 0;
  border: 15px solid transparent; border-top: 30px solid var(--encre); border-bottom: 0;
}

/* ---------- L'orage ---------- */
.terrain.orage { background: #40357A; }
.terrain.orage.flash { background: #8177D1 !important; }
.eclairs { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.eclairs polyline { fill: none; stroke: var(--soleil); stroke-width: 6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.eclairs polyline.branche { stroke-width: 3; opacity: .75; }
.nuage { position: absolute; top: 9%; left: 12%; right: 12%; z-index: 4; height: 16%; background: var(--encre); border-radius: 999px; }
.nuage span { position: absolute; bottom: 40%; background: var(--encre); border-radius: 50%; aspect-ratio: 1; }
.nuage span:nth-child(1) { left: 6%; width: 30%; }
.nuage span:nth-child(2) { left: 28%; width: 42%; }
.nuage span:nth-child(3) { right: 6%; width: 32%; }
.nuage i { position: absolute; top: 30%; width: 14px; height: 14px; background: var(--soleil); border-radius: 50%; opacity: 0; }
.nuage i:nth-of-type(1) { left: 22%; } .nuage i:nth-of-type(2) { left: 50%; top: 5%; } .nuage i:nth-of-type(3) { left: 74%; top: 45%; }
.nuage.charge { animation: gronde .09s linear infinite; filter: drop-shadow(0 0 12px #FFCB2E) drop-shadow(0 0 4px #FFCB2E); }
.nuage.charge i { animation: etincelle .22s linear infinite; }
.nuage.charge i:nth-of-type(2) { animation-delay: -.08s; } .nuage.charge i:nth-of-type(3) { animation-delay: -.15s; }
@keyframes gronde { 0%, 100% { translate: -2px 0; } 50% { translate: 2px 1px; } }
@keyframes etincelle { 0%, 100% { opacity: 0; scale: .4; } 50% { opacity: 1; scale: 1.5; } }
.herbe { position: absolute; left: 0; right: 0; bottom: 0; height: 13%; background: #2C2360; border-top: 3px solid var(--encre); }
.campeur { z-index: 2; transition: rotate .25s; }
.campeur.grille { rotate: 84deg; }
.brulure { position: absolute; z-index: 1; width: 30px; height: 11px; border-radius: 50%; background: rgba(0, 0, 0, .5); transform: translate(-50%, -50%); }

/* ---------- Le crocodile ---------- */
.terrain.croco { display: grid; place-items: center; background: #D9F5E5; }
.croc { width: min(94%, 400px); }
.machoire { position: relative; z-index: 2; }
.machoire svg { display: block; width: 100%; height: auto; overflow: visible; }
.machoire.haut { margin-bottom: -7px; }
.machoire.bas { margin-top: -7px; }
.cr-paupiere { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(.45); transition: transform .12s; }
.cr-pupille { transition: transform .2s; }
.cr-content { opacity: 0; }
.croc.cligne .cr-paupiere { transform: scaleY(2); }
.croc.louche .cr-paupiere { transform: scaleY(1.3); }
.croc.louche .cr-pupille { transform: translateY(5px); }
.gueule { display: grid; grid-template-rows: 1fr; overflow: hidden; margin: 0 16px; background: radial-gradient(ellipse 60% 40% at 50% 100%, #FF8FA3 0 98%, transparent 100%), #C2304A; border-left: var(--trait); border-right: var(--trait); transition: grid-template-rows .1s ease-in; }
.dents { min-height: 0; display: grid; grid-template-columns: repeat(var(--colonnes), 1fr); gap: 8px 9px; padding: 18px 14px 20px; align-content: center; }
.dents.attente { pointer-events: none; }
.dent { position: relative; aspect-ratio: .86; min-width: 0; padding: 0; background: var(--blanc); border: var(--trait); border-radius: 14px 14px 46% 46% / 14px 14px 62% 62%; box-shadow: 0 4px 0 var(--encre); transition: transform .1s, opacity .2s, background .2s; }
.dent::before { content: ""; position: absolute; left: 18%; top: 12%; width: 22%; height: 30%; border-radius: 999px; background: #DDF1FF; }
.dent:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 var(--encre); }
.dent.enfoncee { transform: translateY(5px) scale(.84); box-shadow: none; background: #F6C9D1; opacity: .75; }
.dent.enfoncee::before { display: none; }
.croc.ferme .cr-paupiere, .croc.ferme .cr-pupille { opacity: 0; }
.croc.ferme .cr-content { opacity: 1; }
.croc.ferme .gueule { grid-template-rows: 0fr; border-color: transparent; }
.croc.ferme .dents { padding-top: 0; padding-bottom: 0; visibility: hidden; }
.croc.ferme { animation: secousse .4s .1s; }
@keyframes secousse { 0%, 100% { translate: 0 0; } 20% { translate: -8px 3px; } 40% { translate: 7px -3px; } 60% { translate: -5px 2px; } 80% { translate: 4px 0; } }

/* ---------- Le ballon ---------- */
.terrain.ballon-jeu { display: grid; place-items: center; }
.ballon {
  --gonfle: .3;
  position: relative; width: min(74%, 46vh); aspect-ratio: .9;
  background: var(--tomate); border: 4px solid var(--encre); border-radius: 50% 50% 48% 48%;
  transform: scale(var(--gonfle)); transition: transform .28s cubic-bezier(.3, 1.7, .5, 1);
}
.ballon::after { content: ""; position: absolute; left: 50%; top: 100%; translate: -50% -2px; border: 12px solid transparent; border-bottom: 18px solid var(--encre); border-top: 0; }
.ballon .reflet { position: absolute; left: 20%; top: 14%; width: 22%; height: 14%; background: #fff; opacity: .4; border-radius: 50%; rotate: -30deg; }
.ballon.pompe-anim { animation: frisson .3s; }
@keyframes frisson { 30% { rotate: -4deg; } 70% { rotate: 4deg; } }
.boum { font-size: 4rem; font-weight: 800; color: var(--tomate); -webkit-text-stroke: 3px var(--encre); paint-order: stroke fill; rotate: -8deg; animation: colle .3s cubic-bezier(.3, 1.6, .5, 1) both; }
.compteur-pompe { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-weight: 800; opacity: .55; }

/* ---------- Le sol qui s'effondre ---------- */
.terrain.sol { display: grid; place-items: center; background: #2B1E5E; }
.dalles { display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(5, 1fr); gap: 6px; width: min(94%, 60vh); aspect-ratio: 1; }
.dalle { min-width: 0; min-height: 0; padding: 3px; background: var(--blanc); border: var(--trait); border-radius: 12px; box-shadow: 0 4px 0 #120A33; transition: transform .45s ease-in, opacity .45s ease-in; }
.dalle:not(:disabled):active { transform: translateY(3px); }
.dalle.tremble { animation: tremble .09s linear infinite; background: #FFD9D9; }
@keyframes tremble { 0%, 100% { translate: -2px 0; } 50% { translate: 2px 1px; } }
.dalle.tombee { transform: scale(.15) rotate(40deg); opacity: 0; }

/* ---------- La météorite ---------- */
.terrain.mer { display: grid; place-items: center; background: #8FD8FF; }
.ile { position: relative; width: min(97%, 62vh); aspect-ratio: 1; background: #FFE9A8; border: 4px solid var(--encre); border-radius: 50%; touch-action: manipulation; }
.habitant { z-index: 2; pointer-events: none; }
.ombre { position: absolute; z-index: 1; aspect-ratio: 1; background: var(--encre); border-radius: 50%; pointer-events: none; }
.cratere { position: absolute; aspect-ratio: 1; translate: -50% -50%; background: rgba(29, 17, 71, .2); border: 3px dashed var(--encre); border-radius: 50%; pointer-events: none; }
.caillou { position: absolute; z-index: 5; width: 34px; height: 34px; background: var(--encre); border: 3px solid var(--tomate); border-radius: 50%; pointer-events: none; }

/* ---------- La tour ---------- */
.terrain.tour-jeu { display: flex; flex-direction: column; align-items: center; padding: 6px 12px 4px; background: #BFE9FF; }
.tour { flex: 1; min-height: 0; width: min(80%, 300px); display: flex; flex-direction: column; }
.toit { align-self: center; border: 0 solid transparent; border-width: 0 60px 16px; border-bottom-color: var(--encre); }
.etage { flex: 1; min-height: 0; display: flex; align-items: center; gap: 6px; padding: 0 8px; background: #FFF6D6; border: var(--trait); margin-top: -3px; color: inherit; }
.etage:disabled { opacity: 1; }
.numero { flex: none; width: 1.5em; font-weight: 800; font-size: .95rem; line-height: 1; text-align: left; }
.palier { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
.etage.choisi { background: var(--soleil); }
.etage.detruit { background: repeating-linear-gradient(135deg, #B98A5E 0 10px, #9C6F45 10px 20px); }
.etage.detruit .numero { opacity: .5; text-decoration: line-through; }
.palier.secoue { animation: tremble .08s linear infinite; }
.pied-tour { min-height: 38px; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; padding-top: 2px; }

/* ---------- La course (piste longue, caméra, objets) ---------- */
.course-piste .paysage {
  flex: none; height: 34px; border-bottom: 3px solid var(--encre);
  background:
    radial-gradient(circle 13px at 34px 68%, #1FB86E 96%, transparent 100%),
    radial-gradient(circle 9px at 96px 80%, #17A05E 96%, transparent 100%),
    radial-gradient(ellipse 30px 9px at 150px 30%, #fff 96%, transparent 100%),
    #D7F0FF;
  background-size: 190px 100%; background-repeat: repeat-x;
}
.course-piste .couloir {
  overflow: hidden;
  background: repeating-linear-gradient(90deg, transparent 0 44px, rgba(29, 17, 71, .07) 44px 88px);
  background-position-x: var(--defile, 0);
}
.course-piste .objets { position: absolute; inset: 0; pointer-events: none; }
.course-piste .objet { position: absolute; left: 0; bottom: 14%; }
.course-piste .coureur { margin-left: 0; }
.flaque { width: calc(var(--taille) * .8); height: calc(var(--taille) * .2); background: #5CCBFF; border: 2px solid var(--encre); border-radius: 50%; box-sizing: border-box; }
.pierre { width: calc(var(--taille) * .32); height: calc(var(--taille) * .26); background: #9AA3B5; border: 2px solid var(--encre); border-radius: 45% 55% 30% 30%; box-sizing: border-box; }
.fleches { width: calc(var(--taille) * .72); height: calc(var(--taille) * .4); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 20'%3E%3Cpath d='M4 3 L13 10 L4 17 M15 3 L24 10 L15 17 M26 3 L35 10 L26 17' fill='none' stroke='%23FF8A1F' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.objet.pris { opacity: .22; }
.course-piste .arrivee { left: 0; right: auto; top: 34px; }
.course-piste .rang { right: 8px; z-index: 3; }
.couloir.largue .nom-couloir { opacity: 1; color: var(--tomate); }
.couloir.largue .nom-couloir::after { content: " à la traîne"; }

/* ---------- La tour : portes et résultat ---------- */
.etage { position: relative; }
.porte {
  display: none; position: absolute; left: 2.5em; right: 0; top: 0; bottom: 0; z-index: 2;
  background: #C98B4B; border-left: var(--trait);
  transform-origin: left center; transition: transform .45s ease-in, opacity .15s .35s;
}
.porte::after { content: ""; position: absolute; right: 10px; top: 50%; width: 8px; height: 8px; translate: 0 -50%; background: var(--encre); border-radius: 50%; }
.tour.portes .etage:not(.detruit) .porte { display: block; }
.tour.portes .etage.revele .porte { transform: perspective(500px) rotateY(-100deg); opacity: 0; }
.locataire { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.locataire b { font-size: .85rem; font-weight: 800; max-width: 6em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palier .locataire:not(:only-child) b { display: none; }
.palier .mini, .pied-tour .mini { width: var(--pm, 30px); height: var(--pm, 30px); margin: 0 -1px; }
.etage.gagnant { background: var(--soleil); }
.etage.perdant { background: #FFC9C9; }
.pied-tour { gap: 0 8px; }
.pied-tour .locataire b { font-size: .75rem; }

/* ---------- Les chaises musicales ---------- */
.terrain.chaises { display: grid; place-items: center; }
.ronde { position: relative; width: min(92%, 56vh); aspect-ratio: 1; }
.chaise { position: absolute; width: calc(var(--taille) * .66); height: calc(var(--taille) * .66); translate: -50% -50%; background: #C98B4B; border: var(--trait); border-radius: 9px 9px 4px 4px; box-shadow: 0 4px 0 var(--encre); }
.danseur { z-index: 2; }
.danseur.sans-chaise { animation: tremble .09s linear infinite; }
.danseur.sorti { opacity: 0; scale: .3; transition: opacity .3s, scale .3s; animation: none; }
.notes { display: none; position: absolute; inset: 0; pointer-events: none; }
.ronde.musique .notes { display: block; }
.notes i { position: absolute; font-style: normal; font-size: 1.7rem; font-weight: 800; animation: sautille .32s ease-in-out infinite alternate; }
.notes i:nth-child(1) { left: 2%; top: 2%; } .notes i:nth-child(2) { right: 2%; top: 4%; animation-delay: -.15s; } .notes i:nth-child(3) { left: 46%; bottom: 0; animation-delay: -.25s; }
@keyframes balance { from { rotate: -1.6deg; } to { rotate: 1.6deg; } }

/* ---------- Les bulles de savon ---------- */
.terrain.ciel-bulles {
  background:
    radial-gradient(ellipse 46px 15px at 70px 50px, #fff 96%, transparent 100%),
    radial-gradient(ellipse 34px 12px at 210px 170px, #fff 96%, transparent 100%),
    #BFE9FF;
  background-size: 290px 250px;
}
.obstacles { position: absolute; inset: 0; pointer-events: none; }
.obstacles .branche { position: absolute; left: 0; height: 16px; translate: 0 -50%; background: #8A5529; border: 3px solid var(--encre); border-left: 0; border-radius: 0 10px 10px 0; box-sizing: border-box; }
.obstacles .branche::after { content: ""; position: absolute; right: -8px; top: -15px; width: 26px; height: 18px; background: #1FB86E; border: 3px solid var(--encre); border-radius: 60% 40% 60% 40%; }
.obstacles .branche.droite { left: auto; right: 0; border-left: 3px solid var(--encre); border-right: 0; border-radius: 10px 0 0 10px; }
.obstacles .branche.droite::after { right: auto; left: -8px; }
.piaf { position: absolute; z-index: 3; width: calc(var(--taille) * .9); height: calc(var(--taille) * .45); translate: -50% -50%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 16'%3E%3Cpath d='M2 13 Q9 0 16 11 Q23 0 30 13' fill='none' stroke='%231D1147' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; animation: battement .16s ease-in-out infinite alternate; }
@keyframes battement { to { scale: 1 .55; } }
.bulleur { z-index: 2; }
.bulleur-corps { width: 100%; height: 100%; }
.en-bulle::after {
  content: ""; position: absolute; inset: -24%; border-radius: 50%; border: 3px solid #fff;
  background: radial-gradient(circle at 30% 26%, rgba(255, 255, 255, .95) 0 7%, rgba(255, 255, 255, .28) 8% 100%);
  box-shadow: 0 0 0 2px rgba(29, 17, 71, .22);
}

/* ---------- La pêche aux canards ---------- */
.terrain.foire { display: grid; place-items: center; background: repeating-linear-gradient(90deg, #FFD9D9 0 26px, #fff 26px 52px); }
.bassin { position: relative; width: min(94%, 58vh); aspect-ratio: 1; background: #5CCBFF; border: 10px solid #2F7BFF; border-radius: 50%; outline: 3px solid var(--encre); box-shadow: inset 0 0 0 3px var(--encre); }
.remous { position: absolute; inset: 24%; border: 3px dashed rgba(255, 255, 255, .65); border-radius: 50%; }
.canard-btn { position: absolute; width: var(--taille); height: calc(var(--taille) * .8); translate: -50% -50%; padding: 0; background: none; border: 0; }
.canard-btn:disabled { opacity: 1; }
.canard-btn svg { display: block; width: 100%; height: 100%; overflow: visible; }
.canard-btn.vers-gauche svg { transform: scaleX(-1); }
.plumes { fill: #FFD84D; } .aile { fill: #F2B705; } .oeil-canard { fill: var(--encre); }
.canard-btn.peche { z-index: 5; scale: 2.2; transition: left .4s ease-out, top .4s ease-out, scale .4s cubic-bezier(.3, 1.6, .5, 1); animation: tremble .1s linear infinite; }
.canard-btn.peche.bon, .canard-btn.peche.noir { animation: none; }
.canard-btn.noir .plumes { fill: #1D1147; } .canard-btn.noir .aile { fill: #40357A; } .canard-btn.noir .oeil-canard { fill: #fff; }
.canard-btn.range { opacity: 0; scale: .3; transition: opacity .3s, scale .3s; }

/* ---------- La bombe ---------- */
.terrain.bombe-jeu { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: #2B1E5E; }
.bombe { position: relative; flex: none; width: min(38%, 22vh); aspect-ratio: 1; display: grid; place-items: center; background: var(--encre); border: 4px solid #0B0620; border-radius: 50%; }
.meche { position: absolute; left: 58%; top: -18%; width: 9px; height: 24%; background: #C98B4B; border: 2px solid #0B0620; rotate: 22deg; transform-origin: 50% 100%; }
.meche::after { content: ""; position: absolute; left: 50%; top: -9px; width: 14px; height: 14px; translate: -50% 0; background: var(--soleil); border-radius: 50%; animation: etincelle .25s linear infinite; }
.cadran { padding: 2px 10px; background: #0B0620; color: #7CFF9B; border: 2px solid #7CFF9B; border-radius: 8px; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.cadran.urgent { color: var(--tomate); border-color: var(--tomate); animation: tremble .1s linear infinite; }
/* Les fils sont rangés sur deux rangées, pour rester faciles à toucher même à seize. */
.fils { display: grid; grid-template-columns: repeat(var(--colonnes), 1fr); grid-template-rows: 1fr 1fr; gap: 12px 4px; width: 94%; height: 50%; }
.fil { position: relative; min-width: 0; min-height: 0; padding: 0; background: none; border: 0; }
.fil::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 16px; translate: -50% 0; background: var(--c); border: 3px solid #0B0620; border-radius: 8px; box-sizing: border-box; }
.fil.rayures::before { background: repeating-linear-gradient(45deg, var(--c) 0 6px, var(--c2) 6px 12px); }
.fil.bandes::before { background: repeating-linear-gradient(0deg, var(--c) 0 9px, var(--c2) 9px 15px); }
.fil.pois::before { background: radial-gradient(circle, var(--c2) 2.6px, transparent 3.1px) 0 0 / 10px 13px, var(--c); }
.fil:disabled { opacity: 1; }
.fil.coupe::before { clip-path: polygon(0 0, 100% 0, 100% 38%, 0 44%, 0 62%, 100% 56%, 100% 100%, 0 100%); opacity: .4; }
.bombe-jeu .boum { position: absolute; top: 40%; }

/* ---------- Le chapeau du magicien ---------- */
.terrain.scene-magie { display: flex; flex-direction: column; background: #40357A; }
.magie { position: relative; flex: 1; min-height: 0; display: grid; place-items: end center; }
.haut-de-forme { position: relative; z-index: 2; width: min(46%, 26vh); aspect-ratio: 1.1; margin-bottom: 20px; background: var(--encre); border: 4px solid #0B0620; border-radius: 4px 4px 12px 12px; }
.haut-de-forme::before { content: ""; position: absolute; left: -20%; right: -20%; top: -9%; height: 14%; background: var(--encre); border: 4px solid #0B0620; border-radius: 999px; }
.ruban-chapeau { position: absolute; left: 0; right: 0; top: 16%; height: 15%; background: var(--tomate); }
.ruban-chapeau::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; translate: -50% -50%; background: var(--soleil); clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 96%, 50% 76%, 20% 96%, 30% 60%, 0 38%, 38% 36%); }
.magie.tape .haut-de-forme { animation: sursaut .5s; }
@keyframes sursaut { 30% { scale: 1.1 .88; } 60% { scale: .94 1.07; } }
.baguette { position: absolute; right: 13%; bottom: 44%; z-index: 4; width: 9px; height: 26%; background: var(--encre); border: 2px solid #0B0620; border-radius: 5px; rotate: 35deg; transform-origin: 50% 100%; box-sizing: border-box; }
.baguette::before { content: ""; position: absolute; left: -2px; right: -2px; top: -2px; height: 24%; background: #fff; border: 2px solid #0B0620; border-radius: 5px 5px 0 0; }
.magie.tape .baguette { animation: coup-de-baguette .45s; }
@keyframes coup-de-baguette { 45% { rotate: -20deg; } }
.lueur { position: absolute; left: 50%; bottom: 36%; width: 80%; aspect-ratio: 1; translate: -50% 30%; background: radial-gradient(circle, rgba(255, 203, 46, .55), transparent 62%); opacity: 0; transition: opacity .3s; }
.magie.montre .lueur { opacity: 1; }
.magie.crapaud .lueur { background: radial-gradient(circle, rgba(31, 184, 110, .75), transparent 62%); }
.magie .sorti { position: absolute; left: 50%; bottom: 40%; z-index: 1; width: min(42%, 22vh); aspect-ratio: 1; translate: -50% 0; opacity: 0; scale: .2; }
.magie .sorti svg, .souvenir svg { display: block; width: 100%; height: 100%; overflow: visible; }
.magie.montre .sorti { animation: jaillit .55s cubic-bezier(.3, 1.6, .5, 1) forwards, flotte 1.2s .55s ease-in-out infinite alternate; }
.magie.montre.crapaud .sorti { animation: jaillit .55s cubic-bezier(.3, 1.6, .5, 1) forwards, coasse .45s .55s ease-in-out infinite alternate; }
.magie.range .sorti { animation: range-objet .36s ease-in forwards; }
@keyframes jaillit { from { bottom: 38%; opacity: 0; scale: .2; rotate: -30deg; } to { bottom: 60%; opacity: 1; scale: 1; rotate: 0deg; } }
@keyframes flotte { from { translate: -50% 0; rotate: -4deg; } to { translate: -50% -10px; rotate: 4deg; } }
@keyframes coasse { from { scale: 1; } to { scale: 1.14 1.06; } }
@keyframes range-objet { from { bottom: 60%; opacity: 1; scale: 1; } to { bottom: 4%; opacity: 0; scale: .2; } }
.etincelles { position: absolute; left: 50%; bottom: 56%; z-index: 3; width: 0; height: 0; }
.etincelles i { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; background: var(--soleil); rotate: var(--a); opacity: 0; clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 96%, 50% 76%, 20% 96%, 30% 60%, 0 38%, 38% 36%); }
.magie.montre .etincelles i { animation: eclat .75s ease-out; }
.magie.crapaud .etincelles i { background: #7CFF9B; }
@keyframes eclat { from { transform: translateY(0) scale(.4); opacity: 1; } to { transform: translateY(-120px) scale(1.3); opacity: 0; } }
.etal { flex: none; min-height: 42px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; padding: 4px; background: #2C2360; border-top: 3px solid var(--encre); }
.souvenir { width: 32px; height: 32px; }


/* ---------- Le pont ---------- */
.terrain.lagon { display: flex; flex-direction: column; background: #5CCBFF; }
.rang-ilots { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 13%; }
.rang-ilots.sommet { flex: 1.25; background: #1FB86E; border-bottom: var(--trait); }
.rang-ilots.plage { flex: 1.15; background: #FFE9A8; border-top: var(--trait); }
.sable { width: 8px; height: 8px; }
.scores { position: absolute; left: 4px; top: 50%; translate: 0 -50%; max-width: 25%; display: flex; flex-wrap: wrap; }
.scores .mini { width: 22px; height: 22px; margin: -1px; }
.ilot { height: 82%; max-width: 27%; aspect-ratio: 1.3; padding: 0; background: #FFE9A8; border: var(--trait); border-radius: 50%; box-shadow: 0 4px 0 #2F7BFF; transition: transform .4s ease-in, opacity .4s ease-in; }
.ilot:disabled { opacity: 1; }
.ilot.prochain { background: var(--soleil); animation: sautille .45s ease-in-out infinite alternate; }
.ilot.solide { background: #BDE6CB; }
.ilot.coule { transform: translateY(40%) scale(.4); opacity: 0; }
.coffre { position: relative; width: 56px; height: 40px; background: #C98B4B; border: var(--trait); border-radius: 10px 10px 4px 4px; box-sizing: border-box; }
.coffre::before { content: ""; position: absolute; left: 0; right: 0; top: 38%; height: 3px; background: var(--encre); }
.coffre i { position: absolute; left: 50%; top: 38%; width: 11px; height: 13px; translate: -50% -35%; background: var(--soleil); border: 2px solid var(--encre); border-radius: 3px; }
.coffre.ouvert { background: var(--soleil); animation: sautille .2s ease-in-out infinite alternate; }
.lagon .marcheur { z-index: 4; transition: left .3s ease-out, top .3s cubic-bezier(.3, -0.5, .6, 1); }
.marcheur.chute { animation: chute .7s ease-in forwards; }
@keyframes chute { to { scale: .15; rotate: 220deg; opacity: 0; } }

/* ---------- La courte paille ---------- */
.terrain.tirage { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.vies { position: absolute; left: 6px; right: 6px; top: 6px; z-index: 3; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; }
.vie-joueur { display: inline-flex; align-items: center; gap: 2px; padding: 0 6px 0 2px; border: 2px solid transparent; border-radius: 999px; }
.vie-joueur .mini { width: 28px; height: 28px; }
.coeurs i { font-style: normal; font-size: 1rem; line-height: 1; color: var(--tomate); }
.coeurs i.perdue { color: rgba(29, 17, 71, .18); }
.vie-joueur.touche { border-color: var(--tomate); animation: tremble .08s linear 8; }
.botte { position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: center; gap: 6px; width: 90%; height: 54%; margin-bottom: -22px; }
.paille { position: relative; flex: 1; min-width: 0; max-width: 46px; height: 100%; padding: 0; background: none; border: 0; }
.paille:disabled { opacity: 1; }
.tige { position: absolute; left: 50%; bottom: 0; width: 15px; height: 46%; translate: -50% 0; background: #FFE27A; border: 3px solid var(--encre); border-radius: 7px; box-sizing: border-box; transition: height .45s cubic-bezier(.3, 1.4, .5, 1), bottom .45s cubic-bezier(.3, 1.4, .5, 1); }
.paille.longue .tige { bottom: 22%; height: 66%; }
.paille.courte .tige { bottom: 30%; height: 26%; background: var(--tomate); }
.paille .mini { position: absolute; left: 50%; top: 12%; width: 32px; height: 32px; translate: -50% -100%; }
.paille.courte .mini { top: 44%; }
.poing { position: relative; z-index: 2; flex: none; width: min(82%, 340px); height: 22%; background: #FFB199; border: var(--trait); border-bottom: 0; border-radius: 44px 44px 0 0; }

/* ---------- Les cachettes ---------- */
.terrain.jardin {
  background:
    radial-gradient(ellipse 9px 5px at 30px 26px, #8FD3A6 96%, transparent 100%),
    radial-gradient(ellipse 7px 4px at 86px 70px, #8FD3A6 96%, transparent 100%),
    #BDE6CB;
  background-size: 120px 100px;
}
.sentier { position: absolute; left: 34%; right: 34%; top: 8%; bottom: 8%; background: #F3E3B5; border: 3px dashed rgba(29, 17, 71, .25); border-radius: 999px; }
.cachette { position: absolute; z-index: 2; width: 29%; aspect-ratio: 1; translate: -50% -50%; padding: 0; background: none; border: 0; }
.cachette:disabled { opacity: 1; }
.cachette svg { position: relative; z-index: 1; display: block; width: 100%; height: 100%; overflow: visible; }
.cachette.choisi svg { filter: drop-shadow(0 0 0 var(--soleil)) drop-shadow(0 0 6px var(--soleil)) drop-shadow(0 0 6px var(--soleil)); }
.cachette.fouille svg { animation: tremble .09s linear infinite; }
.cachette.vide svg { opacity: .55; }
/* Les bonshommes dépassent derrière la cachette, puis en sortent d'un bond. */
.curieux { position: absolute; left: -10%; right: -10%; bottom: 52%; z-index: 0; display: flex; justify-content: center; transition: bottom .35s cubic-bezier(.3, 1.9, .5, 1), scale .35s; }
.curieux .mini { width: 44%; height: auto; aspect-ratio: 1; margin: 0 -7%; }
.cachette.debusque .curieux { bottom: 86%; z-index: 2; scale: 1.15; }
.cachette.pris .curieux .mini { animation: tremble .09s linear 10; }
.chien { position: absolute; left: 50%; top: 50%; z-index: 4; width: 27%; aspect-ratio: 1.3; translate: -50% -50%; pointer-events: none; transition: left 1s linear, top 1s linear; }
.chien svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chien.vers-gauche svg { transform: scaleX(-1); }
.chien .queue { transform-origin: 26px 56px; animation: remue .22s ease-in-out infinite alternate; }
@keyframes remue { from { rotate: -14deg; } to { rotate: 16deg; } }
.chien .oreille { transform-origin: 80px 20px; transition: rotate .15s; }
.chien.marche svg { animation: trottine .2s ease-in-out infinite alternate; }
@keyframes trottine { to { translate: 0 -4px; } }
.chien.marche .patte.a { animation: foulee-chien .2s ease-in-out infinite alternate; }
.chien.marche .patte.b { animation: foulee-chien .2s ease-in-out infinite alternate-reverse; }
@keyframes foulee-chien { from { translate: -3px 0; } to { translate: 3px -3px; } }
.chien.renifle .tete-chien { transform-origin: 78px 54px; animation: flaire .28s ease-in-out infinite alternate; }
@keyframes flaire { from { rotate: 6deg; } to { rotate: 22deg; } }
.chien.aboie svg { animation: jappe .22s ease-in-out infinite alternate; }
.chien.aboie .oreille { rotate: -30deg; }
@keyframes jappe { to { translate: 0 -9px; } }
.ouaf { display: none; position: absolute; left: 50%; bottom: 96%; translate: -50% 0; padding: 2px 9px; background: var(--blanc); border: var(--trait); border-radius: 12px; font-size: .9rem; font-weight: 800; white-space: nowrap; }
.chien.aboie .ouaf { display: block; }
.emoji { font-size: 2.5rem; line-height: 1.15; }
.trouves { display: flex; flex-wrap: wrap; justify-content: center; min-height: 30px; }
.trouves .mini { width: 30px; height: 30px; }

/* ---------- Le pari risqué ---------- */
.terrain.echelles { display: flex; justify-content: space-evenly; padding: 4px 4px 6px 24px; }
.colonne-echelle { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; padding-top: 2.3em; border-radius: 12px; }
.colonne-echelle.moi { background: rgba(255, 203, 46, .4); }
.colonne-echelle .mise { position: absolute; top: 2px; left: 50%; translate: -50% 0; }
.mise { flex: none; min-width: 2em; height: 2em; display: grid; place-items: center; padding: 0 3px; background: var(--soleil); border: var(--trait); border-radius: 999px; font-weight: 800; font-size: .9rem; box-sizing: border-box; }
.bloque .mise { background: var(--tomate); }
.avance .mise { background: #9BE8B8; }
.echelle { position: relative; flex: 1; min-height: 0; width: min(30px, 62%); margin-top: calc(var(--taille) * .75); border-left: 4px solid #C98B4B; border-right: 4px solid #C98B4B; }
.echelle i { position: absolute; left: 0; right: 0; height: 4px; translate: 0 50%; background: #C98B4B; }
.echelle i.repere { background: var(--encre); }
.colonne-echelle:first-child .repere::after { content: attr(data-n); position: absolute; right: calc(100% + 8px); top: 50%; translate: 0 -50%; font-style: normal; font-size: .72rem; font-weight: 800; }
.fanion { position: absolute; left: 50%; bottom: 100%; width: 3px; height: calc(var(--taille) * .55); translate: -50% 0; background: var(--encre); }
.fanion::after { content: ""; position: absolute; left: 3px; top: 0; border: 6px solid transparent; border-left: 11px solid var(--tomate); border-right: 0; }
.grimpeur { position: absolute; left: 50%; bottom: 0; z-index: 2; width: var(--taille); height: var(--taille); translate: -50% 30%; transition: bottom .9s cubic-bezier(.3, 1.3, .5, 1); }
.reste { min-width: 1.9em; margin-top: calc(var(--taille) * .38); background: var(--blanc); border: 2px solid var(--encre); border-radius: 8px; font-size: .82rem; font-weight: 800; line-height: 1.4; text-align: center; }
.mise-bouton { font-size: 1.4rem; }

/* ---------- La graine magique ---------- */
.terrain.serre { background: #BFE9FF; }
.nuage-pluie { position: absolute; left: 8%; right: 8%; top: -34%; z-index: 3; height: 11%; background: #fff; border-radius: 999px; filter: drop-shadow(3px 0 0 #1D1147) drop-shadow(-3px 0 0 #1D1147) drop-shadow(0 3px 0 #1D1147) drop-shadow(0 -3px 0 #1D1147); transition: top .8s cubic-bezier(.3, 1.3, .5, 1); }
.nuage-pluie span { position: absolute; bottom: 40%; background: #fff; border-radius: 50%; aspect-ratio: 1; }
.nuage-pluie span:nth-child(1) { left: 8%; width: 26%; } .nuage-pluie span:nth-child(2) { left: 30%; width: 38%; } .nuage-pluie span:nth-child(3) { right: 8%; width: 28%; }
.il-pleut .nuage-pluie { top: 8%; }
.pluie { position: absolute; inset: 17% 5% 60px; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .5s;
  background-image: radial-gradient(ellipse 2px 7px at 50% 50%, #2F7BFF 96%, transparent 100%), radial-gradient(ellipse 2px 7px at 50% 50%, #2F7BFF 96%, transparent 100%);
  background-size: 26px 36px; background-position: 0 0, 13px 18px; animation: averse .32s linear infinite; }
@keyframes averse { to { background-position: 0 36px, 13px 54px; } }
.il-pleut .pluie { opacity: .9; }
.pots { display: flex; align-items: flex-end; gap: 6px; width: 100%; height: 100%; padding: 8px 8px 4px; }
.pot { --pousse: 0; flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 0; background: none; color: inherit; border: 0; }
.pot:disabled { opacity: 1; }
.plante { position: relative; flex: 1; min-height: 0; width: 100%; }
.pousse { position: absolute; left: 50%; bottom: 0; width: 9px; height: calc(var(--pousse) * 80%); translate: -50% 0; background: #1FB86E; border: 2px solid var(--encre); border-bottom: 0; border-radius: 5px 5px 0 0; box-sizing: border-box; opacity: calc(var(--pousse) * 60); transform-origin: 50% 100%; animation: balance 1.5s ease-in-out infinite alternate; }
.pot:nth-child(2n) .pousse { animation-delay: -.7s; }
.feuille { position: absolute; bottom: 26%; width: 17px; height: 10px; background: #1FB86E; border: 2px solid var(--encre); box-sizing: border-box; scale: 0; transition: scale .4s cubic-bezier(.3, 1.7, .5, 1); }
.feuille.g { right: 100%; border-radius: 80% 0 80% 0; transform-origin: 100% 100%; }
.feuille.d { left: 100%; bottom: 46%; border-radius: 0 80% 0 80%; transform-origin: 0 100%; }
.feuille.haut { bottom: 66%; }
.feuillu .feuille.g:not(.haut), .feuillu .feuille.d { scale: 1; }
.grand .feuille.haut { scale: 1; }
.bourgeon { position: absolute; left: 50%; bottom: 100%; width: 16px; height: 18px; translate: -50% 45%; background: #17A05E; border: 2px solid var(--encre); border-radius: 50% 50% 45% 45%; box-sizing: border-box; }
.eclose .bourgeon { display: none; }
.fleur { position: absolute; left: 50%; bottom: 100%; z-index: 1; width: 42px; height: 42px; translate: -50% 45%; scale: 0; transition: scale .45s cubic-bezier(.3, 1.8, .5, 1); }
.fleur svg { display: block; width: 100%; height: 100%; overflow: visible; }
.eclose .fleur { scale: 1; }
.pot.gagnant .fleur { scale: 1.3; }
.terre { position: relative; flex: none; width: 84%; height: 48px; margin-top: 3px; border: var(--trait); border-radius: 4px 4px 16px 16px; box-sizing: border-box; }
.terre::before { content: ""; position: absolute; left: -11%; right: -11%; top: -6px; height: 13px; background: inherit; border: var(--trait); border-radius: 6px; box-sizing: border-box; }
.terre.rayures { background: repeating-linear-gradient(0deg, #E0733A 0 8px, #F7B07A 8px 14px); }
.terre.pois { background: radial-gradient(circle, #fff 3px, transparent 3.6px) 0 0 / 14px 14px, #2F7BFF; }
.terre.biais { background: repeating-linear-gradient(45deg, #FF6FB5 0 7px, #FFC1DE 7px 14px); }
.terre.carreaux { background: conic-gradient(#12C4C4 25%, #A8EDED 0 50%, #12C4C4 0 75%, #A8EDED 0) 0 0 / 16px 16px; }
.terre.vagues { background: repeating-radial-gradient(circle at 50% 130%, #9B5DE5 0 6px, #C9A7F2 6px 12px); }
.pot.choisi .terre { outline: 4px solid var(--encre); outline-offset: 4px; }
.pot.gagnant .terre { box-shadow: 0 0 0 5px var(--soleil); }
.pot.perdant .terre { box-shadow: 0 0 0 5px var(--tomate); }
.pot .trouves { min-height: 34px; }
.pot .trouves .mini { width: 28px; height: 28px; margin: 0 -2px; }

/* ---------- Kikoné : défis de coup d'œil ---------- */
.scores-kikone { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; margin-top: -4px; }
.score-joueur { display: inline-flex; align-items: center; gap: 2px; padding: 1px 8px 1px 2px; background: rgba(255, 255, 255, .55); border: 2px solid transparent; border-radius: 999px; font-weight: 800; font-size: .9rem; }
.score-joueur .mini { width: 26px; height: 26px; }
.score-joueur.actif { background: var(--blanc); border-color: var(--encre); }
.terrain.kikone { background: var(--blanc); touch-action: none; user-select: none; -webkit-user-select: none; }
.terrain.kikone > svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.zone-tactile { cursor: pointer; }
.resultat-kikone { display: inline-flex; align-items: center; gap: 10px; text-align: left; font-size: 1.2rem; line-height: 1.15; }
.resultat-kikone .mini { flex: none; width: 46px; height: 46px; }
.resultat-kikone b { font-size: 1.6rem; }
.resultat-kikone small { display: block; font-size: .9rem; font-weight: 700; opacity: .85; }
.consigne-geante { position: absolute; left: 0; right: 0; top: 10px; z-index: 2; text-align: center; font-size: 2.6rem; font-weight: 800; line-height: 1; pointer-events: none; }
.fraction-geante { display: flex; flex-direction: column; align-items: center; top: 14%; font-size: 2.4rem; }
.fraction-geante i { width: 1.4em; height: 5px; margin: 4px 0; background: var(--encre); border-radius: 3px; }
.fraction-geante sup, .fraction-geante sub { font-size: 1em; line-height: 1; vertical-align: baseline; }
.regle-fraction text { font-family: var(--police); font-size: 22px; font-weight: 800; fill: var(--encre); }
.cadran-angle .poignee { filter: drop-shadow(0 3px 0 #1D1147); }
/* Les points : visibles 4 secondes, puis cachés derrière un voile pendant la réponse. */
.kikone .nuage-points { visibility: hidden; }
.kikone.montre .nuage-points, .kikone.revele .nuage-points { visibility: visible; }
.voile { position: absolute; inset: 0; z-index: 1; display: none; place-items: center; background: repeating-linear-gradient(45deg, #FFF6D6 0 18px, #FFEBA8 18px 36px); font-size: 5rem; font-weight: 800; color: rgba(29, 17, 71, .25); }
.kikone.cache .voile { display: grid; }
.chrono-barre { position: absolute; left: 0; top: 0; z-index: 2; height: 8px; width: 100%; background: var(--tomate); transform-origin: left; transform: scaleX(0); }
.kikone.montre .chrono-barre { animation: chrono 4s linear forwards; }
@keyframes chrono { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.champ-tir { background: #D7F0FF; }
.trace.suite { opacity: .35; }
.commandes .saisie { flex: 1; min-width: 0; padding: 12px 14px; background: var(--blanc); border: var(--trait); border-radius: 16px; font-size: 1.4rem; font-weight: 800; text-align: center; }
.commandes .saisie::placeholder { color: rgba(29, 17, 71, .4); }
.commandes .saisie + .bouton { flex: none; width: auto; padding-left: 22px; padding-right: 22px; }

/* ---------- Kikoné : torchon commun (bocal, Kim) ---------- */
.torchon {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: conic-gradient(#FF4D4D 25%, #fff 0 50%, #FF4D4D 0 75%, #fff 0) 0 0 / 44px 44px;
  border-bottom: 6px solid var(--encre);
  transform: translateY(-102%); transition: transform .45s cubic-bezier(.5, 0, .3, 1.3);
}
.couvert .torchon { transform: none; }

/* ---------- Le bocal à bonbons ---------- */
.terrain.bocal-jeu { display: grid; place-items: center; background: #FFF6D6; }
.terrain.kikone.bocal-jeu > .bocal { position: static; inset: auto; }
.bocal { display: block; width: auto; height: 94%; max-width: 96%; }
.terrain.kikone > .bocal { position: static; width: auto; height: 94%; max-width: 96%; }

/* ---------- Le chrono à l'aveugle ---------- */
.chrono-cadre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.terrain.kikone .chrono-cadre svg.chrono { position: static; width: min(78%, 40vh); height: auto; }
.chrono .nuage-chrono { visibility: hidden; }
.chrono .nuage-chrono text { font-family: var(--police); font-size: 48px; font-weight: 800; fill: #fff; }
.chrono-cache .chrono .nuage-chrono { visibility: visible; }
.chrono-cache .chrono .aiguille-chrono { visibility: hidden; }
.objectif-chrono { margin: 0; font-size: 1.15rem; font-weight: 700; }
.objectif-chrono b { font-size: 1.6rem; font-weight: 800; color: var(--tomate); font-variant-numeric: tabular-nums; }
.affichage-chrono { margin: 0; padding: 2px 18px; background: var(--encre); color: #7CFF9B; border-radius: 12px; font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.chrono-cache .affichage-chrono { color: transparent; text-shadow: 0 0 0 transparent; }
.chrono-cache .affichage-chrono::before { content: "?,??"; position: absolute; color: #7CFF9B; }
.affichage-chrono { position: relative; }
.bouton-stop { font-size: 1.6rem !important; letter-spacing: .02em; }

/* ---------- Le plateau de Kim ---------- */
.terrain.kim-jeu { display: grid; place-items: center; background: #FFF6D6; }
.plateau-kim { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); gap: 6px; width: min(94%, 56vh); aspect-ratio: 4 / 3.2; padding: 10px; background: #C98B4B; border: var(--trait); border-radius: 18px; box-shadow: inset 0 0 0 5px #E8B86D; }
.case-kim { min-width: 0; min-height: 0; display: grid; place-items: center; background: #FFF6D6; border: 2px solid rgba(29, 17, 71, .35); border-radius: 10px; }
.case-kim svg { width: 86%; height: 86%; overflow: visible; }
.case-kim.revenu { background: #9BE8B8; animation: sautille .3s ease-in-out 4 alternate; }
.commandes .choix-images { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.commandes .choix-images.six { grid-template-columns: repeat(6, 1fr); gap: 5px; }
.commandes .choix-images.trois { grid-template-columns: repeat(3, 1fr); }
.choix-image { min-width: 0; aspect-ratio: 1; padding: 6px; display: grid; place-items: center; background: var(--blanc); border: var(--trait); border-radius: 16px; box-shadow: 0 4px 0 var(--encre); }
.choix-image svg { width: 100%; height: 100%; overflow: visible; }
.choix-image:disabled { opacity: 1; }
.choix-image:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--encre); }
.choix-image.avec-nom { aspect-ratio: auto; grid-template-rows: 1fr auto; padding: 6px 4px 4px; height: 112px; }
.choix-image.avec-nom svg { height: 70px; }
.choix-image b { font-size: .95rem; font-weight: 800; line-height: 1.1; }
.choix-image.bon { background: #9BE8B8; }
.choix-image.faux { background: #FFB3B3; }

/* ---------- Les ombres chinoises ---------- */
.terrain.ombres-jeu { background: #2B1E5E; }
.drap { position: absolute; inset: 0; overflow: hidden; background: #3A2C70; transition: background .4s; }
.drap.allume, .drap.devoile { background: radial-gradient(circle at 50% 46%, #FFF8D9 0 30%, #FFE7A0 55%, #F2B705 100%); }
.drap.eteint { background: radial-gradient(circle at 50% 46%, #6A5BA8 0 30%, #3A2C70 80%); }
.lampe { position: absolute; left: 50%; top: -14px; width: 60px; height: 28px; translate: -50% 0; background: var(--encre); border-radius: 0 0 30px 30px; }
.silhouette {
  position: absolute; left: 50%; top: 48%; width: min(74%, 42vh); aspect-ratio: 1;
  translate: -50% -50%; opacity: 0;
  transform: scale(var(--zoom, 1)) translate(var(--ox, 0), var(--oy, 0));
  filter: brightness(0); transition: opacity .35s, filter .5s, transform .6s cubic-bezier(.3, 1.4, .5, 1);
}
.silhouette svg { width: 100%; height: 100%; overflow: visible; }
.drap.allume .silhouette { opacity: 1; }
.drap.eteint .silhouette { opacity: 0; }
.drap.devoile .silhouette { opacity: 1; filter: none; transform: none; }
.rideau-g, .rideau-d { position: absolute; top: 0; bottom: 0; width: 9%; background: repeating-linear-gradient(90deg, #C9283D 0 10px, #A81E31 10px 20px); border: 3px solid var(--encre); }
.rideau-g { left: -3px; border-radius: 0 0 40px 0; }
.rideau-d { right: -3px; border-radius: 0 0 0 40px; }

/* ---------- La carte ---------- */
.carte-svg { background: #F3E3B5; }
.titre-carte { font-family: var(--police); font-size: 18px; font-weight: 800; fill: var(--encre); opacity: .7; }
.carte-svg .etiquette text { font-family: var(--police); font-size: 16px; font-weight: 800; fill: var(--encre); }

/* ---------- Le métronome ---------- */
.mt-cadre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(circle at 50% 45%, #FFF6D6 0, #FFE9C2 70%); }
.mt-lampes, .mt-ronds { display: flex; gap: 10px; }
.mt-lampes i { width: 22px; height: 22px; background: var(--blanc); border: var(--trait); border-radius: 50%; transition: background .1s; }
.mt-lampes i.allumee { background: #FFD84D; box-shadow: 0 0 0 4px rgba(255, 216, 77, .45); }
.mt-cadre.muet .mt-lampes { opacity: .35; }
.mt-ronds { gap: 8px; visibility: hidden; }
.mt-cadre.muet .mt-ronds { visibility: visible; }
.mt-ronds i { width: 20px; height: 20px; background: var(--blanc); border: var(--trait); border-radius: 50%; }
.mt-ronds i.plein { background: var(--c); animation: rk-pop .25s cubic-bezier(.3, 1.6, .5, 1); }
.mt-tambour { width: min(76%, 40vh); cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; transform-origin: 50% 80%; }
.mt-tambour svg { display: block; width: 100%; height: auto; overflow: visible; pointer-events: none; }
.mt-tambour.pulse { animation: mt-pulse .18s ease-out; }
@keyframes mt-pulse { 40% { scale: 1.08; } }
.mt-tambour.frappe { animation: mt-frappe .12s ease-out; }
@keyframes mt-frappe { 40% { scale: 1.04 .93; } }
.mt-tambour.pulse.frappe { animation: mt-pulse .18s ease-out, mt-frappe .12s ease-out; }
.mt-bilan { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 12px; background: #FFF6D6; }
.mt-bilan h3 { margin: 0; font-size: 1.2rem; font-weight: 800; }
.mt-frise { width: 100%; height: auto; overflow: visible; }
.mt-legende { font-family: var(--police); font-size: 11px; font-weight: 800; fill: var(--encre); opacity: .7; }
.mt-cles { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin: 0; font-size: .8rem; font-weight: 700; }
.mt-cles span { display: inline-flex; align-items: center; gap: 4px; }
.mt-cles i { width: 13px; height: 13px; border: 3px solid; border-radius: 50%; }
.mt-cles i.g { width: 4px; height: 16px; border: 0; border-radius: 2px; background: #B9B4CC; }

/* ---------- La fondue ---------- */
.fd-cadre { position: absolute; inset: 0; display: flex; flex-direction: column; background: radial-gradient(circle at 50% 60%, #FFF1D6 0, #F6D9B0 75%); }
.fd-haut { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px 0; }
.fd-jauge { position: relative; flex: 1; height: 26px; overflow: hidden; background: var(--blanc); border: var(--trait); border-radius: 999px; }
.fd-plein { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: repeating-linear-gradient(45deg, #FFD84D 0 10px, #FFE27A 10px 20px); border-right: 3px solid var(--encre); transition: width .6s cubic-bezier(.3, 1.4, .5, 1); }
.fd-jauge b { position: relative; display: block; text-align: center; font-size: .85rem; font-weight: 800; line-height: 20px; }
.fd-essais { display: flex; gap: 5px; }
.fd-essais i { width: 20px; height: 20px; background: #E9B36A; border: var(--trait); border-radius: 5px; opacity: .35; }
.fd-essais i.actif { opacity: 1; }
.fd-essais i.sorti { opacity: 1; background: #FFD84D; border-radius: 50%; }
.fd-essais i.plouf { opacity: 1; background: #5CCBFF; border-radius: 50% 50% 50% 0; rotate: -45deg; }
.fd-scene { flex: 1; min-height: 0; width: 100%; display: block; overflow: visible; cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.terrain.kikone .fd-cadre > svg.fd-scene { position: static; height: auto; }
.fd-flamme { transform-box: fill-box; transform-origin: 50% 100%; animation: fd-flamme .3s ease-in-out infinite alternate; }
@keyframes fd-flamme { to { scale: .9 1.12; } }
.fd-bulle { transform-box: fill-box; transform-origin: center; animation: fd-bulle 1.6s ease-in-out infinite; }
.fd-bulle.b2 { animation-delay: -.6s; } .fd-bulle.b3 { animation-delay: -1.1s; }
@keyframes fd-bulle { 0%, 100% { scale: .3; opacity: 0; } 50% { scale: 1.1; opacity: 1; } }
.fd-goutte { opacity: 0; transform-box: fill-box; transform-origin: center; }
.gicle .fd-goutte { animation: fd-gicle .8s cubic-bezier(.2, .7, .4, 1) forwards; }
@keyframes fd-gicle { 0% { opacity: 1; transform: rotate(var(--a)) translateX(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)); } }
.fd-plouf { position: absolute; left: 50%; top: 42%; z-index: 3; translate: -50% -50%; font-size: 4.2rem; font-weight: 800; line-height: 1; color: #5CCBFF; -webkit-text-stroke: 3px var(--encre); paint-order: stroke fill; text-shadow: 0 6px 0 var(--encre); white-space: nowrap; opacity: 0; scale: .3; pointer-events: none; }
.fd-plouf.visible { animation: fd-plouf 1.6s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes fd-plouf { 0% { opacity: 0; scale: .3; rotate: -12deg; } 20% { opacity: 1; scale: 1.15; rotate: 4deg; } 35% { scale: 1; rotate: -3deg; } 85% { opacity: 1; } 100% { opacity: 0; scale: 1; } }
.fd-recap { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 3; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; background: var(--blanc); border: var(--trait); border-radius: 16px; box-shadow: 0 4px 0 var(--encre); animation: rk-pop .4s cubic-bezier(.3, 1.6, .5, 1); }
.fd-recap p { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.fd-recap p b { flex: none; display: grid; place-items: center; width: 20px; height: 20px; font-size: .75rem; background: #FFD84D; border: 2px solid var(--encre); border-radius: 50%; }
.fd-recap p.ko b { background: #5CCBFF; }
.fd-barre { flex: 1; height: 12px; overflow: hidden; background: #F2DCC6; border: 2px solid var(--encre); border-radius: 999px; }
.fd-barre i { display: block; height: 100%; background: #FFD84D; }

/* ---------- Yakombien ? ---------- */
.terrain.yakombien { background: #fff; }
.yk-scene { position: absolute; inset: 0; overflow: hidden; }
.yk-scene[data-niveau="F"] { background: linear-gradient(#BFE9FF 0 62%, #BDE6CB 62%); }
.yk-scene[data-niveau="M"] {
  background:
    linear-gradient(90deg, transparent 11%, #FF8FA3 11%, #FF8FA3 calc(11% + 3px), transparent calc(11% + 3px)),
    repeating-linear-gradient(transparent 0 26px, #A9D3F5 26px 28px), #FFFDF4;
}
.yk-scene[data-niveau="D"] { background: #2F5D50; box-shadow: inset 0 0 0 7px #8A5529, inset 0 0 0 10px #1D1147; }
.yk-scene[data-niveau="H"] {
  background:
    radial-gradient(circle 1.3px, #fff 96%, transparent 100%) 0 0 / 37px 43px,
    radial-gradient(circle 1px, #FFE27A 96%, transparent 100%) 18px 22px / 53px 47px,
    linear-gradient(rgba(92, 203, 255, .1) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(92, 203, 255, .1) 1px, transparent 1px) 0 0 / 24px 24px,
    #14114A;
}
.yk-scene[data-niveau="G"] { background: radial-gradient(circle at 50% 115%, #FF8A1F 0, #B3202B 32%, #4A0A12 62%, #1A0306 100%); }

.yk-deco { position: absolute; z-index: 1; display: block; opacity: 0; transform: rotate(var(--r)) scale(.2) translateY(30px); transition: opacity .35s, transform .55s cubic-bezier(.3, 1.6, .5, 1); transition-delay: calc(var(--i) * 80ms); pointer-events: none; }
.yk-scene.entree .yk-deco { opacity: 1; transform: rotate(var(--r)) scale(1); }
.yk-deco svg { display: block; width: 100%; height: auto; overflow: visible; }
.yk-craie { display: block; white-space: nowrap; color: rgba(255, 255, 255, .85); font-size: 1.35rem; font-weight: 700; font-style: italic; }
.yk-craie.petit { font-size: 1rem; }
.yk-bulle { animation: yk-bulle 1.4s ease-in infinite; transform-box: fill-box; }
.yk-bulle.b2 { animation-delay: -.5s; } .yk-bulle.b3 { animation-delay: -.9s; }
@keyframes yk-bulle { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-28px); opacity: 0; } }
.yk-tourne { transform-box: view-box; transform-origin: 50px 50px; animation: yk-tourne 6s linear infinite; }
@keyframes yk-tourne { to { transform: rotate(360deg); } }
.yk-scintille { animation: yk-scintille 1.3s ease-in-out infinite alternate; }
@keyframes yk-scintille { from { opacity: .35; } to { opacity: 1; } }
.yk-flamme { transform-box: fill-box; transform-origin: 50% 100%; animation: yk-flamme .45s ease-in-out infinite alternate; }
.yk-flamme.f2 { animation-duration: .35s; animation-delay: -.2s; }
@keyframes yk-flamme { from { transform: scaleY(.9) skewX(-2deg); } to { transform: scaleY(1.08) skewX(2deg); } }
.yk-braise { position: absolute; bottom: -10px; z-index: 1; width: 6px; height: 6px; border-radius: 50%; background: #FFD84D; box-shadow: 0 0 6px #FF8A1F; animation: yk-braise 3s linear infinite; }
@keyframes yk-braise { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-460px) translateX(20px); opacity: 0; } }

/* La carte centrale : d'abord le nom du niveau en grand, puis la question, puis la réponse. */
.yk-carte {
  position: absolute; left: 6%; right: 6%; top: 21%; bottom: 23%; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 8px;
  padding: 14px 16px; overflow-y: auto; text-align: center;
  background: #fff; border: var(--trait); border-radius: 22px; box-shadow: var(--ombre);
  transform: scale(.3); opacity: 0; transition: transform .5s cubic-bezier(.3, 1.6, .5, 1) .25s, opacity .3s .25s;
}
.yk-scene.entree .yk-carte { transform: none; opacity: 1; }
.yk-carte > * { max-width: 100%; flex: none; }
.yk-carte.etat-solution { top: 4%; bottom: 4%; transition: top .35s, bottom .35s; }
.yk-niveau { font-size: 2.5rem; font-weight: 800; line-height: 1; transition: font-size .35s, padding .35s; }
.yk-pour { font-size: 1.05rem; font-weight: 700; }
.yk-theme, .yk-question, .yk-apercu, .yk-solution { display: none; }
.yk-scene .yk-carte.etat-question .yk-niveau, .yk-scene .yk-carte.etat-solution .yk-niveau { font-size: .95rem; padding: 3px 12px; border-radius: 999px; color: #fff !important; background: var(--niv); animation: none !important; }
.etat-question .yk-pour, .etat-solution .yk-pour { display: none; }
.etat-question .yk-theme, .etat-solution .yk-theme { display: block; font-size: .85rem; font-weight: 800; opacity: .6; }
.etat-question .yk-question { display: block; margin: 0; font-size: 1.35rem; font-weight: 800; line-height: 1.25; animation: yk-apparait .4s ease-out; }
@keyframes yk-apparait { from { opacity: 0; transform: translateY(8px); } }
.etat-question .yk-apercu { display: block; margin: 0; min-height: 1.3em; font-weight: 800; color: #2F7BFF; }
.etat-solution .yk-question { display: block; margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.25; opacity: .8; }
.etat-solution .yk-solution { display: flex; flex-direction: column; gap: 6px; animation: yk-apparait .4s ease-out; }
.yk-solution p { margin: 0; }
.yk-bonne { font-size: 1.7rem; font-weight: 800; line-height: 1.1; color: #17A05E; overflow-wrap: anywhere; }
.yk-dit { font-size: .95rem; font-weight: 700; overflow-wrap: anywhere; }
.yk-dit b { display: block; font-size: 1.05rem; color: var(--tomate); }
.yk-savais { padding: 8px 10px; background: #FFF6D6; border-radius: 12px; font-size: .88rem; font-weight: 600; line-height: 1.3; text-align: left; }
.yk-savais b { font-weight: 800; }

.yk-scene[data-niveau="F"] .yk-carte { --niv: #1FB86E; }
.yk-scene[data-niveau="F"] .yk-niveau { color: #1FB86E; }
.yk-scene[data-niveau="M"] .yk-carte { --niv: #2F7BFF; }
.yk-scene[data-niveau="M"] .yk-niveau { color: #2F7BFF; font-style: italic; }
.yk-scene[data-niveau="D"] .yk-carte { --niv: #12C4C4; }
.yk-scene[data-niveau="D"] .yk-niveau { color: #2F5D50; }
.yk-scene[data-niveau="H"] .yk-carte { --niv: #9B5DE5; border-color: #F2B705; box-shadow: 0 5px 0 #F2B705; }
.yk-scene[data-niveau="H"] .yk-niveau { color: #6B3FC0; font-size: 2.2rem; }
.yk-scene[data-niveau="G"] .yk-carte { --niv: #E8333F; border-color: #B3202B; box-shadow: 0 0 0 3px #FF8A1F, 0 0 26px #FF8A1F; }
.yk-scene[data-niveau="G"] .yk-niveau { color: #E8333F; font-size: 2.5rem; animation: yk-tremble .12s linear infinite; }
@keyframes yk-tremble { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-2px, 1px) rotate(-1deg); } 75% { transform: translate(2px, -1px) rotate(1deg); } }

.zone-jeu > .scene { min-width: 0; }
.commandes .saisie { width: 0; }
.commandes .yk-zeros { flex: none; width: auto; padding-left: 12px; padding-right: 12px; font-size: 1.05rem; }
.commandes .saisie + .yk-zeros + .bouton { flex: none; width: auto; padding-left: 16px; padding-right: 16px; }

/* Le bilan de la manche */
.terrain.yakombien-bilan { display: flex; flex-direction: column; padding: 12px; overflow-y: auto; background: #fff; }
.yk-titre-bilan { margin: 0 0 8px; font-size: 1.2rem; font-weight: 800; text-align: center; }
.yk-bilan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.yk-bilan li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #F4F6FA; border-radius: 14px; animation: yk-apparait .35s ease-out both; }
.yk-bilan li:nth-child(2) { animation-delay: .1s; } .yk-bilan li:nth-child(3) { animation-delay: .2s; } .yk-bilan li:nth-child(4) { animation-delay: .3s; }
.yk-bilan li:nth-child(5) { animation-delay: .4s; } .yk-bilan li:nth-child(6) { animation-delay: .5s; } .yk-bilan li:nth-child(7) { animation-delay: .6s; } .yk-bilan li:nth-child(8) { animation-delay: .7s; }
.yk-bilan .mini { flex: none; width: 36px; height: 36px; }
.yk-ligne { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.yk-ligne b { font-weight: 800; }
.yk-ligne small { font-size: .8rem; font-weight: 600; opacity: .75; overflow-wrap: anywhere; }
.yk-rapport { flex: none; max-width: 42%; font-size: .85rem; font-weight: 800; text-align: right; }
.yk-bilan li.puni { background: #FFC9C9; }
.yk-bilan li.puni .yk-rapport::after { content: " −1 ♥"; color: var(--tomate); }

/* ---------- Sapasousakas ---------- */
.terrain.sapas { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 34px 10px 14px;
  background: radial-gradient(circle at 50% 40%, #2FA36B 0, #1E7D4F 70%), #1E7D4F; }
.terrain.sapas::before { content: ""; position: absolute; inset: 8px; border: 3px dashed rgba(255, 255, 255, .22); border-radius: 16px; pointer-events: none; }
.sp-manche { position: absolute; left: 10px; top: 10px; z-index: 2; padding: 3px 10px; background: var(--blanc); border: var(--trait); border-radius: 999px; font-size: .85rem; font-weight: 800; }
.sp-manche:empty { display: none; }
.sp-manche.nouvelle { animation: rk-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.sp-cartes { display: flex; gap: 16px; perspective: 900px; }
.sp-carte { position: relative; width: min(36vw, 128px); aspect-ratio: 5 / 7; display: grid; place-items: center; background: var(--blanc); border: var(--trait); border-radius: 14px; box-shadow: 0 5px 0 var(--encre); }
.sp-carte b { font-size: clamp(3.4rem, 16vw, 5.2rem); font-weight: 800; line-height: 1; }
.sp-coin { position: absolute; font-size: .95rem; font-weight: 800; }
.sp-coin.h { left: 8px; top: 5px; } .sp-coin.b { right: 8px; bottom: 5px; rotate: 180deg; }
.sp-ref.vide { background: transparent; border-style: dashed; border-color: rgba(255, 255, 255, .5); box-shadow: none; }
.sp-ref.pose { animation: sp-pose .35s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes sp-pose { from { translate: 60px 0; rotate: 8deg; opacity: .3; } }
.sp-retourne { position: relative; width: min(36vw, 128px); aspect-ratio: 5 / 7; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.3, 1.2, .5, 1); }
.sp-retourne.montre { transform: rotateY(180deg); }
.sp-retourne .sp-carte { position: absolute; inset: 0; width: auto; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.sp-face { transform: rotateY(180deg); }
.sp-dos { background: repeating-linear-gradient(45deg, #E8333F 0 8px, #FF4D4D 8px 16px); }
.sp-dos::after { content: "?"; display: grid; place-items: center; width: 52%; aspect-ratio: 1; background: var(--blanc); border: var(--trait); border-radius: 50%; font-size: 2.2rem; font-weight: 800; }
.sp-bas { display: flex; align-items: center; gap: 12px; }
.sp-tirelire { position: relative; width: 104px; scale: var(--taille, 1); transform-origin: 50% 80%; transition: scale .45s cubic-bezier(.3, 1.6, .5, 1); }
.sp-tirelire svg { display: block; width: 100%; height: auto; overflow: visible; transition: opacity .1s; }
.sp-tirelire.hop { animation: sp-hop .45s ease-out; }
@keyframes sp-hop { 40% { translate: 0 -16px; } 70% { translate: 0 2px; } }
.sp-tirelire.casse svg { opacity: 0; }
.sp-morceaux { position: absolute; left: 50%; top: 55%; }
.sp-morceaux i { position: absolute; width: 22px; height: 18px; margin: -9px 0 0 -11px; background: #FF9BC8; border: 2.5px solid var(--encre); clip-path: polygon(0 20%, 60% 0, 100% 60%, 30% 100%); animation: sp-eclat .9s cubic-bezier(.2, .7, .4, 1) forwards; }
.sp-morceaux i:nth-child(3n) { background: #FFD84D; border-radius: 50%; clip-path: none; width: 14px; height: 14px; margin: -7px 0 0 -7px; }
@keyframes sp-eclat { to { transform: rotate(var(--a)) translateX(var(--d)) rotate(var(--r)); opacity: 0; } }
.sp-cagnotte { min-width: 70px; font-size: 1.8rem; font-weight: 800; color: var(--blanc); text-shadow: 0 3px 0 var(--encre); white-space: nowrap; }
.sp-tampon { position: absolute; left: 50%; top: 36%; z-index: 4; translate: -50% -50%; padding: 4px 16px; border: 6px solid currentColor; border-radius: 12px; background: rgba(255, 255, 255, .92); font-size: 2.6rem; font-weight: 800; line-height: 1.05; white-space: nowrap; opacity: 0; pointer-events: none; }
.sp-tampon.visible { animation: sp-tampon 1.4s cubic-bezier(.3, 1.4, .5, 1) forwards; }
@keyframes sp-tampon { 0% { opacity: 0; scale: 2.2; rotate: -18deg; } 18% { opacity: 1; scale: 1; rotate: -9deg; } 80% { opacity: 1; } 100% { opacity: 0; scale: 1; rotate: -9deg; } }
.sp-tampon.sapass { color: #17A05E; }
.sp-tampon.sakas { color: #E8333F; }
.sp-tampon.pareil { color: #2F7BFF; font-size: 2.1rem; }
.sp-tampon.jackpot { color: #C98200; font-size: 2.2rem; }
.sp-paris { position: absolute; left: 10px; right: 10px; bottom: 12px; z-index: 3; display: flex; gap: 10px; justify-content: center; }
.sp-paris[hidden] { display: none; }
.sp-pari { flex: 1; padding: 14px 6px; background: var(--blanc); border: var(--trait); border-radius: 16px; box-shadow: 0 4px 0 var(--encre); font-size: 1.1rem; font-weight: 800; }
.sp-pari.choisi { background: #FFD84D; }
.sp-verdicts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.sp-verdicts > span { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 2px; border: var(--trait); border-radius: 999px; font-size: .85rem; font-weight: 800; }
.sp-verdicts .mini { width: 30px; height: 30px; }
.sp-verdicts .ok { background: #9BE8B8; } .sp-verdicts .ko { background: #FFB3B3; }
.sp-boutons { flex: 1; min-width: 0; display: flex; gap: 6px; }
.sp-boutons .bouton { padding: 15px 4px; font-size: 1rem; }
.sp-boutons .bouton.sp-encaisse { background: #9BE8B8; }

/* ---------- L'aiguillage ---------- */
.terrain.aiguillage { background: radial-gradient(circle 2px, rgba(29, 17, 71, .08) 98%, transparent) 0 0 / 22px 22px, #BDE6CB; }
.ai-reseau { position: absolute; inset: 0; }
.ai-plan { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ai-voie { transition: opacity .3s; }
.ai-voie.eteinte { opacity: .28; }
.ai-aig { position: absolute; z-index: 2; width: 48px; height: 48px; translate: -50% -50%; display: grid; place-items: center; padding: 0; background: var(--blanc); border: var(--trait); border-radius: 50%; box-shadow: 0 3px 0 var(--encre); }
.ai-aig svg { display: block; width: 30px; height: 30px; }
.ai-aig b { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.ai-aig:disabled { cursor: default; opacity: 1; }
.ai-aig.levier { border-color: var(--c); border-width: 5px; }
.ai-aig.bascule { animation: rk-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.ai-reseau.choix .ai-aig { animation: ai-invite 1.2s ease-in-out infinite alternate; }
@keyframes ai-invite { to { box-shadow: 0 3px 0 var(--encre), 0 0 0 6px rgba(255, 216, 77, .7); } }
.ai-aig.choisi, .ai-rien.choisi { background: #FFD84D; animation: none !important; box-shadow: 0 0 0 5px var(--blanc), 0 3px 0 7px var(--encre); }
.ai-rien { position: absolute; right: 8px; top: 8px; z-index: 2; display: none; padding: 9px 14px; background: var(--blanc); border: var(--trait); border-radius: 999px; box-shadow: 0 3px 0 var(--encre); font-size: .88rem; font-weight: 800; }
.ai-reseau.choix .ai-rien { display: block; }
.ai-qui { position: absolute; z-index: 3; translate: 28px -50%; display: flex; align-items: center; gap: 2px; padding: 2px 8px 2px 2px; background: var(--blanc); border: 2px solid var(--encre); border-radius: 999px; animation: rk-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.ai-qui svg { display: block; }
.ai-qui b { margin-left: 2px; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.ai-qui.ai-qui-rien { left: auto; right: 8px; top: 8px; translate: none; }
.ai-clac { position: absolute; z-index: 4; translate: -50% -170%; font-size: 1.15rem; font-weight: 800; color: var(--tomate); -webkit-text-stroke: 1.5px var(--blanc); paint-order: stroke fill; white-space: nowrap; pointer-events: none; animation: lu-monte .9s ease-out forwards; }
.ai-gare { position: absolute; z-index: 2; translate: -50% 0; display: flex; flex-direction: column; align-items: center; }
.ai-quai svg { display: block; }
.ai-gare b { max-width: min(64px, var(--larg, 64px)); overflow: hidden; font-size: .7rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.ai-gare.garage b { opacity: .55; }
.ai-vies { display: flex; gap: 0; margin-top: -1px; }
.ai-vies i { font-size: .78rem; }
.ai-gare.touchee .ai-quai { animation: gronde .12s linear 6; }
.ai-role { position: absolute; z-index: 2; translate: -50% -50%; display: flex; align-items: center; gap: 3px; padding: 1px 8px 1px 2px; background: var(--blanc); border: 2px solid var(--encre); border-radius: 999px; font-size: .75rem; font-weight: 800; }
.ai-role svg { display: block; }
.ai-panneau { position: absolute; left: 10px; right: 10px; top: 36%; z-index: 5; display: flex; gap: 10px; padding: 10px; background: rgba(255, 255, 255, .96); border: var(--trait); border-radius: 18px; box-shadow: 0 5px 0 var(--encre); }
.ai-panneau[hidden] { display: none; }
.ai-choix { flex: 1; padding: 16px 6px; background: var(--blanc); border: var(--trait); border-radius: 14px; box-shadow: 0 4px 0 var(--encre); font-size: 1.1rem; font-weight: 800; }
.ai-choix.choisi { background: #FFD84D; }

/* ---------- Sakrak ! ---------- */
.terrain.sakrak { background: linear-gradient(#9FDCFF, #DDF3FF 55%); }
.sk-monde { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sk-scores .score-joueur b { display: inline-flex; align-items: center; gap: 2px; min-width: 14px; justify-content: center; }
.sk-goutte { display: inline-block; width: 9px; height: 9px; background: #2F7BFF; border: 1.5px solid var(--encre); border-radius: 50% 50% 50% 0; rotate: -45deg; }
.sk-planche.suivante .sk-bois { filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 2px #FFD84D); }
.sk-moitie { transform-box: fill-box; }
.sk-moitie.g { transform-origin: 0 50%; animation: sk-tombe-g 1.1s ease-in forwards; }
.sk-moitie.d { transform-origin: 100% 50%; animation: sk-tombe-d 1.1s ease-in forwards; }
@keyframes sk-tombe-g { 30% { rotate: 50deg; translate: 0 0; } 100% { rotate: 120deg; translate: -6px 200px; opacity: 0; } }
@keyframes sk-tombe-d { 30% { rotate: -50deg; translate: 0 0; } 100% { rotate: -120deg; translate: 6px 200px; opacity: 0; } }
.sk-eclabousse { transform-box: fill-box; transform-origin: center; opacity: 0; animation: fd-gicle .8s cubic-bezier(.2, .7, .4, 1) forwards; }
.sk-cri { position: absolute; left: 50%; top: 30%; z-index: 3; translate: -50% -50%; font-size: 3.6rem; font-weight: 800; line-height: 1; white-space: nowrap; -webkit-text-stroke: 3px var(--encre); paint-order: stroke fill; text-shadow: 0 6px 0 var(--encre); opacity: 0; pointer-events: none; }
.sk-cri.visible { animation: fd-plouf 1.5s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.sk-cri.casse { color: #FFD84D; }
.sk-cri.eau { color: #5CCBFF; top: 62%; }
.sk-cri.bravo { color: #7CFF9B; font-size: 3rem; }
.sk-pile { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sk-boutons { display: flex; gap: 6px; }
.sk-boutons .bouton { padding: 13px 4px; font-size: .98rem; }
.sk-boutons .bouton.principal { flex: 1.25; font-size: 1.02rem; }
.sk-legende { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px; margin: 0; font-size: .78rem; font-weight: 700; }
.sk-legende span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.sk-legende i { width: 18px; height: 8px; border: 2px solid var(--encre); border-radius: 2px; }
.sk-legende b { font-weight: 800; }
.sk-legende .sk-plus { flex-basis: 100%; justify-content: center; opacity: .8; }
.sk-scores .score-joueur.fini b { color: #17A05E; }
.sk-scores .score-joueur.expose { background: #FFF6C9; }
.sk-manche { position: absolute; left: 8px; top: 8px; z-index: 2; padding: 3px 10px; background: var(--blanc); border: var(--trait); border-radius: 999px; font-size: .85rem; font-weight: 800; }
.sk-manche:empty { display: none; }
.sk-manche.nouvelle { animation: rk-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.sk-planche.reposee { animation: sk-repose .5s ease-out; }
@keyframes sk-repose { from { opacity: 0; } }
.sk-legende .neuve i { background: #EFC58A; }
.sk-legende .fissuree i { background: #E2B06E; background-image: linear-gradient(60deg, transparent 45%, #1D1147 45% 55%, transparent 55%); }
.sk-legende .tres i { background: #B9814A; background-image: linear-gradient(60deg, transparent 25%, #1D1147 25% 33%, transparent 33% 62%, #1D1147 62% 70%, transparent 70%); }
.sk-legende .pourrie i { background: #7E8B4A; background-image: radial-gradient(circle at 30% 50%, #1D1147 1.5px, transparent 2px), radial-gradient(circle at 70% 50%, #1D1147 1.5px, transparent 2px); }

/* ---------- La fourmi et le fourmilier ---------- */
.terrain.fourmiliere { background:
  radial-gradient(circle 3px, rgba(255, 255, 255, .12) 98%, transparent) 0 0 / 38px 41px,
  radial-gradient(circle 2px, rgba(29, 17, 71, .18) 98%, transparent) 17px 20px / 29px 33px,
  linear-gradient(#BFE9FF 0 17%, #43C26A 17% 20%, #A86B3C 20%); }
.fo-plan { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; }
.fo-butte { position: absolute; left: 50%; top: 9%; z-index: 2; width: 26%; height: 12%; translate: -50% 0; background: #A86B3C; border: var(--trait); border-bottom: 0; border-radius: 50% 50% 0 0 / 80% 80% 0 0; }
.fo-butte::after { content: ""; position: absolute; left: 50%; top: 22%; width: 26%; height: 34%; translate: -50% 0; background: #3E2614; border: 3px solid var(--encre); border-radius: 50%; }
.fo-fourmilier { position: absolute; left: 1%; top: 1%; z-index: 3; width: 38%; transform-origin: 70% 70%; transition: filter .4s, rotate .4s; }
.fo-fourmilier > svg { display: block; width: 100%; height: auto; overflow: visible; }
.fo-badge { position: absolute; left: -4px; top: -8px; width: 30px; height: 30px; }
.fo-badge svg { width: 100%; height: 100%; }
.fo-fourmilier.sniff { animation: fo-sniff .25s ease-in-out infinite alternate; }
@keyframes fo-sniff { to { rotate: 4deg; } }
.fo-fourmilier.repu { animation: bt-joie .3s ease-in-out infinite alternate; }
.fo-fourmilier.bredouille { filter: grayscale(.7); rotate: -8deg; }
.fo-erreurs { position: absolute; right: 6px; top: 6px; z-index: 3; display: flex; align-items: center; gap: 4px; padding: 3px 8px; background: var(--blanc); border: var(--trait); border-radius: 999px; }
.fo-erreurs:empty { display: none; }
.fo-erreurs small { margin-right: 2px; font-size: .75rem; font-weight: 800; }
.fo-erreurs i { width: 14px; height: 14px; border: 2.5px solid var(--encre); border-radius: 50%; }
.fo-erreurs i.fatale { border-color: var(--tomate); border-style: dashed; }
.fo-erreurs i.faite { background: var(--tomate); border-style: solid; border-color: var(--encre); }
.fo-couloir { position: absolute; z-index: 2; width: 38%; translate: -50% -50%; display: grid; place-items: center; padding: 3px 8px; overflow: hidden; background: #3E2614; border: var(--trait); border-radius: 50%; box-shadow: inset 0 5px 0 rgba(0, 0, 0, .35); transition: background .3s; }
.fo-couloir b { font-size: .9rem; font-weight: 800; color: #F2D27A; opacity: .6; }
.fo-couloir.choisi { background: #FFD84D; box-shadow: 0 0 0 4px var(--blanc); }
.fo-couloir.choisi b { color: var(--encre); opacity: 1; }
.fo-couloir:disabled { cursor: default; }
.fo-couloir.ouvert { background: #F2DCC6; box-shadow: inset 0 4px 0 rgba(0, 0, 0, .12); }
.fo-couloir.ouvert b { display: none; }
.fo-couloir.trouve { background: #FFC9C9; }
.fo-couloir.sauve { background: #C8F2D2; }
.fo-dedans { display: none; height: 100%; width: 100%; align-items: center; justify-content: center; gap: 2px; }
.fo-couloir.ouvert .fo-dedans { display: flex; animation: rk-pop .4s cubic-bezier(.3, 1.6, .5, 1); }
.fo-dedans > svg { height: 68%; width: auto; max-width: 70%; }
.fo-fourmi { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-width: 0; }
.fo-fourmi svg { display: block; height: calc(100% - 12px); max-height: 50px; width: auto; aspect-ratio: 1; }
.fo-fourmi em { font-size: .65rem; font-style: normal; font-weight: 800; line-height: 1; white-space: nowrap; }
.fo-tirage { position: absolute; inset: 20% 0 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 12px; padding: 20px; }
.fo-candidat { width: 62px; height: 62px; transition: scale .12s; }
.fo-candidat svg { width: 100%; height: 100%; }
.fo-candidat.pointe { scale: 1.25; }
.fo-candidat.elu { scale: 1.5; animation: bt-joie .3s ease-in-out infinite alternate; }

/* ---------- Les Rikiki : jeux pour les tout petits ---------- */
.rk-piece, .bt-gob, .cd-de, .lu-luciole { padding: 0; background: none; border: 0; }
.rk-piece svg, .bt-gob svg, .cd-de svg, .lu-luciole svg { display: block; width: 100%; height: 100%; overflow: visible; }
.rk-pieces.attente .rk-piece { pointer-events: none; }
.rk-piece.hesite { animation: rk-hesite .16s ease-in-out infinite alternate !important; }
@keyframes rk-hesite { from { rotate: -7deg; } to { rotate: 7deg; } }
@keyframes rk-pop { from { scale: .3; opacity: 0; } 60% { scale: 1.12; opacity: 1; } to { scale: 1; } }
.terrain.rikiki.secoue { animation: secousse .5s 2; }

/* Le nid */
.terrain.nid-jeu { display: grid; place-items: center; background: linear-gradient(#BFE9FF, #E6F6FF 70%); }
.ni-branche { position: absolute; left: -10%; right: -10%; top: 62%; height: 26px; background: #8A5529; border: var(--trait); border-radius: 14px; rotate: -8deg; }
.ni-feuille { position: absolute; width: 70px; height: 34px; background: #1FB86E; border: var(--trait); border-radius: 0 100% 0 100%; }
.ni-feuille.f1 { left: 4%; top: 58%; rotate: -30deg; }
.ni-feuille.f2 { right: 3%; top: 66%; rotate: 20deg; }
.ni-nid { position: relative; width: 94%; padding: 0 6px 22px; }
.ni-paille { position: absolute; left: -2%; right: -2%; bottom: 0; height: 52%; z-index: 0; background: repeating-linear-gradient(168deg, #C98B4B 0 7px, #8A5529 7px 11px, #B07A4F 11px 17px); border: var(--trait); border-radius: 18px 18px 50% 50% / 18px 18px 70% 70%; }
.ni-oeufs { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(var(--col), 1fr); gap: 0 4px; }
.ni-oeuf { aspect-ratio: 100 / 120; transform-origin: 50% 92%; animation: ni-dodo 2.8s ease-in-out var(--d) infinite; }
@keyframes ni-dodo { 0%, 80%, 100% { rotate: 0deg; } 86% { rotate: -5deg; } 93% { rotate: 4deg; } }
.ni-oeuf.ouvert { position: relative; z-index: 2; animation: none; }
.ni-oeuf.ouvert svg { animation: rk-pop .5s cubic-bezier(.3, 1.5, .5, 1); }
.ni-oeuf:disabled { cursor: default; }
.ni-grr { position: absolute; left: 50%; top: -38%; z-index: 3; translate: -50% 0; padding: 2px 8px; background: var(--blanc); border: var(--trait); border-radius: 12px; font-size: 1rem; font-weight: 800; color: var(--tomate); white-space: nowrap; animation: rk-pop .4s .2s both, gronde .12s .6s linear infinite; }

/* Le bonneteau */
.terrain.bonneteau { background: linear-gradient(#FFE9C2 0 66%, #C98B4B 66%); }
.bt-table { position: absolute; left: 0; right: 0; top: 66%; height: 8px; background: #8A5529; border-top: var(--trait); }
.bt-gob { position: absolute; bottom: 34%; width: var(--l); aspect-ratio: 100 / 110; transform: translateX(-50%); }
.bt-gob:disabled { cursor: default; }
.bt-tasse { position: absolute; inset: 0; z-index: 1; transition: transform .35s cubic-bezier(.3, 1.5, .5, 1); }
.bt-gob.leve .bt-tasse { transform: translateY(-64%) rotate(-10deg); }
/* La balle n'est visible que gobelet levé : rien ne dépasse quand ils sont posés. */
.bt-balle { position: absolute; left: 50%; bottom: 0; z-index: 0; width: 54%; aspect-ratio: 1; translate: -50% 0; opacity: 0; transition: opacity 0s .3s; }
.bt-gob.leve .bt-balle { opacity: 1; transition-delay: 0s; }
.bt-gob.bon .bt-balle { animation: bt-joie .3s ease-in-out infinite alternate; }
@keyframes bt-joie { to { scale: 1.15; } }
.bt-gob.faux .bt-tasse svg { filter: saturate(.4); }
.bt-gob:not(:disabled) .bt-tasse { transform-origin: 50% 100%; animation: bt-attend .9s ease-in-out infinite alternate; }
@keyframes bt-attend { from { rotate: -3deg; } to { rotate: 3deg; } }

/* Qui s'est caché ? */
.terrain.qui-cache { background: linear-gradient(#BFE9FF 0 52%, #9BE8B8 52%); }
.qc-pre { position: absolute; inset: 12px 5% 10px; display: grid; place-items: center; }
.qc-animaux { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; max-width: 330px; }
.qc-animaux.n5, .qc-animaux.n6 { grid-template-columns: repeat(3, 1fr); }
.qc-case { aspect-ratio: 1; display: grid; place-items: center; background: rgba(255, 255, 255, .65); border: 3px solid rgba(29, 17, 71, .15); border-radius: 18px; }
.qc-case svg { width: 86%; height: 86%; overflow: visible; }
.qc-case.sorti { background: #FFF6C9; border-color: var(--encre); }
.qc-case.sorti svg { animation: rk-pop .5s cubic-bezier(.3, 1.5, .5, 1); }
.qc-yeux { animation: qc-cligne 3s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes qc-cligne { 0%, 90%, 100% { scale: 1 1; } 95% { scale: 1 .1; } }
.qc-rideau { position: absolute; top: 0; bottom: 0; z-index: 4; width: 51%; background: repeating-linear-gradient(90deg, #C9283D 0 14px, #A81E31 14px 28px); border: 3px solid var(--encre); transition: transform .6s ease-in-out; }
.qc-rideau.g { left: -3px; transform: translateX(-100%); border-radius: 0 0 30px 0; }
.qc-rideau.d { right: -3px; transform: translateX(100%); border-radius: 0 0 0 30px; }
.qui-cache.ferme .qc-rideau { transform: none; }

/* La course au dé : un petit jeu de l'oie */
.terrain.course-de { display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 4px; background: #9BE8B8; }
.cd-plateau { position: relative; flex: 1; min-height: 0; margin: 4px; }
.cd-route { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cd-case { position: absolute; z-index: 1; width: 17%; aspect-ratio: 1; max-height: 17%; translate: -50% -50%; display: grid; place-items: center; background: var(--fond); border: var(--trait); border-radius: 30%; box-shadow: 0 3px 0 var(--encre); }
.cd-case b { font-size: .8rem; font-weight: 800; opacity: .45; }
.cd-case svg { width: 74%; height: 74%; overflow: visible; }
.cd-case.depart { background: #D6F5D0; }
.cd-case.arrivee { width: 21%; max-height: 21%; background: #FFF6C9; border-radius: 50%; }
.cd-case.etoile { background: #FFF6C9; }
.cd-case.fusee { background: #DFF4FF; }
.cd-case.boue { background: #F2DCC6; }
.cd-case.active { animation: rk-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.cd-pion { position: absolute; z-index: 2; width: min(11%, 38px); aspect-ratio: 1; translate: calc(-50% + var(--dx, 0px)) calc(-60% + var(--dy, 0px)); transition: left .3s cubic-bezier(.3, 1.4, .5, 1), top .3s cubic-bezier(.3, 1.4, .5, 1), translate .3s; }
.cd-pion svg { width: 100%; height: 100%; }
.cd-pion.devant, .cd-pion.actif { z-index: 3; }
.cd-pion.actif svg { filter: drop-shadow(0 0 4px #fff); animation: bt-joie .5s ease-in-out infinite alternate; }
.cd-pion.saut { animation: cd-saut .32s ease-out; }
@keyframes cd-saut { 50% { transform: translateY(-45%); } }
.cd-compte { position: absolute; left: 50%; bottom: 90%; translate: -50% 0; font-size: 1.8rem; font-weight: 800; line-height: 1; color: var(--tomate); -webkit-text-stroke: 1.5px var(--blanc); paint-order: stroke fill; }
.cd-rang { position: absolute; right: -8px; top: -8px; display: grid; place-items: center; width: 20px; height: 20px; font-size: .75rem; font-style: normal; font-weight: 800; color: var(--encre); background: #FFD84D; border: 2px solid var(--encre); border-radius: 50%; }
.cd-pion.dernier svg { filter: grayscale(.5); }
.cd-bas { flex: none; display: flex; align-items: center; justify-content: space-between; height: 96px; padding: 0 6px; }
.cd-legende { display: flex; flex-direction: column; gap: 2px; font-size: .85rem; font-weight: 800; }
.cd-legende span { display: flex; align-items: center; gap: 4px; }
.cd-legende svg { width: 24px; height: 24px; }
.cd-de { width: 84px; height: 84px; margin-right: 10px; filter: drop-shadow(0 5px 0 #1D1147); }
.cd-de:disabled { cursor: default; }
.cd-de:not(:disabled) { animation: cd-invite .7s ease-in-out infinite alternate; }
@keyframes cd-invite { to { scale: 1.08; rotate: 4deg; } }
.cd-de.roule { animation: cd-roule .18s linear infinite; }
@keyframes cd-roule { 0% { rotate: 0deg; translate: 0 0; } 50% { translate: 0 -14px; } 100% { rotate: 90deg; translate: 0 0; } }
.cd-de.pose { animation: rk-pop .35s cubic-bezier(.3, 1.6, .5, 1); }

/* Le petit oiseau */
.terrain.petit-oiseau { background: linear-gradient(#9FDCFF 0 70%, #9BE8B8 70%); }
.po-soleil { position: absolute; right: 9%; top: 6%; width: 50px; height: 50px; background: #FFD84D; border: var(--trait); border-radius: 50%; box-shadow: 0 0 0 9px rgba(255, 216, 77, .35); }
.po-nuage { position: absolute; width: 74px; height: 26px; background: var(--blanc); border-radius: 999px; opacity: .9; }
.po-nuage::before { content: ""; position: absolute; left: 14px; top: -14px; width: 36px; height: 30px; background: inherit; border-radius: 50%; }
.po-nuage.n1 { left: 8%; top: 9%; } .po-nuage.n2 { left: 46%; top: 17%; scale: .8; }
.po-scene { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.po-acteur { position: absolute; left: 0; top: 0; width: 62px; height: 62px; transform: translate(-200px, 0); }
.po-acteur svg { display: block; width: 100%; height: 100%; overflow: visible; }
.po-acteur.po-oiseau { width: 58px; height: 40px; }
.po-oiseau .aile { transform-box: fill-box; transform-origin: 50% 100%; animation: battre .16s ease-in-out infinite alternate; }
.po-buisson { position: absolute; bottom: 21%; z-index: 3; width: 96px; pointer-events: none; }
.po-buisson svg { display: block; width: 100%; height: auto; overflow: visible; }
.po-buisson .qc-yeux { display: none; }
.po-buisson.g { left: -26px; } .po-buisson.d { right: -26px; scale: -1 1; }
.po-paris { position: absolute; left: 10px; right: 10px; bottom: 12px; z-index: 4; display: flex; gap: 10px; }
.po-paris[hidden], .po-verdicts[hidden] { display: none; }
.po-pari { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px 6px; background: var(--blanc); border: var(--trait); border-radius: 18px; box-shadow: 0 5px 0 var(--encre); font-size: 1.2rem; font-weight: 800; }
.po-pari b { font-size: 1.8rem; line-height: 1; }
.po-pari.choisi { background: #FFD84D; }
.po-verdicts { position: absolute; left: 8px; right: 8px; top: 10px; z-index: 4; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.po-verdicts > span { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 2px; border: var(--trait); border-radius: 999px; font-size: .85rem; font-weight: 800; }
.po-verdicts .mini { width: 30px; height: 30px; }
.po-verdicts .ok { background: #9BE8B8; } .po-verdicts .ko { background: #FFB3B3; }

/* Les lucioles */
.terrain.lucioles { background: radial-gradient(circle at 80% 12%, #4A3E94 0, #1B1446 62%); touch-action: none; user-select: none; -webkit-user-select: none; }
.lu-lune { position: absolute; right: 10%; top: 6%; width: 46px; height: 46px; border-radius: 50%; background: #FFF6C9; box-shadow: 0 0 22px rgba(255, 246, 201, .6); }
.lu-herbe { position: absolute; left: 0; right: 0; bottom: 0; height: 14%; background: #12452C; border-top: 3px solid #0B2E1D; }
.lu-ciel { position: absolute; inset: 0; z-index: 2; }
.lu-luciole { position: absolute; width: 66px; height: 66px; translate: -50% -50%; filter: drop-shadow(0 0 8px #E9FF6B); animation: lu-vol 1.8s ease-in-out forwards; }
@keyframes lu-vol { 0% { opacity: 0; transform: scale(.3); } 15% { opacity: 1; transform: scale(1); } 85% { opacity: 1; transform: translate(var(--dx), var(--dy)); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.5); } }
.lu-luciole.prise { animation: lu-prise .45s ease-in forwards; pointer-events: none; }
@keyframes lu-prise { 0% { scale: 1.3; } 100% { scale: .2; opacity: 0; translate: 40vw 60vh; } }
.lu-luciole.fuite { animation: lu-fuite .6s ease-in forwards; }
@keyframes lu-fuite { to { opacity: 0; translate: -50% -200%; } }
.lu-aile { transform-box: fill-box; transform-origin: center; animation: lu-aile .1s linear infinite alternate; }
@keyframes lu-aile { to { scale: 1 .45; } }
.lu-bocal { position: absolute; right: 10px; bottom: 8px; z-index: 3; width: 68px; height: 82px; display: grid; place-items: center; background: rgba(191, 233, 255, .22); border: 3px solid #E6F6FF; border-radius: 14px 14px 24px 24px; overflow: hidden; }
.lu-bocal::before { content: ""; position: absolute; left: 10%; right: 10%; top: -3px; height: 9px; background: #C98B4B; border: 2px solid #E6F6FF; border-radius: 4px; }
.lu-lueur { position: absolute; inset: 0; opacity: 0; background: radial-gradient(circle, #F2FF8A 0, rgba(215, 255, 77, .5) 50%, transparent 75%); transition: opacity .3s; }
.lu-bocal b { position: relative; font-size: 1.8rem; font-weight: 800; color: var(--blanc); text-shadow: 0 2px 0 var(--encre); }
.lucioles.montre .chrono-barre { animation: chrono 10s linear forwards; }
.lu-luciole.magique { filter: drop-shadow(0 0 10px #FF6FD8); animation: lu-vol 1.3s ease-in-out forwards, lu-arcenciel 1.2s linear infinite; }
.lu-luciole.magique.prise { animation: lu-prise .45s ease-in forwards; }
@keyframes lu-arcenciel { from { filter: drop-shadow(0 0 10px #FF6FD8) hue-rotate(0deg); } to { filter: drop-shadow(0 0 10px #FF6FD8) hue-rotate(360deg); } }
.lu-etincelle { animation: qc-cligne .5s infinite; transform-box: fill-box; transform-origin: center; }
.lu-plus { position: absolute; z-index: 4; translate: -50% -50%; font-size: 1.5rem; font-weight: 800; color: #D7FF4D; text-shadow: 0 2px 0 var(--encre); pointer-events: none; animation: lu-monte .7s ease-out forwards; }
.lu-plus.magique { font-size: 2rem; color: #FF8FE0; }
@keyframes lu-monte { from { opacity: 1; transform: translateY(0) scale(.8); } to { opacity: 0; transform: translateY(-50px) scale(1.2); } }

@media (prefers-reduced-motion: reduce) {
  .rib, .bestiole, .singe, .condamne-avatar, .tampon, .piste.coup-de-feu, .atelier-apercu .avatar { animation: none; }
}

/* ---------- Pilpoil ---------- */
.terrain.kikone.pilpoil { background: #BFE9FF; }
.pp-moitie { position: absolute; top: 0; bottom: 0; width: 50%; display: flex; align-items: flex-end; padding: 0 12px 8px; pointer-events: none; transition: background .12s; }
.pp-moitie.gauche { left: 0; justify-content: flex-start; }
.pp-moitie.droite { right: 0; justify-content: flex-end; }
.pp-moitie span { display: grid; place-items: center; width: 40px; height: 40px; border: 3px solid var(--encre); border-radius: 50%; background: rgba(255, 255, 255, .7); font-size: 1.1rem; color: var(--encre); }
.pp-moitie.appuye { background: rgba(255, 255, 255, .22); }
.pp-moitie.appuye span { background: var(--soleil); }
.pp-bulle { position: absolute; z-index: 4; translate: -50% -50%; padding: 4px 12px; background: var(--blanc); border: var(--trait); border-radius: 16px; box-shadow: 0 3px 0 var(--encre); font-weight: 800; font-size: 1.15rem; white-space: nowrap; pointer-events: none; animation: pp-pop .35s cubic-bezier(.3, 1.6, .5, 1) both; }
.pp-bulle.meuh { background: #FFE3A3; }
.pp-bulle.arbre { background: #C9F2C7; }
.pp-bulle.pilpoil-gros { padding: 6px 20px; background: var(--soleil); border-radius: 22px; font-size: 2.6rem; letter-spacing: .02em; }
@keyframes pp-pop { from { scale: .3; opacity: 0; } to { scale: 1; opacity: 1; } }
.pp-confetti { position: absolute; top: 0; z-index: 5; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .pp-bulle { animation: none; } }

/* ================= Mode salon (sa-) ================= */
/* Accueil : les deux entrées. */
.sa-entrees-titre { font-size: .95rem; margin-top: 4px; }
.sa-entrees { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sa-entrees .bouton { padding: 13px 8px; font-size: 1.02rem; min-height: 56px; }

/* Textes communs. */
.sa-etiquette { font-weight: 800; font-size: 1.05rem; }
.sa-aide, .sa-intro { font-size: 1rem; }
.sa-erreur {
  background: #FFE1E1; border: var(--trait); border-radius: 16px; padding: 10px 14px;
  font-weight: 700; line-height: 1.3;
}

/* Rejoindre : le code. */
.sa-rejoindre { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.sa-champ-code {
  width: 100%; padding: 10px 0 10px .32em; text-align: center;
  font-size: clamp(2.4rem, 13vw, 3.2rem); font-weight: 800; letter-spacing: .32em; text-transform: uppercase;
  background: var(--blanc); border: var(--trait); border-radius: 22px; box-shadow: var(--ombre);
}
.sa-champ-code::placeholder { color: rgba(29, 17, 71, .2); }
.sa-champ-code:focus, .sa-champ-nom:focus { outline: none; box-shadow: 0 5px 0 var(--encre), 0 0 0 4px var(--blanc); }

/* Qui es-tu ? */
.sa-profil { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sa-profil .sa-etiquette { margin-top: 12px; }
.sa-profil-avatar {
  position: relative; width: 150px; height: 150px; padding: 12px 10px 18px;
  background: var(--blanc); border: var(--trait); border-radius: 50%; box-shadow: var(--ombre);
}
.sa-profil-avatar:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--encre); }
.sa-crayon {
  position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%);
  background: var(--soleil); border: 3px solid var(--encre); border-radius: 999px; padding: 0 12px;
  font-size: .95rem; font-weight: 800; white-space: nowrap;
}
.sa-champ-nom {
  width: 100%; max-width: 320px; padding: 12px 16px; text-align: center;
  font-size: 1.4rem; font-weight: 800;
  background: var(--blanc); border: var(--trait); border-radius: 18px; box-shadow: var(--ombre);
}
.sa-connus h2 { font-size: 1.05rem; font-weight: 800; margin-bottom: 8px; }
.sa-connus-liste { display: flex; flex-wrap: wrap; gap: 8px; }
.sa-connu {
  display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 4px 14px 4px 6px;
  background: var(--blanc); border: var(--trait); border-radius: 999px; box-shadow: 0 3px 0 var(--encre); font-weight: 800;
}
.sa-connu[aria-pressed="true"] { background: var(--encre); color: var(--blanc); }
.sa-connu .mini { width: 36px; height: 36px; }

/* Message (retiré, fermé…). */
.sa-message { margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.sa-message-avatar { width: 130px; height: 130px; }
.sa-message h2 { font-size: 1.6rem; font-weight: 800; line-height: 1.15; }
.sa-message p { font-size: 1.1rem; max-width: 22em; }

/* ---------- La salle d'attente ---------- */
.ecran.sa-salle { gap: 12px; }
.sa-tete { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 10px; }
.sa-carte {
  min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--blanc); border: var(--trait); border-radius: 20px; box-shadow: var(--ombre); padding: 8px 12px 10px;
}
.sa-carte-titre { font-size: .85rem; font-weight: 800; opacity: .75; }
.sa-code { font-size: clamp(2.1rem, 11vw, 2.7rem); font-weight: 800; letter-spacing: .14em; line-height: 1; font-variant-numeric: tabular-nums; }
.sa-partager {
  min-height: 44px; margin-top: 4px; padding: 6px 14px;
  background: var(--soleil); border: 3px solid var(--encre); border-radius: 14px; box-shadow: 0 3px 0 var(--encre);
  font-size: .95rem; font-weight: 800;
}
.sa-partager:active, .sa-qr:active { transform: translateY(3px); box-shadow: 0 0 0 var(--encre); }
.sa-qr {
  width: clamp(92px, 27vw, 116px); aspect-ratio: 1; padding: 4px;
  background: var(--blanc); border: var(--trait); border-radius: 16px; box-shadow: var(--ombre);
}
.qr { display: block; width: 100%; height: 100%; }

/* La pièce : un mur, un sol, une fenêtre, un cadre, une plante et un tapis. */
.sa-piece {
  position: relative; flex: 1 1 auto; min-height: 250px; overflow: hidden; isolation: isolate;
  background: #FFD98A; border: var(--trait); border-radius: 24px; box-shadow: var(--ombre);
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.sa-mur {
  position: absolute; left: 0; right: 0; top: 0; height: 40%;
  background: #C9E8FF repeating-linear-gradient(90deg, rgba(255, 255, 255, .45) 0 14px, transparent 14px 30px);
  border-bottom: 3px solid var(--encre);
}
.sa-fanions { position: absolute; left: 4%; right: 4%; top: 0; display: flex; justify-content: space-between; }
.sa-fanions i { width: 9%; aspect-ratio: 1 / 1.1; background: var(--tomate); border: 2.5px solid var(--encre); border-top: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.sa-fanions i:nth-child(3n + 2) { background: #2F7BFF; }
.sa-fanions i:nth-child(3n) { background: var(--blanc); }
.sa-fenetre {
  position: absolute; left: 9%; top: 26%; width: 24%; height: 58%;
  background: #8FD3FF; border: 3px solid var(--encre); border-radius: 12px; box-shadow: inset 0 0 0 4px var(--blanc);
  overflow: hidden;
}
.sa-fenetre::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: var(--encre); }
.sa-fenetre::after { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 4px; margin-top: -2px; background: var(--encre); }
.sa-fenetre i { position: absolute; left: 14%; top: 20%; width: 42%; height: 22%; background: var(--blanc); border-radius: 999px; box-shadow: 10px 6px 0 -2px var(--blanc); }
.sa-cadre {
  position: absolute; right: 13%; top: 30%; width: 17%; height: 44%;
  background: #FFF6D6; border: 3px solid var(--encre); border-radius: 8px; box-shadow: inset 0 0 0 4px #FF8A1F; rotate: 4deg;
}
.sa-cadre::after { content: "♥"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--tomate); font-size: 1.2rem; line-height: 1; }
.sa-sol {
  position: absolute; left: 0; right: 0; top: 40%; bottom: 0;
  background: repeating-linear-gradient(180deg, transparent 0 24px, rgba(29, 17, 71, .1) 24px 27px);
}
.sa-tapis {
  position: absolute; left: 20%; right: 20%; top: 34%; height: 40%;
  background: #FF6FB5; border: 3px solid var(--encre); border-radius: 50%; box-shadow: inset 0 0 0 7px #FFC2E0;
}
.sa-plante { position: absolute; right: 4%; top: 28%; width: 12%; aspect-ratio: 1 / 1.6; z-index: 5; }
.sa-plante::after {
  content: ""; position: absolute; left: 14%; right: 14%; bottom: 0; height: 40%;
  background: #FF8A1F; border: 3px solid var(--encre); border-radius: 4px 4px 10px 10px;
}
.sa-plante i { position: absolute; bottom: 32%; width: 46%; aspect-ratio: 1 / 1.7; background: #1FB86E; border: 3px solid var(--encre); border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%; transform-origin: 50% 100%; }
.sa-plante i:nth-child(1) { left: 2%; rotate: -28deg; }
.sa-plante i:nth-child(2) { left: 27%; bottom: 38%; height: auto; }
.sa-plante i:nth-child(3) { right: 2%; rotate: 28deg; }
.sa-astuce {
  position: absolute; left: 0; right: 0; bottom: 6px; z-index: 2; text-align: center; pointer-events: none;
  font-size: .85rem; font-weight: 800; opacity: .6;
}

/* Les bonshommes. Seuls des éléments HTML bougent (pas de transform CSS sur le SVG). */
.sa-persos { position: absolute; left: 9%; right: 9%; top: 47%; bottom: 9%; --sa-taille: clamp(52px, 15.5vw, 70px); }
.sa-perso { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.sa-perso-ancre { position: absolute; left: 0; top: 0; width: var(--sa-taille); height: var(--sa-taille); transform: translate(-50%, -100%); }
.sa-perso-saut { position: relative; width: 100%; height: 100%; }
.sa-perso-saut.arrive { animation: sa-arrivee .75s cubic-bezier(.3, 1.2, .5, 1) both; }
.sa-perso-saut.saute { animation: sa-saut .5s ease-out; }
.sa-perso-pas, .sa-perso-corps { width: 100%; height: 100%; }
.sa-perso.marche .sa-perso-pas { animation: sa-pas .26s ease-in-out infinite alternate; }
.sa-perso-corps { transition: opacity .3s; }
.sa-nom {
  position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); margin-bottom: -2px;
  max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--blanc); border: 2px solid var(--encre); border-radius: 999px; padding: 0 8px;
  font-size: .78rem; font-weight: 800; line-height: 1.45;
}
.sa-perso.moi .sa-nom { background: var(--encre); color: var(--blanc); }
.sa-perso.hote .sa-nom::before { content: "★ "; color: #F2B705; }
.sa-coche {
  position: absolute; right: -6px; top: 14%; width: 24px; height: 24px;
  display: grid; place-items: center; background: #1FB86E; color: var(--blanc);
  border: 2.5px solid var(--encre); border-radius: 50%; font-size: .8rem; font-weight: 800; line-height: 1;
  scale: 0; transition: scale .22s cubic-bezier(.3, 1.6, .5, 1);
}
.sa-perso.pret .sa-coche { scale: 1; }
.sa-dodo { position: absolute; left: -8px; top: 2px; font-size: 1.1rem; opacity: 0; transition: opacity .3s; }
.sa-perso.dort .sa-perso-corps { opacity: .45; }
.sa-perso.dort .sa-nom { opacity: .6; }
.sa-perso.dort .sa-dodo { opacity: 1; animation: sa-dodo 2.2s ease-in-out infinite; }
.sa-salut { position: absolute; right: -16px; top: -10px; font-size: 1.6rem; opacity: 0; transform-origin: 70% 90%; }
.sa-perso.salue .sa-salut { animation: sa-salut 1.35s ease-out; }
.sa-perso.appui .sa-perso-corps { opacity: .7; }
.sa-perso.part { opacity: 0; transition: opacity .4s; }
@keyframes sa-arrivee {
  0% { transform: translateY(-150%) scale(.7); opacity: 0; }
  35% { transform: translateY(0) scale(1.08, .9); opacity: 1; }
  52% { transform: translateY(-26%) scale(.96, 1.05); }
  68% { transform: translateY(0) scale(1.04, .95); }
  82% { transform: translateY(-9%); }
  100% { transform: translateY(0); }
}
@keyframes sa-saut { 0% { transform: translateY(0) scale(1.06, .92); } 40% { transform: translateY(-42%) scale(.96, 1.06); } 80% { transform: translateY(0) scale(1.06, .93); } 100% { transform: none; } }
@keyframes sa-pas { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-7%) rotate(4deg); } }
@keyframes sa-dodo { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-3px, -5px); } }
@keyframes sa-salut { 0% { opacity: 0; transform: scale(.4); } 15% { opacity: 1; transform: scale(1.1) rotate(-14deg); } 35% { transform: rotate(16deg); } 55% { transform: rotate(-12deg); } 75% { opacity: 1; transform: rotate(10deg); } 100% { opacity: 0; transform: rotate(0); } }

/* Les voiles : « Partie en cours… », « On attend l'hôte… ». */
.sa-voile { position: absolute; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 14px; background: rgba(255, 203, 46, .8); cursor: default; }
.sa-voile-carte {
  max-width: 300px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  background: var(--blanc); border: var(--trait); border-radius: 22px; box-shadow: var(--ombre); padding: 14px 16px 16px;
}
.sa-voile-carte h2 { font-size: 1.35rem; font-weight: 800; }
.sa-voile-carte .bouton { margin-top: 6px; }
.sa-sablier { font-size: 2rem; line-height: 1; animation: sa-sablier 1.6s ease-in-out infinite; }
@keyframes sa-sablier { 0%, 40% { transform: rotate(0); } 60%, 100% { transform: rotate(180deg); } }

.sa-resume { text-align: center; font-size: 1.1rem; font-weight: 800; }
.sa-consigne { text-align: center; font-size: 1rem; margin-top: -6px; }
.sa-actions { padding-top: 0; }
.sa-salle .sa-actions { flex-direction: row; }
.sa-salle .sa-actions .bouton { flex: 1; padding: 15px 10px; }
.sa-salle .sa-actions .bouton[hidden] + .bouton, .sa-salle .sa-actions .bouton:only-child { flex: 1; }
.bouton.sa-pret { background: var(--soleil); }
.bouton.sa-pret.principal { background: var(--tomate); }
.bouton.sa-pret.est-pret { background: #7FE3B0; }
/* Les boutons de l'hôte « s'allument » quand tout le monde est prêt. */
.bouton.sa-hasard, .bouton.sa-choisir { font-size: 1.15rem; }
.bouton.sa-hasard.principal { background: var(--tomate); }
.bouton.sa-choisir.allume { background: #5CCBFF; }
.bouton.sa-hasard.allume, .bouton.sa-choisir.allume { animation: sa-allume .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes sa-allume { from { transform: scale(.92); } }

/* « On joue à quoi ? » en salon : les joueurs du salon en haut. */
.sa-equipe { cursor: default; }
.sa-equipe-minis { display: flex; flex-wrap: wrap; gap: 2px; min-width: 0; }
.sa-equipe-prets { margin-left: auto; flex: none; padding-left: 8px; font-weight: 800; font-size: .95rem; }
.sa-pas-pret { opacity: .4; }
.sa-compte-regle { max-width: 17em; font-size: 1rem; line-height: 1.3; }

/* Bandeau de connexion, petits messages et fenêtres. */
.sa-bandeau {
  position: fixed; z-index: 60; left: 50%; top: calc(10px + env(safe-area-inset-top)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 6px 16px;
  background: var(--encre); color: var(--blanc); border-radius: 999px; box-shadow: 0 3px 0 rgba(29, 17, 71, .35);
  font-weight: 800; pointer-events: none;
}
.sa-bandeau-point { width: 10px; height: 10px; border-radius: 50%; background: var(--soleil); animation: sa-clignote 1s ease-in-out infinite alternate; }
@keyframes sa-clignote { from { opacity: .25; } to { opacity: 1; } }
.sa-toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 10px 18px; text-align: center;
  background: var(--blanc); border: var(--trait); border-radius: 18px; box-shadow: var(--ombre);
  font-weight: 800; animation: pop .25s cubic-bezier(.3, 1.6, .5, 1); transition: opacity .4s;
}
.sa-toast.part { opacity: 0; }
.sa-dialogue {
  width: min(380px, calc(100vw - 32px)); padding: 18px 18px 16px;
  background: var(--blanc); color: var(--encre); border: var(--trait); border-radius: 26px; box-shadow: 0 8px 0 var(--encre);
  text-align: center;
}
.sa-dialogue::backdrop { background: rgba(29, 17, 71, .55); }
.sa-dialogue h2 { font-size: 1.35rem; font-weight: 800; line-height: 1.2; margin-bottom: 6px; }
.sa-dialogue p { margin-bottom: 4px; }
.sa-dialogue-boutons { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.sa-qr-grand { width: min(260px, 70vw); margin: 6px auto 10px; border: var(--trait); border-radius: 18px; overflow: hidden; }
.sa-lien { width: 100%; margin-top: 8px; padding: 8px 10px; border: 2px dashed rgba(29, 17, 71, .4); border-radius: 12px; font-size: .9rem; text-align: center; background: #FFF6D6; }

/* ---------- La partie en miroir ---------- */
.sa-compte { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(255, 203, 46, .7); }
.sa-compte-boite {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 26px 20px; text-align: center;
  background: var(--blanc); border: var(--trait); border-radius: 28px; box-shadow: 0 8px 0 var(--encre);
}
.sa-compte-jeu { font-size: 1.4rem; font-weight: 800; }
.sa-compte-chiffre {
  width: 112px; height: 112px; display: grid; place-items: center;
  background: var(--tomate); border: var(--trait); border-radius: 50%; box-shadow: var(--ombre);
  font-size: 4rem; font-weight: 800; line-height: 1;
}
.sa-compte-chiffre.pop { animation: pop .3s cubic-bezier(.3, 1.6, .5, 1); }
.sa-compte-qui { font-size: .95rem; }
.sa-attente-verdict {
  position: fixed; z-index: 40; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(420px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; text-align: center;
  background: var(--blanc); border: var(--trait); border-radius: 20px; box-shadow: var(--ombre);
}
/* Chez les invités, ce que seul l'hôte peut toucher. */
.sa-attend { pointer-events: none; }
button.sa-attend { opacity: .65; }
/* « À toi ! » chez celui qui doit jouer. */
.sa-a-toi {
  position: absolute; z-index: 32; left: 50%; top: 42%; transform: translateX(-50%);
  padding: 6px 16px; white-space: nowrap; pointer-events: none;
  background: var(--tomate); border: var(--trait); border-radius: 999px; box-shadow: 0 4px 0 var(--encre);
  font-size: 1.1rem; font-weight: 800;
  animation: sa-a-toi 2.3s ease-out both;
}
@keyframes sa-a-toi { 0% { opacity: 0; transform: translateX(-50%) scale(.6); } 10% { opacity: 1; transform: translateX(-50%) scale(1.08); } 18% { transform: translateX(-50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
/* Pendant un choix secret, chez les autres. */
.sa-secret, .sa-entracte {
  position: absolute; inset: -4px -4px -10px; z-index: 30;
  display: grid; place-items: center; padding: 16px; text-align: center;
  background: var(--soleil);
}
.sa-entracte { background: rgba(255, 203, 46, .9); }
.sa-secret-carte, .sa-entracte-carte {
  max-width: 320px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--blanc); border: var(--trait); border-radius: 26px; box-shadow: 0 8px 0 var(--encre); padding: 16px 20px 20px;
  animation: pop .3s cubic-bezier(.3, 1.6, .5, 1);
}
.sa-secret-avatar { width: 110px; height: 110px; }
.sa-secret-carte p { font-size: 1.25rem; line-height: 1.25; }
.sa-entracte-carte h2 { font-size: 1.4rem; font-weight: 800; line-height: 1.2; }
.sa-entracte-carte p { font-size: 1.05rem; }
.sa-secret-points { display: flex; gap: 6px; }
.sa-secret-points i { width: 10px; height: 10px; border-radius: 50%; background: var(--encre); animation: sa-point 1.2s ease-in-out infinite; }
.sa-secret-points i:nth-child(2) { animation-delay: .2s; }
.sa-secret-points i:nth-child(3) { animation-delay: .4s; }
@keyframes sa-point { 0%, 100% { opacity: .2; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-5px); } }
/* Les manches jouées par tout le monde en même temps : « Tu as fini ! On attend… ». */
.sa-attente-chacun {
  position: absolute; z-index: 30; inset: -4px -4px -10px;
  display: grid; place-items: center; padding: 16px; text-align: center;
  background: rgba(255, 203, 46, .86);
}
.sa-attente-carte {
  max-width: 330px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: var(--blanc); border: var(--trait); border-radius: 26px; box-shadow: 0 8px 0 var(--encre); padding: 16px 18px 18px;
  animation: pop .3s cubic-bezier(.3, 1.6, .5, 1);
}
.sa-attente-carte h2 { font-size: 1.35rem; font-weight: 800; }
.sa-attente-qui { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sa-attente-qui > span { display: flex; flex-direction: column; align-items: center; font-weight: 800; font-size: .95rem; }
.sa-attente-qui .mini { width: 40px; height: 40px; }
.sa-attente-qui .joue .mini { animation: sautille .5s ease-in-out infinite alternate; }
.sa-attente-qui .fini { color: #17A05E; }
.sa-forfait { padding: 10px 12px; font-size: 1rem; background: var(--soleil); }
/* Le bilan d'une manche, le même sur tous les natels. */
.terrain.sa-bilan-terrain { display: flex; flex-direction: column; padding: 12px; overflow-y: auto; background: #fff; touch-action: auto; }
.sa-bilan-titre { margin: 0 0 8px; font-size: 1.2rem; font-weight: 800; text-align: center; }
.sa-bilan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; position: relative; z-index: 2; }
.sa-bilan li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #F4F6FA; border-radius: 14px; animation: pop .3s ease-out both; }
.sa-bilan li.reussi { background: #D4F5E2; }
.sa-bilan li.rate { background: #FFC9C9; }
.sa-bilan .mini { flex: none; width: 36px; height: 36px; }
.sa-bilan-ligne { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.sa-bilan-ligne b { font-weight: 800; }
.sa-bilan-ligne small { font-size: .8rem; font-weight: 600; opacity: .75; overflow-wrap: anywhere; }
.sa-bilan-score { flex: none; font-weight: 800; font-size: 1.1rem; }
.lu-bilan { margin: 14px; }
/* L'hôte peut jouer pour un joueur qui ne répond plus. */
.sa-relais {
  position: absolute; z-index: 34; left: 6px; right: 6px; bottom: 6px;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px;
  background: var(--blanc); border: var(--trait); border-radius: 18px; box-shadow: var(--ombre);
  font-weight: 800;
}
.sa-relais span { flex: 1; line-height: 1.2; }
.sa-relais .bouton { width: auto; flex: none; padding: 10px 14px; font-size: 1rem; background: var(--soleil); }

@media (prefers-reduced-motion: reduce) {
  .sa-perso-saut.arrive, .sa-perso-saut.saute, .sa-perso.marche .sa-perso-pas, .sa-perso.dort .sa-dodo,
  .sa-sablier, .sa-bandeau-point, .sa-compte-chiffre.pop, .sa-toast,
  .bouton.sa-hasard.allume, .bouton.sa-choisir.allume, .sa-secret-carte, .sa-entracte-carte, .sa-secret-points i { animation: none; }
  .sa-a-toi { animation: none; opacity: 1; }
  .sa-attente-carte, .sa-attente-qui .joue .mini, .sa-bilan li { animation: none; }
  .sa-perso.salue .sa-salut { animation: none; opacity: 1; }
  .sa-coche { transition: none; }
}
