:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #03070d;
  color: #fff9ee;
}

* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: #03070d; }

#app { position: relative; isolation: isolate; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; cursor: none; touch-action: none; }

header {
  position: absolute;
  z-index: 4;
  top: max(26px, env(safe-area-inset-top));
  left: max(34px, env(safe-area-inset-left));
  right: 28px;
  pointer-events: none;
}

h1 {
  margin: 0;
  max-width: 1280px;
  font-size: clamp(28px, 3.3vw, 64px);
  line-height: .98;
  letter-spacing: -.045em;
  text-wrap: balance;
  text-shadow: 0 2px 18px #03070d, 0 0 5px #03070d;
}


#loading, #hint, #label, #reset {
  position: absolute;
  z-index: 5;
  border: 1px solid rgba(255, 249, 238, .16);
  background: rgba(3, 7, 13, .82);
  color: #fff9ee;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .28);
  backdrop-filter: blur(9px);
}

#loading {
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 12px 16px; border-radius: 999px;
  font-size: 14px; letter-spacing: .02em;
}

#hint {
  left: max(34px, env(safe-area-inset-left));
  bottom: max(24px, env(safe-area-inset-bottom));
  padding: 9px 12px; border-radius: 7px;
  color: #d8ecf4; font-size: clamp(12px, 1.05vw, 16px);
  pointer-events: none; transition: opacity .25s ease;
}

#reset {
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  padding: 10px 14px; border-radius: 7px;
  font: 700 13px/1 Arial, sans-serif; cursor: pointer;
}
#reset:hover, #reset:focus-visible { border-color: #9af4ff; color: #9af4ff; outline: none; }

#lens {
  --x: -200px; --y: -200px;
  position: absolute; z-index: 6;
  left: 0; top: 0; width: 34px; height: 34px;
  border: 1.5px solid #fff9ee; border-radius: 50%;
  transform: translate(calc(var(--x) - 17px), calc(var(--y) - 17px));
  box-shadow: 0 0 0 1px rgba(3, 7, 13, .8), 0 0 12px rgba(154, 244, 255, .14);
  pointer-events: none; opacity: 0; transition: opacity .12s ease;
}
#lens::after {
  content: ""; position: absolute; width: 11px; height: 2px;
  right: -8px; bottom: 0; border-radius: 2px;
  background: #fff9ee; transform: rotate(45deg); transform-origin: left center;
  box-shadow: 0 0 0 1px rgba(3, 7, 13, .55);
}

#label {
  left: 50%; bottom: 72px; transform: translateX(-50%);
  max-width: min(330px, calc(100vw - 30px));
  padding: 10px 12px; border-radius: 8px;
  pointer-events: none; opacity: 0; transition: opacity .12s ease;
  font-size: 13px; line-height: 1.25;
}
#label strong { display: block; margin-bottom: 2px; font-size: 15px; }
#label span { color: #9af4ff; }

.ready #loading { display: none; }
.pointer #lens, .pointer #label { opacity: 1; }
.interacted #hint { opacity: .35; }
.dragging #map { cursor: grabbing; }
.dragging #lens, .dragging #label { opacity: 0; }

@media (max-width: 720px) {
  header { top: 22px; left: 20px; right: 18px; }
  h1 { font-size: clamp(26px, 7vw, 36px); max-width: calc(100vw - 40px); }
  h1 span { display: block; }

  #hint { left: 18px; right: auto; bottom: 18px; width: min(330px, calc(100vw - 36px)); max-width: none; text-wrap: balance; }
  .interacted #hint { opacity: 0; }
  #reset { right: 18px; bottom: 18px; }
  #lens { width: 30px; height: 30px; transform: translate(calc(var(--x) - 15px), calc(var(--y) - 15px)); }
  #label { bottom: calc(72px + env(safe-area-inset-bottom)); width: calc(100vw - 36px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
