* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 900;
    margin: 0;
    padding: 0;
}

body {
    overflow: hidden;
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- اللوغو الثابت في أعلى يمين الشاشة --- */
.fixed-logo {
    position: fixed;
    top: 35px;
    right: 35px;
    z-index: 99999;
    pointer-events: none;
}

.logo-top-right {
    width: 140px;
    height: auto;
    object-fit: contain;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.logo-top-right:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* --- شاشة العرض --- */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg, 
        #111952 0%, 
        #0a3a7a 25%, 
        #0066b3 50%, 
        #0099dd 75%, 
        #00D4FF 100%
    );
    background-size: 300% 300%;
    animation: gradientAnimation 20s ease-in-out infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    margin: 0;
    padding: 0;
}

.logo-img-big {
    width: 50%;
    max-width: 500px;
    height: auto;
    object-fit: contain;
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- شاشة الترحيب --- */
#welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg, 
        #111952 0%, 
        #0a3a7a 25%, 
        #0066b3 50%, 
        #0099dd 75%, 
        #00D4FF 100%
    );
    background-size: 300% 300%;
    animation: gradientAnimation 20s ease-in-out infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    width: 100%;
    max-width: 600px;
}

.welcome-title {
    color: #ffffff;
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

.person-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.4);
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.credit-text {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.start-btn {
    background: linear-gradient(135deg, #00D4FF, #0099cc);
    color: #ffffff;
    border: none;
    padding: 16px 50px;
    font-size: 1.3rem;
    font-weight: 900;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.start-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.start-btn:hover::before {
    left: 100%;
}

.start-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.6);
    background: linear-gradient(135deg, #00D4FF, #0077b3);
}

.start-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

/* --- شاشة الأسئلة --- */
#questions-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg, 
        #111952 0%, 
        #0a3a7a 25%, 
        #0066b3 50%, 
        #0099dd 75%, 
        #00D4FF 100%
    );
    background-size: 300% 300%;
    animation: gradientAnimation 20s ease-in-out infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9997;
}

/* --- حاوية الأسئلة --- */
.questions-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 30px 35px;
    width: 95%;
    max-width: 850px;
    height: auto;
    max-height: 90vh;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.3s ease;
}

/* --- مساحة الصورة --- */
.image-area {
    width: 100%;
    flex: 0 0 auto;
    display: none;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: rgba(17, 25, 82, 0.05);
    border-radius: 16px;
    aspect-ratio: 1 / 1;
    max-height: 200px;
    width: 200px;
    margin: 0 auto 10px auto;
}

#question-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* --- نص السؤال --- */
.question-text-area {
    text-align: center;
    flex-shrink: 0;
    padding: 5px 0;
    order: 0;
}

#question-text {
    color: #111952;
    font-size: 1.5rem;
    font-weight: 900;
}

/* --- الخيارات --- */
.options-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    justify-content: center;
    min-height: 80px;
    padding: 5px 0;
    order: 1;
}

.option {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option:hover {
    background: #edf2f7;
    border-color: #111952;
}

/* --- الخيار المختار (قبل التأكيد) --- */
.option.selected {
    background: #111952;
    border-color: #111952;
    color: white;
}

.option.selected .option-letter {
    background: white;
    color: #111952;
}

/* --- الإجابة الصحيحة (لون أخضر فاتح مع تدرج) --- */
.option.correct {
    background: linear-gradient(135deg, #e6f7e6, #d4edda);
    border-color: #28a745;
    color: #155724;
}

.option.correct .option-letter {
    background: #28a745;
    color: white;
}

/* --- الإجابة الخاطئة (لون أحمر فاتح مع تدرج) --- */
.option.wrong {
    background: linear-gradient(135deg, #f8e6e6, #f8d7da);
    border-color: #dc3545;
    color: #721c24;
}

.option.wrong .option-letter {
    background: #dc3545;
    color: white;
}

.option-letter {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background: #e2e8f0;
    border-radius: 50%;
    font-weight: 900;
    margin-left: 12px;
    flex-shrink: 0;
}

.option-text {
    flex-grow: 1;
    font-weight: 900;
}

/* --- الأزرار --- */
.buttons-area {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    padding-top: 10px;
    order: 2;
}

.prev-btn, .confirm-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
}

.prev-btn {
    background: #e2e8f0;
    color: #111952;
}

.prev-btn:hover {
    background: #cbd5e0;
}

.prev-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.confirm-btn {
    background: linear-gradient(135deg, #00D4FF, #0099cc);
    color: white;
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* --- التجاوب --- */
@media screen and (max-width: 1024px) {
    .fixed-logo {
        top: 30px;
        right: 30px;
    }
    .logo-top-right {
        width: 120px;
    }
    
    .logo-img-big {
        width: 60%;
        max-width: 400px;
    }
    .welcome-title {
        font-size: 2.5rem;
    }
    .person-img {
        width: 160px;
        height: 160px;
    }
    .credit-text {
        font-size: 1.3rem;
    }
    .start-btn {
        padding: 14px 40px;
        font-size: 1.1rem;
    }
    .questions-container {
        padding: 25px 30px;
        max-width: 750px;
        max-height: 85vh;
    }
    .image-area {
        max-height: 180px;
        width: 180px;
    }
    #question-text {
        font-size: 1.4rem;
    }
    .options-area {
        min-height: 70px;
    }
}

@media screen and (max-width: 768px) {
    .fixed-logo {
        top: 25px;
        right: 25px;
    }
    .logo-top-right {
        width: 100px;
    }
    
    .logo-img-big {
        width: 75%;
        max-width: 300px;
    }
    .welcome-title {
        font-size: 2rem;
    }
    .person-img {
        width: 140px;
        height: 140px;
    }
    .credit-text {
        font-size: 1.1rem;
    }
    .start-btn {
        padding: 12px 35px;
        font-size: 1rem;
    }
    .questions-container {
        padding: 20px 25px;
        max-width: 600px;
        max-height: 85vh;
    }
    .image-area {
        max-height: 150px;
        width: 150px;
    }
    #question-text {
        font-size: 1.2rem;
    }
    .option {
        padding: 10px 15px;
    }
    .prev-btn, .confirm-btn {
        padding: 12px;
        font-size: 1rem;
    }
    .options-area {
        min-height: 60px;
    }
}

@media screen and (max-width: 480px) {
    .fixed-logo {
        top: 20px;
        right: 20px;
    }
    .logo-top-right {
        width: 80px;
    }
    
    .logo-img-big {
        width: 85%;
        max-width: 250px;
    }
    .welcome-title {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }
    .person-img {
        width: 120px;
        height: 120px;
    }
    .credit-text {
        font-size: 0.9rem;
    }
    .start-btn {
        padding: 10px 30px;
        font-size: 0.9rem;
    }
    .questions-container {
        padding: 15px 18px;
        max-width: 100%;
        border-radius: 18px;
        max-height: 90vh;
    }
    .image-area {
        max-height: 120px;
        width: 120px;
    }
    #question-text {
        font-size: 1.1rem;
    }
    .option {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    .prev-btn, .confirm-btn {
        padding: 10px;
        font-size: 0.9rem;
    }
    .options-area {
        min-height: 50px;
    }
}