.empty-hero { margin: auto; width: min(100%, 500px); display: grid; justify-items: center; gap: 9px; text-align: center; overflow-wrap: anywhere; }
.empty-hero h2 { font-size: clamp(21px, 4vw, 34px); }
.empty-hero p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.game-text { width: min(100%, 600px); margin-inline: auto; flex: 1; padding: 10px; }
.empty-orbit { display: grid; place-items: center; width: clamp(44px, 11dvh, 81px); aspect-ratio: 1; margin-bottom: 4px; border-radius: 23%; background: #e7eee3; color: var(--green); font-size: clamp(23px, 6dvh, 44px); }

.board-container { flex: 1; display: grid; place-items: center; min-height: 0; min-width: 0; container-type: size; }
.board-frame { width: min(100%, 55vh, 660px); width: min(100%, calc((100cqh - 36px) * var(--board-ratio) + 18px), 660px); display: grid; grid-template-columns: 16px minmax(0, 1fr); grid-template-rows: 14px auto 22px; gap: 0 2px; }
.board-files, .board-ranks { display: grid; color: #625441; font-size: clamp(8px, 2.6cqh, 12px); line-height: 1; text-align: center; align-items: center; }
.board-files { grid-column: 2; }
.board-ranks { grid-column: 1; grid-row: 2; }
.board-shell { grid-row: 2; grid-column: 2; min-width: 0; position: relative; border-radius: 9px; background: #e4c597; box-shadow: inset 0 0 0 1px #8f683960, 0 3px 8px #6a4c2422; }
.board-shell > svg, .board-grid { position: absolute; inset: 0; width: 100%; height: 100%; }
.board-shell > svg { stroke: #896b48; stroke-width: .027; fill: #896b48; pointer-events: none; }
.board-grid { display: grid; }
.board-point { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 0; border: 0; background: transparent; touch-action: manipulation; }
.board-point:disabled { opacity: 1; }
.board-point::before { content: ""; width: 78%; aspect-ratio: 1; border-radius: 50%; }
@media (hover: hover) { .board-point:not(:disabled):hover::before { background: #26302c38; } }
.board-point.black-stone::before { background: radial-gradient(circle at 34% 28%, #555852, #252b29 60%, #191e1d); box-shadow: 0 1px 2px #34221470; }
.board-point.white-stone::before { background: radial-gradient(circle at 34% 28%, #fffef4, #e7ded0 82%); box-shadow: 0 1px 2px #34221470; }
.board-point.last-stone::after { content: ""; position: absolute; width: 20%; aspect-ratio: 1; border-radius: 50%; background: #ae6943; }
.board-point.winning-stone::before { outline: 2px solid #417863; }
.board-caption { grid-column: 2; grid-row: 3; align-self: end; text-align: center; color: var(--muted); font-size: 12px; }

.xiangqi-board { background: #eddbb9; container-type: inline-size; }
.xiangqi-board .board-point::before { content: none; }
.xiangqi-board .river-label { stroke: none; fill: #866743; font: .4px "KaiTi", "SimSun", serif; letter-spacing: .1px; }
.chess-piece { display: grid; place-items: center; width: 83%; aspect-ratio: 1; border-radius: 50%; border: 1px solid #9c8157; background: #fbf2da; color: #263430; box-shadow: 0 1px 2px #513b2640, inset 0 0 0 2px #fff8e5; font: 700 clamp(12px, 6cqw, 32px)/1 "KaiTi", "PingFang SC", "Microsoft YaHei", serif; }
.chess-piece.red-piece { color: #9a302c; }
.xiangqi-board .last-piece { box-shadow: inset 0 0 0 1px #a26e38; border-radius: 4px; }
.xiangqi-board .last-origin { box-shadow: inset 0 0 0 1px #9e7a475c; border-radius: 4px; }
.selected-piece .chess-piece { outline: 2px solid #2d6e56; background: #fff7d3; }
.legal-point:has(.chess-piece) .chess-piece { outline: 2px dashed #39795f; }
.legal-point:not(:has(.chess-piece))::after { position: absolute; content: ""; width: 26%; aspect-ratio: 1; border-radius: 50%; background: #34745a; }
.captured-summary { white-space: nowrap; }

.number-panel, .rps-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(4px, 2dvh, 16px); text-align: center; }
.number-label, .number-tip, .rps-last, .story-foot { font-size: 13px; color: var(--muted); }
.number-range { display: flex; align-items: center; gap: clamp(10px, 4vw, 30px); font-size: clamp(37px, min(13dvh, 12vw), 106px); color: var(--green); font-weight: 750; font-variant-numeric: tabular-nums; line-height: .98; }
.number-range span { font-size: .45em; color: #698b76; }
.number-track { width: min(82%, 390px); position: relative; height: 7px; flex: 0 0 auto; border-radius: 9px; overflow: hidden; background: #e6ece4; }
.number-remaining { position: absolute; inset-block: 0; min-width: 3px; border-radius: inherit; background: #428568; }
.attempts { display: flex; gap: 5px; }
.attempt-dot { width: 8px; aspect-ratio: 1; border-radius: 50%; background: #508267; }
.attempt-dot.used { background: #dce4d9; }
.choice-row { display: flex; justify-content: center; gap: 7px; }
.move-choice { flex: 1; display: flex; justify-content: center; align-items: center; gap: 5px; min-height: 42px; padding: 5px 7px; font-size: 14px; font-weight: 650; border-radius: 10px; border: 1px solid #d9e4d9; background: #edf4eb; color: var(--green); white-space: nowrap; }
.move-choice:hover { background: #dcebe0; }
.rps-score { display: flex; align-items: end; gap: clamp(10px, 4vw, 28px); color: var(--green); }
.rps-side { display: grid; gap: 4px; min-width: 54px; }
.rps-side small, .rps-reveal small { color: var(--muted); font-size: 12px; }
.rps-side strong, .rps-divider { font-size: clamp(28px, min(11dvh, 12vw), 76px); line-height: .92; font-variant-numeric: tabular-nums; }
.rps-divider { opacity: .5; }
.rps-reveal { display: flex; align-items: center; gap: 14px; font-size: clamp(18px, 7dvh, 51px); line-height: 1; }
.story-book { flex: 1; min-height: 0; width: min(100%, 660px); margin: 0 auto; padding: clamp(8px, 2vw, 22px); border: 1px solid #eadfca; background: #f8f2e6; border-radius: 14px; }
.story-book .reader-title { color: #795337; }
.story-book .reader-content { line-height: 1.55; }
.story-foot { align-self: center; padding-top: 5px; }

@media (max-height: 510px) {
  .number-panel, .rps-panel { gap: 4px; }
  .move-choice { min-height: 33px; }
  .story-book { padding: 7px 10px; }
}
.keyboard-open .empty-orbit { display: none; }

@media (min-width: 620px) and (max-height: 510px) {
  .room-card:has(.board-container) { display: grid; grid-template-columns: minmax(0, 1fr) max(115px, 25%); grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .room-card:has(.board-container) .room-heading { grid-column: 2; grid-row: 1; align-items: start; flex-direction: column; }
  .room-card:has(.board-container) .game-view { grid-column: 1; grid-row: 1 / -1; }
  .room-card:has(.board-container) .game-controls { grid-column: 2; grid-row: 2; }
  .room-card:has(.board-container) .game-moment { grid-column: 2; grid-row: 4; }
}
