.play-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 12px;
}
.play-title { flex: 1; font-weight: 700; font-size: 1.05rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-size { font-weight: 400; color: var(--muted); font-size: .85rem; }

#play-view { max-width: 680px; margin-inline: auto; }
.board-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.board {
  --cell: 28px;
  display: grid;
  grid-template-areas: "corner cols" "rows cells";
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  background: var(--card);
  border-radius: 10px;
  padding: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.board .corner { grid-area: corner; }
.board-head, .board-body { display: contents; }
.size-controls {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
  font-size: .85rem; color: var(--ink-soft);
}
.board-wrap.zoomed {
  display: block; overflow: auto; max-height: 60vh;
  border: 1px solid var(--line); border-radius: 8px;
}
.zoomed .board {
  display: flex; flex-direction: column; width: max-content;
  padding: 0; border: 0; border-radius: 0; touch-action: auto;
}
.zoomed .board-head, .zoomed .board-body { display: flex; }
.zoomed .board-head { position: sticky; top: 0; z-index: 3; background: var(--card); }
.zoomed .corner, .zoomed .row-clues { position: sticky; left: 0; z-index: 2; background: var(--card); }
.zoomed .corner { flex: 1; }
.zoomed .clue { font-size: 1rem; }
.zoomed .row-clues .clue { gap: .3em; }
.zoomed .row-clues { box-shadow: 1px 0 var(--line-strong); }
.zoomed .board-head { box-shadow: 0 1px var(--line-strong); }
.zoomed .cells { touch-action: none; }

.col-clues {
  grid-area: cols;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--cell);
  align-items: end;
  /* 盤面のマス間のすき間(1px)と枠線(2px)に合わせる */
  column-gap: 1px;
  padding: 0 2px;
}
.row-clues {
  grid-area: rows;
  display: grid;
  grid-auto-rows: var(--cell);
  justify-items: end;
  row-gap: 1px;
  padding: 2px 0;
}
.clue {
  display: flex;
  font-size: calc(var(--cell) * .5);
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: color .15s;
}
.col-clues .clue { flex-direction: column; align-items: center; gap: calc(var(--cell) * .14); padding: 4px 0; border-radius: 6px 6px 0 0; }
.row-clues .clue { align-items: center; gap: calc(var(--cell) * .28); padding: 0 6px 0 4px; height: var(--cell); border-radius: 6px 0 0 6px; }
.clue.done { color: var(--done); text-decoration: line-through; text-decoration-thickness: 1px; }
.clue.hl { background: var(--accent-softer); }
.col-clues .clue:nth-child(5n):not(:last-child) { box-shadow: inset -1px 0 0 transparent; }

.cells {
  grid-area: cells;
  display: grid;
  border: 2px solid var(--ink-soft);
  background: var(--line);
  gap: 1px;
  cursor: pointer;
}
.cell {
  width: var(--cell);
  height: var(--cell);
  background: #fff;
  position: relative;
  transition: background-color .08s;
}
.cell.hl { background: var(--accent-softer); }
.cells:focus { outline: none; }
.cells:focus-visible .cell.cursor { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.cells:focus-visible .cell.cursor.filled::after { content: ""; position: absolute; inset: 2px; border: 1px solid white; }
.cell.filled { background: var(--ink); }
.cell.crossed::before, .cell.crossed::after {
  content: "";
  position: absolute;
  left: 22%; right: 22%;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--cross);
  border-radius: 2px;
}
.cell.crossed::before { transform: rotate(45deg); }
.cell.crossed::after { transform: rotate(-45deg); }

/* 5マスごとの太線 */
.cell.br5 { box-shadow: 1px 0 0 0 var(--ink-soft); }
.cell.bb5 { box-shadow: 0 1px 0 0 var(--ink-soft); }
.cell.br5.bb5 { box-shadow: 1px 0 0 0 var(--ink-soft), 0 1px 0 0 var(--ink-soft), 1px 1px 0 0 var(--ink-soft); }

.board.solved .cells { cursor: default; }
.board.solved .cell.crossed::before, .board.solved .cell.crossed::after { display: none; }
.board.solved .cell.filled { background: var(--solve-color, var(--ink)); }
.board.solved .clue { color: var(--done); }

.controls { justify-content: center; max-width: 520px; margin: 16px auto 0; }
.ico-fill { display: inline-block; width: 14px; height: 14px; background: currentColor; border-radius: 2px; }
.ico-cross { font-weight: 700; font-size: 1.1em; line-height: 1; }

@media (max-width: 480px) {
  .board { padding: 4px; border-radius: 8px; }
  .controls .btn { padding: 6px 12px; }
}
