html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ff4d1f;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.rd {
  box-sizing: border-box;
  width: min(480px, 88vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.rd__map {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  width: 100%;
  height: clamp(104px, 34vw, 160px);
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  background: radial-gradient(circle at 16% 74%, #c9e0bd 0 42px, transparent 42px), linear-gradient(104deg, transparent 0 64%, #bcd9ea 64% 71%, transparent 71%), repeating-linear-gradient(90deg, #fffdf7 0 7px, transparent 7px 30px), repeating-linear-gradient(0deg, #fffdf7 0 7px, transparent 7px 26px), #efe9dc;
}

.rd__block {
  position: absolute;
  display: block;
  background: #e2dac9;
  border-radius: 4px;
}

.rd__block--a {
  left: 20%;
  top: 10%;
  width: 15%;
  height: 22%;
}

.rd__block--b {
  left: 47%;
  top: 48%;
  width: 19%;
  height: 26%;
}

.rd__block--c {
  left: 73%;
  top: 42%;
  width: 13%;
  height: 20%;
}

.rd__route {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.rd__line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rd__line--base {
  stroke: rgba(23, 20, 26, 0.13);
  stroke-width: 7;
}

.rd__line--draw {
  stroke: #2f6df6;
  stroke-width: 5;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.rd:not(.is-demo) .rd__line--draw {
  transition: stroke-dashoffset 900ms ease-out;
}

.rd.is-drawn .rd__line--draw {
  stroke-dashoffset: 0;
}

.rd__pin, .rd__flag {
  position: absolute;
  display: block;
  filter: drop-shadow(0 2px 3px rgba(23, 20, 26, 0.28));
}

.rd__pin svg, .rd__flag svg {
  display: block;
}

.rd__pin--start {
  left: 12.1%;
  top: 82%;
  transform: translate(-50%, -100%);
  color: #2f6df6;
}

.rd__flag {
  left: 86.3%;
  top: 24.7%;
  transform: translate(-50%, -50%);
  color: rgba(23, 20, 26, 0.82);
}

.rd__badge {
  position: absolute;
  top: 8px;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  color: rgba(23, 20, 26, 0.92);
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  white-space: nowrap;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  transform: translate(-50%, -6px) scale(0.6);
  opacity: 0;
  transition: transform 300ms cubic-bezier(0.2, 1.4, 0.4, 1), opacity 300ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.rd__badge-ico {
  display: inline-flex;
  color: #2f6df6;
}

.rd.is-drawn .rd__badge {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  transition-delay: 860ms;
}

.rd__btn {
  box-sizing: border-box;
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: rgba(23, 20, 26, 0.92);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  transition: transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.rd__btn-ico {
  display: inline-flex;
  color: #2f6df6;
}

.rd__btn:hover {
  transform: translateY(-1px);
}

.rd__btn:active {
  transform: translateY(1px);
}

.rd__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.rd.is-demo .rd__line--draw {
  animation-name: rd-draw;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes rd-draw {
  0% {
    stroke-dashoffset: 100;
  }
  45% {
    stroke-dashoffset: 0;
  }
  72% {
    stroke-dashoffset: 0;
  }
  88% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 100;
  }
}
.rd.is-demo .rd__badge {
  animation-name: rd-badge;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

@keyframes rd-badge {
  0% {
    opacity: 0;
    transform: translate(-50%, -6px) scale(0.6);
  }
  44% {
    opacity: 0;
    transform: translate(-50%, -6px) scale(0.6);
  }
  56% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  84% {
    opacity: 0;
    transform: translate(-50%, -6px) scale(0.6);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -6px) scale(0.6);
  }
}
@media (max-width: 340px) {
  .rd {
    gap: 0;
  }
  .rd__btn {
    margin-top: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rd.is-demo .rd__line--draw, .rd.is-demo .rd__badge {
    animation: none !important;
  }
  .rd__line--draw, .rd__badge, .rd__btn {
    transition: none;
  }
  .rd__line--draw {
    stroke-dashoffset: 0;
  }
  .rd__badge {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}
