.table-area { display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 0; min-width: 0; }
.board-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 240px;
  width: min(100%, calc(100vh - var(--topbar-h, 63px) - 109px));
  max-width: 100%;
  margin: 0 auto;
  padding: 10px 10px 20px;
  border-radius: var(--radius);
  background: transparent;
  border: 2px solid #3b2a1a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
#board {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  cursor: crosshair;
  touch-action: manipulation;
  background: transparent;
}
#board.no-anim { animation: none; }
.turnbadge { position: absolute; right: 16px; bottom: 4px; z-index: 5; max-width: calc(100% - 32px); }
.turnbadge .badge { font-size: 12px; padding: 4px 10px; white-space: normal; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--log-bg); color: var(--dim); }
.badge.info { color: #cfe3ff; border-color: #33507a; }
.badge.best { color: #0d1117; background: var(--gold); border-color: var(--gold); font-weight: 700; }
.badge.thin { color: var(--warn); border-color: var(--warn); }
.badge.wrong { color: #ffd7d3; border-color: var(--raise); background: rgba(224, 87, 74, .12); }
.winlink { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(127, 209, 160, .9), 0 4px 14px rgba(0, 0, 0, .5); }
  50% { box-shadow: 0 0 0 4px rgba(127, 209, 160, .35), 0 4px 14px rgba(0, 0, 0, .5); }
}
.crownpop { animation: crownpop .32s ease-out; }
@keyframes crownpop {
  0% { transform: scale(.4) translateY(-6px); opacity: 0; }
  60% { transform: scale(1.15) translateY(0); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.stone-crown {
  position: absolute;
  z-index: 6;
  font-size: 16px;
  line-height: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6));
}
.stone-crown[hidden] { display: none; }
/* 行动栏高度：单行布局（不换行），高度 = 按钮高 + 上下 padding + 上下边框。
   按钮高 = 文字行高（line-height:1 → 13px）+ 上下 padding 10px + 上下边框 2px = 30px；
   .actions 的 min-height 必须 ≥ 按钮高，否则按钮会被 flex 容器压缩（flex-shrink 默认 1）。
   总高 = 30 + 2*8 + 2*1 = 48px，与 board.css 的 .board-wrap 宽度公式里的 109px 分量一致
   （109 = 顶栏下 layout padding 16*2 + table-area gap 12 + actionbar 48 + board-wrap 边框 2*2
    + 下内衬 20 + 余量 3——公式少减一点，wrap 变宽、棋盘随之变大；badge 钉在 wrap 内下边，
    画布下沿随之下移，与 badge 的空隙收紧。该分量越小棋盘越大，但不得小于
    32+12+48+4+20 = 116px（现留 5px 余量），否则 wrap 高度不足、画布会被
    max-height:100% 压缩变形；要继续增大棋盘，必须先减下内衬（.board-wrap 的 padding 下值，
    注意 badge 高约 22px + bottom 4px，下内衬低于 26px 后徽标会顶到画布下沿）再减该分量） */
.actionbar { display: flex; flex-wrap: nowrap; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); padding: 8px 10px; flex: 0 0 auto; }
.actions { flex: 1 1 auto; display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; justify-content: flex-end; min-height: 30px; }
.actions .wait { color: var(--dim); font-size: 12px; }
.actions button { flex: 0 0 auto; line-height: 1; min-width: 72px; padding: 10px 10px; font-size: 13px; font-weight: 600; color: #fff; }
.actions button b { margin-left: 5px; font-family: var(--mono); font-size: 11px; font-weight: 700; }
.actions button.fold { background: #3a4453; }
.actions button.check { background: #2f5f96; }
.actions button.call { background: #2f7a4d; }
.actions button.raise { background: #a83c31; }
.actions button.raise.allin { background: #8f2f26; border: 1px solid var(--gold); box-shadow: 0 0 0 1px rgba(212, 175, 55, .25); }
.actions button.ghost.next { background: transparent; color: var(--gold); border-color: var(--gold); }
.actions button.ghost.cashout { background: transparent; color: var(--dim); border-color: var(--line); }
.actions button.ghost.cashout:hover:not(:disabled) { color: var(--gold); border-color: var(--gold); }
