body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
}

.container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror effect for selfie */
    filter: brightness(0.6) contrast(1.2) grayscale(0.3); /* Dark, cool tone for "night window" effect */
}

#fogCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: crosshair;
    touch-action: none; /* Critical for mobile touch drawing */
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas */
    z-index: 20;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-family: sans-serif;
    font-size: 24px;
    background: rgba(0,0,0,0.5);
    padding: 20px;
    border-radius: 10px;
}

#result {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #e63946;
    font-family: Arial, sans-serif;
    font-size: 24px;
    text-shadow: 1px 1px 2px black;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 20px;
}

#error-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 80%;
    z-index: 100;
}

#error-overlay h2 {
    color: #ff4444;
    margin-top: 0;
}
