/* Marelle — ce qui est propre au jeu (le style commun est dans ../commun/theme.css) */
:root{ --p1:#ef4b55; --p2:#3b8fe6; --p3:#2fa865; --p4:#f39a1e; --chalk:#f6f2e6; --asphalt:#4b525c; --ok:#58c47a; }
html,body{height:100%;overflow:hidden;-webkit-user-select:none;user-select:none}

/* Tableau de bord : case visée + progression (8 cases) */
.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}
.prog{display:flex;gap:3px;margin-top:4px}
.team.right .prog{flex-direction:row-reverse}
.prog i{width:9px;height:9px;border-radius:3px;border:1.5px solid var(--ink);background:#fff}
.prog i.on{background:var(--pc)}
.prog i.cur{background:#fff;box-shadow:inset 0 0 0 2px var(--pc)}
.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}
.tval b.bump{animation:bump .5s ease}
@keyframes bump{40%{transform:scale(1.5);color:var(--pc)}}
@media (max-width:400px){ .tval b{font-size:20px} .prog i{width:7px;height:7px;border-width:1.2px} .prog{gap:2px} }
.logo{color:var(--p1)}
/* 3 ou 4 joueurs : tout aligné à gauche, plus compact */
.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}
.hud.multi .prog{gap:2px} .hud.multi .prog i{width:7px;height:7px;border-width:1.2px;border-radius:2px}
@media (max-width:440px){ .hud.multi .tval>span:first-child{display:none} .hud.multi .prog i{width:5px;height:6px;border-radius:1px} .hud.multi .prog{gap:1px} }

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

/* ---------- La marelle ---------- */
#board{display:block;touch-action:none;cursor:pointer;font-family:var(--font-d)}
#board .ground{fill:var(--asphalt)}
#board .grain circle{fill:rgba(255,255,255,.07)}
#board .zone.terre{fill:#5a5148;stroke:none}
#board .zone.terre.throwzone{fill:#64594c}
#board .zone.terre.next{animation:glow 1s ease-in-out infinite;fill:#4f7a55}
#board .lbl{fill:rgba(246,242,230,.75);font-size:15px;font-weight:800;letter-spacing:.18em}
#board .ciel-lbl{font-size:17px}
#board .star{fill:rgba(255,224,138,.65);font-size:12px}
#board .cell{fill:rgba(255,255,255,.03);stroke:var(--chalk);stroke-width:3;stroke-linejoin:round;transition:fill .2s}
#board .cell.ciel{fill:rgba(140,180,255,.16)}
#board .num{fill:var(--chalk);font-size:32px;font-weight:800;opacity:.92;pointer-events:none}
#board .hatch{opacity:0;pointer-events:none;transition:opacity .2s}
#board .hint{opacity:0;pointer-events:none}
#board .hint .foot{fill:rgba(255,255,255,.85)}
#board .hint .turn{display:none;fill:#fff;font-size:20px;font-weight:800}
/* case visée (lancer) */
#board .cellg.target .cell{fill:rgba(255,209,102,.32);stroke:#ffd166;stroke-dasharray:9 6;animation:march 1s linear infinite}
#board .cellg.target .num{fill:#ffe29a}
/* case de la pierre : interdite */
#board .cellg.forbid .hatch{opacity:1}
#board .cellg.forbid .cell{fill:rgba(239,75,85,.22);stroke:#ff8a8f}
/* prochaine case à toucher */
#board .cellg.next .cell{fill:rgba(88,196,122,.42);animation:glow 1s ease-in-out infinite}
#board .cellg.next .hint{opacity:1}
#board .cellg.next.turning .foot{display:none}
#board .cellg.next.turning .turn{display:inline}
/* retours visuels */
#board .cell.hit{fill:rgba(88,196,122,.6)}
#board .cell.miss{fill:rgba(239,75,85,.45)}
@keyframes glow{50%{opacity:.6}}
@keyframes march{to{stroke-dashoffset:-30}}

/* pierre */
#board .stone{pointer-events:none}
#board .stone.gone{opacity:0}
#board .stone .rock{fill:#c9c1b2;stroke:#5f584e;stroke-width:1.6}
#board .stone .shine{fill:none;stroke:rgba(255,255,255,.7);stroke-width:1.4;stroke-linecap:round}
#board .stone .shadow{fill:rgba(0,0,0,.28)}
#board .stone .ring{fill:none;stroke:#7ee39b;stroke-width:3;opacity:0}
#board .stone .ring.on{opacity:1;animation:glow 1s ease-in-out infinite}

/* visée : flèche et jauge de force */
#board .aim,#board .gauge{pointer-events:none}
#board .aim.gone,#board .gauge.gone{display:none}
#board .aim-line{stroke:#fff;stroke-width:4;stroke-dasharray:8 7;stroke-linecap:round;fill:none}
#board .aim-head{fill:#fff}
#board .gauge-box{fill:rgba(0,0,0,.35);stroke:var(--chalk);stroke-width:2.5}

/* joueur */
#board .kid{pointer-events:none;--kc:var(--p1)}
#board .kid .shadow{fill:rgba(0,0,0,.3)}
#board .kid .leg,#board .kid .arm{fill:none;stroke:#3a2a20;stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round}
#board .kid .shirt{fill:var(--kc);stroke:#1f1b16;stroke-width:1.4}
#board .kid .head{fill:#a86b45;stroke:#1f1b16;stroke-width:1.4}
#board .kid .hair{fill:#1f1b16}
#board .kid .p-un,#board .kid .p-deux{display:none}
#board .kid.un .p-std,#board .kid.deux .p-std{display:none}
#board .kid.un .p-un,#board .kid.deux .p-deux{display:inline}

/* marques */
#board .marks *{pointer-events:none}
#board .xmark path{fill:none;stroke:#ff5a62;stroke-width:4.5;stroke-linecap:round}
#board .xmark{animation:fadeOut 1.9s ease-in forwards}
#board .print .foot{fill:var(--kc);stroke:var(--chalk);stroke-width:1}
#board .print{animation:fadeOut 1.4s ease-in forwards}
#board .burst text{fill:#ffe08a;font-size:14px}
#board .burst{animation:burst 1s ease-out forwards;transform-box:fill-box}
#board .tapmark{fill:none;stroke:rgba(255,255,255,.85);stroke-width:2;animation:fadeOut .5s ease-out forwards}
@keyframes fadeOut{0%,55%{opacity:1}100%{opacity:0}}
@keyframes burst{from{opacity:1}to{opacity:0}}

/* 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 Marelle ---------- */
#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:#4b525c;color:var(--chalk)}
#splash::before{content:'';position:absolute;inset:0;background:radial-gradient(circle,rgba(255,255,255,.07) 1px,transparent 1.6px) 0 0/14px 14px}
.sp-title{position:relative;font-family:var(--font-d);font-size:clamp(46px,13vw,90px);font-weight:800;line-height:1;margin-bottom:22px;
  opacity:0;animation:fade .5s ease .05s forwards}
.sp-board{position:relative;width:132px;height:236px}
.sp-board i{position:absolute;display:flex;align-items:center;justify-content:center;font:800 18px/1 var(--font-d);font-style:normal;
  border:2.5px solid var(--chalk);box-sizing:border-box;opacity:0;animation:fade .25s ease var(--d) forwards}
.sp-board .c{width:44px;height:34px;left:44px}
.sp-board .c1{top:202px} .sp-board .c2{top:168px} .sp-board .c3{top:134px}
.sp-board .c4{top:100px;left:0} .sp-board .c5{top:100px;left:44px;width:44px}
.sp-board .c6{top:66px} .sp-board .c7{top:32px;left:0} .sp-board .c8{top:32px;left:44px}
.sp-board .c4,.sp-board .c7{left:22px} .sp-board .c5,.sp-board .c8{left:66px}
.sp-board .ciel{left:22px;top:-12px;width:88px;height:44px;border-radius:44px 44px 0 0;font-size:13px;letter-spacing:.12em}
.sp-stone{position:absolute;left:58px;top:146px;width:16px;height:12px;border-radius:50%;background:#c9c1b2;border:2px solid #5f584e;
  opacity:0;transform:translateY(-120px) scale(1.4);animation:drop .5s cubic-bezier(.3,1.4,.5,1) 1.5s forwards}
.sp-sub{margin-top:24px;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 drop{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}
  .tval b.bump{animation:none}
}

/* 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)}
