/* Bataille navale : navires vectoriels vus du dessus, mer bleue et réglages accessibles. */
.wl-bn{--wl-bn-sea:#d7eefa;--wl-bn-sea-2:#c4e4f6;--wl-bn-line:#9cc9e3;--wl-bn-ship:#5f7183;--wl-bn-hit:#e2483d;--wl-bn-sunk:#8f2a24;--wl-bn-water:#eef7fc}
.wl-bn [hidden]{display:none!important}
.wl-bn .wl-brain-levels{margin-bottom:1.8rem}
.wl-bn-settings{align-items:center;gap:1.2rem 2rem;margin-top:1.4rem}
.wl-bn-settings .wl-chess-choice{border-radius:20px;justify-content:center}
.wl-bn-audio{display:flex;align-items:center;gap:1rem;max-width:40rem;padding:1rem 1.2rem;border:1px solid var(--wl-tag-border);border-radius:14px;background:var(--wl-soft);text-align:left}
.wl-bn-audio p{margin:0;font-size:1.25rem;line-height:1.5;color:var(--wl-muted)}
.wl-bn-sound{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.4rem;flex:none;min-height:44px;max-width:11rem;padding:.8rem;border:1px solid var(--wl-tag-border);border-radius:10px;background:white;color:var(--wl-link);font:inherit;font-size:1.25rem;font-weight:700;cursor:pointer}
.wl-bn-sound[aria-pressed=true]{background:var(--wl-header);color:white}
.wl-bn-sound:focus-visible{outline:3px solid var(--wl-pop);outline-offset:3px}
/* Message board above the seas: indigo when neutral (apart from the sea blue), gold for good news, red-orange for bad news; the badge follows the moment. */
.wl-bn-status{--bn-msg-bg:#f1f0ff;--bn-msg-line:#c3bff2;--bn-msg-ink:#2f2a7a;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:1.2rem;min-height:6rem;max-width:60rem;margin:2rem auto 2.4rem;padding:1.2rem 2rem;border:2px solid var(--bn-msg-line);border-radius:var(--wl-radius);background:var(--bn-msg-bg);box-shadow:0 4px 0 var(--bn-msg-line);color:var(--bn-msg-ink);font-size:1.8rem;font-weight:700;line-height:1.4;text-align:center}
.wl-bn-status[data-tone=good]{--bn-msg-bg:var(--wl-gold-soft);--bn-msg-line:var(--wl-gold-border);--bn-msg-ink:var(--wl-gold-ink)}
.wl-bn-status[data-tone=bad]{--bn-msg-bg:#ffede6;--bn-msg-line:#f4a98f;--bn-msg-ink:#8a2a12}
.wl-bn-status-text{margin:0}
.wl-bn-status-text:empty{visibility:hidden}
.wl-bn-status::before{content:"\1F3AF";display:grid;place-items:center;flex:none;width:3.6rem;height:3.6rem;border-radius:50%;background:var(--wl-panel);box-shadow:inset 0 0 0 2px var(--bn-msg-line);font-size:1.9rem;line-height:1}
.wl-bn.is-placing .wl-bn-status::before{content:"\2693"}
.wl-bn.is-thinking .wl-bn-status::before{content:"\1F4BB"}
.wl-bn-status[data-tone=good]::before{content:"\2B50"}
.wl-bn-status[data-tone=bad]::before{content:"\1F4A5"}
.wl-bn.is-over .wl-bn-status[data-tone=good]::before{content:"\1F3C6"}
.wl-bn.is-thinking .wl-bn-status-text::after{content:"";display:inline-block;width:1.4rem;height:1.4rem;margin-left:.6rem;vertical-align:-.15rem;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:wl-bn-spin .8s linear infinite}
.wl-bn-go{grid-column:1/-1;justify-self:center;margin-top:.2rem;background:var(--wl-pop);border-color:var(--wl-pop);color:var(--wl-pop-ink);box-shadow:0 4px 0 var(--wl-pop-text)}
.wl-bn-go:hover{background:var(--wl-pop-light)}
.wl-bn-status.is-new{animation:wl-bn-pop .35s ease-out}
@keyframes wl-bn-spin{to{transform:rotate(360deg)}}
@keyframes wl-bn-pop{0%{transform:scale(.96)}60%{transform:scale(1.02)}to{transform:none}}
.wl-bn-h{margin:0 0 .8rem;font-size:1.7rem;text-align:center}
.wl-bn-left{color:var(--wl-muted);font-weight:500;font-size:1.4rem}

.wl-bn-place{max-width:70rem;margin:0 auto 1.6rem;padding:1.2rem;border-radius:var(--wl-radius);background:var(--wl-soft)}
.wl-bn-dock{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr));gap:.8rem}
.wl-bn-dock-ship{position:relative;display:inline-flex;flex-direction:column;align-items:center;gap:.4rem;min-height:44px;padding:.7rem 1.1rem;border:2px solid transparent;border-radius:var(--wl-radius-sm);background:var(--wl-panel);color:var(--wl-ink);font:inherit;font-weight:600;cursor:pointer}
.wl-bn-dock-ship small{color:var(--wl-muted);font-weight:500}
.wl-bn-dock-ship.is-on{border-color:var(--wl-pop);background:var(--wl-pop-soft)}
/* Placed ships fade out of the picker and get a check badge, so the ones left to place stand out. */
.wl-bn-dock-ship.is-placed:not(.is-on){border-style:dashed;border-color:var(--wl-line);background:transparent;color:var(--wl-muted)}
.wl-bn-dock-ship.is-placed:not(.is-on) .wl-bn-ship-icon{opacity:.3;filter:grayscale(1)}
.wl-bn-dock-ship.is-placed::after{content:"\2713";position:absolute;top:.4rem;right:.4rem;display:grid;place-items:center;width:2.2rem;height:2.2rem;border-radius:50%;background:var(--wl-accent);color:var(--wl-nav);font-size:1.3rem;font-weight:700;line-height:1}
.wl-bn-dock-ship:focus-visible{outline:3px solid var(--wl-link);outline-offset:2px}
.wl-bn-ship-icon{display:block;width:calc(var(--ship-length)*3rem);height:4rem;max-width:100%;pointer-events:none}
.wl-bn-ship-icon svg{display:block;width:100%;height:100%;overflow:visible}
.wl-bn-tools{flex-wrap:wrap;gap:1rem;justify-content:center;margin-top:1.2rem}

.wl-bn-seas{display:grid;gap:2rem;align-items:start}
@media (min-width:900px){.wl-bn-seas{grid-template-columns:1fr 1fr}.wl-bn.is-placing .wl-bn-seas{grid-template-columns:minmax(0,52rem);justify-content:center}}
.wl-bn-sea{min-width:0}
.wl-bn-wrap{position:relative}
.wl-bn-wrap:has(> [data-bn-over]:not([hidden])) .wl-bn-grid{min-height:34rem}
.wl-bn-grid{display:grid;grid-template-columns:1.8rem repeat(var(--bn-size,10),minmax(0,1fr));gap:2px;width:min(100%,52rem);margin:0 auto;padding:.6rem;border-radius:var(--wl-radius);background:var(--wl-bn-line);user-select:none;-webkit-user-select:none}
.wl-bn-corner{display:block}
.wl-bn-label{display:flex;align-items:center;justify-content:center;color:#24506b;font-weight:700;font-size:1.2rem;line-height:1.6}
.wl-bn-cell{position:relative;aspect-ratio:1;min-width:0;padding:0;border:0;border-radius:3px;background:var(--wl-bn-sea);cursor:default;-webkit-tap-highlight-color:transparent}
.wl-bn-cell:focus-visible{outline:3px solid var(--wl-pop);outline-offset:-3px;z-index:1}
.wl-bn-cell.is-open{cursor:crosshair}
.wl-bn-cell.is-open:hover{background:#fff6d6}
.wl-bn.is-placing .wl-bn-sea--mine .wl-bn-cell{cursor:pointer}

/* Each cell crops the same complete SVG: the hull spans precisely its real cells, in either orientation. */
.wl-bn-cell.is-ship{background:var(--wl-bn-sea)}
.wl-bn-cell>svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.wl-bn-cell.is-reveal>svg{opacity:.7}
.wl-bn-cell.is-preview{background:#7cc58f;box-shadow:inset 0 0 0 2px #2f8a4c}
.wl-bn-cell.is-bad{background:#f3b3ad;box-shadow:inset 0 0 0 2px var(--wl-bn-hit)}

/* Tirs. */
.wl-bn-cell.is-miss::after,.wl-bn-cell.is-water::after{content:"";position:absolute;inset:38%;border-radius:50%;background:#fff;box-shadow:0 0 0 2px #7fb6d6}
.wl-bn-cell.is-water{background:var(--wl-bn-water)}
.wl-bn-cell.is-water::after{inset:44%;background:#b9d9eb;box-shadow:none}
.wl-bn-cell.is-hit::after,.wl-bn-cell.is-sunk::after{content:"";position:absolute;inset:22%;border-radius:50%;background:var(--wl-bn-hit);box-shadow:0 0 0 3px rgba(255,255,255,.75)}
.wl-bn-cell.is-hit{animation:wl-bn-boom .4s ease-out}
.wl-bn-cell.is-sunk{background:#c9deeb}
.wl-bn-cell.is-sunk>svg{filter:grayscale(.8) brightness(.75)}
.wl-bn-cell.is-sunk::after{inset:30%;background:#ffb4a8;box-shadow:none}
.wl-bn-cell.is-hint{animation:wl-bn-pulse 1.1s ease-in-out infinite;box-shadow:inset 0 0 0 3px #f2a516}
@keyframes wl-bn-boom{from{transform:scale(1.25)}}
@keyframes wl-bn-pulse{50%{background:#ffe9a8}}
@media (prefers-reduced-motion:reduce){.wl-bn-cell.is-hit,.wl-bn-cell.is-hint,.wl-bn-status.is-new{animation:none}}

.wl-bn-fleet{display:flex;flex-wrap:wrap;gap:.5rem 1.2rem;justify-content:center;margin:1rem 0 0;padding:0;list-style:none;font-size:1.35rem}
.wl-bn-fleet-item{display:inline-flex;align-items:center;gap:.6rem}
.wl-bn-fleet-item .wl-bn-ship-icon{width:calc(var(--ship-length)*1.4rem);height:2rem}
.wl-bn-fleet-item.is-sunk{color:var(--wl-muted);text-decoration:line-through}
.wl-bn-fleet-item.is-sunk .wl-bn-ship-icon{filter:grayscale(1);opacity:.65}
.wl-bn .wl-brain-over{border-radius:var(--wl-radius)}
.wl-bn-wins{white-space:nowrap}
@media (max-width:560px){.wl-bn-grid{padding:.3rem;gap:1px;grid-template-columns:1.4rem repeat(var(--bn-size,10),minmax(0,1fr))}.wl-bn-label{font-size:1rem}.wl-bn-dock-ship{padding:.5rem .8rem}}
/* Keep the ship picker compact enough to use beside the sea on a phone. */
@media (max-width:560px){
    .wl-bn-place{padding:.8rem;margin-bottom:.8rem}
    .wl-bn-dock{grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}
    .wl-bn-dock-ship{min-width:0;gap:.2rem;padding:.5rem;font-size:1.2rem;line-height:1.3;overflow-wrap:anywhere}
    .wl-bn-dock-ship small{display:block}
    .wl-bn-dock-ship .wl-bn-ship-icon{height:2.4rem;width:calc(var(--ship-length)*2rem)}
    .wl-bn-place .wl-bn-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem;margin-top:.8rem}
    .wl-bn-place .wl-btn{min-width:0;min-height:44px;padding:.6rem;font-size:1.2rem;justify-content:center}
    .wl-bn-place [data-bn-start]{grid-column:1/-1}
    .wl-bn-go{justify-self:stretch;justify-content:center;min-height:48px}
    .wl-bn-status{gap:.8rem;min-height:5rem;margin:1.2rem 0 1.4rem;padding:.9rem 1.2rem;font-size:1.45rem;line-height:1.4;text-align:left}
    .wl-bn-status::before{width:2.8rem;height:2.8rem;font-size:1.5rem}
    .wl-bn.is-placing [data-bn-my-fleet]{display:none}
}
