:root {
    --primary: #ff0055;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text: #ffffff;
    --bg: #050505;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    overflow: hidden;
    background-color: var(--bg);
    color: var(--text);
    width: 100vw;
    height: 100vh;
}

#webgl {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ui-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}

.header h1 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.status-indicator {
    font-size: 0.8rem;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #aaa;
    border-radius: 50%;
}

.status-indicator.active {
    color: #0f0;
}

.status-indicator.active::before {
    background: #0f0;
    box-shadow: 0 0 5px #0f0;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
}

.control-group {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

label {
    font-size: 0.75rem;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 1px;
}

select, button {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    transition: all 0.3s;
}

select:hover, button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

select option {
    background: #222;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 100%;
    height: 35px;
    border-radius: 8px;
    background: none;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--glass-border);
    border-radius: 8px;
}

.camera-preview {
    position: absolute;
    top: -120px;
    right: 0;
    width: 140px;
    height: 105px;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--glass-border);
    transform-origin: bottom right;
    transition: transform 0.3s;
}

#camera-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror effect */
}

/* Mobile Adaptation */
@media (max-width: 600px) {
    .ui-container {
        width: 95%;
        bottom: 10px;
        padding: 15px;
    }

    .camera-preview {
        width: 100px;
        height: 75px;
        top: -90px;
    }
    
    .controls {
        gap: 10px;
    }
}