/* Échecs : plateau vert et crème aux couleurs du site, panneau latéral, pièces vectorielles. */
.wl-chess{--wl-chess-light:#f3ecd6;--wl-chess-dark:#7fa66a;--wl-chess-last:rgba(255,206,74,.55);--wl-chess-sel:rgba(255,138,61,.6);--wl-chess-dotc:rgba(20,35,26,.28);--wl-chess-size:min(62rem,var(--wl-fit-h))}
.wl-chess [hidden]{display:none!important}
.wl-chess-setup{display:flex;flex-wrap:wrap;gap:1rem 2rem;justify-content:center;margin-bottom:1.4rem}
.wl-chess-choice{display:inline-flex;flex-wrap:wrap;gap:.5rem;padding:.4rem;border-radius:999px;background:var(--wl-soft)}
.wl-chess-opt{display:inline-flex;align-items:center;gap:.6rem;min-height:44px;padding:.6rem 1.4rem;border:0;border-radius:999px;background:transparent;color:var(--wl-ink);font:inherit;font-weight:600;cursor:pointer}
.wl-chess-opt.is-on{background:var(--wl-panel);box-shadow:0 2px 6px rgba(10,60,30,.15);color:var(--wl-header)}
.wl-chess-opt:focus-visible{outline:3px solid var(--wl-link);outline-offset:2px}
.wl-chess-dot{display:inline-block;width:1.4rem;height:1.4rem;border-radius:50%;border:2px solid #26332b;flex:none}
.wl-chess-dot--w{background:#fff}.wl-chess-dot--b{background:#26332b}

.wl-chess-game{display:grid;grid-template-columns:minmax(0,var(--wl-chess-size)) minmax(24rem,32rem);gap:4rem;justify-content:center;align-items:start;margin-top:1.6rem}
.wl-chess-main{width:100%;min-width:0}
.wl-chess-player{display:flex;align-items:center;justify-content:space-between;gap:1rem;min-height:4rem;padding:.4rem .8rem;border-radius:var(--wl-radius-sm);transition:background .2s}
.wl-chess-player.is-turn{background:var(--wl-tag-bg)}
.wl-chess-who{display:inline-flex;align-items:center;gap:.7rem;font-size:1.5rem}
.wl-chess-taken{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;min-height:2.2rem}
.wl-chess-taken .wl-chess-pc{width:2.2rem;height:2.2rem;margin-left:-.6rem}
.wl-chess-lead{margin-left:.6rem;font-weight:700;font-size:1.3rem;color:var(--wl-muted)}

.wl-chess-wrap{position:relative}
.wl-chess-board{display:grid;grid-template-columns:repeat(8,1fr);aspect-ratio:1;width:100%;border-radius:var(--wl-radius-sm);overflow:hidden;box-shadow:0 0 0 3px #4f7a41,var(--wl-shadow);touch-action:none;user-select:none;-webkit-user-select:none}
.wl-chess-sq{position:relative;display:block;width:100%;aspect-ratio:1;min-width:0;padding:0;border:0;margin:0;font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
.wl-chess-sq.is-light{background:var(--wl-chess-light)}.wl-chess-sq.is-dark{background:var(--wl-chess-dark)}
.wl-chess-sq::before,.wl-chess-sq::after{content:"";position:absolute;pointer-events:none}
.wl-chess-sq.is-last::before{inset:0;background:var(--wl-chess-last)}
.wl-chess-sq.is-selected::before{inset:0;background:var(--wl-chess-sel)}
.wl-chess-sq.is-hint::before{inset:0;background:rgba(80,170,255,.45)}
.wl-chess-sq.is-check::before{inset:0;background:radial-gradient(circle,rgba(230,40,30,.85) 0,rgba(230,40,30,.45) 45%,transparent 75%)}
.wl-chess-sq.is-target::after{left:50%;top:50%;width:28%;height:28%;transform:translate(-50%,-50%);border-radius:50%;background:var(--wl-chess-dotc)}
.wl-chess-sq.is-capture::after{inset:4%;border-radius:50%;border:.5rem solid var(--wl-chess-dotc)}
.wl-chess-sq.is-over{box-shadow:inset 0 0 0 4px rgba(255,255,255,.85)}
.wl-chess-sq:focus-visible{outline:none;box-shadow:inset 0 0 0 4px #1d5c3a,inset 0 0 0 6px #fff;z-index:1}
.wl-chess-piece{position:absolute;inset:0;display:block;z-index:2;pointer-events:none}
.wl-chess-sq.is-dragging .wl-chess-piece{opacity:.3}
.wl-chess-pc{display:block;width:100%;height:100%;stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round}
.wl-chess-pc:is(img){object-fit:contain;object-position:center}
.wl-chess-pc--w{fill:#fffdf6;stroke:#26332b}.wl-chess-pc--w .wl-chess-d{fill:none;stroke:#26332b}.wl-chess-pc--w .wl-chess-e{fill:#26332b;stroke:none}
.wl-chess-pc--b{fill:#2b3530;stroke:#101612}.wl-chess-pc--b .wl-chess-d{fill:none;stroke:#e9e4d2}.wl-chess-pc--b .wl-chess-e{fill:#e9e4d2;stroke:none}
.wl-chess-piece .wl-chess-pc{filter:drop-shadow(0 1px 1px rgba(0,0,0,.25))}
.wl-chess-coord{position:absolute;z-index:3;font-size:clamp(.9rem,1.8vw,1.2rem);font-weight:700;line-height:1;pointer-events:none}
.wl-chess-coord--rank{top:.3rem;left:.35rem}.wl-chess-coord--file{right:.35rem;bottom:.25rem}
.wl-chess-sq.is-light .wl-chess-coord{color:#5d8a4b}.wl-chess-sq.is-dark .wl-chess-coord{color:#f3ecd6}
.wl-chess-ghost{position:fixed;left:0;top:0;z-index:1000;pointer-events:none;filter:drop-shadow(0 6px 8px rgba(0,0,0,.3))}
.wl-chess.is-thinking .wl-chess-board{cursor:progress}

.wl-chess-promo{position:absolute;inset:0;z-index:6;display:grid;place-items:center;background:rgba(20,35,26,.45);border-radius:var(--wl-radius-sm)}
.wl-chess-promo-box{background:var(--wl-panel);border-radius:var(--wl-radius);padding:1.4rem 1.6rem;text-align:center;box-shadow:var(--wl-shadow)}
.wl-chess-promo-box p{margin:0 0 1rem;font-weight:700}
.wl-chess-promo-box>div{display:flex;gap:.8rem}
.wl-chess-promo-pc{width:6.4rem;height:6.4rem;padding:.4rem;border:2px solid var(--wl-tag-border);border-radius:var(--wl-radius-sm);background:var(--wl-chess-light);cursor:pointer}
.wl-chess-promo-pc:hover,.wl-chess-promo-pc:focus-visible{border-color:var(--wl-pop);outline:none;background:var(--wl-pop-soft)}

.wl-chess-side{display:grid;gap:1.4rem;align-content:start}
.wl-chess-status{min-height:5.2rem;margin:0;padding:1rem 1.2rem;border-radius:var(--wl-radius-sm);background:var(--wl-soft);font-weight:600}
.wl-chess.is-thinking .wl-chess-status::after{content:"";display:inline-block;width:1.2rem;height:1.2rem;margin-left:.6rem;vertical-align:-.1rem;border:2px solid var(--wl-link);border-right-color:transparent;border-radius:50%;animation:wl-chess-spin .8s linear infinite}
@keyframes wl-chess-spin{to{transform:rotate(360deg)}}
.wl-chess-tools{display:grid;grid-template-columns:1fr 1fr;gap:.7rem}
.wl-chess-tools .wl-btn{justify-content:center;padding-inline:.8rem;min-height:44px}
.wl-chess-tools .wl-btn:disabled{opacity:.45;cursor:not-allowed}
.wl-chess-toggle{display:flex;align-items:center;gap:.7rem;font-size:1.5rem;cursor:pointer}
.wl-chess-toggle input{width:1.8rem;height:1.8rem;accent-color:var(--wl-link)}
.wl-chess-history{border:1px solid var(--wl-line);border-radius:var(--wl-radius-sm);padding:1rem 1.2rem}
.wl-chess-history-head{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:.6rem}
.wl-chess-history-head .wl-h3{margin:0}
.wl-chess-moves{margin:0;padding-left:3.2rem;max-height:22rem;overflow:auto;font-variant-numeric:tabular-nums;font-size:1.5rem}
.wl-chess-moves li{padding:.15rem 0}
.wl-chess-moves li::marker{color:var(--wl-muted)}
.wl-chess-mv{display:inline-block;min-width:7rem;padding:0 .4rem;border-radius:5px}
.wl-chess-fig{display:inline-block;width:1.9rem;height:1.9rem;vertical-align:-.45rem;margin-right:.1rem;stroke-width:2}
.wl-chess-mv.is-last{background:var(--wl-tag-bg);font-weight:700}
.wl-chess-moves .wl-chess-empty{list-style:none;margin-left:-3.2rem;color:var(--wl-muted)}
.wl-chess-new{justify-content:center}

@media (prefers-reduced-motion:reduce){.wl-chess.is-thinking .wl-chess-status::after{animation:none}}
@media (max-width:900px){
    .wl-chess-game{grid-template-columns:minmax(0,1fr);gap:1.4rem}
    .wl-chess-main{max-width:var(--wl-chess-size);margin-inline:auto}
    .wl-chess-moves{max-height:14rem}
}
@media (max-width:600px){
    .wl-chess-setup{gap:.8rem}
    .wl-chess-choice{border-radius:var(--wl-radius-sm)}
    .wl-chess-opt{padding:.5rem 1rem}
    .wl-chess-promo-pc{width:5.2rem;height:5.2rem}
    .wl-chess-sq.is-capture::after{border-width:.35rem}
}
