* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #050505;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    color: white;
    height: 100dvh; 
}

#container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* FIX: Give video actual size so AI can see it, but hide it visually */
#webcam {
    position: absolute;
    top: 0;
    left: 0;
    width: 640px; 
    height: 480px;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    visibility: hidden; /* Hides it from view but keeps it in DOM */
}

/* Header */
.header {
    position: fixed;
    top: max(2rem, env(safe-area-inset-top)); 
    left: max(2rem, env(safe-area-inset-left));
    text-align: left;
    z-index: 10;
    pointer-events: none;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    background: linear-gradient(45deg, #ff6e7f, #bfe9ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: 0.9;
    letter-spacing: -1px;
    filter: drop-shadow(0 0 15px rgba(255,255,255,0.3));
}

/* Color Controls */
.color-controls {
    position: fixed;
    top: max(2rem, env(safe-area-inset-top));
    right: max(2rem, env(safe-area-inset-right));
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.color-scheme {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-scheme button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    min-width: 120px;
}

.color-scheme button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.color-scheme button.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.color-preview {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.color-preview.cosmic { background: linear-gradient(45deg, #ff6e7f, #bfe9ff); }
.color-preview.neon { background: linear-gradient(45deg, #00ff87, #60efff); }
.color-preview.sunset { background: linear-gradient(45deg, #ff8c37, #ff427a); }
.color-preview.ocean { background: linear-gradient(45deg, #0082c8, #00b4db); }

/* Input Area */
.input-container {
    position: fixed;
    bottom: max(2rem, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 90%;
    max-width: 600px;
    padding: 0 1rem;
}

.input-wrapper {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    box-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 30px -1px rgba(0, 0, 0, 0.3);
}

input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 1.25rem;
    color: white;
    font-size: 16px; 
    font-weight: 500;
}

input:focus {
    outline: none;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

button#typeBtn {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    padding: 0.75rem 1.5rem;
    color: white;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

button#typeBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px -2px rgba(79, 70, 229, 0.5);
}

button#typeBtn:active {
    transform: translateY(1px);
}

.button-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .header {
        top: max(1.5rem, env(safe-area-inset-top));
        left: max(1.5rem, env(safe-area-inset-left));
    }

    .header h1 {
        font-size: 1.5rem; 
    }

    .color-controls {
        top: max(1.5rem, env(safe-area-inset-top));
        right: max(1.5rem, env(safe-area-inset-right));
        padding: 0.5rem;
    }

    .color-scheme button {
        padding: 0.4rem;
        min-width: auto;
    }
    
    .color-scheme button span {
        display: none; 
    }
    
    .input-container {
        bottom: max(1.5rem, env(safe-area-inset-bottom));
    }

    button#typeBtn {
        padding: 0.75rem 1.25rem;
    }

    .button-content span {
        display: none; 
    }
}
