/* Battleships – styles for battleships-ui.js (view #v-battleships). The screens reuse the Four Stressed / Wild Stressed
   classes of fourkings.css (fk-hero, fk-choices, fk-panel, fk-banner, fk-finish, wd-bar, wd-moves, wd-vs …) like Mill;
   this file adds the grid, the fleet tray and a few details. Palette is fixed (paper, ink, red) under every theme. */
.bs{--bs-l:#fbf7ec;--bs-ink:#141210;--bs-red:#a3221b;--bs-ship:#2a2622}
.bs [hidden]{display:none!important}
.bs .fk-panel{--pc:var(--bs-red)}
.bs-emb{display:block;width:104px;height:104px;margin:0 auto 10px;background:var(--bs-l);border:1px solid var(--bs-ink);box-shadow:2px 2px 0 rgba(20,18,16,.18);padding:8px;transform:rotate(-3deg)}
.bs-emb svg{display:block;width:100%;height:100%}
.bs-chm{display:inline-block;width:22px;height:22px;flex:0 0 auto}
.bs-chm svg{display:block;width:100%;height:100%}
.fk-choice .bs-chm{position:absolute;width:20px;height:20px}
.fk-choice .bs-chm.ix{left:10px;top:10px}.fk-choice .bs-chm.ix2{right:10px;bottom:10px}
#bsResume .fk-resume{border-left-color:var(--bs-red)}

/* the grid: 10 x 10 squares; ships lie under the squares as ink hulls, shots are drawn on the squares */
.bs-wrap{margin:0 auto;width:100%;max-width:max(240px,calc(100vh - 452px))}
.bs.placing .bs-wrap{max-width:max(240px,calc(100vh - 420px))}
.bs-board{position:relative;padding:21px 3px 3px 23px;margin:6px 0;user-select:none;-webkit-user-select:none;touch-action:manipulation}
.bs-board.mini,.bs-board.nocoord{padding:0}
.bs-co{position:absolute;display:flex;font:700 11px/1 "Libre Baskerville",serif;color:#5d574d}
.bs-co span{flex:1 1 0;display:flex;align-items:center;justify-content:center;min-width:0}
.bs-cx{left:23px;right:3px;top:0;height:17px}.bs-cy{top:21px;bottom:3px;left:0;width:19px;flex-direction:column}
.bs-board.nocoord .bs-co{display:none}
.bs-sea{position:relative;width:100%;aspect-ratio:1/1;background:var(--bs-l);border:2px solid var(--bs-ink);outline:1px solid var(--bs-ink);outline-offset:3px;box-sizing:border-box}
.bs-board.mini .bs-sea{border-width:1px;outline:0}
.bs-ships,.bs-grid{position:absolute;inset:0}
.bs-grid{display:grid;grid-template:repeat(10,minmax(0,1fr))/repeat(10,minmax(0,1fr))}
.bs-c{position:relative;display:block;margin:0;padding:0;min-width:0;min-height:0;background:transparent;border:0;border-right:1px solid rgba(20,18,16,.28);border-bottom:1px solid rgba(20,18,16,.28);border-radius:0;font:inherit;color:inherit;cursor:default;-webkit-appearance:none;appearance:none}
.bs-c:nth-child(10n){border-right:0}.bs-c:nth-child(n+91){border-bottom:0}
.bs-board.input .bs-c.go{cursor:pointer}
.bs-c:focus{outline:none}.bs-c:focus-visible{outline:2px dashed var(--bs-ink);outline-offset:-3px}
.bs-c::after{content:"";position:absolute;pointer-events:none}
.bs-c.m::after{inset:36%;border-radius:50%;background:var(--bs-ink);opacity:.6}
.bs-c.h::after,.bs-c.k::after{inset:16%;background:linear-gradient(45deg,transparent 42%,var(--bs-x,var(--bs-red)) 42% 58%,transparent 58%),linear-gradient(-45deg,transparent 42%,var(--bs-x,var(--bs-red)) 42% 58%,transparent 58%)}
.bs-c.k{--bs-x:var(--bs-l)}
.bs-board.own .bs-c.h{--bs-x:var(--bs-l);background:radial-gradient(circle,var(--bs-red) 0 58%,transparent 60%)}
.bs-c.last{box-shadow:inset 0 0 0 2px var(--bs-red)}
.bs-c.dot::after{inset:40%;border-radius:50%;background:var(--bs-ink);opacity:.42}
.bs-c.e::after{inset:41%;border-radius:50%;background:var(--bs-ink);opacity:.45}
html.no-dots .bs-c.dot::after{display:none}
.bs-ship{position:absolute;box-sizing:border-box;border-radius:999px;background:var(--bs-ship);border:1px solid #000;box-shadow:1px 2px 0 rgba(0,0,0,.17)}
.bs-ship.sunk{background:var(--bs-red);border-color:var(--bs-ink)}
.bs-ship.ghost{position:absolute;z-index:auto;transform:none;background:transparent;border:2px dashed var(--bs-ink);box-shadow:none;opacity:.7}
.bs-ship.sel{outline:2px solid var(--bs-red);outline-offset:1px;animation:bsSel 1.6s ease-in-out infinite}
.bs-hull{display:contents}
.bs-ship.blk{border-radius:3px;border:0;box-shadow:none}.bs-ship.blk.br{border-radius:0}
.bs-ship.blk.sel{outline:0;animation:none;background:var(--bs-red)}
.bs-ship.blk.ghost{border:0;background:rgba(20,18,16,.22);opacity:1}
.bs-ship.draft{background:#c4675f;border-color:#c4675f;box-shadow:none}
@keyframes bsSel{50%{outline-offset:3px}}
.bs-c.h,.bs-c.k,.bs-c.m{animation:bsIn .28s ease-out}
@keyframes bsIn{0%{opacity:.2}}
html.a11y-cb .bs{--bs-red:#0072b2}
html.a11y-con .bs-sea{background:#fff}html.a11y-con .bs-c{border-color:#000}

/* player bars: the fleet as small hulls, sunk ships struck out */
.bs-fleet{margin-left:auto;display:flex;align-items:center;gap:3px;flex-wrap:wrap;justify-content:flex-end;flex:0 1 auto;min-width:0}
.bs .wd-nm{flex:0 0 auto;max-width:46%}
.bs-fleet i{height:7px;border-radius:4px;background:var(--bs-ship);border:1px solid var(--bs-ink);box-sizing:border-box}
.bs-fleet i.x{background:var(--bs-red);opacity:.55}
.bs-fleet small{font-size:11px;font-style:italic;color:var(--mut);white-space:nowrap;margin-left:4px}
.bs .wd-bar,.bs .bs-wrap{max-width:max(240px,calc(100vh - 452px))}
.bs.placing .wd-bar{display:none}
.bs .fk-banner{--pc:var(--bs-red);margin:4px 0}
.bs-bt{display:flex;flex-direction:column;gap:2px;min-width:0}
.bs-ev{font:italic 700 12.5px/1.2 "Libre Baskerville",serif;opacity:.85}
.bs-ev.hot{color:var(--bs-red);opacity:1}.bs .fk-banner.mine .bs-ev.hot{color:inherit}
.bs .fk-bl{white-space:normal;font-size:17px}
.bs-next{margin:6px 0}.bs-next .btn{flex:1}

/* placing the fleet */
.bs-help{font-size:12.5px;font-style:italic;color:var(--mut);margin:6px 0}
.bs-list{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.bs-ts{display:flex;flex-direction:column;align-items:flex-start;gap:5px;padding:7px 9px;min-height:44px;background:transparent;color:inherit;border:1px solid var(--ink);border-left:4px solid var(--ink);font:700 13px/1.15 "Libre Baskerville",serif;text-align:left;cursor:pointer;border-radius:0}
.bs-ts.on{border-left-color:var(--bs-red);box-shadow:inset 0 0 0 1px var(--bs-red)}
.bs-ts.done{opacity:.62}.bs-ts.done.on{opacity:1}
.bs-pips{display:flex;gap:2px}.bs-pips i{width:11px;height:8px;background:var(--bs-ship);border:1px solid var(--bs-ink);box-sizing:border-box}
.bs-ts.done .bs-pips i{background:transparent}
.bs-prog{font:700 13px/1.3 "Libre Baskerville",serif;margin:0 0 6px;color:var(--bs-red)}
.bs-list.ten .bs-ts{min-height:38px;padding:5px 8px;gap:4px;font-size:12.5px}
.bs-tools{margin:8px 0 2px}.bs-tools .btn{flex:1;min-width:0}
.bs-tray .fk-go{display:block;width:100%;margin-top:8px}
#bsReady[aria-disabled=true]{opacity:.5}

/* your own fleet (small grid) beside the list of shots */
.bs-own{display:flex;gap:12px;align-items:stretch;margin-top:4px}
.bs.placing .bs-own{display:none}
.bs-ownb{flex:0 0 132px;min-width:0}.bs-ownb .tcgrp{margin:2px 0 4px}
.bs-own .wd-moves{flex:1 1 0;min-width:0;height:auto;max-height:158px;margin-top:0}
.bs-opts{font-size:12.5px;color:var(--mut);font-style:italic;text-align:center;margin:4px 0 0}

/* the cover between two players on one device, and the result screen */
.bs-cover{position:fixed;inset:0;z-index:6;background:var(--paper);overflow-y:auto;padding:calc(48px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom))}
.bs-cov .bs-emb{margin-bottom:18px}
.bs-fin .bs-chm{width:32px;height:32px}

/* full screen while a game is on (same as the Four Stressed game screen) */
html.bs-full .mast,html.bs-full .dateline,html.bs-full .xpbar,html.bs-full .bnav,html.bs-full .subbar{display:none!important}
html.bs-full .app{max-width:1180px;padding-bottom:calc(10px + env(safe-area-inset-bottom))!important;padding-top:calc(4px + env(safe-area-inset-top))!important}
@media (min-width:900px){
  .bs .bs-wrap,.bs .wd-bar,.bs.placing .bs-wrap{max-width:min(100%,calc(100vh - 200px))}
  .bs-emb{width:128px;height:128px}
  .bs-co{font-size:13px}
  .bs-ownb{flex-basis:150px}
  .bs-own .wd-moves{min-height:0;max-height:178px}
}
html.a11y-calm .bs *{animation:none!important;transition:none!important}
@media (prefers-reduced-motion:reduce){.bs *{animation:none!important;transition:none!important}}
