.nonogram-game {
  --ng-ink: #253c3b;
  --ng-muted: #536861;
  --ng-paper: #fbfaf4;
  --ng-line: #c6d0c8;
  --ng-green: #385e55;
  --ng-gold: #e3b957;
  color: var(--ng-ink);
  font: 500 1rem/1.45 system-ui, sans-serif;
}
.nonogram-game * { box-sizing: border-box; }
.nonogram-game .ng-shell { max-width: 1360px; margin: 0 auto; padding: clamp(12px, 2vw, 24px); background: var(--ng-paper); border: 1px solid #d7ddd4; border-radius: 18px; }
.nonogram-game .ng-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.nonogram-game .ng-heading h2 { margin: 0; font: 700 clamp(1.5rem, 3vw, 2.25rem)/1.1 Georgia, serif; }
.nonogram-game .ng-kicker { margin: 0 0 .3rem; color: var(--ng-green); font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.nonogram-game .ng-memory { max-width: 17rem; margin: 0; color: var(--ng-muted); font-size: .85rem; text-align: right; }
.nonogram-game .ng-instructions { max-width: 70ch; margin: .8rem 0 1rem; color: var(--ng-muted); }
.nonogram-game .ng-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .7rem; }
.nonogram-game .ng-readouts, .nonogram-game .ng-modes, .nonogram-game .ng-actions, .nonogram-game .ng-dialog-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.nonogram-game .ng-readouts { color: var(--ng-muted); font-size: .9rem; }
.nonogram-game .ng-readouts > span { padding: .35rem .6rem; background: #f0f2e9; border-radius: 999px; }
.nonogram-game button, .nonogram-game select { min-height: 42px; padding: .45rem .8rem; border: 1px solid #aebdb4; border-radius: 9px; background: #fff; color: var(--ng-ink); font: inherit; cursor: pointer; }
.nonogram-game button:hover:not(:disabled), .nonogram-game select:hover { border-color: var(--ng-green); background: #f3f7f1; }
.nonogram-game button:focus-visible, .nonogram-game select:focus-visible, .nonogram-game:focus-visible { outline: 3px solid #bb812a; outline-offset: 2px; }
.nonogram-game button:disabled { opacity: .48; cursor: not-allowed; }
.nonogram-game .ng-modes [aria-pressed="true"] { border-color: var(--ng-green); background: #dce9df; box-shadow: inset 0 0 0 1px var(--ng-green); }
.nonogram-game .ng-rewards { margin: .6rem 0 1rem; color: var(--ng-muted); font-size: .85rem; }
.nonogram-game .ng-play-area { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 220px); align-items: start; gap: 1.25rem; }
.nonogram-game .ng-puzzle { --ng-cell-size: clamp(38px, min(4vw, 5.4vh), 52px); display: grid; grid-template-columns: minmax(64px, auto) repeat(var(--ng-width), minmax(0, var(--ng-cell-size))); grid-template-rows: minmax(72px, auto) repeat(var(--ng-height), var(--ng-cell-size)); width: max-content; max-width: 100%; margin: 0 auto; overflow: auto; border: 1px solid #aebdb4; border-radius: 8px; background: #fff; }
.nonogram-game .ng-corner { border-right: 2px solid #829991; border-bottom: 2px solid #829991; background: #edf1e9; }
.nonogram-game .ng-column-clue, .nonogram-game .ng-row-clue { display: flex; align-items: center; justify-content: center; gap: .16rem; color: #455d58; font-size: clamp(.66rem, 1.1vw, .82rem); font-weight: 700; }
.nonogram-game .ng-column-clue { flex-direction: column; align-self: stretch; border-right: 1px solid var(--ng-line); border-bottom: 2px solid #829991; padding: 3px 0; }
.nonogram-game .ng-row-clue { border-right: 2px solid #829991; border-bottom: 1px solid var(--ng-line); padding: 0 7px; }
.nonogram-game .ng-column-clue.is-current-line, .nonogram-game .ng-row-clue.is-current-line { background: #e6eee3; color: #24483e; }
.nonogram-game .ng-cell { display: grid; place-items: center; min-width: 0 !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; border-right: 1px solid #ccd5ce !important; border-bottom: 1px solid #ccd5ce !important; border-radius: 0 !important; background: #fff !important; color: var(--ng-ink) !important; font-size: clamp(.9rem, 2vw, 1.35rem) !important; font-weight: 800 !important; line-height: 1 !important; }
.nonogram-game .ng-cell.is-current-line { background: #f0f4eb !important; }
.nonogram-game .ng-cell.is-filled { background: #385e55 !important; color: white !important; }
.nonogram-game .ng-cell.is-marked { color: #a45142 !important; background: #fff9f4 !important; }
.nonogram-game .ng-cell.is-selected { position: relative; z-index: 1; box-shadow: inset 0 0 0 3px #c58629 !important; }
.nonogram-game .ng-cell:focus-visible { outline: 3px solid #9c6821 !important; outline-offset: -3px; }
.nonogram-game .ng-cell:disabled { opacity: .88; cursor: default; }
.nonogram-game .ng-side { padding: .8rem; border-radius: 12px; background: #edf1e9; color: var(--ng-muted); }
.nonogram-game .ng-selection { margin: 0 0 .6rem; color: var(--ng-ink); font-weight: 700; }
.nonogram-game .ng-side-help, .nonogram-game .ng-help { margin: 0; font-size: .88rem; color: var(--ng-muted); }
.nonogram-game .ng-status { min-height: 1.5em; margin: .8rem 0 .5rem; color: var(--ng-ink); font-weight: 700; }
.nonogram-game .ng-status.is-success { color: #246346; }
.nonogram-game .ng-status.is-paused { color: #855b21; }
.nonogram-game .ng-help { color: var(--ng-muted); }
.nonogram-game .ng-dialog { width: min(92vw, 460px); padding: 1.25rem; border: 1px solid #aebdb4; border-radius: 16px; color: var(--ng-ink); background: var(--ng-paper); box-shadow: 0 15px 55px #172a2750; }
.nonogram-game .ng-dialog::backdrop { background: #1525238a; }
.nonogram-game .ng-dialog h3 { margin: 0 0 .4rem; font: 700 1.45rem Georgia, serif; }
.nonogram-game .ng-dialog p { color: var(--ng-muted); }
.nonogram-game .ng-dialog label { display: grid; gap: .25rem; margin: .8rem 0; font-weight: 700; }
.nonogram-game .ng-dialog-actions { justify-content: flex-end; margin-top: 1rem; }
@media (max-width: 760px) {
  .nonogram-game .ng-heading { align-items: flex-start; }
  .nonogram-game .ng-play-area { grid-template-columns: minmax(0, 1fr); container-type: inline-size; }
  .nonogram-game .ng-side { display: flex; gap: .75rem; }
  .nonogram-game .ng-puzzle { --ng-cell-size: clamp(27px, min(7vw, 4vh), 36px); grid-template-columns: 48px repeat(var(--ng-width), var(--ng-cell-size)); grid-template-rows: minmax(64px, auto) repeat(var(--ng-height), var(--ng-cell-size)); }
}
@media (max-width: 560px) {
  .nonogram-game .ng-shell { padding: 12px; }
  .nonogram-game .ng-heading { display: block; }
  .nonogram-game .ng-memory { max-width: none; margin-top: .4rem; text-align: left; }
  .nonogram-game .ng-puzzle { --ng-cell-size: min(32px, calc((100cqi - 44px) / var(--ng-width))); grid-template-columns: 42px repeat(var(--ng-width), var(--ng-cell-size)); grid-template-rows: minmax(58px, auto) repeat(var(--ng-height), var(--ng-cell-size)); }
  .nonogram-game .ng-actions { width: 100%; }
  .nonogram-game .ng-actions button { flex: 1; }
}
@media (max-height: 950px) and (min-width: 761px) {
  .nonogram-game .ng-shell { padding-block: 12px; }
  .nonogram-game .ng-heading { justify-content: flex-end; }
  .nonogram-game .ng-heading > div { display: none; }
  .nonogram-game .ng-memory { max-width: none; font-size: .72rem; }
  .nonogram-game .ng-instructions { font-size: .8rem; line-height: 1.35; }
  .nonogram-game .ng-readouts, .nonogram-game .ng-toolbar { font-size: .8rem; gap: .4rem; }
  .nonogram-game .ng-rewards { margin-block: .35rem; }
  .nonogram-game .ng-status { margin-block: .35rem; }
  .nonogram-game .ng-instructions { margin-block: .45rem .65rem; }
}
@media (prefers-reduced-motion: reduce) { .nonogram-game *, .nonogram-game *::before, .nonogram-game *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
