/* Des couleurs franches, des formes accueillantes et une lecture confortable. */
@font-face {
  font-family: Fredoka;
  src: url("/assets/fredoka-semibold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Nunito;
  src: url("/assets/nunito-regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Nunito;
  src: url("/assets/nunito-bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  --papier: #faf7ff;
  --papier-creux: #f1ecff;
  --encre: #292349;
  --encre-douce: #5b5476;
  --encre-tenue: #70698a;
  --regle: #e7dffa;
  --regle-forte: #d1c4ee;
  --rouge: #a92f55;
  --rouge-pale: #ffedf0;
  --vert: #08765f;
  --vert-pale: #d7f7e9;
  --case-claire: #fff1dd;
  --case-sombre: #a89bdd;
  --dernier-coup: #ffc857a8;
  --serif: Nunito, "Trebuchet MS", sans-serif;
  --sans: Nunito, "Trebuchet MS", sans-serif;
  --display: Fredoka, "Trebuchet MS", sans-serif;
}
html { color-scheme: light; }
/* Le fond couvre aussi les pages plus hautes que la fenêtre. */
body {
  background: radial-gradient(circle at 3% 4%, #ffe6bc 0, transparent 26rem),
    radial-gradient(circle at 96% 20%, #e6d9ff 0, transparent 30rem), var(--papier);
  height: auto;
  min-height: 100vh;
  font: 400 16px/1.55 var(--sans);
}
button, select, input, textarea { font-family: var(--sans); }
:focus-visible { outline: 3px solid #f07843; outline-offset: 3px; border-radius: 9px; }

/* Accueil : une introduction et des choix distincts, faciles à parcourir. */
.preparation {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .93fr) minmax(0, 1fr);
  column-gap: clamp(38px, 7vw, 100px);
  max-width: 1260px;
  min-height: 100vh;
  margin: auto;
  padding: 96px 36px 56px;
}
.preparation::before {
  content: "♞  L’ATELIER DES ÉCHECS";
  position: absolute;
  top: 30px;
  left: 36px;
  padding: 9px 15px;
  border-radius: 99px;
  background: #6b4bc5;
  color: #fff;
  font: 600 14px/1.2 var(--display);
  letter-spacing: .035em;
}
.preparation__titre {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: end;
  max-width: 540px;
  margin: 0 0 20px;
  color: #37266d;
  font: 600 clamp(2.8rem, 4.8vw, 4.6rem)/1.04 var(--display);
  letter-spacing: -.025em;
}
.preparation__chapeau {
  grid-column: 1;
  grid-row: 3;
  align-self: start;
  max-width: 450px;
  margin: 0;
  color: #5f527c;
  font-size: 1.08rem;
  line-height: 1.7;
}
.preparation::after {
  content: "♞";
  grid-column: 1;
  grid-row: 4 / 7;
  align-self: start;
  justify-self: start;
  display: grid;
  place-items: center;
  width: 180px;
  height: 180px;
  margin: 34px 0 20px 15px;
  border: 9px solid #fff;
  border-radius: 35px;
  background: conic-gradient(#f5ab9c 25%, #ffe5a6 0 50%, #f5ab9c 0 75%, #ffe5a6 0) 0 0 / 50% 50%;
  box-shadow: 10px 12px 0 #e3d8ff, 0 20px 45px #68529824;
  color: #6b4bc5;
  font: 112px/1 Georgia, serif;
  transform: rotate(-8deg);
  pointer-events: none;
}
.preparation > .champ, .preparation > .avis-loyaute, .preparation > .bouton { grid-column: 2; min-width: 0; }
.preparation > .champ {
  margin: 0 0 10px;
  padding: 17px 20px;
  border: 2px solid transparent;
  border-radius: 20px;
}
.preparation > .champ:nth-of-type(1) { grid-row: 1; background: #eee5ff; border-color: #e4d5ff; }
.preparation > .champ:nth-of-type(2) { grid-row: 2; background: #fff0d1; border-color: #ffe6b0; }
.preparation > .champ:nth-of-type(3) { grid-row: 3; background: #dff7ed; border-color: #c9efdd; }
.preparation > .champ:nth-of-type(4) { grid-row: 4; background: #ffe8e8; border-color: #ffdbdf; }
.champ__legende {
  display: block;
  margin-bottom: .55rem;
  color: #443472;
  font: 600 1rem/1.2 var(--display);
  letter-spacing: 0;
  text-transform: none;
}
.choix { gap: .5rem; }
.choix__option, .bouton {
  min-height: 42px;
  padding: .6rem .95rem;
  border: 1px solid #dbd0f2;
  border-radius: 12px;
  background: #fff;
  color: #493c6f;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s, box-shadow .16s;
}
.choix__option:hover, .bouton:hover:not(:disabled) { background: #f4edff; border-color: #8b6ad1; box-shadow: 0 3px 0 #d7c5f6; }
.choix__option[aria-pressed=true] { background: #6a4bc4; border-color: #6a4bc4; color: #fff; box-shadow: 0 3px 0 #4b319d; }
.choix__aide { margin: .55rem 0 0; color: #625773; font-size: .82rem; line-height: 1.45; }
.champ select, .entete select {
  max-width: 100%;
  padding: .65rem .8rem;
  border: 1px solid #d9cbee;
  border-radius: 11px;
  background: #fff;
  color: #443472;
}
.avis-loyaute {
  grid-row: 5;
  margin: 3px 0 12px;
  padding: 13px 17px;
  border: 0;
  border-radius: 16px;
  background: #fff6de;
  color: #735120;
  font-size: .81rem;
  line-height: 1.5;
}
.avis-loyaute p { color: #735b3b; }
.bouton--principal { background: #f77764; border-color: #f77764; color: #292349; box-shadow: 0 4px 0 #c85249; }
.bouton--principal:hover:not(:disabled) { background: #ff9a83; border-color: #ff9a83; color: #292349; box-shadow: 0 4px 0 #c85249; }
.preparation > .bouton--principal { grid-row: 6; width: 100%; padding: .9rem; font: 600 1.12rem var(--display); }

/* L'échiquier reste au centre ; l'analyse et les commentaires forment deux cartes. */
.entete {
  align-items: center;
  gap: .7rem 1rem;
  padding: 14px clamp(18px, 3vw, 44px);
  border: 0;
  background: #6b4bc5;
  color: #fff;
}
.entete__titre { color: #fff; font: 600 1.22rem var(--display); letter-spacing: 0; }
.entete__titre span { color: #e6dcff; font: 400 .84rem var(--sans); }
.entete__outils { gap: .5rem; color: #fff; }
.entete__outils select { padding: .5rem .6rem; }
.entete .bouton { min-height: 38px; }
.plateau-double {
  max-width: 1500px;
  margin: 0 auto;
  padding: 30px clamp(20px, 3vw, 44px) 64px;
  grid-template-columns: minmax(300px, 45%) minmax(0, 1fr);
  gap: 20px clamp(28px, 3.5vw, 52px);
}
.colonne-echiquier { gap: 14px; }
.echiquier-rangee { grid-template-columns: 12px 1fr; gap: 13px; }
.echiquier { border: 0; border-radius: 9px; box-shadow: 0 0 0 8px #fff, 0 12px 0 8px #e4d8fb, 0 18px 35px #59418b29; }
.regle-eval { border: 0; border-radius: 12px; background: #3f3165; }
.regle-eval__blancs { background: #ffe8a6; }
.regle-eval__milieu { background: #f47e65; height: 2px; }
.cg-wrap coords coord { color: #4e426f; }
.saisie__champ, .sources__zone {
  min-height: 44px;
  padding: .7rem .85rem;
  border: 2px solid #dfd3f4;
  border-radius: 12px;
  background: #fff;
}
.saisie__champ::placeholder { color: #82789d; }
.navigation { gap: .45rem; }
.navigation__position { color: #645483; font-weight: 700; }
.navigation__aide { color: #766b8f; }
.sources { padding: 15px 17px; border: 2px solid #e2d5fa; border-radius: 17px; background: #f3ecff; }
.sources__titre { color: #5d40aa; letter-spacing: .04em; }
.sources__titre b { color: #463376; }
.sources__aide { color: #655b79; }
.a-jouer, .feuille {
  width: 100%;
  max-width: none;
  border: 2px solid #ede5fa;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 7px 0 #e9dff8, 0 16px 34px #5c488816;
}
.a-jouer { padding: 24px; border-top: 7px solid #ffbb52; }
.a-toi__entete { align-items: center; margin-bottom: 20px; }
.a-toi__titre, .feuille__titre { color: #3d2c75; font: 600 1.35rem var(--display); letter-spacing: 0; text-transform: none; }
.a-toi__section-titre { color: #705aa4; font-size: .73rem; letter-spacing: .06em; }
.a-toi__section--menaces .a-toi__section-titre { color: #ac4a51; }
.a-toi__corps { border-left-color: #ffbd67; }
.a-toi__coup { margin-bottom: .6rem; padding: .8rem 1rem; border: 0; border-radius: 15px; background: #f4f0ff; }
.a-toi__coup[data-principal=true] { padding: 1rem; border: 0; border-radius: 15px; background: #d7f7e9; }
.a-toi__coup-rang { color: #705aa4; letter-spacing: .06em; }
.a-toi__coup-san { color: #593fa5; }
.a-toi__coup[data-principal=true] .a-toi__coup-san { color: #08765f; }
.a-toi__coup-raison, .glose__paragraphe { color: #51486a; font-size: .95rem; line-height: 1.6; }
.a-toi__notes { border-color: #eee7f9; }
.feuille { padding: 22px 24px; border-top: 7px solid #ed8aa9; }
.feuille__entete { align-items: center; padding-bottom: 13px; border-bottom: 1px solid #eee7f9; }
.feuille__etat { color: #70638b; }
.tour { border-color: #eee7f9; }
.coup { border-left-color: #eee7f9; border-radius: 8px; }
.coup:hover { background: #f2eaff; }
.coup[data-actuel=true] { background: #6b4bc5; color: #fff; }
.glose { border-radius: 10px; }
.vide { color: #766b8f; font-size: .94rem; font-style: normal; }
.loyaute { border: 0; border-radius: 14px; background: #fff1d5; }
.constats { border-color: #eee7f9; }

@media (max-width: 900px) {
  .plateau-double { grid-template: "echiquier" "a-jouer" "feuille" / minmax(0, 1fr); }
  .colonne-echiquier, .a-jouer, .feuille { width: 100%; max-width: 600px; margin: 0 auto; }
}
@media (max-width: 760px) {
  .preparation { display: block; min-height: 0; padding: 90px 18px 40px; }
  .preparation::before { top: 24px; left: 18px; }
  .preparation::after { display: none; }
  .preparation__titre { max-width: 600px; margin-bottom: 14px; font-size: clamp(2.5rem, 9vw, 3.5rem); }
  .preparation__chapeau { margin-bottom: 24px; font-size: 1rem; }
  .preparation > .champ { padding: 16px; }
  .preparation > .bouton--principal { width: 100%; }
  .entete { gap: 12px; }
  .entete__outils { width: 100%; margin-left: 0; }
  .a-jouer, .feuille { padding: 19px; }
}
@media (max-width: 400px) {
  .plateau-double { padding-left: 14px; padding-right: 14px; }
  .choix__option { padding: .6rem .7rem; }
  .entete__outils { font-size: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Parcours d'accueil et d'import de la version publiée. */
body { background-attachment: fixed; background-repeat: no-repeat; }
.preparation { display: flow-root; }
.preparation::after { display: none; }
.preparation__titre, .preparation__chapeau { position: static; width: auto; }
.preparation__titre { margin: 0 0 18px; }
.preparation__chapeau { margin: 0 0 25px; }
.accueil-choix { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 0; }
.carte-choix {
  min-height: 155px;
  padding: 24px;
  border: 2px solid #e3d4ff;
  border-radius: 22px;
  background: #eee5ff;
  box-shadow: 0 5px 0 #dfd0f8;
  color: #3d2c75;
}
.carte-choix:nth-child(2) { background: #fff0d1; border-color: #ffe1a3; box-shadow: 0 5px 0 #f5d89c; }
.carte-choix:hover { background: #e6d7ff; border-color: #ad91e9; }
.carte-choix:nth-child(2):hover { background: #ffe6ae; border-color: #e2b454; }
.carte-choix__titre { font: 600 1.4rem var(--display); }
.carte-choix__aide { color: #5f5478; font-size: .95rem; }
.lien-retour { display: block; width: fit-content; margin-bottom: 16px; color: #5d40aa; font-weight: 700; }
.preparation__section { margin-bottom: 16px; }
.preparation__section--import { padding: 24px; border: 2px solid #e3d4ff; border-radius: 22px; background: #f0e9ff; }
.preparation__section .champ { margin-bottom: 10px; padding: 17px 20px; border: 2px solid transparent; border-radius: 20px; }
.preparation__section .champ:nth-child(1) { background: #eee5ff; border-color: #e4d5ff; }
.preparation__section .champ:nth-child(2) { background: #fff0d1; border-color: #ffe6b0; }
.preparation__section .champ:nth-child(3) { background: #dff7ed; border-color: #c9efdd; }
.preparation__section .champ:nth-child(4) { background: #ffe8e8; border-color: #ffdbdf; }
.preparation__section > .bouton--principal { width: 100%; margin-top: 4px; font: 600 1.1rem var(--display); }
.import__bloc { padding: 16px; border-radius: 16px; background: #fff; }
.import__live { padding: 16px; border: 0; border-radius: 16px; background: #fff2d7; }
.import__bloc .sources__label, .import__live .sources__label { color: #5d40aa; }
.preparation .avis-loyaute { margin-top: 16px; }
@media (min-width: 901px) {
  .preparation__titre, .preparation__chapeau { float: left; clear: left; width: 42%; }
  .preparation__chapeau::after {
    content: "♞";
    display: grid;
    place-items: center;
    width: 160px;
    height: 160px;
    margin: 40px 0 16px 12px;
    border: 9px solid #fff;
    border-radius: 32px;
    background: conic-gradient(#f5ab9c 25%, #ffe5a6 0 50%, #f5ab9c 0 75%, #ffe5a6 0) 0 0 / 50% 50%;
    box-shadow: 10px 12px 0 #e3d8ff;
    color: #6b4bc5;
    font: 100px/1 Georgia, serif;
    transform: rotate(-8deg);
  }
  .preparation > .accueil-choix,
  .preparation > .preparation__section,
  .preparation > .lien-retour,
  .preparation > .avis-loyaute { margin-left: 52%; }
}
@media (max-width: 900px) {
  .preparation { min-height: 0; padding: 90px 18px 40px; }
  .preparation::before { top: 24px; left: 18px; }
  .preparation__titre { max-width: 650px; font-size: clamp(2.3rem, 7vw, 3.5rem); }
  .preparation__chapeau { max-width: 600px; }
  .preparation > .accueil-choix,
  .preparation > .preparation__section,
  .preparation > .lien-retour,
  .preparation > .avis-loyaute { margin-left: 0; }
}
