body {
    margin: 0;
    overflow: hidden;
    background-color: #050505;
    color: #fff;
    font-family: sans-serif;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 80%;
    max-width: 300px;
}

#uiControls {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 20;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

#uiControls button, #uiControls label {
    background-color: #222;
    color: #fff;
    border: 1px solid #444;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: sans-serif;
    font-size: 14px;
    transition: background-color 0.3s;
    box-sizing: border-box;
}

#uiControls button:hover, #uiControls label:hover {
    background-color: #444;
}

#modelUpload {
    display: none;
}

#cameraContainer {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 480px;
    height: 270px;
    z-index: 10;
    border: 2px solid #555;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    background-color: #000;
    transition: all 0.3s ease;
}

#videoElement, #guidesCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(-1); 
    object-fit: cover;
}

#sceneCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

@media (max-width: 768px) {
    #uiControls {
        top: 15px;
        left: 15px;
        right: 15px;
        gap: 10px;
        justify-content: space-between;
    }

    #uiControls button, #uiControls label {
        padding: 8px 12px;
        font-size: 13px;
        flex: 1;
        text-align: center;
    }

    #cameraContainer {
        width: 280px;
        height: 157px;
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    #uiControls {
        flex-direction: column;
    }

    #uiControls button, #uiControls label {
        width: 100%;
    }

    #cameraContainer {
        width: 200px;
        height: 112px;
        bottom: 15px;
        right: 15px;
    }

    #loading {
        font-size: 16px;
        padding: 15px;
    }
}