html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #d1ddf1;
}

#app {
    width: 100%;
    height: 100%;
}

#map-wrapper {
    width: 100%;
    height: 100%;
}

/* #map-container {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

#map-container svg {
    position: absolute;
    left: 0;
    top: 0;
} */

#map-container {
    width: 100%;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

#map-container svg {
    display: block;
    height: 100%;
    width: auto;
    min-width: 100%;
}

/* #character {
    position: absolute;
    pointer-events: none;
} */

#character {
    position: absolute;
    /* Relative to #map-container */
    z-index: 10;
    pointer-events: none;
    will-change: left, top;
    /* Performance boost */
}

#character img {
    transform-origin: center bottom;
}

.road-step {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1995bc;
    color: #fff;
    font-weight: bolder;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    z-index: 0;
    cursor: pointer;
    font-family: Poppins;
    font-size: 1.2rem;
}

.step-popup {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -100%) translate(var(--popup-x, 40px), var(--popup-y, -160px)) scale(0);
    transform-origin: 50% 100%;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: transform 180ms ease, opacity 180ms ease;
}

.step-popup.is-visible {
    transform: translate(-50%, -100%) translate(var(--popup-x, 40px), var(--popup-y, -160px)) scale(1);
    opacity: 1;
}

.step-popup__clock {
    width: 14px;
    height: 14px;
    display: block;
}

.step-popup__box {
    width: 240px;
    background: #fff;
    border: 3px solid #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.step-popup__top {
    padding: 10px 12px;
    color: #fff;
    font-weight: 800;
}

.step-popup__header {
    font-size: 13px;
    letter-spacing: 0.2px;
}

.step-popup__subheader {
    font-size: 13px;
    letter-spacing: 0.2px;
}

.step-popup__content {
    padding: 10px 12px 12px 12px;
    color: #1d1d1d;
}

.step-popup__title {
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.step-popup__body {
    font-size: 12px;
    line-height: 1.25;
    margin-bottom: 8px;
}

.step-popup__emphasis {
    font-size: 11px;
    line-height: 1.25;
    font-weight: 700;
    margin-bottom: 10px;
}

.step-popup__time {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 12px;
}

#goal-star {
    position: absolute;
    width: 52px;
    height: 52px;
    transform: translate(-50%, -50%);
    transform-style: preserve-3d;
    background: url("../assets/star.png") no-repeat center / contain;
    animation: goalSpin3D 2.1s linear infinite;
    pointer-events: none;
    z-index: 5;
    will-change: transform;
}

.step-popup.clamp-top.is-visible {
    transform:
        translate(-50%, 0) translate(var(--popup-x, 40px), var(--popup-y, 0)) scale(1);
}

@keyframes goalSpin3D {
    from {
        transform: translate(-50%, -50%) perspective(700px) rotateY(0deg);
    }

    to {
        transform: translate(-50%, -50%) perspective(700px) rotateY(360deg);
    }
}

#goal-star::after {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    filter: brightness(0.75);
    opacity: 0.35;
    transform: translateZ(-1px);
}

/* responsive */

@media (max-width: 500px) {
    #map-container {
        height: 100vh;
    }
}

@media (min-width: 1500px) {
#map-wrapper {
        display: flex;
        align-content: center;
        justify-content: center;
    }
}

@media (max-width: 1024px) {
    .step-popup.clamp-top {
        position: fixed;
        /* Fix to viewport, not map */
        left: 50% !important;
        top: 20px !important;
        transform: translate(-50%, 0) scale(0) !important;
        --popup-x: 0px !important;
        --popup-y: 0px !important;
    }

    .step-popup.clamp-top.is-visible {
        transform: translate(-50%, 0) scale(1) !important;
    }
}