/* Fullscreen camera preview and overlay button styles */
body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    background: #000;
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: none;
}
#video, #canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    z-index: 1;
}
#canvas {
    pointer-events: none;
    z-index: 3;
}
#video-container {
    position: absolute;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #000;
}
/* Off-screen compute canvas */
#compute {
    position: absolute;
    top: -9999px;
    left: -9999px;
    opacity: 1;
    z-index: 10;
    background: #222121;
    pointer-events: none;
}
#debug-overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    max-height: 40vh;
    background: rgba(0,0,0,0.7);
    color: #0f0;
    font-family: monospace;
    font-size: 1em;
    padding: 0.5em 1em;
    z-index: 1000;
    overflow-y: auto;
    pointer-events: none;
    white-space: pre-line;
}

#bluetooth-btn,
#flip-camera-btn {
    position: absolute;
    top: 2vh;
    background: #2196f3;
    color: #fff;
    border: none;
    border-radius: 0.8em;
    padding: 0.3em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
    width: 4.5em;
    height: 4.5em;
    display: flex;
    align-items: center;
    justify-content: center;
}
#bluetooth-btn {
    left: 2vw;
}
#flip-camera-btn {
    left: calc(2vw + 5em);
}
#bluetooth-btn img,
#flip-camera-btn img {
    width: 3.2em;
    height: 3.2em;
    display: block;
    pointer-events: none;
}
#bluetooth-btn:active,
#flip-camera-btn:active {
    background: #1565c0;
}
@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
#bluetooth-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.2em;
    height: 2.2em;
    border: 0.3em solid #fff;
    border-top: 0.3em solid #2196f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
    pointer-events: none;
}
