/* Fenêtre « Comment ça marche ? » (page Packs) : voir js/comment-ca-marche.js */
#boite-info { width: min(640px, calc(100vw - 1.5rem)); max-width: none; max-height: calc(100dvh - 2rem); overflow-y: auto; }
.cm { display: grid; gap: 1rem; }
.cm h3 { margin: 0; }
.cm-etapes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.cm-etape {
  display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; align-items: center;
  padding: 0.8rem; border: 1px solid var(--color-border); border-radius: 0.9rem; background: var(--color-surface-2);
}
.cm-etape-raretes { grid-template-columns: 1fr; }
.cm-texte h4 { margin: 0 0 0.25rem; font-size: var(--text-base); display: flex; align-items: center; gap: 0.5rem; }
.cm-texte p { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.5; }
.cm-texte strong { color: var(--color-text); }
.cm-texte a { color: var(--color-primary); }
.cm-numero {
  display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--color-primary); color: var(--color-text-inverse, #16171a); font-size: 0.75rem; font-weight: 800;
}
.cm-ok { justify-self: center; min-width: 12rem; }

/* illustrations */
.cm-illu { display: flex; align-items: center; justify-content: center; gap: 0.3rem; min-height: 4.2rem; }
.cm-carte {
  --c: var(--r-commune);
  width: 1.5rem; aspect-ratio: 5 / 7; border-radius: 0.25rem; flex-shrink: 0;
  border: 1.5px solid var(--c); background: linear-gradient(180deg, color-mix(in oklab, var(--c) 25%, #1b1c20) 0 68%, var(--c) 68% 80%, #1b1c20 80%);
  box-shadow: 0 0 10px color-mix(in oklab, var(--c) 35%, transparent);
}
.cm-carte.grande { width: 2.6rem; }
.cm-illu-pack .cm-carte { margin-left: -0.55rem; transform: rotate(calc((var(--i) - 2) * 7deg)) translateY(calc(var(--i) * 1px)); }
.cm-illu-pack .cm-carte:nth-of-type(2) { margin-left: 0; }
.cm-pack {
  flex-shrink: 0;
  width: 2.2rem; aspect-ratio: 5 / 7; border-radius: 0.3rem;
  background: linear-gradient(115deg, transparent 30%, rgb(255 255 255 / 0.2) 45%, transparent 60%), linear-gradient(160deg, #2a2c33, #15161a);
  border: 1px solid rgb(255 255 255 / 0.2); border-top: 3px dashed rgb(255 255 255 / 0.35);
}
.cm-fleche { color: var(--color-text-faint); margin: 0 0.4rem; }
.cm-illu-stock { flex-wrap: wrap; gap: 0.2rem; max-width: 9rem; margin-inline: auto; }
.cm-jauge { width: 0.6rem; height: 1.3rem; border-radius: 0.15rem; background: var(--color-border); }
.cm-jauge.pleine { background: var(--color-primary); }
.cm-horloge { width: 100%; text-align: center; font-size: 0.72rem; font-family: var(--font-mono); color: var(--color-text-muted); margin-top: 0.3rem; }
.cm-illu-raretes { order: 2; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.4rem; }
.cm-rarete { display: grid; justify-items: center; gap: 0.25rem; text-align: center; }
.cm-rarete strong { font-size: 0.68rem; line-height: 1.15; }
.cm-rarete small { font-family: var(--font-mono); font-size: 0.72rem; color: var(--color-text-muted); }
.cm-double { margin-left: -1rem; transform: translate(0.2rem, 0.2rem); }
.cm-fragment { font-size: 1.6rem; }
.cm-illu-marche { font-size: 1.6rem; gap: 0.6rem; }

@media (max-width: 520px) {
  .cm-etape { grid-template-columns: 1fr; gap: 0.6rem; }
  .cm-illu { min-height: 3.4rem; }
  .cm-illu-raretes { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 0.7rem; }
}
/* variantes (étape affichée seulement quand elles sont activées) */
.cm-illu-variantes { gap: 0.45rem; }
.cm-variante {
  font: 700 0.62rem/1 var(--font-mono);
  letter-spacing: 0.12em;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  color: #111214;
  background: #e7e6e3;
}
.cm-variante-1 { background: linear-gradient(90deg, #9ff, #f9f); }
.cm-variante-2 { background: linear-gradient(90deg, #ff9, #9ff, #f9f); }
