body {
    margin: 0;
    overflow: hidden;
    background-color: #050505;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 15;
    pointer-events: none;
}

#ui-layer {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 20;
    color: #ff69b4; 
    background: rgba(0, 0, 0, 0.6);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 105, 180, 0.2);
    font-size: 12px;
    line-height: 1.4;
    width: 210px;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    pointer-events: auto;
    transition: height 0.3s ease;
}

#ui-layer.collapsed {
    width: auto;
    min-width: 120px;
}

#ui-layer.collapsed #ui-content {
    display: none;
}

.ui-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 4px;
    margin-bottom: 8px;
}

#ui-layer h1 {
    margin: 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    pointer-events: none;
}

#btn-collapse {
    background: none;
    border: none;
    color: #ff69b4;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

#btn-collapse:hover {
    color: #fff;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    pointer-events: none;
}

.value {
    font-weight: bold;
    color: #fff;
}

/* Voice Toggle Button */
#btn-voice {
    width: 100%;
    margin-top: 5px;
    margin-bottom: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 105, 180, 0.3);
    border-radius: 6px;
    color: #ddd;
    cursor: pointer;
    font-size: 11px;
    text-transform: uppercase;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#btn-voice:hover {
    background: rgba(255, 105, 180, 0.2);
    color: #fff;
}

#btn-voice.active {
    background: rgba(0, 255, 255, 0.2); 
    color: #0ff;
    border-color: #0ff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

/* Draggable & Resizable Camera Wrapper */
#camera-wrapper {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 200px;
    height: 150px;
    z-index: 18;
    background: rgba(0,0,0,0.5);
    border: 1px solid #444;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    resize: both;
    overflow: hidden;
    min-width: 100px;
    min-height: 80px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    pointer-events: auto;
}

#camera-handle {
    background: rgba(255, 105, 180, 0.2);
    color: #ccc;
    font-size: 10px;
    text-align: center;
    cursor: grab;
    padding: 2px 0;
    user-select: none;
    flex-shrink: 0;
}

#camera-handle:active {
    cursor: grabbing;
    background: rgba(255, 105, 180, 0.4);
}

#webcam-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); 
    opacity: 0.8;
    pointer-events: none;
}

/* Fullscreen override for AR mode */
#camera-wrapper.fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    border: none;
    border-radius: 0;
    resize: none;
    background: black;
    z-index: 1 !important;
    pointer-events: none;
}

#camera-wrapper.fullscreen #camera-handle {
    display: none;
}

#camera-wrapper.fullscreen #webcam-preview {
    opacity: 1.0;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    z-index: 30;
    font-size: 18px;
    text-align: center;
    background: rgba(0,0,0,0.8);
    padding: 20px;
    border-radius: 12px;
    pointer-events: none;
}

#voice-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #555;
    transition: all 0.2s;
}

#voice-indicator.listening {
    background-color: #00ff00;
    box-shadow: 0 0 6px #00ff00;
}
