.brand img { border-radius: 6px; }
.xiangqi-page .table { grid-template-columns: minmax(0, 600px) minmax(180px, 1fr); }
.mode {
  color: var(--accent);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 13px;
  font-weight: 700;
}
.xiangqi-status {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 27px;
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 750;
}
.xiangqi-status::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--xiangqi-side-dot, #bd392d);
}
.xiangqi-status[data-side="B"] { --xiangqi-side-dot: #526967; }
.xiangqi-status[data-phase="over"] { color: var(--accent); }
.xiangqi-surface {
  position: relative;
  width: 100%;
  max-width: 510px;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid #a4784d;
  border-radius: 9px;
  background: #edc58d;
  background: linear-gradient(155deg, #f6d7a7, #eac080);
}
.xiangqi-lines {
  position: absolute;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.xiangqi-lines path {
  fill: none;
  stroke: #805a36;
  stroke-width: .24;
}
.xiangqi-lines text {
  fill: #704827;
  font-family: system-ui, sans-serif;
  font-size: 4.3px;
  font-weight: 650;
}
.xiangqi-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
}
.intersection {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  background: transparent;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.intersection[data-last] {
  background: #754d2830;
}
.intersection:focus-visible {
  z-index: 1;
  outline: 2px solid #005d45;
  outline-offset: -2px;
  border-radius: 4px;
}
.intersection[data-selected] { background: #1a6b4c31; }
.intersection[data-legal]::after {
  content: "";
  position: absolute;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #005e43;
}
.intersection[data-legal][data-side]::after {
  width: 92%;
  border: 2px solid #005e43;
  background: transparent;
}
.token {
  display: grid;
  place-items: center;
  width: 84%;
  aspect-ratio: 1;
  border: 1px solid #835d33;
  border-radius: 50%;
  color: #213332;
  background: #fff5db;
  box-shadow: inset 0 0 0 2px #e9c997, 0 2px 2px #57370c38;
  font-size: clamp(14px, 4vw, 26px);
  font-weight: 800;
  line-height: 1;
}
.intersection[data-side="R"] .token { color: #922c20; }
.intersection[data-selected] .token { outline: 2px solid #005e43; outline-offset: 1px; }
.intersection[data-checked] .token { outline: 2px dashed #a01f17; outline-offset: 1px; }
.xiangqi-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-block-start: 8px;
}
.xiangqi-actions button { -webkit-tap-highlight-color: transparent; }
.xiangqi-actions button:disabled { opacity: .55; cursor: default; }
.moves { margin-inline-start: auto; color: var(--sub); font-size: 13px; }
.guide p:last-child { margin-block-end: 0; }
@media (max-width: 680px) {
  .xiangqi-page { padding-inline: 9px; }
  .xiangqi-page .table { grid-template-columns: 1fr; }
  .xiangqi-page .game { padding: 6px; }
}
