@import url("fonts/audiowide.css");
body {
    background: #202020;
    height:100%;
    overflow:hidden;
}

main * {
    touch-action:pinch-zoom;
    -webkit-user-select: none;
    user-select: none;
}

#map-container {
    position:fixed;
    top:10px;
    left:10px;
    right:10px;
    bottom:10px;
    background:black;
    /* clip instead of hidden so that accessibility tools do not scroll it automatically; scrolling on focus is handled via javascript */
    overflow:clip; 
    border-radius:5px;

}
#map-container::after {
    content: '';
    position: absolute;
    top:0;
    left:0;
    right:0;
    bottom:0;
    pointer-events:none;
    box-shadow: inset 0px 0px 20px 20px black;
}
#map {
    width:100%;
    height:100%;
    --map-offset-x: 0;
    --map-offset-y: 0;
    --map-zoom:1;
    transform: translate(
        calc(-1px * var(--map-offset-x)),
        calc(1px * var(--map-offset-y))
    ) scale(var(--map-zoom), var(--map-zoom));
    --grid-size:20px;
}
#map * {
    position:absolute;
}
#map > div {
    width:0;
    height:0;
    
    top:calc(50% - var(--grid-size) * var(--y));
    left:calc(50% + var(--grid-size) * var(--x));

    opacity:0;
    animation: fadeIn 1s ease forwards;
}
@keyframes fadeIn {
    0% { }
    100% { opacity:1; }
}

#map > .icon {
    z-index:1;
}
#map > .icon > .title {
    transform:translate(calc(var(--grid-size) - 10px), -50%);
    
    margin-left:10px;

    color:white;
    
    width:auto;
    height:auto;
    white-space:nowrap;
    font-family:"Audiowide", monospace;
    
    background-color: #000000c0;
}
#map > .icon > button {
    display:block;
    width:var(--grid-size);
    height:var(--grid-size);
    
    background-color: white;
    
    border-radius:0;
    border:0;
    padding:0px;
    margin:0px;

    box-shadow: 0px 0px 5px 5px #000000;
    
    transform: translate(-50%, -50%);
    transition:transform 0.15s;
}
#map > .icon > button:hover, #map > .icon > button:focus-visible {
    transform: translate(-50%, -50%) scale(150%);
}
#map > .icon > button:active {
    background:lightgrey;
}

#map > .line > div {
    width: calc(var(--grid-size) * var(--length));

    /* transform-origin and translateY is to correctly position the border to the center */
    --border-size: calc(2px / var(--map-zoom));
    transform-origin:left center;
    transform: translateY(calc(var(--border-size) / -2))
        rotate(var(--angle))
        scale(0);

    border-top:var(--border-size) solid #f0b080;
    animation: scaleIn 1s ease forwards;
}
@keyframes scaleIn {
    0% { }
    100% {
        transform:translateY(calc(var(--border-size) / -2))
            rotate(var(--angle));
    }
}


#map > .tooltip {
    width:auto;
    height:auto;
    color:#ffffe0;
    font-family:"Audiowide", monospace;

    display:flex;
    align-items: center;
}
#map > .tooltip > * {
    position:relative;
    pointer-events:none;
}
#map > .tooltip > img {
    height:50px;
    transform:rotate(-22deg);
    margin-right:5px;
}
