/* intro-video.css — v1.5.0 */

/* ── Pantalla completa real (Android requestFullscreen) ───────────────── */
/*
 * Cuando el navegador concede fullscreen al overlay,
 * el elemento pasa a ser el "viewport" — hay que asegurarse
 * de que ocupa el 100% de ese nuevo contexto.
 */
.intro-video-overlay:fullscreen,
.intro-video-overlay:-webkit-full-screen,
.intro-video-overlay:-ms-fullscreen {
    width: 100% !important;
    height: 100% !important;
}

/* ── Overlay ──────────────────────────────────────────────────────────── */

.intro-video-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    width: 100%;
    width: 100vw;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: -webkit-fill-available;
    background: #000;
    overflow: hidden;
    isolation: isolate;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.intro-video-overlay[data-hidden] {
    opacity: 0;
    pointer-events: none;
}

/* ── Vídeo ────────────────────────────────────────────────────────────── */

/*
 * Por defecto (desktop / landscape): cover — llena toda la pantalla.
 * En portrait móvil el JS añade la clase .iv-portrait al elemento <video>
 * → object-fit: contain para encajar el vídeo en la anchura sin recortar.
 */
.intro-video-player {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: #000;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    transition: object-fit 0s; /* evita flash en el cambio */
}

.intro-video-player.iv-portrait {
    object-fit: contain;
}

/* ── Botones base ─────────────────────────────────────────────────────── */

.intro-video-skip,
.intro-video-sound-btn {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    text-decoration: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.4s ease;
}

.intro-video-skip:hover,
.intro-video-skip:focus-visible,
.intro-video-sound-btn:hover,
.intro-video-sound-btn:focus-visible {
    background: rgba(0, 0, 0, 0.82);
    border-color: rgba(255, 255, 255, 0.8);
    outline: none;
}

/* ── Botón Saltar Intro ── derecha ────────────────────────────────────── */

.intro-video-skip {
    right: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

/* ── Botón sonido ── izquierda ────────────────────────────────────────── */

.intro-video-sound-btn {
    left: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.intro-video-sound-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

.intro-video-sound-btn[data-hidden] {
    opacity: 0;
    pointer-events: none;
}

/* ── Banner "Gira el móvil" ───────────────────────────────────────────── */
/*
 * El JS crea el elemento y lo elimina del DOM.
 * El CSS solo gestiona apariencia y animaciones.
 */

.intro-video-rotate-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 18px 26px;
    background: rgba(0, 0, 0, 0.70);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 18px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    pointer-events: none;
    /* Fade-in con retardo */
    opacity: 0;
    animation: iv-fadein 0.5s ease 0.8s forwards;
}

.intro-video-rotate-hint svg {
    width: 52px;
    height: 52px;
    animation: iv-spin-phone 1.8s ease-in-out 1.3s 2;
}

/* El JS añade esta clase para ocultar con fade-out antes de eliminar del DOM */
.intro-video-rotate-hint.iv-hint-hide {
    animation: iv-fadeout 0.5s ease forwards;
}

@keyframes iv-fadein {
    from { opacity: 0; transform: translate(-50%, -46%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes iv-fadeout {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes iv-spin-phone {
    0%   { transform: rotate(0deg)   scale(1);    }
    35%  { transform: rotate(-90deg) scale(1.08); }
    65%  { transform: rotate(-90deg) scale(1.08); }
    100% { transform: rotate(0deg)   scale(1);    }
}

/* ── Responsive ── botones más pequeños en móvil ──────────────────────── */

@media (max-width: 480px) {
    .intro-video-skip,
    .intro-video-sound-btn {
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        padding: 9px 13px;
        font-size: 13px;
    }
    .intro-video-skip      { right: 14px; }
    .intro-video-sound-btn { left:  14px; }
}

/* ── Ocultar controles nativos WebKit/Blink ───────────────────────────── */

.intro-video-player::-webkit-media-controls,
.intro-video-player::-webkit-media-controls-enclosure,
.intro-video-player::-webkit-media-controls-panel,
.intro-video-player::-webkit-media-controls-play-button,
.intro-video-player::-webkit-media-controls-start-playback-button {
    display: none !important;
    -webkit-appearance: none;
    appearance: none;
}
