/* Number Memory playfield (Phase 5, inside the shared game shell). */
.nm-stage { display: flex; flex-direction: column; gap: var(--rb-space-3); height: calc(var(--rb-stage-height) + 52px); }
.nm-display {
    position: relative; display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; align-items: center; justify-content: center; gap: var(--rb-space-2);
    padding: var(--rb-space-5) var(--rb-space-4) var(--rb-space-6);
    border: 1px solid var(--rb-border); border-radius: var(--rb-radius-lg);
    background: radial-gradient(ellipse at 50% 0%, var(--rb-surface-violet), transparent 70%), var(--rb-surface-soft);
    text-align: center;
}
.nm-display__value { max-width: 100%; color: var(--rb-primary); font-size: clamp(2.25rem, 1.6rem + 4vw, 4rem); font-weight: var(--rb-fw-extrabold); letter-spacing: .06em; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.nm-display__value.is-correct { color: var(--rb-success); }
.nm-display__value.is-reveal { color: var(--rb-text); }
.nm-display__value .is-diff { border-radius: 6px; background: var(--rb-danger-bg); color: var(--rb-danger); box-shadow: inset 0 -3px 0 var(--rb-danger); }
.nm-display__caption { color: var(--rb-text-secondary); font-size: var(--rb-fs-sm); font-weight: var(--rb-fw-semibold); }
.nm-timer { position: absolute; right: var(--rb-space-5); bottom: var(--rb-space-3); left: var(--rb-space-5); height: 6px; overflow: hidden; border-radius: var(--rb-radius-pill); background: color-mix(in srgb, var(--rb-primary) 12%, transparent); }
.nm-timer__bar { display: block; height: 100%; border-radius: inherit; background: var(--rb-brand-gradient); transform: scaleX(0); transform-origin: left center; }

/* Setting (start state) and answer form (playing) share one slot of fixed height. */
.nm-slot { display: grid; min-height: 112px; }
.nm-setup, .nm-answer { grid-area: 1 / 1; margin: 0; }
.rb-game:not([data-state="start"]) .nm-setup { display: none; }
.nm-setup { min-width: 0; padding: 0; border: 0; }
.nm-setup__legend { margin-bottom: var(--rb-space-2); color: var(--rb-text); font-size: var(--rb-fs-sm); font-weight: var(--rb-fw-semibold); }
.nm-setup__options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--rb-space-2); }
.nm-option { position: relative; display: block; cursor: pointer; }
.nm-option input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.nm-option span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; padding: .375rem; border: 1px solid var(--rb-border-strong); border-radius: var(--rb-radius-sm); background: var(--rb-surface); color: var(--rb-text); font-weight: var(--rb-fw-bold); line-height: 1.2; text-align: center; }
.nm-option small { color: var(--rb-text-secondary); font-size: var(--rb-fs-xs); font-weight: var(--rb-fw-semibold); }
.nm-option input:checked + span { border: 2px solid var(--rb-primary); background: var(--rb-primary-soft); color: var(--rb-primary); }
.nm-option input:focus-visible + span { outline: 3px solid var(--rb-focus-ring); outline-offset: 2px; }
.nm-answer { display: flex; flex-direction: column; gap: var(--rb-space-2); }
.nm-answer[hidden] { display: none; }
.nm-answer__row { display: flex; gap: var(--rb-space-2); }
.nm-answer__input { flex: 1 1 auto; min-width: 0; font-size: 1.375rem; font-weight: var(--rb-fw-bold); letter-spacing: .12em; text-align: center; font-variant-numeric: tabular-nums; }
.nm-answer__submit { flex: 0 0 auto; }
.nm-feedback { min-height: 1.5em; margin: 0; color: var(--rb-text-secondary); font-size: var(--rb-fs-sm); text-align: center; }
@media (prefers-reduced-motion: reduce) { .nm-timer__bar { transition: none !important; } }
