body {
    margin: 0;
    padding: 0;
    overflow: hidden;
}
#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: white;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}
#loading.hidden {
    display: none;
}

/* Mobile controller toggle button */
#controllerToggleBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1999;
    cursor: pointer;
    font-size: 24px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#controllerToggleBtn:hover {
    background: #0056b3;
    transform: scale(1.1);
}

#controllerToggleBtn:active {
    transform: scale(0.95);
}

@media (max-width: 600px) {
    #controllerToggleBtn {
        display: flex;
    }
    
    #controllerPanel {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
        min-width: auto !important;
        max-width: calc(100% - 20px);
    }
}

/* LED safe-area mode: letterbox map to top 52.3148vh (1920×565 ratio) */
html.led-safe-area body {
    background: #fff;
}

html.led-safe-area #map {
    top: 0;
    bottom: auto;
    height: 52.3148vh;
}

html.led-safe-area #controllerToggleBtn {
    bottom: auto;
    top: 20px;
}

