:root {
  color-scheme: dark;
  --ink: #f4eee1;
  --muted: #b8aa95;
  --panel: rgba(14, 12, 10, 0.74);
  --line: rgba(255, 240, 210, 0.22);
  --amber: #ffcf56;
  --red: #d64336;
  --green: #75c65b;
  --shadow: rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #080706;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}

a,
button {
  min-height: 42px;
  border: 1px solid rgba(255, 235, 190, 0.28);
  border-radius: 6px;
  background: rgba(24, 21, 19, 0.82);
  color: var(--ink);
  font: 800 0.8rem/1 "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--shadow);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

a:hover,
a:focus-visible,
button:hover,
button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 210, 100, 0.82);
  outline: none;
}

.map-shell,
.map-mount {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-width: 320px;
}

.map-mount {
  cursor: grab;
  touch-action: none;
}

.map-mount.dragging {
  cursor: grabbing;
}

.map-mount canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.map-hud {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  pointer-events: none;
}

.map-brand,
.map-readout {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 36px var(--shadow);
  backdrop-filter: blur(8px);
}

.map-brand {
  width: min(330px, calc(100vw - 32px));
  padding: 12px 14px;
  text-transform: uppercase;
}

.map-brand span {
  display: block;
  color: var(--red);
  font-weight: 900;
  font-size: 0.82rem;
}

.map-brand strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.2rem, 3vw, 1.85rem);
}

.map-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
  pointer-events: auto;
}

.map-actions a,
.map-actions button {
  display: grid;
  place-items: center;
  width: 86px;
  padding: 0 12px;
}

.map-actions button.active {
  border-color: rgba(255, 210, 100, 0.82);
  background: linear-gradient(145deg, rgba(177, 63, 47, 0.92), rgba(38, 26, 21, 0.96));
}

.map-readout {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 3;
  width: min(520px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.map-readout div {
  min-width: 0;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
}

.map-readout span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.map-readout strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

@media (max-width: 720px) {
  .map-hud {
    left: 10px;
    right: 10px;
    top: 10px;
    display: grid;
  }

  .map-brand {
    width: 100%;
  }

  .map-actions {
    justify-content: stretch;
  }

  .map-actions a,
  .map-actions button {
    flex: 1;
    width: auto;
    min-width: 68px;
    min-height: 40px;
    font-size: 0.72rem;
  }

  .map-readout {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
  }

  .map-readout div {
    padding: 10px 8px;
  }
}

@media (max-height: 520px) {
  .map-readout {
    display: none;
  }
}
