/*
 * استيراد خط Tajawal من Google Fonts
 */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;600;700;800&display=swap');

/* ===== زر ابدأ المنافسة المميز ===== */
.btn-competition-start {
    position: relative;
    background: linear-gradient(45deg, #8B5CF6, #EC4899, #EF4444);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.25);
    border: none;
    cursor: pointer;
    overflow: hidden;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    display: block;
}

/* تنسيق خاص للهاتف */
@media (max-width: 768px) {
    .btn-competition-start {
        max-width: 90%;
        margin: 0 auto;
        display: block;
    }
}

@media (max-width: 640px) {
    .btn-competition-start {
        max-width: 95%;
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        margin: 0 auto;
        display: block;
    }
}

.btn-competition-start::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-competition-start:hover::before {
    left: 100%;
}

.btn-competition-start:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 12px 35px rgba(139, 92, 246, 0.35);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn-competition-start .fa-rocket {
    animation: rocketBounce 2s infinite;
}

.btn-competition-start .fa-trophy {
    animation: trophyPulse 1.5s infinite;
}

@keyframes rocketBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
    60% { transform: translateY(-3px); }
}

@keyframes trophyPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===== تنسيقات الشارات القابلة للضغط ===== */
.badge-item {
    cursor: pointer !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 12px;
    padding: 8px;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.badge-item * {
    cursor: pointer !important;
    pointer-events: none;
}

/* تنسيق خاص للأجهزة الكبيرة */
@media (min-width: 768px) {
    .badge-item {
        cursor: pointer !important;
        transition: none;
        position: relative;
        z-index: 1;
    }
    
    .badge-item:hover {
        transform: none;
        box-shadow: none;
        background: rgba(139, 92, 246, 0.05);
    }
    
    .badge-item:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
        background: rgba(139, 92, 246, 0.1);
    }
    
    .badge-item * {
        cursor: pointer !important;
        pointer-events: none;
        user-select: none;
    }
}

/* تنسيق للهاتف */
@media (max-width: 767px) {
    .badge-item:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    }
    
    .badge-item:active {
        transform: translateY(-1px);
        transition: transform 0.1s ease;
    }
}

/* تم إزالة CSS زر تحميل المزيد - عرض جميع البطاقات مباشرة */

@keyframes arrowBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-2px); }
}

/* ضمان عدم تداخل زر تحميل المزيد مع شريط التقدم */
#library {
    padding-bottom: 2rem !important; /* مساحة إضافية من الأسفل */
}

/* تحسين شريط التقدم الثابت */
#progress-tracker {
    z-index: 50 !important; /* أعلى من زر تحميل المزيد */
}

/* ===== السهم الذكي ===== */
#smartScrollBtn {
    position: fixed;
    right: 1.5rem;
    bottom: 6rem;
    z-index: 60;
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(45deg, #3B82F6, #6366F1, #8B5CF6);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    border: none;
    border-radius: 50%;
    color: white;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* لون السهم للأسفل (أزرق) */
#smartScrollBtn.scroll-down {
    background: linear-gradient(45deg, #3B82F6, #6366F1, #8B5CF6);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* لون السهم للأعلى (أخضر) */
#smartScrollBtn.scroll-up {
    background: linear-gradient(45deg, #10B981, #059669, #047857);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* تحسينات إضافية للحركة السلسة */
html {
    scroll-behavior: smooth;
}

/* تحسين الأداء للتمرير */
* {
    scroll-behavior: smooth;
}

#smartScrollBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

#smartScrollBtn:hover::before {
    left: 100%;
}

#smartScrollBtn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 35px rgba(139, 92, 246, 0.6);
}

#smartScrollBtn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* تحسين الاستجابة للضغط المتكرر */
#smartScrollBtn {
    transition: transform 0.1s ease, background 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#scrollIcon {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
    z-index: 1;
}

#smartScrollBtn:hover #scrollIcon {
    transform: scale(1.1);
}

/* تأثيرات إضافية للسهم */
#smartScrollBtn.show {
    animation: bounceIn 0.5s ease-out;
}

#smartScrollBtn.hide {
    animation: bounceOut 0.3s ease-in;
}

@keyframes bounceIn {
    0% { transform: scale(0) rotate(180deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(90deg); opacity: 0.8; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes bounceOut {
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    100% { transform: scale(0) rotate(180deg); opacity: 0; }
}

/* ===== نظام المسافات الموحدة ===== */
.section-spacing {
    margin-top: 3rem !important; /* mt-12 */
}

.section-spacing-large {
    margin-top: 4rem !important; /* mt-16 */
}

.section-spacing-small {
    margin-top: 2rem !important; /* mt-8 */
}

/* تطبيق المسافات الموحدة على جميع الأقسام */
section[id]:not([id="welcomeScreen"]):not([id="gameScreen"]):not([id="statusModal"]):not([id="subscriptionModal"]):not([id="reviewModal"]):not([id="freeCodeModal"]):not([id="paymentModal"]):not([id="successModal"]):not([id="editProfileModal"]):not([id="changePasswordModal"]) {
    margin-top: 3rem !important;
}

/* تطبيق المسافات الموحدة على الأقسام الفرعية */
.section-content > div:not(:first-child) {
    margin-top: 3rem !important;
}

/* تطبيق المسافات الموحدة على الإعلانات */
.home-ad-banner,
.ad-section,
[data-ad-type] {
    margin-top: 3rem !important;
}

/* ===== تنسيقات الأقسام المخصصة ===== */
.custom-section {
    margin-top: 3rem !important;
}

.custom-hero-section {
    position: relative;
    overflow: hidden;
}

.custom-hero-section .emoji-background {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    pointer-events: none;
}

.custom-hero-section .emoji-background .emoji {
    position: absolute;
    font-size: 4rem;
    animation: float 6s ease-in-out infinite;
}

.custom-hero-section .emoji-background .emoji:nth-child(1) {
    top: 1rem;
    right: 1rem;
    animation-delay: 0s;
}

.custom-hero-section .emoji-background .emoji:nth-child(2) {
    bottom: 1rem;
    left: 1rem;
    animation-delay: 2s;
}

.custom-hero-section .emoji-background .emoji:nth-child(3) {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 4s;
}

.custom-triple-section {
    margin-top: 3rem !important;
}

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

/* الخلفية المتحركة */
.floating-circles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.1));
    animation: floatUpDown 8s ease-in-out infinite;
}

.circle-1 {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.1));
}

.circle-2 {
    width: 150px;
    height: 150px;
    top: 20%;
    right: 15%;
    animation-delay: 2s;
    background: linear-gradient(45deg, rgba(255, 20, 147, 0.15), rgba(255, 105, 180, 0.1));
}

.circle-3 {
    width: 80px;
    height: 80px;
    bottom: 30%;
    left: 20%;
    animation-delay: 4s;
    background: linear-gradient(45deg, rgba(138, 43, 226, 0.2), rgba(147, 51, 234, 0.1));
}

.circle-4 {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 30%;
    animation-delay: 6s;
    background: linear-gradient(45deg, rgba(0, 191, 255, 0.15), rgba(30, 144, 255, 0.1));
}

.circle-5 {
    width: 90px;
    height: 90px;
    bottom: 10%;
    right: 10%;
    animation-delay: 8s;
    background: linear-gradient(45deg, rgba(50, 205, 50, 0.2), rgba(34, 197, 94, 0.1));
}

/* النجوم المتحركة */
.stars-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    font-size: 2rem;
    animation: twinkle 3s ease-in-out infinite;
    user-select: none;
}

.star-1 {
    top: 15%;
    left: 5%;
    animation-delay: 0s;
}

.star-2 {
    top: 25%;
    right: 10%;
    animation-delay: 0.5s;
}

.star-3 {
    top: 40%;
    left: 15%;
    animation-delay: 1s;
}

.star-4 {
    bottom: 35%;
    right: 20%;
    animation-delay: 1.5s;
}

.star-5 {
    bottom: 20%;
    left: 8%;
    animation-delay: 2s;
}

.star-6 {
    top: 70%;
    right: 5%;
    animation-delay: 2.5s;
}

/* تأثيرات الضوء */
.light-effects {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.light-beam {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: lightSweep 6s ease-in-out infinite;
}

.light-1 {
    top: 20%;
    left: -100%;
    width: 200%;
    height: 2px;
    animation-delay: 0s;
}

.light-2 {
    top: 50%;
    left: -100%;
    width: 200%;
    height: 1px;
    animation-delay: 2s;
}

.light-3 {
    top: 80%;
    left: -100%;
    width: 200%;
    height: 1.5px;
    animation-delay: 4s;
}

/* Hero Section */
.hero-section {
    padding: 2rem 0;
}

.hero-title-container {
    position: relative;
}

.hero-main-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.title-word {
    display: inline-block;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease-in-out infinite, wordBounce 2s ease-in-out infinite;
    animation-delay: calc(var(--word-index) * 0.2s);
}

.title-word:nth-child(1) { --word-index: 0; }
.title-word:nth-child(2) { --word-index: 1; }
.title-word:nth-child(3) { --word-index: 2; }

.hero-subtitle {
    font-size: 1.5rem;
    color: #64748b;
    margin-top: 1rem;
}

.subtitle-text {
    display: inline-block;
    animation: slideInUp 1s ease-out 1s both;
}

/* الأيقونات المتحركة */
.hero-icons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.icon-container {
    position: relative;
    animation: iconFloat 4s ease-in-out infinite;
}

.icon-container:nth-child(1) { animation-delay: 0s; }
.icon-container:nth-child(2) { animation-delay: 0.5s; }
.icon-container:nth-child(3) { animation-delay: 1s; }
.icon-container:nth-child(4) { animation-delay: 1.5s; }

.icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.icon-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.icon-wrapper:hover::before {
    transform: translateX(100%);
}

.icon-wrapper:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

/* الأزرار التفاعلية */
.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.hero-btn {
    position: relative;
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 200px;
    justify-content: center;
}

.primary-btn {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    background-size: 300% 300%;
    color: white;
    animation: gradientShift 3s ease-in-out infinite;
}

.secondary-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.hero-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.btn-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.hero-btn:hover .btn-glow {
    transform: translateX(100%);
}

.btn-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.hero-btn:hover .btn-icon {
    transform: scale(1.2) rotate(10deg);
}

/* الرسوم المتحركة */
@keyframes floatUpDown {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes lightSweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes wordBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes slideInUp {
    0% { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
    .hero-main-title {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .hero-icons {
        gap: 1rem;
    }
    
    .icon-wrapper {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-btn {
        min-width: 250px;
    }
}

.custom-wide-section {
    position: relative;
    overflow: hidden;
}

.custom-wide-section .emoji-background {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    pointer-events: none;
}

.custom-wide-section .emoji-background .emoji {
    position: absolute;
    font-size: 4rem;
}

.custom-wide-section .emoji-background .emoji:nth-child(1) {
    top: 1rem;
    right: 1rem;
    animation: bounce 2s ease-in-out infinite;
}

.custom-wide-section .emoji-background .emoji:nth-child(2) {
    bottom: 1rem;
    left: 1rem;
    opacity: 0.5;
}

/* ===== الرسوم المتحركة للأقسام المخصصة ===== */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* الأنماط العامة */
:root{
  --cream:#FFF7E9; /* خلفية دافئة */
  --soft:#FFF1D6;  /* بطاقات فاتحة */
}
body{font-family:'Tajawal',system-ui,Arial,sans-serif;background:var(--cream);}
.page{max-width:1100px;margin-inline:auto;padding-inline:1rem}@media(min-width:768px){.page{padding-inline:2rem}}

/* دائرة التقدم */
.radial{width:64px;height:64px;border-radius:9999px;background:conic-gradient(#f59e0b var(--p,0%), #fcd34d 0 100%);position:relative}
.radial::after{content:"";position:absolute;inset:8px;background:var(--soft);border-radius:9999px}
.radial .val{position:absolute;inset:0;display:grid;place-items:center;font-weight:700;font-size:.9rem}

/* كارد عام للأطفال */
.kid-card{background:#fff;border-radius:1.25rem;box-shadow:0 10px 24px rgba(0,0,0,.06);border:1px solid rgba(0,0,0,.04)}
.glass{background:linear-gradient(135deg, rgba(255,255,255,.75), rgba(255,255,255,.55));backdrop-filter: blur(6px);}

/* زر ممتع */
.btn{display:inline-flex;align-items:center;gap:.5rem;padding:.8rem 1.1rem;border-radius:999px;font-weight:700;transition:all 0.3s ease;}

/* تبويب الأقسام */
.nav-link[aria-current="page"]{background:#111827;color:#fff}

/* أنماط إضافية */
.page{
    animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.answer-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    position: relative;
}
.answer-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.answer-card.correct {
    border: 4px solid #34d399; /* emerald-400 */
    animation: bounce 0.5s ease;
}
.answer-card.wrong {
    border: 4px solid #f87171; /* red-400 */
    animation: shake 0.5s ease;
}

/* تحسين تصميم بطاقات الإجابات للهاتف المحمول */
.answer-card .aspect-\[16\/9\] {
    aspect-ratio: 4/3 !important; /* تغيير النسبة لتكون أكثر ملاءمة للهاتف */
    min-height: 120px;
    max-height: 150px;
}

.answer-card img {
    object-fit: cover !important;
    object-position: center;
    width: 100% !important;
    height: 100% !important;
    transition: transform 0.3s ease;
    border-radius: 0.75rem;
}

.answer-card:hover img {
    transform: scale(1.05);
}

.answer-card .font-bold {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-top: 0.5rem;
    text-align: center;
    padding: 0 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* تحسين الشبكة للهاتف المحمول */
#answerCards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
}

/* تحسين الحاوية الرئيسية */
.answer-cards-container {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* إجبار البطاقات على البقاء داخل الحاوية */
.answer-cards-container * {
    box-sizing: border-box;
    max-width: 100%;
}

/* إجبار جميع العناصر على البقاء داخل الحاوية */
.answer-cards-container,
.answer-cards-container *,
.answer-cards-container *::before,
.answer-cards-container *::after {
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}

/* إجبار البطاقات على البقاء داخل الحاوية */
.answer-card,
.answer-card *,
.answer-card *::before,
.answer-card *::after {
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}

/* إجبار الصور على البقاء داخل البطاقات */
.answer-card img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    object-position: center !important;
}

/* إجبار النصوص على البقاء داخل البطاقات */
.answer-card .font-bold {
    max-width: 100% !important;
    width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
}

/* إجبار جميع العناصر على البقاء داخل الحاوية */
.answer-cards-container {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* إجبار البطاقات على البقاء داخل الحاوية */
#answerCards {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* إجبار البطاقات على البقاء داخل الحاوية */
.answer-card {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* إجبار الصور على البقاء داخل البطاقات */
.answer-card .aspect-\[16\/9\] {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* إجبار النصوص على البقاء داخل البطاقات */
.answer-card .font-bold {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* إجبار جميع العناصر على البقاء داخل الحاوية */
.answer-cards-container * {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* إجبار جميع العناصر على البقاء داخل الحاوية */
.answer-cards-container *::before,
.answer-cards-container *::after {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* إجبار جميع العناصر على البقاء داخل الحاوية */
.answer-cards-container *::before,
.answer-cards-container *::after {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* تحسينات عامة للبطاقات */
.answer-card {
    box-sizing: border-box;
    border-radius: 1rem;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    z-index: 1;
    will-change: transform;
    backface-visibility: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

/* تحسين الصور */
.answer-card .aspect-\[16\/9\] {
    overflow: hidden;
    border-radius: 0.75rem;
    position: relative;
    background: linear-gradient(135deg, #fef3c7, #ffffff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
    margin: 0;
}

/* تحسين النص */
.answer-card .font-bold {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    text-align: center;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.4;
    font-weight: 600;
    color: #374151;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 0.5rem;
}

/* للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .answer-card {
        min-height: 120px;
        padding: 0.5rem;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .answer-card .aspect-\[16\/9\] {
        min-height: 70px;
        max-height: 90px;
        border-radius: 0.5rem;
        width: 100%;
        max-width: 100%;
    }
    
    .answer-card .font-bold {
        font-size: 0.7rem;
        margin-top: 0.25rem;
        padding: 0 0.25rem;
        min-height: 1.25rem;
        line-height: 1.1;
        width: 100%;
        max-width: 100%;
    }
    
    #answerCards {
        gap: 0.5rem;
        padding: 0.5rem;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    /* تحسين المساحة على الشاشات الصغيرة */
    .answer-cards-container {
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
}

/* للشاشات المتوسطة */
@media (min-width: 481px) and (max-width: 768px) {
    #answerCards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0.75rem;
        width: 100%;
        max-width: 100%;
    }
    
    .answer-card {
        min-height: 140px;
        width: 100%;
        max-width: 100%;
    }
    
    .answer-card .aspect-\[16\/9\] {
        min-height: 80px;
        max-height: 100px;
        width: 100%;
        max-width: 100%;
    }
    
    .answer-card .font-bold {
        font-size: 0.75rem;
        margin-top: 0.5rem;
        min-height: 1.5rem;
        width: 100%;
        max-width: 100%;
    }
}

/* للشاشات الكبيرة */
@media (min-width: 769px) {
    #answerCards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1rem;
        width: 100%;
        max-width: 100%;
    }
    
    .answer-card {
        min-height: 180px;
        width: 100%;
        max-width: 100%;
    }
    
    .answer-card .aspect-\[16\/9\] {
        aspect-ratio: 16/9 !important;
        min-height: 100px;
        max-height: 140px;
        width: 100%;
        max-width: 100%;
    }
    
    .answer-card .font-bold {
        font-size: 0.85rem;
        margin-top: 0.75rem;
        min-height: 2rem;
        width: 100%;
        max-width: 100%;
    }
}

/* تحسينات إضافية للهاتف المحمول */
@media (max-width: 768px) {
    /* تحسين المساحة في الشاشة الصغيرة */
    .answer-cards-container {
        max-width: 100%;
        margin: 0;
        padding: 0;
        width: 100%;
    }
    
    /* تحسين النص للقراءة على الهاتف */
    .answer-card .font-bold {
        font-weight: 600;
        color: #374151;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        width: 100%;
        max-width: 100%;
    }
    
    /* تحسين الظلال للهاتف */
    .answer-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .answer-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    /* تحسين المساحة الإجمالية */
    .answer-cards-container {
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    /* تحسين النص للهاتف */
    .answer-card .font-bold {
        min-height: 1.25rem;
        width: 100%;
        max-width: 100%;
    }
}

/* تحسينات للشاشات الكبيرة جداً */
@media (min-width: 1200px) {
    #answerCards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        max-width: 800px;
        margin: 0 auto;
        padding: 1.5rem;
        width: 100%;
    }
    
    .answer-card {
        min-height: 200px;
        width: 100%;
        max-width: 100%;
    }
    
    .answer-card .aspect-\[16\/9\] {
        min-height: 120px;
        max-height: 160px;
        width: 100%;
        max-width: 100%;
    }
    
    .answer-card .font-bold {
        font-size: 1rem;
        margin-top: 1rem;
        min-height: 2.5rem;
        width: 100%;
        max-width: 100%;
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* أنماط جديدة للشارات */
.badge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f7f7f7, #ffffff);
    border: 2px solid #ddd;
    border-radius: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.badge-card.earned {
    border-color: #fcd34d;
    background: linear-gradient(135deg, #fffbe6, #fffde6);
    box-shadow: 0 4px 12px rgba(252, 211, 77, 0.2);
}
.badge-card img {
    width: 60px;
    height: 60px;
    margin-bottom: 0.5rem;
}
.badge-card p {
    font-size: 0.75rem;
    font-weight: 700;
    color: #555;
    text-align: center;
}
.badge-card.earned p {
    color: #f59e0b;
}

/* أنماط جديدة لبطاقات ملخص التقدم - محسّنة */
.summary-card {
    background: white;
    border-radius: 1.5rem;
    padding: 1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border: 2px solid transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    min-height: 100px;
    display: flex;
    flex-direction: column;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--card-color), var(--card-color-light));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.summary-card:hover::before {
    transform: scaleX(1);
}

.summary-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    border-color: var(--card-color);
}

/* أنواع البطاقات */
.progress-card {
    --card-color: #f59e0b;
    --card-color-light: #fbbf24;
}

.level-card {
    --card-color: #10b981;
    --card-color-light: #34d399;
}

.points-card {
    --card-color: #8b5cf6;
    --card-color-light: #a78bfa;
}

.completed-card {
    --card-color: #f97316;
    --card-color-light: #fb923c;
    background: linear-gradient(135deg, #fff7ed, #fed7aa);
    border: 2px solid #f97316;
}

.completed-card:hover {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    border-color: #ea580c;
}

/* أيقونة البطاقة */
.card-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--card-color), var(--card-color-light));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

/* منع الحركة للأيقونات في الشريط الثابت */
.sticky-progress-bar .sticky-card-icon {
    position: absolute !important;
    top: 4px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 3 !important;
    transition: none !important;
    animation: none !important;
}

.sticky-progress-bar .sticky-card-icon i {
    position: relative !important;
    z-index: 4 !important;
    transition: none !important;
    animation: none !important;
    transform: none !important;
}

/* منع جميع الحركات في الشريط الثابت */
.sticky-progress-bar * {
    animation: none !important;
    transition: none !important;
}

.sticky-progress-bar .sticky-card {
    animation: none !important;
    transition: none !important;
}

.sticky-progress-bar .sticky-card:hover {
    animation: none !important;
    transition: none !important;
}

.summary-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* محتوى البطاقة */
.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* حلقة التقدم */
.progress-ring {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 0.5rem;
}

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

.progress-ring path:first-child {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 3;
}

.progress-ring path:last-child {
    fill: none;
    stroke: var(--card-color);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: calc(100 - var(--progress));
    transition: stroke-dashoffset 1s ease;
}

.progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.progress-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--card-color);
    line-height: 1;
}

.progress-label {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 600;
}

/* عرض المستوى */
.level-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.5rem;
}

.level-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--card-color);
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.level-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* عرض النقاط */
.points-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.5rem;
}

.points-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--card-color);
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.points-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* عرض التحديات المكتملة */
.completed-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.5rem;
}

.completed-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--card-color);
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.completed-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* تفاصيل البطاقة */
.card-details {
    text-align: center;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.card-subtitle {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.3;
}

/* تأثيرات إضافية */
.summary-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.summary-card:hover::after {
    transform: translateX(100%);
}

/* تحسينات للموبايل */
@media (max-width: 768px) {
    .summary-card {
        min-height: 90px;
        padding: 0.75rem;
    }
    
    .card-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .level-number,
    .points-number,
    .completed-number {
        font-size: 1.75rem;
    }
    
    .progress-ring {
        width: 50px;
        height: 50px;
    }
    
    .progress-value {
        font-size: 0.9rem;
    }
}

/* ===== تأثيرات إضافية للبطاقات ===== */

/* تأثير النبض للأيقونات */
@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* منع الحركة للأيقونات في الشريط الثابت */
.sticky-progress-bar .sticky-card .sticky-card-icon,
.sticky-progress-bar .sticky-card .sticky-card-icon i {
    animation: none !important;
    transition: none !important;
    transform: none !important;
}

/* الحركة للأيقونات في البطاقات العادية فقط */
.summary-bar .progress-card .card-icon {
    animation: iconPulse 2s ease-in-out infinite;
}

.summary-bar .level-card .card-icon {
    animation: iconPulse 2s ease-in-out infinite 0.5s;
}

.summary-bar .points-card .card-icon {
    animation: iconPulse 2s ease-in-out infinite 1s;
}

.summary-bar .completed-card .card-icon {
    animation: iconPulse 2s ease-in-out infinite 1.5s;
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.completed-card:hover .card-icon {
    background: linear-gradient(135deg, #ea580c, #dc2626);
    transform: scale(1.1) rotate(10deg);
}

/* تأثير التوهج للبطاقات */
.summary-card {
    position: relative;
}

.summary-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, var(--card-color), var(--card-color-light), var(--card-color));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* تأثير الظل المتحرك */
.summary-card {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.summary-card:hover {
    filter: drop-shadow(0 12px 24px rgba(0,0,0,0.2));
}

/* تأثير النص المتحرك */
.card-title,
.card-subtitle {
    transition: transform 0.3s ease, color 0.3s ease;
}

.summary-card:hover .card-title {
    transform: translateY(-2px);
    color: var(--card-color);
}

.summary-card:hover .card-subtitle {
    transform: translateY(-1px);
}

/* تأثيرات خاصة للبطاقة الأخيرة */
.completed-card:hover .card-title {
    color: #ea580c;
    font-weight: 800;
}

.completed-card:hover .completed-number {
    color: #ea580c;
    transform: scale(1.15);
}

/* تأثير الأرقام المتحركة */
.level-number,
.points-number,
.completed-number,
.progress-value {
    transition: all 0.3s ease;
}

.summary-card:hover .level-number,
.summary-card:hover .points-number,
.summary-card:hover .completed-number,
.summary-card:hover .progress-value {
    transform: scale(1.1);
    text-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ===== أنماط لوحة التحكم المحسّنة ===== */

/* المستويات والأسئلة المكتملة */
.level-group {
    margin-bottom: 2rem;
    border-radius: 1rem;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid rgba(0,0,0,0.05);
}

.level-header {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 1.1rem;
}

.level-header:hover {
    background: linear-gradient(135deg, #f97316, #ea580c);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.3);
}

.level-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.level-title {
    font-size: 1.2rem;
}

.questions-count {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.level-arrow {
    transition: transform 0.3s ease;
    font-size: 1.2rem;
}

.level-arrow.rotate-180 {
    transform: rotate(180deg);
}

.level-questions-container {
    display: none;
    padding: 1.5rem;
    background: white;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.level-questions-container.active {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    animation: slideDown 0.3s ease;
}

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

/* بطاقات الأسئلة المكتملة */
.completed-question-card {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 2px solid #bbf7d0;
    border-radius: 1rem;
    padding: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.completed-question-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.completed-question-card:hover::before {
    transform: scaleX(1);
}

.completed-question-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
}

.question-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.question-title {
    font-weight: 700;
    color: #166534;
    font-size: 1rem;
    line-height: 1.4;
}

.question-actions {
    display: flex;
    justify-content: flex-end;
}

.replay-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.replay-btn:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.3);
}

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

/* رسالة عدم وجود تحديات مكتملة */
.no-completed-message {
    text-align: center;
    padding: 3rem 2rem;
    color: #64748b;
}

.no-completed-message i {
    margin-bottom: 1rem;
    opacity: 0.6;
}

.no-completed-message p {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ===== أنماط حالة الاشتراك المحسّنة ===== */
.subscription-status {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-top: 1rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.subscription-status:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.subscription-status.active {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.subscription-status.pending {
    border-color: #60a5fa;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.subscription-status.expired {
    border-color: #f87171;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.subscription-status.none {
    border-color: #94a3b8;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.status-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-weight: 800;
    font-size: 1.1rem;
}

.subscription-details {
    margin-bottom: 1.5rem;
}

.subscription-details p {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #374151;
}

.subscription-actions {
    display: flex;
    gap: 0.75rem;
}

.subscription-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
}

/* ===== تحسينات عامة للوحة التحكم ===== */
#dashboard .kid-card {
    transition: all 0.3s ease;
}

#dashboard .kid-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

#dashboard input {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

#dashboard input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
    outline: none;
}

#dashboard label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: block;
}

/* ===== إشعارات الحفظ ===== */
.save-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

.notification-content {
    border-radius: 1rem;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    font-weight: 600;
    color: white;
    min-width: 300px;
    backdrop-filter: blur(10px);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.summary-card-sm .main-content {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.summary-card-sm .main-val {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
}
.summary-card-sm .sub-text {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    color: #4a5568;
}
.summary-card-sm .radial {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}
.summary-card-sm .val {
    font-size: 0.8rem;
}
.summary-card-sm.dark-green {
    background: linear-gradient(to bottom right, #10B981, #059669); /* emerald-500 to emerald-600 */
    color: white;
}
.summary-card-sm.dark-green .main-val,
.summary-card-sm.dark-green .sub-text {
    color: white;
}
.summary-card-sm.dark-green .fa-star {
    color: #FCD34D; /* amber-300 */
}

/* أنماط جديدة لبطاقات التحدي المكتملة */
.completed-challenge-card {
    border-color: #34d399;
}
.completed-challenge-card .fa-star {
    color: #f59e0b; /* amber-500 */
    font-size: 1.25rem; /* أكبر قليلاً */
}
.completed-challenge-card .status-text {
    font-weight: 700;
    color: #34d399; /* emerald-500 */
    font-size: 0.875rem;
}
/* أنماط جديدة لإظهار المستويات في لوحة التحكم */
.level-group {
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}
.level-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f0fdf4; /* emerald-50 */
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.level-header:hover {
    background: #dcfce7; /* emerald-100 */
}
.level-header i {
    transition: transform 0.2s ease;
}
.level-questions-container {
    display: none;
    padding: 1.5rem;
    background-color: white;
}
.level-questions-container.active {
    display: grid;
}
.level-questions-container .kid-card {
    background-color: #f9fafb; /* gray-50 */
}
.level-questions-container .kid-card p.font-bold {
    color: #34d399;
}
/* تنسيق العناوين الطويلة */
.kid-card h3, .kid-card h4, .level-group p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* أنماط القفل */
.challenge-lock {
    position: absolute;
    inset: 0;
    background-color: rgba(12, 36, 97, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}
.challenge-lock:hover {
    background-color: rgba(12, 36, 97, 0.9);
}

/* أنماط حالة الاشتراك */
.subscription-status {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
}

/* === أنماط الأسئلة المكتملة === */
.level-group {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 2px solid #e5e7eb;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.level-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.level-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.level-header:hover {
    background: linear-gradient(135deg, #d97706, #c2410c);
}

.level-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.level-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
}

.questions-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.level-arrow {
    font-size: 1.25rem;
    color: white;
    transition: transform 0.3s ease;
}

.level-arrow.rotate-180 {
    transform: rotate(180deg);
}

.level-questions-container {
    display: none;
    padding: 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}

.level-questions-container.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

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

.completed-question-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.completed-question-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #f59e0b;
}

.question-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.question-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}

.question-actions {
    display: flex;
    justify-content: flex-end;
}

.replay-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.replay-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: scale(1.05);
}

.no-completed-message {
    text-align: center;
    padding: 3rem 2rem;
    color: #6b7280;
}

.no-completed-message i {
    margin-bottom: 1rem;
    display: block;
}

.no-completed-message p {
    font-size: 1.125rem;
    font-weight: 600;
}

/* === أنماط أيقونة الرسائل === */
.notification-bell {
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.notification-bell.has-unread {
    color: #ef4444 !important; /* red-500 */
    animation: bellJump 1.5s infinite;
}

.notification-bell.has-unread:hover {
    animation: bellShake 0.5s infinite;
}

@keyframes bellJump {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-8px);
    }
    50% {
        transform: translateY(-4px);
    }
    75% {
        transform: translateY(-8px);
    }
}

@keyframes bellShake {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    50% {
        transform: rotate(0deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

/* تأثير النبض الأحمر */
.notification-bell.has-unread::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* === أنماط لوحة التحكم === */
.dashboard-tab {
    transition: all 0.3s ease;
}

.dashboard-tab.active {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.dashboard-tab:hover:not(.active) {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.dashboard-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.dashboard-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* أنماط إضافية */
.margin-1rem {
    margin: 1rem 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

/* أنماط مربع السحب - ارتفاع مرن */
#monthly-draw-section {
    min-height: auto;
    overflow: visible;
}

#monthly-draw-section .grid {
    height: auto;
}

#monthly-draw-section .kid-card.glass {
    height: auto;
    display: block;
}

/* أنماط عرض الفائزين */
.winners-section {
    text-align: center;
    margin-top: 0.5rem;
}

.winners-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #3730a3;
    margin-bottom: 0.5rem;
    text-align: center;
}

.winners-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
}

.winner-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #3730a3;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.winner-icon {
    font-size: 0.875rem;
    animation: bounce 2s infinite;
}

.winner-name {
    font-weight: 700;
}

.winners-message {
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
}

/* تحسين عرض الفائزين على الكمبيوتر */
@media (min-width: 768px) {
    .winners-section {
        margin-top: 0.75rem;
    }
    
    .winners-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .winners-list {
        gap: 0.5rem;
    }
    
    .winner-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        border-radius: 0.75rem;
    }
    
    .winner-icon {
        font-size: 1rem;
    }
    
    .winners-message {
        font-size: 0.875rem;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

.subscription-status.active {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.subscription-status.pending {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

.subscription-status.expired {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
}

.subscription-status.none {
    border-color: #6b7280;
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
}

.subscription-status .status-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.subscription-status .status-text {
    color: #1f2937;
}

.subscription-status .subscription-details {
    margin-bottom: 1.5rem;
}

.subscription-status .subscription-details p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    color: #4b5563;
    font-size: 0.875rem;
}

.subscription-status .plan-type {
    font-weight: 600;
    color: #1f2937;
    font-size: 1rem;
}

.subscription-status .days-remaining {
    font-weight: 700;
    color: #f59e0b;
    font-size: 1.125rem;
}

.subscription-status .subscription-actions {
    display: flex;
    gap: 0.75rem;
}

.subscription-status .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.subscription-status .btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* نوافذ تعديل البيانات وكلمة المرور */
#editProfileModal,
#changePasswordModal {
    animation: fadeIn 0.3s ease-out;
}

#editProfileModal .kid-card,
#changePasswordModal .kid-card {
    animation: slideUp 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

#editProfileModal input,
#changePasswordModal input {
    transition: all 0.3s ease;
}

#editProfileModal input:focus,
#changePasswordModal input:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.2);
}

/* تحسينات إضافية للوحة التحكم */
.dashboard-stats-card {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.dashboard-stats-card:hover {
    transform: translateY(-4px);
    border-color: #fbbf24;
    box-shadow: 0 12px 32px rgba(251, 191, 36, 0.2);
}

.dashboard-action-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.dashboard-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.dashboard-action-btn.secondary {
    background: linear-gradient(135deg, #10b981, #059669);
}

.dashboard-action-btn.secondary:hover {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

/* أنماط الإنجازات */
.achievement-completed {
    animation: achievementGlow 2s ease-in-out infinite;
}

@keyframes achievementGlow {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
    }
    50% {
        box-shadow: 0 8px 32px rgba(245, 158, 11, 0.6);
    }
}

/* تحسينات إضافية للوحة التحكم */
.dashboard-stats-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.dashboard-stats-card:hover .card-title {
    color: var(--card-color);
}

/* تأثيرات خاصة للإنجازات */
.kid-card[id*="firstQuestion"]:hover,
.kid-card[id*="firstLevel"]:hover,
.kid-card[id*="masterBadge"]:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* === تحسينات لوحة المستخدم === */

/* تصميم البطاقات المحسن */
.dashboard-stats-card {
    @apply p-6 bg-white rounded-2xl shadow-lg border border-gray-100;
    transition: all 0.3s ease;
}

.dashboard-stats-card:hover {
    @apply shadow-xl transform -translate-y-1;
}

/* تصميم الأيقونات الدائرية */
.dashboard-stats-card .w-16.h-16 {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.dashboard-stats-card:hover .w-16.h-16 {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

/* تصميم البطاقات الداخلية */
.dashboard-stats-card .bg-gradient-to-br {
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.dashboard-stats-card .bg-gradient-to-br:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* تصميم شريط التقدم */
#nextLevelProgress {
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* تحسين عرض الشارات */
#userBadges .text-center {
    transition: all 0.3s ease;
}

#userBadges .text-center:hover {
    transform: scale(1.05);
}

/* تأثيرات إضافية */
#userBadges .text-center::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
    border-radius: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#userBadges .text-center:hover::before {
    opacity: 1;
}

/* تأثيرات إضافية */
#userBadges .text-center::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
    border-radius: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#userBadges .text-center:hover::before {
    opacity: 1;
}

/* تصميم متجاوب */
@media (max-width: 768px) {
    .dashboard-stats-card {
        @apply p-4;
    }
    
    .dashboard-stats-card .w-16.h-16 {
        @apply w-12 h-12;
    }
    
    .dashboard-stats-card .text-xl {
        @apply text-lg;
    }
    
    .dashboard-stats-card .text-3xl {
        @apply text-2xl;
    }
    
    .dashboard-stats-card .text-2xl {
        @apply text-xl;
    }
}

/* === تحسينات شاشة تسجيل الدخول === */

/* تحسين رابط "إنشاء حساب جديد" */
.create-account-link {
    position: relative;
    text-decoration: none;
    transition: all 0.3s ease;
}

.create-account-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #f59e0b, #f97316);
    transition: width 0.3s ease;
}

.create-account-link:hover::after {
    width: 100%;
}

/* تحسين زر "هل نسيت كلمة المرور؟" */
.forgot-password-link {
    position: relative;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    transition: all 0.3s ease;
}

.forgot-password-link:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

/* تحسين عنوان "إنشاء حساب جديد" */
.text-gradient {
    background: linear-gradient(135deg, #f59e0b, #f97316, #ea580c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.text-gradient::before {
    content: '✨';
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.8;
}

/* تحسين زر التسجيل */
.btn.bg-gradient-to-r {
    position: relative;
    overflow: hidden;
}

.btn.bg-gradient-to-r::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;
}

.btn.bg-gradient-to-r:hover::before {
    left: 100%;
}

/* تأثيرات إضافية للشاشات */
@media (max-width: 768px) {
    .forgot-password-link {
        padding: 6px 12px;
        font-size: 0.875rem;
    }
    
    .text-gradient::before {
        left: -25px;
        font-size: 1rem;
    }
}

/* === تحسينات عرض الشارات === */

/* === تصميم جديد للشارات === */

/* تصميم شبكة الشارات - إزالة القيود التي تخفي الشارات */
#userBadges {
    display: grid;
    gap: 0.75rem;
    align-items: start;
    width: 100%;
    max-width: 100%;
    /* إزالة overflow: hidden و max-height لتجنب إخفاء الشارات */
}

/* تصميم أزرار التنقل الدائرية */
#badgePrevBtn,
#badgeNextBtn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#badgePrevBtn:disabled,
#badgeNextBtn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: scale(0.9);
}

#badgePrevBtn:not(:disabled):hover,
#badgeNextBtn:not(:disabled):hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

#badgePrevBtn:not(:disabled):active,
#badgeNextBtn:not(:disabled):active {
    transform: scale(0.95);
}

/* تأثير داخلي للأزرار */
#badgePrevBtn::before,
#badgeNextBtn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

#badgePrevBtn:hover::before,
#badgeNextBtn:hover::before {
    width: 100%;
    height: 100%;
}

/* تحسين على الشاشات الصغيرة */
@media (max-width: 768px) {
    #badgePrevBtn,
    #badgeNextBtn {
        width: 40px;
        height: 40px;
    }
}

/* تصميم أيقونات التنقل التفاعلية */
.nav-icon-container {
    position: relative;
    cursor: pointer;
    display: block !important; /* إجبار العرض */
    visibility: visible !important; /* إجبار الرؤية */
}

.nav-icon {
    display: flex !important; /* إجبار العرض */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(139, 92, 246, 0.15);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    pointer-events: auto !important; /* إجبار التفاعل */
    z-index: 10; /* ضمان الظهور فوق العناصر الأخرى */
}

.nav-icon:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.nav-icon.active {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.8);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.4);
}

.nav-icon i {
    color: #8b5cf6;
    margin-bottom: 2px;
    transition: all 0.3s ease;
}

.nav-icon:hover i {
    transform: scale(1.1);
}

.nav-label {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.nav-icon:hover .nav-label {
    opacity: 1;
    visibility: visible;
    bottom: -25px;
}

/* تأثير داخلي للأيقونات */
.nav-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.nav-icon:hover::before {
    width: 100%;
    height: 100%;
}

/* تحسين على الشاشات الصغيرة */
@media (max-width: 768px) {
    .nav-icon {
        width: 50px; /* تصغير بنسبة 10% من 56px */
        height: 50px; /* تصغير بنسبة 10% من 56px */
        display: flex !important; /* إجبار العرض على الموبايل */
        min-width: 50px; /* تصغير بنسبة 10% من 56px */
        min-height: 50px; /* تصغير بنسبة 10% من 56px */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .nav-icon i {
        font-size: 18px; /* تصغير بنسبة 10% من 20px */
    }
    
    .nav-label {
        font-size: 10px; /* تصغير بنسبة 10% من 11px */
        padding: 4px 8px;
        bottom: -35px;
    }
    
    /* إجبار عرض الشريط العلوي */
    #user-actions {
        display: flex !important;
        visibility: visible !important;
        gap: 0.75rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem;
    }
    
    /* تحسين الهيدر للهاتف */
    header {
        padding: 0.5rem 0;
    }
    
    header nav {
        gap: 0.75rem;
    }
    
    /* تحسين المساحة بين الشعار والأزرار */
    header .flex.items-center.gap-3 {
        gap: 1rem;
    }
}

/* تحسين على الشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .nav-icon {
        width: 45px; /* تصغير بنسبة 10% من 50px */
        height: 45px; /* تصغير بنسبة 10% من 50px */
        display: flex !important; /* إجبار العرض */
        min-width: 45px; /* تصغير بنسبة 10% من 50px */
        min-height: 45px; /* تصغير بنسبة 10% من 50px */
    }
    
    .nav-icon i {
        font-size: 16px; /* تصغير بنسبة 10% من 18px */
    }
    
    .nav-label {
        font-size: 9px; /* تصغير بنسبة 10% من 10px */
        padding: 3px 6px;
        bottom: -30px;
    }
    
    /* تحسين المساحة في الهيدر */
    #user-actions {
        gap: 0.5rem;
        padding: 0.25rem;
    }
    
    header nav {
        gap: 0.5rem;
    }
}

/* إصلاحات إضافية للشريط العلوي */
header {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    display: block !important;
    visibility: visible !important;
}

#user-actions {
    display: flex !important;
    visibility: visible !important;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* إجبار إظهار الأزرار الأساسية فقط */
#user-actions .nav-icon-container[data-section="welcomeScreen"],
#user-actions .nav-icon-container[data-section="library"],
#user-actions .nav-icon-container[data-section="subscriptionPlans"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* إخفاء أيقونات المستخدمين المسجلين للمستخدمين غير المسجلين */
body:not(.user-logged-in) .nav-icon-container[data-section="dashboard"],
body:not(.user-logged-in) .nav-icon-container[data-action="logout"],
body:not(.user-logged-in) .nav-icon-container[data-action="messages"] {
    display: none !important;
}

/* إخفاء أيقونات المستخدمين غير المسجلين للمستخدمين المسجلين */
body.user-logged-in .nav-icon-container[data-action="login"],
body.user-logged-in .nav-icon-container[data-action="register"] {
    display: none !important;
}

/* إظهار أيقونة الرسائل للمستخدمين المسجلين */
body.user-logged-in .nav-icon-container[data-action="messages"] {
    display: block !important;
    visibility: visible !important;
}

/* تصميم خاص لأيقونات الإجراءات */
.nav-icon-container[data-action="login"] .nav-icon {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
}

/* تصميم خاص لأيقونة الكأس المميزة */
.trophy-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.trophy-icon i {
    color: #8b5cf6;
    z-index: 2;
    transition: all 0.3s ease;
    animation: trophyGlow 2s ease-in-out infinite;
}

/* تأثيرات إضافية للكأس */
.nav-icon:hover .trophy-icon {
    transform: scale(1.05);
}

/* تأثيرات إضافية للكأس */
.nav-icon:hover .trophy-icon {
    transform: scale(1.05);
}

/* تأثير توهج ذهبي للكأس */
.trophy-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, rgba(255, 165, 0, 0.2) 30%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: all 0.4s ease;
    filter: blur(2px);
}

.nav-icon:hover .trophy-icon::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

/* تأثير وميض للكأس كل ثانيتين */
@keyframes trophyGlow {
    0%, 100% {
        color: #8b5cf6;
        text-shadow: none;
        transform: scale(1);
    }
    50% {
        color: #ffd700;
        text-shadow: 
            0 0 10px rgba(255, 215, 0, 0.8),
            0 0 20px rgba(255, 215, 0, 0.6);
        transform: scale(1.05);
    }
}





/* تأثير خطوط متوهجة حول الكأس */
.trophy-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    background: conic-gradient(from 0deg, transparent, rgba(255, 215, 0, 0.4), transparent, rgba(255, 165, 0, 0.4), transparent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: all 0.5s ease;
    animation: rotateGradient 4s linear infinite;
}

.nav-icon:hover .trophy-icon::after {
    opacity: 1;
}

@keyframes rotateGradient {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* تأثير توهج داخلي للكأس */
.nav-icon:hover .trophy-icon i {
    color: #ffd700;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.6),
        0 0 30px rgba(255, 215, 0, 0.4);
    transform: scale(1.1);
}

/* تأثير حدود متوهجة */
.nav-icon:hover {
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.4),
        0 0 40px rgba(255, 215, 0, 0.2),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
}

/* تصميم شريط التصفية والبحث المحسن */
#filterToggle, #searchToggle {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#filterToggle:hover, #searchToggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#filterToggle.active, #searchToggle.active {
    background: #8b5cf6;
    color: white;
}

#searchBar, #filterBar {
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

/* تصميم حقول البحث والتصفية */
#searchInput, #ageFilter, #catFilter {
    transition: all 0.3s ease;
}

#searchInput:focus, #ageFilter:focus, #catFilter:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* تصميم أزرار المسح */
#clearSearch, #clearFilters {
    transition: all 0.3s ease;
}

#clearSearch:hover, #clearFilters:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}



.nav-icon-container[data-action="login"] .nav-icon:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.nav-icon-container[data-action="login"] .nav-icon i {
    color: #f59e0b;
}

.nav-icon-container[data-action="register"] .nav-icon {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}

.nav-icon-container[data-action="register"] .nav-icon:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.6);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.nav-icon-container[data-action="register"] .nav-icon i {
    color: #22c55e;
}

.nav-icon-container[data-action="logout"] .nav-icon {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.nav-icon-container[data-action="logout"] .nav-icon:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.nav-icon-container[data-action="logout"] .nav-icon i {
    color: #ef4444;
}

/* تصميم خاص لأيقونة الرسائل */
.nav-icon-container[data-action="messages"] .nav-icon {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

.nav-icon-container[data-action="messages"] .nav-icon:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-icon-container[data-action="messages"] .nav-icon i {
    color: #3b82f6;
}

/* تحسينات صورة غلاف التحدي */
.challenge-cover {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.challenge-cover:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.challenge-cover-image {
    transition: transform 0.3s ease;
}

.challenge-cover:hover .challenge-cover-image {
    transform: scale(1.05);
}

.challenge-cover .fa-play {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.challenge-cover:hover .fa-play {
    transform: scale(1.1);
}

/* ===== تحسينات نافذة السؤال الحديثة ===== */

/* نافذة السؤال المحسنة */
.modern-game-modal {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #e2e8f0 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

/* الأشكال المتحركة في الخلفية */
.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.shape-3 {
    width: 60px;
    height: 60px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    top: 30%;
    right: 30%;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* زر الاستماع المحسن */
.modern-play-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto;
    min-width: 200px;
    justify-content: center;
}

.modern-play-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.modern-play-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.modern-play-btn .play-icon-container {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-play-btn .rotating-circle {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: rotate 3s linear infinite;
}

.modern-play-btn .pulse-ring {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.modern-play-btn .play-icon {
    font-size: 16px;
    z-index: 3;
    position: relative;
    transition: all 0.3s ease;
}

.modern-play-btn .play-text {
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* حالة التشغيل */
.modern-play-btn.playing {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: playPulse 1s ease-in-out infinite;
}

.modern-play-btn.playing .rotating-circle {
    border-color: rgba(255, 255, 255, 0.6);
    animation-duration: 1s;
}

.modern-play-btn.playing .pulse-ring {
    animation-duration: 0.5s;
}

.modern-play-btn.playing .play-icon {
    transform: scale(1.2);
}

@keyframes playPulse {
    0%, 100% { box-shadow: 0 8px 25px rgba(240, 147, 251, 0.3); }
    50% { box-shadow: 0 15px 35px rgba(245, 87, 108, 0.5); }
}

/* شبكة الإجابات المحسنة */
.modern-answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* بطاقات الإجابات المحسنة */
.modern-answers-grid .answer-item-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 120px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    border: 2px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.modern-answers-grid .answer-item-container:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.modern-answers-grid .answer-item-container:nth-child(1) {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.modern-answers-grid .answer-item-container:nth-child(2) {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.modern-answers-grid .answer-item-container:nth-child(3) {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.modern-answers-grid .answer-item-container:nth-child(4) {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
}

/* حاوية الصورة المحسنة */
.modern-answers-grid .answer-image-container {
    width: 100%;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-answers-grid .answer-image-container:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modern-answers-grid .answer-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    cursor: pointer;
}

.modern-answers-grid .answer-item-container:hover .answer-image {
    transform: scale(1.1);
}

.modern-answers-grid .answer-image-container:hover .answer-image {
    transform: scale(1.15);
}

/* زر النص المحسن */
.modern-answers-grid .answer-text-button {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 12px;
    padding: 8px 12px;
    min-height: 40px;
    width: 100%;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modern-answers-grid .answer-text-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.modern-answers-grid .answer-text {
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    word-break: break-word;
    overflow-wrap: break-word;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-answers-grid .answer-text-button:hover .answer-text {
    color: #1f2937;
    font-weight: 700;
}

/* تأثيرات البطاقات المجابة */
.modern-answers-grid .answer-item-container.answered.wrong {
    opacity: 0.8;
    filter: grayscale(0.2);
}

.modern-answers-grid .answer-item-container.answered.correct {
    opacity: 1;
}

/* تأثيرات الإجابة الصحيحة والخاطئة المحسنة */
.modern-answers-grid .answer-item-container.correct {
    border: 4px solid #10b981;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    animation: correctAnswer 1.2s ease;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    position: relative;
    overflow: visible;
}

/* تم إزالة الشكل البيضاوي للإجابة الصحيحة */

.modern-answers-grid .answer-item-container.wrong {
    border: 4px solid #ef4444;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    animation: wrongAnswer 1s ease;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
    position: relative;
    overflow: visible;
}

/* تم إزالة الشكل البيضاوي للإجابة الخاطئة */

/* رسوم متحركة للإجابة الصحيحة */
@keyframes correctAnswer {
    0% { 
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }
    25% { 
        transform: scale(1.08);
        box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 12px 30px rgba(16, 185, 129, 0.4);
    }
    75% { 
        transform: scale(1.02);
        box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
    }
}

/* رسوم متحركة للإجابة الخاطئة */
@keyframes wrongAnswer {
    0%, 100% { 
        transform: translateX(0) scale(1);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }
    10% { 
        transform: translateX(-8px) scale(1.02);
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
    }
    20% { 
        transform: translateX(8px) scale(1.02);
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
    }
    30% { 
        transform: translateX(-6px) scale(1.01);
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
    }
    40% { 
        transform: translateX(6px) scale(1.01);
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
    }
    50% { 
        transform: translateX(-4px) scale(1);
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
    }
    60% { 
        transform: translateX(4px) scale(1);
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
    }
    70% { 
        transform: translateX(-2px) scale(1);
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
    }
    80% { 
        transform: translateX(2px) scale(1);
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
    }
    90% { 
        transform: translateX(-1px) scale(1);
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
    }
}

/* تم إزالة رسوم متحركة الشكل البيضاوي */

/* تأثير الموجة */
@keyframes rippleEffect {
    0% { 
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% { 
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* تأثيرات إضافية للصور عند الإجابة الصحيحة */
.modern-answers-grid .answer-item-container.correct .answer-image {
    animation: imageGlow 1s ease 0.5s;
}

@keyframes imageGlow {
    0%, 100% { 
        filter: brightness(1) saturate(1);
    }
    50% { 
        filter: brightness(1.2) saturate(1.3);
    }
}

/* تأثيرات إضافية للصور عند الإجابة الخاطئة */
.modern-answers-grid .answer-item-container.wrong .answer-image {
    animation: imageShake 0.8s ease;
}

@keyframes imageShake {
    0%, 100% { 
        transform: translateX(0);
        filter: brightness(1);
    }
    25% { 
        transform: translateX(-2px);
        filter: brightness(0.8);
    }
    75% { 
        transform: translateX(2px);
        filter: brightness(0.8);
    }
}

/* تأثيرات النص عند الإجابة الصحيحة */
.modern-answers-grid .answer-item-container.correct .answer-text {
    animation: textBounce 0.8s ease 0.4s;
    color: #065f46;
    font-weight: 700;
}

@keyframes textBounce {
    0%, 100% { 
        transform: translateY(0);
    }
    50% { 
        transform: translateY(-3px);
    }
}

/* تأثيرات النص عند الإجابة الخاطئة */
.modern-answers-grid .answer-item-container.wrong .answer-text {
    animation: textShake 0.8s ease;
    color: #991b1b;
    font-weight: 700;
}

@keyframes textShake {
    0%, 100% { 
        transform: translateX(0);
    }
    25% { 
        transform: translateX(-1px);
    }
    75% { 
        transform: translateX(1px);
    }
}

/* ===== رسائل الإجابة الفورية الجديدة ===== */
.answer-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    pointer-events: none;
    animation: feedbackAppear 0.3s ease-out, feedbackDisappear 0.3s ease-in 0.7s both;
}

.feedback-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 25px 35px;
    border-radius: 25px;
    font-weight: 800;
    font-size: 22px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 4px solid rgba(255, 255, 255, 0.4);
    min-width: 140px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.feedback-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 25px;
    z-index: -1;
}

.correct-feedback .feedback-content {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.wrong-feedback .feedback-content {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.feedback-icon-container {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.feedback-icon {
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* تم إزالة الرسوم المتحركة من النصوص */

.feedback-text {
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    font-size: 20px;
    letter-spacing: 1px;
    font-weight: 900;
}

@keyframes feedbackAppear {
    0% { 
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes feedbackDisappear {
    0% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% { 
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

/* تم إزالة الرسوم المتحركة غير المستخدمة */

/* زر الإغلاق في دائرة */
#closeModal {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1001;
}

#closeModal:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

#closeModal:hover i {
    color: #ef4444;
    transform: rotate(90deg);
}

#closeModal i {
    font-size: 18px;
    color: #6b7280;
    transition: all 0.3s ease;
}

/* إضافة مساحة للعنوان لتجنب التداخل مع زر الإغلاق */
#gameTitle {
    padding-right: 70px !important; /* مساحة كافية لزر الإغلاق */
    margin-right: 0 !important;
    word-wrap: break-word;
    line-height: 1.2;
    max-width: calc(100% - 80px); /* ضمان عدم تجاوز المساحة المتاحة */
}

/* تحسينات إضافية للشاشات الكبيرة */
@media (min-width: 769px) {
    #gameTitle {
        padding-right: 80px !important;
        font-size: 1.5rem !important;
    }
}

/* تحسينات التجاوب لرسائل الإجابة */
@media (max-width: 480px) {
    .feedback-content {
        padding: 20px 25px;
        font-size: 18px;
        gap: 10px;
    }
    
    .feedback-icon {
        font-size: 22px;
    }
    
    .feedback-icon-container {
        width: 45px;
        height: 45px;
    }
    
    #closeModal {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
    
    #closeModal i {
        font-size: 16px;
    }
    
    /* مساحة إضافية للعنوان في الهواتف الصغيرة */
    #gameTitle {
        padding-right: 60px !important;
        font-size: 1.1rem !important;
        line-height: 1.3 !important;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .feedback-content {
        padding: 22px 30px;
        font-size: 20px;
        gap: 11px;
    }
    
    .feedback-icon {
        font-size: 23px;
    }
    
    .feedback-icon-container {
        width: 47px;
        height: 47px;
    }
    
    #closeModal {
        width: 42px;
        height: 42px;
    }
    
    #closeModal i {
        font-size: 17px;
    }
    
    /* مساحة للعنوان في الشاشات المتوسطة */
    #gameTitle {
        padding-right: 65px !important;
        font-size: 1.3rem !important;
    }
}

/* ===== تحسينات التجاوب مع الشاشات ===== */

/* الهواتف الصغيرة (أقل من 480px) */
@media (max-width: 480px) {
    .modern-game-modal {
        padding: 16px !important;
        margin: 8px !important;
        max-height: 95vh !important;
    }
    
    .modern-play-btn {
        padding: 10px 20px;
        min-width: 160px;
        font-size: 14px;
    }
    
    .modern-play-btn .play-icon-container {
        width: 32px;
        height: 32px;
    }
    
    .modern-play-btn .rotating-circle,
    .modern-play-btn .pulse-ring {
        width: 32px;
        height: 32px;
    }
    
    .modern-play-btn .play-icon {
        font-size: 14px;
    }
    
    .modern-answers-grid {
        gap: 8px;
    }
    
    .modern-answers-grid .answer-item-container {
        min-height: 100px;
        padding: 8px;
    }
    
    .modern-answers-grid .answer-image-container {
        height: 60px;
        margin-bottom: 6px;
    }
    
    .modern-answers-grid .answer-text-button {
        padding: 6px 8px;
        min-height: 32px;
    }
    
    .modern-answers-grid .answer-text {
        font-size: 12px;
    }
    
    .floating-shapes .shape {
        display: none; /* إخفاء الأشكال المتحركة على الشاشات الصغيرة */
    }
}

/* الهواتف المتوسطة (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .modern-game-modal {
        padding: 20px !important;
        margin: 12px !important;
    }
    
    .modern-play-btn {
        padding: 12px 24px;
        min-width: 180px;
    }
    
    .modern-answers-grid {
        gap: 10px;
    }
    
    .modern-answers-grid .answer-item-container {
        min-height: 110px;
    }
    
    .modern-answers-grid .answer-image-container {
        height: 70px;
    }
    
    .modern-answers-grid .answer-text {
        font-size: 13px;
    }
    
    .shape-1, .shape-3 {
        display: none; /* إخفاء بعض الأشكال */
    }
}

/* التابلت (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .modern-game-modal {
        padding: 24px !important;
        margin: 16px !important;
    }
    
    .modern-play-btn {
        padding: 14px 28px;
        min-width: 220px;
        margin-bottom: 2.5rem !important; /* هامش مناسب للتابلت */
    }
    
    .modern-answers-grid {
        gap: 14px;
        margin-top: 1.5rem !important; /* هامش مناسب للتابلت */
    }
    
    .modern-answers-grid .answer-item-container {
        min-height: 130px;
    }
    
    .modern-answers-grid .answer-image-container {
        height: 85px;
    }
    
    .modern-answers-grid .answer-text {
        font-size: 15px;
    }
}

/* الديسكتوب (1025px وأكثر) */
@media (min-width: 1025px) {
    .modern-game-modal {
        padding: 32px !important;
        margin: 20px !important;
    }
    
    .modern-play-btn {
        padding: 16px 32px;
        min-width: 240px;
        margin-bottom: 3rem !important; /* زيادة الهامش السفلي */
    }
    
    .modern-answers-grid {
        gap: 16px;
        margin-top: 2rem !important; /* إضافة هامش علوي */
    }
    
    .modern-answers-grid .answer-item-container {
        min-height: 140px;
    }
    
    .modern-answers-grid .answer-image-container {
        height: 90px;
    }
    
    .modern-answers-grid .answer-text {
        font-size: 16px;
    }
}

/* تحسينات خاصة للشاشات العريضة */
@media (min-width: 1440px) {
    .modern-game-modal {
        max-width: 800px;
    }
    
    .modern-play-btn {
        margin-bottom: 4rem !important; /* هامش أكبر للشاشات العريضة */
    }
    
    .modern-answers-grid {
        gap: 20px;
        margin-top: 3rem !important; /* هامش أكبر للشاشات العريضة */
    }
    
    .modern-answers-grid .answer-item-container {
        min-height: 160px;
    }
    
    .modern-answers-grid .answer-image-container {
        height: 100px;
    }
}

/* تحسينات للشاشات عالية الدقة */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .modern-answers-grid .answer-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
        image-rendering: pixelated;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* تحسينات للوضع الأفقي على الهواتف */
@media (max-width: 768px) and (orientation: landscape) {
    .modern-game-modal {
        max-height: 90vh !important;
        padding: 12px !important;
    }
    
    .modern-answers-grid .answer-item-container {
        min-height: 80px;
    }
    
    .modern-answers-grid .answer-image-container {
        height: 50px;
    }
    
    .modern-answers-grid .answer-text {
        font-size: 11px;
    }
    
    .floating-shapes {
        display: none; /* إخفاء الأشكال في الوضع الأفقي */
    }
}

/* تحسينات زر إعادة التحدي */
.btn.bg-slate-400 {
    background: linear-gradient(135deg, #94a3b8, #64748b) !important;
    border: 1px solid #475569;
    position: relative;
    overflow: hidden;
}

.btn.bg-slate-400:hover {
    background: linear-gradient(135deg, #64748b, #475569) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(100, 116, 139, 0.4);
}

.btn.bg-slate-400 .fa-rotate-right {
    transition: transform 0.3s ease;
}

.btn.bg-slate-400:hover .fa-rotate-right {
    transform: rotate(180deg);
}

/* تأثير لمعان عند التمرير */
.btn.bg-slate-400::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.5s ease;
}

.btn.bg-slate-400:hover::before {
    left: 100%;
}

/* إزالة القواعد المتضاربة مع Tailwind CSS */
/* Tailwind CSS يتولى إدارة grid-template-columns */

/* تصميم كل شارة */
.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid transparent;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-align: center;
}

.badge-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.95);
}

/* تصميم حاوية الأيقونة */
.badge-icon-container {
    position: relative;
    margin-bottom: 0.5rem;
}

/* تصميم أيقونة الشارة */
.badge-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid;
}

.badge-icon.earned {
    border-color: #fbbf24;
    box-shadow: 0 0 18px rgba(251, 191, 36, 0.5);
    animation: badgeGlow 2s ease-in-out infinite alternate;
}

.badge-icon.locked {
    border-color: #d1d5db;
    filter: grayscale(0.6);
    opacity: 0.6;
}

.badge-item:hover .badge-icon {
    transform: scale(1.08);
}

.badge-item:hover .badge-icon.earned {
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.7);
    animation: badgeGlow 1s ease-in-out infinite alternate;
}

.badge-item:hover .badge-icon.locked {
    filter: grayscale(0.4);
    opacity: 0.8;
}

/* تصميم صورة الشارة */
.badge-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

/* تصميم حالة الشارة (قفل/صح) */
.badge-status {
    position: absolute;
    bottom: -0.2rem;
    right: -0.2rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.badge-status .fa-check-circle {
    color: #10b981;
}

.badge-status .fa-lock {
    color: #6b7280;
}

/* تصميم معلومات الشارة */
.badge-info {
    text-align: center;
    width: 100%;
}

/* تصميم اسم الشارة */
.badge-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* تأثيرات إضافية */
.badge-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
    border-radius: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.badge-item:hover::before {
    opacity: 1;
}

/* رسالة التحميل */
#userBadges .col-span-full {
    grid-column: 1 / -1;
    padding: 1.5rem;
    text-align: center;
    width: 100%;
}

#userBadges .fa-spinner {
    color: #6b7280;
    margin-bottom: 0.5rem;
}

/* تأثير توهج الشارات المكتسبة */
@keyframes badgeGlow {
    0% {
        box-shadow: 0 0 18px rgba(251, 191, 36, 0.5);
    }
    100% {
        box-shadow: 0 0 25px rgba(251, 191, 36, 0.8);
    }
}

/* إصلاح مشكلة التجاوز - إزالة overflow: hidden للشارات */
.kid-card {
    /* إزالة overflow: hidden للسماح بعرض جميع الشارات */
    overflow: visible;
}

.kid-card #userBadges {
    margin: 0;
    padding: 0;
}

/* إصلاحات إضافية لبطاقة الشارات - إزالة overflow: hidden */
.kid-card:has(#userBadges) {
    /* إزالة overflow: hidden للسماح بعرض جميع الشارات */
    position: relative;
    overflow: visible;
}

/* ضمان احتواء الشارات في البطاقة الأرجوانية - إزالة overflow: hidden */
.bg-gradient-to-br.from-purple-50.to-indigo-50 {
    /* إزالة overflow: hidden للسماح بعرض جميع الشارات */
    position: relative;
    overflow: visible;
}

.bg-gradient-to-br.from-purple-50.to-indigo-50 #userBadges {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* تحسين المسافات في بطاقة الشارات */
.bg-gradient-to-br.from-purple-50.to-indigo-50 .flex.items-center.gap-3.mb-4 {
    margin-bottom: 1rem;
}

/* ضمان عدم تجاوز الشارات */
#userBadges .text-center {
    min-width: 0;
    min-height: 0;
}

/* === إصلاحات إضافية لعرض الشارات في الموبايل === */

/* ضمان عرض جميع الشارات في الموبايل */
@media (max-width: 767px) {
    #userBadges {
        /* إزالة أي قيود على الارتفاع */
        max-height: none !important;
        overflow: visible !important;
        /* ضمان عرض 3 أعمدة في الموبايل */
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem;
    }
    
    /* ضمان عدم إخفاء الشارات في البطاقة */
    .kid-card:has(#userBadges) {
        overflow: visible !important;
        max-height: none !important;
    }
    
    /* ضمان عدم إخفاء الشارات في البطاقة الأرجوانية */
    .bg-gradient-to-br.from-purple-50.to-indigo-50 {
        overflow: visible !important;
        max-height: none !important;
    }
    
    /* تحسين حجم الشارات في الموبايل */
    .badge-item {
        min-height: 80px;
        padding: 0.5rem 0.25rem;
    }
    
    .badge-icon {
        width: 2.25rem;
        height: 2.25rem;
    }
    
    .badge-item .text-xs {
        font-size: 0.65rem;
        line-height: 1.2;
    }
}

/* ضمان عرض جميع الشارات في الكمبيوتر أيضاً */
@media (min-width: 768px) {
    #userBadges {
        /* إزالة أي قيود على الارتفاع */
        max-height: none !important;
        overflow: visible !important;
        /* ضمان عرض 4 أعمدة في الكمبيوتر */
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.5rem;
    }
}

/* === تحسينات النوافذ المنبثقة === */

/* ضمان عرض النصوص كاملة */
#statusModal .kid-card,
#reviewModal .kid-card,
#successModal .kid-card {
    max-height: 90vh;
    overflow-y: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* تحسين عرض الرسائل */
#statusMessage,
#reviewMessage,
#success-message {
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.6;
    max-width: 100%;
}

/* تحسين عرض العناوين */
#statusMessage h3,
#reviewTitle,
#success-title {
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

/* تحسين الأزرار */
#statusCloseBtn,
#closeReviewModal,
#closeSuccessModal {
    min-width: 120px;
    white-space: nowrap;
}

/* تحسين المسافات */
#statusModal .space-y-6 > * + *,
#reviewModal .space-y-6 > * + *,
#successModal .space-y-6 > * + * {
    margin-top: 1.5rem;
}

/* تحسين عرض الكود */
#code-display {
    word-break: break-all;
    overflow-wrap: anywhere;
}

#generated-code {
    word-break: break-all;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* تحسين التمرير */
.kid-card::-webkit-scrollbar {
    width: 8px;
}

.kid-card::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.kid-card::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.kid-card::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== تنسيقات زر Google المميز ===== */
.google-oauth-button {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 25%, #fbbc05 50%, #ea4335 75%, #4285f4 100%);
    background-size: 300% 300%;
    animation: google-gradient 3s ease infinite;
    border: 2px solid #4285f4;
    box-shadow: 0 8px 25px rgba(66, 133, 244, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.google-oauth-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 35px rgba(66, 133, 244, 0.4);
    animation-duration: 1s;
}

.google-oauth-button:active {
    transform: translateY(0) scale(0.98);
}

@keyframes google-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.google-oauth-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.google-oauth-button:hover::before {
    left: 100%;
}

.google-oauth-icon {
    background: white;
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.google-oauth-button:hover .google-oauth-icon {
    transform: rotate(360deg) scale(1.1);
}

.google-oauth-text {
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

/* تأثير اللمعان عند التمرير */
.google-oauth-button:hover {
    background: linear-gradient(135deg, #4285f4 0%, #34a853 25%, #fbbc05 50%, #ea4335 75%, #4285f4 100%);
    background-size: 200% 200%;
    animation: google-shine 0.6s ease-in-out;
}

@keyframes google-shine {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* تحسين الخط الفاصل */
.google-divider {
    position: relative;
    margin: 1.5rem 0;
}

.google-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d1d5db, transparent);
}

.google-divider span {
    background: white;
    padding: 0 1rem;
    font-weight: 600;
    color: #6b7280;
    position: relative;
    z-index: 1;
}