body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #0a0a0a;
    color: #fff;
}

.screen {
    min-height: 100vh;
}

.style-btn {
    transition: all .2s;
}
.style-btn.active,
.style-btn:hover {
    background-color: #ffc107;
    color: #000;
    border-color: #ffc107;
}

.camera-wrap {
    position: relative;
    width: 480px;
    height: 480px;
    overflow: hidden;  /* imprescindible para que el box-shadow no se escape */
    border-radius: .375rem;
    border: 3px solid #ffc107;
}

#video {
    transform: scaleX(-1);
    background: #111;
    display: block;
    width: 480px;
    height: 480px;
    object-fit: cover;
}

/* Canvas de previsualización: se superpone al video tras el disparo */
#canvas {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 480px;
    height: 480px;
    object-fit: cover;
    z-index: 11;
}
#canvas.visible {
    display: block;
}

/* Capa guía sobre el vídeo */
#face-guide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

/* Óvalo: el box-shadow oscurece TODO excepto el interior del óvalo */
#face-oval {
    width: 200px;
    height: 280px;
    border: 3px dashed rgba(255, 193, 7, 0.95);
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
    transition: width .35s ease, height .35s ease, border-color .3s ease, box-shadow .3s ease;
}

/* Sin cara detectada: óvalo rojo */
#face-oval.no-face {
    border-color: rgba(220, 53, 69, 0.95);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    animation: oval-pulse 1.2s ease-in-out infinite;
}

/* Cara detectada: óvalo verde */
#face-oval.face-ok {
    border-color: rgba(40, 167, 69, 0.95);
    border-style: solid;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}

@keyframes oval-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .55; }
}

#face-oval.group-mode {
    width: 420px;
    height: 240px;
}

#guide-hint {
    margin-top: 12px;
    font-size: .8rem;
    background: rgba(0,0,0,.65);
    color: #ffc107;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    transition: color .3s;
}
#guide-hint.hint-ok  { color: #28a745; }
#guide-hint.hint-err { color: #dc3545; }

#face-count-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,193,7,.9);
    color: #000;
    font-weight: bold;
    font-size: .75rem;
    padding: 3px 10px;
    border-radius: 20px;
    display: none;
}

/* Flash de cámara */
#camera-flash {
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 20;
    border-radius: .375rem;
}
#camera-flash.fire {
    animation: flash-anim .9s ease-out forwards;
}
@keyframes flash-anim {
    0%   { opacity: 1; }
    15%  { opacity: .95; }
    100% { opacity: 0; }
}

#countdown-display {
    font-size: 8rem;
    line-height: 1;
    text-shadow: 0 0 30px rgba(255, 193, 7, 0.8);
    transition: transform .1s;
}
#countdown-display.pulse {
    transform: scale(1.2);
}

.gallery-card {
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
}
.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.3);
    border-color: #ffc107 !important;
}