/* OPENOFGAPIT3-0hyperspace.css — cinematic pro */

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

body {
    position: relative;
    font-family: "Segoe UI", Arial, sans-serif;
    color: #fff;
}

/* Fond hyperspace */
canvas#space {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background:
        radial-gradient(circle at center, rgba(20,30,70,0.55) 0%, rgba(0,0,0,0.95) 48%, #000 100%);
}

/* Flash */
#flash {
    position: fixed;
    inset: 0;
    z-index: 8;
    opacity: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at center, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.18) 22%, rgba(255,255,255,0) 62%);
    transition: opacity 0.85s ease;
}
#flash.show {
    opacity: 1;
}

/* Crawl */
.crawl-wrap {
    position: fixed;
    inset: 0;
    z-index: 4;
    perspective: 560px;
    pointer-events: none;
    overflow: hidden;
}

.crawl {
    position: absolute;
    left: 50%;
    bottom: -90%;
    width: min(88vw, 760px);
    transform: translateX(-50%) rotateX(23deg);
    transform-origin: 50% 100%;
    text-align: center;
    opacity: 0;
    color: #ffe889;
    text-shadow:
        0 0 10px rgba(255, 217, 61, 0.22),
        0 0 26px rgba(255, 217, 61, 0.12);
}

.crawl h1 {
    margin: 0 0 20px;
    font-size: clamp(28px, 5vw, 64px);
    font-weight: 800;
    letter-spacing: 0.08em;
}

.crawl p {
    margin: 0;
    font-size: clamp(18px, 2.1vw, 31px);
    line-height: 1.65;
    font-weight: 600;
}

.crawl.show {
    opacity: 1;
    animation: gp3Crawl 22s linear forwards;
}

@keyframes gp3Crawl {
    0% {
        bottom: -72%;
        opacity: 0;
    }
    6% {
        opacity: 1;
    }
    100% {
        bottom: 118%;
        opacity: 0;
    }
}

/* Orb */
#orb {
    position: fixed;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.15);
    z-index: 6;
    opacity: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 35% 35%, rgba(255,255,255,0.95), rgba(170,220,255,0.9) 25%, rgba(70,130,255,0.9) 52%, rgba(0,0,0,0) 74%);
    box-shadow:
        0 0 24px rgba(120, 190, 255, 0.9),
        0 0 58px rgba(72, 145, 255, 0.7),
        0 0 140px rgba(72, 145, 255, 0.28);
    transition:
        opacity 1s ease,
        transform 3.6s cubic-bezier(.18,.7,.22,1),
        box-shadow 3.6s ease;
}

#orb.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(6.5);
}

#orb.explode {
    opacity: 0;
    transform: translate(-50%, -50%) scale(18);
    box-shadow:
        0 0 40px rgba(255,255,255,1),
        0 0 100px rgba(130,200,255,0.95),
        0 0 220px rgba(130,200,255,0.45);
}

/* Image finale */
#finalImage {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 7;
    width: min(78vw, 900px);
    max-height: 84vh;
    object-fit: contain;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.22);
    filter:
        drop-shadow(0 0 20px rgba(255,255,255,0.18))
        drop-shadow(0 0 70px rgba(120,180,255,0.12));
}

/* Bubble */
#bubble {
    position: fixed;
    left: 50%;
    bottom: 8vh;
    transform: translateX(-50%);
    z-index: 9;
    min-width: 280px;
    max-width: min(92vw, 760px);
    padding: 18px 24px;
    border-radius: 18px;
    display: none;
    text-align: center;
    font-size: clamp(20px, 2vw, 32px);
    line-height: 1.4;
    color: #fff;
    background: rgba(7, 10, 24, 0.66);
    border: 1px solid rgba(145, 195, 255, 0.38);
    box-shadow:
        0 10px 40px rgba(0,0,0,0.45),
        0 0 32px rgba(100,160,255,0.18);
    backdrop-filter: blur(10px);
}

#bubble.show {
    display: block;
    animation: bubbleIn 1s ease forwards;
}
#bubble.hide {
    animation: bubbleOut 1s ease forwards;
}

@keyframes bubbleIn {
    from { opacity: 0; transform: translateX(-50%) translateY(26px) scale(0.95); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes bubbleOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    to   { opacity: 0; transform: translateX(-50%) translateY(18px) scale(0.97); }
}

/* Contrôles */
.controls {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 12;
}

#playBtn,
#enableAudioBtn,
#reloadCard button {
    appearance: none;
    border: 1px solid rgba(135, 195, 255, 0.35);
    background: rgba(10, 16, 32, 0.82);
    color: #d7ebff;
    border-radius: 12px;
    padding: 10px 14px;
    font: 600 13px/1 "Segoe UI", Arial, sans-serif;
    letter-spacing: 0.06em;
    cursor: pointer;
}

#playBtn:hover,
#enableAudioBtn:hover,
#reloadCard button:hover {
    background: rgba(18, 28, 56, 0.94);
}

/* Notice audio */
#audioNotice {
    position: fixed;
    left: 50%;
    top: 18px;
    transform: translateX(-50%);
    z-index: 12;
    display: none;
    text-align: center;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(0,0,0,0.75);
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 10px 32px rgba(0,0,0,0.35);
}

/* Reload */
#reloadOverlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.58);
    backdrop-filter: blur(4px);
}

#reloadCard {
    min-width: 280px;
    max-width: 90vw;
    text-align: center;
    padding: 24px 22px;
    border-radius: 18px;
    background: rgba(8, 12, 26, 0.88);
    border: 1px solid rgba(150,200,255,0.25);
    box-shadow: 0 12px 48px rgba(0,0,0,0.4);
    color: #fff;
}

#reloadCard > div {
    margin-bottom: 14px;
    font-size: 18px;
    font-weight: 700;
}

@media (max-width: 700px) {
    #bubble {
        font-size: 18px;
        bottom: 5vh;
        padding: 14px 16px;
    }

    .crawl p {
        font-size: clamp(15px, 4.4vw, 22px);
    }

    .crawl h1 {
        font-size: clamp(24px, 8vw, 44px);
    }

    .controls {
        top: 10px;
        right: 10px;
    }
}