/* Nonogram — clue gutters + board. Cell size follows the stage width and the grid size. */
.ng-wrap { --cell: clamp(14px, calc((min(100vw - 2rem, 720px) - 2rem) / (var(--w, 10) + var(--rl, 2) * 0.9)), 36px); display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; gap: 3px; width: max-content; max-width: 100%; margin: 0 auto; user-select: none; touch-action: none; }
.ng-corner { background: transparent; }
.ng-cols { display: grid; grid-template-columns: repeat(var(--w, 10), var(--cell)); gap: 1px; align-items: end; }
.ng-rows { display: grid; grid-template-rows: repeat(var(--h, 10), var(--cell)); gap: 1px; align-items: stretch; }
.ng-clue { display: flex; gap: 2px; font-family: var(--font-mono); font-size: calc(var(--cell) * 0.46); font-weight: 600; color: var(--text-primary); background: var(--surface); border-radius: 4px; }
.ng-clue span { min-width: calc(var(--cell) * 0.55); text-align: center; }
.ng-clue-col { flex-direction: column; align-items: center; justify-content: flex-end; padding: 4px 0 3px; min-height: calc(var(--cell) * 0.6 * var(--cl, 2) + 8px); }
.ng-clue-row { flex-direction: row; align-items: center; justify-content: flex-end; padding: 0 5px 0 4px; min-width: calc(var(--cell) * 0.62 * var(--rl, 2) + 8px); }
.ng-clue.is-done { color: var(--text-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.ng-board { display: grid; gap: 1px;
}
.ng-row { display: contents; }
.ng-board { background: var(--border); border: 2px solid var(--text-primary); border-radius: 4px; overflow: hidden; }
.ng-cell { width: var(--cell); height: var(--cell); padding: 0; border: 0; background: var(--surface-elevated, #fff); color: var(--text-muted); font: inherit; font-size: calc(var(--cell) * 0.6); line-height: 1; cursor: pointer; position: relative; }
.ng-cell.is-v5 { border-right: 2px solid var(--text-primary); }
.ng-cell.is-h5 { border-bottom: 2px solid var(--text-primary); }
.ng-cell.is-fill { background: var(--text-primary); }
.ng-cell.is-x::after { content: "×"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: calc(var(--cell) * 0.7); }
.ng-cell.is-sel { outline: 2px solid var(--brand); outline-offset: -2px; z-index: 1; }
.ng-cell.is-bad { background: #dc2626; }
.ng-cell.is-bad.is-x::after { color: #dc2626; }
.ng-board.is-solved .ng-cell.is-x::after { display: none; }
.ng-board.is-solved .ng-cell.is-fill { background: var(--brand); }
.ng-cell:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
#ng-bar .game-key.is-on { background: var(--brand-ink); color: #fff; border-color: var(--brand-ink); }
