:root {
    --bg: #f8fafc; --card: #ffffff; --text: #1e293b; --primary: #10b981;
    --border: #cbd5e1; --accent: #f1f5f9;
}

.dark-mode {
    --bg: #0f172a; --card: #1e293b; --text: #f1f5f9; --border: #475569; --accent: #334155;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); transition: 0.3s; }

.app-container { max-width: 500px; margin: 0 auto; min-height: 100vh; padding: 20px; display: flex; flex-direction: column; }
/* Header & Progress */
.game-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.header-left { display: flex; gap: 10px; }
.btn-icon { background: var(--card); border: 1px solid var(--border); padding: 10px; border-radius: 12px; cursor: pointer; color: var(--text); }
.bar-bg { background: var(--border); height: 8px; border-radius: 10px; overflow: hidden; margin-bottom: 5px; }
.bar-fill { background: var(--primary); height: 100%; width: 0%; transition: 0.5s; }


/* Arab Sentence */
.sentence-container {
    display: flex; flex-direction: row-reverse; justify-content: center;
    gap: 12px; margin: 30px 0; font-size: 2.2rem; font-weight: bold;
}
.clickable-word {
    padding: 4px 12px; border-radius: 12px; cursor: pointer; transition: 0.2s;
}
.clickable-word.active { color: var(--primary); background:var(--border)}
.clickable-word.completed { color: var(--primary); opacity: 0.5; }

/* Question Card */
.question-card {
    background: var(--border); color: var(--text); padding: 20px;
    border-radius: 20px; position: relative; margin-top: 20px;
}
.card-badge {
    position: absolute; top: -10px; left: 20px; background: var(--primary);
    padding: 4px 12px; border-radius: 8px; font-size: 0.75rem; font-weight: bold;
}

/* Options */
.options-grid { display: grid; gap: 10px; margin-top: 15px; }
.option-btn {
    background: #10b9818e; color: var(--text-main); border: none; padding: 12px;
    border-radius: 12px; font-weight: 600; cursor: pointer; transition: 0.2s;
}
.dark-mode .option-btn { background: #10b9818e; color: white; }
.option-btn:hover { transform: scale(1.02); background: #10b981; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 100; align-items: center; justify-content: center; }
.modal-card { background: var(--bg-app); padding: 30px; border-radius: 24px; text-align: center; width: 280px; }
.btn-continue { background: var(--success-color); color: white; border: none; width: 100%; padding: 14px; border-radius: 12px; font-weight: bold; cursor: pointer; margin-top: 15px; }

/* Level Overlay */
.overlay {
    display: none; 
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4); 
    backdrop-filter: blur(10px); /* Efek kaca */
    z-index: 1000;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

/* Kartu Level (Glassmorphism) */
.overlay-content {
    background: rgba(255, 255, 255, 0.85);
    width: 85%;
    max-width: 350px;
    padding: 25px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    text-align: center;
}

/* Dark Mode Adjustment */
.dark-mode .overlay-content {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.overlay-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary); /* Mengikuti warna tema utama */
    margin: 0;
}

.dark-mode .overlay-header h3 {
    color: #059669; /* Biru terang untuk dark mode */
}

/* Grid Tombol Level */
.level-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 5px;
}

/* Tombol Angka (Default/Locked) */
.lvl-btn {
    aspect-ratio: 1/1;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.dark-mode .lvl-btn {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.2);
}

/* Tombol Level Aktif (Warna Tema Darsa Media) */
.lvl-btn.active {
    background: linear-gradient(135deg, #10b981, #059669); /* Gradasi Biru-Ungu */
    color: white;
    box-shadow: 0 4px 10px #0596686a;
}

/* Highlight Level yang Sedang Dimainkan */
.lvl-btn.current {
    background: linear-gradient(135deg, #10b981, #059669); /* Gradasi Hijau Sukses */
    color: white;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.lvl-btn:disabled {
    cursor: not-allowed;
}

.lvl-btn.active:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* Tombol Close Level */
#btn-close-levels {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
    opacity: 0.5;
}

#btn-close-levels:hover {
    opacity: 1;
    color: #ef4444;
}

/* Tambahkan di irob.css */
#sentence-display {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}