/* Grow with the window at the canvas's 1000:560 shape. */
.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;
  /* The map handles its own pinch-zoom and drag-pan. */
  touch-action: none;
}

/* 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;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgb(0 0 0 / 0.6);
  color: #fff;
  text-align: center;
  overflow-y: auto;
}

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

.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;
}

/* Nameless Nuke: a war-room look. */
.nw-stage {
  background: #030814;
}

.nw-overlay {
  background: rgb(2 6 16 / 0.82);
}

.nw-overlay button.primary {
  background: #0284c7;
}

.nk-panel {
  width: 100%;
  max-width: 40rem;
  margin: auto;
}

.nk-opt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.45rem 0;
}

.nk-opt span {
  width: 100%;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nw-overlay .nk-opt button {
  padding: 0.35rem 0.75rem;
  background: rgb(56 189 248 / 0.1);
  color: #e2e8f0;
  border: 1px solid rgb(56 189 248 / 0.35);
}

.nw-overlay .nk-opt button.on {
  background: #38bdf8;
  color: #020617;
}

.nk-table {
  margin: 0.5rem auto;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.nk-table th,
.nk-table td {
  padding: 0.2rem 0.6rem;
  text-align: left;
}

.nk-table th {
  color: #94a3b8;
  font-weight: 600;
  border-bottom: 1px solid rgb(56 189 248 / 0.3);
}

.nk-sub {
  margin: 0.9rem 0 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nk-results {
  max-width: 44rem;
}

.nk-scroll {
  overflow-x: auto;
}

.nk-chart {
  display: block;
  width: 100%;
  max-width: 35rem;
  height: auto;
  margin: 0 auto;
  background: rgb(15 23 42 / 0.6);
  border: 1px solid rgb(56 189 248 / 0.2);
  border-radius: 0.5rem;
}

.nk-events {
  list-style: none;
  margin: 0.25rem auto;
  padding: 0;
  max-width: 34rem;
  max-height: 14rem;
  overflow-y: auto;
  text-align: left;
  font-size: 0.82rem;
}

.nk-events li {
  display: flex;
  gap: 0.6rem;
  padding: 0.15rem 0;
  border-bottom: 1px solid rgb(56 189 248 / 0.08);
}

.nk-events time {
  flex: none;
  width: 2.6rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.nk-log {
  margin: 0.8rem auto 0;
  max-width: 34rem;
}

.nk-log summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
}
