@font-face {
    font-family: 'Roboto Flex';
    src: url('../assets/fonts/RobotoFlex.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
}

@font-face {
    font-family: 'Satoshi';
    src: url('../assets/fonts/SatoshiVariable.ttf') format('truetype');
    font-weight: 300 900;
    font-style: normal;
}

@font-face {
    font-family: 'Bebas Neue';
    src: url('../assets/fonts/BebasNeueBook.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Bebas Neue';
    src: url('../assets/fonts/BebasNeueRegular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Bebas Neue';
    src: url('../assets/fonts/BebasNeueBold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
    font-family: 'Roboto Flex', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Video de la cámara de fondo */
#camera-feed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    object-fit: cover;
    z-index: 1;
}

/* Canvas 3D transparente superpuesto */
#ar-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 2;
    pointer-events: none;
}

/* Pantalla de bloqueo PC */
#desktop-fallback,
#desktop-fallback-proximamente {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #0b0f19;
    background-image: url('../assets/fondo-disa-desktop.jpg');
    background-size: cover;
    background-position: center bottom;
    color: white;
    z-index: 9999;
    display: none;
    /* Se activa vía JS si no es móvil */
    justify-content: center;
    align-items: center;
    text-align: center;
}

#desktop-fallback.show,
#desktop-fallback-proximamente.show {
    display: flex !important;
}

.hide {
    display: none !important;
}

#desktop-fallback .desktop-content,
#desktop-fallback-proximamente .desktop-content {
    align-items: center;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    padding: 0 0 10vh 0;
}

.desktop-pretitle {
    color: #ffffff;
    font-family: 'Satoshi', sans-serif;
    font-size: 1.5vw;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 1.15em;
    opacity: 0.7;
    margin: 0 0 4vh 0;

    @media (width >=1441px) {
        margin: 0 0 2vh 0;
        font-size: 16pt;
    }
}

.desktop-title {
    color: #ffffff;
    font-size: 5.9259vw;
    font-weight: 500;
    letter-spacing: 0.35em;
    line-height: 1.35;
    margin: 0;
    text-indent: 12px;

    @media (width >=1441px) {
        font-size: 64pt;
        margin: 0 0 1.5vh;
    }
}

.desktop-subtitle {
    color: #ffffff;
    font-size: 2.5vw;
    font-weight: 300;
    line-height: 1.1;
    margin: 0 0 4vh 0;

    @media (width >=1441px) {
        margin: 0 0 4vh 0;
        font-size: 28pt;
    }
}

.desktop-disclaimer-proximamente {
    color: #ffffff;
    font-size: 2.5vw;
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 300;
    line-height: 1.1;
    margin: 0 0 4vh 0;

    @media (width >=1441px) {
        margin: 0 0 4vh 0;
        font-size: 32pt;
    }
}

.desktop-qr-container {
    height: 20vw;
    margin-bottom: 45px;
    width: 20vw;

    @media (width >=1441px) {
        height: 265px;
        width: 265px;
    }
}

.desktop-qr-container img {
    height: 100%;
    /* Truco para hacer el fondo negro del QR transparente en CSS dejando intacto el blanco */
    mix-blend-mode: screen;
    object-fit: contain;
}

.desktop-svg-container {
    width: 60vw;
    height: 20vw;
    max-width: 530px;
    margin-bottom: 40px;
    opacity: 0.85;

    @media (width >=1441px) {
        height: 265px;
    }
}

.desktop-svg-container svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.desktop-disclaimer {
    font-size: 2.4074vw;
    font-weight: 300;
    line-height: 1;
    margin: 0;

    @media (width >=1441px) {
        font-size: 26.02pt;
    }
}

#desktop-footer-logos {
    bottom: 7vh;
    height: 6vw;
    object-fit: contain;
    position: absolute;

    @media (width >=1441px) {
        height: 90px;
    }
}

/* Interfaz inicial de permisos (Home) */
#ui,
#ui-proximamente {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    height: 100ddvh;
    z-index: 4;
    background-color: transparent;
    color: white;
    text-align: center;
    overflow: hidden;
}

/* Fondo estrellas animado con paneo lateral */
.ui-background {
    position: fixed;
    top: 0;
    left: -15%;
    width: 130%;
    height: 100dvh;
    height: 100ddvh;
    background-image: url('../assets/fondo-estrellas-disa.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: 1;
    will-change: transform;
    animation: bgPan 15s ease-in-out infinite alternate;
}

/* Capa estación (PNG con transparencia, estática, anclada al bottom) */
.ui-background-station {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65dvw;
    max-height: 720px;
    background-image: url('../assets/fondo-disa-estacion.png');
    background-size: 100% auto;
    background-position: center 0;
    background-repeat: no-repeat;
    z-index: 2;
    pointer-events: none;
}

@keyframes bgPan {
    0% {
        transform: translateX(0%);
    }

    50% {
        transform: translateX(5%);
    }

    100% {
        transform: translateX(-5%);
    }
}

.ui-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100dvh;
    height: 100ddvh;
    position: absolute;
    top: 0;
    left: 0;
    padding: 0 20px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
    z-index: 10;
}

.ui-spacer {
    flex-grow: 1;
    /* Empuja el texto y botón hacia abajo */
}

/* ── Constelación Vectorial Hero ─────────────────────────────── */
.constellation-hero {
    width: 85%;
    max-width: 340px;
    margin: 5dvw auto 0;
    opacity: 0.85;
}

.constellation-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

/* Trapecio: se dibuja al entrar, luego pulsa */
.constel-trap {
    /* Perímetro aprox 620 */
    stroke-dasharray: 620;
    stroke-dashoffset: 620;
    animation:
        drawTrap 2s cubic-bezier(0.3, 0, 0.2, 1) 0s forwards,
        pulseTrap 5s ease-in-out 2.2s infinite;
}

@keyframes drawTrap {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes pulseTrap {

    0%,
    100% {
        stroke-opacity: 0.7;
    }

    50% {
        stroke-opacity: 1;
    }
}

/* Etiquetas de las estrellas (Años) */
.star-label {
    fill: #ffffff;
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 300;
    font-size: 8px;
    text-anchor: end;
    pointer-events: none;
    letter-spacing: 0.5px;
}

.star-label tspan {
    font-weight: 800;
    fill: #ffffff;
    baseline-shift: 0;
    /* Fuerza a iOS Safari a anclarlo a la misma base */
}

/* Estrellas: visibles desde el inicio, cada una pulsa de forma independiente */

/* Halo exterior (nth-child 1): gran respiración de opacidad */
.star-dot circle:nth-child(1) {
    animation: haloBreath 3.5s ease-in-out var(--sp, 0s) infinite;
}

/* Corona media (nth-child 2): respira con más opacidad */
.star-dot circle:nth-child(2) {
    animation: coronaBreath 3s ease-in-out calc(var(--sp, 0s) + 0.25s) infinite;
}

/* Capa interior (nth-child 3): la más vibrante */
.star-dot circle:nth-child(3) {
    animation: innerBreath 2.6s ease-in-out calc(var(--sp, 0s) + 0.1s) infinite;
}

/* Núcleo blanco: pulso SUTIL — no crece más allá de 1.4x */
.s-core {
    animation: coreBreath 2.6s ease-in-out var(--sp, 0s) infinite;
    transform-box: fill-box;
    transform-origin: center;
}

@keyframes haloBreath {

    0%,
    100% {
        opacity: 0.07;
    }

    50% {
        opacity: 0.45;
    }
}

@keyframes coronaBreath {

    0%,
    100% {
        opacity: 0.18;
    }

    50% {
        opacity: 0.75;
    }
}

@keyframes innerBreath {

    0%,
    100% {
        opacity: 0.45;
    }

    50% {
        opacity: 1;
    }
}

/* El núcleo solo se estira hasta 1.4x — el glow hace el resto */
@keyframes coreBreath {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.95;
    }

    50% {
        transform: scale(1.35);
        opacity: 0.7;
    }
}

.ui-title {
    font-size: 7.4074vw;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 3.3vw;
    margin: 10vh 0 0 0;
    color: #ffffff;
}

.ui-pretitle {
    color: #ffffff;
    font-family: 'Satoshi', sans-serif;
    font-size: 2.8dvw;
    font-weight: 600;
    letter-spacing: 1.2em;
    line-height: 1.1;
    margin: 0 0 1dvh 0;
    opacity: 0.7;
    position: absolute;
    top: 7.1dvh;
}

.ui-subtitle {
    font-size: 4.6296dvw;
    font-weight: 300;
    line-height: 1.4;
    position: absolute;
    bottom: 67dvw;
    margin: 0;
    color: #ffffff;
}

.ui-disclaimer-proximamente {
    bottom: 32dvw;
    color: #ffffff;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 4.5dvw;
    font-weight: 300;
    line-height: 1.1;
    margin: 0;
    position: absolute;
    width: 100%;
}

#start-btn {
    bottom: 32dvw;
    /* Deja libre el espacio para la estación DISA */
    animation: pulseCenter 1.5s infinite;
    position: absolute;
}

@keyframes pulseCenter {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.ui-footer {
    position: absolute;
    /* Footer se ubica justo encima de la estación: la estación ocupa ~55vw de altura */
    bottom: 8dvw;
    left: 0;
    width: 100%;
    padding: 8px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    box-sizing: border-box;
    z-index: 10;
}

.ui-footer img {
    height: 38px;
    max-width: 90%;
    object-fit: contain;
}

button {
    padding: 16px 32px;
    font-size: 1.2rem;
    background: #e1f5ff;
    border: none;
    color: #010101;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Roboto Flex', sans-serif;
    box-shadow: 0 4px 15px rgba(225, 245, 255, 0.3);
    transition: transform 0.2s;
    white-space: nowrap;
}

button:active {
    transform: scale(0.95);
}

/* Botón Flotante para ver info de Estrella */
#action-btn {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    background: #e1f5ff;
    color: #010101;
    padding: 18px 60px;
    box-shadow: 0 4px 20px rgba(225, 245, 255, 0.4);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: translateX(-50%) scale(1);
    }

    50% {
        transform: translateX(-50%) scale(1.05);
    }

    100% {
        transform: translateX(-50%) scale(1);
    }
}

/* Modal de Información de Estrella */
#star-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    opacity: 1;
    transition: opacity 0.3s ease;
}

#star-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #050b14;
    padding: 40px 30px;
    border-radius: 24px;
    border: 1px solid rgba(85, 190, 255, 0.4);
    color: white;
    text-align: center;
    position: relative;
    max-width: 420px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9);
    margin-top: 60px;
}

/* El resplandor animado interno (detectable en mobile) */
.modal-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, #1a3a5a 0%, transparent 60%);
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
    animation: modalPulse 2.5s ease-in-out infinite alternate;
}

@keyframes modalPulse {
    0% {
        transform: translate(-5%, -10%) scale(0.9);
        opacity: 0.1;
    }

    100% {
        transform: translate(5%, 10%) scale(1.3);
        opacity: 1;
    }
}

/* Forzar que el contenido esté por encima del gradiente */
.modal-content h2,
.modal-content h3,
.modal-content p {
    position: relative;
    z-index: 1;
}

.modal-image-container {
    position: absolute;
    top: -65px;
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: #000;
    padding: 0;
    border: 3px solid #ffffff;
    box-shadow: 0 0 45px rgba(85, 190, 255, 0.9);
    z-index: 2;
    overflow: hidden;
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background-color: #000;
}

.modal-content h2 {
    color: #ffffff;
    letter-spacing: 14px;
    font-size: 3.2rem;
    margin: 60px 0 20px 0;
    font-weight: 800;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.modal-content h3 {
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 30px 0;
    white-space: pre-line;
    line-height: 1.4;
}

.modal-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    text-align: center;
}

/* Mira central */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 2.5rem;
    font-weight: 300;
    z-index: 3;
    pointer-events: none;
    display: none;
}

/* Mensaje de estado dinámico */
#feedback-msg {
    position: absolute;
    top: 15%;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 2.2rem;
    line-height: 1.2;
    z-index: 3;
    font-weight: 700;
    text-shadow: 0px 4px 15px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    display: none;
    padding: 0 20px;
    box-sizing: border-box;
}