/* BASE */

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

html,
body {
    width: 100%;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}


/* CONTENEDOR */

.container {
    width: auto;
    height: max-content;
    position: relative;
    overflow: hidden;
}

.container .fondo {
    width: auto;
    height: 100dvh;
    object-fit: contain;
}


/* LOGO */

.logo {
    position: absolute;
    width: 11%;
    top: 3%;
    right: 0%;
    transform: translateX(-50%);
    z-index: 5;
}

.logo-img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    animation: logoAparece 3s ease-out forwards;
}

@keyframes logoAparece {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(-30px);
    }
    70% {
        opacity: 1;
        transform: scale(1.08) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}


/* HOME */

.home {
    position: absolute;
    width: 70%;
    height: auto;
    top: 4.4%;
    left: 0%;
    border-radius: 50%;
}

.home img {
    width: 100%;
    height: 100%;
}

/* MARCADORES */

.marcadores {
    position: absolute;
    width: 72%;
    top: 24%;
    left: 14%;
    z-index: 5;
}

.fila {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4%;
    margin-bottom: 4%;
}

.fila h2 {
    color: #08246f;
    font-size: clamp(22px, 4.5vh, 42px);
    font-weight: 900;
    line-height: 1;
}

.pill {
    width: 38%;
    height: clamp(42px, 7vh, 70px);
    border-radius: 999px;
    color: #fff;
    font-size: clamp(28px, 5.5vh, 52px);
    font-weight: 900;
    display: flex;
    justify-content: center;
    align-items: center;
}

.azul {
    background: #344bd6;
}

.naranja {
    background: linear-gradient(90deg, #ffa733, #f27a00);
}

/* CÁMARA */

.camara-contenedor {
    position: absolute;
    width: 92%;
    height: 47%;
    left: 4%;
    top: 42%;
    z-index: 5;
    border-radius: 6%;
    background: linear-gradient(90deg, #ffc15c, #f57b00);
    padding: 8% 4% 4%;
    display: flex;
    flex-direction: column;
}

.mensaje {
    position: absolute;
    top: 2%;
    left: 5%;
    background: #344bd6;
    color: #fff;
    padding: 1.6% 4%;
    border-radius: 999px;
    font-size: clamp(10px, 1.8vh, 16px);
    font-weight: 800;
    white-space: nowrap;
}

.camara {
    width: 100%;
    height: 100%;
    border-radius: 5%;
    background: linear-gradient(120deg, #ffe0a2, #f1a052);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.camara span {
    font-size: clamp(40px, 7vh, 70px);
    filter: grayscale(1) brightness(5);
}

#canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 5%;
}

#video.video-hidden {
    display: none !important;
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* MODAL */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #344bd6, #2a3ba0);
    padding: clamp(30px, 8vw, 60px);
    border-radius: 20px;
    text-align: center;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    color: #fff;
    font-size: clamp(32px, 7vw, 48px);
    margin-bottom: clamp(20px, 5vw, 40px);
    font-weight: 900;
}

.modal-stats {
    margin-bottom: clamp(20px, 5vw, 40px);
    color: #fff;
    font-size: clamp(16px, 3.5vw, 24px);
    line-height: 1.8;
}

.modal-stats div {
    margin: clamp(8px, 2vw, 15px) 0;
    font-weight: 600;
}

.modal-buttons {
    display: flex;
    gap: clamp(10px, 3vw, 20px);
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: clamp(12px, 2vw, 18px) clamp(24px, 4vw, 40px);
    border: none;
    border-radius: 999px;
    font-size: clamp(14px, 2.5vw, 20px);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(90deg, #ffa733, #f27a00);
    color: #fff;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 167, 51, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 2px solid #fff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* RESPONSIVE MÓVIL */

@media (max-width: 767px) {
    .marcadores {
        width: 78%;
        top: 23%;
        left: 11%;
    }

    .fila {
        gap: 5%;
        margin-bottom: 5%;
    }

    .fila h2 {
        font-size: clamp(24px, 7vw, 36px);
    }

    .pill {
        width: 42%;
        height: clamp(42px, 8vw, 58px);
        font-size: clamp(28px, 8vw, 44px);
    }

    .camara-contenedor {
        width: 92%;
        height: 42%;
        left: 4%;
        top: 41%;
        padding: 9% 4% 4%;
        border-radius: 7%;
    }

    .mensaje {
        top: 2%;
        left: 5%;
        font-size: clamp(9px, 2.8vw, 13px);
        padding: 1.8% 4%;
    }

    .camara {
        border-radius: 6%;
    }

    .camara span {
        font-size: clamp(42px, 12vw, 65px);
    }
}

@media (max-width: 390px) {
    .marcadores {
        top: 22.5%;
        width: 82%;
        left: 9%;
    }

    .fila h2 {
        font-size: clamp(22px, 7vw, 30px);
    }

    .pill {
        width: 43%;
        height: 44px;
        font-size: 30px;
    }

    .camara-contenedor {
        top: 40%;
        height: 43%;
    }

    .mensaje {
        font-size: 9px;
    }
}

/* TABLETS / IPAD */

@media (min-width: 768px) and (max-width: 1024px) {

    .logo {
        width: 12%;
        top: 3%;
    }

    .home {
        width: 72%;
        top: 4%;
    }

    .marcadores {
        width: 70%;
        left: 15%;
        top: 22%;
    }

    .fila {
        margin-bottom: 3%;
    }

    .fila h2 {
        font-size: clamp(30px, 3vw, 42px);
    }

    .pill {
        width: 40%;
        height: 58px;
        font-size: 42px;
    }

    .camara-contenedor {
        width: 90%;
        left: 5%;
        top: 38%;
        height: 47%;
        padding: 7% 3% 3%;
    }

    .mensaje {
        font-size: 13px;
        padding: 10px 18px;
    }

    .camara span {
        font-size: 70px;
    }
}


/* FIX: evitar cámara duplicada */

.camara {
    position: relative;
    overflow: hidden;
}

.video-hidden,
#video {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    left: -9999px;
    top: -9999px;
}

#canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: inherit;
    object-fit: cover;
}