/* Grow the stage with the window, keeping its aspect ratio on screen. */
.nw-header,
.nw {
  max-width: max(64rem, min(100%, calc((100vh - 9rem) * 1000 / 560 + 2rem)));
}

.nw {
  margin: 0 auto;
  padding: 0 1rem 2rem;
  -webkit-user-select: none;
  user-select: none;
}

.nw-stage {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.nw-stage canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1000 / 560;
  touch-action: manipulation;
}

/* Fullscreen: letterbox the canvas at its aspect ratio. */
.nw-stage:fullscreen {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
}

.nw-stage:fullscreen canvas {
  width: min(100vw, 178.57vh);
}

.nw-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.nw-overlay {
  position: absolute;
  inset: 0;
  display: none;
  padding: 1rem;
  background: rgb(10 4 24 / 0.84);
  color: #fff;
  text-align: center;
  overflow-y: auto;
}

.nw-overlay.open {
  display: flex;
}

/* margin: auto centres the page but still lets a tall one scroll. */
.nw-overlay > * {
  margin: auto;
  max-width: 52rem;
}

/* On small screens the menus get the whole viewport to breathe. */
@media (max-width: 40rem) {
  .nw-overlay.open {
    position: fixed;
    z-index: 50;
    background: rgb(10 4 24 / 0.94);
  }
}

.nw-overlay h2 {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  margin: 0 0 0.25rem;
}

.nw-overlay p {
  margin: 0.25rem 0 0.75rem;
  color: #e7e5e4;
}

.nw-overlay .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.nw-overlay button {
  font: inherit;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  background: #fff;
  color: #1c1917;
  border: 0;
  border-radius: 0.5rem;
  cursor: pointer;
}

.nw-overlay button.primary {
  background: var(--accent);
  color: #fff;
}

.nw-overlay .help {
  font-size: 0.85rem;
  color: #d6d3d1;
}

.nw-overlay button[aria-pressed='true'] {
  background: #c4b5fd;
}

.nw-overlay .nw-gift {
  color: #fde047;
  font-weight: 600;
}

.nw-album {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.6rem;
  margin: 0.75rem 0;
}

.nw-album figure {
  position: relative;
  margin: 0;
}

.nw-album img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.nw-album span {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  padding: 0 0.4rem;
  border-radius: 1rem;
  background: #fde047;
  color: #1c1917;
  font-size: 0.75rem;
  font-weight: 700;
}

.nw-ach {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.nw-ach li {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: rgb(255 255 255 / 0.06);
  color: #a8a29e;
}

.nw-ach li.got {
  background: rgb(253 224 71 / 0.14);
  color: #fef3c7;
}

.nw-ach b {
  display: block;
}

.nw-ach li.got b {
  color: #fde047;
}

.nw-ach span {
  font-size: 0.85rem;
}
