.board-with-eval {
  --board-light: #eeeed2;
  --board-dark: #769656;
  --board-size: min(100%, max(280px, calc(100vh - 216px)), 820px);
  gap: 7px;
  margin: 0;
}
#board {
  width: var(--board-size);
  max-width: 100%;
  max-height: none;
  min-width: 0;
  flex: 0 1 var(--board-size);
  border-radius: 4px;
  touch-action: none;
  user-select: none;
  isolation: isolate;
}
#board-arrows { z-index: 4; }
#squares { touch-action: none; }
.square {
  background: var(--board-light);
  cursor: default;
}
.square.dark { background: var(--board-dark); }
.square:has(img) { cursor: grab; }
.square:focus-visible {
  z-index: 5;
  outline: 3px solid #fff;
  outline-offset: -4px;
}
.square.last { box-shadow: inset 0 0 0 100px #ffff3380; }
.square.selected { box-shadow: inset 0 0 0 100px #ffff3380; }
.square img { -webkit-user-drag: none; }
.square:has(img.sliding) { z-index: 2; }
.square img.sliding { z-index: 1; }
.square .coord {
  color: var(--board-dark);
  font-size: clamp(10px, 1.25vw, 17px);
  font-weight: 750;
  pointer-events: none;
}
.square.dark .coord { color: var(--board-light); }
.coord.rank { left: 3px; top: 3px; }
.coord.file { right: 3px; bottom: 2px; }
.legal-dot {
  inset: 33.6%;
  width: auto;
  height: auto;
  background: rgb(0 0 0 / 14%);
  pointer-events: none;
}
.legal-dot.capture-hint {
  inset: 0;
  background: transparent;
  border: 5px solid rgb(0 0 0 / 14%);
}
.square.classification-square {
  box-shadow: inset 0 0 0 100px color-mix(in srgb, var(--classification-color) 50%, transparent);
}
.board-rating {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.rating-marker {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  --badge-x: 94%;
  --badge-y: 6%;
  --badge-width: 40%;
}
.rating-marker.tuck-top { --badge-y: 22%; }
.rating-marker.tuck-right { --badge-x: 78%; }
.rating-marker.classification-featured {
  --badge-x: 95%;
  --badge-width: 37.5%;
}
.rating-marker.classification-featured.tuck-top { --badge-y: 18.75%; }
.rating-marker.classification-featured.tuck-right { --badge-x: 81.25%; }
.rating-marker .move-category,
.classification-glyph {
  position: absolute;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}
.rating-marker .move-category {
  left: var(--badge-x);
  top: var(--badge-y);
  width: var(--badge-width);
}
.move-category svg, .classification-glyph svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.classification-tint {
  position: absolute;
  inset: 0;
  background: var(--classification-flash);
  opacity: 0;
}
.classification-brief { animation: classification-brief .42s ease-out both; }
@keyframes classification-brief {
  0%, 100% { opacity: 0; }
  26% { opacity: .55; }
}
.classification-glyph {
  left: 50%;
  top: 62.5%;
  width: 70%;
  opacity: 0;
  filter: drop-shadow(0 1px rgb(0 0 0 / 35%));
}
.classification-arrive .classification-tint { animation: classification-tint 1.3s ease both; }
.classification-arrive .classification-glyph { animation: classification-glyph 1.3s ease both; }
.classification-arrive .move-category { animation: result-badge .3s ease 1s both; }
@keyframes classification-tint {
  0%, 100% { opacity: 0; }
  23.077%, 76.923% { opacity: .8; }
}
@keyframes classification-glyph {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  23.077%, 76.923% { left: 50%; top: 62.5%; opacity: 1; transform: translate(-50%, -50%); }
  99% { opacity: 1; }
  100% { left: var(--badge-x); top: calc(var(--badge-y) + 1%); opacity: 0; transform: translate(-50%, -50%) scale(.55); }
}
#board.dragging, #board.dragging .square { cursor: grabbing; }
.square.drag-source img, .square.promoting img { visibility: hidden; }
.square.drag-target { outline: 5px solid #fff8; outline-offset: -5px; }
.piece-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  pointer-events: none;
  user-select: none;
  transform-origin: center;
}
.board-results {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}
.result-square {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  --badge-x: 95%;
  --badge-y: 6%;
}
.result-square.tuck-top { --badge-y: 18.75%; }
.result-square.tuck-right { --badge-x: 81.25%; }
.result-tint { position: absolute; inset: 0; background: var(--result-color); opacity: 0; }
.result-glyph, .result-badge {
  position: absolute;
  display: block;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}
.result-glyph { left: 50%; top: 62.5%; width: 70%; opacity: 0; }
.result-badge {
  left: var(--badge-x);
  top: var(--badge-y);
  width: 37.5%;
  filter: drop-shadow(0 1px rgb(0 0 0 / 35%));
}
.result-badge svg, .result-glyph svg { display: block; width: 100%; height: 100%; }
.result-label {
  position: absolute;
  left: var(--badge-x);
  top: var(--badge-y);
  transform: translate(-50%, -50%);
  padding: .14em .7em;
  border-radius: 30px;
  color: var(--result-color);
  background: white;
  box-shadow: 0 1px rgb(0 0 0 / 35%);
  font-size: clamp(12px, 1.5vw, 23px);
  font-weight: 800;
  white-space: nowrap;
  opacity: 0;
}
.tuck-top .result-label { top: 18.75%; }
.tuck-right .result-label { left: 100%; transform: translate(-100%, -50%); }
.result-arrive .result-tint { animation: result-tint 1.3s linear both; }
.result-arrive .result-glyph { animation: result-glyph 1.3s linear both; }
.result-arrive .result-badge { animation: result-badge .3s ease-in-out 1s both; }
.result-arrive .result-label { animation: result-label 1.3s linear both; }
@keyframes result-tint {
  0% { opacity: 0; animation-timing-function: cubic-bezier(0,0,.2,1); }
  23.077%, 76.923% { opacity: .8; }
  100% { opacity: 0; }
}
@keyframes result-glyph {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); animation-timing-function: cubic-bezier(0,0,.2,1); }
  23.077%, 76.923% { left: 50%; top: 62.5%; opacity: 1; transform: translate(-50%, -50%); }
  76.923% { animation-timing-function: ease-in-out; }
  99% { opacity: 1; }
  100% { left: var(--badge-x); top: var(--badge-y); opacity: 0; transform: translate(-50%, -50%) scale(.536); }
}
@keyframes result-badge {
  from { opacity: 0; }
  82% { opacity: 0; }
  to { opacity: 1; }
}
@keyframes result-label {
  0% { opacity: 0; translate: 0 20%; animation-timing-function: cubic-bezier(0,0,.2,1); }
  23.077%, 76.923% { opacity: 1; translate: 0 0; scale: 1; }
  76.923% { animation-timing-function: ease-in-out; }
  100% { opacity: 0; scale: 0 1; }
}
.promotion-panel, .promotion-pawn { position: absolute; width: 12.5%; z-index: 8; }
.promotion-pawn { pointer-events: none; }
.promotion-panel {
  bottom: 0;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  background: white;
  border-radius: 3px;
  box-shadow: 3px 3px 10px #000a;
}
.promotion-panel.promotion-top { bottom: auto; top: 0; flex-direction: column; }
.promotion-panel button { display: grid; place-items: center; width: 100%; padding: 0; aspect-ratio: 1; }
.promotion-panel button:hover, .promotion-panel button:focus-visible { background: #d6d6cf; }
.promotion-panel button:focus-visible { outline-offset: -3px; }
.promotion-panel img { display: block; width: 100%; pointer-events: none; }
.promotion-panel .promotion-cancel { aspect-ratio: 2; background: #ededed; color: #8d8d8d; }
.promotion-cancel svg { width: 22%; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.square .captured-piece { pointer-events: none; }
.eval-rail { width: 19px; }
.eval-track { background: #403d39; }
.eval-track > div {
  background: #f5f4ef;
  transition: height 190ms cubic-bezier(.2,.75,.25,1);
}
.eval-track > div.flipped { top: 0; bottom: auto; }
.eval-rail > span {
  top: auto;
  bottom: 5px;
  left: 0;
  width: 100%;
  color: #322f2a;
  font-size: 8px;
  font-weight: 800;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff;
}
.eval-rail:has(.flipped) > span { top: 5px; bottom: auto; }
.review-summary[hidden] { display: none; }
.review-summary { display: block; padding: 0; }
.review-summary details {
  margin: 0 0 10px;
  border-radius: 4px;
  background: var(--raised);
}
.review-summary summary {
  padding: 8px 11px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  user-select: none;
}
.review-summary summary:hover { color: #fff; }
.review-count-scroll {
  max-height: clamp(130px, calc(100vh - 540px), 265px);
  overflow: auto;
  overscroll-behavior: contain;
}
.review-counts {
  width: 100%;
  padding: 0 10px 8px;
  border-spacing: 0;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}
.review-counts th, .review-counts td { padding: 2px 3px; font-size: 12px; }
.review-counts thead th { color: var(--muted); font-size: 11px; font-weight: 550; }
.review-counts th:first-child { width: 56%; text-align: left; }
.review-counts tbody th { color: var(--text); font-weight: 600; }
.review-counts td { color: var(--category-color); font-weight: 750; text-align: center; }
.review-counts svg { width: 15px; height: 15px; margin-right: 6px; vertical-align: -3px; }
@media (prefers-reduced-motion: reduce) {
  .classification-arrive > *, .result-arrive > * { animation: none; }
}
.analysis-fullscreen-controls button[hidden] { display: none; }
.analysis-fullscreen-controls {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  margin: 12px 0;
}
#analysis-view[data-fullscreen] {
  position: fixed;
  z-index: 100;
  inset: 0;
  overflow: auto;
  background: var(--bg, #302e2b);
  padding: 12px 16px 64px;
  box-sizing: border-box;
}
#analysis-view[data-fullscreen] .analysis-layout {
  width: min(100%, 1580px);
  margin: 0 auto;
  justify-content: center;
}
#analysis-view[data-fullscreen] .board-with-eval {
  --board-size: min(100%, max(200px, calc(100dvh - 145px)));
}
#analysis-view[data-fullscreen="board"] .analysis-layout {
  display: flex;
}
#analysis-view[data-fullscreen="review"] .analysis-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(8px, 2vw, 22px);
}
#analysis-view[data-fullscreen="review"] .analysis-column {
  height: max(250px, calc(100dvh - 86px));
  min-height: 0;
}
#analysis-view[data-fullscreen="board"] .analysis-column,
#analysis-view[data-fullscreen="board"] .eval-rail {
  display: none;
}
#analysis-view[data-fullscreen="board"] .board-column {
  width: min(100%, max(200px, calc(100dvh - 145px)));
}
#analysis-view[data-fullscreen] .analysis-fullscreen-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  justify-content: center;
  padding: 8px;
  background: #262522;
  z-index: 2;
}
.analysis-fullscreen-controls button[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px var(--accent);
}
