/* Scene contract: one world pixel space, one camera transform.
   Only labels use --scene-ui-scale; never apply it to world artwork. */
.scene-viewport {
  overflow: hidden;
  overflow: clip;
  user-select: none;
}
.scene-viewport.is-panning { cursor: grabbing; }
.scene-plane {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  overflow: hidden;
  transform-origin: 0 0;
  will-change: transform;
}
.scene-background {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}
.scene-weather {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background-image: radial-gradient(ellipse,#fff8ce70 1px,transparent 2px),radial-gradient(ellipse,#fff8ce50 1px,transparent 2px);
  background-size: 171px 143px,239px 193px;
  animation: drift 20s linear infinite;
}
.scene-weather.caves {
  background-image: radial-gradient(ellipse,#b0ebd250 1px,transparent 3px);
  background-size: 140px 170px;
}
.scene-points { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.map-point {
  position: absolute;
  padding: 0;
  border: 0;
  background: none;
  text-align: center;
  white-space: nowrap;
  pointer-events: auto;
  touch-action: none;
  filter: drop-shadow(0 2px 3px #153a2740);
  /* The bottom center of the badge is its saved scene coordinate. */
  transform: translate(-50%,-100%) scale(var(--scene-ui-scale,1));
  transform-origin: 50% 100%;
}
.point-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #faf6e7;
  border: 2px solid #d4bd7c;
  color: var(--green);
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  margin: auto;
}
.point-icon>span { display: block; transform: rotate(45deg); font-size: 16px; }
.point-label {
  display: block;
  background: #fffbeeef;
  border: 1px solid #e2d9bd;
  border-radius: 4px;
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
  margin-top: 8px;
  padding: 4px 9px;
  letter-spacing: .2px;
}
.map-point:hover .point-icon,.map-point:focus-visible .point-icon {
  background: #e8d390;
  transform: rotate(-45deg) translate(3px,-3px);
}
.map-point.under-construction .point-icon { border-color: #b4a586; }
.scene-character {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 20;
  pointer-events: none;
}
.scene-character>svg {
  position: absolute;
  /* 220 world pixels wide. SVG ground (100,240) in viewBox 0 -20 200 280
     lands exactly on the parent's saved (x,y), regardless of name or zoom. */
  width: 220px;
  height: 308px;
  max-width: none;
  left: -110px;
  top: -286px;
  display: block;
  filter: drop-shadow(0 10px 6px #22492d25);
}
.scene-character .character-tag {
  position: absolute;
  left: 0;
  top: 28px;
  transform: translateX(-50%) scale(var(--scene-ui-scale,1));
  transform-origin: 50% 0;
  font-size: 10px;
  font-weight: 650;
  border: 1px solid #fff8dd;
  color: var(--green);
  background: #fffbedf2;
  border-radius: 20px;
  padding: 5px 13px;
  box-shadow: 0 3px 8px #36533b25;
  white-space: nowrap;
}
.character-tag small { display: block; font-size: 7px; font-weight: 500; color: #8c977c; letter-spacing: 1px; margin-top: 1px; }
.avatar-shadow { transform-origin: 100px 240px; }
.map-controls button:disabled { cursor: default; opacity: .45; }
