:root {
    --primary: #4834d4;
    --bg: #f4f7fa;
    --white: #ffffff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; }

body { font-family: 'Segoe UI', Tahoma, sans-serif; background-color: var(--bg); margin: 0; direction: rtl; }

.container { max-width: 500px; margin: 0 auto; padding: 15px; }

/* الهيدر */
.top-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.nav-title { font-size: 1.2rem; font-weight: 800; color: var(--primary); flex: 1; text-align: center; }

/* 1- تعديل: بطاقات المواد ملونة بالكامل */
.subject-card {
    padding: 20px; border-radius: 18px; margin-bottom: 12px; 
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1); color: white; cursor: pointer;
    transition: 0.2s; border: none;
}
.subject-card:active { transform: scale(0.96); }
.subject-info { font-size: 1.1rem; font-weight: bold; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }

/* 2- تعديل: شبكة 4 أسئلة في الصف */
.questions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.q-box {
    aspect-ratio: 1/1; background: var(--white); border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; font-weight: 800; position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05); border-bottom: 4px solid #dfe6e9;
}
.q-edit-btn {
    position: absolute; top: 5px; left: 5px; font-size: 0.65rem;
    background: rgba(255,255,255,0.8); color: var(--primary); padding: 4px; border-radius: 6px;
}

/* ألوان الحالة */
.status-green { border-color: #2ecc71 !important; }
.status-yellow { border-color: #f1c40f !important; }
.status-red { border-color: #e74c3c !important; }

/* 3 & 4- تعديل: تنسيق التمرين وحجم الكلمات */
.quiz-container { background: var(--white); padding: 20px; border-radius: 20px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.quiz-text { 
    line-height: 2.2; 
    font-size: 1.1rem; /* تصغير الخط قليلاً */
    white-space: pre-wrap; 
    color: #000; /* النص الأساسي أسود */
}
.gap {
    display: inline-flex; /* لضمان المحاذاة مع النص */
    align-items: center; justify-content: center;
    min-width: 50px; height: 1.4em; background: #f0f0f0;
    border-bottom: 2px solid #bbb; margin: 0 3px; 
    vertical-align: middle; border-radius: 4px;
    color: transparent;
}
.gap.correct { 
    color: #000 !important; /* الكلمات المحلولة أسود */
    background: transparent; border-bottom-color: #2ecc71; 
    font-weight: bold; 
}

.word-card { 
    padding: 8px 15px; background: white; border: 1px solid #ddd; 
    border-radius: 10px; font-size: 0.95rem; font-weight: bold; color: #000;
}

/* الإدخال */
input, textarea { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid #ddd; font-family: inherit; font-size: 0.95rem; }
.main-btn { background: var(--primary); color: white; border: none; padding: 15px; border-radius: 15px; width: 100%; font-weight: bold; margin-top: 10px; cursor: pointer; }
.fab { position: fixed; bottom: 20px; left: 20px; width: 55px; height: 55px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; box-shadow: 0 5px 15px rgba(0,0,0,0.2); border: none; z-index: 100; }
.hidden { display: none !important; }
