:root {
  color-scheme: dark;
  --surface: rgba(12, 17, 20, 0.86);
  --surface-strong: rgba(8, 12, 14, 0.94);
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(232, 190, 95, 0.5);
  --text: #edf3ef;
  --muted: #a9b8b1;
  --accent: #e8be5f;
  --blocked: rgba(218, 72, 72, 0.42);
  --teleport: rgba(83, 168, 214, 0.44);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #101619;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
input {
  font: inherit;
}

.explorer-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-width: 320px;
  min-height: 460px;
  overflow: hidden;
}

#mapCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #121a18;
  image-rendering: pixelated;
  cursor: grab;
}

#mapCanvas.is-dragging {
  cursor: grabbing;
}

.toolbar,
.inspector,
.status,
.minimap {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.toolbar {
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px;
  overflow-x: auto;
}

.title {
  flex: 0 0 auto;
  padding: 0 6px;
  color: #f5e6bd;
  font-size: 14px;
  line-height: 32px;
  white-space: nowrap;
}

.map-field,
.tool-group,
.tool-group label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.map-field,
.tool-group label {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.tool-group {
  flex: 0 0 auto;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

select,
button,
#zoomReadout {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

select {
  width: min(34vw, 230px);
  min-width: 150px;
  padding: 0 30px 0 10px;
}

option {
  background: #141b20;
}

button {
  min-width: 34px;
  padding: 0 10px;
  cursor: pointer;
}

button:hover,
select:hover {
  border-color: var(--line-strong);
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#zoomReadout {
  min-width: 58px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 30px;
  text-align: center;
}

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.inspector {
  right: 12px;
  top: 78px;
  width: 260px;
  padding: 12px;
}

.inspector h2 {
  margin: 0 0 10px;
  color: #f5e6bd;
  font-size: 14px;
  line-height: 1.2;
}

.inspector dl {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px 10px;
  margin: 0;
  font-size: 13px;
}

.inspector dt {
  color: var(--muted);
}

.inspector dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.minimap {
  right: 12px;
  bottom: 12px;
  width: 180px;
  height: 180px;
  background: var(--surface-strong);
  image-rendering: pixelated;
}

.status {
  left: 12px;
  bottom: 12px;
  max-width: min(620px, calc(100vw - 220px));
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.status.is-error {
  color: #ffd0d0;
  border-color: rgba(218, 72, 72, 0.7);
}

@media (max-width: 760px) {
  .toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .title {
    width: 100%;
    line-height: 20px;
  }

  .tool-group:first-of-type {
    padding-left: 0;
    border-left: 0;
  }

  .inspector {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 204px;
    width: auto;
  }

  .minimap {
    width: 168px;
    height: 168px;
  }

  .status {
    right: 192px;
    max-width: none;
  }
}
