* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
    background: #050505;
}

/* =========================================================
   ESCENA
   ========================================================= */

.escena {
    position: absolute;

    /*
     * El escenario ocupa el mayor rectángulo posible
     * manteniendo exactamente la proporción 3:2.
     *
     * No depende de si estamos en ordenador, tablet,
     * móvil vertical u horizontal.
     */
    width: min(100vw, 150vh);
    height: min(100vh, calc(100vw * 2 / 3));

    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    overflow: hidden;
}

/* Imagen completa, sin recortar jamás */

.escena__fondo {
    position: absolute;
    inset: 0;

    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    user-select: none;
    -webkit-user-drag: none;
}

/* =========================================================
   ZONAS INTERACTIVAS
   ========================================================= */

.zona-interactiva {
    position: absolute;

    margin: 0;
    padding: 0;

    border: 0;
    outline: 0;

    background: transparent;

    cursor: pointer;

    /*
     * Nada de efectos visuales.
     * La zona existe únicamente para detectar el clic.
     */
}

/*
 * Coordenadas PROVISIONALES.
 *
 * Cuando carguemos la imagen veremos exactamente dónde
 * está el expediente y corregiremos estos porcentajes.
 */

.zona-expediente {
    left: 34%;
    top: 43%;

    width: 32%;
    height: 43%;
}

/* =========================================================
   AUDIO
   ========================================================= */

.control-audio {
    position: fixed;

    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));

    z-index: 100;

    display: flex;
    align-items: center;
    gap: 8px;

    padding: 7px 10px;

    border-radius: 999px;

    background: rgba(10, 10, 10, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.control-audio__boton {
    display: grid;
    place-items: center;

    width: 32px;
    height: 32px;

    padding: 0;

    border: 0;
    background: transparent;

    font-size: 18px;

    cursor: pointer;
}

.control-audio__volumen {
    width: 90px;
    cursor: pointer;
}

/*
 * En pantallas especialmente estrechas dejamos únicamente
 * un control de volumen más compacto.
 */

@media (max-width: 480px) {
    .control-audio__volumen {
        width: 65px;
    }
}

/* =========================================================
   FOTOGRAFÍA DEL SUJETO
   ========================================================= */

.zona-foto-sujeto {
    left: 46.8%;
    top: 67.5%;

    width: 8.2%;
    height: 14.5%;

    z-index: 1;
}

.zona-perfil-sujeto {
    left: 33%;
    top: 57%;

    width: 20%;
    height: 35%;

    z-index: 2;
}


/* =========================================================
   VISOR DE EVIDENCIAS
   ========================================================= */

.visor-evidencia {
    position: fixed;
    inset: 0;

    z-index: 200;

    display: flex;
    align-items: center;
    justify-content: center;

    padding:
        max(20px, env(safe-area-inset-top))
        max(20px, env(safe-area-inset-right))
        max(20px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));

    background: rgba(0, 0, 0, 0.78);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 180ms ease,
        visibility 180ms ease;
}

.visor-evidencia.activo {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.visor-evidencia__cerrar {
    position: fixed;

    top: max(18px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));

    z-index: 201;

    width: 44px;
    height: 44px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: rgba(10, 10, 10, 0.78);
    color: #fff;

    font-family: Arial, sans-serif;
    font-size: 30px;
    line-height: 1;

    cursor: pointer;
}

/* =========================================================
   FOTOGRAFÍA GIRATORIA
   ========================================================= */

.tarjeta-evidencia {
    position: relative;

    width: min(90vw, calc(90vh * 0.8));
    aspect-ratio: 4 / 5;

    perspective: 1400px;

    cursor: pointer;
}

.tarjeta-evidencia.documento {
    width: min(90vw, calc(90vh * 2 / 3));
    aspect-ratio: 2 / 3;
}

.tarjeta-evidencia__interior {
    position: relative;

    width: 100%;
    height: 100%;

    transform-style: preserve-3d;

    transition: transform 0.75s cubic-bezier(.2, .7, .2, 1);
}

.tarjeta-evidencia.girada .tarjeta-evidencia__interior {
    transform: rotateY(180deg);
}

.tarjeta-evidencia__cara {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.tarjeta-evidencia__reverso {
    transform: rotateY(180deg);
}

.tarjeta-evidencia__cara img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    user-select: none;
    -webkit-user-drag: none;

    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.55));
}