:root { --primary: #4834d4; --bg-sky: #e3f2fd; --white: #ffffff; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; }
html, body { overscroll-behavior-y: contain; background-color: var(--bg-sky); margin: 0; direction: rtl; font-family: 'Segoe UI', Tahoma, sans-serif; }
.container { max-width: 500px; margin: 0 auto; padding: 15px; min-height: 100vh; }
.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; }

/* بطاقات المواد */
.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; }
.action-btns { display: flex; gap: 8px; }
.btn-icon { background: rgba(255,255,255,0.25); padding: 7px; border-radius: 8px; cursor: pointer; font-size: 0.9rem; }

/* شبكة الأسئلة */
.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.2rem; font-weight: 800; position: relative; box-shadow: 0 4px 8px rgba(0,0,0,0.05); border-bottom: 5px solid #dfe6e9; }
.q-actions { position: absolute; top: 4px; left: 4px; right: 4px; display: flex; justify-content: space-between; font-size: 0.6rem; color: var(--primary); }

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

/* الخيارات */
.option-group { background: white; padding: 10px; border-radius: 15px; margin-bottom: 10px; border: 1px solid #d1e9ff; }
.option-label { display: block; font-size: 0.8rem; font-weight: bold; color: #555; margin-bottom: 5px; }
.chips { display: flex; gap: 5px; }
.chip-item { flex: 1; text-align: center; padding: 10px 2px; background: #f0f7ff; border-radius: 10px; font-size: 0.75rem; cursor: pointer; border: 1px solid #bee3f8; color: #444; }
input[type="radio"]:checked + .chip-item { background: var(--primary); color: white; border-color: var(--primary); }

/* تأثير الخطأ */
.gap.error-flash { background: #ffcccc !important; border-bottom-color: #e74c3c !important; transition: 0.2s; }
.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; }
.gap.correct { color: #000 !important; background: transparent; border-bottom-color: #2ecc71; font-weight: bold; }

.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; }
input, textarea { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid #ddd; margin-bottom: 10px; background: white; }
.main-btn { background: var(--primary); color: white; border: none; padding: 15px; border-radius: 15px; width: 100%; font-weight: bold; cursor: pointer; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal-content { background: var(--bg-sky); padding: 20px; border-radius: 20px; width: 85%; }
.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; border: none; z-index: 100; box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
.hidden { display: none !important; }
