/* الإعدادات العامة */

/* أكواد شاشة الفوز */
.win-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.7);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999;
    opacity: 0; visibility: hidden;
    transition: 0.3s ease;
    backdrop-filter: blur(4px);
}
.win-overlay.active {
    opacity: 1; visibility: visible;
}
.win-card {
    background: #ffffff;
    padding: 40px 50px;
    border-radius: 24px;
    text-align: center;
    transform: scale(0.5);
    transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2), 0 0 60px rgba(251, 191, 36, 0.3);
    border: 3px solid #f59e0b;
    max-width: 400px;
    width: 90%;
}
.win-overlay.active .win-card {
    transform: scale(1);
}
.win-trophy {
    font-size: 80px;
    margin: 0;
    animation: float-bounce 2s infinite ease-in-out;
}
@keyframes float-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}
.win-title {
    color: #1e293b;
    font-size: 28px;
    margin: 15px 0 10px;
    font-weight: 800;
}
.win-text {
    color: #64748b;
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.5;
}
.win-action-btn {
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.4);
    transition: transform 0.2s, filter 0.2s;
}
.win-action-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f8ff; /* لون أزرق فاتح مريح للعين */
    color: #333;
}

/* تنسيقات شريط التنقل (Navbar) */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    padding: 15px 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar h2 {
    margin: 0;
    color: #2c3e50;
}

.navbar ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.navbar a {
    text-decoration: none;
    color: #555;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar a:hover, .navbar a.active {
    background-color: #007bff;
    color: white;
}

/* تنسيقات المحتوى الرئيسي */
main {
    padding: 30px;
    max-width: 1000px;
    margin: 20px auto;
}

.intro-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    line-height: 1.8;
}

/* تنسيقات منطقة اللعب في المرحلة الثانية */
#game-header {
    display: flex;
    justify-content: space-between;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    color: #2c3e50;
}

#score {
    color: #28a745;
    font-size: 26px;
}

#current-question {
    color: #d35400;
    font-size: 26px;
}

#abacus-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    text-align: center;
}

#check-answer-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    transition: background 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#check-answer-btn:hover {
    background-color: #218838;
}

/* تأثير حركة النجمة */
#star-icon {
    position: fixed;
    bottom: 20%;
    left: 50%;
    font-size: 80px;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
}

.hidden {
    display: none;
}

.animate-star {
    animation: flyUp 1.5s ease-out forwards;
    display: block !important;
}

@keyframes flyUp {
    0% { transform: translate(-50%, 0) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -200px) scale(1.5); opacity: 1; }
    100% { transform: translate(-50%, -400px) scale(0.5); opacity: 0; }
}
/* =========================================
   تنسيقات شاشة الفوز (Modal)
   ========================================= */
.win-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.7);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999; opacity: 0; visibility: hidden;
    transition: 0.3s ease; backdrop-filter: blur(4px);
}
.win-overlay.active { opacity: 1; visibility: visible; }
.win-card {
    background: #ffffff; padding: 40px 50px; border-radius: 24px; text-align: center;
    transform: scale(0.5); transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2), 0 0 60px rgba(251, 191, 36, 0.3);
    border: 3px solid #f59e0b; max-width: 400px; width: 90%;
}
.win-overlay.active .win-card { transform: scale(1); }
.win-trophy { font-size: 80px; margin: 0; animation: float-bounce 2s infinite ease-in-out; }
@keyframes float-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
.win-title { color: #1e293b; font-size: 28px; margin: 15px 0 10px; font-weight: 800; }
.win-text { color: #64748b; font-size: 16px; margin-bottom: 25px; line-height: 1.5; }
.win-action-btn {
    padding: 12px 30px; font-size: 18px; font-weight: bold;
    background: linear-gradient(135deg, #16a34a, #15803d); color: white;
    border: none; border-radius: 12px; cursor: pointer;
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.4); transition: transform 0.2s, filter 0.2s;
}
.win-action-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }