.table-status, .board-key, .board-actor, .board-identity, .result-head {
  display: flex;
  align-items: center;
}
.table-status { justify-content: space-between; gap: 12px; min-height: 31px; }
.board-actor { gap: 10px; min-width: 0; overflow-wrap: anywhere; color: #fff7da; font-size: 19px; }
.board-actor .stone { width: 24px; flex: none; }
.table-status .clock { padding: 5px 9px; border: 1px solid #66816a; border-radius: 5px; color: #fff4ca; }
.table-status .clock.urgent { color: #ffe0bc; background: #783a27; border-color: #de9664; }
.board-key { justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 13px; color: #e7ebd9; font-size: 12px; font-weight: 700; }
.board-identity { gap: 7px; }
.board-identity .stone { width: 18px; }
.last-key::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border: 2px solid #fff4cb; vertical-align: -1px; }
.cell.last-stop { outline: 2px solid #fff4cb; outline-offset: -4px; }
.cell.last-stop:focus-visible { outline: 3px solid #a34818; }
.bar.last-wall { background: #80532c; border-color: #513c22; box-shadow: inset 0 0 0 1.5px #f6d48d, 0 0 0 1px #5a4128; }
.bar.last-breach, .bar.removing {
  border: 1px dashed #80391e;
  background: repeating-linear-gradient(135deg,#fbc378 0 4px,#a63d24 4px 7px);
  box-shadow: 0 0 0 1px #f8cc8a;
}
.bar.last-breach { opacity: .7; clip-path: polygon(0 0,100% 0,100% 36%,0 46%,0 63%,100% 53%,100% 100%,0 100%); }
.bar.h.last-breach { clip-path: polygon(0 0,41% 0,36% 100%,53% 100%,58% 0,100% 0,100% 100%,0 100%); }
.bar.removing { opacity: 1; z-index: 5; }
.path-note { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px; }
.breaker-warning { padding: 3px 6px; border-radius: 3px; color: #823c19; background: #ffe5c1; font-family: var(--sans); font-weight: 800; }
.action-card.breaking { border-color: #cc8956; }
.breaking #confirm-turn { background: #8d3f22; color: #fff6e6; }
.action-card .wall-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(52px,1fr)); gap: 5px; }
.action-card .wall-options button { min-height: 44px; padding: 5px 3px; }
.action-card .turn-controls button { min-height: 44px; }
.recent-moves { padding: 0; margin: 0; list-style: none; }
.recent-moves li { padding: 6px 0; overflow-wrap: anywhere; }
.recent-moves li + li { border-top: 1px solid var(--line); }
.recent-moves li:first-child { color: var(--ink); font-weight: 700; }
.winner-star { color: #ffe295; text-shadow: 0 2px #8d632d; line-height: 1; }
.result-head { gap: 12px; margin: -1px -1px 16px; padding: 16px; border: 1px solid #a8884c; border-radius: 8px; background: #294938; color: #fff3ce; }
.result-head .winner-star { font-size: 27px; }
.result-head h2 { overflow-wrap: anywhere; font-size: 20px; }
.result-head p { margin-top: 4px; color: #e6e1c9; font-size: 13px; overflow-wrap: anywhere; }
.results-card h3 { font-size: 16px; }
.rank-row.first-place .rank-number { color: #77501d; background: #f8e5b7; padding: 4px; border-radius: 4px; text-align: center; }
.cell.winning-region { background-image: repeating-linear-gradient(135deg,transparent 0 8px,#fff7d444 8px 11px); }
@media (max-width: 640px) {
  .game-shell .room-tools { margin-bottom: 8px; }
  .game-shell .play-table { padding: 9px 9px 10px; }
  .table-status { min-height: 29px; margin-bottom: 7px; }
  .board-actor { font-size: 16px; }
  .board-actor .stone { width: 20px; }
  .table-status .clock { padding: 2px 6px; font-size: 15px; }
  .board-key { margin-top: 10px; }
  .side-stack .action-card { padding: 11px 12px; }
  .action-card .path-note, .action-card .wall-options, .action-card .turn-controls { margin-top: 6px; }
  .game-layout { gap: 8px; }
}
@media (max-width: 640px) and (max-height: 740px) {
  .game-shell { padding-top: 8px; }
  .game-shell .room-tools { margin-bottom: 6px; }
  .game-shell .room-tools h1 { font-size: 21px; }
  .game-shell .room-tools .eyebrow { margin-bottom: 0; }
  .action-card:has(.turn-inputs) { padding: 0; border: 0; }
  .game-shell:has(.turn-inputs) { padding-bottom: 175px; }
  .action-card .turn-inputs {
    position: fixed;
    z-index: 7;
    inset: auto 0 0;
    margin: 0;
    padding: 7px max(14px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: var(--white);
  }
  .turn-inputs .instruction { font-size: 13px; line-height: 1.35; }
  .turn-inputs .path-note { margin-top: 2px; }
}
