/* Reversi – styles for reversi-ui.js (view #v-reversi). 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 board and a few details. Board palette is fixed (paper, ink, red) under every theme, like the other add-ons. */
.rs{--rs-l:#fbf7ec;--rs-f:#efe7d2;--rs-ink:#141210;--rs-red:#a3221b;--rs-w:#fbf7ec;--rs-b:#2a2622}
.rs [hidden]{display:none!important}
.rs .fk-panel{--pc:var(--rs-red)}
.rs-emb{display:block;width:104px;height:104px;margin:0 auto 10px;background:var(--rs-l);border:1px solid var(--rs-ink);box-shadow:2px 2px 0 rgba(20,18,16,.18);padding:8px;transform:rotate(-3deg)}
.rs-emb svg{display:block;width:100%;height:100%}
.rs-chm{display:inline-block;width:22px;height:22px;flex:0 0 auto}
.fk-choice .rs-chm{position:absolute;width:16px;height:16px}
.fk-choice .rs-chm.ix{left:10px;top:10px}.fk-choice .rs-chm.ix2{right:10px;bottom:10px}
.rs .fk-rl li>.wd-chip{margin-top:3px}
#rsResume .fk-resume{border-left-color:var(--rs-red)}
.rs-note{font-size:13px;font-style:italic;color:var(--mut);text-align:center;margin:2px 0 10px}

/* the board: one SVG, 8 x 8 user units (one unit = one square); discs stay on their squares and turn over */
.rs-wrap{margin:0 auto;width:100%;max-width:max(250px,calc(100vh - 318px))}
.rs-board{position:relative;width:100%;aspect-ratio:1/1;background:var(--rs-l);border:2px solid var(--rs-ink);outline:1px solid var(--rs-ink);outline-offset:3px;margin:6px 0;user-select:none;-webkit-user-select:none;touch-action:manipulation}
.rs-board svg{display:block;width:100%;height:100%;overflow:visible}
.rs-field{fill:var(--rs-f)}
.rs-ln{fill:none;stroke:var(--rs-ink);stroke-width:.03}
.rs-edge{fill:none;stroke:var(--rs-ink);stroke-width:.07}
.rs-pt{fill:var(--rs-ink)}
.rs-co{font:700 .27px "Libre Baskerville",serif;fill:#5d574d;text-anchor:middle;dominant-baseline:central}
.rs-board.nocoord .rs-co{display:none}
.rs-pc .in{transform-box:fill-box;transform-origin:50% 50%}
.rs-pc .o{stroke:var(--rs-ink);stroke-width:.045}
.rs-pc .r{fill:none;stroke-width:.03;opacity:.4}
.rs-pc.s0 .o{fill:var(--rs-w)}.rs-pc.s0 .r{stroke:var(--rs-ink)}
.rs-pc.s1 .o{fill:var(--rs-b);stroke:#000}.rs-pc.s1 .r{stroke:var(--rs-w)}
.rs-pc .sh{fill:rgba(0,0,0,.17)}
.rs-pc.new .in{animation:rsIn .3s cubic-bezier(.3,1.4,.5,1) both}
@keyframes rsIn{0%{transform:scale(.2);opacity:0}}
/* a flipped disc turns over: it narrows to a line and opens again in the new colour (two names: a second flip animates again) */
.rs-pc.fa .in{animation:rsFlipA .44s ease-in-out both}
.rs-pc.fb .in{animation:rsFlipB .44s ease-in-out both}
.rs-pc.fa .o,.rs-pc.fb .o{animation:rsInk .44s step-end both}
.rs-pc.fa .r,.rs-pc.fb .r{animation:rsRing .44s step-end both}
@keyframes rsFlipA{0%{transform:scaleX(1)}50%{transform:scaleX(.04)}100%{transform:scaleX(1)}}
@keyframes rsFlipB{0%{transform:scaleX(1)}50%{transform:scaleX(.04)}100%{transform:scaleX(1)}}
.rs-pc.s0.fa .o,.rs-pc.s0.fb .o{--rs-from:var(--rs-b)}.rs-pc.s1.fa .o,.rs-pc.s1.fb .o{--rs-from:var(--rs-w)}
@keyframes rsInk{0%{fill:var(--rs-from)}50%{fill:currentColor}}
@keyframes rsRing{0%{opacity:0}50%{opacity:.4}}
.rs-pc.s0 .o{color:var(--rs-w)}.rs-pc.s1 .o{color:var(--rs-b)}
.rs-pc.last .r{stroke:var(--rs-red);opacity:.95;stroke-width:.05}
.rs-last{fill:var(--rs-red);opacity:.15}
.rs-dot{fill:var(--rs-ink);opacity:.42;pointer-events:none}
html.no-dots .rs-dot{display:none}
.rs-hit{fill:transparent;cursor:default}
.rs-board.input .rs-hit.go{cursor:pointer}
.rs-hit:focus{outline:none}.rs-hit:focus-visible{stroke:var(--rs-ink);stroke-width:.06;stroke-dasharray:.12 .07}
html.a11y-cb .rs{--rs-red:#0072b2}
html.a11y-con .rs-field{fill:#fff}html.a11y-con .rs-board{background:#fff}html.a11y-con .rs-ln{stroke:#000;stroke-width:.05}html.a11y-con .rs-pc .o{stroke-width:.07}

/* player bars: the number of discs of each colour */
.rs-cnt{margin-left:auto;display:flex;align-items:baseline;gap:6px;white-space:nowrap}
.rs-cnt small{font-size:11px;font-style:italic;color:var(--mut)}
.rs-cnt b{font:900 22px/1 "Playfair Display",serif;min-width:1.3em;text-align:right}
.rs .wd-bar,.rs .rs-wrap{max-width:max(250px,calc(100vh - 318px))}
.rs .fk-banner{--pc:var(--rs-red);margin:4px 0}
.rs .fk-banner.pass{border-color:var(--rs-red)}
.rs-fin .rs-chm{width:26px;height:26px}

/* full screen while a game is on (same as the Four Stressed game screen) */
html.rs-full .mast,html.rs-full .dateline,html.rs-full .xpbar,html.rs-full .bnav,html.rs-full .subbar{display:none!important}
html.rs-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){
  .rs .rs-wrap,.rs .wd-bar{max-width:min(100%,calc(100vh - 200px))}
  .rs-emb{width:128px;height:128px}
}
html.a11y-calm .rs *{animation:none!important;transition:none!important}
@media (prefers-reduced-motion:reduce){.rs *{animation:none!important;transition:none!important}}
