* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #001122, #000000);
    color: white;
    overflow: hidden;
    height: 100vh;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 17, 34, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 170, 255, 0.3);
}

.header h1 {
    font-size: 24px;
    font-weight: bold;
    color: #8a2be2;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

.status-panel {
    display: flex;
    gap: 20px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-label {
    font-size: 14px;
    opacity: 0.8;
}

.status-connected { color: #00ff00; }
.status-ready { color: #ffaa00; }
.status-warning { color: #ff6600; }
.status-disconnected { color: #ff3366; }
.status-error { color: #ff0000; }

#scene-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#webgl-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 500;
    pointer-events: none;
}

.crosshair-center {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: -3px;
    left: -3px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.crosshair-line {
    position: absolute;
    background: white;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.6);
}

.crosshair-h {
    width: 20px;
    height: 2px;
    top: -1px;
    left: -10px;
}

.crosshair-v {
    width: 2px;
    height: 20px;
    top: -10px;
    left: -1px;
}

.controls-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 17, 34, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0, 170, 255, 0.3);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.primary-btn {
    background: #8a2be2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
}

.primary-btn:hover {
    background: #9a3bf2;
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.5);
}

.secondary-btn {
    background: rgba(0, 170, 255, 0.2);
    color: #00aaff;
    border: 1px solid #00aaff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: rgba(0, 170, 255, 0.3);
    transform: translateY(-1px);
}

input[type="range"] {
    width: 100px;
    height: 4px;
    background: rgba(0, 170, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #00aaff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
}

.instructions-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    background: rgba(0, 17, 34, 0.95);
    backdrop-filter: blur(15px);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid rgba(0, 170, 255, 0.5);
    max-width: 500px;
    display: none;
    box-shadow: 0 0 50px rgba(138, 43, 226, 0.3);
}

.instructions-panel h3 {
    color: #8a2be2;
    margin-bottom: 20px;
    font-size: 20px;
}

.instructions-panel p {
    margin-bottom: 15px;
    line-height: 1.6;
    opacity: 0.9;
}

.tech-note {
    background: rgba(0, 170, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 3px solid #00aaff;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #ff3366;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 51, 102, 0.2);
    border-radius: 50%;
}

.footer {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
    font-size: 12px;
    opacity: 0.7;
}

.footer a {
    color: #8a2be2;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .controls-panel {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .status-panel {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }
    
    .instructions-panel {
        margin: 20px;
        padding: 20px;
        max-width: calc(100vw - 40px);
    }
}

/* Glow effects */
.primary-btn, .crosshair-center, .crosshair-line {
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    from { filter: brightness(1); }
    to { filter: brightness(1.2); }
}

/* Loading animation for when face detection is starting */
.status-ready::after {
    content: '...';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}