* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Microsoft YaHei', sans-serif; background: #fff; color: #111; display: flex; flex-direction: column; align-items: center; min-height: 100vh; padding: 20px; }
h1 { font-size: 28px; margin-bottom: 10px; }
#status { font-size: 16px; margin-bottom: 15px; color: #555; }
#board-wrap { position: relative; }
#board { display: grid; grid-template-columns: repeat(9, 52px); grid-template-rows: repeat(10, 52px); gap: 1px; background: #000; border: 2px solid #000; }
.cell { width: 52px; height: 52px; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.cell.selected { background: #ddd; }
.cell.palace { background: #d8d8d8; }
.cell.palace.selected { background: #bbb; }
.cell.valid-move::after { content: ''; position: absolute; width: 14px; height: 14px; background: rgba(0,0,0,0.25); border-radius: 50%; }
.cell.valid-capture::after { content: ''; position: absolute; inset: 2px; border: 3px solid #c00; border-radius: 4px; }
.piece { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: bold; user-select: none; border: 2px solid #000; transition: transform 0.12s ease; }
.piece.black { background: #000; color: #fff; }
.piece.white { background: #fff; color: #000; }
.piece.selected-ring { box-shadow: 0 0 0 3px #888; transform: scale(1.08); }
.piece.under-attack { border-color: #c00; }
#controls { margin-top: 15px; display: flex; gap: 10px; }
button { padding: 8px 20px; font-size: 14px; cursor: pointer; border: 1px solid #000; border-radius: 0; background: #fff; color: #000; }
button:hover { background: #000; color: #fff; }
#msg { margin-top: 10px; font-size: 16px; color: #c00; min-height: 24px; }
#overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100; justify-content: center; align-items: center; }
#overlay.active { display: flex; }
#overlay-box { background: #fff; padding: 40px 60px; text-align: center; border: 2px solid #000; }
#overlay-box h2 { font-size: 32px; margin-bottom: 20px; }
#overlay-box button { margin-top: 10px; }
@media (max-width: 560px) {
  #board { grid-template-columns: repeat(9, 36px); grid-template-rows: repeat(10, 36px); }
  .cell { width: 36px; height: 36px; }
  .piece { width: 30px; height: 30px; font-size: 14px; }
}
.home-wrap { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh; }
.home-wrap h1 { font-size: 48px; margin-bottom: 40px; letter-spacing: 8px; }
.home-wrap .btn-group { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.home-wrap button { font-size: 18px; padding: 12px 40px; margin: 0; }
.rules-wrap { max-width: 560px; text-align: left; }
.rules-wrap h2 { text-align: center; margin-bottom: 20px; }
.rules-wrap p { margin-bottom: 8px; line-height: 1.6; }
.rules-wrap ul { margin-left: 20px; margin-bottom: 12px; }
.rules-wrap li { margin-bottom: 4px; }
.pve-select { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; }
.pve-select h1 { font-size: 36px; margin-bottom: 30px; }
.pve-select .diff-group { display: flex; gap: 12px; margin-bottom: 20px; }
.pve-select .diff-btn { font-size: 18px; padding: 14px 36px; }
