/* Ludo — ce qui est propre au jeu (le style commun est dans ../commun/theme.css) */
:root{ --p1:#ef4b55; --p2:#3b8fe6; --p3:#2fa865; --p4:#f39a1e;
  --bois:#e7d9ba; --trait:#1f1b16; --case:#fdfaf1; }
html,body{height:100%;overflow:hidden;-webkit-user-select:none;user-select:none}

/* ---------- Tableau de bord : pions rentrés + état des 4 pions ---------- */
.tval{display:flex;align-items:baseline;gap:5px;font-size:13px;font-weight:700;color:var(--ink-2)}
.team.right .tval{flex-direction:row-reverse}
.team.right .tval .of{order:-1}
.tval b{display:inline-block;font-family:var(--font-d);font-size:24px;line-height:1;color:var(--ink)}
.tval .of{font-weight:800}
/* Les 4 pions : la forme dit l'état, pas seulement la couleur
   (vide = cour · plein = piste · barré = couloir · plein encadré = arrivé) */
.prog{display:flex;gap:3px;margin-top:4px}
.team.right .prog{flex-direction:row-reverse}
.prog i{width:10px;height:10px;border-radius:50%;border:1.6px solid var(--ink);background:#fff}
.prog i.piste{background:var(--pc)}
.prog i.couloir{background:repeating-linear-gradient(45deg,var(--pc) 0 2px,#fff 2px 4px)}
.prog i.arrive{background:var(--pc);border-radius:2px;box-shadow:0 0 0 1.6px #fff,0 0 0 3px var(--ink)}
.ctitle{font-family:var(--font-d);font-size:18px;font-weight:800;line-height:1.1}
.csub{font-size:12px;font-weight:700;color:var(--ink-2);margin-top:3px;max-width:110px}
@media (max-width:400px){ .tval b{font-size:20px} .prog i{width:8px;height:8px;border-width:1.3px} .prog{gap:2px} }
.logo{color:var(--p1)}
.hud.multi .team.right .tval,.hud.multi .team.right .prog{flex-direction:row}
.hud.multi .team.right .tval .of{order:0}
.hud.multi .tval b{font-size:20px}
@media (max-width:440px){ .hud.multi .tval>span:first-child{display:none} .hud.multi .prog i{width:7px;height:7px} }

/* Boutons du bas : libellé court sur petit écran */
.bar .sm{display:none}
@media (max-width:440px){ .bar .lg{display:none} .bar .sm{display:inline} }

/* ---------- Le dé et le bandeau, côte à côte ---------- */
.turnbar{display:flex;align-items:stretch;gap:8px;margin:8px 0 6px}
.turnbar .banner{margin:0;flex:1;min-width:0}
.de-btn{flex:none;width:72px;padding:0;border:2.5px solid var(--ink);border-radius:var(--r);background:var(--card);
  box-shadow:3px 3px 0 var(--ink);display:flex;align-items:center;justify-content:center;
  transition:transform .12s ease-out,box-shadow .12s ease-out,background .2s}
.de-btn .de{width:52px;height:52px;display:block}
.de-btn[aria-disabled="true"]{opacity:.5;cursor:default}
.de-btn.actif{background:var(--ac);animation:deAppel 1.4s ease-in-out infinite}
.de-btn.actif:active{transform:translate(3px,3px);box-shadow:0 0 0 var(--ink);animation:none}
.de-btn.roule .de{animation:deRoule .45s linear infinite}
.de-btn.pose .de{animation:dePose .34s cubic-bezier(.3,1.5,.5,1)}
@keyframes deAppel{50%{box-shadow:3px 3px 0 var(--ink),0 0 0 6px rgba(255,200,61,.35)}}
@keyframes deRoule{to{transform:rotate(360deg)}}
@keyframes dePose{0%{transform:scale(1.35)}100%{transform:scale(1)}}
.de .de-corps{fill:#fffdf6;stroke:var(--trait);stroke-width:3}
.de .pip{fill:var(--trait);opacity:0;transition:opacity .08s}
.de .pip.on{opacity:1}
.de.vide .de-corps{fill:#fffdf6}
.de .de-vide{display:none;fill:rgba(31,27,22,.45);font-size:34px;font-weight:800;font-family:var(--font-d)}
.de.vide .de-vide{display:block}
@media (max-width:400px){ .de-btn{width:60px} .de-btn .de{width:44px;height:44px} }

/* ---------- Le plateau ---------- */
#board{display:block;touch-action:manipulation;font-family:var(--font-d)}
#board .bois{fill:var(--bois)}
#board .case{fill:var(--case);stroke:var(--trait);stroke-width:1.6}
#board .case.etoile,#board .case.depart{stroke-width:3.4}
#board .case.col{stroke-width:2}
#board .marque{fill:rgba(31,27,22,.55);font-size:20px;font-weight:800;pointer-events:none}
#board .marque.fleche{fill:rgba(255,255,255,.9);font-size:19px}
/* Les quatre couleurs : cour, case de départ, couloir d'arrivée, triangle du centre */
#board .cour.c0 .cour-fond,#board .case.d0,#board .couloir.c0 .case,#board .tri.c0{fill:var(--p1)}
#board .cour.c1 .cour-fond,#board .case.d1,#board .couloir.c1 .case,#board .tri.c1{fill:var(--p2)}
#board .cour.c2 .cour-fond,#board .case.d2,#board .couloir.c2 .case,#board .tri.c2{fill:var(--p3)}
#board .cour.c3 .cour-fond,#board .case.d3,#board .couloir.c3 .case,#board .tri.c3{fill:var(--p4)}
#board .cour-fond{stroke:var(--trait);stroke-width:2.5}
#board .cour-pre{fill:#fffdf6;stroke:var(--trait);stroke-width:2}
#board .cour-niche{fill:rgba(31,27,22,.07);stroke:rgba(31,27,22,.3);stroke-width:1.4;stroke-dasharray:3 3}
#board .tri{stroke:var(--trait);stroke-width:2}
#board .centre-lbl{fill:rgba(255,255,255,.95);font-size:15px;font-weight:800;letter-spacing:.1em;
  paint-order:stroke;stroke:rgba(31,27,22,.55);stroke-width:3.5;pointer-events:none}

/* ---------- Les pions ---------- */
#board .pion{cursor:default}
#board .pion .corps{fill:var(--c);stroke:var(--trait);stroke-width:2.4}
#board .pion .ombre{fill:rgba(31,27,22,.28)}
#board .pion .reflet{fill:rgba(255,255,255,.65)}
#board .pion .num{fill:#fff;font-size:15px;font-weight:800;paint-order:stroke;stroke:rgba(31,27,22,.6);stroke-width:3;
  pointer-events:none}
#board .pion .zone{fill:transparent}
#board .pion .halo{fill:none;stroke:var(--ink);stroke-width:3.5;opacity:0}
#board .pion.peut{cursor:pointer}
#board .pion.peut .halo{opacity:1;stroke:#1f1b16;animation:halo 1.1s ease-in-out infinite}
#board .pion.bouge .corps{stroke-width:3.2}
#board .pion.pris .corps{stroke:#fff;stroke-width:3.4}
#board .pion.arrive .corps{stroke-dasharray:none;stroke-width:3}
@keyframes halo{50%{opacity:.35}}

/* Anneau posé sur la case où irait le pion : deuxième cible, plus facile au doigt */
#board .cible{cursor:pointer}
#board .cible .anneau{fill:rgba(255,255,255,.75);stroke:var(--c);stroke-width:3.5;stroke-dasharray:6 5;
  animation:march 1.1s linear infinite}
#board .cible .cible-num{fill:var(--ink);font-size:14px;font-weight:800;pointer-events:none}
#board .cible .zone{fill:transparent}
/* Cible prise au clavier : anneau plein, couleur du focus */
#board .cible:focus{outline:none}
#board .cible:focus-visible .anneau{stroke:var(--focus);stroke-width:5;stroke-dasharray:none}
@keyframes march{to{stroke-dashoffset:-22}}

/* ---------- Marques passagères ---------- */
#board .marques *{pointer-events:none}
#board .xmark path{fill:none;stroke:#ff3b47;stroke-width:5.5;stroke-linecap:round}
#board .xmark{animation:fadeOut 1.4s ease-in forwards}
#board .burst text{fill:#f7b32b;font-size:17px;paint-order:stroke;stroke:rgba(31,27,22,.5);stroke-width:2.5}
#board .burst{animation:burst 1s ease-out forwards}
@keyframes fadeOut{0%,55%{opacity:1}100%{opacity:0}}
@keyframes burst{from{opacity:1;transform:scale(.7)}to{opacity:0;transform:scale(1.25)}}

/* Aide : résumé en tête */
.brief{background:#fff6dc;border:2px solid var(--ink);border-radius:var(--r);padding:8px 12px;font-size:15px;line-height:1.45;margin:6px 0 2px}

/* ---------- Écran de lancement du Ludo ---------- */
#splash{position:fixed;inset:0;z-index:50;display:flex;flex-direction:column;align-items:center;justify-content:center;
  overflow:hidden;cursor:pointer;animation:out .5s ease-in 3.1s forwards;background:#2f2719;color:#f6f2e6}
#splash::before{content:'';position:absolute;inset:0;
  background:radial-gradient(circle,rgba(255,255,255,.06) 1px,transparent 1.6px) 0 0/16px 16px}
.sp-title{position:relative;font-family:var(--font-d);font-size:clamp(46px,13vw,90px);font-weight:800;line-height:1;
  margin-bottom:24px;opacity:0;animation:fade .5s ease .05s forwards}
.sp-board{position:relative;width:184px;height:184px;background:var(--bois);border:3px solid #f6f2e6;border-radius:10px}
.sp-board .q{position:absolute;width:68px;height:68px;border-radius:10px;border:2.5px solid #2f2719;
  opacity:0;transform:scale(.4);animation:pop .35s cubic-bezier(.3,1.5,.5,1) var(--d) forwards}
.sp-board .q0{left:8px;top:8px;background:var(--p1)} .sp-board .q1{right:8px;top:8px;background:var(--p2)}
.sp-board .q2{right:8px;bottom:8px;background:var(--p3)} .sp-board .q3{left:8px;bottom:8px;background:var(--p4)}
.sp-cross{position:absolute;left:50%;top:50%;width:34px;height:34px;margin:-17px 0 0 -17px;
  background:#fffdf6;border:2.5px solid #2f2719;transform:rotate(45deg);opacity:0;animation:fade .3s ease .75s forwards}
.sp-de{position:absolute;left:50%;top:50%;width:46px;height:46px;margin:-23px 0 0 -23px;border-radius:9px;
  background:#fffdf6;border:3px solid #2f2719;opacity:0;transform:translateY(-120px) rotate(-70deg) scale(1.5);
  animation:deTombe .55s cubic-bezier(.3,1.4,.5,1) 1.15s forwards}
.sp-de s{position:absolute;width:8px;height:8px;border-radius:50%;background:#2f2719;text-decoration:none}
.sp-de s:nth-child(1){left:7px;top:7px} .sp-de s:nth-child(2){right:7px;top:7px}
.sp-de s:nth-child(3){left:16px;top:16px} .sp-de s:nth-child(4){left:7px;bottom:7px}
.sp-de s:nth-child(5){right:7px;bottom:7px}
.sp-sub{margin-top:26px;font-weight:800;letter-spacing:.2em;text-transform:uppercase;font-size:13px;
  opacity:0;animation:fade .5s ease 2s forwards;position:relative}
.sp-skip{position:absolute;bottom:max(18px,env(safe-area-inset-bottom));font-size:12px;color:rgba(246,242,230,.8)}
#splash.gone{display:none}
@keyframes pop{to{opacity:1;transform:none}}
@keyframes deTombe{to{opacity:1;transform:none}}
@keyframes fade{to{opacity:1}}
@keyframes out{to{opacity:0;visibility:hidden}}

@media (prefers-reduced-motion:reduce){
  #splash,#splash *{animation-duration:.01s!important;animation-delay:0s!important}
  #splash{animation:out .3s ease 1.2s forwards!important}
  #board *{animation:none!important;transition:none!important}
  .de-btn,.de-btn .de{animation:none!important}
}

/* Joueur qui a quitté la partie : il reste visible, mais éteint. */
.team.parti{opacity:.45;filter:grayscale(1)}
.team.parti .tname::after{content:' · parti';font-size:11px;font-weight:700;color:var(--ink-2)}
