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

html, body {
    height: 100%;
    overflow: hidden;
    font-family: sans-serif;
    text-align: center;
}

body {
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding: 1rem;
}

/* Screens */
#screen-intro,
#screen-game,
#screen-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 640px;
    gap: 0.6rem;
}

.hidden { display: none !important; }

h1 { font-size: 1.8rem; }

p.subtitle {
    color: #555;
    font-size: 0.95rem;
}

/* Webcam container — fills remaining space between title and button */
#webcam-container {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
}

#webcam-container canvas {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    display: block;
}

#countdown {
    font-size: 6rem;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-shadow: 0 2px 8px #000;
    pointer-events: none;
}

button {
    padding: 0.6rem 1.8rem;
    font-size: 1rem;
    cursor: pointer;
}

#result-photo {
    max-height: 35vh;
    border-radius: 8px;
}

#outcome { font-size: 1.5rem; font-weight: bold; }

#details { color: #555; }
