body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    touch-action: none; /* Disables default browser gestures (scroll/zoom) for better 3D control */
}

canvas {
    display: block;
    cursor: grab;
}

canvas:active {
    cursor: grabbing;
}

/* MediaPipe Elements */
.input_video {
    display: none; /* Hide the video feed */
}

.output_canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5; /* Below info-panel */
    transform: scaleX(-1); /* Mirror effect for selfie view */
    opacity: 0.5; /* Make it subtle */
    width: 20%; /* Smaller */
    height: auto;
    max-width: 320px;
    border-radius: 8px;
    border: 1px solid rgba(0, 210, 255, 0.3);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

.status-badge {
    position: absolute;
    bottom: 20px;
    left: 20px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 10;
    transition: background-color 0.3s ease;
}

#gesture-legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 15px;
    background: rgba(10, 25, 40, 0.85);
    color: #e0e0e0;
    border: 1px solid #00d2ff;
    border-radius: 12px;
    z-index: 10;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
}

.legend-item {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

#info-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    padding: 25px;
    background: rgba(10, 25, 40, 0.85);
    color: #e0e0e0;
    border: 1px solid #00d2ff;
    border-radius: 12px;
    display: none; /* Hidden by default */
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
    transition: opacity 0.3s ease;
    z-index: 10;
}

#info-panel h2 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #00d2ff;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(0, 210, 255, 0.3);
    padding-bottom: 10px;
}

#info-panel p {
    line-height: 1.6;
    font-size: 0.95rem;
}

#close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    color: #aaa;
    font-size: 1.2rem;
    transition: color 0.2s;
}

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

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00d2ff;
    font-size: 1.2rem;
    letter-spacing: 2px;
    pointer-events: none;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}