/* ninegrid: styles for this game only (loaded after /css/core.css). */
.ng-grid {
  display: grid; grid-template-columns: repeat(9, minmax(0, 1fr));
  width: 100%; max-width: 520px; margin: 0 auto; aspect-ratio: 1;
  border: 3px solid var(--text); border-radius: 12px; overflow: hidden; background: var(--surface);
}
.ng-cell {
  position: relative; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--surface); color: var(--text); padding: 0; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: clamp(18px, 5.4vw, 30px);
  display: flex; align-items: center; justify-content: center; min-width: 0;
}
.ng-cell:nth-child(9n) { border-right: 0; }
.ng-cell:nth-child(n+73) { border-bottom: 0; }
.ng-cell.br { border-right: 2px solid var(--text); }
.ng-cell.bb { border-bottom: 2px solid var(--text); }
.ng-cell.given { font-weight: 800; }
.ng-cell.user { color: var(--select); }
.ng-cell.peer { background: color-mix(in srgb, var(--select) 7%, var(--surface)); }
.ng-cell.same { background: color-mix(in srgb, var(--select) 18%, var(--surface)); }
.ng-cell.sel { background: color-mix(in srgb, var(--select) 30%, var(--surface)); box-shadow: inset 0 0 0 2px var(--select); }
.ng-cell.clash { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, var(--surface)); }
.ng-cell.wave { animation: wave .5s ease; }
.ng-notes { position: absolute; inset: 2px; display: grid; grid-template-columns: repeat(3, 1fr); font-size: clamp(8px, 2vw, 11px); font-weight: 700; color: var(--muted); font-family: var(--body); }
.ng-notes i { font-style: normal; display: flex; align-items: center; justify-content: center; }
.ng-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 520px; margin: 0 auto 10px; }
.ng-tools .btn { min-height: 44px; padding: 0 6px; font-size: 15px; }
#ng-notes[aria-pressed="true"] { background: var(--select); color: var(--surface); border-color: var(--select); }
.ng-pad { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 5px; max-width: 520px; margin: 0 auto; }
.ng-key {
  position: relative; height: 56px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-family: var(--display); font-size: 24px; font-weight: 800; cursor: pointer; padding: 0; box-shadow: 0 2px 0 var(--line); touch-action: manipulation;
}
.ng-key small { position: absolute; top: 3px; right: 5px; font-size: 10px; font-family: var(--body); color: var(--muted); font-weight: 700; }
.ng-key.done { opacity: .3; }
.ng-pad.notes .ng-key span { font-size: 16px; color: var(--muted); }
.ng-key:hover { border-color: var(--select); }
@media (prefers-reduced-motion: reduce) {
  .ng-cell.wave { animation: none; }
}
.ng-grid { border: 0; padding: 8px; gap: 0; background: var(--tray); box-shadow: 0 10px 0 var(--tray-edge), 0 24px 40px rgba(20, 33, 58, .25); border-radius: 18px; overflow: visible; }
.ng-cell { border: 0; background: var(--tile-top); margin: 2px; border-radius: 7px; box-shadow: 0 2px 0 var(--tile-edge); color: var(--tile-ink); }
.ng-cell.br { margin-right: 6px; border: 0; }
.ng-cell.bb { margin-bottom: 6px; border: 0; }
.ng-cell.given { background: linear-gradient(180deg, #E4E9F5, #D6DDEE); }
.ng-cell.user { color: var(--select); }
.ng-cell.peer { background: color-mix(in srgb, var(--select) 12%, #F4F6FB); }
.ng-cell.same { background: color-mix(in srgb, var(--select) 26%, #F4F6FB); }
.ng-cell.sel { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 0 #C99A14, 0 0 0 2px #fff inset; transform: translateY(-2px); }
.ng-cell.clash { color: #fff; background: linear-gradient(180deg, #F0646A, #E5484D); }
.ng-notes { color: var(--muted); }
.ng-grid { gap: 3px; grid-template-rows: repeat(9, minmax(0, 1fr)); }
.ng-cell, .ng-cell.br, .ng-cell.bb { margin: 0; }
.ng-cell.boxalt:not(.sel):not(.peer):not(.same):not(.clash) { background: linear-gradient(180deg, #F3EEDD, #E9E2CB); }
