@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;800&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #0f2027; 
    color: #333;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

#bg-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -1;
    background: linear-gradient(to bottom, #0f2027, #203a43, #2c5364);
}

.main-wrapper {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.screen {
    display: none;
    opacity: 0;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.screen.active {
    display: flex;
    opacity: 1;
}

/* Wajib pakai !important agar panel berhasil disembunyikan */
.hidden { display: none !important; } 

.game-title {
    font-size: 3.5rem;
    color: #f1c40f;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    margin: 20px 0 5px;
    text-align: center;
    letter-spacing: 2px;
}
.subtitle {
    color: #ecf0f1;
    font-size: 1.1rem;
    margin-bottom: 40px;
    text-align: center;
}
.screen-title {
    color: #f1c40f;
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.menu-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 400px;
}
.menu-btn {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}
.menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-color: #f1c40f;
}
.menu-btn.back-web {
    background: #c0392b;
    border-color: #e74c3c;
    margin-top: 10px;
}
.menu-btn.back-web:hover { background: #e74c3c; }

.back-btn {
    margin-top: 25px;
    padding: 10px 20px;
    background: #34495e;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

#level-grid {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.level-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.level-card:hover { transform: scale(1.02); }
.level-card.locked {
    background: rgba(189, 195, 199, 0.8);
    cursor: not-allowed;
    color: #7f8c8d;
}
.level-card.locked:hover { transform: none; }
.level-card.active-level {
    border: 3px solid #2ecc71;
    animation: pulse 2s infinite;
}
.level-info h3 { margin: 0; font-size: 1.2rem; }
.level-info p { margin: 5px 0 0; font-size: 0.9rem; color: #555; }
.level-status { font-size: 1.5rem; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.info-card {
    background: rgba(255,255,255,0.95);
    padding: 25px;
    border-radius: 15px;
    width: 100%;
    box-sizing: border-box;
}
.instruction-list { list-style: none; padding: 0; margin: 0; }
.instruction-list li { margin-bottom: 15px; font-size: 1.1rem; border-bottom: 1px solid #eee; padding-bottom: 10px;}
.center-text { text-align: center; }
.stat-item { font-size: 1.3rem; margin-bottom: 15px; font-weight: 600;}
.rank-badge { background: #f39c12; color: white; padding: 5px 15px; border-radius: 20px; font-size: 1.1rem; }

#game-container {
    width: 100%;
    background: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
#player-stats {
    display: flex; justify-content: space-between;
    background: #2c3e50; color: white; padding: 15px; font-weight: bold;
}
#battle-arena { padding: 20px; text-align: center; background: linear-gradient(135deg, #e0eafc, #cfdef3); }
#enemy-sprite { font-size: 70px; margin-bottom: 10px; animation: float 2s ease-in-out infinite; }
#enemy-dialogue { font-style: italic; background: white; padding: 10px; border-radius: 10px; display: inline-block; border: 2px solid #ccc; margin-bottom: 15px;}
#question-text { font-size: 1.1rem; margin-bottom: 20px;}
#question-text small { color: #7f8c8d; font-size: 0.9rem; display: block; margin-bottom: 5px; }
#options-container { display: flex; flex-direction: column; gap: 10px; }

/* INI ADALAH KELAS DESAIN TOMBOL JAWABAN YANG CANTIK */
.option-btn {
    padding: 15px; 
    border: 2px solid #3498db; 
    background: white; 
    color: #2c3e50;
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 1rem; 
    font-weight: 600; 
    transition: all 0.2s; 
    font-family: 'Poppins', sans-serif;
    text-align: left; /* Teks rata kiri agar rapi jika panjang */
}
.option-btn:hover { background: #3498db; color: white; }

#feedback-panel, #end-panel {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.95); display: flex; flex-direction: column;
    justify-content: center; align-items: center; z-index: 10;
}
#feedback-text { font-size: 2rem; margin-bottom: 5px;}
.correct { color: #27ae60; }
.wrong { color: #c0392b; }
#feedback-panel button, #end-panel button {
    padding: 12px 30px; background: #2ecc71; color: white; border: none;
    border-radius: 8px; font-size: 1.2rem; cursor: pointer; margin-top: 15px; font-weight: bold;
}

.credit-footer {
    margin-top: auto; padding-top: 30px; margin-bottom: 10px;
    font-size: 0.8rem; color: rgba(255,255,255,0.5); text-align: center; width: 100%;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}