/* Complément de mise en page pour la revue de partie. */
.colonne-echiquier > *,
.echiquier-rangee,
.aides-echiquier,
.accordeon,
.feuille {
  min-width: 0;
  box-sizing: border-box;
}

/* L'échiquier et ses aides restent chacun dans leur propre rangée. */
.echiquier-rangee {
  grid-template-columns: 12px minmax(0, 1fr);
  width: 100%;
}
.echiquier {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}
.regle-eval[data-variante="true"] { opacity: .35; }
.aides-echiquier { width: 100%; }

.navigation { gap: .5rem; }
.navigation .bouton,
.alerte-mat__actions button,
.variation-mat__actions button {
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  line-height: 1.3;
}
.navigation .bouton { font-size: 1rem; }
.navigation__position { color: #514168; }
.navigation__aide { color: #514168; }
.navigation__resultat {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .2rem .45rem;
  padding: .35rem .65rem;
  border: 1px solid #baaee3;
  border-radius: .7rem;
  background: #f3efff;
  color: #382653;
  font-size: .82rem;
  line-height: 1.3;
}
.navigation__resultat[data-ton="gagnee"] {
  background: #d9f7e9;
  border-color: #76cda9;
  color: #064c3d;
}
.navigation__resultat[data-ton="perdue"] {
  background: #fff0f2;
  border-color: #efa5b6;
  color: #811a38;
}

/* Le chevron est décoratif ; l'état reste porté par details/summary. */
.accordeon__titre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 44px;
  min-width: 0;
  color: #3d2c75;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.accordeon__titre::-webkit-details-marker { display: none; }
.accordeon__titre::after {
  content: "+";
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: #eee5ff;
  color: #3d2c75;
  font: 700 1.25rem/1 var(--sans, sans-serif);
}
.accordeon[open] > .accordeon__titre::after { content: "−"; }
.accordeon__titre:focus-visible,
.navigation button:focus-visible,
.alerte-mat button:focus-visible,
.variation-mat button:focus-visible {
  outline: 3px solid #9b351f;
  outline-offset: 3px;
}
.feuille__entete { min-width: 0; flex-wrap: wrap; }
.feuille__titre { min-width: 0; overflow-wrap: anywhere; }

.alerte-mat,
.variation-mat {
  box-sizing: border-box;
  min-width: 0;
  padding: 1rem 1.1rem;
  border: 2px solid;
  border-radius: 18px;
  overflow-wrap: anywhere;
}
.alerte-mat[hidden],
.variation-mat[hidden] { display: none; }
.alerte-mat {
  border-color: #a92f55;
  border-left-width: 7px;
  background: #ffedf0;
  color: #60203a;
  box-shadow: 0 4px 0 #f1c8d3;
}
.variation-mat {
  border-color: #8060bc;
  background: #f4efff;
  color: #302449;
  box-shadow: 0 4px 0 #e2d6f6;
}
.alerte-mat__titre,
.variation-mat__titre {
  margin: 0 0 .4rem;
  font: 600 1.2rem/1.25 var(--display, sans-serif);
}
.alerte-mat__titre { color: #8b2043; }
.variation-mat__titre { color: #493078; }
.alerte-mat__texte,
.variation-mat__texte,
.variation-mat__progression {
  margin: .4rem 0;
  line-height: 1.5;
}
.variation-mat__progression { font-weight: 700; }
.alerte-mat__actions,
.variation-mat__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .75rem;
}

@media (max-width: 400px) {
  .echiquier-rangee { grid-template-columns: 10px minmax(0, 1fr); gap: .5rem; }
  .aides-echiquier__option { flex-basis: 100%; }
  .alerte-mat, .variation-mat { padding: .85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .accordeon__titre,
  .alerte-mat *,
  .variation-mat *,
  .navigation * { transition: none; animation: none; }
}
