body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    font-family: sans-serif;
    overscroll-behavior: none;
}

#map {
    height: 100svh;
    width: 100vw;
    z-index: 1; /* Leaflet sits at z-index 1 */
}

/* Login Overlay */
#login-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#login-overlay.hidden {
    display: none;
}

#login-overlay:not(.hidden) ~ * {
    display: none;
}

.login-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.login-box input {
    padding: 10px;
    margin-bottom: 10px;
    width: 80%;
}

.login-box button {
    padding: 10px 20px;
    cursor: pointer;
}

/* Toast Notifications */
#toast-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    user-select: none;
    pointer-events: none;
}

.toast {
    background-color: #ff4444;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    animation: fadeout 3s forwards;
    animation-delay: 2s;
    --base-opacity: 0.8;
    opacity: var(--base-opacity);
}

@keyframes fadeout {
    from { opacity: var(--base-opacity); }
    to { opacity: 0; }
}

#topright {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 900;
    text-align: right;
}
#status {
    font-size: 0.8rem;
    font-weight: bold;
    font-family: monospace;
    white-space: pre-line;
}

.resonators {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-items: left;
    gap: 0 5px;
}

.resonators > div {
    background-image: linear-gradient(0deg, var(--color) 0 var(--i), white var(--i) 100%);
    width: 40px;
    height: 10px;
    border: 1px solid black;
}

#energy-bar {
    position: absolute;
    top: -90px;
    left: -50px;
    z-index: 900;
    scale: 0.3;
}

#path5382 {
    transition: 2s linear;
    stroke-width: 12px !important;
}

#mapLoading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    text-align: center;
    font-size: 1.2rem;
}