/* Pengaturan Dasar */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, sans-serif;
    overflow: hidden; 
}

/* 1. Gaya Beranda (Homepage) */
#home-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#home-container h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

#home-container p {
    font-size: 1.2rem;
    /* BARU: Menambah margin bawah untuk memberi ruang ke wrapper tombol */
    margin-bottom: 40px; 
}

/* BARU: Wrapper untuk tombol di beranda */
.button-wrapper {
    display: flex;
    flex-direction: column; /* Menumpuk tombol secara vertikal */
    align-items: center;
    gap: 20px; /* Jarak antar tombol */
}

#startButton {
    padding: 15px 35px;
    font-size: 1.5rem;
    color: #764ba2;
    background-color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

#startButton:hover {
    transform: scale(1.05); 
    background-color: #f0f0f0;
}

/* BARU: Gaya untuk tombol game lainnya */
#otherGameButton {
    /* Meniru gaya #startButton */
    display: inline-block;
    padding: 15px 35px;
    font-size: 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background-color 0.2s ease;
    text-decoration: none; /* Menghapus garis bawah tautan */

    /* Warna sekunder yang berbeda */
    background-color: transparent;
    color: white;
    border: 2px solid white; /* Gaya 'outline' */
}

#otherGameButton:hover {
    transform: scale(1.05);
    background-color: rgba(255, 255, 255, 0.1); /* Efek hover ringan */
}


/* 2. Gaya Layar Aplikasi Game */
#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; 
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    overflow: hidden;
}

/* Gaya untuk tombol kembali */
#homeButton {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px 15px;
    font-size: 1rem;
    background-color: white;
    color: #333;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    z-index: 10; 
    transition: background-color 0.2s ease;
}

#homeButton:hover {
    background-color: #f0f0f0;
}

/* Status Layar Game */
.state-wait { background-color: #3498db; }
.state-ready { background-color: #2ecc71; }
.state-fail { background-color: #e74c3c; }
.state-result { background-color: #34495e; }


/* --- Gaya untuk Animasi Game Over --- */

.hidden {
    display: none !important;
}

#gameOverOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#skullIcon {
    width: 150px;
    height: auto;
    margin-bottom: 20px;
    opacity: 0;
    animation: bounceIn 1s ease-out 0.3s forwards;
}

@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

#gameOverMessage {
    font-size: 2.2rem;
    color: #e74c3c;
    text-shadow: 0 0 10px black;
    opacity: 0;
    animation: fadeIn 1s ease-out 1s forwards;
}

#gameOverRestartText {
    margin-top: 20px;
    font-size: 1rem;
    color: #999;
    opacity: 0;
    animation: fadeIn 1s ease-out 1.5s forwards;
}

#fire-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    pointer-events: none;
    z-index: -1;
}

.fire-particle {
    position: absolute;
    bottom: -50px;
    width: 30px;
    height: 40px;
    background: #ff8c00;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 0 0 10px #ff8c00, 0 0 20px #ff8c00, 0 0 30px #ff4500;
    animation: fireAnimation 2s ease-out infinite;
    opacity: 0;
}

.fire-particle:nth-child(1) { left: 10%; animation-duration: 2.1s; animation-delay: 0.2s; width: 25px; height: 35px; }
.fire-particle:nth-child(2) { left: 25%; animation-duration: 1.8s; animation-delay: 0s; }
.fire-particle:nth-child(3) { left: 40%; animation-duration: 2.3s; animation-delay: 0.5s; width: 35px; height: 45px; }
.fire-particle:nth-child(4) { left: 55%; animation-duration: 2s; animation-delay: 0.3s; }
.fire-particle:nth-child(5) { left: 70%; animation-duration: 1.7s; animation-delay: 0.1s; width: 20px; height: 30px; }
.fire-particle:nth-child(6) { left: 85%; animation-duration: 2.2s; animation-delay: 0.6s; }
.fire-particle:nth-child(7) { left: 50%; animation-duration: 1.9s; animation-delay: 0.4s; width: 40px; height: 50px; }


@keyframes fireAnimation {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.9;
        filter: blur(2px);
    }
    100% {
        transform: translateY(-150px) scale(0.5);
        opacity: 0;
        filter: blur(5px);
    }
}