/* ========================================
   تنسيقات عامة وإعادة تعيين
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* الألوان الرئيسية */
    --primary-green: #0F3D2E;
    --secondary-gold: #D4AF37;
    --accent-bg: #EAE3CC;
    --text-dark: #1E1E1E;
    --hover-green: #1C6B4C;
    --correct-green: #28a745;
    --wrong-red: #dc3545;
    --light-bg: #F5F1E8;
    --card-bg: #FFFFFF;

    /* الظلال */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.2);

    /* الانتقالات */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #F5F1E8 0%, #E8E1D5 100%);
    color: var(--text-dark);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ========================================
   خلفية النجوم المتحركة
   ======================================== */

.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--secondary-gold);
    border-radius: 50%;
    animation: twinkle 3s infinite;
    opacity: 0;
}

.star:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.star:nth-child(2) {
    top: 40%;
    left: 80%;
    animation-delay: 0.5s;
}

.star:nth-child(3) {
    top: 60%;
    left: 30%;
    animation-delay: 1s;
}

.star:nth-child(4) {
    top: 80%;
    left: 70%;
    animation-delay: 1.5s;
}

.star:nth-child(5) {
    top: 30%;
    left: 50%;
    animation-delay: 2s;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* ========================================
   الحاوية الرئيسية
   ======================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* ========================================
   رأس الصفحة
   ======================================== */

.main-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--hover-green) 100%);
    padding: 40px 20px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 40px 40px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-logos {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.header-logo {
    width: clamp(100px, 18vw, 200px);
    height: auto;
    padding: clamp(12px, 2vw, 24px);
    /* إضافة padding */
    background: rgba(255, 255, 255, 0.15);
    /* خلفية شفافة */
    border-radius: 20px;
    /* حدود دائرية */
    backdrop-filter: blur(10px);
    /* تأثير زجاجي */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
    /* ظلال محسّنة */
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo:hover {
    transform: scale(1.1);
}

.logo-left {
    order: 2;
}

.logo-right {
    order: 1;
}



.main-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: headerPulse 8s infinite;
}

@keyframes headerPulse {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(10px, 10px) scale(1.1);
    }
}

.header-content {
    position: relative;
    z-index: 1;
}

.header-icon {
    font-size: 48px;
    margin-bottom: 10px;
    animation: floatIcon 3s ease-in-out infinite;
    display: inline-block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.main-title {
    font-family: 'Amiri', serif;
    font-size: clamp(32px, 6vw, 48px);
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.header-subtitle {
    font-size: clamp(16px, 3vw, 20px);
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
}

.header-decoration {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.deco-icon {
    font-size: 24px;
    animation: bounce 2s infinite;
    display: inline-block;
}

.deco-icon:nth-child(2) {
    animation-delay: 0.3s;
}

.deco-icon:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* ========================================
   الشاشات (Screens)
   ======================================== */

.screen {
    display: none;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   شاشة الترحيب
   ======================================== */

.welcome-card {
    background: var(--card-bg);
    border-radius: 30px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    max-width: 900px;
    margin: 0 auto;
}

.welcome-hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: scaleIn 0.6s ease;
    display: inline-block;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.welcome-title {
    font-family: 'Tajawal', sans-serif;
    font-size: clamp(26px, 5vw, 36px);
    color: var(--primary-green);
    margin-bottom: 15px;
    font-weight: 800;
}

.welcome-desc {
    font-size: clamp(16px, 3vw, 20px);
    color: #666;
    font-weight: 400;
}

/* ========================================
   قسم الإعدادات
   ======================================== */

.settings-section {
    margin-bottom: 35px;
}

.settings-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 20px;
}

.label-icon {
    font-size: 28px;
}

/* ========================================
   بطاقات اختيار القسم
   ======================================== */

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.section-card {
    background: linear-gradient(135deg, var(--accent-bg) 0%, #F0E9D8 100%);
    border-radius: 20px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.section-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.section-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-gold);
}

.section-card:hover::before {
    opacity: 1;
}

.section-card.selected {
    background: linear-gradient(135deg, var(--secondary-gold) 0%, #C9A532 100%);
    border-color: var(--primary-green);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4);
}

.section-card.selected .card-title,
.section-card.selected .card-desc {
    color: white;
}

.section-card.special {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--hover-green) 100%);
    color: white;
}

.section-card.special .card-title,
.section-card.special .card-desc {
    color: white;
}

.section-card.special.selected {
    background: linear-gradient(135deg, var(--secondary-gold) 0%, #C9A532 100%);
}

.card-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-5px) rotate(5deg);
    }
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 8px;
}

.card-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
}

.card-badge {
    display: inline-block;
    background: rgba(15, 61, 46, 0.1);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.section-card.selected .card-badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* ========================================
   أزرار الصعوبة
   ======================================== */

.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.difficulty-btn {
    padding: 18px 20px;
    background: white;
    border: 3px solid #ddd;
    border-radius: 18px;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.difficulty-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.difficulty-btn:hover::before {
    width: 300px;
    height: 300px;
}

.difficulty-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.difficulty-btn.selected {
    background: linear-gradient(135deg, var(--secondary-gold) 0%, #C9A532 100%);
    border-color: var(--secondary-gold);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.diff-icon {
    font-size: 24px;
}

.diff-text {
    position: relative;
    z-index: 1;
}

/* ========================================
   مفتاح المؤقت
   ======================================== */

.timer-container {
    background: var(--accent-bg);
    padding: 20px 25px;
    border-radius: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.timer-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-green);
}

.timer-icon {
    font-size: 28px;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toggle-switch {
    width: 60px;
    height: 32px;
    background: #ccc;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: background var(--transition-normal);
}

.toggle-slider {
    width: 26px;
    height: 26px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    right: 3px;
    transition: transform var(--transition-normal);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active {
    background: var(--secondary-gold);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(-28px);
}

.toggle-status {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-green);
    min-width: 50px;
}

/* ========================================
   زر البدء
   ======================================== */

.start-btn {
    width: 100%;
    max-width: 350px;
    margin: 40px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 40px;
    background: linear-gradient(135deg, var(--secondary-gold) 0%, #C9A532 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 24px;
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4);
    position: relative;
    overflow: hidden;
}

.start-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.start-btn:hover::before {
    width: 400px;
    height: 400px;
}

.start-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 32px rgba(212, 175, 55, 0.5);
}

.start-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 28px;
    position: relative;
    z-index: 1;
}

.btn-text {
    position: relative;
    z-index: 1;
}

/* ========================================
   شاشة اللعب
   ======================================== */

.game-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 15px 20px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
    flex: 1;
    min-width: 140px;
    transition: transform var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card.highlight {
    background: linear-gradient(135deg, var(--secondary-gold) 0%, #C9A532 100%);
    color: white;
}

.stat-icon {
    font-size: 32px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 14px;
    opacity: 0.8;
}

.stat-card.highlight .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-green);
}

.stat-card.highlight .stat-value {
    color: white;
}

.back-btn {
    background: var(--primary-green);
    border: none;
    padding: 12px 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}

.back-btn:hover {
    background: var(--hover-green);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.back-btn:active {
    transform: translateY(0);
}

.back-icon {
    font-size: 20px;
}

.back-text {
    display: inline-block;
}

.sound-btn {
    background: var(--accent-bg);
    border: none;
    padding: 15px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-normal);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-btn:hover {
    background: var(--secondary-gold);
    transform: scale(1.1) rotate(10deg);
}

.sound-icon {
    font-size: 24px;
}

/* ========================================
   شريط التقدم
   ======================================== */

.progress-wrapper {
    margin-bottom: 25px;
}

.progress-track {
    height: 12px;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-gold) 0%, var(--primary-green) 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ========================================
   بطاقة السؤال
   ======================================== */

.question-card {
    background: white;
    border-radius: 25px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    min-height: 450px;
    position: relative;
}

.question-header {
    margin-bottom: 25px;
    text-align: center;
}

.question-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--hover-green) 100%);
    color: white;
    padding: 10px 25px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.question-content {
    margin-bottom: 25px;
}

.question-title {
    font-family: 'Tajawal', serif;
    font-size: clamp(22px, 4vw, 28px);
    color: var(--primary-green);
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.8;
    font-weight: 700;
}

/* ========================================
   القسم الأول: اختيار متعدد
   ======================================== */

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.option-btn {
    padding: 20px 25px;
    background: var(--accent-bg);
    border: 3px solid transparent;
    border-radius: 18px;
    font-size: 18px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: right;
    line-height: 1.6;
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.option-btn:hover:not(.correct):not(.wrong):not(:disabled)::before {
    width: 400px;
    height: 400px;
}

.option-btn:hover:not(.correct):not(.wrong):not(:disabled) {
    background: #DDD5BF;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--secondary-gold);
}

.option-btn.correct {
    background: linear-gradient(135deg, var(--correct-green) 0%, #20873a 100%);
    color: white;
    border-color: var(--correct-green);
    animation: correctPulse 0.6s ease;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.option-btn.wrong {
    background: linear-gradient(135deg, var(--wrong-red) 0%, #c82333 100%);
    color: white;
    border-color: var(--wrong-red);
    animation: shake 0.5s ease;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

@keyframes correctPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    50% {
        transform: translateX(10px);
    }

    75% {
        transform: translateX(-5px);
    }
}

/* ========================================
   القسم الثاني: ترتيب الجملة
   ======================================== */

.words-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    min-height: 100px;
    padding: 25px;
    background: var(--accent-bg);
    border-radius: 20px;
    margin-bottom: 20px;
    border: 2px dashed rgba(212, 175, 55, 0.3);
}

.words-label {
    width: 100%;
    text-align: center;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 10px;
}

.word-card {
    padding: 15px 25px;
    background: white;
    border: 3px solid var(--primary-green);
    border-radius: 15px;
    font-size: 18px;
    font-weight: 700;
    cursor: grab;
    transition: all var(--transition-normal);
    user-select: none;
    box-shadow: var(--shadow-sm);
}

.word-card:active {
    cursor: grabbing;
}

.word-card:hover {
    transform: translateY(-3px) rotate(2deg);
    box-shadow: var(--shadow-md);
}

.word-card.dragging {
    opacity: 0.5;
    transform: scale(1.08);
}

.drop-zone {
    min-height: 100px;
    padding: 25px;
    background: white;
    border: 3px dashed var(--secondary-gold);
    border-radius: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.drop-zone.drag-over {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--primary-green);
    border-style: solid;
    transform: scale(1.02);
}

.drop-zone-placeholder {
    color: #999;
    font-size: 16px;
    font-weight: 500;
}

.section2-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.check-btn,
.reset-btn {
    padding: 16px 35px;
    border: none;
    border-radius: 18px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: 'Cairo', sans-serif;
}

.check-btn {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--hover-green) 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(15, 61, 46, 0.3);
}

.check-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(15, 61, 46, 0.4);
}

.reset-btn {
    background: var(--accent-bg);
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
}

.reset-btn:hover {
    background: var(--primary-green);
    color: white;
    transform: translateY(-3px);
}

.check-btn:active,
.reset-btn:active {
    transform: translateY(-1px);
}

/* ========================================
   القسم الثالث: اكتشف الخطأ
   ======================================== */

.sentence-display {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 30px 0;
}

.word-item {
    padding: 14px 22px;
    background: var(--accent-bg);
    border: 3px solid transparent;
    border-radius: 15px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.word-item:hover {
    background: #DDD5BF;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.word-item.selected {
    background: linear-gradient(135deg, var(--secondary-gold) 0%, #C9A532 100%);
    color: white;
    border-color: var(--secondary-gold);
    transform: translateY(-3px) scale(1.05);
}

.word-item.error-highlight {
    background: linear-gradient(135deg, var(--wrong-red) 0%, #c82333 100%);
    color: white;
    animation: shake 0.5s ease;
}

.correction-panel {
    display: none;
    margin-top: 30px;
    padding: 25px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 20px;
    border: 2px solid rgba(212, 175, 55, 0.3);
}

.correction-panel.show {
    display: block;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.correction-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 15px;
    text-align: center;
}

.correction-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.correction-btn {
    padding: 14px 28px;
    background: white;
    border: 3px solid var(--primary-green);
    border-radius: 15px;
    font-size: 18px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.correction-btn:hover {
    background: var(--accent-bg);
    transform: translateY(-3px);
}

.correction-btn.correct {
    background: linear-gradient(135deg, var(--correct-green) 0%, #20873a 100%);
    color: white;
    border-color: var(--correct-green);
    animation: correctPulse 0.6s ease;
}

/* ========================================
   ✅ زر الرجوع الثابت - التغييرات هنا
   ======================================== */

/* ✅ التغيير 1: تغيير position من fixed إلى static لإزالة التحرك مع الصفحة */
.back-button-fixed {
    position: static;
    /* ✅ تم التغيير من fixed إلى static */
    /* تم إزالة: top, right, z-index - لأنها خاصة بـ fixed */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all var(--transition-normal);
    margin-bottom: 20px;
    /* ✅ إضافة مسافة تحته */
}

/* ✅ التغيير 2: تحديث تنسيق الظهور */
.back-button-fixed.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ✅ التغيير 3: تحديث تنسيق الزر نفسه */
.back-button-fixed button {
    display: inline-flex;
    /* ✅ تم التغيير من flex إلى inline-flex */
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--hover-green) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
}

.back-button-fixed button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, var(--hover-green) 0%, var(--primary-green) 100%);
}

.back-button-fixed button:active {
    transform: translateY(-1px) scale(1.02);
}

.back-button-icon {
    font-size: 20px;
    font-weight: bold;
    transition: transform var(--transition-fast);
}

.back-button-fixed button:hover .back-button-icon {
    transform: translateX(5px);
}

.back-button-text {
    font-weight: 600;
}

/* ========================================
   صندوق التغذية الراجعة
   ======================================== */

.feedback-box {
    display: none;
    margin-top: 25px;
    padding: 25px;
    border-radius: 18px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    animation: slideIn 0.4s ease;
}

.feedback-box.show {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-box.correct {
    background: rgba(40, 167, 69, 0.1);
    color: var(--correct-green);
    border: 3px solid var(--correct-green);
}

.feedback-box.wrong {
    background: rgba(220, 53, 69, 0.1);
    color: var(--wrong-red);
    border: 3px solid var(--wrong-red);
}

.feedback-icon {
    font-size: 36px;
    margin-bottom: 10px;
    display: block;
}

.feedback-text {
    font-size: 20px;
    margin-bottom: 10px;
}

.feedback-explanation {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.9;
    margin-top: 10px;
    line-height: 1.6;
}

/* ========================================
   زر التالي
   ======================================== */

.next-btn {
    display: none;
    margin: 25px auto 0;
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--secondary-gold) 0%, #C9A532 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: 'Cairo', sans-serif;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
    align-items: center;
    gap: 10px;
}

.next-btn.show {
    display: flex;
    margin-left: auto;
    margin-right: auto;
}

.next-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4);
}

.btn-arrow {
    font-size: 20px;
    transition: transform var(--transition-normal);
}

.next-btn:hover .btn-arrow {
    transform: translateX(-5px);
}

/* ========================================
   شاشة النتائج
   ======================================== */

.results-card {
    background: white;
    border-radius: 30px;
    padding: 50px 40px;
    box-shadow: var(--shadow-xl);
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.results-header {
    margin-bottom: 30px;
}

.results-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: zoomIn 0.6s ease;
    display: inline-block;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.results-title {
    font-family: 'Tajawal', serif;
    font-size: clamp(28px, 5vw, 38px);
    color: var(--primary-green);
    font-weight: 800;
}

/* ========================================
   دائرة النتيجة
   ======================================== */

.score-display {
    margin: 30px 0;
}

.score-circle {
    width: 180px;
    height: 180px;
    margin: 0 auto;
    position: relative;
}

.score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: #E8E1D5;
    stroke-width: 8;
}

.score-ring-fill {
    fill: none;
    stroke: var(--secondary-gold);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1.5s ease;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    font-size: 56px;
    font-weight: 900;
    color: var(--secondary-gold);
    display: block;
}

.score-total {
    font-size: 24px;
    color: #999;
    font-weight: 600;
}

/* ========================================
   رسالة النتائج
   ======================================== */

.results-message {
    font-size: clamp(18px, 3vw, 22px);
    color: var(--text-dark);
    margin: 25px 0;
    line-height: 1.6;
    font-weight: 600;
}

/* ========================================
   شبكة الإحصائيات
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 35px 0;
}

.stat-box {
    padding: 25px 20px;
    background: var(--accent-bg);
    border-radius: 20px;
    transition: transform var(--transition-normal);
}

.stat-box:hover {
    transform: translateY(-5px);
}

.stat-box.correct {
    background: rgba(40, 167, 69, 0.1);
    border: 2px solid var(--correct-green);
}

.stat-box.wrong {
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid var(--wrong-red);
}

.stat-box.time {
    background: rgba(212, 175, 55, 0.1);
    border: 2px solid var(--secondary-gold);
}

.stat-box-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.stat-box-value {
    font-size: 40px;
    font-weight: 900;
    margin-bottom: 5px;
}

.stat-box.correct .stat-box-value {
    color: var(--correct-green);
}

.stat-box.wrong .stat-box-value {
    color: var(--wrong-red);
}

.stat-box.time .stat-box-value {
    color: var(--secondary-gold);
}

.stat-box-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

/* ========================================
   أزرار النتائج
   ======================================== */

.results-actions {
    margin-top: 35px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 40px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--hover-green) 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: 'Cairo', sans-serif;
    box-shadow: 0 6px 20px rgba(15, 61, 46, 0.3);
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(15, 61, 46, 0.4);
}

.action-btn .btn-icon {
    font-size: 24px;
}

/* ========================================
   ذيل الصفحة
   ======================================== */

.main-footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 50px;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-text {
    font-family: 'Amiri', serif;
    font-size: clamp(18px, 3vw, 22px);
    color: var(--primary-green);
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-icon {
    font-size: 24px;
    animation: twinkle 2s infinite;
}

.footer-date {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.footer-logo-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-logo {
    width: clamp(130px, 25vw, 280px);
    height: auto;
    padding: clamp(16px, 3vw, 30px);
    background: rgba(255, 255, 255, 0.12);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo:hover {
    transform: scale(1.08) translateY(-3px);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

/* ========================================
   تصميم متجاوب
   ======================================== */

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .main-header {
        padding: 30px 15px 20px;
        border-radius: 0 0 30px 30px;
    }

    .header-icon {
        font-size: 40px;
    }

    .welcome-card,
    .question-card,
    .results-card {
        padding: 25px 20px;
    }

    .section-grid,
    .difficulty-grid {
        grid-template-columns: 1fr;
    }

    .game-stats {
        flex-direction: column;
    }

    .stat-card {
        width: 100%;
    }

    .back-btn {
        width: 100%;
        justify-content: center;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* ✅ التغيير 4: إضافة تنسيق للهواتف */
    .back-button-fixed {
        width: 100%;
        margin-bottom: 15px;
    }

    .back-button-fixed button {
        width: 100%;
        justify-content: center;
    }
}