.badge{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  color:var(--text);
  background:var(--surface);
}
.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  flex:1 1 180px;
}
.field select{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--text);
}
.field select:focus{outline:none;border-color:var(--accent-border)}
.field select:focus-visible{outline:2px solid var(--accent-outline);outline-offset:2px}

.board-wrap{position:relative;display:flex;justify-content:center}
.board{
   max-width:calc(48px * 9);
   width:100%;
   --cell:48px;
   height:calc(var(--cell) * 10);
  position:relative;
  box-sizing:content-box;
   border:1px solid var(--border);
   border-radius:14px;
  background:linear-gradient(180deg, #fbfcfe, #f2f4f7);
   overflow:hidden;
   user-select:none;
   touch-action:manipulation;
 }
.board-lines{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
}
.board-grid{
  position:absolute;
  inset:0;
  display:grid;
  grid-template-columns:repeat(9, var(--cell));
  grid-template-rows:repeat(10, var(--cell));
  gap:0;
}
.cell{
   position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1;
 }
.cell::after{
  content:'';
  position:absolute;
  left:50%;
  top:50%;
  width:34px;
  height:34px;
  transform:translate(-50%,-50%);
  border-radius:999px;
  background:transparent;
  border:1px solid transparent;
}
.cell.to::after{background:rgba(31,74,122,.10);border-color:rgba(31,74,122,.16)}
.cell.sel::after{background:rgba(31,74,122,.14);border-color:rgba(31,74,122,.20)}
.cell.cap::after{background:rgba(127,29,29,.10);border-color:rgba(127,29,29,.18)}
.piece{
   width:38px;height:38px;
   border-radius:999px;
   border:1px solid var(--border);
   display:flex;align-items:center;justify-content:center;
   font-size:18px;font-weight:700;
   position:relative;
   left:auto;top:auto;
   transform:none;
   padding:0;
  z-index:2;
 }
.piece:focus{outline:none}
.piece:focus-visible{outline:2px solid var(--accent-outline);outline-offset:2px}
.piece.r{background:#fff;border-color:rgba(127,29,29,.22);color:#7f1d1d}
.piece.b{background:#0b1220;border-color:rgba(15,23,42,.32);color:#f1f5f9}
.piece.disabled{opacity:.65}
.river{
   position:absolute;
   left:0;
   right:0;
   top:50%;
   transform:translateY(-50%);
   width:100%;
   box-sizing:border-box;
   pointer-events:none;
   display:flex;justify-content:space-between;
   padding:0 16px;
 }
.river-text{
   font-weight:800;
   letter-spacing:.3em;
   color:rgba(15,23,42,.35);
   text-shadow:0 1px 0 rgba(255,255,255,.7);
 }
.moves{
   margin:12px 0 0;
   padding:12px;
   border-radius:12px;
   border:1px solid var(--border);
   background:var(--surface);
   line-height:1.6;
   max-height:260px;
   overflow:auto;
   white-space:pre-wrap;
 }
.field.compact{min-width:140px}
.field.compact select{width:100%}
@media (max-width:520px){
   .board{--cell:38px;border-radius:12px}
  .cell::after{width:28px;height:28px}
   .piece{width:32px;height:32px;font-size:16px}
   .river{padding:0 10px}
 }
