/* ============================================================
   neo — les étapes de la création du ninja
   Chargé après neo.css, sous html.neo comme lui. Un fichier par
   chantier pour que les refontes parallèles ne se marchent pas dessus.
   ============================================================ */

/* ------------------------------------------------------------------------
   LA CRÉATION EN SCÈNES  [26/10/2026]
   Le DOM vient de `crSquelette` (game.js) :
     .crs.crs-<étape>
       .crs-gauche  → .crs-scene (.crs-cadre décor · .crs-figs personnages)
                      .crs-plaque (ce que le choix change)
       .crs-cote    → .crs-tete · .crs-intro · .crs-dossier · .crs-liste
                      .crs-extra · .crs-barre
   Les deux colonnes sont en `display: contents` : sur téléphone tout se
   range dans UNE pile (flex + order), sur grand écran dans DEUX colonnes
   (grille). La plaque passe DEVANT le bas du cadre : les jambes des
   personnages vont derrière elle, leur tête dépasse le haut du cadre.
   Pas de verre, pas de halo, pas de dégradé : des aplats, une ombre noire.
   ------------------------------------------------------------------------ */

/* ---------- l'écran : toute la largeur, la scène monte au bord ---------- */
html.neo #screen-create.active:has(.crs) {
  max-width: none !important;
  padding: 0 !important;
  min-height: 100svh;
}
html.neo #screen-create:has(.crs) .create-head {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: 0 !important; padding: 0 !important; border: 0 !important;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
html.neo #screen-create:has(.crs) #create-banner { display: none !important; }
html.neo #screen-create #create-list:has(> .crs) { display: block; gap: 0; }
/* Le son se range contre la langue : le titre de l'étape prend le milieu. */
html.neo body:has(#screen-create.active .crs) .nj-snd-btn { right: calc(72px + env(safe-area-inset-right)); }
/* `body { overflow-x: hidden }` en fait un conteneur de défilement qui ne
   défile jamais : rien n'y colle (voir les deux essais notés dans style.css).
   `clip` rogne pareil sans créer ce conteneur — la barre et la scène collent. */
html.neo body:has(#screen-create.active .crs) { overflow-x: clip; overflow-y: visible; }

html.neo .crs {
  --crs-g: 12px;                                   /* la gouttière */
  --crs-scene-h: clamp(200px, 32svh, 300px);
  --crs-katon: #ff6a2b;
  --crs-suiton: #4cb3ff;
  --crs-doton: #c79a5b;
  --crs-raiton: #ffd84a;
  --crs-futon: #7fe0b0;
  --crs-sortie: cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  color: var(--n-encre);
  font-family: var(--n-titre);
}
html.neo .crs-gauche,
html.neo .crs-cote { display: contents; }
html.neo .crs-tete { order: 1; }
html.neo .crs-dossier { order: 2; }
html.neo .crs-intro { order: 3; }
html.neo .crs-scene { order: 4; }
html.neo .crs-plaque { order: 5; }
html.neo .crs-liste { order: 6; }
html.neo .crs-extra { order: 7; }
html.neo .crs-barre { order: 8; }

/* ---------- l'en-tête : l'étape, entre le retour et les réglages ---------- */
html.neo .crs-tete {
  min-height: calc(60px + env(safe-area-inset-top));
  padding: calc(14px + env(safe-area-inset-top)) 128px 0 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
html.neo .crs-etape {
  margin: 0;
  font-size: 10.5px; font-weight: 800; line-height: 1.2;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--n-orange);
}
html.neo .crs-titre {
  margin: 2px 0 0;
  font-size: clamp(15px, 4.4vw, 19px); font-weight: 900; line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--n-encre);
}
html.neo .crs-intro {
  margin: 12px var(--crs-g) 0;
  padding: 0 4px;
  font-size: 13.5px; line-height: 1.45;
  color: var(--n-doux);
}

/* ---------- le dossier : un jeton par étape, relié au suivant ---------- */
html.neo .crs-dossier {
  list-style: none;
  margin: 12px var(--crs-g) 0;
  padding: 0;
  display: flex;
}
html.neo .crs-dossier > li {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex; flex-direction: column; align-items: center;
}
html.neo .crs-dossier > li:not(:last-child)::after {
  content: "";
  position: absolute; z-index: 0;
  top: 17px; left: calc(50% + 22px); right: calc(-50% + 22px);
  height: 2px; border-radius: 2px;
  background: var(--n-filet-fort);
}
html.neo .crs-dossier > li.fait::after { background: var(--n-orange); }
html.neo .crs-dossier > li > button {
  all: unset;
  box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center;
  max-width: 100%;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
html.neo .crs-dossier > li > button:focus-visible { outline: 2px solid var(--n-orange); outline-offset: 3px; }
html.neo .crs-j-vis {
  position: relative; z-index: 1;
  flex: none;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--n-s2);
  border: 1.5px solid var(--n-filet-fort);
  color: var(--n-pale);
  transition: transform 0.2s var(--crs-sortie), border-color 0.2s;
}
html.neo .crs-j-vis img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
html.neo .crs-j-vis img.crs-j-drapeau {
  width: 100%; height: 100%;
  border-radius: 50%;
  outline: 0; box-shadow: none; background: transparent;
  vertical-align: top;
}
html.neo .crs-j-n { font-size: 12.5px; font-weight: 900; font-variant-numeric: tabular-nums; }
html.neo .crs-j-k { font-size: 17px; font-weight: 900; line-height: 1; color: var(--n-encre); }
html.neo .crs-dossier > li.ici .crs-j-vis {
  border: 2px solid var(--n-orange);
  background: #2b1a0b;
  color: var(--n-orange);
}
html.neo .crs-dossier > li.fait .crs-j-vis { border-color: var(--n-orange); }
html.neo .crs-dossier > li.plus { opacity: 0.5; }
html.neo .crs-j-l {
  max-width: 100%;
  margin-top: 5px;
  font-size: 9.5px; font-weight: 800; line-height: 1.1;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--n-pale);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html.neo .crs-dossier > li.ici .crs-j-l { color: var(--n-orange); }
html.neo .crs-dossier > li.fait .crs-j-l { color: var(--n-doux); }
@media (hover: hover) and (pointer: fine) {
  html.neo .crs-dossier > li > button:hover .crs-j-vis { transform: translateY(-2px); border-color: var(--n-encre); }
  html.neo .crs-dossier > li > button:hover .crs-j-l { color: var(--n-encre); }
}
html.neo .crs-nat-katon { color: var(--crs-katon) !important; }
html.neo .crs-nat-suiton { color: var(--crs-suiton) !important; }
html.neo .crs-nat-doton { color: var(--crs-doton) !important; }
html.neo .crs-nat-raiton { color: var(--crs-raiton) !important; }
html.neo .crs-nat-futon { color: var(--crs-futon) !important; }

/* ---------- la scène : un lieu, des personnages qui sortent du cadre ---------- */
html.neo .crs-scene {
  position: relative; z-index: 1;
  height: var(--crs-scene-h);
  margin-top: 40px;                 /* la place de la tête qui dépasse */
}
html.neo .crs-cadre {
  position: absolute;
  inset: 0 var(--crs-g);
  overflow: hidden;
  isolation: isolate;
  border-radius: 22px;
  background: var(--n-s1);
  border: 1px solid var(--n-filet-fort);
  box-shadow: var(--n-ombre);
  animation: crs-cadre-entre 0.5s var(--crs-sortie) both;
}
/* Un voile uni : le décor recule, le personnage reste devant. */
html.neo .crs-cadre::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: rgba(10, 11, 15, 0.2);
  pointer-events: none;
}
html.neo .crs-decor {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 55%;
  animation: crs-decor-entre 0.75s var(--crs-sortie) both;
}
html.neo .crs-decor.part { z-index: -1; animation: crs-decor-sort 0.5s ease-out both; }
html.neo .crs-scene[data-ton="katon"] .crs-cadre { border-color: color-mix(in srgb, var(--crs-katon) 60%, transparent); }
html.neo .crs-scene[data-ton="suiton"] .crs-cadre { border-color: color-mix(in srgb, var(--crs-suiton) 60%, transparent); }
html.neo .crs-scene[data-ton="doton"] .crs-cadre { border-color: color-mix(in srgb, var(--crs-doton) 60%, transparent); }
html.neo .crs-scene[data-ton="raiton"] .crs-cadre { border-color: color-mix(in srgb, var(--crs-raiton) 60%, transparent); }
html.neo .crs-scene[data-ton="futon"] .crs-cadre { border-color: color-mix(in srgb, var(--crs-futon) 60%, transparent); }

html.neo .crs-figs {
  position: absolute; z-index: 2;
  left: var(--crs-g); right: var(--crs-g);
  top: -40px; bottom: -36px;
  pointer-events: none;
}
html.neo .crs-lot {
  position: absolute; inset: 0;
  display: flex; justify-content: center; align-items: flex-end;
  animation: crs-lot-entre 0.6s 0.08s var(--crs-sortie) both;
}
html.neo .crs-lot.entre { animation: crs-lot-glisse 0.45s var(--crs-sortie) both; }
html.neo .crs-lot.part { animation: crs-lot-sort 0.32s ease-in both; }
html.neo .crs-fig {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  height: 100%; width: auto; max-width: 74%;
  object-fit: contain; object-position: 50% 100%;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 14px 14px rgba(0, 0, 0, 0.6));
  transition: scale 0.4s var(--crs-sortie), filter 0.35s ease-out;
}
html.neo .crs-lot[data-n="2"] .crs-fig { height: 94%; max-width: 54%; }
html.neo .crs-lot[data-n="2"] .crs-fig + .crs-fig { margin-left: -9%; }
html.neo .crs-lot[data-n="3"] .crs-fig { height: 84%; max-width: 42%; }
html.neo .crs-lot[data-n="3"] .crs-fig:nth-child(2) { height: 100%; margin: 0 -9%; z-index: 1; }
html.neo .crs-lot .crs-fig:not(.loin) { z-index: 2; }
/* Trois sensei : celui qu'on regarde passe devant, à pleine taille. */
html.neo .crs-lot[data-n="3"]:has(.loin) .crs-fig:nth-child(2) { height: 84%; }
html.neo .crs-lot[data-n="3"]:has(.loin) .crs-fig:not(.loin) { height: 100%; }
html.neo .crs-fig.loin { scale: 0.88; filter: brightness(0.36) saturate(0.5) drop-shadow(0 10px 10px rgba(0, 0, 0, 0.5)); }
html.neo .crs-fig.silh { filter: brightness(0) drop-shadow(0 0 1px rgba(255, 255, 255, 0.35)); }
html.neo .crs-fig.silh.loin { filter: brightness(0) opacity(0.6); }

/* ---------- la plaque : ce que le choix change en jeu ---------- */
/* Longue liste (villages, clans) : la scène se fait plus basse pour que la
   première rangée de tuiles tienne au-dessus de la barre. */
html.neo .crs:has(.crs-liste-2) { --crs-scene-h: clamp(160px, 22svh, 220px); }

html.neo .crs-plaque {
  position: relative; z-index: 3;
  margin: -52px var(--crs-g) 0;
  padding: 16px 16px 15px;
  background: var(--n-s1);
  border: 1px solid var(--n-filet-fort);
  border-radius: 18px;
  box-shadow: 0 -12px 22px -16px rgba(0, 0, 0, 0.95), var(--n-ombre);
}
html.neo .crs-plaque::before {
  content: "";
  position: absolute; left: 18px; top: -1px;
  width: 46px; height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--n-orange);
}
html.neo .crs-kicker {
  position: absolute; width: 1px; height: 1px;
  margin: 0; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
html.neo .crs-nom {
  margin: 0;
  font-size: clamp(22px, 6.2vw, 28px); font-weight: 900; line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--n-encre);
}
html.neo .crs-sous {
  margin: 5px 0 0;
  font-size: 11px; font-weight: 800; line-height: 1.25;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--n-or);
}
html.neo .crs-texte {
  margin: 8px 0 0;
  font-size: 14.5px; line-height: 1.45;
  color: var(--n-doux);
}
html.neo .crs-regle {
  margin: 10px 0 0;
  padding: 8px 11px;
  font-size: 13.5px; line-height: 1.42;
  color: var(--n-encre);
  background: var(--n-s2);
  border-left: 3px solid var(--n-orange);
  border-radius: 4px 10px 10px 4px;
}
html.neo .crs-regle b { font-weight: 800; color: var(--n-orange); }
html.neo .crs-faits {
  list-style: none;
  margin: 10px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
html.neo .crs-fait {
  padding: 6px 9px;
  font-size: 12.5px; font-weight: 700; line-height: 1.2;
  color: var(--n-doux);
  background: var(--n-s2);
  border: 1px solid var(--n-filet-fort);
  border-radius: 8px;
}
html.neo .crs-fait b { font-weight: 900; color: var(--n-encre); }
html.neo .crs-fait.bon { color: var(--n-vert); border-color: rgba(67, 209, 122, 0.38); }
html.neo .crs-fait.bon b { color: var(--n-vert); }
html.neo .crs-fait.dur { color: #ff7a7a; border-color: rgba(255, 77, 77, 0.38); }
html.neo .crs-fait.dur b { color: #ff7a7a; }
html.neo .crs-fait.or { color: var(--n-or); border-color: rgba(242, 193, 78, 0.42); }

html.neo .crs-apt { margin-top: 12px; }
html.neo .crs-apt-t {
  margin: 0 0 7px;
  font-size: 10.5px; font-weight: 800; line-height: 1.2;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--n-pale);
}
html.neo .crs-apt ul {
  list-style: none;
  margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px;
}
html.neo .crs-apt li {
  position: relative;
  min-width: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 2px 5px;
  background: var(--n-s2);
  border: 1px solid var(--n-filet);
  border-radius: 10px;
}
html.neo .crs-apt span {
  max-width: 100%;
  font-size: 9.5px; font-weight: 700; line-height: 1.2;
  color: var(--n-pale);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html.neo .crs-apt b {
  font-size: 19px; font-weight: 900; line-height: 1.12;
  font-variant-numeric: tabular-nums;
  color: var(--n-chakra);
}
html.neo .crs-apt i {
  position: absolute; top: -8px; right: -3px;
  padding: 1px 5px;
  font-style: normal; font-size: 10px; font-weight: 900; line-height: 1.3;
  font-variant-numeric: tabular-nums;
  border-radius: 6px;
}
html.neo .crs-apt i.plus { background: var(--n-vert); color: #04150a; }
html.neo .crs-apt i.moins { background: var(--n-rouge); color: #1d0505; }
@media (max-width: 389px) {
  html.neo .crs-apt ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* La plaque relit le choix : ses lignes remontent l'une après l'autre. */
html.neo .crs-plaque.crs-relance > * { animation: crs-plaque-entre 0.42s var(--crs-sortie) both; }
html.neo .crs-plaque.crs-relance > :nth-child(3) { animation-delay: 0.04s; }
html.neo .crs-plaque.crs-relance > :nth-child(4) { animation-delay: 0.08s; }
html.neo .crs-plaque.crs-relance > :nth-child(5) { animation-delay: 0.12s; }
html.neo .crs-plaque.crs-relance > :nth-child(n+6) { animation-delay: 0.16s; }

/* ---------- les tuiles : toucher montre, « Choisir » engage ---------- */
html.neo .crs-liste {
  --tuile-l: 84px;
  position: relative;
  display: flex; gap: 10px;
  margin: 0;
  padding: 32px var(--crs-g) 14px;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-padding: 0 var(--crs-g);
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
html.neo .crs-liste::-webkit-scrollbar { display: none; }
html.neo .crs-paquet { flex: none; display: flex; gap: 8px; }
html.neo .crs-groupe {
  flex: none;
  align-self: stretch;
  margin: 0;
  padding: 0 0 0 6px;
  writing-mode: vertical-rl;
  rotate: 180deg;
  text-align: center;
  font-size: 9.5px; font-weight: 800; line-height: 1;
  letter-spacing: 0.12em; text-transform: uppercase;
  white-space: nowrap;
  color: var(--n-pale);
  border-left: 1px solid var(--n-filet-fort);
}
html.neo .crs-grille {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(var(--rangs, 1), auto);
  grid-auto-columns: var(--tuile-l);
  gap: 30px 8px;
}
/* Une seule rangée sans intertitre (époque, style, escouade) : tout tient. */
html.neo .crs-liste:not(.crs-liste-2) > .crs-paquet:only-child { flex: 1 1 0; min-width: 0; }
html.neo .crs-liste:not(.crs-liste-2) > .crs-paquet:only-child .crs-grille { flex: 1 1 0; min-width: 0; grid-auto-columns: minmax(0, 1fr); }

html.neo .crs-tuile {
  position: relative;
  min-width: 0;
  display: flex; flex-direction: column; align-items: stretch;
  margin: 0;
  padding: 5px 5px 9px;
  font: inherit; text-align: center;
  color: var(--n-encre);
  background: var(--n-s2);
  border: 1.5px solid var(--n-filet-fort);
  border-radius: 14px;
  box-shadow: var(--n-ombre-choix);
  cursor: pointer;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.24s var(--crs-sortie), scale 0.12s ease-out, border-color 0.18s, background-color 0.18s;
  animation: crs-tuile-entre 0.45s var(--crs-sortie) both;
  animation-delay: calc(min(var(--i, 0), 12) * 28ms + 120ms);
}
html.neo .crs-tuile:active { scale: 0.96; }
html.neo .crs-tuile:focus-visible { outline: 2px solid var(--n-orange); outline-offset: 2px; }
html.neo .crs-tuile[aria-pressed="true"] {
  transform: translateY(-4px);
  border-color: var(--n-orange);
  background: #2a1d12;
}
html.neo .crs-tuile[aria-pressed="true"]::after {
  content: "";
  position: absolute; left: 50%; bottom: -9px;
  width: 20px; height: 4px; border-radius: 2px;
  translate: -50% 0;
  background: var(--n-orange);
}
@media (hover: hover) and (pointer: fine) {
  html.neo .crs-tuile:not([aria-pressed="true"]):hover { border-color: rgba(255, 138, 31, 0.55); background: var(--n-s3); }
}
/* La fenêtre de la tuile : le buste en sort par le haut, jamais par les côtés. */
html.neo .crs-t-vis {
  position: relative;
  display: block;
  height: 56px;
  border-radius: 10px;
  background: var(--n-s3);
  clip-path: inset(-44px 0 0 0 round 0 0 10px 10px);
}
html.neo .crs-t-perso .crs-t-vis img {
  position: absolute; left: 50%; bottom: 0;
  height: 82px; width: auto; max-width: none;
  translate: -50% 0;
  transform-origin: 50% 100%;
  transition: scale 0.3s var(--crs-sortie);
}
html.neo .crs-tuile[aria-pressed="true"] .crs-t-vis img:not(.crs-t-lieu) { scale: 1.08; }
html.neo img.crs-t-lieu {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 10px;
}
html.neo .crs-t-vis img.crs-t-embleme {
  position: absolute; left: 50%; bottom: -10px;
  width: 26px; height: 26px;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--n-fond);
  outline: 0;
  box-shadow: 0 0 0 2px var(--n-s2);
  vertical-align: top;
}
html.neo .crs-t-lieu + .crs-t-embleme,
html.neo .crs-t-vis:has(.crs-t-embleme) { clip-path: none; }
html.neo .crs-tuile[aria-pressed="true"] .crs-t-vis img.crs-t-embleme { box-shadow: 0 0 0 2px #2a1d12; }
html.neo .crs-t-lieu ~ .crs-t-nom,
html.neo .crs-t-vis:has(.crs-t-embleme) + .crs-t-nom { margin-top: 13px; }
html.neo .crs-t-vis.crs-t-sceau { display: grid; place-items: center; }
html.neo .crs-t-vis.crs-t-sceau > span {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  font-size: 22px; font-weight: 900; line-height: 1;
  color: #ffb199;
  background: #3a1511;
  border: 1.5px solid rgba(255, 110, 80, 0.5);
  border-radius: 9px;
  rotate: -5deg;
  transition: rotate 0.3s var(--crs-sortie);
}
html.neo .crs-tuile[aria-pressed="true"] .crs-t-vis.crs-t-sceau > span { rotate: 0deg; }
html.neo .crs-t-nom {
  display: block;
  margin-top: 7px;
  font-size: 12px; font-weight: 800; line-height: 1.15;
  color: var(--n-encre);
  overflow-wrap: anywhere;
  hyphens: auto;
}
html.neo .crs-t-sous {
  display: block;
  margin-top: 3px;
  font-size: 10px; font-weight: 700; line-height: 1.2;
  color: var(--n-pale);
}
html.neo .crs-club .crs-t-sous { color: var(--n-or); letter-spacing: 0.08em; }

/* ---------- l'interrupteur de l'époque ---------- */
html.neo .crs-extra { margin: 4px var(--crs-g) 0; }
html.neo .crs-extra:empty { display: none; }
html.neo .crs-bascule {
  all: unset;
  box-sizing: border-box;
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: var(--n-s1);
  border: 1px solid var(--n-filet-fort);
  border-radius: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
html.neo .crs-bascule:focus-visible { outline: 2px solid var(--n-orange); outline-offset: 2px; }
html.neo .crs-bascule-case {
  position: relative;
  flex: none;
  width: 44px; height: 26px;
  border-radius: 13px;
  background: var(--n-s3);
  border: 1px solid var(--n-filet-fort);
  transition: background-color 0.2s, border-color 0.2s;
}
html.neo .crs-bascule-case::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--n-doux);
  transition: translate 0.24s var(--crs-sortie), background-color 0.2s;
}
html.neo .crs-bascule[aria-checked="true"] .crs-bascule-case { background: var(--n-orange); border-color: var(--n-orange); }
html.neo .crs-bascule[aria-checked="true"] .crs-bascule-case::after { translate: 18px 0; background: #1a0b00; }
html.neo .crs-bascule-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
html.neo .crs-bascule-txt b { font-size: 14px; font-weight: 800; line-height: 1.25; color: var(--n-encre); }
html.neo .crs-bascule-txt small { font-size: 12.5px; line-height: 1.35; color: var(--n-doux); }

/* ---------- la barre : l'action qui engage, toujours sous le pouce ---------- */
html.neo .crs-barre {
  position: sticky; bottom: 0; z-index: 20;
  margin-top: auto;
  padding: 12px var(--crs-g) calc(12px + env(safe-area-inset-bottom));
  background: var(--n-fond);
  border-top: 1px solid var(--n-filet);
}
html.neo .crs .crs-go.btn-gold {
  display: block;
  width: 100%; min-height: 54px;
  margin: 0;
  padding: 14px 18px;
  font: 900 16px/1.2 var(--n-titre);
  letter-spacing: 0.01em;
  color: #1a0b00;
  background: var(--n-orange);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 -3px 0 rgba(0, 0, 0, 0.22) inset, 0 12px 20px -12px rgba(0, 0, 0, 0.95);
  text-shadow: none;
}
html.neo .crs .crs-go.btn-gold:disabled {
  cursor: default;
  color: var(--n-pale);
  background: var(--n-s3);
  box-shadow: none;
  filter: none;
}

/* ---------- la feuille de chakra ---------- */
html.neo .crs-papier {
  position: absolute; z-index: 3;
  left: 50%; top: 50%;
  width: 104px; height: 128px;
  translate: -50% -50%;
  rotate: -4deg;
  display: flex;
  filter: drop-shadow(0 16px 14px rgba(0, 0, 0, 0.7));
}
html.neo .crs-papier-g,
html.neo .crs-papier-d {
  position: relative;
  flex: 1 1 50%;
  overflow: hidden;
  background: #efe5cc;
  transition: background-color 0.5s;
}
html.neo .crs-papier-g { border-radius: 4px 0 0 4px; box-shadow: inset -1px 0 0 rgba(60, 40, 20, 0.16); }
html.neo .crs-papier-d { border-radius: 0 4px 4px 0; }
html.neo .crs-papier i {
  position: absolute; top: 50%;
  font-style: normal; font-size: 54px; font-weight: 900; line-height: 1;
  color: rgba(150, 44, 24, 0.55);
}
html.neo .crs-papier-g i { left: 100%; translate: -50% -50%; }
html.neo .crs-papier-d i { left: 0; translate: -50% -50%; }
/* On presse : le papier tremble entre les doigts. */
html.neo .crs-papier.lit { scale: 0.94; animation: crs-presse 0.95s ease-in-out both; }
html.neo .crs-papier.lit-katon :is(.crs-papier-g, .crs-papier-d) { background: #f7d2ae; }
html.neo .crs-papier.lit-suiton :is(.crs-papier-g, .crs-papier-d) { background: #d6dfe0; }
html.neo .crs-papier.lit-doton :is(.crs-papier-g, .crs-papier-d) { background: #e2d0ac; }
html.neo .crs-papier.lit-raiton :is(.crs-papier-g, .crs-papier-d) { background: #f1ecd0; }
html.neo .crs-papier.lit-futon :is(.crs-papier-g, .crs-papier-d) { background: #f3f0e2; }
/* Lu : chaque nature laisse le papier dans SON état (l'état final est
   écrit hors animation, pour qu'il tienne aussi sans mouvement). */
html.neo .crs-papier.lu-katon :is(.crs-papier-g, .crs-papier-d) {
  background: #2c170d;
  clip-path: inset(0 0 100% 0);
  animation: crs-brule 1.1s ease-in both;
}
html.neo .crs-papier.lu-katon i { color: rgba(255, 120, 60, 0.6); }
html.neo .crs-papier.lu-suiton { translate: -50% -46%; }
html.neo .crs-papier.lu-suiton :is(.crs-papier-g, .crs-papier-d) {
  background: #8ea2ad;
  animation: crs-mouille 1s ease-out both;
}
html.neo .crs-papier.lu-suiton i { color: rgba(20, 50, 80, 0.45); }
html.neo .crs-papier.lu-doton {
  scale: 0.8; rotate: 10deg;
  clip-path: polygon(0 7%, 16% 0, 44% 5%, 70% 0, 100% 9%, 95% 38%, 100% 70%, 86% 100%, 54% 93%, 22% 100%, 0 86%, 6% 50%);
  animation: crs-effrite 0.9s ease-out both;
}
html.neo .crs-papier.lu-doton :is(.crs-papier-g, .crs-papier-d) { background: #b48f5f; }
html.neo .crs-papier.lu-raiton {
  scale: 0.76; rotate: -12deg;
  clip-path: polygon(0 0, 22% 6%, 40% 0, 62% 7%, 84% 0, 100% 10%, 93% 30%, 100% 52%, 92% 74%, 100% 100%, 74% 93%, 50% 100%, 28% 92%, 0 100%, 7% 76%, 0 50%, 8% 24%);
  animation: crs-froisse 0.8s steps(8, end) both;
}
html.neo .crs-papier.lu-raiton :is(.crs-papier-g, .crs-papier-d) { background: #e4d9b9; }
html.neo .crs-papier.lu-futon .crs-papier-g { translate: -30px 6px; rotate: -13deg; animation: crs-fend-g 0.7s var(--crs-sortie) both; }
html.neo .crs-papier.lu-futon .crs-papier-d { translate: 30px -4px; rotate: 11deg; animation: crs-fend-d 0.7s var(--crs-sortie) both; }
html.neo .crs-kanji {
  position: absolute; z-index: 2;
  left: 50%; top: 50%;
  translate: -50% -52%;
  font-size: clamp(130px, 40vw, 190px); font-weight: 900; line-height: 1;
  color: transparent;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
html.neo .crs-kanji:empty { display: none; }
html.neo .crs-kanji.entre { animation: crs-kanji 0.8s var(--crs-sortie) both; }

/* ---------- le nom et le dossier complet ---------- */
html.neo .crs-name .crs-plaque { padding-top: 18px; }
html.neo .crs-champ-l { display: flex; gap: 8px; }
html.neo .crs-champ {
  flex: 1 1 auto;
  min-width: 0;
  height: 56px;
  padding: 0 16px;
  font: 800 20px/1 var(--n-titre);
  letter-spacing: -0.01em;
  color: var(--n-encre);
  background: var(--n-fond);
  border: 1.5px solid var(--n-filet-fort);
  border-radius: 14px;
}
html.neo .crs-champ::placeholder { font-size: 16px; font-weight: 600; color: var(--n-pale); }
html.neo .crs-champ:focus { outline: none; border-color: var(--n-orange); }
html.neo .crs .crs-de {
  flex: none;
  align-self: auto;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  padding: 0;
  color: var(--n-encre);
  background: var(--n-s2);
  border: 1.5px solid var(--n-filet-fort);
  border-radius: 14px;
  cursor: pointer;
  transition: rotate 0.35s var(--crs-sortie), border-color 0.18s, color 0.18s;
}
html.neo .crs .crs-de:active { rotate: -24deg; }
html.neo .crs .crs-de:focus-visible { outline: 2px solid var(--n-orange); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  html.neo .crs .crs-de:hover { color: var(--n-orange); border-color: var(--n-orange); }
}
html.neo .crs-recap {
  margin-top: 10px;
  padding: 14px 12px 12px;
  background: var(--n-s1);
  border: 1px solid var(--n-filet-fort);
  border-radius: 18px;
}
html.neo .crs-recap-t {
  margin: 0 0 9px 2px;
  font-size: 11px; font-weight: 800; line-height: 1.2;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--n-orange);
}
html.neo .crs-recap ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
html.neo .crs-recap li > button,
html.neo .crs-recap li.crs-r-fixe {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 5px 10px;
  background: var(--n-s2);
  border: 1px solid var(--n-filet);
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: crs-tuile-entre 0.4s var(--crs-sortie) both;
}
html.neo .crs-recap li.crs-r-fixe { cursor: default; }
html.neo .crs-recap li:nth-child(2) > button { animation-delay: 0.04s; }
html.neo .crs-recap li:nth-child(3) > button { animation-delay: 0.08s; }
html.neo .crs-recap li:nth-child(4) > button { animation-delay: 0.12s; }
html.neo .crs-recap li:nth-child(5) > button { animation-delay: 0.16s; }
html.neo .crs-recap li:nth-child(n+6) > button { animation-delay: 0.2s; }
html.neo .crs-recap li > button:focus-visible { outline: 2px solid var(--n-orange); outline-offset: 2px; }
html.neo .crs-recap .crs-j-vis { grid-row: 1 / 3; border-color: var(--n-orange); }
html.neo .crs-recap .crs-r-l {
  grid-column: 2; grid-row: 1;
  font-size: 10px; font-weight: 800; line-height: 1.2;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--n-pale);
}
html.neo .crs-recap .crs-r-v {
  grid-column: 2; grid-row: 2;
  font-size: 14.5px; font-weight: 800; line-height: 1.25;
  color: var(--n-encre);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html.neo .crs-recap .crs-r-m {
  grid-column: 3; grid-row: 1 / 3;
  font-size: 12px; font-weight: 800;
  color: var(--n-orange);
}
@media (hover: hover) and (pointer: fine) {
  html.neo .crs-recap li > button:hover { border-color: rgba(255, 138, 31, 0.55); background: var(--n-s3); }
}
html.neo .crs-recap .crs-apt { margin-top: 14px; }

/* ---------- tablette : la pile, centrée ---------- */
@media (min-width: 600px) and (max-width: 899px) {
  html.neo .crs { max-width: 680px; margin: 0 auto; --crs-g: 16px; --crs-scene-h: clamp(260px, 36svh, 380px); }
  html.neo .crs-tete { padding-left: 80px; padding-right: 150px; }
}

/* ---------- grand écran : la scène à gauche, le dossier à droite ----------
   Deux colonnes, une seule rangée : la scène COLLE en haut (100svh) pendant
   que la colonne de droite défile ; la barre colle en bas de cette colonne. */
@media (min-width: 900px) {
  html.neo .crs {
    --crs-g: 0px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 480px);
    column-gap: clamp(28px, 3.4vw, 56px);
    align-items: start;
    max-width: 1560px;
    margin: 0 auto;
    padding: 0 clamp(20px, 2.6vw, 40px);
  }
  html.neo .crs-gauche {
    display: block;
    position: sticky; top: 0;
    height: 100svh; min-height: 620px;
  }
  html.neo .crs-cote {
    display: flex; flex-direction: column;
    min-height: 100svh;
  }
  html.neo .crs-scene { position: absolute; inset: 0; height: auto; margin: 0; }
  html.neo .crs-cadre {
    inset: calc(88px + env(safe-area-inset-top)) 0 64px;
    border-radius: 28px;
  }
  /* Agrandi au-delà de sa taille, le décor flouterait mal : un flou franc le
     met au second plan, derrière un personnage net. */
  html.neo .crs-decor { filter: blur(2px) saturate(0.92); scale: 1.03; }
  html.neo .crs-cadre::after { background: rgba(10, 11, 15, 0.3); }
  html.neo .crs-figs {
    left: 0; right: 0;
    top: calc(36px + env(safe-area-inset-top));
    bottom: 160px;
  }
  html.neo .crs-fig { max-width: 66%; }
  html.neo .crs-lot[data-n="2"] .crs-fig { max-width: 50%; }
  html.neo .crs-lot[data-n="3"] .crs-fig { max-width: 36%; }
  html.neo .crs-gauche > .crs-plaque {
    position: absolute; left: 28px; right: 28px; bottom: 28px;
    max-height: calc(100% - 300px);
    overflow: auto;
    margin: 0;
    padding: 20px 22px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 22px;
    align-items: start;
  }
  html.neo .crs-gauche > .crs-plaque > * { grid-column: 1; }
  html.neo .crs-gauche > .crs-plaque > .crs-apt { grid-column: 2; grid-row: 1 / span 8; margin: 2px 0 0; width: 228px; }
  html.neo .crs-gauche > .crs-plaque > .crs-apt ul { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  html.neo .crs-nom { font-size: clamp(28px, 2.6vw, 38px); }
  html.neo .crs-texte { font-size: 15.5px; max-width: 62ch; }
  html.neo .crs-regle { font-size: 14px; max-width: 64ch; }
  html.neo .crs-apt b { font-size: 21px; }
  html.neo .crs-apt span { font-size: 10px; }

  html.neo .crs-tete { min-height: 0; padding: calc(90px + env(safe-area-inset-top)) 0 0; }
  html.neo .crs-etape { font-size: 12px; }
  html.neo .crs-titre { margin-top: 6px; font-size: clamp(32px, 3vw, 42px); line-height: 1.02; letter-spacing: -0.02em; }
  html.neo .crs-intro { order: 2; margin: 12px 0 0; padding: 0; font-size: 15px; max-width: 46ch; }
  html.neo .crs-dossier { order: 3; margin: 24px 0 0; }
  html.neo .crs-cote > .crs-plaque { order: 4; margin: 22px 0 0; }
  html.neo .crs-cote > .crs-plaque > .crs-apt { margin-top: 14px; }
  html.neo .crs-j-vis { width: 40px; height: 40px; }
  html.neo .crs-dossier > li:not(:last-child)::after { top: 19px; left: calc(50% + 24px); right: calc(-50% + 24px); }
  html.neo .crs-j-l { font-size: 10px; }
  html.neo .crs-liste {
    order: 5;
    display: block;
    overflow: visible;
    margin: 8px 0 0;
    padding: 0;
  }
  html.neo .crs-paquet { display: block; margin-top: 6px; }
  html.neo .crs-groupe {
    writing-mode: horizontal-tb;
    rotate: none;
    margin: 16px 0 0;
    padding: 0 0 6px;
    text-align: left;
    font-size: 10.5px;
    border-left: 0;
    border-bottom: 1px solid var(--n-filet);
  }
  html.neo .crs-grille,
  html.neo .crs-liste:not(.crs-liste-2) > .crs-paquet:only-child .crs-grille {
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
    grid-auto-columns: auto;
    gap: 32px 10px;
    padding-top: 30px;
  }
  html.neo .crs-t-vis { height: 64px; }
  html.neo .crs-t-perso .crs-t-vis img { height: 92px; }
  html.neo .crs-t-nom { font-size: 13px; }
  html.neo .crs-t-sous { font-size: 10.5px; }
  html.neo .crs-extra { order: 6; margin: 22px 0 0; }
  html.neo .crs-barre {
    order: 8;
    margin-top: auto;
    padding: 24px 0 calc(24px + env(safe-area-inset-bottom));
    border-top: 0;
  }
  html.neo .crs-name .crs-figs { bottom: 64px; }
  html.neo .crs-chakra .crs-papier { width: 150px; height: 186px; }
  html.neo .crs-chakra .crs-papier i { font-size: 78px; }
  html.neo .crs-kanji { font-size: clamp(220px, 24vw, 340px); }
  html.neo body:has(#screen-create.active .crs) .nj-snd-btn { right: calc(138px + env(safe-area-inset-right)); }
}

/* ---------- les mouvements ---------- */
@keyframes crs-cadre-entre { from { opacity: 0; scale: 0.97; } }
@keyframes crs-decor-entre { from { opacity: 0; scale: 1.08; } }
@keyframes crs-decor-sort { to { opacity: 0; } }
@keyframes crs-lot-entre { from { opacity: 0; translate: 0 30px; } }
@keyframes crs-lot-glisse { from { opacity: 0; translate: 26px 6px; } }
@keyframes crs-lot-sort { to { opacity: 0; translate: -18px 4px; } }
@keyframes crs-plaque-entre { from { opacity: 0; translate: 0 8px; } }
@keyframes crs-tuile-entre { from { opacity: 0; translate: 0 14px; } }
@keyframes crs-presse {
  0% { scale: 1; rotate: -4deg; }
  18% { scale: 0.95; rotate: -2deg; }
  36% { scale: 0.97; rotate: -6deg; }
  54% { scale: 0.93; rotate: -3deg; }
  72% { scale: 0.96; rotate: -5deg; }
  100% { scale: 0.94; rotate: -4deg; }
}
@keyframes crs-brule {
  0% { background: #efe5cc; clip-path: inset(0 0 0 0); }
  30% { background: #ffb36b; clip-path: inset(0 0 0 0); }
  60% { background: #7a3412; }
}
@keyframes crs-mouille { from { background: #efe5cc; } }
@keyframes crs-effrite {
  from { scale: 0.94; rotate: -4deg; clip-path: polygon(0 0, 16% 0, 44% 0, 70% 0, 100% 0, 100% 38%, 100% 70%, 100% 100%, 54% 100%, 22% 100%, 0 100%, 0 50%); }
}
@keyframes crs-froisse {
  0% { scale: 0.94; rotate: -4deg; clip-path: polygon(0 0, 22% 0, 40% 0, 62% 0, 84% 0, 100% 0, 100% 30%, 100% 52%, 100% 74%, 100% 100%, 74% 100%, 50% 100%, 28% 100%, 0 100%, 0 76%, 0 50%, 0 24%); }
  25% { rotate: 6deg; }
  50% { rotate: -9deg; }
  75% { rotate: 4deg; }
}
@keyframes crs-fend-g { from { translate: 0 0; rotate: 0deg; } }
@keyframes crs-fend-d { from { translate: 0 0; rotate: 0deg; } }
@keyframes crs-kanji {
  0% { opacity: 0; scale: 0.4; }
  60% { opacity: 1; scale: 1.06; }
}

@media (prefers-reduced-motion: reduce) {
  html.neo .crs *,
  html.neo .crs *::before,
  html.neo .crs *::after {
    animation: none !important;
    transition: none !important;
  }
}
