.lchess { width:100%; min-width:0; max-width:660px; margin:24px auto 0; }
.lchess > .post-meta { margin:0 0 20px; }
.stopfish { font:16px/1.4 'Courier New',Courier,monospace; color:#ccc9bc; }
.stopfish-layout { display:grid; grid-template-columns:minmax(0,420px) 220px; align-items:start; gap:20px; }
.board-paper { min-width:0; display:grid; grid-template-columns:minmax(0,1fr) 20px; gap:10px; margin-bottom:22px; }
.board-surface { container-type:inline-size; min-width:0; }

/* The lines are text too. Every rank is exactly 35 monospace characters. */
#chess-board { width:max-content; font:18px/1 'Courier New',Courier,monospace; font-size:min(18px,4.75cqw); font-variant-ligatures:none; letter-spacing:0; white-space:pre; touch-action:none; user-select:none; }
.ascii-files { display:block; height:1.5em; color:#a7a496; }
.ascii-rule { display:block; height:.85em; line-height:.85em; color:#777b6a; }
.ascii-rank { display:flex; align-items:stretch; height:1.65em; }
.ascii-rank-label { display:flex; align-items:center; width:2ch; color:#a7a496; }
.ascii-pipe { display:inline-flex; align-items:center; width:1ch; color:#777b6a; pointer-events:none; }
.stopfish .chess-square { position:relative; display:inline-flex; align-items:center; justify-content:start; flex:none; width:4ch; height:100%; min-width:0; min-height:0; padding:0; margin:0; border:0; border-radius:0; background:none; box-shadow:none; font:inherit; letter-spacing:0; text-decoration:none; outline-offset:-2px; cursor:default; }
.stopfish .chess-square.occupied { cursor:grab; }
.chess-piece { display:inline-block; width:3ch; color:#a5b77f; font-family:'Courier New',Courier,monospace; font-weight:bold; text-align:center; pointer-events:none; }
.chess-piece::before,.chess-piece::after { content:' '; white-space:pre; font-weight:normal; }
.chess-piece.white { color:#eeeadd; }
.chess-piece.empty { color:#72746a; font-weight:normal; }
.chess-piece.drag-source { visibility:hidden; }
.chess-square.selected .chess-piece::before { content:'['; }
.chess-square.selected .chess-piece::after { content:']'; }
.chess-square.suggested .chess-piece { color:#e0bb6e; }
.chess-square.suggested .chess-piece::before { content:'>'; }
.chess-square.suggested .chess-piece::after { content:'<'; }
@media(hover:hover) { .chess-square:hover .chess-piece { background:#ffffff0c; } }
#fish-key { margin:12px 0 0 2ch; color:#a7a496; font-size:12px; }
.fish-note { margin:0; font-size:14px; }

.eval-wrap { position:relative; min-height:0; margin:27px 0 30px; }
#fish-eval { position:absolute; inset:0; border:1px solid #777b6a; background:#292c26; overflow:hidden; }
#fish-eval-white { position:absolute; bottom:0; left:0; width:100%; height:50%; background:#ccc9bc; transition:height .15s linear; }
#fish-eval.flipped #fish-eval-white { bottom:auto; top:0; }
#fish-eval.is-unknown { opacity:.5; }
#fish-eval-number { position:absolute; top:calc(100% + 5px); left:50%; transform:translateX(-50%); font:12px/1.2 'Courier New',Courier,monospace; white-space:nowrap; color:#ccc9bc; }
#fish-status { margin:12px 0 0; font-size:13px; color:#aaa; }
#fish-status:empty { display:none; }
.fish-desk { padding-top:27px; }
#fish-side { border:0; padding:0; margin:0 0 20px; min-width:0; }
#fish-side label { display:flex; align-items:center; gap:7px; min-height:30px; cursor:pointer; font:inherit; }
#fish-side input { appearance:auto; accent-color:#a5b77f; width:14px; height:14px; padding:0; margin:0; cursor:pointer; }
.chess-controls { display:flex; flex-wrap:wrap; gap:4px 8px; margin:0 0 22px; }
.stopfish button:not(.chess-square) { appearance:none; display:inline-block; margin:0; padding:4px 0; min-height:30px; border:0; border-radius:0; background:none; color:#ddd9cc; box-shadow:none; font:15px/1.2 'Courier New',Courier,monospace; letter-spacing:0; text-decoration:none; white-space:nowrap; cursor:pointer; }
.stopfish button:not(.chess-square)::before { content:'['; padding-right:1ch; color:#999b89; }
.stopfish button:not(.chess-square)::after { content:']'; padding-left:1ch; color:#999b89; }
.stopfish button:not(.chess-square):active:not(:disabled) { color:#a5b77f; }
.stopfish button:disabled { color:#77776f; opacity:1; cursor:default; }
.stopfish button:disabled::before,.stopfish button:disabled::after { color:inherit; }
#fish-advice { display:block; min-height:28px; margin:16px 0 0; font:bold 18px/1.3 'Courier New',Courier,monospace; color:#ddd9cc; }
.stopfish :focus-visible { outline:1px dashed #a5b77f; outline-offset:3px; }
.stopfish .chess-square:focus-visible { outline-offset:-2px; }
#chess-ghost { display:flex; align-items:center; justify-content:center; width:48px; height:48px; position:fixed; z-index:20; pointer-events:none; transform:translate(-50%,-50%); font-size:18px; }
#chess-ghost::before,#chess-ghost::after { content:none; }
.stopfish .sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.fish-options { margin:0 0 18px; font-size:13px; line-height:1.5; }
.fish-options summary { cursor:pointer; }
.fish-options fieldset { border:0; padding:8px 0; margin:0; min-width:0; }
.fish-options legend { padding:6px 0 0; }
.fish-options fieldset label { display:block; }
.fish-options input { appearance:auto; width:auto; margin:3px 4px 3px 0; padding:0; }
.fish-options select { appearance:auto; width:auto; padding:2px; border:1px solid #777b6a; border-radius:0; background:#292c26; color:#ddd9cc; font:inherit; }
@media(max-width:700px) {
  .lchess { max-width:420px; margin-top:14px; }
  .stopfish-layout { grid-template-columns:minmax(0,1fr); gap:4px; }
  .fish-desk { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:14px 16px; padding-top:0; }
  #fish-side { margin:0; }
  #fish-side label { min-height:55px; }
  .chess-controls { margin:0; align-content:start; }
  .stopfish button:not(.chess-square) { min-height:55px; }
  .stopfish #fish-predict { grid-column:1/-1; justify-self:start; }
  #fish-status { grid-column:1/-1; margin:0; }
  #fish-advice { grid-column:1/-1; min-height:0; margin:0; }
  #fish-advice:empty { display:none; }
  .fish-options { grid-column:1/-1; margin:0; }
  .fish-options summary { padding:5px 0; }
}
@media(prefers-reduced-motion:reduce) { #fish-eval-white { transition:none; } }
