body { margin: 0; overflow: hidden; background-color: #1a4d6e; }

/* HUD 容器样式 - 恢复原来的布局方式 */
#hud-container {
    position: absolute;
    top: 10px;
    width: 100%;
    text-align: center;
    color: white;
    font-family: Arial, sans-serif;
    pointer-events: none;
    text-shadow: 1px 1px 2px black;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 5px; /* 控制两行之间的间距 */
}

#controlsHint {
    font-size: 16px;
}

#status {
    font-size: 18px;
    font-weight: bold;
}


#sideViewLabel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40vh; /* 对应 JS 中的 size */
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-family: Arial, sans-serif;
    pointer-events: none;
    z-index: 100;
    font-size: 14px;
}

/* 设置按钮样式 */
#settingsBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
    font-size: 30px;
    cursor: pointer;
    color: white;
    opacity: 0.8;
}

/* 移动端控制样式 */
#mobileControls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* 让未点击区域穿透 */
    z-index: 200;
}

#joystickZone {
    position: absolute;
    bottom: 50px;
    left: 50px;
    width: 150px;
    height: 150px;
    pointer-events: auto;
}

#joystickBase {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    position: relative;
    top: 15px;
    left: 15px;
}

#joystickHandle {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

#actionButtons {
    position: absolute;
    bottom: 40px;
    right: 40px;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 20px;
    pointer-events: auto;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-btn {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    color: white;
    font-size: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.1s;
}

.game-btn:active {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0.95);
}

.boost-btn {
    width: 90px;
    height: 90px;
    background: rgba(255, 200, 0, 0.3);
    border-color: rgba(255, 200, 0, 0.6);
    font-size: 40px;
}

.boost-btn:active {
    background: rgba(255, 200, 0, 0.6);
}

/* 适配不同屏幕 */
@media (max-width: 600px) {
    #joystickZone {
        bottom: 30px;
        left: 20px;
        width: 120px;
        height: 120px;
    }
    #joystickBase {
        width: 100px;
        height: 100px;
    }
    #joystickHandle {
        width: 40px;
        height: 40px;
    }
    #actionButtons {
        bottom: 30px;
        right: 20px;
        gap: 15px;
    }
    .game-btn {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    .boost-btn {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
}

/* 移动端适配 (小于 800px) */
@media (max-width: 800px) {
    /* 侧视图移动到右上角 */
    #sideViewLabel {
        bottom: auto;
        top: calc(40vmin + 25px); /* 位于侧视图下方 */
        right: 20px;
        width: 40vmin;
    }
    
    /* 设置按钮移动到左上角 */
    #settingsBtn {
        right: auto;
        left: 20px;
    }

    /* 隐藏 PC 端提示信息，并调整状态栏位置 */
    #controlsHint {
        display: none;
    }
    /* 在移动端不需要额外调整 top，因为容器已经有了 top: 10px */
}