.vector-map {
  position: relative;
  isolation: isolate;
  cursor: crosshair;
  touch-action: none;
  background: #b9d8e5;
  height: 330px;
  user-select: none;
  -webkit-user-select: none;
  border: 1px solid #9ebfcbb3;
}

.vector-map:focus-visible { outline: 3px solid #3867ff; outline-offset: 3px; }
.vector-map.is-panning { cursor: grabbing; }
.vector-map-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  transform-origin: 0 0;
  will-change: transform;
}

.vector-map-canvas img { display: block; width: 100%; height: 100%; }
.map-country-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.map-country-labels span {
  position: absolute;
  color: #53634f;
  font: 500 11px / 1.2 Arial, "Noto Sans SC", sans-serif;
  text-align: center;
  text-shadow: 0 1px 2px #fff, 0 -1px 2px #fff;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.map-controls {
  position: absolute;
  z-index: 5;
  top: 12px;
  left: 12px;
  display: grid;
  border: 1px solid #bac8d3;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px #17305724;
}
.map-controls button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: #fff;
  color: #233957;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}
.map-controls button + button { border-top: 1px solid #e1e7ec; }
.map-controls button:hover { background: #eff4fb; }
.map-controls button:disabled { color: #bdc6d1; cursor: default; }
.map-controls .map-reset-view { font-size: 11px; font-weight: 700; }
.map-source, .map-zoom-label { position: absolute; bottom: 0; z-index: 4; background: #ffffffd9; color: #53647a; padding: 3px 6px; font: 10px / 1.2 Arial, sans-serif; }
.map-source { right: 0; text-decoration: none; }
.map-zoom-label { left: 0; }
.map-country-labels span[hidden], .map-feedback[hidden], .guess-location-marker[hidden], .answer-location-marker[hidden] { display: none; }
.result-card[hidden], .photo-credit[hidden] { display: none; }

.guess-location-marker,
.answer-location-marker {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.guess-location-marker {
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: #315fff;
  box-shadow: 0 3px 10px #15356c77;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.answer-location-marker {
  width: 24px;
  height: 24px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #ff704b;
  box-shadow: 0 3px 10px #8d2b1977;
  animation: answer-pop .42s cubic-bezier(.2, 1.4, .45, 1) both;
}

.map-feedback {
  position: absolute;
  z-index: 4;
  top: 16px;
  left: 50%;
  min-width: 144px;
  padding: 9px 13px;
  border-radius: 999px;
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 7px 18px #1730572b;
}

.map-feedback.is-correct { background: #168f68; animation: feedback-in .38s ease-out both; }
.map-feedback.is-wrong { background: #d9534f; animation: feedback-in .38s ease-out both; }
.vector-map.is-correct { animation: map-success .56s ease-out; }
.vector-map.is-wrong { animation: map-shake .45s ease-in-out; }

@keyframes answer-pop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.25); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes feedback-in {
  from { opacity: 0; transform: translate(-50%, -85%) scale(.84); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes map-success {
  0%, 100% { box-shadow: inset 0 0 0 0 #42d99c00; }
  40% { box-shadow: inset 0 0 0 8px #42d99ca3; }
}

@keyframes map-shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

@media (prefers-reduced-motion: reduce) {
  .answer-location-marker, .map-feedback, .vector-map.is-correct, .vector-map.is-wrong { animation: none; }
}
