/* Mon Prof d'Échecs — site vitrine. Le tapis vert, l'échiquier mural du prof, la feuille de partie. */

body.site { background: var(--ivoire); }
.evitement { position: absolute; left: -999px; top: 0; background: var(--coup); padding: 0.6rem 1rem; z-index: 50; font-weight: 700; }
.evitement:focus { left: 0; }

/* ---------- En-tête et hero ---------- */
.hero { background: var(--tapis); color: var(--ivoire); padding: 0 clamp(1.1rem, 4vw, 3.5rem) clamp(3rem, 6vw, 5.5rem); overflow: hidden; }
.barre { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.3rem 0; max-width: 84rem; margin: 0 auto; }
.logo { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 800; font-stretch: 75%; font-variation-settings: "wdth" 75; font-size: 1.45rem; line-height: 1; letter-spacing: -0.01em; color: inherit; white-space: nowrap; }
.logo-case { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; background: var(--coup); color: var(--encre); border-radius: 3px; font-size: 1.5rem; flex: none; }
.barre-liens { display: flex; align-items: center; gap: clamp(0.8rem, 2vw, 1.8rem); }
.lien-discret { text-decoration: none; font-weight: 600; font-size: 0.98rem; color: rgba(247, 242, 227, 0.88); white-space: nowrap; }
.barre .btn { white-space: nowrap; }
.lien-discret:hover { color: #fff; text-decoration: underline; }
.hero .btn { border-color: var(--coup); }
.hero .btn:hover { border-color: #ffd65e; }

.hero-grille { max-width: 84rem; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; padding-top: clamp(1.5rem, 4vw, 3.5rem); }
.hero-texte .titre-1 { font-size: clamp(2.9rem, 6.4vw, 6rem); line-height: 0.93; }
.hero-chapo { font-size: clamp(1.08rem, 1.5vw, 1.3rem); line-height: 1.45; max-width: 31rem; margin: 1.5rem 0 1.9rem; color: rgba(247, 242, 227, 0.92); }
.hero-offre { margin-top: 1.1rem; font-size: 0.98rem; color: var(--buis); max-width: 26rem; }

/* L'échiquier mural et son suivi */
.demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(12.5rem, 15rem); gap: clamp(1.2rem, 2.2vw, 2rem); align-items: start; }
.mural { background: var(--ivoire); padding: clamp(0.5rem, 1vw, 0.85rem) clamp(0.5rem, 1vw, 0.85rem) 0; border-radius: 6px; box-shadow: clamp(8px, 1.2vw, 16px) clamp(8px, 1.2vw, 16px) 0 var(--tapis-sombre); }
.echiquier { position: relative; aspect-ratio: 1; container-type: inline-size; border-radius: 2px; overflow: hidden;
  background: conic-gradient(var(--case-verte) 25%, var(--buis) 0 50%, var(--case-verte) 0 75%, var(--buis) 0) 0 0 / 25% 25%; }
.colonnes-lettres { display: grid; grid-template-columns: repeat(8, 1fr); text-align: center; color: var(--encre); font-weight: 700; font-size: clamp(0.62rem, 0.9vw, 0.8rem); line-height: 1; padding: 0.4em 0 0.45em; }
.surligne { position: absolute; width: 12.5%; height: 12.5%; background: rgba(245, 197, 66, 0.72); transition: opacity 0.25s; }
.pion { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; display: grid; place-items: center; transition: transform 0.55s cubic-bezier(0.3, 0.8, 0.3, 1), opacity 0.25s; will-change: transform; }
.pion span { grid-area: 1 / 1; font-family: "Pieces", "Noto Sans Symbols 2", "Segoe UI Symbol", sans-serif; font-size: 10cqw; line-height: 1; }
.pion--blanc .fond { color: #fffdf4; }
.pion--blanc .trait { color: var(--encre); }
.pion--noir .fond { color: var(--encre); }
.pion.pris { opacity: 0; }

.suivi { display: grid; gap: 0.9rem; align-content: start; font-size: 0.95rem; }
.suivi h2 { font-size: 0.86rem; font-weight: 700; line-height: 1.2; margin-bottom: 0.45rem; color: var(--buis); }
.suivi h2 span { font-weight: 500; }
.feuille { background: var(--tapis-sombre); border-radius: var(--rayon); padding: 0.85rem 0.95rem 0.7rem; }
.feuille ol { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 1.02rem; }
.feuille li { display: grid; grid-template-columns: 1.7rem 1fr 1fr; padding: 0.24rem 0; border-top: 1px solid var(--trait-clair); min-height: 1.95rem; }
.feuille li:first-child { border-top: 0; }
.feuille .n { color: var(--buis); font-weight: 500; }
.feuille [data-coup] { opacity: 0; transition: opacity 0.3s; }
.feuille [data-coup].joue { opacity: 1; }
.feuille [data-coup].dernier { color: var(--coup); }
.constat, .courriel { border-radius: var(--rayon); padding: 0.85rem 0.95rem 0.95rem; opacity: 0; transform: translateY(8px); transition: opacity 0.45s, transform 0.45s; }
.constat.visible, .courriel.visible { opacity: 1; transform: none; }
.constat { background: var(--tapis-sombre); }
.constat p { margin-bottom: 0.6rem; }
.constat .wdl { border-color: var(--ivoire); height: 1.45rem; line-height: 1.3rem; font-size: 0.78rem; }
.courriel { background: var(--coup); color: var(--encre); }
.courriel h2 { color: var(--encre); }
.courriel p { line-height: 1.38; }
.rejouer { justify-self: start; background: none; border: 0; padding: 0.2rem 0; color: var(--buis); font-weight: 600; font-size: 0.88rem; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.rejouer:hover { color: #fff; }

@media (max-width: 1080px) {
  .hero-grille { grid-template-columns: 1fr; }
  .demo { max-width: 46rem; }
}
@media (max-width: 640px) {
  .barre-liens .lien-discret[href^="#"] { display: none; }
  .demo { grid-template-columns: 1fr; }
  .suivi { grid-template-columns: 1fr 1fr; }
  .feuille { grid-row: span 2; }
  .rejouer { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .barre .btn { display: none; } /* le grand bouton du hero est juste en dessous */
}
@media (max-width: 420px) {
  .logo { font-size: 1.15rem; }
  .logo-case { width: 1.7rem; height: 1.7rem; font-size: 1.2rem; }
  .barre-liens .lien-discret { font-size: 0.9rem; }
  .suivi { grid-template-columns: 1fr; }
}

/* ---------- Fonctions : un damier de deux colonnes ---------- */
.fonctions { background: var(--ivoire); }
.fonctions-tete { max-width: 84rem; margin: 0 auto; padding: clamp(3.5rem, 8vw, 7rem) clamp(1.1rem, 4vw, 3.5rem) clamp(2rem, 4vw, 3.5rem); }
.fonctions-tete .titre-2 { max-width: 17em; }
/* Le damier va d'un bord à l'autre de l'écran ; le contenu des cases reste aligné sur la grille de la page. */
.damier { --marge: clamp(1.6rem, 4vw, 3.5rem); --bord: max(var(--marge), calc((100vw - 84rem) / 2 + var(--marge))); display: grid; grid-template-columns: 1fr 1fr; }
.case { min-height: clamp(17rem, 28vw, 24rem); padding: var(--marge); display: flex; flex-direction: column; justify-content: center; }
.damier > :nth-child(odd) { padding-left: var(--bord); }
.damier > :nth-child(even) { padding-right: var(--bord); }
.case--claire { background: var(--buis); }
.case--claire .titre-3 { font-size: clamp(1.65rem, 2.7vw, 2.45rem); line-height: 1.02; max-width: 15em; }
.case--claire p { margin-top: 1.1rem; font-size: 1.06rem; line-height: 1.5; max-width: 30rem; }
.case--foncee { background: var(--tapis); color: var(--ivoire); align-items: stretch; }
.case--foncee > * { width: 100%; max-width: 27rem; margin-left: auto; margin-right: auto; }

/* Maquettes dans les cases foncées */
.maq-table { font-size: 0.95rem; }
.maq-table th { text-align: left; font-weight: 600; font-size: 0.8rem; color: var(--buis); padding: 0 0.5rem 0.5rem 0; border-bottom: 1.5px solid var(--trait-clair); }
.maq-table td { padding: 0.62rem 0.5rem 0.62rem 0; border-bottom: 1px solid var(--trait-clair); font-variant-numeric: tabular-nums; }
.maq-table td:first-child { font-weight: 700; }
.maq-table tr:last-child td { border-bottom: 0; }
.pastille { display: inline-block; padding: 0.1em 0.6em; border-radius: 99px; font-size: 0.8rem; font-weight: 650; border: 1.5px solid var(--trait-clair); white-space: nowrap; }
.pastille--ok { background: var(--coup); color: var(--encre); border-color: var(--coup); }

.maq-fichier { font-weight: 700; margin-bottom: 1.1rem; overflow-wrap: anywhere; }
.maq-barre { display: grid; grid-template-columns: 6.6rem 1fr auto; align-items: center; gap: 0.7rem; margin-bottom: 0.7rem; font-size: 0.9rem; }
.maq-barre span { color: var(--buis); }
.maq-barre i { height: 1.3rem; background: var(--case-verte); border-radius: 2px; justify-self: start; }
.maq-barre--apres i { background: var(--coup); }
.maq-barre b { font-variant-numeric: tabular-nums; min-width: 4.2rem; text-align: right; }
.maq-note { margin-top: 1rem; font-size: 0.9rem; color: var(--buis); }

.maq-page { border: 2px solid var(--ivoire); border-radius: 6px; overflow: hidden; background: var(--ivoire); color: var(--encre); }
.maq-adresse { background: var(--tapis-sombre); color: var(--ivoire); font-size: 0.86rem; font-weight: 600; padding: 0.5rem 0.8rem; overflow-wrap: anywhere; border-bottom: 2px solid var(--ivoire); }
.maq-porte { padding: 1.1rem 1.2rem 1.3rem; display: grid; gap: 0.55rem; }
.maq-club { font-weight: 800; font-stretch: 75%; font-variation-settings: "wdth" 75; font-size: 1.5rem; line-height: 1; margin-bottom: 0.3rem; }
.maq-champ { border: 1.5px solid rgba(20, 19, 15, 0.4); border-radius: 3px; padding: 0.42rem 0.6rem; font-size: 0.84rem; color: var(--encre-douce); background: #fff; }
.maq-bouton { background: var(--coup); border: 1.5px solid var(--encre); border-radius: 3px; padding: 0.45rem 0.6rem; font-weight: 700; font-size: 0.88rem; text-align: center; }

.maq-formules { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.maq-formule { border: 2px solid var(--ivoire); border-radius: var(--rayon); padding: 1rem 1.1rem 1.1rem; display: grid; gap: 0.15rem; }
.maq-formule span { font-weight: 650; font-size: 0.92rem; color: var(--buis); }
.maq-formule b { font-weight: 800; font-stretch: 75%; font-variation-settings: "wdth" 75; font-size: clamp(2.2rem, 3.6vw, 3.1rem); line-height: 1; }
.maq-formule small { font-size: 0.85rem; }

.maq-ouvertures { display: grid; gap: 0.75rem; }
.maq-ouvertures li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 0.8rem; align-items: center; font-weight: 650; font-size: 0.95rem; }
.maq-ouvertures .wdl { border-color: var(--ivoire); min-width: 0; }
.maq-legende { margin-top: 1rem; font-size: 0.82rem; color: var(--buis); display: flex; gap: 0.9rem; align-items: center; flex-wrap: wrap; }
.maq-legende span { display: inline-flex; align-items: center; gap: 0.4rem; }
.maq-legende i { display: inline-block; width: 0.8rem; height: 0.8rem; border: 1.5px solid var(--ivoire); }
.l-w { background: #fff; } .l-d { background: #b9b4a4; } .l-l { background: var(--encre); }

.maq-regle { font-size: clamp(1.2rem, 1.9vw, 1.55rem); line-height: 1.75; font-weight: 550; }
.maq-regle mark { background: var(--coup); color: var(--encre); padding: 0.1em 0.4em; border-radius: 3px; font-weight: 700; white-space: nowrap; }

@media (max-width: 760px) {
  .damier { grid-template-columns: 1fr; }
  .damier > .case { min-height: 0; padding-left: var(--marge); padding-right: var(--marge); }
  .case--foncee { padding-top: 2.2rem; padding-bottom: 2.2rem; }
  /* Sur une colonne : le texte d'abord, sa maquette ensuite. */
  .damier > :nth-child(3) { order: 4; } .damier > :nth-child(4) { order: 3; }
  .damier > :nth-child(5) { order: 5; } .damier > :nth-child(6) { order: 6; }
  .damier > :nth-child(7) { order: 8; } .damier > :nth-child(8) { order: 7; }
  .damier > :nth-child(9) { order: 9; } .damier > :nth-child(10) { order: 10; }
  .damier > :nth-child(11) { order: 12; } .damier > :nth-child(12) { order: 11; }
  .damier > :nth-child(1) { order: 1; } .damier > :nth-child(2) { order: 2; }
}

/* ---------- La feuille de partie : vous / votre club ---------- */
.partie { background: var(--ivoire); padding: clamp(3.5rem, 8vw, 7rem) clamp(1.1rem, 4vw, 3.5rem); }
.partie-dedans { max-width: 62rem; margin: 0 auto; }
.feuille-partie { margin-top: clamp(1.8rem, 3vw, 2.8rem); background: var(--papier); border: 2px solid var(--encre); border-radius: var(--rayon); font-size: clamp(1rem, 1.5vw, 1.2rem); }
.feuille-partie thead th { text-align: left; padding: 0.85rem 1.2rem; font-weight: 800; font-stretch: 75%; font-variation-settings: "wdth" 75; font-size: 1.35rem; border-bottom: 2px solid var(--encre); }
.feuille-partie thead th:nth-child(3) { background: var(--encre); color: var(--ivoire); }
.feuille-partie tbody th { width: 3.2rem; padding: 0.95rem 0 0.95rem 1.2rem; text-align: left; font-weight: 800; font-stretch: 75%; font-variation-settings: "wdth" 75; font-size: 1.5rem; color: var(--case-verte); font-variant-numeric: tabular-nums; vertical-align: baseline; }
.feuille-partie td { padding: 0.95rem 1.2rem; border-left: 1.5px solid var(--trait); vertical-align: baseline; }
.feuille-partie tbody tr + tr th, .feuille-partie tbody tr + tr td { border-top: 1.5px solid var(--trait); }
.feuille-partie td:nth-child(2) { font-weight: 650; }
.feuille-partie tbody th + td { border-left: 0; }
@media (max-width: 600px) {
  .feuille-partie thead th, .feuille-partie td { padding-left: 0.7rem; padding-right: 0.7rem; }
  .feuille-partie tbody th { width: 2.2rem; padding-left: 0.7rem; font-size: 1.2rem; }
}

/* ---------- L'offre : une case surlignée, comme le dernier coup joué ---------- */
.offre { background: var(--coup); color: var(--encre); padding: clamp(3.5rem, 8vw, 7rem) clamp(1.1rem, 4vw, 3.5rem); }
.offre-dedans { max-width: 84rem; margin: 0 auto; }
.offre .titre-1 { font-size: clamp(2.8rem, 7.6vw, 7.4rem); line-height: 0.92; max-width: 11em; }
.offre p { font-size: clamp(1.05rem, 1.5vw, 1.25rem); max-width: 36rem; margin-top: 1.5rem; }
.btn--encre { background: var(--encre); color: var(--ivoire); border-color: var(--encre); }
.btn--encre:hover { background: #2b2921; }

/* ---------- Questions ---------- */
.questions { background: var(--ivoire); padding: clamp(3.5rem, 8vw, 7rem) clamp(1.1rem, 4vw, 3.5rem); }
.questions-dedans { max-width: 62rem; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.faq details { border-top: 2px solid var(--encre); }
.faq details:last-child { border-bottom: 2px solid var(--encre); }
.faq summary { cursor: pointer; padding: 1.05rem 2.2rem 1.05rem 0; font-weight: 700; font-size: 1.12rem; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.2rem; top: 50%; transform: translateY(-52%); font-size: 1.7rem; font-weight: 500; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 2.2rem 1.25rem 0; max-width: 40rem; font-size: 1.04rem; }
@media (max-width: 760px) { .questions-dedans { grid-template-columns: 1fr; } }

/* ---------- Pied de page ---------- */
.pied { background: var(--tapis-sombre); color: var(--ivoire); padding: clamp(2.5rem, 5vw, 4rem) clamp(1.1rem, 4vw, 3.5rem) 2rem; }
.pied-dedans { max-width: 84rem; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.pied-dedans p { margin-top: 0.8rem; color: var(--buis); }
.pied ul { display: grid; gap: 0.5rem; max-width: 24rem; }
.pied li { color: var(--buis); }
.pied li a { color: var(--ivoire); font-weight: 650; }
.pied-note { max-width: 84rem; margin: 2.2rem auto 0; padding-top: 1.2rem; border-top: 1px solid var(--trait-clair); font-size: 0.82rem; color: rgba(234, 217, 166, 0.75); }
