/* --- [STYLE GAME 1 - SAMBUNG AYAT v2.0] --- */
/* Versi bersih, dihapus style index.html & game lain */

/* --- Import Font --- */
@import url('https://fonts.googleapis.com/css2?family=Lateef:wght@400;700&family=Noto+Sans:wght@400;700&display=swap');

: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-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-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-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-skor-saya-bg: #1a3a24;
    --warna-pilihan-bg: #333;
    --warna-pilihan-hover: #444;
    --warna-tabel-header: #2c2c2c;
}

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;
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.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;
}
.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;
}

/* --- Style .menu & .menu-item DIHAPUS --- */

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;
}
.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;
}
.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); }

.game-card {
    padding: 20px;
    margin-top: 20px;
    border: 1px solid var(--warna-border);
    border-radius: 8px;
    text-align: right; /* [PENTING] Tetap rata kanan untuk Game 1 */
    transition: border-color 0.3s;
}

/* --- Style Teks Ayat & Referensi --- */
.ayat {
    direction: rtl;
    margin-bottom: 20px;
    line-height: 1.7;
    min-height: 50px; 
}
/* Sembunyikan teks ayat saat loading awal */
.ayat-teks:empty, .ayat-referensi:empty {
    display: none;
}
.ayat-teks {
    display: block;
    font-family: var(--font-arab);
    font-size: 2.6em; /* Ukuran font ayat (JS akan ganti ke 3.5em) */
    color: var(--warna-teks-arab);
    font-weight: 700;
}
.ayat-referensi {
    display: block;
    font-family: var(--font-latin);
    font-size: 1.15em;
    color: var(--warna-teks-sekunder);
    font-weight: 400;
    text-align: right;
    margin-top: 8px;
    direction: ltr;
    text-align: right;
}

.pilihan-jawaban {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: right;
}
.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(-2px);
}

/* [DIUBAH] Hanya style untuk .btn-pilihan */
.btn-pilihan {
    background-color: var(--warna-pilihan-bg);
    border: 1px solid var(--warna-border);
    line-height: 1.6;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
    padding: 10px 15px;
    font-weight: 700;
}
.btn-pilihan:hover { background-color: var(--warna-pilihan-hover); }
.btn-pilihan:disabled { opacity: 0.7; }
.btn-pilihan {
    color: var(--warna-teks-arab);
    text-align: right;
    direction: rtl;
    font-family: var(--font-arab);
    font-size: 1.8em;
}

/* --- Style .btn-pilihan-surah DIHAPUS --- */

.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;
}

.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;
}

/* --- Timer Bar (Versi JS-Control) --- */
.timer-bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--warna-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}
.timer-bar {
    height: 100%;
    width: 100%;
    background-color: var(--warna-utama);
    border-radius: 4px;
}

/* --- Styling untuk Mode Tabs (2 Baris) --- */
.mode-tabs {
    display: flex;
    justify-content: center;
    background-color: var(--warna-pilihan-bg);
    border-radius: 8px;
    padding: 5px;
    margin-bottom: 20px;
    border: 1px solid var(--warna-border);
}
.mode-tab {
    flex-grow: 1;
    flex-basis: 0;
    padding: 8px 5px;
    font-family: var(--font-latin);
    color: var(--warna-teks-sekunder);
    background-color: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.3;
}
.mode-tab span {
    display: block;
    text-align: center;
}
.tab-level {
    font-size: 0.9em;
    font-weight: 700;
}
.tab-juz {
    font-size: 0.8em;
    font-weight: 400;
}
.mode-tab:hover {
    background-color: var(--warna-border);
}
.mode-tab.active {
    background-color: var(--warna-utama);
    color: var(--warna-teks-putih);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.mode-tab.active span {
    color: var(--warna-teks-putih);
}

/* --- Animasi singkat untuk highlight jawaban benar --- */
@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;
}

.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;
}