/* Nonogram (Pages/Games/Nonogram, wwwroot/js/nonogram.js): a CSS grid with the clues of the columns on top, the clues of the rows on
   the left and the cells as buttons. Sizes follow the number of columns (--ng-n) and of clue columns (--ng-cc). */
.ng-wrap {
    --ng-cell: min(calc((100vw - 2.5rem) / (var(--ng-n) + var(--ng-cc) * .8)), 2.6rem);
    margin: .75rem auto 0;
    padding: .75rem;
    border-radius: .75rem;
    background: var(--game-panel, #fff);
    box-shadow: 0 0 0 .2rem var(--game-frame, #212529);
    overflow-x: auto;
    width: fit-content;
    max-width: 100%;
}
.ng-board {
    display: grid;
    grid-template-columns: repeat(var(--ng-cc), calc(var(--ng-cell) * .8)) repeat(var(--ng-n), var(--ng-cell));
    touch-action: none;           /* painting by dragging must not scroll the page */
    user-select: none;
    -webkit-user-select: none;
}
.ng-clue {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex-direction: column;
    font-size: calc(var(--ng-cell) * .42);
    font-weight: 700;
    color: #212529;
    line-height: 1.05;
    padding: 0 .1rem .1rem;
}
.ng-clue.ng-r { flex-direction: row; justify-content: flex-end; align-items: center; gap: .25em; padding: 0 .25rem 0 0; }
.ng-clue.ng-c { justify-content: flex-end; align-items: center; }
.ng-clue.done { color: #adb5bd; }
.ng-clue span.done { color: #adb5bd; }
.ng-cell {
    width: var(--ng-cell);
    height: var(--ng-cell);
    padding: 0;
    border: 1px solid #adb5bd;
    background: #fff;
    font-size: calc(var(--ng-cell) * .6);
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
}
.ng-cell.thick-top { border-top: 2px solid #212529; }
.ng-cell.thick-left { border-left: 2px solid #212529; }
.ng-cell.filled { background: #212529; border-color: #212529; }
.ng-cell.filled.thick-top { border-top-color: #212529; }
.ng-cell.cross::after { content: '✕'; }
.ng-cell.wrong { background: #dc3545; border-color: #dc3545; }
.ng-cell.hinted { box-shadow: inset 0 0 0 3px var(--bs-primary); }
.ng-cell:focus-visible { outline: 3px solid var(--bs-primary); outline-offset: -3px; z-index: 1; }
.ng-picture {
    display: grid;
    width: min(14rem, 70vw);
    aspect-ratio: 1;
    margin: .5rem auto 1rem;
    border: 2px solid #212529;
    background: #fff;
}
.ng-picture span.on { background: #212529; }
