/* ゲーム内だけに適用。全ての寸法は利用者の文字サイズ設定に追従。 */
.g-game { color: var(--ink); width: 100%; min-width: 0; line-height: 1.7; }
.g-body { display: grid; gap: 1rem; min-width: 0; }
.g-instruction { font-size: 1.15rem; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.g-progress, .g-note { color: var(--sub); margin: 0; }
.g-status { padding: .85rem; margin: 1rem 0 0; border: .1rem solid var(--line); border-radius: .6rem; background: var(--primary-soft); min-height: 3rem; box-sizing: border-box; }
.g-btn { font-family: var(--gothic); font-weight: 600; color: var(--primary); background: var(--surface); border: .1rem solid var(--primary); border-radius: .6rem; min-height: 3rem; min-width: 3rem; padding: .6rem .65rem; cursor: pointer; touch-action: manipulation; overflow-wrap: anywhere; box-sizing: border-box; line-height: 1.4; }
.g-btn:focus-visible { outline: .2rem solid var(--accent); outline-offset: .15rem; }
.g-btn:disabled { cursor: default; color: var(--sub); border-color: var(--line); background: var(--bg); }
.g-btn:active { background: var(--primary-soft); }
.g-main { background: var(--primary); color: var(--primary-ink); }
.g-quiet { color: var(--sub); border-color: var(--line); }
.g-selected, .g-selected:disabled { background: var(--primary-soft); border: .2rem solid var(--primary); color: var(--primary); box-shadow: inset 0 0 0 .1rem var(--surface); }
.g-done, .g-done:disabled { background: var(--good-bg); color: var(--good); border-color: var(--good); }
.g-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.g-bank { display: grid; grid-template-columns: repeat(auto-fit, minmax(3.1rem, 1fr)); gap: .5rem; }
.g-answer { font-size: 1.55rem; font-weight: 700; letter-spacing: .08rem; padding: 1rem .5rem; background: var(--primary-soft); color: var(--ink); border-radius: .6rem; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.g-items, .g-clues { padding-left: 1.4rem; margin: 0; }
.g-item, .g-clue { margin: .5rem 0; overflow-wrap: anywhere; }
.g-reference { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem; }
.g-turn { font-weight: 700; }
.g-pattern { display: grid; grid-template-columns: repeat(var(--g-n), 1fr); width: 100%; max-width: 7rem; aspect-ratio: 1; gap: .08rem; border: .12rem solid var(--ink); background: var(--line); padding: .12rem; margin: .2rem auto; box-sizing: border-box; }
.g-pixel { background: var(--surface); aspect-ratio: 1; min-width: 0; }
.g-filled { background: var(--primary); }
.g-stroop { font-size: 2.7rem; text-align: center; font-weight: 900; margin: 0; background: var(--surface); padding: .5rem; border: .1rem solid var(--line); border-radius: .6rem; }
.g-color-accent { color: var(--accent); }
.g-color-good { color: var(--good); }
.g-color-warn { color: var(--warn); }
.g-color-ink { color: var(--ink); }
.g-color-sub { color: var(--sub); }
/* 3remの操作面を守るため、大きいナンプレは盤面だけ横に動かす。 */
.g-board-scroll { max-width: 100%; overflow-x: auto; padding: .25rem; box-sizing: border-box; overscroll-behavior-x: contain; }
.g-sudoku { display: grid; grid-template-columns: repeat(var(--g-n), 3rem); width: max-content; border-right: .15rem solid var(--ink); border-bottom: .15rem solid var(--ink); }
.g-cell { width: 3rem; height: 3rem; min-width: 3rem; min-height: 3rem; padding: .15rem; border: .05rem solid var(--line); border-radius: 0; font-size: 1.25rem; }
.g-fixed:disabled { color: var(--ink); background: var(--bg); font-weight: 900; }
.g-box-top { border-top: .15rem solid var(--ink); }
.g-box-left { border-left: .15rem solid var(--ink); }
.g-cell.g-selected { border: .15rem solid var(--primary); }
.g-solution-cell { display: grid; place-items: center; width: 3rem; height: 3rem; border: .05rem solid var(--line); background: var(--surface); box-sizing: border-box; }
.g-trail { display: grid; grid-template-columns: repeat(auto-fit, minmax(3rem, 1fr)); max-width: calc(var(--g-cols) * 4rem); gap: .4rem; }
.g-pairs { display: grid; grid-template-columns: repeat(auto-fit, minmax(3.7rem, 1fr)); gap: .5rem; }
.g-pairs .g-btn { min-height: 5.5rem; padding: .35rem .15rem; }
.g-picture { display: block; width: 2.6rem; height: 2.6rem; margin: 0 auto; }
.g-svg { display: block; width: 100%; height: 100%; }
.g-picture-name { display: block; font-size: .8rem; line-height: 1.4; }
@media (prefers-reduced-motion: reduce) {
  .g-game, .g-body, .g-btn, .g-pattern, .g-picture { animation: none; transition: none; scroll-behavior: auto; }
}

/* ---- 仕上げ（結合時に追加）---- */
/* 計算と数列の式は、ひと目で読める大きさにする。 */
.g-question { font-size: 2rem; line-height: 1.5; text-align: center; letter-spacing: .04em; padding: .6rem .2rem; font-variant-numeric: tabular-nums; }
.g-options .g-btn { min-height: 3.8rem; font-size: 1.25rem; }
.g-status { font-weight: 700; }
/* ナンプレは横に動かさず、画面の幅に収める。 */
/* 9×9でも1マスを40px前後に保つため、盤面だけカードの余白まで広げる。 */
.g-board-scroll { overflow-x: visible; padding: 0; margin-inline: -1.5rem; max-width: none; }
.g-sudoku { grid-template-columns: repeat(var(--g-n), minmax(0, 1fr)); width: 100%; max-width: calc(var(--g-n) * 3.4rem); margin: 0 auto; }
.g-cell { width: auto; height: auto; min-width: 0; min-height: 0; aspect-ratio: 1; padding: 0; font-size: clamp(1rem, 4.6vw, 1.4rem); }
.g-solution-cell { width: auto; height: auto; aspect-ratio: 1; }
/* 絵あわせ：伏せた札は深緑、表は生成りの紙。 */
.g-pairs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-pairs .g-btn { min-height: 0; aspect-ratio: 3 / 4; border-radius: .5rem; }
.g-pairs .g-back, .g-pairs .g-back:disabled { color: transparent; border-color: var(--primary); background: var(--primary) repeating-linear-gradient(45deg, rgba(255,255,255,.09) 0 .35rem, transparent .35rem .7rem); box-shadow: inset 0 0 0 .22rem var(--primary), inset 0 0 0 .3rem rgba(255,255,255,.35); }
.g-pairs .g-face, .g-pairs .g-face:disabled { background: var(--bg); color: var(--accent); border-color: var(--line); }
.g-pairs .g-done, .g-pairs .g-done:disabled { background: var(--good-bg); color: var(--good); border-color: var(--good); }
.g-picture { width: 62%; height: auto; aspect-ratio: 1; }
.g-picture-name { color: var(--ink); font-size: .74rem; }
.g-stroop { font-family: var(--gothic); font-size: 3.4rem; }
.g-trail .g-btn { aspect-ratio: 1; font-size: 1.35rem; }
@media (min-width: 480px) { .g-pairs { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
