/* N-back 기억 테스트 전용. 판은 늘 진한 남색 바탕 + 흰 칸이라 밝은/어두운 화면 모두 같은 대비를 쓴다. */
.nb {
  --nb-bg: #27348f;
  --nb-cell: rgba(255, 255, 255, 0.13);
  --nb-ok: #1fd19b;
  --nb-bad: #ff4d5e;
  margin-top: 10px;
}

.nb-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 8px;
  font-variant-numeric: tabular-nums;
}
.nb-top p {
  margin: 0;
  color: var(--muted);
}
.nb-top span {
  font-size: 0.88rem;
  font-weight: 600;
}
.nb-top b {
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 800;
}
.nb-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 12px;
}
.nb-progress span {
  display: block;
  height: 100%;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

.nb-board {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(280px, 46vh, 400px);
  padding: clamp(14px, 3vw, 24px);
  border-radius: 26px;
  background: var(--nb-bg);
  color: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.nb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 2.4vw, 14px);
  width: min(100%, 340px);
  aspect-ratio: 1;
}
.nb-cell {
  border-radius: 18px;
  background: var(--nb-cell);
  transition: background-color 0.08s ease, transform 0.08s ease, box-shadow 0.12s ease;
}
.nb-cell.on {
  background: #fff;
  transform: scale(0.96);
}
.nb-cell.on.ok {
  box-shadow: 0 0 0 5px var(--nb-ok);
}
.nb-cell.on.bad {
  box-shadow: 0 0 0 5px var(--nb-bad);
}

.nb-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  background: var(--nb-bg);
  color: #fff;
}
.nb-cover[hidden] {
  display: none;
}
.nb-cover-icon {
  font-size: 2.6rem;
  line-height: 1;
}
.nb-cover-title {
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.nb-cover-sub {
  font-size: 1rem;
  opacity: 0.92;
  max-width: 24em;
}
.nb-cover-btn {
  margin-top: 10px;
  min-width: 160px;
  background: #fff;
  color: #1d2a7a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.nb-cover-btn:focus-visible {
  outline-color: #fff;
}

.nb-same {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 72px;
  margin-top: 14px;
  border-radius: 20px;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow);
  transition: transform 0.08s ease, border-color 0.12s ease, background-color 0.12s ease;
}
.nb-same:not(:disabled):hover {
  border-color: var(--brand);
}
.nb-same:disabled {
  opacity: 0.55;
  cursor: default;
}
.nb-same.press {
  transform: scale(0.97);
}
.nb-same.ok {
  border-color: var(--nb-ok);
}
.nb-same.bad {
  border-color: var(--nb-bad);
}
.nb-same kbd {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
@media (hover: none) {
  .nb-same kbd {
    display: none;
  }
}
.nb-msg {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  min-height: 1.6em;
  margin: 10px 0 0;
}
.nb .mine-list time {
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .nb-cell,
  .nb-same,
  .nb-progress span {
    transition: none;
  }
}
