/* Mon Prof d'Échecs — espace coach, espace membres, pages de connexion. */

/* ---------- Marque ---------- */
.marque { 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.3rem; line-height: 1; letter-spacing: -0.01em; }
.marque .case { display: grid; place-items: center; width: 2rem; height: 2rem; background: var(--coup); color: var(--encre); border-radius: 3px; font-size: 1.45rem; flex: none; }

/* ---------- Espace coach ---------- */
body.app { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: 100vh; background: var(--papier); }
.app-nav { background: var(--tapis); color: var(--ivoire); padding: 1.4rem 1rem 1rem; display: flex; flex-direction: column; gap: 1.6rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.app-nav .marque { color: var(--ivoire); padding: 0 0.5rem; }
.app-club { padding: 0.8rem 0.75rem; background: var(--tapis-sombre); border-radius: var(--rayon); }
.app-club strong { display: block; font-size: 1.05rem; line-height: 1.2; overflow-wrap: anywhere; }
.app-club a { font-size: 0.82rem; color: var(--buis); overflow-wrap: anywhere; }
.app-menu { display: grid; gap: 0.15rem; }
.app-menu a { display: flex; align-items: center; justify-content: space-between; padding: 0.55rem 0.75rem; border-radius: var(--rayon); text-decoration: none; font-weight: 550; color: rgba(247, 242, 227, 0.86); }
.app-menu a:hover { background: var(--tapis-clair); color: var(--ivoire); }
.app-menu a[aria-current="page"] { background: var(--coup); color: var(--encre); font-weight: 700; }
.app-menu .compte { font-size: 0.78rem; font-variant-numeric: tabular-nums; opacity: 0.8; }
.app-pied { margin-top: auto; display: grid; gap: 0.35rem; font-size: 0.88rem; padding: 0 0.75rem; }
.app-pied a { color: rgba(247, 242, 227, 0.8); }
.app-pied .essai { color: var(--buis); font-size: 0.82rem; line-height: 1.35; margin-bottom: 0.4rem; }
.app-main { padding: 2rem clamp(1rem, 3vw, 2.75rem) 4rem; min-width: 0; }
.app-tete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.app-tete h1 { font-stretch: 75%; font-variation-settings: "wdth" 75; font-weight: 800; font-size: clamp(1.9rem, 3vw, 2.6rem); line-height: 1; letter-spacing: -0.01em; }
.app-tete .sous { color: var(--encre-douce); margin-top: 0.4rem; max-width: 46rem; }
.app-tete .actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.app-bar { display: none; }

@media (max-width: 860px) {
  body.app { display: block; }
  .app-bar { display: flex; align-items: center; justify-content: space-between; background: var(--tapis); color: var(--ivoire); padding: 0.7rem 1rem; position: sticky; top: 0; z-index: 20; }
  .app-bar .marque { color: var(--ivoire); font-size: 1.1rem; }
  .app-bar button { background: none; border: 1.5px solid var(--trait-clair); color: var(--ivoire); border-radius: var(--rayon); padding: 0.35rem 0.7rem; font-weight: 650; cursor: pointer; }
  .app-nav { display: none; position: fixed; inset: 3.2rem 0 0 0; height: auto; z-index: 19; }
  .app-nav .marque { display: none; }
  body.menu-ouvert .app-nav { display: flex; }
  .app-main { padding-top: 1.4rem; }
}

/* ---------- Blocs ---------- */
.panneau { border: 1.5px solid var(--trait); border-radius: var(--rayon); background: #fff; padding: 1.25rem 1.35rem; margin-bottom: 1.4rem; }
.panneau > h2, .panneau > .tete h2 { font-size: 1.12rem; font-weight: 750; line-height: 1.2; }
.panneau > h2 { margin-bottom: 0.9rem; }
.panneau .tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.9rem; }
.panneau .tete a { font-size: 0.9rem; }
.panneau p + p { margin-top: 0.7rem; }
.panneau--plat { background: transparent; }
.panneau--vert { background: var(--tapis); color: var(--ivoire); border-color: var(--tapis); }
.panneau--vert .aide { color: var(--buis); }
.note { color: var(--encre-douce); font-size: 0.9rem; }
.colonnes { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); align-items: start; }
.colonnes > *, .deux-tiers > * { min-width: 0; }
.colonnes > .panneau { margin-bottom: 0; }
.colonnes + .panneau, .colonnes + .colonnes { margin-top: 1.4rem; }
.deux-tiers { display: grid; gap: 1.4rem; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1080px) { .deux-tiers { grid-template-columns: 1fr; } }

/* Chiffres du tableau de bord : une rangée de cases, claires et foncées en alternance. */
.rangee { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1.5px solid var(--encre); border-radius: var(--rayon); overflow: hidden; margin-bottom: 1.4rem; }
.rangee > div { padding: 1.1rem 1.2rem 1.2rem; background: var(--buis); min-width: 0; }
.rangee > div:nth-child(even) { background: var(--tapis); color: var(--ivoire); }
.rangee .nombre { font-stretch: 75%; font-variation-settings: "wdth" 75; font-weight: 800; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1; font-variant-numeric: tabular-nums; }
.rangee .quoi { font-weight: 600; margin-top: 0.35rem; font-size: 0.95rem; }
.rangee .detail { font-size: 0.82rem; opacity: 0.8; margin-top: 0.15rem; }
@media (max-width: 720px) {
  .rangee { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rangee > div:nth-child(3) { background: var(--tapis); color: var(--ivoire); }
  .rangee > div:nth-child(4) { background: var(--buis); color: var(--encre); }
}

.jauge { height: 0.6rem; border: 1.5px solid currentColor; border-radius: 99px; overflow: hidden; margin-top: 0.55rem; }
.jauge > span { display: block; height: 100%; background: currentColor; min-width: 2px; }

/* Tableaux */
.tableau-wrap { overflow-x: auto; margin: 0 -1.35rem -1.25rem; }
.tableau th { text-align: left; font-size: 0.8rem; font-weight: 650; color: var(--encre-douce); padding: 0.55rem 0.7rem; border-bottom: 1.5px solid var(--encre); white-space: nowrap; }
.tableau td { padding: 0.7rem 0.7rem; border-bottom: 1px solid var(--trait); vertical-align: middle; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau th:first-child, .tableau td:first-child { padding-left: 1.35rem; }
.tableau th:last-child, .tableau td:last-child { padding-right: 1.35rem; }
.tableau td.num, .tableau th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau a.fort { font-weight: 700; text-decoration: none; }
.tableau a.fort:hover { text-decoration: underline; }
.tableau .petit { font-size: 0.84rem; color: var(--encre-douce); }
.tableau .serre { white-space: nowrap; }
.tableau .wdl { min-width: 7.5rem; }
.tableau tbody tr:hover { background: rgba(234, 217, 166, 0.28); }

.vide { text-align: center; padding: 2.4rem 1rem; }
.vide .piece { font-size: 3rem; color: var(--case-verte); display: block; margin-bottom: 0.6rem; }
.vide h2, .vide h3 { font-size: 1.2rem; font-weight: 750; margin-bottom: 0.35rem; }
.vide p { color: var(--encre-douce); max-width: 30rem; margin: 0 auto 1.1rem; }

.liste-etapes { display: grid; gap: 0.1rem; counter-reset: etape; }
.liste-etapes li { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; gap: 0.6rem; align-items: center; padding: 0.65rem 0; border-bottom: 1px solid var(--trait); counter-increment: etape; }
.liste-etapes li:last-child { border-bottom: 0; }
.liste-etapes li::before { content: counter(etape) "."; font-weight: 800; font-stretch: 75%; font-variation-settings: "wdth" 75; font-size: 1.35rem; color: var(--case-verte); font-variant-numeric: tabular-nums; }
.liste-etapes li.fait { color: var(--encre-douce); }
.liste-etapes li.fait::before { content: "✓"; color: var(--tapis); }
.liste-etapes li.fait strong { text-decoration: line-through; text-decoration-thickness: 1.5px; font-weight: 550; }

.fil { font-size: 0.9rem; margin-bottom: 0.7rem; }
.fil a { color: var(--encre-douce); }

.actions-ligne { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.separe { border-top: 1.5px solid var(--trait); margin-top: 1.2rem; padding-top: 1.2rem; }
form.enligne { display: inline; }
.comptes-echecs { display: grid; gap: 0.7rem; }
.compte-echecs { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; align-items: baseline; padding: 0.7rem 0.85rem; border: 1.5px solid var(--trait); border-radius: var(--rayon); }
.compte-echecs strong { font-weight: 750; }
.compte-echecs .classements { display: flex; gap: 0.8rem; flex-wrap: wrap; font-size: 0.88rem; color: var(--encre-douce); font-variant-numeric: tabular-nums; }
.compte-echecs .classements b { color: var(--encre); }

.periode { display: inline-flex; border: 1.5px solid var(--encre); border-radius: var(--rayon); overflow: hidden; font-size: 0.86rem; font-weight: 650; }
.periode a { padding: 0.3rem 0.7rem; text-decoration: none; border-left: 1.5px solid var(--encre); }
.periode a:first-child { border-left: 0; }
.periode a[aria-current="true"] { background: var(--encre); color: #fff; }

/* Règle d'automatisation, écrite comme une phrase */
.regle { font-size: 1.05rem; line-height: 2.4; }
.regle select, .regle input { display: inline-block; width: auto; max-width: 100%; min-height: 2.2rem; line-height: 1.3; padding: 0.3em 0.55em; margin: 0 0.15em; vertical-align: baseline; font-weight: 650; background: #fffbe9; border-color: var(--coup-fonce); }
.regle input[type="number"] { width: 4.6rem; }
.variables { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.variables code { background: var(--buis); padding: 0.1em 0.45em; border-radius: 3px; font-family: inherit; font-size: 0.84rem; font-weight: 600; }

/* Vidéos */
.depot { border: 2px dashed rgba(20, 19, 15, 0.45); border-radius: var(--rayon); padding: 2rem 1.2rem; text-align: center; background: #fffdf5; transition: background-color 0.12s, border-color 0.12s; }
.depot.survol { background: #fff3c4; border-color: var(--encre); }
.depot p { color: var(--encre-douce); margin-top: 0.5rem; font-size: 0.92rem; }
.envois { display: grid; gap: 0.6rem; margin-top: 1rem; }
.envoi { border: 1.5px solid var(--trait); border-radius: var(--rayon); padding: 0.7rem 0.9rem; background: #fff; }
.envoi .nom { font-weight: 650; overflow-wrap: anywhere; }
.envoi .suivi { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.85rem; color: var(--encre-douce); margin-top: 0.3rem; font-variant-numeric: tabular-nums; }
.envoi progress { width: 100%; height: 0.55rem; margin-top: 0.45rem; accent-color: var(--tapis); }
.envoi.erreur { border-color: var(--gaffe); }
.envoi.erreur .suivi { color: var(--gaffe); font-weight: 600; }

.videos { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.video-carte { display: grid; gap: 0.55rem; text-decoration: none; align-content: start; }
.video-carte .vignette { position: relative; aspect-ratio: 16 / 9; background: var(--tapis); border-radius: var(--rayon); overflow: hidden; display: grid; place-items: center; color: var(--buis); border: 1.5px solid var(--encre); }
.video-carte .vignette img { width: 100%; height: 100%; object-fit: cover; }
.video-carte .vignette .piece { font-size: 3.2rem; opacity: 0.7; }
.video-carte .duree { position: absolute; right: 0.4rem; bottom: 0.4rem; background: var(--encre); color: #fff; font-size: 0.76rem; font-weight: 650; padding: 0.1em 0.45em; border-radius: 3px; font-variant-numeric: tabular-nums; }
.video-carte .verrou { position: absolute; left: 0.4rem; top: 0.4rem; background: var(--coup); color: var(--encre); font-size: 0.76rem; font-weight: 700; padding: 0.15em 0.5em; border-radius: 3px; }
.video-carte h3 { font-size: 1.02rem; font-weight: 700; line-height: 1.25; }
.video-carte:hover h3 { text-decoration: underline; }
.video-carte .meta { font-size: 0.84rem; color: var(--encre-douce); }
.lecteur { background: #000; border-radius: var(--rayon); overflow: hidden; border: 1.5px solid var(--encre); }
.lecteur video { width: 100%; max-height: 72vh; }
.puces { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.puce { background: var(--buis); border-radius: 3px; padding: 0.12em 0.55em; font-size: 0.82rem; font-weight: 600; }
.choix-ouvertures { columns: 2 14rem; column-gap: 1.4rem; max-height: 17rem; overflow-y: auto; border: 1.5px solid var(--trait); border-radius: var(--rayon); padding: 0.7rem 0.9rem; background: #fff; }
.choix-ouvertures label { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.18rem 0; break-inside: avoid; font-size: 0.93rem; }
.choix-ouvertures input { accent-color: var(--tapis); margin-top: 0.3rem; }
.economie { font-size: 0.84rem; color: #1c5a39; font-weight: 650; }

/* ---------- Pages de connexion (coach et clubs) : deux cases côte à côte ---------- */
body.porte { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.porte-affiche { background: var(--tapis); color: var(--ivoire); padding: clamp(1.5rem, 4vw, 3.5rem); display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; position: relative; overflow: hidden; }
.porte-affiche .marque { color: var(--ivoire); position: relative; z-index: 1; }
.porte-affiche .accroche { position: relative; z-index: 1; }
.porte-affiche .accroche p { margin-top: 1.1rem; font-size: 1.12rem; max-width: 30rem; color: rgba(247, 242, 227, 0.88); }
.porte-affiche .damier { position: absolute; right: -9%; bottom: -14%; width: min(62%, 30rem); aspect-ratio: 1; opacity: 0.5; transform: rotate(-8deg);
  background: conic-gradient(var(--tapis-clair) 25%, transparent 0 50%, var(--tapis-clair) 0 75%, transparent 0) 0 0 / 25% 25%; border: 2px solid var(--tapis-clair); }
.porte-affiche .grande-piece { position: absolute; right: 6%; bottom: 3%; font-size: clamp(9rem, 22vw, 19rem); color: var(--coup); line-height: 0.8; }
.porte-affiche .petit { position: relative; z-index: 1; font-size: 0.86rem; color: var(--buis); }
.porte-affiche .petit a { color: inherit; }
.porte-form { padding: clamp(1.5rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: center; background: var(--papier); }
.porte-form > div { width: 100%; max-width: 27rem; margin: 0 auto; }
.porte-form h1 { font-stretch: 75%; font-variation-settings: "wdth" 75; font-weight: 800; font-size: clamp(1.9rem, 3vw, 2.5rem); line-height: 1; margin-bottom: 0.5rem; }
.porte-form .chapo { color: var(--encre-douce); margin-bottom: 1.6rem; }
.porte-form .bas { margin-top: 1.3rem; font-size: 0.93rem; color: var(--encre-douce); }
@media (max-width: 820px) {
  body.porte { display: block; }
  .porte-affiche { padding: 1.4rem 1.2rem 1.8rem; min-height: 0; gap: 1.2rem; }
  .porte-affiche .grande-piece, .porte-affiche .damier { display: none; }
  .porte-affiche .accroche .titre-1 { font-size: 2.2rem; }
  .porte-affiche .accroche p { font-size: 1rem; }
}

/* ---------- Espace membres d'un club ---------- */
body.club { background: var(--papier); min-height: 100vh; display: flex; flex-direction: column; }
.club-bar { background: var(--tapis); color: var(--ivoire); }
.club-bar .dedans { max-width: var(--page); margin: 0 auto; padding: 1.1rem clamp(1rem, 3vw, 2rem) 0; }
.club-nom { font-stretch: 75%; font-variation-settings: "wdth" 75; font-weight: 800; font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1; text-decoration: none; display: inline-flex; align-items: center; gap: 0.6rem; overflow-wrap: anywhere; }
.club-nom .case { display: grid; place-items: center; width: 1.25em; height: 1.25em; background: var(--coup); color: var(--encre); border-radius: 3px; font-size: 0.8em; flex: none; }
.club-haut { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.club-haut .qui { font-size: 0.9rem; color: var(--buis); }
.club-haut .qui a { color: inherit; }
.club-menu { display: flex; gap: 0.2rem; margin-top: 1rem; overflow-x: auto; }
.club-menu a { padding: 0.6rem 0.95rem; text-decoration: none; font-weight: 650; border-radius: var(--rayon) var(--rayon) 0 0; white-space: nowrap; color: rgba(247, 242, 227, 0.86); }
.club-menu a:hover { background: var(--tapis-clair); }
.club-menu a[aria-current="page"] { background: var(--papier); color: var(--encre); }
.club-main { flex: 1; width: 100%; max-width: var(--page); margin: 0 auto; padding: 2rem clamp(1rem, 3vw, 2rem) 3.5rem; }
.club-main > h1 { font-stretch: 75%; font-variation-settings: "wdth" 75; font-weight: 800; font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1; margin-bottom: 1.3rem; }
.club-pied { border-top: 1.5px solid var(--trait); padding: 1rem; text-align: center; font-size: 0.84rem; color: var(--encre-douce); }
.formules { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.formule { border: 1.5px solid var(--encre); border-radius: var(--rayon); padding: 1.3rem; background: #fff; display: flex; flex-direction: column; gap: 0.6rem; }
.formule .prix { font-stretch: 75%; font-variation-settings: "wdth" 75; font-weight: 800; font-size: 2.6rem; line-height: 1; }
.formule .prix small { font-size: 1rem; font-weight: 600; font-stretch: 100%; font-variation-settings: "wdth" 100; color: var(--encre-douce); }
.formule .btn { margin-top: auto; }

/* Page simple (erreurs, confirmations) */
body.simple { display: grid; place-items: center; min-height: 100vh; background: var(--tapis); padding: 1.5rem; }
.simple-carte { background: var(--papier); border-radius: var(--rayon); padding: clamp(1.5rem, 4vw, 2.6rem); max-width: 34rem; width: 100%; }
.simple-carte h1 { font-stretch: 75%; font-variation-settings: "wdth" 75; font-weight: 800; font-size: 2rem; line-height: 1; margin-bottom: 0.8rem; }
.simple-carte p { margin-bottom: 1rem; }
