/* --- RESET & BASIC --- */
* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }

body {
    background: #2c3e50;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: 'Varela Round', sans-serif;
}

.mobile-frame {
    width: 100%;
    height: 100%;
    background: #81D4FA; /* Warna langit */
    position: relative;
    overflow: hidden;
    /* border-radius: 30px;
    border: 10px solid #222; */
}

/* HEADER STYLE */
.header-ui {
    /* POSISI FIX MENGAMBANG */
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    
    /* PENTING: Agar selalu di paling depan */
    z-index: 999; 
    
    padding: 20px 10px 20px 10px;
    text-align: center;
    
    /* Background Gradient agar tulisan terbaca tapi peta di baliknya tetap terlihat samar */
    background: linear-gradient(to bottom, rgba(129, 212, 250, 1) 0%, rgba(129, 212, 250, 0.8) 60%, rgba(129, 212, 250, 0) 100%);
    
    /* Agar user tetap bisa scroll peta meskipun jarinya menyentuh area header yang transparan */
    pointer-events: none; 
}

/* Update juga Scroll Area agar konten paling atas tidak tertutup header */
.scroll-area {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    position: relative;
    
   
}

/* Pastikan judul text bisa terbaca jelas */
.map-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    color: #fff;
    -webkit-text-stroke: 3px #546E7A; 
    paint-order: stroke fill;
    text-shadow: 3px 3px 0px rgba(0,0,0,0.2);
    margin-bottom: 5px;
}

.map-subtitle {
    font-size: 0.7rem;
    color: #fff;
    background-color: rgba(0,0,0,0.3);
    display: inline-block;
    padding: 4px 10px;
    border-radius: 10px;
}

/* SCROLL AREA */
.scroll-area {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    position: relative;
}
.scroll-area::-webkit-scrollbar { display: none; }

.world-container {
    width: 100%;
    position: relative;
   
    
}

/* --- LOGIKA STACKING (Sesuai Code Lama Anda) --- */
.bg-stack {
    width: 100%;
    display: flex;
    flex-direction: column-reverse; /* Level awal di BAWAH */
}

/* WRAPPER BARU: Mengbungkus Gambar + Levelnya */
.segment-wrapper {
    position: relative; /* Penting! Agar level absolute relatif ke gambar ini */
    width: 100%;
}

.map-segment {
    width: 100%;
    display: block;
    vertical-align: bottom; 
    min-height: 300px; /* Minimal tinggi agar level muat */
}

/* Label Coming Soon */
.coming-soon-badge {
    position: absolute;
    top: 55px; /* Tepat di bawah judul group (karena judul top:20px + tinggi judul) */
    right: 20px; /* Sejajar dengan judul */
    background: #FF5722; /* Warna Oranye Mencolok */
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 25;
    animation: pulseBadge 2s infinite;
}

/* ============================================= */
/* --- CUSTOM ALERT POPUP STYLE --- */
/* ============================================= */

/* Overlay Gelap (Background) */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Gelap transparan */
    z-index: 2000; /* Paling atas, di atas header */
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px); /* Efek blur di belakang */
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Class untuk menyembunyikan */
.custom-alert-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Kotak Popup */
.custom-alert-box {
    background: #fff;
    width: 85%;
    max-width: 320px;
    padding: 25px 20px;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border: 4px solid #81D4FA; /* Border warna tema */
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Efek membal */
}

/* Animasi saat muncul */
.custom-alert-overlay:not(.hidden) .custom-alert-box {
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Ikon di Atas */
.alert-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    display: inline-block;
    animation: shakeIcon 2s infinite;
}

@keyframes shakeIcon {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* Teks Judul */
.alert-title {
    font-family: 'Fredoka One', cursive;
    color: #455A64;
    font-size: 1.5rem;
    margin: 0 0 10px 0;
}

/* Pesan Isi */
.alert-message {
    font-family: 'Varela Round', sans-serif;
    color: #607D8B;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Tombol OK */
.alert-btn {
    background: linear-gradient(to bottom, #4FC3F7, #29B6F6);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-family: 'Fredoka One', cursive;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 0 #0288D1;
    transition: transform 0.1s;
}

.alert-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #0288D1;
}

/* Animasi berdenyut agar menarik perhatian */
@keyframes pulseBadge {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* AWAN PEMISAH */
.cloud-separator {
    width: 100%;
    height: 120px;
    
    /* Pastikan path gambar benar */
    background-image: url('assets/images/awan.png'); 
    
    /* UBAH DARI 'no-repeat' MENJADI 'repeat-x' AGAR BISA BERGERAK TANPA PUTUS */
    background-repeat: repeat-x; 
    
    background-size: contain; /* atau 'auto 100%' jika ingin awan aslinya panjang */
    background-position: 0% center;
    
    margin-top: -60px;     
    margin-bottom: -60px;
    position: relative;
    z-index: 50;  
    pointer-events: none;
    opacity: 0.9;

    /* PANGGIL ANIMASI */
    /* Nama animasi: moveClouds */
    /* Durasi: 60 detik (makin besar makin pelan) */
    /* Loop: infinite (selamanya) */
    animation: moveClouds 60s linear infinite;
    
    /* Agar transisi halus */
    will-change: background-position;
}

/* VARIASI GERAKAN */
/* Agar tidak semua awan bergerak sama (terlihat robot), kita bedakan awan Ganjil & Genap */

/* Awan urutan Ganjil: Gerak ke Kanan (Default) */
.bg-stack .cloud-separator:nth-child(odd) {
    animation-duration: 80s; /* Lebih pelan */
    opacity: 0.8;
}

/* Awan urutan Genap: Gerak ke Kiri (Reverse) */
.bg-stack .cloud-separator:nth-child(even) {
    animation-direction: reverse; /* Arah sebaliknya */
    animation-duration: 65s; /* Lebih cepat sedikit */
    opacity: 1; /* Lebih tebal */
}


/* --- LEVEL NODES HIJAIYAH STYLE --- */

/* Judul Halaman (Halaman 1-3) */
.group-title {
    position: absolute;
    bottom: 50px;
    right: 20px;
    background: #fff;
    color: #5D4037;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.5rem;
    font-weight: bold;
    box-shadow: 0 3px 0 #D7CCC8;
    z-index: 20;
    font-family: 'PressStart2P', monospace;
}

/* NODE LEVEL DI PETA */
.level-node {
    position: absolute;
    /* top & left di-set via JS */
    transform: translate(-50%, -50%);
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition:
        transform 0.18s ease-out,
        filter 0.18s ease-out;
}

/* Hover: sedikit membesar + glow */
.level-node:hover {
    transform: translate(-50%, -50%) scale(1.06);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
}

/* Klik: sedikit turun ke bawah (efek ditekan) */
.level-node:active {
    transform: translate(-50%, -50%) scale(0.95) translateY(2px);
}

@font-face {
    font-family: 'PressStart2P';
    src: url('/assets/fonts/PressStart2P-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}


/* LINGKARAN TOMBOL LEVEL */
.node-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center; 
    font-size: 0.7rem;
    box-shadow:
        0 6px 0 rgba(0, 0, 0, 0.25),
        0 10px 18px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
    font-family: 'PressStart2P', monospace;
   
}

/* Highlight “glossy” di atas lingkaran */
.node-circle::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 0%,
        rgba(255, 255, 255, 0.75),
        transparent 55%);
    opacity: 0.7;
    pointer-events: none;
}

/* Isi teks / nomor di tengah lingkaran */
.node-circle span,
.node-circle .node-label {
    position: relative;
    z-index: 1;
}

/* STATE: UNLOCKED (KUNING EMAS) */
.level-node.unlocked .node-circle {
    background: linear-gradient(145deg, #FFD54F, #FFB300);
    border: 4px solid #FFF8E1;
    color: #4E342E;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* Unlocked bisa diberi animasi bernafas (opsional) */
.level-node.unlocked .node-circle {
    animation: pulse-glow 1.8s ease-in-out infinite;
}

/* STATE: LOCKED (ABU GELAP) */
.level-node.locked .node-circle {
    background: linear-gradient(145deg, #78909C, #455A64);
    border: 4px solid #CFD8DC;
    color: #ECEFF1;
    filter: grayscale(0.1) brightness(0.9);
}

/* Bisa bikin cursor beda untuk locked */
.level-node.locked {
    cursor: not-allowed;
}

/* Nama Level di bawah Tombol */
.node-name {
    margin-top: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #3E2723;
    background: rgba(255, 255, 255, 0.9);
    padding: 3px 10px;
    border-radius: 999px;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(2px);
     font-family: 'PressStart2P', monospace;
}

/* Kalau nama level panjang, biar rapi */
.level-node.long-name .node-name {
    white-space: normal;
    max-width: 120px;
}

/* ANIMASI PULSE GLOW UNTUK LEVEL UNLOCKED */
@keyframes pulse-glow {
    0% {
        box-shadow:
            0 6px 0 rgba(0, 0, 0, 0.25),
            0 0 0 0 rgba(255, 215, 64, 0.7);
    }
    50% {
        box-shadow:
            0 6px 0 rgba(0, 0, 0, 0.25),
            0 0 18px 8px rgba(255, 215, 64, 0.0);
    }
    100% {
        box-shadow:
            0 6px 0 rgba(0, 0, 0, 0.25),
            0 0 0 0 rgba(255, 215, 64, 0.0);
    }
}


/* =========================================
   RESPONSIVE MOBILE FIX
   Tambahkan ini di baris paling bawah CSS
   ========================================= */

@media screen and (max-width: 480px) {
    body {
        /* Matikan fungsi centering flexbox pada HP */
        display: block; 
        background-color: #81D4FA; /* Samakan warna dengan langit */
        height: 100%;
        overflow: hidden; /* Mencegah scroll pada body utama */
    }

    .mobile-frame {
        /* Ubah ukuran fix menjadi memenuhi layar HP */
        width: 100%;       /* Lebar penuh */
        height: 100%;     /* Tinggi penuh (dvh = dynamic viewport height untuk mengatasi address bar browser HP) */
        
        /* Hilangkan border HP bohong-bohongan */
        /* border: none;
        border-radius: 0;
        box-shadow: none; */
        
        /* Pastikan posisi direset */
        position: absolute;
        top: 0;
        left: 0;
    }

    .header-ui {
        /* Pastikan header menempel di paling atas layar fisik */
        position: fixed; /* Ganti absolute jadi fixed agar lebih kuat di HP */
        top: 0;
        left: 0;
        width: 100%;
        padding-top: 40px; /* Tambahan padding untuk menutupi Poni/Notch HP */
    }
    
    .scroll-area {
        /* Sesuaikan padding agar konten level 1 tidak tertutup header yang lebih tebal */
        padding-top: 130px; 
    }
}
@keyframes moveClouds {
    from {
        background-position-x: 0px;
    }
    to {
        /* Geser background sejauh 1000px ke samping */
        /* Angka ini harus cukup besar agar terlihat mengalir */
        background-position-x: 1000px; 
    }
}

 
/* KONTAINER BINTANG (Muncul di atas tombol) */
.stars-container {
    position: absolute;
    top: -20px; /* Di atas tombol */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    z-index: 70;
    pointer-events: none;
}

.star {
    font-size: 12px;
    color: #FFD700; /* Warna Emas */
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    /* Animasi kecil agar menarik */
    animation: popIn 0.5s ease backwards;
}

.star:nth-child(2) { animation-delay: 0.1s; font-size: 14px; margin-top: -3px; } /* Bintang tengah lebih besar & tinggi */
.star:nth-child(3) { animation-delay: 0.2s; }

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Modifikasi agar level yang selesai tetap terlihat berwarna (Unlocked) */
.level-node.completed .node-circle {
    background: #FFCA28; /* Tetap Kuning */
    border-color: #FFF8E1;
    color: #3E2723;
}

/* ========================================= */
/* EARLY ACCESS POPUP STYLE */
/* ========================================= */

/* Overlay Gelap Belakang */
.ea-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Gelap banget biar fokus */
    z-index: 10000; /* Di atas Loading Screen */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

/* Kartu Utama */
.ea-card {
    background-color: #2C5566; /* Warna Teal Gelap sesuai gambar */
    width: 90%;
    max-width: 400px;
    padding: 30px 20px;
    border-radius: 25px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.1);
    animation: popUpBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Animasi Muncul */
@keyframes popUpBounce {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Judul */
.ea-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
    line-height: 1.3;
}

/* Pill Putih (Info Update) */
.ea-pill-white {
    background-color: white;
    color: #2C5566;
    padding: 8px 15px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 15px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.1);
}

/* Deskripsi Teks */
.ea-desc {
    font-size: 0.9rem;
    color: #E0F7FA;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Container Highlight (Pengganti Harga) */
.ea-highlight-container {
    margin: 20px 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Pill Gelap (Label) */
.ea-pill-dark {
    background-color: rgba(0,0,0,0.2);
    color: #aaa;
    padding: 5px 15px;
    border-radius: 20px 20px 0 0;
    font-size: 0.8rem;
    width: 60%;
    margin-bottom: -10px; /* Numpuk dikit */
    padding-bottom: 15px;
}

/* Pill Besar (Game Iqro) */
.ea-pill-hero {
    background-color: white;
    color: #2C5566;
    width: 100%;
    padding: 15px 10px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    position: relative;
    z-index: 2;
}

.ea-pill-hero h1 {
    margin: 0;
    font-size: 1.8rem;
    color: #2C5566;
}

.ea-pill-hero span {
    font-size: 0.8rem;
    color: #FF9800; /* Warna oranye untuk aksen */
    font-weight: bold;
}

/* Footer Note */
.ea-footer-pill {
    background-color: white;
    color: #2C5566;
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.ea-subfooter {
    font-size: 0.75rem;
    color: #B2EBF2;
    margin-bottom: 20px;
}

/* Tombol Tutup */
.ea-button {
    background: linear-gradient(to bottom, #FFB74D, #F57C00);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 0 #E65100;
    transition: transform 0.1s;
}

.ea-button:active {
    transform: translateY(4px);
    box-shadow: none;
}
