/* Neuriosity — N-Back playfield.
   Shared chrome lives in ../_shared/game-kit.css */

.nb-game .neu-status:empty { display: none; }

/* The letter stream. Big, because it has to be read at a glance while the
   grid is being watched at the same time — and it doubles as the count-in. */
.nb-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  flex: 0 0 auto;
  height: calc(var(--gu) * 13);
  min-width: calc(var(--gu) * 16);
  padding: 0 calc(var(--gu) * 3);
  color: #2d0a91;
  font-size: calc(var(--gu) * 9);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  background: #fff;
  border: calc(var(--gu) * 0.35) solid rgba(45, 10, 145, 0.18);
  border-radius: calc(var(--gu) * 1.6);
}

/* ---------- the position stream ---------- */

.nb-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
}

/* Nothing on the grid is tapped, so it can be sized to be READ rather than
   to be hit — which is what leaves room for two thumb-sized keys below. */
.nb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: calc(var(--gu) * 0.9);
  height: 100%;
  aspect-ratio: 1;
  padding: calc(var(--gu) * 0.9);
  background: #fff;
  border: calc(var(--gu) * 0.35) solid rgba(45, 10, 145, 0.18);
  border-radius: calc(var(--gu) * 1.6);
}

.nb-cell {
  display: block;
  min-width: 0;
  min-height: 0;
  background: #eef0f7;
  border-radius: calc(var(--gu) * 0.6);
}

.nb-cell.is-lit { background: #2d0a91; }

@media (prefers-reduced-motion: no-preference) {
  .nb-cell { transition: background 90ms linear; }
}

/* ---------- the two answers ---------- */

.nb-keys {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: calc(var(--gu) * 2);
  flex: 0 0 auto;
  width: 100%;
  max-width: calc(var(--gu) * 80);
}

.nb-key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--gu) * 0.2);
  flex: 1 1 0;
  min-height: 44px;
  padding: calc(var(--gu) * 1.2) calc(var(--gu) * 1);
  color: var(--navy, #062b63);
  font: inherit;
  background: #fff;
  border: calc(var(--gu) * 0.4) solid rgba(45, 10, 145, 0.24);
  border-radius: calc(var(--gu) * 1.6);
  cursor: pointer;
}

.nb-key b {
  font-size: calc(var(--gu) * 3.6);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.nb-key span {
  color: var(--ink-soft, #526b8e);
  font-size: calc(var(--gu) * 2.3);
  font-weight: 600;
}

.nb-key:disabled { opacity: 0.45; cursor: default; }
.nb-key:not(:disabled):hover { border-color: #2d0a91; }
.nb-key:focus-visible { outline: calc(var(--gu) * 0.5) solid #2d0a91; outline-offset: calc(var(--gu) * 0.2); }

.nb-key.is-right { background: rgba(14, 168, 90, 0.18); border-color: var(--green, #0ea85a); }
.nb-key.is-wrong { background: rgba(241, 95, 109, 0.18); border-color: var(--coral, #f15f6d); }
