@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300..700;1,300..700&family=Great+Vibes&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Baskervville:ital,wght@0,400..700;1,400..700&display=swap");
body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    touch-action: manipulation;
    background: #5a5a5a;
    font-family: "Cormorant Garamond", serif;
    font-weight: 700;
}

:root {
    --vh: 100vh; /* fallback */
}

.fullscreen {
    height: calc(var(--vh, 1vh) * 100);
}

.container,
#pembuka,
#subPembuka,
#kabutPage,
#bintangPage {
    width: 100% !important;
    max-width: none;
}

.container {
    width: 100%;
    max-width: 428px; /* lebar maksimal seperti iPhone XR */
    height: 100vh;
    background-color: #041f3b;
    position: relative;
    overflow: hidden;
}

.popup-permission {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 4, 4, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.popup-permission p {
    font-size: 1.5rem;
    color: white;
    width: 55%;
}

.popup-permission button {
    display: block;
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border: none;
    border-radius: 15px;
    background: rgba(84, 84, 84, 0.7);
    transition: all 0.3s ease;
    color: rgb(255, 255, 255);
    text-align: center;
    margin: 10px auto;
    transition: opacity 1s ease;
    font-family: "Baskervville", serif;
}

#pembuka,
#subPembuka,
#kabutPage {
    height: calc(var(--vh, 1vh) * 100);
}

* {
    user-select: none; /* Cegah seleksi teks */
    -webkit-user-select: none; /* Untuk browser Safari */
    -ms-user-select: none; /* Untuk IE/Edge lama */
    -webkit-user-drag: none; /* Cegah drag image di Safari */
}

img {
    pointer-events: auto;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

#pembuka {
    position: fixed;
    height: 100%;
    width: 100%;
    max-width: 428px;
    background-color: #041f3b;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #5a5a5a;
    overflow: hidden;
}

#bg-pembuka {
    position: absolute;
    top: -80%;
    left: 0;
    width: 100%;
    height: auto; /* penting jika tinggi lebih dari 100vh */
    z-index: -1;
    transition: transform 3.5s ease-in-out;
}

.pesawatPembuka {
    position: absolute;
    left: 49%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    opacity: 1;
    transition: all 5s ease-in-out;
    z-index: 0; /* di bawah awan, di atas background */
    animation: floating 1.5s infinite;
}

.pesawatPembuka.terbang {
    left: 115%;
    top: 5%;
}

.judulUndangan {
    font-size: 1rem;
    color: white;
    top: 20%;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    position: absolute;
    font-size: 1.2rem;
    transition: opacity 1s ease;
}

#judul1 {
    top: 0;
    padding: 0;
    margin: 0 0 20px 0;
    font-family: "Great Vibes", serif !important;
    font-weight: 500 !important;
    font-size: 2.7rem;
    text-shadow: 0 0 5px #000000, 0 0 5px #ffffff;
}
#namaTamu {
    font-size: 1.5rem;
    color: whitesmoke;
}

.subJudulUndangan {
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 0.93rem;
    color: white;
    text-align: center;
    padding: 0 10px;
}

#buka-undangan {
    display: block;
    padding: 10px 20px;
    font-size: 0.9em;
    cursor: pointer;
    border: none;
    background: rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    color: white;
    text-align: center;
    margin: 10px auto;
    transition: opacity 1s ease;
    font-family: "Baskervville", serif;
}

/* animasi angin */
#anginEffect {
    position: absolute;
    top: 80%;
    width: 28%;
    left: 33%;
    transform: translate(-50%, 0); /* Pusat horizontal */
    pointer-events: none;
    z-index: 10;
    transform: translateY(0);
    opacity: 0;
    transition: transform 1.5s ease, opacity 0.8s ease;
}

#mic-error-msg {
    margin: 10px auto; /* Auto horizontal centering */
    text-align: center;
    font-size: 1em;
    color: #eddada;
    width: 90%;
    margin-top: 250px;
    transition: opacity 0.5s ease;
}
#buka-undangan:hover {
    background: rgba(0, 0, 0, 0.6);
    color: #f4f1eb;
}
#petunjuk {
    font-size: 1.1rem;
    margin-top: 250px;
    color: #f4f1eb;
    animation: blink 1.5s infinite;
    font-style: italic;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: "Baskervville", serif;
    font-weight: 400;
}

/* ====== sub pembuka ==== */
#subPembuka {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out, visibility 0s linear 1s; /* delay visibility */
    height: 100%;
    width: 100%;
    max-width: 428px;
    background-color: #041f3b;
    overflow: hidden;
    position: relative;
}

#bg-SubPembuka {
    position: absolute;
    top: -80%;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 0;
    transition: transform 12s ease-in-out;
}

/* Kelas untuk animasi gerak turun */
.gerakTurun {
    transform: translateY(70vh);
}

#subPembuka p {
    color: white;
    text-align: justify;
    position: relative;
    margin: 0 auto;
    top: 40%;
    font-size: 1.4rem;
    text-shadow: 0 0 5px #000, 0 0 10px #000;
    line-height: 110%;
    width: 90%;
}

#subPembuka.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 1s ease-in-out;
}

.pesawatSubPembuka {
    position: absolute;
    left: -15%;
    top: 80%;
    transform: translate(-50%, -50%);
    width: 120px;
    opacity: 1;
    transition: all 12s ease-in-out;
    z-index: 0; /* di bawah awan, di atas background */
    animation: floating 1.5s infinite;
}

.pesawatSubPembuka.terbang {
    left: 115%;
    top: 5%;
}

/* == konten tersembunyi Awan == */
#kabutPage {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out, visibility 0s linear 1s; /* delay visibility */
    height: 100%;
    width: 100%;
    max-width: 428px;
    background-color: #041f3b;
}

#bg-kabut {
    position: absolute;
    top: 0%;
    left: 0;
    width: 100%;
    height: auto; /* penting jika tinggi lebih dari 100vh */
    z-index: 0;
    transition: transform 3.5s ease-in-out;
}

#kabutPage.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 1s ease-in-out;
}

#judul2 {
    position: relative;
    z-index: 3;
    padding: 0;
    margin-top: 75px;
    color: white;
    width: 100%;
    text-align: center;
    font-size: 1.8rem;
    font-style: italic;
}

/* Posisi teks tanggal */
.tanggal {
    position: absolute;
    top: 48%;
    left: 50%;
    width: 100%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    opacity: 1; /* disembunyikan dulu */
    transition: opacity 1s ease-in-out;
    z-index: 1;
    font-family: "Cormorant Garamond", serif;
    text-align: center;
    text-shadow: 0 0 5px #000000, 0 0 5px #ffffff;
}
.tanggal > h3 {
    position: absolute;
    width: 100%;
    top: -38%;
    margin: 0;
    padding: 0;
    font-size: 2.5rem; /* opsional, bisa kamu atur sesuai preferensi */
}

.tanggal > h2 {
    margin: 0;
    padding: 0;
    font-size: 4rem; /* opsional */
}

.pesawatAwan {
    position: absolute;
    top: 80%; /* 45%*/
    left: -45%; /* 50%*/
    transform: translate(-50%, -50%);
    width: 120px;
    opacity: 1;
    transition: all 3s ease-in-out;
    z-index: 0; /* di bawah awan, di atas background */
    animation: floating 1.5s infinite;
}

@keyframes floating {
    0% {
        transform: translate(-50%, -50%) translateY(0px);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-8px);
    }
    100% {
        transform: translate(-50%, -50%) translateY(0px);
    }
}

.pesawatAwan.masuk {
    top: 34%; /* target posisi masuk */
    left: 55%;
}
.pesawatAwan.masuk.terbang {
    left: 115%;
    top: 5%;
}
.jejakPesawat {
    position: absolute;
    top: 80%; /* 53%*/
    left: -45%; /* 41%*/
    transform: translate(-50%, -50%);
    width: 170px;
    opacity: 1;
    transition: all 4s ease-in-out;
    z-index: 0; /* di bawah awan, di atas background */
    animation: floating 1.8s infinite;
}
.jejakPesawat.masuk {
    top: 48%;
    left: 27%;
}

.jejakPesawat.masuk.terbang {
    left: 120%;
    top: 5%;
}

/* Awan paling atas (posisi dan transisi) */
.awan,
.awan2,
.awan3,
.awan4 {
    position: absolute;
    transform: translateX(-50%);
    transition: all 1s ease-in-out;
    cursor: pointer;
    z-index: 2;
}
.awan {
    top: 25%;
    left: 45%;
    width: 420px;
}
.awan2 {
    top: 34%;
    left: 60%;
    width: 420px;
}
.awan3 {
    top: 38%;
    left: 10%;
    width: 420px;
}
.awan4 {
    top: 42%;
    left: 85%;
    width: 420px;
}

/* Pergeseran awan */
.awan.geser {
    left: -340px;
    transform: translateX(0);
}
.awan2.geser2 {
    left: 340px;
    transform: translateX(0);
}
.awan3.geser3 {
    left: -370px;
    transform: translateX(0);
}
.awan4.geser4 {
    left: 300px;
    transform: translateX(0);
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}
.kabutInfo {
    color: white;
    text-align: center;
    font-style: italic;
    position: absolute;
    bottom: 18%;
    padding: 0 20px;
    font-size: 1rem;
    animation: blink 1.5s infinite;
    font-family: "Baskervville", serif;
    font-weight: 400;
}

.swipeIcon {
    position: absolute;
    width: 25%;
    z-index: 10;
    left: 50%;
    top: 60%;
    transform: translateX(-40%);
    animation: swipe 1.5s infinite ease-out, blink 1.5s infinite step-start;
}

@keyframes swipe {
    0% {
        transform: translate(-50%, -50%) translateX(0px);
    }
    50% {
        transform: translate(-50%, -50%) translateX(-50px);
    }
    100% {
        transform: translate(-50%, -50%) translateX(0px);
    }
}

/* === sub Kabut ==== */

#subKabut {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out, visibility 0s linear 1s; /* delay visibility */
    height: 100%;
    width: 100%;
    max-width: 428px;
    background-color: #041f3b;
    overflow: hidden;
}

#bg-SubKabut {
    position: absolute;
    top: -80%;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 0;
    transition: transform 12s ease-in-out;
}

#subKabut p {
    color: white;
    text-align: justify;
    position: relative;
    margin: 0 auto;
    top: 40%;
    font-size: 1.3rem;
    font-style: normal;
    text-shadow: 0 0 5px #000, 0 0 10px #000;
    line-height: 110%;
    width: 90%;
}
#subKabut.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 1s ease-in-out;
}

.pesawatSubKabut {
    position: absolute;
    left: -15%;
    top: 80%;
    transform: translate(-50%, -50%);
    width: 120px;
    opacity: 1;
    transition: all 12s ease-in-out;
    z-index: 0; /* di bawah awan, di atas background */
    animation: floating 1.5s infinite;
}

.pesawatSubKabut.terbang {
    left: 115%;
    top: 5%;
}

/* ==== halaman bintang ====*/
#bintangPage {
    position: relative;
    width: 100%;
    max-width: 428px;
    height: 100vh;
    background-color: #171926;
    overflow: hidden;
    display: none;
    opacity: 0;
    transition: opacity 1s ease;
}

#bg-bintang {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    transform: translateX(0);
    transition: transform 30s linear;
    object-fit: cover;
    animation: geserSamping 20s linear infinite;
    z-index: 0;
}

@keyframes geserSamping {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}
.gerakSamping {
    transform: translateX(-50%); /* gerakkan ke kiri setengah lebar */
}

#judul3 {
    position: relative; /* agar z-index berlaku */
    z-index: 3; /* lebih tinggi dari canvas & bintang */
    padding: 0;
    margin-top: 60px;
    color: white;
    width: 100%;
    text-align: center;
    font-size: 1.8rem;
    font-style: italic;
}

canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    opacity: 1;
    transition: opacity 2s ease;
}

.bintang {
    position: absolute;
    width: 100px;
    height: 100px;
    cursor: pointer;
    z-index: 1;
    transition: opacity 2s ease, transform 0.3s ease;
}

.bintang.clicked {
    transform: scale(1.2);
    filter: drop-shadow(0 0 8px #fef08a);
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

#loveline {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    visibility: hidden;
    width: 350px;
    transition: opacity 2s ease;
    z-index: 2;
}

#loveline.visible {
    opacity: 1;
    visibility: visible;
}

.bintangInfo {
    color: white;
    text-align: center;
    font-style: italic;
    position: absolute;
    top: 85px;
    width: 100%;
    font-size: 0.9rem;
    animation: blink 1.5s infinite;
    font-family: "Baskervville", serif;
    font-weight: 400;
}
.bintangInfo2 {
    color: white;
    text-align: center;
    font-style: italic;
    position: absolute;
    bottom: 10%;
    font-size: 0.9rem;
    padding: 0 30px;
    font-family: "Baskervville", serif;
    font-weight: 400;
}

.pesawatBintang {
    position: absolute;
    left: -15%;
    top: 80%;
    transform: translate(-50%, -50%);
    width: 120px;
    opacity: 1;
    transition: all 15s ease-in-out;
    z-index: 0; /* di bawah awan, di atas background */
    animation: floating 1.5s infinite;
}

.pesawatBintang.terbang {
    left: 115%;
    top: 5%;
}

.tapIcon {
    position: absolute;
    width: 15%;
    z-index: 10;
    left: 50%;
    top: 40%;
    transform: width(20%);
    animation: pulse 1s infinite ease-out, blink 1s infinite step-start;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2); /* Membesar */
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* === Sub Bintang === */

#subBintang {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out, visibility 0s linear 1s; /* delay visibility */
    height: 100%;
    width: 100%;
    max-width: 428px;
    background-color: #041f3b;
    overflow: hidden;
}

#bg-SubBintang {
    position: absolute;
    top: -80%;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 0;
    transition: transform 12s ease-in-out;
}

#subBintang p {
    color: white;
    text-align: justify;
    position: relative;
    margin: 0 auto;
    top: 40%;
    font-size: 1.4rem;
    text-shadow: 0 0 5px #000, 0 0 10px #000;
    line-height: 110%;
    width: 90%;
}

#subBintang.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 1s ease-in-out;
}

.pesawatSubBintang {
    position: absolute;
    left: -15%;
    top: 80%;
    transform: translate(-50%, -50%);
    width: 120px;
    opacity: 1;
    transition: all 12s ease-in-out;
    z-index: 0; /* di bawah awan, di atas background */
    animation: floating 1.5s infinite;
}

.pesawatSubBintang.terbang {
    left: 115%;
    top: 5%;
}

/* Halaman LokasiPage */
#lokasiPage {
     opacity: 0;
    visibility: hidden; 
    transition: opacity 1s ease-in-out, visibility 0s linear 1s; /*delay visibility */
    position: fixed;
    height: 100%;
    width: 100%;
    max-width: 428px;
    background-color: #041f3b;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #5a5a5a;
    overflow: hidden;
}

.bg-full {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.textTitle {
    z-index: 1;
    width: 81%;
    top: 18%;
    left: 50%;
    margin: 0 auto;
    position: absolute;
    animation: floating 2s infinite;
}

.textLokasi {
    z-index: 1;
    width: 81%;
    top: 60%;
    margin: 0 auto;
    position: absolute;
}

#kehadiranBtn {
    position: relative;
    display: block;
    padding: 10px 20px;
    font-size: 1.3rem;
    cursor: pointer;
    border: none;
    border-radius: 15px;
    background: rgba(87, 87, 87, 0.5) !important;
    transition: all 0.3s ease;
    color: white;
    text-align: center;
    margin: 10px auto;
    transition: opacity 1s ease;
    font-family: "Cormorant Garamond", serif;
    font-weight: 700;
    top: 32%;
}

.textTitle,
.textLokasi,
#kehadiranBtn {
     opacity: 0; 
    transition: opacity 1s ease-in-out;
}

#kehadiranBtn:hover {
    background: rgba(87, 87, 87, 1) !important;
    color: #f4f1eb;
}

.pesawatLokasi {
    position: absolute;
    top: 80%; /* 45%*/
    left: -20%; /* 50%*/
    transform: translate(-50%, -50%);
    width: 120px;
    opacity: 1;
    transition: all 3.5s ease-in-out;
    z-index: 0; /* di bawah awan, di atas background */
    animation: floating 1.5s infinite;
}
.pesawatLokasi.terbang {
    left: 115%;
    top: 5%;
}

/* Konfirmasi Page */
#konfirmasiPage {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out, visibility 0s linear 1s; /* delay visibility */
    position: fixed;
    height: 100%;
    width: 100%;
    max-width: 428px;
    background-color: #041f3b;
    z-index: 100;
    display: block;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #5a5a5a;
    overflow: hidden;
}

#konfirmasiPage.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 1s ease-in-out;
}

.formFrame {
    position: relative;
    padding: 0;
    background: rgba(0, 0, 0, 0.2);
    /* display: flex; */
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 85%;
    border: none;
    border-radius: 20px;
    width: 100%;
    max-width: 360px;
    padding: 20px 0;
}

.konfirmasiTitle {
    color: white;
    position: relative;
    top: 5%;
    margin: 0;
    padding: 0;
    font-size: 2rem;
}

.formKonfirmasi {
    position: relative;
    z-index: 1;
    text-align: left;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
}

.formKonfirmasi input {
    display: block;
    width: 100%;
    max-width: 80%;
    margin: 0.6rem auto;
    padding: 0.6rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    opacity: 0.8;
    margin: 10px 0;
    font-family: "Cormorant Garamond", serif;
    font-weight: 700;
}

.formKonfirmasi table {
    width: 100%;
    max-width: 85%;
}

.formKonfirmasi table td span {
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
}
.formKonfirmasi select {
    display: block;
    width: 100%;
    margin: 0.6rem auto;
    padding: 0.6rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    opacity: 0.8;
    margin: 10px 0;
    font-family: "Cormorant Garamond", serif;
    font-weight: 700;
}

.formKonfirmasi button {
    margin-top: 1rem;
    padding: 0.7rem 1.6rem;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: "Cormorant Garamond", serif;
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.formKonfirmasi button:hover {
    background: rgba(0, 0, 0, 0.7);
}

.konfirmasiInfo {
    color: white;
    width: 100%;
    text-align: justify;
    max-width: 85%;
}

#inputRekanWrapper {
    width: 100%;
}

#inputRekanWrapper input {
    display: block;
    max-width: 80%;
    margin: 0.6rem auto;
    padding: 0.6rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    opacity: 0.8;
    font-family: "Cormorant Garamond", serif;
    font-weight: 700;
}

.form_message {
    color: white;
}

.pesawatKonfirmasi {
    position: absolute;
    top: 80%; /* 45%*/
    left: -20%; /* 50%*/
    transform: translate(-50%, -50%);
    width: 120px;
    opacity: 1;
    transition: all 3.5s ease-in-out;
    z-index: 0; /* di bawah awan, di atas background */
    animation: floating 1.5s infinite;
}
.pesawatKonfirmasi.terbang {
    left: 115%;
    top: 5%;
}

.cardKonfirmasi {
    display: none;
    color: white;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10;
    width: 80%;
    opacity: 0;
    font-size: 1rem;
    padding: 0 20px;
    font-style: italic;
}

.cardKonfirmasi h2 {
    font-weight: 700;
    text-align: center;
}
.cardKonfirmasi h3 {
    font-weight: 700;
}
