/* Styles communs : coach et salle en ligne.
   Identité Chess Take Off : un ciel de nuit qui s'éclaire à l'horizon (l'échiquier est la piste, l'IA le moteur),
   la propulsion en orangé, l'IA en bleu ciel ; le vert reste la couleur de l'action et des bons coups. */
:root {
  --bg: #070a17; --card: rgba(19, 22, 38, .88); --bord: rgba(255, 255, 255, .08);
  --vert: #10b981; --rouge: #ef4444; --ambre: #f59e0b; --bleu: #3b82f6;
  --txt: #f8fafc; --muted: #94a3b8; --champ: rgba(0, 0, 0, .45);
  --nuit: #0b1026; --nuit-2: #151a45; --aube: #2b1460;
  --ia: #38bdf8; --propulsion: #fb923c; --propulsion-2: #fbbf24;
  --degrade-propulsion: linear-gradient(135deg, #fbbf24 0%, #fb923c 55%, #f97316 100%);
  --titres: "Segoe UI Variable Display", "SF Pro Display", -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(1100px 520px at 88% -12%, rgba(91, 33, 182, .22), transparent 62%) fixed,
              radial-gradient(900px 480px at -5% 112%, rgba(251, 146, 60, .09), transparent 60%) fixed,
              radial-gradient(circle at 30% -20%, #1a1f45 0%, #070a17 70%) fixed, #070a17;
  color: var(--txt); font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }
.installer { display: none; }
.installer.dispo { display: inline-block; }
button { font-family: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
a { color: var(--bleu); }
/* Le nom de la plateforme, en haut à gauche de chaque page : un clic ramène à l'accueil.
   Le logo (un pion qui décolle) et le nom, dont la fin est aux couleurs de la propulsion. */
.marque { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-weight: 800;
          font-size: 16px; white-space: nowrap; font-family: var(--titres); letter-spacing: -.2px; }
.marque .logo-cto { width: 1.75em; height: 1.75em; flex: none; border-radius: 26%;
                    box-shadow: 0 4px 16px rgba(251, 146, 60, .22); transition: transform .25s; }
.marque .nom b { font-weight: 800; background: var(--degrade-propulsion); -webkit-background-clip: text;
                 background-clip: text; color: transparent; }
.marque:hover { color: #fff; }
.marque:hover .logo-cto { transform: translateY(-2px) rotate(-6deg); }
@media (prefers-reduced-motion: reduce) { .marque .logo-cto { transition: none; } }
:focus-visible { outline: 2px solid var(--ambre); outline-offset: 2px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 8px; }

/* Échiquier */
.plateau { border-radius: 14px; overflow: hidden; border: 1px solid var(--bord); background: #1a1d29;
           box-shadow: 0 16px 40px rgba(0, 0, 0, .55); }
.plateau svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; }
.plateau .piece { transition: transform .55s cubic-bezier(.45, .05, .25, 1), opacity .4s; }
.plateau .piece.sort { opacity: 0; }
.plateau .cle { animation: fondu .35s ease-out; }
.plateau .echec { animation: pulse 1.2s ease-in-out infinite; }
.plateau .fleche .trait { animation: trace .4s ease-out both; }
.plateau .fleche .tete { animation: fondu .4s ease-out .15s both; }
.plateau .fleche.deja .trait, .plateau .fleche.deja .tete { animation: none; }
@media (prefers-reduced-motion: reduce) {  /* réglage d'accessibilité du système : pas d'animations */
  .plateau .piece { transition: none; }
  .plateau .fleche .trait, .plateau .fleche .tete, .plateau .cle, .plateau .echec { animation: none !important; }
}
@keyframes trace { from { stroke-dashoffset: var(--l); } to { stroke-dashoffset: 0; } }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { fill-opacity: .7; } 50% { fill-opacity: .35; } }

/* Contrôles */
.btn { background: rgba(59, 130, 246, .15); border: 1px solid rgba(59, 130, 246, .45); color: #fff;
       border-radius: 10px; padding: 9px 10px; font-size: 12.5px; font-weight: 700; }
.btn:hover:not(:disabled) { background: rgba(59, 130, 246, .3); }
.btn.vert { background: linear-gradient(135deg, #10b981, #059669); border: 0; }
.btn.vert:hover:not(:disabled) { filter: brightness(1.1); }
.btn.rouge { background: rgba(239, 68, 68, .15); border-color: rgba(239, 68, 68, .45); }
.btn.gris { background: rgba(255, 255, 255, .07); border-color: var(--bord); }
.sel, .champ { min-width: 0; background: var(--champ); color: #fff; border: 1px solid var(--bord);
               border-radius: 8px; padding: 7px 9px; font-size: 12.5px; }
.sel option, .sel optgroup { background: #161820; }
.ligne { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.ligne > .sel, .ligne > .champ, .ligne > .btn { flex: 1; }
.bloc { background: rgba(255, 255, 255, .03); border: 1px solid var(--bord); border-radius: 12px;
        padding: 10px; margin-bottom: 8px; }
.titre-bloc { font-size: 12px; font-weight: 800; color: var(--vert); margin-bottom: 8px; }
.aide { font-size: 11px; color: var(--muted); line-height: 1.45; }
.pill { font-size: 10.5px; font-weight: 600; color: var(--muted); background: rgba(255, 255, 255, .04);
        border: 1px solid var(--bord); padding: 3px 9px; border-radius: 8px; display: inline-flex; gap: 5px;
        align-items: center; }
.pt { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.badge { font-size: 11px; font-weight: 600; color: var(--vert); background: rgba(16, 185, 129, .12);
         border: 1px solid rgba(16, 185, 129, .25); padding: 4px 10px; border-radius: 50px; white-space: nowrap; }
.titre-joueur { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 800;
                color: #111; padding: 1px 7px 1px 5px; border-radius: 50px; margin-left: 5px; vertical-align: 1px;
                text-shadow: 0 0 2px rgba(255, 255, 255, .6); white-space: nowrap; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50;
         background: rgba(15, 17, 24, .97); border: 1px solid var(--bord); border-radius: 12px;
         padding: 10px 16px; font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
         max-width: min(560px, calc(100vw - 32px)); }
/* Incident : message d'excuse ou de connexion interrompue (en haut, au centre) */
.bandeau-incident { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
                    z-index: 70; width: min(640px, calc(100vw - 24px)); display: flex; gap: 12px; align-items: flex-start;
                    background: rgba(20, 22, 30, .97); border: 1px solid rgba(245, 158, 11, .6); border-radius: 14px;
                    padding: 12px 14px; font-size: 13px; line-height: 1.5; color: #f1f5f9;
                    box-shadow: 0 16px 40px rgba(0, 0, 0, .6); animation: descend .35s ease-out; }
.bandeau-incident.panne { border-color: rgba(239, 68, 68, .7); }
.bandeau-incident.retour { border-color: rgba(16, 185, 129, .7); }
.bandeau-incident.maintenance, .bandeau-incident.connexion { border-color: rgba(59, 130, 246, .7); }
.bandeau-incident .bi-icone { font-size: 24px; line-height: 1; }
.bandeau-incident .bi-corps { flex: 1; min-width: 0; }
.bandeau-incident .bi-corps b { display: block; font-size: 14px; margin-bottom: 2px; }
.bandeau-incident .bi-effet { color: #fde68a; font-size: 12.5px; margin-top: 3px; }
.bandeau-incident .bi-fermer { background: none; border: 0; color: var(--muted); font-size: 16px; padding: 0 2px; }
@keyframes descend { from { transform: translate(-50%, -12px); } to { transform: translateX(-50%); } }

/* Aide et suggestions (messagerie privée avec l'assistant et l'équipe) */
.zone-aide { display: inline-flex; gap: 6px; flex: none; }
.support-bouton { position: relative; }
.support-bouton.flottant { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 55;
                           font-size: 18px; padding: 10px 13px; border-radius: 50px; }
.support-pastille { position: absolute; top: -6px; right: -6px; background: var(--rouge); color: #fff; font-size: 10px;
                    border-radius: 10px; padding: 0 5px; line-height: 16px; }
.support-panneau { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 62;
                   width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 32px)); display: flex;
                   flex-direction: column; background: #12141c; border: 1px solid var(--bord); border-radius: 18px;
                   box-shadow: 0 24px 60px rgba(0, 0, 0, .7); overflow: hidden; }
.support-panneau[hidden] { display: none !important; }
.sp-tete { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--bord); font-size: 14px; }
.sp-tete a { margin-left: auto; font-size: 12px; text-decoration: none; }
.sp-fermer { background: none; border: 0; color: var(--muted); font-size: 16px; }
.sp-fil { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sp-msg { max-width: 86%; padding: 8px 11px; border-radius: 14px; font-size: 13px; line-height: 1.5; }
.sp-msg.joueur { align-self: flex-end; background: rgba(59, 130, 246, .22); border-bottom-right-radius: 4px; }
.sp-msg.assistant { align-self: flex-start; background: rgba(255, 255, 255, .06); border-bottom-left-radius: 4px; }
.sp-msg.equipe { align-self: flex-start; background: rgba(245, 158, 11, .14); border: 1px solid rgba(245, 158, 11, .4); }
.sp-qui { font-size: 10.5px; font-weight: 800; color: var(--muted); margin-bottom: 2px; text-transform: uppercase; letter-spacing: .5px; }
.sp-msg.equipe .sp-qui { color: var(--ambre); }
.sp-transmis { margin-top: 6px; font-size: 11px; color: #6ee7b7; font-weight: 700; }
.sp-attente { color: var(--muted); font-style: italic; }
.sp-email { padding: 0 12px; font-size: 11.5px; color: var(--muted); }
.sp-email summary { cursor: pointer; }
.sp-email input { width: 100%; margin: 6px 0; }
.sp-saisie { display: flex; gap: 8px; padding: 10px 12px 12px; }
.sp-saisie textarea { flex: 1; margin: 0; height: auto; min-height: 42px; font-size: 13px; font-family: inherit; resize: none;
                      background: var(--champ); color: #fff; border: 1px solid var(--bord); border-radius: 10px; padding: 8px; }
@media (max-width: 640px) {
  .support-panneau { left: 0; right: 0; bottom: 0; top: 0; width: 100%; height: 100%; border-radius: 0; }
}

.promo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none; gap: 8px;
         padding: 12px; background: rgba(15, 17, 24, .96); border: 1px solid var(--bord); border-radius: 14px;
         box-shadow: 0 10px 30px rgba(0, 0, 0, .6); z-index: 5; }
.promo button { font-size: 34px; width: 60px; height: 60px; background: rgba(255, 255, 255, .08);
                border: 1px solid var(--bord); border-radius: 10px; color: #fff; }
.promo button:hover { background: rgba(16, 185, 129, .35); }
