/* --- [STYLE GAME 4 - TEBAK KITAB HADITS V1.0] --- */

/* --- Import Font --- */
@import url('https://fonts.googleapis.com/css2?family=Lateef:wght@400;700&family=Noto+Sans:wght@400;700&display=swap');

/* =========================================
--- 1. DEFINISI VARIABEL WARNA (TEMA) ---
(Sama seperti game lain)
=========================================
*/
:root {
    --font-arab: 'Lateef', serif;
    --font-latin: 'Noto Sans', sans-serif;
    --warna-bg: #f4f7f6;
    --warna-container-bg: #ffffff;
    --warna-teks-utama: #222;
    --warna-teks-sekunder: #555;
    --warna-teks-judul: #006400;
    --warna-teks-putih: #ffffff;
    --warna-teks-arab: #006400; /* Warna teks Arab */
    --warna-utama: #28a745;
    --warna-utama-hover: #218838;
    --warna-netral: #6c757d;
    --warna-netral-hover: #5a6268;
    --warna-border: #ddd;
    --warna-bayangan: rgba(0,0,0,0.07);
    --warna-benar-bg: #d4edda;
    --warna-benar-teks: #155724;
    --warna-salah-bg: #f8d7da;
    --warna-salah-teks: #721c24; /* Warna merah kita */
    --warna-skor-saya-bg: #d4edda;
    --warna-pilihan-bg: #f8f9fa;
    --warna-pilihan-hover: #e2e6ea;
    --warna-tabel-header: #f0f4f6;
}
html[data-theme="dark"] {
    --warna-bg: #121212;
    --warna-container-bg: #1e1e1e;
    --warna-teks-utama: #f1f1f1;
    --warna-teks-sekunder: #aaa;
    --warna-teks-judul: #38c172;
    --warna-teks-putih: #ffffff;
    --warna-teks-arab: #38c172; /* Warna teks Arab (dark) */
    --warna-utama: #28a745;
    --warna-utama-hover: #38c172;
    --warna-netral: #6c757d;
    --warna-netral-hover: #5a6268;
    --warna-border: #444;
    --warna-bayangan: rgba(255,255,255,0.05);
    --warna-benar-bg: #1a3a24;
    --warna-benar-teks: #a3d9b1;
    --warna-salah-bg: #4a1c22;
    --warna-salah-teks: #f1b9be; /* Warna merah kita (dark) */
    --warna-skor-saya-bg: #1a3a24;
    --warna-pilihan-bg: #333;
    --warna-pilihan-hover: #444;
    --warna-tabel-header: #2c2c2c;
}

/* =========================================
--- 2. STYLE DASAR (BODY, CONTAINER) ---
(Sama seperti game lain)
=========================================
*/
body {
    font-family: var(--font-latin);
    background-color: var(--warna-bg);
    color: var(--warna-teks-utama);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s;
}
.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 25px;
    background-color: var(--warna-container-bg);
    border-radius: 12px;
    box-shadow: 0 6px 18px var(--warna-bayangan);
    text-align: center;
    transition: background-color 0.3s;
}

/* =========================================
--- 3. STYLE NAVIGASI & NAMA ---
(Sama seperti game lain)
=========================================
*/
.header-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.header-nav > div { display: flex; gap: 10px; }
.back-link { font-family: var(--font-latin); text-decoration: none; color: var(--warna-netral); font-size: 0.9em; font-weight: 700; }
.back-link:hover { color: var(--warna-teks-utama); }
.theme-toggle { background: none; border: 2px solid var(--warna-border); color: var(--warna-teks-sekunder); font-size: 1.2em; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; padding: 0; display: flex; justify-content: center; align-items: center; transition: background-color 0.3s, color 0.3s, border-color 0.3s; }
.theme-toggle:hover { background-color: var(--warna-pilihan-bg); }

@media (max-width: 600px) { h1 { display: none; } }
.input-nama-wrapper { display: flex; gap: 10px; margin-bottom: 20px; align-items: center; }
#input-nama { flex-grow: 1; padding: 12px; border: 1px solid var(--warna-border); border-radius: 5px; font-size: 1em; background-color: var(--warna-bg); color: var(--warna-teks-utama); box-sizing: border-box; }
#simpan-nama-btn { width: auto; padding: 12px 15px; font-weight: 700; font-size: 1em; margin-top: 0; flex-shrink: 0; }
.nama-aktif-wrapper { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding: 10px 15px; background-color: var(--warna-pilihan-bg); border: 1px solid var(--warna-border); border-radius: 8px; }
#nama-aktif { margin: 0; font-weight: 700; color: var(--warna-teks-sekunder); font-size: 1.1em; text-align: left; flex-grow: 1; }
.rank-info { font-family: var(--font-latin); font-weight: 700; font-size: 0.9em; color: var(--warna-teks-sekunder); margin: 0 10px; white-space: nowrap; }
.btn-ganti-user { background-color: var(--warna-netral); color: var(--warna-teks-putih); border: none; border-radius: 5px; padding: 5px 12px; font-size: 0.9em; font-weight: 700; cursor: pointer; transition: background-color 0.3s; flex-shrink: 0; }
.btn-ganti-user:hover { background-color: var(--warna-netral-hover); }

/* =========================================
--- 4. STYLE GAME CARD & ELEMEN GAME ---
=========================================
*/
h1 { color: var(--warna-teks-judul); margin-bottom: 10px; font-weight: 700; }
h2 { color: var(--warna-teks-judul); border-bottom: 2px solid var(--warna-border); padding-bottom: 10px; font-size: 1.3em; }
p { font-size: 1.1em; color: var(--warna-teks-sekunder); margin-bottom: 25px; }

/* Style Instruksi Skor (Sama) */
.instruksi-game {
    font-size: 0.9em;
    color: var(--warna-teks-sekunder);
    margin-top: -10px;
    margin-bottom: 15px;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    padding: 0 5px;
}

.game-card { padding: 20px; margin-top: 20px; border: 1px solid var(--warna-border); border-radius: 8px; text-align: center; transition: border-color 0.3s; }

/* Style Timer Bar (Sama) */
.timer-bar-container { width: 100%; height: 10px; background-color: var(--warna-pilihan-bg); border: 1px solid var(--warna-border); border-radius: 5px; overflow: hidden; margin-bottom: 20px; }
.timer-bar { height: 100%; width: 100%; background-color: var(--warna-utama); transition: width 1s linear; }

/* [BARU] Style Kontainer Hadits */
.hadits-container {
    direction: rtl; /* Arab dibaca dari kanan */
    margin-bottom: 20px;
    padding: 10px;
    border: 1px dashed var(--warna-border); /* Beri border tipis */
    border-radius: 8px;
    background-color: var(--warna-bg); /* Sedikit beda background */
}
.hadits {
    line-height: 1.7; /* Sedikit lebih renggang */
    min-height: 30px; /* Minimal tinggi */
    display: block;
}
.hadits.arab {
    text-align: right;
    font-family: var(--font-arab);
    font-size: 1.8em; /* Lebih kecil dari ayat Qur'an */
    color: var(--warna-teks-arab);
    font-weight: 400; /* Normal saja, tidak bold */
    margin-bottom: 10px; /* Jarak ke pemisah/terjemahan */
}
.hadits.indo {
    direction: ltr; /* Terjemahan baca dari kiri */
    text-align: left;
    font-family: var(--font-latin);
    font-size: 0.95em; /* Ukuran normal */
    color: var(--warna-teks-sekunder); /* Warna sekunder */
}
.hadits:empty { display: none; }

/* [BARU] Style Pemisah Arab & Indo */
.pemisah-hadits {
    border: none;
    border-top: 1px solid var(--warna-border);
    margin: 15px 0; /* Jarak atas bawah */
}

/* Tombol Umum (Sama) */
.btn { display: inline-block; width: 100%; box-sizing: border-box; padding: 15px 20px; font-family: var(--font-latin); font-size: 1.1em; font-weight: 700; color: var(--warna-teks-putih); background-color: var(--warna-utama); border: none; border-radius: 5px; cursor: pointer; margin-top: 15px; text-decoration: none; transition: background-color 0.3s, transform 0.2s; }
.btn:hover { background-color: var(--warna-utama-hover); transform: translateY(-px); }

/* Style Pilihan Jawaban Horizontal (Sama seperti Game 2/3) */
.pilihan-jawaban {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    text-align: center;
    direction: ltr;
}
/* [DIUBAH] Nama class tombol pilihan */
.btn-pilihan-kitab {
    flex: 1;
    min-width: 120px; /* Atau sesuaikan agar muat */
    background-color: var(--warna-pilihan-bg);
    border: 1px solid var(--warna-border);
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
    padding: 10px 5px;
    font-weight: 700;
    color: var(--warna-teks-utama);
    text-align: center;
    direction: ltr;
    font-family: var(--font-latin);
    font-size: 0.9em; /* Kecilkan sedikit agar muat nama panjang */
    line-height: 1.3;
    margin-top: 0 !important;
}
.btn-pilihan-kitab:hover { background-color: var(--warna-pilihan-hover); }
.btn-pilihan-kitab:disabled { opacity: 0.7; }

/* Style Hasil (Sama) */
.hasil { margin-top: 20px; font-size: 1.2em; font-weight: 700; padding: 10px; border-radius: 5px; }
.hasil.benar { color: var(--warna-benar-teks); background-color: var(--warna-benar-bg); border: 1px solid var(--warna-benar-teks); }
.hasil.salah { color: var(--warna-salah-teks); background-color: var(--warna-salah-bg); border: 1px solid var(--warna-salah-teks); font-size: 1.0em; }
.hasil.salah .poin-nol { color: var(--warna-salah-teks); font-weight: bold; }

/* =========================================
--- 5. STYLE LEADERBOARD & PAGINASI ---
(Sama seperti game lain)
=========================================
*/
.leaderboard-container { margin-top: 30px; text-align: left; }
#leaderboard-table { width: 100%; border-collapse: collapse; }
#leaderboard-table th, #leaderboard-table td { padding: 12px 15px; border-bottom: 1px solid var(--warna-border); transition: border-color 0.3s; text-align: center; }
#leaderboard-table td:nth-child(2) { text-align: left; }
#leaderboard-table th { background-color: var(--warna-tabel-header); color: var(--warna-teks-sekunder); font-weight: 700; }
.skor-saya { background-color: var(--warna-skor-saya-bg) !important; font-weight: 700; }
.pagination-controls { display: none; justify-content: space-between; align-items: center; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--warna-border); }
.pagination-btn { width: auto; flex-grow: 0; flex-shrink: 0; padding: 10px 15px; font-size: 0.9em; margin-top: 0; background-color: var(--warna-utama); }
.pagination-btn:hover { background-color: var(--warna-utama-hover); }
.pagination-btn:disabled { background-color: var(--warna-netral); opacity: 0.6; cursor: not-allowed; transform: none; }
#page-info { font-family: var(--font-latin); font-weight: 700; font-size: 0.9em; color: var(--warna-teks-sekunder); flex-grow: 1; text-align: center; }
.admin-contact { font-family: var(--font-latin); font-size: 0.85em; color: var(--warna-teks-sekunder); margin-top: 20px; margin-bottom: 0; text-align: center; line-height: 1.5; }
.admin-contact a { color: var(--warna-utama); font-weight: 700; text-decoration: none; white-space: nowrap; }
.admin-contact a:hover { text-decoration: underline; }

/* =========================================
--- 6. STYLE ANIMASI ---
(Sama seperti game lain)
=========================================
*/
@keyframes pulse-green {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
  70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}
.jawaban-benar-highlight { animation: pulse-green 1s ease-out; }

/* =========================================
--- 7. [BARU] STYLE INFO SUMBER HADITS (di HASIL) ---
=========================================
*/
.hasil .info-sumber {
    display: block; /* Agar pindah baris */
    margin-top: 8px; /* Jarak dari teks hasil utama */
    font-size: 0.8em; /* Lebih kecil */
    font-weight: 400; /* Normal (tidak bold) */
    color: var(--warna-teks-sekunder); /* Warna abu-abu */
    font-style: italic; /* Miring */
    font-family: var(--font-latin); /* Pastikan font latin */
}