/* 2.3 word / board / logic shells: keep docks on-screen at 360×800 and 390×844. */
.p23-shell {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: .12rem;
}
.p23-shell > .puzzle-toolbar,
.p23-shell > .game-status,
.p23-shell > .quiz-hud {
  flex: 0 0 auto;
}
.p23-shell > .puzzle-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
  align-items: center;
  padding: .1rem 0;
}
.p23-shell > .puzzle-toolbar .btn { padding: .18rem .4rem; font-size: .78rem; min-height: 1.7rem; }
.p23-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
}
.p23-dock {
  flex: 0 0 auto;
  padding: .1rem 0 .15rem;
  background: var(--bg, #08120e);
  z-index: 6;
}
.p23-grid {
  display: grid;
  gap: 2px;
  margin: 0 auto;
}
.p23-cell, .p23-edge, .p23-pit, .p23-key, .p23-col {
  box-sizing: border-box;
  border: 1px solid rgba(232, 212, 139, .35);
  background: #14241c;
  color: #f3e0a0;
  font-weight: 700;
  min-width: 0;
  min-height: 0;
  padding: 0;
}
.p23-cell.tap, .p23-key, .p23-col, .p23-pit, .p23-edge, .p23-arrow {
  cursor: pointer;
}
.p23-cell.block { background: #0a120e; border-color: transparent; pointer-events: none; }
.p23-cell.given { background: #1e3328; color: #e8d48b; }
.p23-cell.sel { outline: 2px solid #e8c86a; outline-offset: -1px; z-index: 1; }
.p23-cell.ok { background: #1d4a2e; }
.p23-cell.bad { background: #4a1d1d; }
.p23-cell.num { font-size: .62rem; color: #c9a227; }
.p23-wordlist {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .45rem;
  justify-content: center;
  font-size: .78rem;
  max-height: 4.2rem;
  overflow: auto;
  width: 100%;
}
.p23-wordlist .got { text-decoration: line-through; opacity: .55; }
.p23-clue { font-size: .82rem; line-height: 1.25; width: 100%; max-height: 4.6rem; overflow: auto; }
.p23-board-wrap { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.p23-stone-b { background: #1b1208; color: #f3e0a0; }
.p23-stone-w { background: #f3e0a0; color: #1b1208; }
.p23-legal { box-shadow: inset 0 0 0 2px #7dbe6a; }
.p23-hint { font-size: .78rem; opacity: .85; }
@media (max-height: 920px) {
  body.in-game .play-wrap:has(.p23-shell) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.in-game .play-wrap:has(.p23-shell) .game-mount {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .p23-shell .letter-pad { gap: .1rem; padding: .1rem .12rem; }
  .p23-shell .letter-key { min-width: 1.35rem; min-height: 1.45rem; font-size: .78rem; }
  .p23-shell .letter-key.wide { min-width: 3rem; }
}

/* ---- Premium paper grids (crossword / word / logic) ---- */
.p23-shell.p23-paper .p23-cell {
  background: #fbf7ee;
  color: #1b2a41;
  border: 1px solid #1b2a41;
  font-family: var(--font-display, "Source Serif 4", Georgia, serif);
  font-weight: 700;
}
.p23-shell.p23-paper .p23-cell.block {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #e8d48b;
  font-family: var(--font-ui, "Source Sans 3", sans-serif);
  font-weight: 600;
}
.p23-shell.p23-paper .p23-cell.given {
  background: #efe6d0;
  color: #1b2a41;
}
.p23-shell.p23-paper .p23-cell.sel {
  outline: 2px solid #c9a227;
  outline-offset: -2px;
}
.p23-shell.p23-paper .p23-cell.ok {
  background: #2f6b3c;
  color: #fbf7ee;
  border-color: #1b2a41;
}
.p23-shell.p23-paper .p23-cell.present {
  background: #c9a227;
  color: #1b1208;
  border-color: #1b2a41;
}
.p23-shell.p23-paper .p23-cell.bad {
  background: #4a4a4a;
  color: #e8e0d0;
  border-color: #1b2a41;
}
.p23-shell.p23-paper .p23-cell.num {
  color: #1b2a41;
  position: relative;
}
.p23-cw-num {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: .52rem;
  line-height: 1;
  font-family: var(--font-ui, "Source Sans 3", sans-serif);
  font-weight: 600;
  color: #5a4a28;
  pointer-events: none;
}
.p23-cage-sum, .p23-ken-sum {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: .52rem;
  line-height: 1;
  font-family: var(--font-ui, "Source Sans 3", sans-serif);
  font-weight: 700;
  color: #5a3a18;
  pointer-events: none;
}
.p23-cell { position: relative; }
.p23-clue, .p23-wordlist, .p23-hint, .p23-quote {
  flex: 0 0 auto;
  color: #f3e0a0;
}
.p23-clue {
  max-height: 5.2rem;
  overflow: auto;
  font-size: .78rem;
  line-height: 1.3;
  width: 100%;
  padding: 0 .2rem;
}
.p23-clue-line {
  display: block;
  width: 100%;
  text-align: left;
  background: #fbf7ee;
  color: #1b2a41;
  border: 1px solid rgba(201, 162, 39, .55);
  border-radius: 6px;
  padding: .2rem .45rem;
  margin: .15rem 0;
  font-size: .8rem;
  font-family: var(--font-ui, "Source Sans 3", sans-serif);
  cursor: pointer;
}
.p23-clue-line.sel {
  outline: 2px solid #c9a227;
  background: #efe6d0;
}
.p23-slots {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  justify-content: center;
  align-items: center;
}
.p23-slots .p23-cell {
  width: 2rem;
  height: 2.2rem;
  min-width: 2rem;
  min-height: 2.2rem;
  font-size: 1.15rem;
}
.p23-lock-row { justify-content: center; margin-bottom: .2rem; }
.p23-lock-row .p23-cell {
  width: 2rem;
  height: 2.15rem;
  min-width: 2rem;
  min-height: 2.15rem;
  font-size: 1.1rem;
}

/* Boards */
.p23-cols {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  width: 100%;
  max-width: 22rem;
  margin: 0 auto .15rem;
}
.p23-cols .p23-col, .p23-cols .btn {
  min-height: 1.85rem;
  width: 100%;
}
.p23-mancala {
  display: grid;
  grid-template-columns: 3.1rem repeat(6, 2.15rem) 3.1rem;
  grid-template-rows: 2.35rem 2.35rem;
  gap: .22rem;
  align-items: stretch;
  justify-content: center;
}
.p23-mancala .p23-store {
  border-radius: .85rem;
  font-size: 1.05rem;
  background: #3a2412;
  color: #f3e0a0;
  border: 1px solid #c9a227;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.p23-mancala .p23-store.ai { grid-column: 1; grid-row: 1 / 3; }
.p23-mancala .p23-store.me { grid-column: 8; grid-row: 1 / 3; }
.p23-mancala .p23-pit {
  border-radius: 50%;
  min-width: 2.15rem;
  min-height: 2.35rem;
  font-size: 1.05rem;
  background: #3a2412;
  color: #f3e0a0;
  border: 1px solid rgba(232, 212, 139, .55);
}
.p23-goban .p23-cell {
  background: #d7b56d;
  border: 1px solid #5a3a18;
  color: #1b1208;
  border-radius: 0;
}
.p23-goban .p23-cell.p23-hoshi::after {
  content: "";
  width: .35rem;
  height: .35rem;
  background: #3a2412;
  border-radius: 50%;
  display: inline-block;
}
.p23-goban .p23-stone-b, .p23-goban .p23-cell.p23-stone-b {
  background: radial-gradient(circle at 35% 30%, #4a4038, #1b1208);
  color: #f3e0a0;
  border-radius: 50%;
}
.p23-goban .p23-stone-w, .p23-goban .p23-cell.p23-stone-w {
  background: radial-gradient(circle at 35% 30%, #fff8e8, #d8c9a0);
  color: #1b1208;
  border-radius: 50%;
}
.p23-mill-wrap { position: relative; }
.p23-mill-lines {
  position: absolute;
  inset: 8%;
  pointer-events: none;
  z-index: 0;
}
.p23-mill-wrap .p23-grid { position: relative; z-index: 1; }
.p23-water .p23-cell {
  background: #1a3d4d;
  border-color: rgba(180, 220, 230, .3);
  color: #e8f4f8;
}
.p23-water .p23-cell.ok { background: #8a2a2a; }
.p23-water .p23-cell.bad { background: #1a2a40; color: #8ab; }
.p23-fleet-mini { margin-top: .2rem; }
.p23-isle {
  border-radius: 50% !important;
  background: #fbf7ee !important;
  color: #1b2a41 !important;
  border: 2px solid #c9a227 !important;
  font-weight: 700;
}
.p23-hashi .p23-cell.block {
  background: transparent;
  border-color: transparent;
  color: #e8d48b;
  font-size: 1.1rem;
}
.p23-edge {
  background: rgba(243, 224, 160, .16);
  border: 1px solid rgba(232, 212, 139, .28);
  min-width: .7rem;
  min-height: .7rem;
}
.p23-edge.on {
  background: #e8c86a;
  border-color: #c9a227;
}
.p23-dock .btn { margin: .1rem; }
.p23-kakuro-clue {
  background: #1a1a1a;
  color: #e8d48b;
  font-size: .52rem;
  line-height: 1.1;
  font-family: var(--font-ui, "Source Sans 3", sans-serif);
  position: relative;
  overflow: hidden;
}
.p23-kakuro-clue .k-down { position: absolute; left: 3px; bottom: 2px; }
.p23-kakuro-clue .k-across { position: absolute; right: 3px; top: 2px; }
.p23-kakuro-clue::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, transparent calc(50% - 1px), #5a4a28 50%, transparent calc(50% + 1px));
  pointer-events: none;
}
