:root {
  --scene-edge-padding: 1em;
}

html,
body {
  margin: 0;
  overflow: hidden;
  background: #000000;
}

#scene,
#scene-present,
#minimap {
  position: fixed;
  inset: var(--scene-edge-padding) auto auto var(--scene-edge-padding);
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#scene {
  background: #000000;
  touch-action: none;
}

#scene-present {
  background: #000000;
  pointer-events: none;
}

#minimap {
  background: transparent;
  box-sizing: content-box;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.perf-debug {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  display: grid;
  gap: 4px;
  justify-items: end;
  color: #74acef;
}

.perf-debug[hidden] {
  display: none;
}

.perf-debug-copy {
  box-sizing: border-box;
  height: 22px;
  padding: 0 8px;
  border: 1px solid currentColor;
  color: inherit;
  background: rgba(0, 0, 0, 0.86);
  font: 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0;
  cursor: pointer;
}

.perf-debug-copy:active {
  background: currentColor;
  color: #000000;
}

.perf-debug-panel {
  min-width: 190px;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid currentColor;
  color: inherit;
  background: rgba(0, 0, 0, 0.86);
  font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0;
  white-space: pre;
}

.talk-input {
  position: fixed;
  left: -1000px;
  top: -1000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body.mapgen-active {
  overflow: auto;
}

body.mapgen-active #scene,
body.mapgen-active #scene-present,
body.mapgen-active #minimap {
  display: none;
}

html.controller-pointer-hidden,
html.controller-pointer-hidden body,
html.controller-pointer-hidden #scene,
html.controller-pointer-hidden #scene-present,
html.controller-pointer-hidden #minimap {
  cursor: none;
}

.mapgen-panel {
  min-height: 100%;
  box-sizing: border-box;
  padding: 14px;
  color: #d7e8ef;
  background: #050608;
  font: 12px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.mapgen-controls {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  padding: 0 0 12px;
  background: #050608;
}

.mapgen-controls label {
  display: grid;
  gap: 3px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.mapgen-controls input,
.mapgen-controls button {
  box-sizing: border-box;
  height: 28px;
  border: 1px solid #5d7480;
  border-radius: 0;
  color: #d7e8ef;
  background: #10151a;
  font: inherit;
}

.mapgen-controls input {
  width: 92px;
  padding: 3px 6px;
}

#mapgen-seed {
  width: 180px;
}

.mapgen-controls button {
  padding: 3px 10px;
  cursor: pointer;
}

.mapgen-controls button:hover {
  color: #050608;
  background: #d7e8ef;
}

#mapgen-preview {
  display: block;
  width: min(768px, 100%);
  height: auto;
  border: 1px solid #5d7480;
  background: #000000;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.mapgen-stats {
  max-width: 768px;
  margin: 10px 0 0;
  white-space: pre-wrap;
}
