.play-header { grid-template-columns: 1fr auto; }
.play-shell { max-width: 1080px; }
.match-intro { padding: clamp(28px, 5.2vw, 66px) 0 clamp(19px, 3.6vw, 38px); }
.match-intro h1 { font-size: clamp(44px, 7.6vw, 88px); }
.match-intro h1 span { display: inline; }
.match-intro > p:last-child { max-width: 490px; margin-top: 12px; color: var(--muted); font-size: clamp(14px, 2.2vw, 17px); }
.chess-layout { display: grid; grid-template-columns: minmax(0, 1.64fr) minmax(270px, 1fr); gap: clamp(15px, 3vw, 31px); align-items: start; }
.chess-stage, .chess-sidebar { min-width: 0; }

.board-frame { --frame-border: #3a495e; padding: clamp(7px, 1.4vw, 14px); border: 1px solid var(--frame-border); border-radius: 12px; background: #171f2d; color: #edf2f7; box-shadow: 0 12px 32px #111a291a; }
.board-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 12px; padding: 0 2px 8px; }
.board-label, .side-label { color: #b6c7da; font: 700 10px/1.4 var(--mono); letter-spacing: .08em; }
.flip-board { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 3px 8px; border: 1px solid var(--frame-border); border-radius: 5px; background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.flip-board .icon { width: 14px; height: 14px; }
.flip-board:hover { border-color: #ff9a7e; color: #ffbca5; }
.flip-board:disabled { opacity: .55; cursor: default; }
.board-bar-bottom { min-height: 44px; padding: 8px 2px 0; }
.board-bar-bottom p { font-size: 13px; font-weight: 700; }
.side-label { flex: none; color: #ffbda7; }
.board-instructions { margin-top: 9px; color: var(--muted); font-size: 12px; }

.chess-board { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(0, 1fr)); aspect-ratio: 1; overflow: hidden; border: 1px solid #46566a; border-radius: 5px; background: #65778d; touch-action: manipulation; }
.chess-square { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 0; background: #e6d6c1; color: #3b4250; cursor: default; -webkit-tap-highlight-color: transparent; }
.chess-square.dark-square { background: #66788d; color: #f1e4d5; }
.chess-square.is-last { background: #dfb88f; color: #403029; }
.chess-square.dark-square.is-last { background: #9d766a; color: #fff4ea; }
.chess-square.is-selected { background: #ffc3a6; color: #45332d; }
.chess-square.is-check { background: #cf7f71; color: #30232a; }
.chess-square:is(.is-playable, .is-target) { cursor: pointer; }
.chess-square:focus-visible { z-index: 1; outline: 3px solid #fc6842; outline-offset: -3px; }
.chess-square::before, .chess-square::after { position: absolute; z-index: 1; font: 700 clamp(8px, 1.25vw, 11px)/1 var(--mono); pointer-events: none; }
.chess-square[data-rank]::before { content: attr(data-rank); top: 3px; left: 3px; }
.chess-square[data-file]::after { content: attr(data-file); bottom: 3px; right: 3px; }
.square-marker { position: absolute; width: 24%; height: 24%; border-radius: 50%; background: #24262a61; pointer-events: none; }
.dark-square .square-marker { background: #ffdab399; }
.is-capture .square-marker { width: 88%; height: 88%; border: 3px solid #8c402fd9; background: transparent; }
.dark-square.is-capture .square-marker { border-color: #ffd0b0; background: transparent; }
.chess-piece { position: relative; width: 88%; height: 88%; overflow: visible; fill: #fcf2dc; stroke: #2d3744; stroke-width: 1.85; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 2px 1px #161f2e38); pointer-events: none; }
.chess-piece.black-piece { fill: #233041; stroke: #e5cfb6; stroke-width: 1.55; }
.piece-detail { fill: none; stroke-width: 1.45; }

.chess-sidebar { display: grid; gap: 11px; }
.opponent-card { padding: clamp(15px, 2.5vw, 25px); border: 1px solid #43526a; border-radius: 10px; background: radial-gradient(ellipse at 86% 2%, #2b3a52, #171f2d 72%); color: #edf2f7; }
.opponent-profile { display: flex; align-items: center; gap: 13px; }
.opponent-avatar { flex: none; width: 56px; height: 56px; border: 1px solid #62758c; border-radius: 9px; background: #34465e; object-fit: cover; object-position: center 26%; }
.opponent-kicker { color: #becadc; font-size: 9px; }
.opponent-profile h2 { margin-top: 4px; font-size: clamp(21px, 3vw, 29px); letter-spacing: -.055em; line-height: 1.07; }
.opponent-rating { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 12px; margin-top: 19px; padding-top: 12px; border-top: 1px solid #4a5970; }
.opponent-rating strong { color: #ffbca4; font: 750 clamp(27px, 4vw, 37px)/1 var(--mono); letter-spacing: -.08em; }
.opponent-rating > span { color: #d0dcec; font: 700 10px/1.4 var(--mono); letter-spacing: .08em; }
.chess-panel { padding: 13px clamp(12px, 2vw, 18px); border: 1px solid var(--line); border-radius: 8px; }
.chess-panel h2 { font: 700 11px/1.35 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.side-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.chess-control { min-height: 39px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.chess-control:hover, .side-button[aria-pressed="true"] { color: var(--accent-text); border-color: var(--accent-text); }
.moves-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.moves-heading span { color: var(--accent-text); font: 700 11px/1.4 var(--mono); }
.no-moves { margin-top: 12px; color: var(--muted); font-size: 13px; }
.move-list { display: grid; gap: 2px; max-height: 185px; margin: 8px 0 0; padding: 0; overflow: auto; list-style: none; }
.move-list:empty { display: none; }
.move-list li { display: grid; grid-template-columns: 2.5em 1fr 1fr; gap: 5px; padding: 4px 6px; border-bottom: 1px solid var(--line); font: 650 12px/1.4 var(--mono); }
.move-list li > :first-child { color: var(--muted); }
.play-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 7px 18px; margin-top: 23px; padding-block: 12px 22px; color: var(--muted); font: 700 10px/1.4 var(--mono); letter-spacing: .045em; }
.play-footer a:hover, .footer-slash { color: var(--accent-text); }

.promotion-dialog, .game-result-dialog { width: min(390px, calc(100% - 26px)); padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
.promotion-dialog::backdrop, .game-result-dialog::backdrop { background: #141d2bd8; }
.promotion-dialog h2 { font-size: 22px; letter-spacing: -.035em; }
.promotion-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin: 14px 0 10px; }
.promotion-cancel { padding: 3px 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }

.game-result-dialog { padding: clamp(20px, 5vw, 30px); border-top: 3px solid var(--accent-text); box-shadow: 0 20px 64px #080f1f66; }
.game-result-dialog .kicker { margin-bottom: 9px; color: var(--accent-text); }
.game-result-dialog h2 { font-size: clamp(34px, 8vw, 48px); }
#game-result-detail { margin-top: 8px; color: var(--muted); }
.result-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 23px; }
.result-actions .button { min-height: 42px; padding: 8px 10px; cursor: pointer; }
.result-actions .button-dark { border: 1px solid transparent; }
.result-actions .button-outline { background: transparent; }

@media (max-width: 760px) {
  .play-shell { max-width: 565px; }
  .chess-layout { grid-template-columns: minmax(0, 1fr); }
  .board-instructions { margin-top: 7px; }
}
@media (max-width: 630px) {
  .play-header { padding-bottom: 9px; }
}
