:root {
    --primary: #4834d4;
    --success: #2ecc71;
    --error: #e74c3c;
    --bg: #f0f2f5;
    --card: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background-color: var(--bg);
    margin: 0; padding: 0; transition: background 0.3s ease;
    overflow-x: hidden; touch-action: manipulation;
}

/* حالات الألوان التفاعلية */
body.correct-flash { background-color: #d1f2eb !important; }
body.error-flash { background-color: #fadbd8 !important; }

.container { max-width: 600px; margin: 0 auto; min-height: 100vh; padding: 20px; box-sizing: border-box; }

/* الهيدر والملاحة */
.top-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.back-circle-btn { width: 45px; height: 45px; border-radius: 50%; border: none; background: #fff; color: var(--primary); box-shadow: 0 4px 10px rgba(0,0,0,0.1); cursor: pointer; }
.score-badge { background: var(--primary); color: #fff; padding: 5px 15px; border-radius: 20px; font-weight: bold; }

/* المكتبة والضغط المطول */
.questions-grid { display: grid; gap: 15px; margin-top: 20px; }
.question-item { 
    background: #fff; padding: 20px; border-radius: 18px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); cursor: pointer;
    border-right: 6px solid var(--primary); transition: transform 0.2s;
    user-select: none; -webkit-user-select: none;
}
.question-item:active { transform: scale(0.97); background: #f9f9f9; }

/* منطقة التمرين */
.interactive-text { 
    background: #fff; padding: 25px; border-radius: 20px; 
    line-height: 2.8; font-size: 1.2rem; text-align: justify;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); min-height: 200px;
}

.word-gap {
    display: inline-block; min-width: 50px; border-bottom: 2px solid #ccc;
    margin: 0 4px; color: transparent; transition: 0.3s;
}
.word-gap.active-gap { border-bottom: 3px solid var(--primary); background: #f0efff; }
.word-gap.filled { color: var(--primary); border-bottom-color: var(--success); font-weight: bold; }

/* الكلمات العائمة */
.floating-words { 
    display: flex; flex-wrap: wrap; gap: 12px; 
    justify-content: center; margin-top: 30px; padding-bottom: 100px;
}
.word-card {
    padding: 12px 20px; background: #fff; border: 2px solid var(--primary);
    border-radius: 12px; cursor: pointer; font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); transition: 0.2s;
}

/* اختيار الصعوبة */
.difficulty-picker { background: #fff; padding: 10px 15px; border-radius: 12px; margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; font-size: 0.9rem; }
#difficulty-level { border: none; color: var(--primary); font-weight: bold; outline: none; }

.fab-btn { position: fixed; bottom: 30px; left: 30px; width: 65px; height: 65px; border-radius: 50%; background: var(--primary); color: #fff; border: none; font-size: 1.5rem; box-shadow: 0 8px 20px rgba(72,52,212,0.4); }

.hidden { display: none !important; }
