/* Load local fonts */
@font-face {
    font-family: 'Gruppo';
    src: url('fonts/Gruppo-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body, html {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100%;
    width: 100%;
    font-family: 'Gruppo', sans-serif;
    background: #000; /* Fallback background */
}

.container {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#map-container {
    width: 20vmin;
    height: 20vmin;
    position: absolute;
    overflow: hidden;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border: 2px solid black;
    text-align: left;
    display: none; /* Hidden by default */
    transition: top 0.3s ease, left 0.3s ease; /* Smooth transitions */
}

/* Default circle mode */
#map-container.circle-mode {
    transform: translate(-50%, -50%);
}

/* Keeps the class names but JavaScript updates the positions */
#map-container.circle-mode-landscape,
#map-container.circle-mode-portrait {
    left: 50%; /* Centering still done via JavaScript */
}


#map {
    width: 100%;
    height: 100%;
}

#canvas-wrapper {
    width: 100vw; /* Full viewport width */
    height: 100vh; /* Full viewport height */
    overflow: hidden;
    position: relative;
}

.circular-mask {
    border-radius: 50%;
    overflow: hidden;
}

#spinner-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Hide initially if circle mode detected in URL */
    opacity: 0;
    transition: opacity 0.1s ease;
}

/* Show spinner after JavaScript positioning or immediately if not circle mode */
#spinner-container.positioned {
    opacity: 1;
}

/* When spinner is positioned for circle mode, override the flex centering */
#spinner-container.circle-positioned {
    display: block;
    background-color: transparent;
}

#loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

#spinner-container.circle-positioned #loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}


@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
