.nb-game {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr);
  align-items: start;
  gap: 2.5rem;
}

.nb-screen-wrap {
  position: relative;
}

/* The applet is drawn at 336×352, so zoom scales it up */
.nb-screen {
  width: 336px;
  height: 352px;
  zoom: 2;
  background: #000;
  border: 1px solid var(--border);
}

/* Keep the old pixel art crisp instead of blurry when it's scaled up */
.nb-screen canvas {
  image-rendering: pixelated;
}

/* Clicks go through to the game, which only takes keys after it's been clicked */
.nb-start {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  margin: 0;
  padding: 0.5rem 1rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  animation: nb-pulse 1.5s ease-in-out infinite alternate;
  z-index: 1;
}

.nb-start.is-hidden {
  display: none;
}

@keyframes nb-pulse {
  to { opacity: 0.6; }
}

.nb-panel h2 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.1rem;
}

.nb-panel p {
  margin: 0 0 0.75rem;
}

.nb-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.nb-hint,
.nb-credits {
  color: var(--muted);
  font-size: 0.9rem;
}

.nb-panel details {
  margin-bottom: 1.5rem;
}

.nb-panel summary {
  cursor: pointer;
  font-weight: 600;
}

.nb-panel details p {
  margin-top: 0.5rem;
}

.nb-key {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.nb-key:hover kbd {
  border-color: var(--muted);
  color: var(--accent-text);
}

.nb-passwords {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nb-passwords li {
  margin-bottom: 0.35rem;
}

.nb-password {
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-raised);
  color: var(--accent-text);
  font-family: var(--mono);
  font-size: 0.9rem;
  cursor: pointer;
}

.nb-password:hover {
  border-color: var(--muted);
}

/* Stack the panel under the game, then shrink the game to fit */
@media (max-width: 1000px) {
  .nb-game {
    grid-template-columns: 1fr;
  }

  .nb-screen-wrap {
    justify-self: center;
  }
}

@media (max-width: 740px) {
  .nb-screen {
    zoom: 1.5;
  }
}

@media (max-width: 560px) {
  .nb-screen {
    zoom: 1;
  }
}
