/* Palco: o mapa, o cursor do pincel e o que flutua sobre ele (status, zoom, aviso, carregando). */

.stage {
  grid-area: stage;
  position: relative;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px) 0 0 / 40px 40px,
    radial-gradient(ellipse at 50% 40%, var(--desk-hi), var(--desk-lo) 80%);
  cursor: crosshair;
}

.stage[data-tool="select"] { cursor: default; }
.stage[data-tool="label"] { cursor: text; }
.stage.erasing { cursor: crosshair; }
.stage[data-tool="pan"],
.stage.grab { cursor: grab; }
.stage.panning { cursor: grabbing; }

.view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.brush-cursor {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  border: 1px solid rgba(246, 241, 228, 0.92);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: var(--z-cursor);
}

.brush-cursor.erase {
  border-style: dashed;
  border-color: rgba(255, 210, 190, 0.95);
}

.overlay {
  position: absolute;
  z-index: var(--z-overlay);
}

.statusbar {
  left: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100% - 200px);
  padding: 7px 12px;
  background: var(--glass);
  border: 1px solid var(--seam);
  border-radius: 6px;
  font: 12px var(--font-mono);
  color: var(--bone-2);
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px);
  white-space: nowrap;
  overflow: hidden;
}

.status-coord {
  color: var(--bone);
  min-width: 15ch;
}

.status-biome {
  color: var(--brass-2);
}

.status-hint {
  color: var(--lichen);
  font-family: var(--font-ui);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zoombar {
  right: 14px;
  bottom: 14px;
  display: flex;
  background: var(--glass);
  border: 1px solid var(--seam);
  border-radius: 6px;
  overflow: hidden;
  backdrop-filter: blur(6px);
}

.zoombar button {
  height: 32px;
  min-width: 34px;
  border: 0;
  background: transparent;
  color: var(--bone-2);
  cursor: pointer;
  font: 500 16px var(--font-mono);
}

.zoombar button:hover {
  color: var(--bone);
  background: var(--hull-3);
}

.zoombar .zoom-fit {
  font-size: 12px;
  min-width: 88px;
  border-inline: 1px solid var(--seam);
  font-variant-numeric: tabular-nums;
}

.note {
  top: 14px;
  left: 14px;
  width: min(360px, calc(100% - 28px));
  box-sizing: border-box;
  display: grid;
  gap: 10px;
  padding: 13px 15px 14px;
  background: rgba(21, 29, 32, 0.94);
  border: 1px solid var(--seam-2);
  border-radius: 7px;
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.note p {
  margin: 0;
  font-size: 14.5px;
  color: var(--bone-2);
}

.note strong {
  color: var(--bone);
  font-weight: 700;
}

.note em {
  font: normal 13px var(--font-mono);
  color: var(--brass-2);
}

.note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.busy {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 11px 18px;
  background: rgba(15, 21, 24, 0.92);
  border: 1px solid var(--seam-2);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--bone);
  pointer-events: none;
}

@media (max-width: 820px) {
  .status-hint { display: none; }
  .statusbar { max-width: calc(100% - 170px); }
}
