.board-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 8px 12px;
}

/* 玩法提示固定高度，避免棋盘上下跳动 */
.game-stage .game-hint-panel {
  height: 112px;
  overflow-y: auto;
  flex-shrink: 0;
  margin-bottom: 12px;
  scrollbar-width: thin;
}

.game-stage .game-hint-panel .game-hint-steps {
  margin-bottom: 0;
}

.game-settings {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  width: 100%;
  flex-shrink: 0;
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.setting-item select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(12, 22, 43, 0.9);
  color: var(--text);
  font-size: 13px;
}

/* 状态 + 倒计时固定占位 */
.board-status-panel {
  width: 100%;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
}

#status {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
  min-height: 1.4em;
}

#move-timer {
  margin: 0;
  min-height: 1.25em;
  font-size: 13px;
  line-height: 1.25;
  color: #7dd3fc;
  text-align: center;
  visibility: hidden;
}

#move-timer.is-active {
  visibility: visible;
}

#move-timer.timer-warn {
  color: #fbbf24;
}

#move-timer.timer-critical {
  color: #f87171;
  font-weight: 600;
}

#move-timer strong {
  font-variant-numeric: tabular-nums;
}

/* 消息区固定占位，避免弹出时顶起棋盘 */
.game-stage .game-msg {
  min-height: 42px;
  margin-top: 10px;
  box-sizing: border-box;
}

.game-stage .game-msg[hidden] {
  display: block !important;
  visibility: hidden;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
}

#board {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  cursor: crosshair;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.board-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  flex-shrink: 0;
}

.board-actions .game-btn {
  min-width: 120px;
  flex: 1 1 120px;
  max-width: 180px;
}

#undo-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#restart-btn {
  min-width: 120px;
}

@media (max-width: 480px) {
  .board-wrap {
    padding: 0 4px 8px;
  }

  .game-stage .game-hint-panel {
    height: 100px;
  }

  .board-status-panel {
    min-height: 50px;
  }

  .setting-item {
    font-size: 12px;
  }

  #status {
    font-size: 13px;
  }
}
