/* Nonogram */
.ng-wrap { overflow-x: auto; padding: 4px 0 8px; }
.ng-grid { --cell: min(36px, calc((100vw - 120px) / (var(--n) + 4))); display: grid; width: max-content; margin: 0 auto; touch-action: none; user-select: none; -webkit-user-select: none; font-size: clamp(11px, calc(var(--cell) * .42), 15px); }
.ng-clue { display: flex; color: var(--fg); font-family: var(--font-display); font-weight: 700; }
.ng-clue.col { flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 6px; gap: 2px; }
.ng-clue.row { justify-content: flex-end; align-items: center; padding-right: 8px; gap: 6px; }
.ng-clue.done { color: var(--dim); opacity: .55; }
.ng-cell {
  width: var(--cell); height: var(--cell); padding: 0; border: 0; cursor: pointer; position: relative;
  background: var(--c-bg); box-shadow: inset 0 0 0 .5px var(--line), inset -1px -1px 0 color-mix(in srgb, var(--line) 80%, transparent);
  -webkit-tap-highlight-color: transparent;
}
.ng-cell.ve { box-shadow: inset 0 0 0 .5px var(--line), inset -2px 0 0 var(--fg); }
.ng-cell.he { box-shadow: inset 0 0 0 .5px var(--line), inset 0 -2px 0 var(--fg); }
.ng-cell.ve.he { box-shadow: inset 0 0 0 .5px var(--line), inset -2px -2px 0 var(--fg); }
.ng-cell:hover { background: color-mix(in srgb, var(--a3) 18%, var(--c-bg)); }
.ng-cell.fill { background: var(--accent, var(--a3)); }
.ng-cell.cross::before, .ng-cell.cross::after { content: ""; position: absolute; left: 22%; right: 22%; top: 50%; height: 2px; background: var(--dim); transform: rotate(45deg); }
.ng-cell.cross::after { transform: rotate(-45deg); }
.ng-grid.solved .ng-cell.fill { animation: ng-pop .5s ease both; }
@keyframes ng-pop { 40% { transform: scale(1.12); } }
#ng-mode.on { background: var(--a1); color: var(--on-accent); }

[data-theme="retro"] .ng-clue { font-weight: 400; font-size: .75em; color: var(--a2); }
[data-theme="retro"] .ng-clue.done { color: var(--dim); }
[data-theme="retro"] .ng-cell { background: #000; box-shadow: inset 0 0 0 1px #2e2858; }
[data-theme="retro"] .ng-cell.ve { box-shadow: inset 0 0 0 1px #2e2858, inset -2px 0 0 var(--a5); }
[data-theme="retro"] .ng-cell.he { box-shadow: inset 0 0 0 1px #2e2858, inset 0 -2px 0 var(--a5); }
[data-theme="retro"] .ng-cell.ve.he { box-shadow: inset 0 0 0 1px #2e2858, inset -2px -2px 0 var(--a5); }
[data-theme="retro"] .ng-cell.fill { background: var(--a3); box-shadow: inset 0 0 0 2px #000; }
[data-theme="retro"] .ng-cell.cross::before, [data-theme="retro"] .ng-cell.cross::after { background: var(--a1); }

[data-theme="doodle"] .ng-clue { font-family: var(--font-body); font-weight: 400; font-size: 1.15em; }
[data-theme="doodle"] .ng-clue.done { text-decoration: line-through var(--a1) 2px; opacity: .6; }
[data-theme="doodle"] .ng-grid { filter: none; }
[data-theme="doodle"] .ng-cell { box-shadow: inset 0 0 0 .5px #b9c6de; }
[data-theme="doodle"] .ng-cell.ve { box-shadow: inset 0 0 0 .5px #b9c6de, inset -2px 0 0 var(--line); }
[data-theme="doodle"] .ng-cell.he { box-shadow: inset 0 0 0 .5px #b9c6de, inset 0 -2px 0 var(--line); }
[data-theme="doodle"] .ng-cell.ve.he { box-shadow: inset 0 0 0 .5px #b9c6de, inset -2px -2px 0 var(--line); }
[data-theme="doodle"] .ng-cell.fill { background: repeating-linear-gradient(-50deg, var(--line) 0 2px, #3b4a72 2px 3.5px); border-radius: 2px 4px 3px 5px; }
[data-theme="doodle"] .ng-cell.cross::before, [data-theme="doodle"] .ng-cell.cross::after { background: var(--a1); height: 2.5px; border-radius: 2px; }
