@charset "utf-8";

:root {
  color-scheme: dark;
  --page: #101112;
  --panel: #202326;
  --panel-strong: #2f3337;
  --text: #f3f0df;
  --muted: #b8b2a0;
  --accent: #9bcf60;
  --line: #4a4f54;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at top, #293038 0, var(--page) 44rem);
  color: var(--text);
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
}

a {
  color: var(--accent);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100% - 24px, 720px);
  margin: 32px auto;
}

.masthead {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.masthead img {
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.map-stage {
  position: relative;
  width: min(100%, 640px);
  aspect-ratio: 4 / 3;
  margin: 0 auto 18px;
  border: 1px solid var(--line);
  background: #111;
  box-shadow: 0 18px 50px rgb(0 0 0 / 38%);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.pan-controls {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  display: grid;
  grid-template-columns: repeat(3, 32px);
  grid-template-rows: repeat(3, 32px);
  gap: 2px;
}

.pan-controls button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: rgb(16 17 18 / 86%);
  color: var(--text);
  cursor: pointer;
}

.pan-controls button:hover,
.pan-controls button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.pan-controls [data-pan="up"] {
  grid-column: 2;
}

.pan-controls [data-pan="left"] {
  grid-column: 1;
  grid-row: 2;
}

.pan-controls [data-pan="right"] {
  grid-column: 3;
  grid-row: 2;
}

.pan-controls [data-pan="down"] {
  grid-column: 2;
  grid-row: 3;
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.search-row,
.style-switcher {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.search-row label,
.style-switcher legend {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.search-fields {
  display: flex;
  gap: 8px;
}

.search-fields input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  background: #111;
  color: var(--text);
  padding: 8px 10px;
}

.search-fields button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #111;
  padding: 8px 14px;
  cursor: pointer;
}

#status {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: var(--muted);
}

.style-switcher {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.style-switcher label {
  white-space: nowrap;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 18px;
  color: var(--muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.about,
footer {
  line-height: 1.5;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .app-shell {
    margin-block: 16px;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .search-fields {
    flex-direction: column;
  }
}
