* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #050510;
    font-family: 'Inter', sans-serif;
}

/* Loader Overlay */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: #0f172a;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #00f7ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Canvas Integration */
.canvas-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Flipped like a mirror */
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none; /* Let UI clicks pass below if necessary */
}

/* Glossmorphism UI Panel */
.ui-panel {
    position: absolute;
    top: 30px;
    left: 30px;
    width: 320px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 30px;
    color: #f1f5f9;
    z-index: 10;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 25px 0;
    color: #fff;
    letter-spacing: -0.5px;
}

.logo span {
    background: linear-gradient(135deg, #00f7ff, #0051ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gesture-status {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
}

.pulse-dot {
    width: 12px;
    height: 12px;
    background-color: #10b981;
    border-radius: 50%;
    margin-right: 12px;
    box-shadow: 0 0 10px #10b981;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 10px;
    color: #94a3b8;
}

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

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

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00f7ff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 247, 255, 0.5);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.guide {
    margin-top: 35px;
}

.guide h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.guide ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guide li {
    font-size: 14px;
    color: #cbd5e1;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
}

.guide span {
    font-size: 16px;
}
