:root {
  color-scheme: light;
  --black: #050505;
  --white: #fffaf0;
  --paper: #fff8df;
  --lila: #a48dbe;
  --oker: #c59d4e;
  --veld: #7fa05a;
  --rose: #ddacc0;
  --water: #a3c2cf;
  --shadow: 4px 4px 0 0 var(--black);
  --radius: 0.6rem;
  font-family: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--black);
  background: var(--lila);
  overscroll-behavior: none;
  position: fixed;
  inset: 0;
}

button {
  font: inherit;
  cursor: pointer;
}

.app-shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--lila);
}

.map-viewport {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
}

.leaflet-map,
.leaflet-container {
  width: 100%;
  height: 100%;
  background: var(--lila);
  font-family: inherit;
}

.leaflet-container {
  cursor: grab;
  touch-action: none;
}

.leaflet-container.leaflet-dragging {
  cursor: grabbing;
}

.leaflet-container.is-placing-pin,
.map-viewport.is-placing-pin {
  cursor: crosshair;
}

.leaflet-image-layer {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-control-container {
  display: none;
}

.ww-div-icon,
.shared-pin {
  border: 0;
  background: transparent;
}

.area-shape {
  stroke: transparent;
  stroke-width: 0;
}

.area-label {
  position: absolute;
  z-index: 5;
  display: inline-grid;
  justify-items: start;
  max-width: 220px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--black);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.06;
  text-align: left;
  transform: translate(-50%, -50%);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  pointer-events: auto;
}

.area-label-tab {
  position: relative;
  z-index: 2;
  min-width: 86px;
  padding: 4px 12px 3px;
  border: 3px solid var(--black);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--black);
  background: var(--lila);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.area-label-body {
  display: block;
  min-width: 95px;
  max-width: 220px;
  margin-top: -3px;
  padding: 7px 10px;
  border: 3px solid var(--black);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  color: var(--black);
  background: var(--paper);
  white-space: pre-line;
}

.area-label.is-active .area-label-body,
.area-label.is-active .area-label-tab {
  background: var(--lila);
}

.area-label.is-dim-label {
  display: block;
  max-width: 190px;
  padding: 7px 10px;
  border: 3px solid var(--black);
  border-radius: var(--radius);
  color: var(--white);
  background: var(--black);
  white-space: pre-line;
}

.stage-marker {
  position: absolute;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 3px solid var(--black);
  border-radius: 999px;
  color: var(--black);
  background: var(--rose);
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
}

.stage-marker::after {
  content: none;
}

.stage-marker span {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 900;
}

.poi-marker {
  position: absolute;
  z-index: 9;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 3px solid var(--black);
  border-radius: 999px;
  color: var(--black);
  background: var(--water);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 900;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.poi-marker::after {
  content: none;
}

.poi-label {
  position: absolute;
  z-index: 8;
  max-width: 132px;
  padding: 7px 10px;
  border: 3px solid var(--black);
  border-radius: var(--radius);
  color: var(--black);
  background: var(--water);
  box-shadow: 3px 3px 0 0 var(--black);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.05;
  transform: translate(14px, -50%);
  white-space: pre-line;
  pointer-events: none;
}

.poi-label.is-wide {
  max-width: 224px;
}

.stage-label {
  position: absolute;
  z-index: 7;
  max-width: 128px;
  padding: 4px 7px;
  border: 3px solid var(--black);
  border-radius: 999px;
  color: var(--black);
  background: var(--white);
  box-shadow: 3px 3px 0 0 var(--black);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  transform: translate(12px, -50%);
  white-space: pre-line;
  pointer-events: none;
}

.location-dot {
  position: absolute;
  z-index: 20;
  width: 22px;
  height: 22px;
  border: 4px solid var(--white);
  border-radius: 999px;
  background: #2778ff;
  box-shadow: 0 0 0 3px var(--black), 4px 4px 0 0 var(--black);
  transform: translate(-50%, -50%);
}

.shared-pin {
  z-index: 22;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px 6px 7px;
  border: 3px solid var(--black);
  border-radius: 999px;
  color: var(--black);
  background: var(--oker);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  transform: translate(-17px, -50%);
}

.shared-pin span {
  font-size: 16px;
  line-height: 1;
}

.app-header {
  position: absolute;
  z-index: 1000;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.app-header > * {
  pointer-events: auto;
}

.brand {
  padding: 8px 12px 10px;
  border: 3px solid var(--black);
  border-radius: var(--radius);
  background: var(--lila);
  box-shadow: var(--shadow);
}

.brand p {
  margin: 0 0 1px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.brand h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(34px, 8vw, 58px);
  line-height: 0.9;
  letter-spacing: 0;
}

.actions,
.zoom-controls {
  display: flex;
  gap: 8px;
}

.share-hint {
  position: absolute;
  z-index: 1100;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  padding: 8px 10px;
  border: 3px solid var(--black);
  border-radius: 999px;
  color: var(--black);
  background: var(--oker);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 900;
  transform: translateX(-50%);
}

.share-hint[hidden] {
  display: none;
}

.share-hint button {
  border: 3px solid var(--black);
  border-radius: 999px;
  color: var(--black);
  background: var(--white);
  font-weight: 900;
}

.ww-btn,
.ww-btn-solid,
.ww-icon-btn,
.ww-square {
  border: 3px solid var(--black);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight: 900;
  transition: transform 120ms ease-out, background-color 160ms ease-out, color 160ms ease-out;
}

.ww-btn,
.ww-btn-solid {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 14px;
}

.ww-btn {
  color: var(--black);
  background: var(--white);
}

.ww-btn-solid {
  color: var(--white);
  background: var(--black);
}

.ww-btn-solid.is-active {
  color: var(--black);
  background: var(--veld);
}

.ww-btn:active,
.ww-btn-solid:active,
.ww-icon-btn:active,
.ww-square:active {
  transform: scale(0.95);
}

.ww-icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--black);
  background: var(--white);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.target-icon {
  position: relative;
  width: 19px;
  height: 19px;
  border: 3px solid currentColor;
  border-radius: 999px;
}

.target-icon::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: currentColor;
}

.zoom-controls {
  position: absolute;
  z-index: 1000;
  left: max(12px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom));
  flex-direction: column;
}

.ww-square {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--black);
  background: var(--oker);
  font-size: 27px;
  line-height: 1;
}

.info-card {
  position: absolute;
  z-index: 26;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 10px;
  max-width: min(420px, calc(100vw - 80px));
  padding: 10px;
  border: 3px solid var(--black);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.eyebrow,
.status {
  margin: 0;
}

.eyebrow {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.status {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 800;
}

@media (hover: hover) {
  .ww-btn:hover {
    color: var(--white);
    background: var(--black);
  }

  .ww-btn-solid:hover {
    color: var(--black);
    background: var(--white);
  }

  .ww-icon-btn:hover {
    color: var(--white);
    background: var(--black);
  }
}

@media (max-width: 720px) {
  .app-header {
    align-items: flex-start;
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    gap: 8px;
  }

  .brand {
    padding: 6px 9px 7px;
    border-width: 3px;
  }

  .brand p {
    font-size: 9px;
  }

  .brand h1 {
    font-size: clamp(28px, 10vw, 40px);
  }

  .actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-end;
    max-width: 178px;
    gap: 6px;
  }

  .ww-btn,
  .ww-btn-solid {
    min-height: 34px;
    padding: 5px 9px;
    border-width: 3px;
    font-size: 12px;
  }

  .ww-icon-btn {
    width: 34px;
    height: 34px;
    border-width: 3px;
    font-size: 18px;
  }

  .target-icon {
    width: 16px;
    height: 16px;
    border-width: 3px;
  }

  .zoom-controls {
    left: max(8px, env(safe-area-inset-left));
    bottom: max(8px, env(safe-area-inset-bottom));
    gap: 6px;
  }

  .ww-square {
    width: 38px;
    height: 38px;
    font-size: 23px;
  }

  .stage-label {
    max-width: 92px;
    font-size: 10px;
  }

  .area-label {
    max-width: 150px;
    font-size: 12px;
  }

  .area-label-body {
    max-width: 150px;
  }

  .share-hint {
    bottom: max(8px, env(safe-area-inset-bottom));
    font-size: 12px;
  }
}

.info-modal[hidden] {
  display: none;
}

.info-modal {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.34);
  cursor: pointer;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  padding: 18px 20px 20px;
  border: 3px solid var(--black);
  border-radius: var(--radius);
  color: var(--black);
  background: var(--paper);
  box-shadow: 6px 6px 0 0 var(--black);
}

.modal-card h2 {
  margin: 0 42px 10px 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 34px;
  line-height: 0.95;
}

.modal-card p {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.28;
}

.modal-card p + p {
  margin-top: 12px;
}

.modal-card a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.share-choices,
.share-result {
  display: grid;
  gap: 10px;
}

.share-choices {
  padding-bottom: 8px;
}

.share-description {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.share-description span,
.share-result label {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.share-description input,
.share-result input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 3px solid var(--black);
  border-radius: var(--radius);
  color: var(--black);
  background: var(--white);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 3px solid var(--black);
  border-radius: 999px;
  color: var(--black);
  background: var(--white);
  box-shadow: 3px 3px 0 0 var(--black);
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
}
