/* ========================================= */
/* IMPORTS, RESETS, BODY UMUM, TRANSITIONS */
/* ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    color: #f0f0f0;
    overflow: hidden; 
    background: #1a1423; /* Warna dasar */
    display: flex; /* Default flex untuk menengahkan konten */
    justify-content: center;
    align-items: center;
}

/* Transisi HANYA untuk halaman chapter */
body.page-chapter {
    animation: fadeInPage 1.5s ease-out forwards;
    opacity: 0;
}
body.fade-out {
    animation: fadeOutPage 1s ease-out forwards !important; /* !important untuk override */
}
@keyframes fadeInPage { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOutPage { from { opacity: 1; } to { opacity: 0; } }

/* ========================================= */
/* BACKGROUND UMUM (LOGIN & PROLOG)         */
/* ========================================= */
.page-login #slideshow-background,
.page-prolog #slideshow-background,
.page-login #particle-canvas,
.page-prolog #particle-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
}
.page-login #particle-canvas,
.page-prolog #particle-canvas {
    z-index: 2; /* Canvas di atas slideshow */
}
.slide { position: absolute; width: 100%; height: 100%; background-size: cover; background-position: center; opacity: 0; animation: imageFade 15s infinite; }
.slide:nth-child(2) { animation-delay: 5s; }
.slide:nth-child(3) { animation-delay: 10s; }
@keyframes imageFade { 0% { opacity: 0; } 17% { opacity: 1; } 33% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 0; } }

/* ========================================= */
/* KONTEN UTAMA (LOGIN & PROLOG)           */
/* ========================================= */
.page-login #login-container,
.page-prolog #main-content {
    display: flex; justify-content: center; align-items: center; text-align: center;
    padding: 20px; z-index: 3; position: relative; width: 100%; height: 100%;
}

/* ==== LOGIN BOX (Hanya di .page-login) ==== */
.page-login .login-box {
    background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); padding: 40px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); max-width: 450px; width: 100%; border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.page-login #login-form { width: 100%; }
.page-login .login-box h1 { font-weight: 600; font-size: 1.8em; margin-bottom: 10px; color: #e0e0e0; }
.page-login .login-box p { font-weight: 300; font-size: 0.9em; margin-bottom: 20px; color: #c0c0c0; }
.page-login #login-form input { width: 100%; padding: 15px; margin-bottom: 15px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.1); color: #fff; border-radius: 8px; font-size: 1em; text-align: center; }
.page-login #login-form input::placeholder { color: #ccc; }
.page-login #login-form input:focus { outline: none; border-color: #fca311; box-shadow: 0 0 0 3px rgba(252, 163, 17, 0.2); }
.page-login #login-form button { width: 100%; padding: 15px; border: none; border-radius: 8px; background: linear-gradient(135deg, #fca311 0%, #e14eca 100%); color: #1a1423; font-size: 1.1em; font-weight: 600; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.page-login #login-form button:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); }
.page-login #error-message { margin-top: 15px; color: #ff6b6b; font-size: 0.9em; font-weight: 400; }

/* ==== INTRO SEQUENCE (Hanya di .page-prolog) ==== */
.page-prolog #intro-sequence { display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; position: relative; }
.page-prolog .intro-text { position: absolute; font-family: 'Dancing Script', cursive; font-size: 3.5em; font-weight: 700; text-align: center; padding: 20px; max-width: 80%; opacity: 0; transition: opacity 1.5s ease; }
.page-prolog .intro-text.final-text { font-size: 4.5em; font-weight: 600; }
.page-prolog .intro-text.visible { opacity: 1; }


/* ========================================= */
/* GAYA KHUSUS UNTUK HALAMAN LAGU (.page-song) */
/* ========================================= */

/* TOMBOL START OVERLAY (Hanya di .page-song) */
.page-song #start-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; z-index: 999; transition: opacity 1s ease; cursor: pointer; }
.page-song #start-button { padding: 20px 40px; font-size: 1.5em; font-weight: 600; color: #333; background: #fff; border: none; border-radius: 50px; }

/* KONTENER MODE VIDEO MUSIK (Hanya di .page-song) */
.page-song #music-video-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 5; opacity: 0; transition: opacity 1.5s ease;
    display: flex; justify-content: center; align-items: center;
    /* Background video akan ditambahkan oleh HTML/JS */
}
.page-song #music-video-container.visible { opacity: 1; }

/* VIDEO BACKGROUND & OVERLAY (Hanya di .page-song) */
.page-song #background-video { position: fixed; top: 50%; left: 50%; min-width: 100%; min-height: 100%; width: auto; height: auto; z-index: -1; transform: translateX(-50%) translateY(-50%); object-fit: cover; }
.page-song .video-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 0; }

/* LIRIK & SPOTIFY PLAYER (Hanya di .page-song) */
.page-song .lyrics-container { text-align: center; padding: 20px; position: relative; z-index: 1; }
.page-song #lyric-display { font-weight: 700; font-size: 4em; color: rgba(255, 255, 255, 0.9); text-transform: uppercase; letter-spacing: 2px; opacity: 0; transition: opacity 0.5s ease; min-height: 100px; text-shadow: 2px 2px 8px rgba(0,0,0,0.7); }
.page-song #spotify-player { position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%); width: 95%; max-width: 500px; background: rgba(0, 0, 0, 0.3); backdrop-filter: blur(15px); border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 15px; box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2); transition: bottom 1.5s ease-out; z-index: 20; }
.page-song #spotify-player.visible { bottom: 20px; }
.page-song #player-album-art { width: 60px; height: 60px; border-radius: 8px; }
.page-song #player-track-info { flex-grow: 1; text-align: left; }
.page-song #player-track-info h3 { font-size: 1em; font-weight: 700; margin: 0; }
.page-song #player-track-info p { font-size: 0.8em; opacity: 0.7; margin: 0; }
.page-song #progress-bar-container { position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: rgba(255, 255, 255, 0.2); }
.page-song #progress-bar { width: 0%; height: 100%; background: #fff; border-radius: 2px; transition: width 0.1s linear; }


/* KELAS UTILITAS & ANIMASI UMUM */
.hidden { display: none !important; }
.shake { animation: shake 0.5s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

/* ========================================= */
/* GAYA KHUSUS UNTUK HALAMAN PETA (.page-map) */
/* ========================================= */

.page-map #main-content {
    display: block; /* Override flex agar bisa scroll jika peta besar */
    padding-top: 50px; /* Beri jarak dari atas */
    height: auto; /* Biarkan tinggi menyesuaikan konten */
    min-height: 100vh;
}

.page-map #map-memory {
    text-align: center;
}

.page-map h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.page-map .subtitle {
    font-size: 1.1em;
    opacity: 0.8;
    margin-bottom: 30px;
}

.page-map .map-container {
    position: relative; /* Penting untuk positioning pin */
    width: 90%;
    max-width: 1000px; /* Batasi lebar peta */
    margin: 0 auto; /* Tengah secara horizontal */
    border-radius: 15px;
    overflow: hidden; /* Rapikan pinggiran */
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.page-map .map-container img {
    display: block; /* Hilangkan space bawah */
    width: 100%;
    height: auto;
}

.page-map .pin {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ff4757; /* Warna pin merah */
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    cursor: pointer;
    transform: translate(-50%, -50%); /* Pusatkan pin */
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.page-map .pin:hover {
    transform: translate(-50%, -50%) scale(1.3); /* Sedikit membesar saat hover */
    background-color: #ff6b81; /* Warna hover */
}

/* === GAYA MODAL/POP-UP === */
.modal {
    display: none; /* Awalnya tersembunyi */
    position: fixed;
    z-index: 1000; /* Pastikan di atas segalanya */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Aktifkan scroll jika konten panjang */
    background-color: rgba(0,0,0,0.7); /* Overlay gelap */
    opacity: 0; /* Untuk animasi fade */
    transition: opacity 0.5s ease;
}

.modal-content {
    background-color: #2c2c3c; /* Background modal sedikit gelap */
    margin: 10% auto; /* Tengah secara vertikal & horizontal */
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px; /* Batasi lebar modal */
    border-radius: 15px;
    position: relative;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    transform: scale(0.9); /* Efek muncul sedikit zoom */
    transition: transform 0.3s ease-out;
}

.modal:target .modal-content, /* Untuk animasi saat muncul */
.modal[style*="display: block"] .modal-content { /* Selector jika display block */
     transform: scale(1);
}

.modal-close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close-button:hover,
.modal-close-button:focus {
    color: white;
    text-decoration: none;
}

.modal-image {
    display: block;
    width: 100%;
    max-height: 400px; /* Batasi tinggi gambar */
    object-fit: cover; /* Agar gambar tidak gepeng */
    border-radius: 10px;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: #e0e0e0;
}

.modal-story {
    font-size: 1.1em;
    line-height: 1.6;
    color: #c0c0c0;
}

/* Ganti background solid di body.page-map */
/* Tambahkan ini di bagian bawah CSS */
@keyframes subtleGradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Ubah gaya body.page-map */
body.page-map {
    /* Remove background-image properties from here */
    background-color: #1a1423; /* Set a solid fallback background color (e.g., dark purple/grey) */
    
    color: #f0f0f0; 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start; 
    align-items: center; 
    min-height: 100vh;
    overflow-y: auto; 
    padding-top: 50px; 
    position: relative; /* Needed for the ::before pseudo-element */
    z-index: 0; /* Make sure body is behind the pseudo-element's parent */
}

/* Add this new block for the background */
body.page-map::before {
    content: ""; /* Required for pseudo-elements */
    position: fixed; /* Cover the whole viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Place it behind the body's content */

    /* Apply GIF background properties here */
    background-image: url('https://media3.giphy.com/media/v1.Y2lkPTc5MGI3NjExZ3h5OXBwMXBmd2E1cW5haGRwbTVqYXl6eHk1eHpnMGd4ZzdmbnZsNyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9dg/wZS0pENJKjBqt1pict/giphy.gif'); 
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat; 
    
    /* Apply opacity HERE */
    opacity: 0.6; /* 60% opacity (adjust as needed) */
}
/* Contoh di style.css */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap'); /* Import font */

/* Styling Judul Halaman Peta */
/* Styling Judul Halaman Peta */
/* Styling Judul Halaman Peta */
.page-map h2 {
    font-family: 'Dancing Script', cursive; 
    font-size: 3.5em; 
    color: #f0f0f0; /* Warna isi huruf */
    margin-bottom: 15px;
    letter-spacing: 1px; 
    /* --- Efek Outline Shadow --- */
    text-shadow: 
        -1px -1px 0 #444, /* Shadow kiri atas */
         1px -1px 0 #444, /* Shadow kanan atas */
        -1px  1px 0 #444, /* Shadow kiri bawah */
         1px  1px 0 #444; /* Shadow kanan bawah */
    /* --- Akhir Efek Outline --- */
}

/* Styling Subtitle (bisa pakai shadow biasa atau outline juga) */
.page-map .subtitle {
   /* ... gaya lain ... */
   color: #d0d0d0;
   text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5); /* Shadow biasa agar tidak terlalu ramai */
}

/* Tambahkan ini di bagian bawah CSS Anda */
/* Tambahkan ini di bagian bawah CSS */
@keyframes animatedGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Styling Judul Halaman Peta */
.page-map h2 {
    font-family: 'Dancing Script', cursive; 
    font-size: 3.5em; 
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4); 
    margin-bottom: 15px;
    letter-spacing: 1px; 

    /* --- Efek Gradien Bergerak --- */
    background: linear-gradient(90deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888, #f09433);
    background-size: 200% 100%; /* Ukuran background lebih besar agar bisa digeser */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    animation: animatedGradient 10s linear infinite; /* Terapkan animasi */
    /* --- Akhir Efek Gradien Bergerak --- */
}

/* ========================================= */
/* GAYA HALAMAN NAVIGASI (.page-navigation) */
/* ========================================= */

body.page-navigation {
    /* Background (bisa gradien lembut, pola, atau GIF halus) */
    background-image: url('https://media3.giphy.com/media/v1.Y2lkPTc5MGI3NjExZ3h5OXBwMXBmd2E1cW5haGRwbTVqYXl6eHk1eHpnMGd4ZzdmbnZsNyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9dg/wZS0pENJKjBqt1pict/giphy.gif'); 
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat;
}

.page-navigation #main-content {
    /* Biarkan flex untuk menengahkan section */
}

#chapter-nav {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 80%;
    max-width: 800px;
}

#chapter-nav h2 {
    font-family: 'Playfair Display', serif; /* Font elegan */
    font-size: 2.8em;
    color: #2d3436;
    margin-bottom: 40px;
}

.timeline {
    display: flex;
    justify-content: space-around; /* Sebar node secara merata */
    align-items: center;
    margin-bottom: 50px;
    padding: 20px 0;
    position: relative;
    border-top: 2px dashed #636e72; /* Garis timeline */
    border-bottom: 2px dashed #636e72;
}

.timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #2d3436;
    transition: transform 0.3s ease;
    position: relative; /* Untuk pseudo-element (garis ke bawah) */
}

.timeline-node:hover {
    transform: scale(1.1); /* Efek hover */
}

/* Garis vertikal dari node ke timeline (opsional) */
.timeline-node::before {
    content: '';
    position: absolute;
    bottom: -22px; /* Sesuaikan agar menyentuh garis bawah */
    height: 20px;
    width: 2px;
    background-color: #636e72;
}
.timeline-node::after { /* Titik di garis timeline */
     content: '';
     position: absolute;
     bottom: -29px; /* Pas di garis bawah */
     height: 10px;
     width: 10px;
     background-color: #636e72;
     border-radius: 50%;
     border: 2px solid #dfe6e9; /* Warna background body */
 }


.node-icon {
    font-size: 3em; /* Ukuran ikon emoji */
    margin-bottom: 10px;
}

.node-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9em;
    font-weight: 600;
}

.restart-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: #6c5ce7; /* Warna tombol (contoh: ungu) */
    color: white;
    font-size: 1.1em;
    font-weight: 600;
    text-decoration: none;
    border-radius: 30px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.restart-button:hover {
    background-color: #a29bfe;
    transform: translateY(-2px);
}

/* ========================================= */
/* GAYA HALAMAN LONG TEXT (.page-longtext)  */
/* ========================================= */

body.page-longtext {
    /* Background lembut seperti kertas */
    background-image: url('https://media3.giphy.com/media/v1.Y2lkPTc5MGI3NjExZ3h5OXBwMXBmd2E1cW5haGRwbTVqYXl6eHk1eHpnMGd4ZzdmbnZsNyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9dg/wZS0pENJKjBqt1pict/giphy.gif'); 
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat;
    color: #4a4a4a; /* Teks gelap */
    overflow-y: auto; /* Izinkan scroll jika teks panjang */
    align-items: flex-start; /* Konten mulai dari atas */
    padding-top: 5vh; /* Beri jarak dari atas */
}

.page-longtext #main-content {
    height: auto; /* Tinggi menyesuaikan konten */
    min-height: 90vh; /* Minimal setinggi layar */
}

#special-message {
    text-align: center;
    background: #fff; /* Kotak pesan putih */
    padding: 40px 50px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 1500px; /* Lebar maksimal kotak pesan */
    margin: 20px auto; /* Tengah & beri jarak */
}

#special-message h2 {
    font-family: 'Dancing Script', cursive; /* Font tulisan tangan */
    font-size: 3em;
    color: #e14eca; /* Warna pink */
    margin-bottom: 30px;
}

.message-content {
    text-align: left; /* Teks pesan rata kiri */
    font-family: 'Poppins', sans-serif;
    font-size: 1.1em;
    line-height: 1.8; /* Jarak antar baris lebih lega */
    color: #555;
    margin-bottom: 40px;
}

.message-content p {
    margin: 0; /* Hapus margin default paragraf */
}

/* Tombol Kembali */
/* Ganti gaya .back-button di style.css */
.back-button {
    display: inline-block;
    padding: 12px 25px 12px 20px; /* Padding kiri lebih kecil untuk ikon */
    background-color: #e14eca; /* Warna pink (sesuaikan dengan tema) */
    color: white;
    font-size: 1em;
    font-weight: 500;
    text-decoration: none;
    border-radius: 25px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    display: inline-flex; /* Agar ikon dan teks sejajar */
    align-items: center; /* Sejajarkan ikon dan teks secara vertikal */
}

/* Tambahkan ikon (Emoji panah kiri) sebelum teks */
.back-button::before {
    content: '← '; /* Emoji panah kiri + spasi */
    margin-right: 8px; /* Jarak antara ikon dan teks */
    font-size: 1.2em; /* Ukuran ikon sedikit lebih besar */
}


.back-button:hover {
    background-color: #cc2366; /* Warna pink lebih tua saat hover */
    transform: scale(1.05); /* Sedikit membesar saat hover */
}
/* Gaya Tombol Umum (jika belum ada) */
.action-button {
     display: inline-block;
     padding: 12px 30px;
     color: white;
     font-size: 1.1em;
     font-weight: 600;
     text-decoration: none;
     border-radius: 30px;
     transition: background-color 0.3s ease, transform 0.3s ease;
     margin: 15px 10px; /* Jarak antar tombol */
 }
.action-button:hover {
     transform: translateY(-2px);
 }

/* Gaya Spesifik Tombol Pesan */
.message-button {
    background-color: #ff6b6b; /* Warna merah muda */
}
.message-button:hover {
    background-color: #ee5253; /* Warna merah muda lebih gelap */
}

.message-content p {
    margin: 0 0 1.5em 0; /* Tambahkan margin bawah (1.5em = sekitar 1.5x tinggi huruf) */
    line-height: 1.8; /* Pastikan line-height cukup (1.8 sudah bagus, bisa coba 1.9) */
}

/* Hapus margin atas pada paragraf pertama agar tidak terlalu jauh dari judul */
.message-content p:first-child {
    margin-top: 0;
}

/* Atur margin bawah paragraf terakhir (tanda tangan) agar tidak terlalu jauh */
.message-content p:last-child {
     margin-bottom: 0; 
     /* Pastikan style inline di HTML untuk rata kanan tetap ada jika perlu */
     /* text-align: right; margin-top: 30px; */
}

/* Pastikan gaya .message-content tetap rata kiri */
.message-content {
    text-align: left; /* Teks pesan rata kiri */
    font-family: 'Poppins', sans-serif;
    font-size: 1.1em;
    /* line-height: 1.8; Pindahkan ke p */
    color: #555;
    margin-bottom: 40px;
}
/* Gaya Tombol Restart (jika perlu disesuaikan) */
/* .restart-button { ... } */