/* ノノグラムの解き方ページ（how_to_solve.php / how_to_solve_en.php）の図 */

.ng-figure {
    margin: 1rem 0 1.5rem;
    overflow-x: auto;
}

.ng-line {
    display: flex;
    align-items: center;
    margin: 0.3rem 0;
    white-space: nowrap;
}

.ng-label {
    flex: 0 0 4rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.ng-clue {
    flex: 0 0 3.2rem;
    text-align: right;
    padding-right: 0.5rem;
    font-weight: bold;
}

/* 数字の間には空白文字も入っている（ng_clue_html）。その幅に少しだけ足す */
.ng-num + .ng-num {
    margin-left: 0.1rem;
}

.ng-num-R {
    color: #dc3545;
}

.ng-num-B {
    color: #0d6efd;
}

.ng-cells {
    display: inline-flex;
    border-left: 1px solid #495057;
}

.ng-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
    box-sizing: border-box;
    border: 1px solid #495057;
    border-left: none;
    font-size: 0.85rem;
    line-height: 1;
    color: #868e96;
}

.ng-cell.ng-sep {
    border-right-width: 2px;
}

/* マスの状態。表の中のマス（.ng-gcell）と共用する */
.ng-fill {
    background-color: #212529;
}

.ng-red {
    background-color: #dc3545;
}

.ng-blue {
    background-color: #0d6efd;
}

.ng-place1 {
    background-color: #9ec5fe;
}

.ng-place2 {
    background-color: #ffda6a;
}

/* その手順で新しく確定したマス */
.ng-new {
    box-shadow: inset 0 0 0 3px #fd7e14;
}

.ng-blank.ng-new {
    background-color: #fff3cd;
}

.ng-figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
    white-space: normal;
}

.ng-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.ng-legend .ng-cell {
    border-left: 1px solid #495057;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.ng-grid-wrap {
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
}

.ng-grid {
    border-collapse: collapse;
}

.ng-grid td,
.ng-grid th {
    padding: 0;
}

.ng-grid .ng-gcell {
    width: 1.6rem;
    min-width: 1.6rem;
    height: 1.6rem;
    border: 1px solid #495057;
    text-align: center;
    vertical-align: middle;
    font-size: 0.85rem;
    color: #868e96;
}

.ng-grid .ng-colclue {
    vertical-align: bottom;
    text-align: center;
    font-weight: bold;
    line-height: 1.15;
    padding-bottom: 0.25rem;
}

.ng-grid .ng-rowclue {
    text-align: right;
    white-space: nowrap;
    font-weight: bold;
    padding-right: 0.5rem;
}

/* 「この行に注目」と示す行のヒント（技12 の図） */
.ng-grid .ng-rowclue.ng-hl {
    background-color: #cfe2ff;
    border-radius: 0.25rem;
}

.ng-stages {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    margin: 1rem 0;
}

.ng-stage {
    max-width: 15rem;
}

/* 目次。自動の連番は「6. 技8」のように技の番号と並んで紛らわしいので付けない */
.ng-toc,
.ng-toc ol {
    list-style: none;
}

.ng-toc {
    padding-left: 0;
}

.ng-toc ol {
    padding-left: 1.25rem;
}

.ng-toc li {
    margin: 0.15rem 0;
}

.ng-toc ol {
    margin-top: 0.15rem;
}

/* ページ冒頭の要点 */
.ng-summary {
    margin: 1.5rem 0 0;
    padding: 1rem 1.25rem;
    border: 1px solid #dee2e6;
    border-left: 4px solid #212529;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
}

.ng-summary h2 {
    margin-bottom: 0.5rem;
    color: #6c757d;
}

.ng-summary li {
    margin: 0.25rem 0;
}

/* 各技の要約（1文）。見出しのすぐ下に置く */
.ng-rule {
    margin: 0.75rem 0 1rem;
    padding: 0.6rem 1rem;
    border-left: 4px solid #fd7e14;
    background-color: #fff8f0;
}

/* 解き方の流れ */
.ng-steps > li {
    margin: 0.5rem 0;
}

/* 呼び名の表・早見表 */
.ng-names,
.ng-cheat {
    font-size: 0.95rem;
}

.ng-cheat th[scope="row"] {
    white-space: nowrap;
}

/* 用語集 */
.ng-glossary dt {
    margin-top: 0.75rem;
}

.ng-glossary dd {
    margin-bottom: 0;
}

/* このページについて */
.ng-about {
    margin: 1.5rem 0 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.ng-about h2 {
    color: #6c757d;
}

.ng-stage-title {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.ng-cta {
    margin: 2.5rem 0 1rem;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
}

.ng-byline {
    font-size: 0.85rem;
    color: #6c757d;
}

.ng-faq h3 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
}

/* 練習問題（タップして解く盤面） */
.ng-practice {
    margin: 1rem 0 2rem;
}

.ng-practice-board {
    overflow-x: auto;
}

.ng-practice .ng-ptd {
    width: 1.75rem;
    min-width: 1.75rem;
    height: 1.75rem;
    border: 1px solid #495057;
}

.ng-practice .ng-ptd.ng-sep-r {
    border-right-width: 2px;
}

.ng-practice .ng-ptd.ng-sep-b {
    border-bottom-width: 2px;
}

.ng-pcell {
    display: block;
    width: 100%;
    height: 1.75rem;
    padding: 0;
    border: 0;
    background-color: #fff;
    color: #868e96;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
}

.ng-pcell.is-fill {
    background-color: #212529;
}

.ng-pcell.is-cross::after {
    content: "×";
}

.ng-pcell:focus-visible {
    outline: 3px solid #fd7e14;
    outline-offset: -3px;
}

/* 解けたら×を消して、絵だけを見せる */
.ng-practice.is-solved .ng-pcell.is-cross::after {
    content: "";
}

.ng-practice-status {
    min-height: 1.5rem;
    margin: 0.5rem 0 0;
    font-weight: bold;
}

.ng-practice.is-solved .ng-practice-status {
    color: #198754;
}
