/* Bithereum Cinematic Intro — overlay, text cards, skip + end card.
 * Loaded by game.html before the launch handler dynamic-imports intro.js.
 */

#bv-intro-root {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #000;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    font-family: 'Nunito', sans-serif;
    opacity: 0;
    transition: opacity 380ms ease;
}
#bv-intro-root.bv-intro-visible { opacity: 1; }
#bv-intro-root.bv-intro-fading  { opacity: 0; pointer-events: none; }

#bv-intro-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.bv-intro-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background:
        radial-gradient(ellipse at center, rgba(0,0,0,0) 35%, rgba(0,0,0,0.55) 75%, rgba(0,0,0,0.88) 100%),
        linear-gradient(180deg, rgba(0,0,0,0.40) 0%, rgba(0,0,0,0) 18%, rgba(0,0,0,0) 78%, rgba(0,0,0,0.55) 100%);
    transition: opacity 1.0s ease;
    opacity: 0;
}

.bv-intro-overlays {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.bv-intro-line {
    position: absolute;
    bottom: 16vh;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0 6vw;
    font-family: 'Bangers', 'Nunito', sans-serif;
    font-size: clamp(1.6rem, 4.5vw, 3.4rem);
    letter-spacing: 0.06em;
    line-height: 1.1;
    color: #fff;
    opacity: 0;
    transform: translateY(18px) scale(0.97);
    transition: opacity .55s ease, transform .55s ease;
    text-shadow:
        0 0 24px rgba(255, 215, 60, 0.55),
        0 0 60px rgba(78, 216, 255, 0.30),
        0 4px 18px rgba(0, 0, 0, 0.95);
    will-change: opacity, transform;
}
.bv-intro-line.bv-show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.bv-intro-skip {
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    z-index: 5;
    pointer-events: auto;
    background: rgba(15, 24, 48, 0.65);
    color: #f0f4fa;
    border: 1px solid rgba(255, 215, 60, 0.35);
    border-radius: 999px;
    padding: 9px 18px;
    font: 600 0.85rem 'Nunito', sans-serif;
    letter-spacing: 0.05em;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background .2s ease, transform .15s ease, opacity .2s ease;
}
.bv-intro-skip:hover { background: rgba(20, 30, 60, 0.85); }
.bv-intro-skip:active { transform: scale(0.97); }
.bv-intro-skip:focus-visible {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}
.bv-intro-skip[disabled] {
    opacity: 0.4;
    pointer-events: none;
}

.bv-intro-loading {
    position: absolute;
    bottom: 8vh;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 4;
    pointer-events: none;
    font: 600 0.95rem 'Nunito', sans-serif;
    color: rgba(240, 244, 250, 0.85);
    letter-spacing: 0.06em;
    opacity: 0;
    transition: opacity .3s ease;
}
.bv-intro-loading.bv-show { opacity: 1; }

.bv-intro-end-card {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .8s ease;
}
.bv-intro-end-card.bv-show {
    opacity: 1;
    pointer-events: auto;
}

.bv-intro-start-btn {
    font-family: 'Bangers', 'Nunito', sans-serif;
    font-size: clamp(2rem, 6vw, 4rem);
    letter-spacing: 0.18em;
    color: #FFD700;
    background: transparent;
    border: 2px solid rgba(255, 215, 60, 0.6);
    border-radius: 999px;
    padding: 16px 48px;
    cursor: pointer;
    text-shadow: 0 0 24px rgba(255, 215, 60, 0.7), 0 0 60px rgba(255, 215, 60, 0.4);
    box-shadow: 0 0 40px rgba(255, 215, 60, 0.35), inset 0 0 20px rgba(255, 215, 60, 0.18);
    animation: bvIntroPulse 1.6s ease-in-out infinite;
    transition: transform .2s ease;
}
.bv-intro-start-btn:hover  { transform: scale(1.04); }
.bv-intro-start-btn:active { transform: scale(0.98); }
.bv-intro-start-btn:focus-visible {
    outline: 2px solid #FFD700;
    outline-offset: 4px;
}

@keyframes bvIntroPulse {
    0%, 100% {
        box-shadow: 0 0 40px rgba(255, 215, 60, 0.35), inset 0 0 20px rgba(255, 215, 60, 0.18);
        border-color: rgba(255, 215, 60, 0.6);
    }
    50% {
        box-shadow: 0 0 70px rgba(255, 215, 60, 0.7), inset 0 0 30px rgba(255, 215, 60, 0.35);
        border-color: rgba(255, 215, 60, 1);
    }
}

/* "Replay intro" link in the hub, below LAUNCH MISSION */
#replay-intro {
    display: none;
    margin-top: 10px;
    font: 600 0.78rem 'Nunito', sans-serif;
    color: rgba(141, 160, 188, 0.85);
    text-decoration: none;
    letter-spacing: 0.05em;
}
#replay-intro:hover {
    color: #FFD700;
    text-decoration: underline;
}
#replay-intro.bv-visible { display: inline-block; }

/* Tiny floating toast used by the Replay link */
.bv-intro-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 24, 48, 0.92);
    color: #FFD700;
    border: 1px solid rgba(255, 215, 60, 0.45);
    border-radius: 999px;
    padding: 10px 22px;
    font: 700 0.85rem 'Nunito', sans-serif;
    letter-spacing: 0.05em;
    z-index: 100000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.bv-intro-toast.bv-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .bv-intro-line,
    .bv-intro-end-card,
    .bv-intro-start-btn,
    .bv-intro-vignette {
        animation: none !important;
        transition: opacity .2s linear !important;
    }
}
