:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --label-green: #1d8b4a;
  --label-bg: #ffffff;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  /* background: #d3e8e3; */
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
}

#mapArea {
  position: fixed;
  flex: 1;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  
      width: 100%;
      height: 100%;
}

#mapBg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.map-bg-part {
  width: 100%;
  height: 50%;
}

.map-bg-part--top {
  background: #97d8bf;
}

.map-bg-part--bottom {
  background: #d3e8e3;
}

#stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
  z-index: 1;
}

#mapImg {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

#labels {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  --inv: 1;
}

.label {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate3d(calc(var(--anchor-x, 0.5) * -100%), -100%, 0);
  transform-origin: calc(var(--anchor-x, 0.5) * 100%) 100%;
  z-index: 3;
  pointer-events: auto;
}

.label > .bubble {
  transform: scale(var(--inv));
  transform-origin: calc(var(--anchor-x, 0.5) * 100%) 100%;
  background: var(--label-bg);
  border: 3px solid var(--label-green);
  border-radius: 16px;
  padding: 10px 16px;
  color: var(--label-green);
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 1px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.label > .bubble::after {
  content: "";
  position: absolute;
  left: calc(var(--anchor-x, 0.5) * 100%);
  bottom: -14px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 14px solid var(--label-green);
}

.label > .bubble::before {
  content: "";
  position: absolute;
  left: calc(var(--anchor-x, 0.5) * 100%);
  bottom: -10px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 12px solid var(--label-bg);
  z-index: 1;
}

#bottomImg {
  width: 100%;
  height: auto;
  display: block;
  flex: none;
/*  padding-bottom: var(--safe-bottom); */
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
      position: fixed;
      bottom: 0;
      left: 0;
      z-index: 10;
}

#detailOverlay {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 50;
  display: none;
  padding: 18px 16px calc(16px + var(--safe-bottom)) 16px;
  box-sizing: border-box;
}

#detailOverlay[data-open="1"] {
  display: block;
}

#detailTop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: var(--safe-top);
}

#detailBack {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

#detailTitle {
  font-size: 18px;
  font-weight: 800;
}

#detailBody {
  margin-top: 14px;
  font-size: 14px;
  color: #111827;
  line-height: 1.55;
}
