* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #121212;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center; /* keep everything centered */
}

header {
    text-align: center;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.2rem;
    color: #a0a0a0;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.video-wrapper {
    background-color: #1e1e1e;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 800px;
    position: relative;
}

#output_canvas {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    background-color: #000000;
    aspect-ratio: 4/3;
    object-fit: cover;
}

/* Status Overlay */
#status-overlay {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background-color: rgba(30, 30, 30, 0.88);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
}

/* Calibration Button */
#calibrate-btn {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s ease;
    font-family: inherit;
}

#calibrate-btn:hover {
    background-color: #1d4ed8;
}

#calibrate-btn:active {
    background-color: #1e40af;
}

#calibrate-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

/* Stats Dashboard */
.stats-dashboard {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 600px; /* SMALL tabular column */
    background-color: #1e1e1e;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    margin-top: -1.5rem;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    flex: 1;
    border-right: 1px solid #333333;
}

.stat-box:last-child {
    border-right: none;
}

.stat-label {
    font-size: 0.65rem;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}

.privacy-note {
    color: #a0a0a0;
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 640px) {
    body {
        padding: 1rem;
    }

    h1 {
        font-size: 2.25rem;
    }

    .video-wrapper {
        padding: 0.5rem;
    }

    #status-overlay {
        top: 1rem;
        left: 1rem;
        right: 1rem;
        font-size: 0.9rem;
    }

    #calibrate-btn {
        bottom: 1.25rem;
    }

    .stats-dashboard {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem 0;
        margin-top: 0;
    }

    .stat-box:nth-child(2) {
        border-right: none;
    }
}
