* {
    box-sizing: border-box;
}

body { 
    font-family: sans-serif; 
    font-size: 18px;
    margin: 0; 
    background-color: #f0f0f0; 
    color: #333; 
}

.container {
    width: 100%; 
    padding: 1em;    
}

header, main, footer {
    text-align: center;
}

h1 {
    font-size: 1.8em; 
    margin-top: 0; 
}

button {
    font-size: 3em;     
    cursor: pointer;     
}

.controls, .preview-controls {
    margin: 1em 0; 
}

#result-container {
    position: relative; 
    max-width: 100%; 
    margin: 0 auto; 
    border: 1px solid #ccc; 
    background-color: #000; 
}

video {
    display: block; 
    width: 100%; 
    height: auto; 
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none; 
}

#legend {
    display: flex; 
    flex-wrap: wrap;
    justify-content: center; 
    margin: 1em 0; 
    padding: 0; 
    list-style: none; 
}

.legend-item {
    display: flex;
    align-items: center; 
    border: 1px solid #ccc;
    background-color: #fff;
    padding: 5px 10px;
    border-radius: 5px; 
    font-size: 0.9em;
}

.legend-color {
    width: 15px;
    height: 15px;
    margin-right: 8px;
    border: 1px solid #ddd;
}

#capture-preview-container {
    margin-top: 2em;
    margin-bottom: 1em;    
}

.hidden {
    display: none;
}

@media (min-width: 768px) {
    body {
        font-size: 16px; 
    }

    .container {
        max-width: 960px; 
        margin: 0; 
        padding: 2em; 
    }

    button {
    font-size: 1em;     
    cursor: pointer;     
}

    header, main, footer {
        text-align: left;
    }

    .controls, #legend, .preview-controls {
        
        justify-content: left; 
    }

    h1 {
        font-size: 2.5em;
    }
}

