/* Number Memory */
.g-number-memory [hidden] { display: none !important; }

.g-number-memory .nm-levelbar { margin: 0 0 10px; gap: 10px; flex-wrap: nowrap; }
.g-number-memory .nm-levelbar .pz-btn { flex: none; min-width: 44px; min-height: 44px; padding: 4px 10px; font-size: 1.3rem; line-height: 1; }
.g-number-memory .nm-leveltitle { display: flex; flex-direction: column; align-items: center; flex: 1 1 auto; min-width: 0; line-height: 1.25; text-align: center; }
.g-number-memory .nm-leveltitle strong { font-size: 1.1rem; font-weight: 900; }
.g-number-memory .nm-leveltitle span { font-size: .8rem; font-weight: 700; color: var(--muted); }

.g-number-memory .nm-status { margin: 0 0 10px; font-weight: 800; color: var(--text); }
.g-number-memory .nm-help { font-size: .85rem; margin: 12px 0 0; }

/* the display: start panel, countdown, the number, typed digits, feedback */
.g-number-memory .nm-panel {
  position: relative; overflow: hidden; max-width: 420px; margin: 0 auto 12px; min-height: 190px;
  display: flex; flex-direction: column; align-items: stretch; justify-content: center;
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 16px;
}
.g-number-memory .nm-screen {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 16px 10px 18px; text-align: center; min-width: 0;
}
.g-number-memory .nm-ov-title { font-weight: 900; font-size: 1.35rem; line-height: 1.15; }
.g-number-memory .nm-ov-sub { color: var(--muted); font-weight: 700; font-size: .9rem; line-height: 1.35; max-width: 32ch; }
.g-number-memory .nm-start { margin-top: 6px; min-width: 140px; min-height: 52px; font-size: 1.1rem; }
.g-number-memory .nm-continue { margin-top: 8px; min-width: 140px; min-height: 48px; }
.g-number-memory .nm-countdown { font-size: 4.5rem; font-weight: 900; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.g-number-memory .nm-wait { font-size: 1.5rem; font-weight: 900; color: var(--muted); }
.g-number-memory .nm-cap { font-size: .78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; line-height: 1.3; }
.g-number-memory .nm-cap.nm-count { font-variant-numeric: tabular-nums; }
.g-number-memory .nm-cap.nm-good { color: var(--good); font-size: .95rem; }

.g-number-memory .nm-num {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: .1em .5em; max-width: 100%;
  font-family: var(--mono); font-weight: 800; font-size: 2.6rem; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--text);
}
.g-number-memory .nm-num.nm-flat { gap: .1em 0; }
.g-number-memory .nm-num.nm-m { font-size: 1.9rem; }
.g-number-memory .nm-num.nm-s { font-size: 1.45rem; }
.g-number-memory .nm-num.nm-xs { font-size: 1.25rem; }
.g-number-memory .nm-group { display: inline-flex; white-space: nowrap; }
.g-number-memory .nm-d { display: inline-block; min-width: .68em; text-align: center; }
.g-number-memory .nm-d.blank { color: var(--muted); opacity: .6; }
.g-number-memory .nm-d.cur { opacity: 1; box-shadow: 0 3px 0 var(--accent); }
/* differing digits: colour plus an underline bar */
.g-number-memory .nm-d.bad { color: var(--bad); box-shadow: 0 4px 0 var(--bad); }

.g-number-memory .nm-timebar { height: 6px; background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); }
.g-number-memory .nm-timebar i { display: block; height: 100%; width: 0; background: var(--accent); }

/* number pad */
.g-number-memory .nm-pad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 340px; margin: 0 auto; }
.g-number-memory .nm-key {
  appearance: none; -webkit-appearance: none; min-width: 0; min-height: 58px; padding: 0; margin: 0;
  border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text);
  font: inherit; font-weight: 900; font-size: 1.45rem; line-height: 1; font-variant-numeric: tabular-nums;
  display: grid; place-items: center; cursor: pointer; transition: transform .06s, background-color .1s, border-color .1s;
}
.g-number-memory .nm-key:active { transform: scale(.96); background: var(--surface-2); }
.g-number-memory .nm-key.nm-back { background: var(--surface-2); font-size: 1.3rem; }
.g-number-memory .nm-key.nm-ok { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-size: 1.15rem; }
.g-number-memory .nm-pad.off .nm-key { opacity: .45; cursor: default; }
.g-number-memory .nm-pad.off .nm-key:active { transform: none; }

@media (min-width: 480px) {
  .g-number-memory .nm-key { min-height: 62px; }
  .g-number-memory .nm-num.nm-m { font-size: 2.3rem; }
  .g-number-memory .nm-num.nm-s { font-size: 1.9rem; }
  .g-number-memory .nm-num.nm-xs { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .g-number-memory .nm-key { transition: none; }
  .g-number-memory .nm-key:active { transform: none; }
  .g-number-memory .nm-timebar { display: none; }
}
