/* Calm Serene Islamic & Educational Theme for Grade 4 Science - Teacher Entisar Ekab */
:root {
    /* ألوان الثيم الهادئ والمحبوب للأطفال (Aqua Teal & Cheerful Honey Gold) */
    --primary-color: #2B9386;
    --primary-dark: #1A5E56;
    --primary-light: #48BCAE;
    --secondary-color: #36A799;
    --accent-color: #F5AC33;
    --accent-warm: #D48B1B;
    --islamic-gold: #F5AC33;
    --islamic-gold-light: #FFF0D4;
    --gold-glow: rgba(245, 172, 51, 0.45);
    --emerald-mint: #E4F6F3;
    --danger-color: #C0392B;
    
    /* ألوان الخلفية والنصوص */
    --bg-color: #F8FBF9;
    --surface-color: #FFFFFF;
    --text-main: #1D3531;
    --text-muted: #4F6E68;
    --text-dim: #718D88;
    
    /* المتغيرات الهندسية والظلال */
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 8px;
    --shadow-soft: 0 8px 24px rgba(43, 147, 134, 0.08);
    --shadow-hover: 0 14px 32px rgba(43, 147, 134, 0.16);
    
    /* الحركة */
    --transition-fast: 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --transition-normal: 0.3s ease;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    font-family: 'Tajawal', 'Changa', sans-serif;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(43, 147, 134, 0.05), transparent 30%),
        radial-gradient(circle at 90% 40%, rgba(245, 172, 51, 0.06), transparent 35%),
        linear-gradient(180deg, #FFFFFF 0%, #F4F9F7 100%);
    min-height: 100vh;
    direction: rtl;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.4s ease, background-image 0.4s ease, color 0.4s ease;
}

/* Floating subtle educational and spiritual symbols */
.floating-forest-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.forest-leaf {
    position: absolute;
    font-size: 2rem;
    opacity: 0.18;
    animation: gentleFloat 12s infinite ease-in-out;
}

.leaf-1 { top: 12%; left: 6%; }
.leaf-2 { top: 35%; right: 4%; }
.leaf-3 { top: 65%; left: 8%; }
.leaf-4 { top: 82%; right: 7%; }
.leaf-5 { top: 48%; left: 50%; }

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-16px) rotate(8deg); }
}

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

/* Islamic Ayah Banner */
.islamic-ayah-banner {
    background: rgba(20, 68, 62, 0.72);
    border-bottom: 1.5px solid rgba(245, 172, 51, 0.45);
    color: #FFF0D4;
    font-size: 0.98rem;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    position: relative;
    z-index: 3;
}

.islamic-ayah-bullet, .islamic-ayah-banner .ayah-bullet {
    color: var(--islamic-gold);
    font-size: 0.8rem;
}

/* Serene Islamic Main Header */
.main-header.masha-premium-header {
    background: linear-gradient(135deg, #1A5E56 0%, #2B9386 50%, #36A799 100%);
    color: #FFFDF9;
    box-shadow: 0 10px 28px rgba(30, 105, 96, 0.22);
    border-bottom: 4px solid var(--accent-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
}

.header-nav-bar {
    max-width: 1250px;
    margin: 0 auto;
    padding: 1rem 1.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

/* Teacher Avatar Badge */
.nav-right-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(212, 175, 55, 0.45);
    padding: 6px 16px 6px 10px;
    border-radius: 50px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.nav-user-badge:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

.nav-avatar-wrap {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #FFF;
    border: 2.5px solid var(--accent-color);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
    flex-shrink: 0;
    overflow: hidden;
}

.nav-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    display: block;
}

.nav-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-user-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #FFFFFF;
    font-family: 'Marhey', 'Tajawal', sans-serif;
    line-height: 1.2;
}

.nav-sing-tag {
    font-size: 0.8rem;
    color: var(--islamic-gold-light);
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
}

/* Center Subject Title */
.nav-title-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-subject-tag {
    font-family: 'Changa', 'Tajawal', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #FFFFFF;
    background: rgba(17, 56, 43, 0.4);
    border: 1.5px solid rgba(212, 175, 55, 0.55);
    padding: 6px 22px;
    border-radius: 30px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    margin: 0;
}

/* Left Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.portal-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--islamic-gold), var(--accent-warm));
    color: #11382B !important;
    text-decoration: none !important;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.95rem;
    font-family: 'Changa', 'Tajawal', sans-serif;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.portal-home-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.5);
    background: linear-gradient(135deg, #F4E5AB, var(--islamic-gold));
}

.portal-home-btn i, .portal-home-btn .btn-icon {
    font-size: 1rem;
}

/* ==========================================================================
   Lesson View Header & Controls (شريط عنوان الدرس والتنقل للرئيسية)
   ========================================================================== */
#lesson-view .main-header,
.main-header:not(.masha-premium-header) {
    background: linear-gradient(135deg, #1A5E56 0%, #2B9386 50%, #36A799 100%) !important;
    border-radius: 24px !important;
    margin: 16px auto 26px auto !important;
    padding: 16px 24px !important;
    border: 2.5px solid var(--accent-color) !important;
    box-shadow: 0 8px 26px rgba(26, 94, 86, 0.25) !important;
    max-width: 1250px !important;
    width: 95% !important;
    display: block !important;
    position: relative !important;
    z-index: 10 !important;
}

#lesson-view .header-content,
.main-header:not(.masha-premium-header) .header-content {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 16px !important;
    flex-wrap: wrap !important;
    width: 100% !important;
}

/* زر العودة للرئيسية - واضح جداً بألوان ذهبية وأخضر إسلامي عالية التباين والجمال */
.home-btn,
#lesson-view .home-btn,
.main-header .home-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    text-decoration: none !important;
    color: #0F3D32 !important;
    font-weight: 900 !important;
    font-size: 1.05rem !important;
    font-family: 'Changa', 'Tajawal', sans-serif !important;
    background: linear-gradient(135deg, #FFF6DD 0%, #F5AC33 60%, #E59A1D 100%) !important;
    border: 2px solid #FFFFFF !important;
    padding: 10px 24px !important;
    border-radius: 40px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.4) !important;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    cursor: pointer !important;
    width: auto !important;
    max-width: fit-content !important;
    flex: 0 0 auto !important;
}

.home-btn i,
#lesson-view .home-btn i,
.main-header .home-btn i {
    color: #0F3D32 !important;
    font-size: 1.2rem !important;
    transition: transform 0.22s ease !important;
}

.home-btn:hover,
#lesson-view .home-btn:hover,
.main-header .home-btn:hover {
    transform: translateY(-2px) scale(1.05) !important;
    background: #FFFFFF !important;
    color: #1A5E56 !important;
    border-color: #F5AC33 !important;
    box-shadow: 0 8px 24px rgba(245, 172, 51, 0.5) !important;
}

.home-btn:hover i,
#lesson-view .home-btn:hover i,
.main-header .home-btn:hover i {
    transform: scale(1.2) !important;
    color: #1A5E56 !important;
}

.lesson-info,
#lesson-view .lesson-info {
    text-align: center !important;
    flex: 1 1 auto !important;
    min-width: 200px !important;
}

.lesson-info .badge,
#lesson-view .lesson-info .badge {
    background: #fff5f8 !important;
    color: #be185d !important;
    border: 1.5px solid #fbcfe8 !important;
    color: #FFFFFF !important;
    font-size: 0.88rem !important;
    font-weight: 800 !important;
    font-family: 'Changa', sans-serif !important;
    padding: 5px 18px !important;
    border-radius: 20px !important;
    display: inline-block !important;
    margin-bottom: 6px !important;
    border: 1.5px solid rgba(255, 255, 255, 0.7) !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2) !important;
    letter-spacing: 0.3px !important;
}

.lesson-info h1,
#lesson-view .lesson-info h1 {
    font-size: 1.65rem !important;
    font-weight: 900 !important;
    color: #831843 !important;
    font-family: 'Tajawal', 'Cairo', sans-serif !important;
    margin: 0 !important;
    text-shadow: none !important;
    line-height: 1.4 !important;
}

.user-progress,
#lesson-view .user-progress {
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
}

.stars-container,
#lesson-view .stars-container {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: 2px solid #FFE082 !important;
    padding: 8px 18px !important;
    border-radius: 30px !important;
    font-weight: 800 !important;
    font-size: 1.05rem !important;
    color: #FFFFFF !important;
    font-family: 'Tajawal', sans-serif !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16) !important;
    backdrop-filter: blur(8px) !important;
    width: auto !important;
    max-width: fit-content !important;
}

.stars-container i,
#lesson-view .stars-container i {
    color: #FFD700 !important;
    font-size: 1.25rem !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)) !important;
}

.stars-container #score-display,
#lesson-view .stars-container #score-display {
    color: #FFFFFF !important;
    font-weight: 900 !important;
    font-size: 1.1rem !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4) !important;
}

/* الأقسام الأساسية */
section {
    margin: 50px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2.2rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* البطاقات التعليمية */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.info-card {
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-soft);
    border: 2px solid transparent;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.card-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    opacity: 0.9;
}

.info-card h3 {
    font-size: 1.4rem;
    color: var(--primary-dark);
    margin-bottom: 15px;
}

.fact-box {
    margin-top: 20px;
    background-color: rgba(233, 196, 106, 0.2);
    padding: 15px;
    border-radius: var(--border-radius-sm);
    border-right: 4px solid var(--accent-color);
    font-size: 0.95rem;
}

.wide-card {
    grid-column: 1 / -1;
}

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

.shape-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--border-radius-md);
}

/* الرسوم التوضيحية للأشكال (CSS Only) */
.shape-visual {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    background-color: var(--secondary-color);
    box-shadow: inset -10px -10px 20px rgba(0,0,0,0.2);
}

.shape-visual.spherical {
    border-radius: 50%;
    background-image: radial-gradient(circle at 30% 30%, #52b788, #2d6a4f);
}

.shape-visual.rod {
    border-radius: 40px;
    width: 120px;
    height: 60px;
    background-image: linear-gradient(135deg, #00B4D8, #0077B6);
}

.shape-visual.spiral {
    background: transparent;
    border: 10px solid var(--accent-warm);
    border-radius: 50%;
    border-right-color: transparent;
    border-left-color: transparent;
    animation: spin 8s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.shape-item h4 {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.shape-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.split-card {
    grid-column: 1 / -1;
    display: flex;
    gap: 30px;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.split-card:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.benefit-side, .harm-side {
    flex: 1;
    background: var(--surface-color);
    padding: 30px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
}

.benefit-side h3 { color: var(--secondary-color); }
.harm-side h3 { color: var(--danger-color); }

.benefit-side ul, .harm-side ul {
    list-style: none;
    padding-right: 10px;
}

.benefit-side ul li, .harm-side ul li {
    position: relative;
    padding-right: 25px;
    margin-bottom: 15px;
}

.benefit-side ul li::before, .harm-side ul li::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 0;
    top: 2px;
}

.benefit-side ul li::before {
    content: "\f00c";
    color: var(--secondary-color);
}

.harm-side ul li::before {
    content: "\f071";
    color: var(--danger-color);
}

/* التدريبات التفاعلية */
.exercises-section {
    background-color: white;
    padding: 50px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
    position: relative;
}

.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.question-card {
    animation: fadeIn 0.5s ease;
}

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

.question-text {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
}

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

.option-btn {
    background-color: var(--bg-color);
    border: 2px solid transparent;
    padding: 20px;
    border-radius: var(--border-radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: right;
    display: flex;
    align-items: center;
    gap: 15px;
}

.option-btn:hover {
    background-color: rgba(0, 180, 216, 0.05);
    border-color: var(--primary-color);
    transform: scale(1.02);
}

.option-btn .option-letter {
    background-color: var(--surface-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.option-btn.correct {
    background-color: rgba(42, 157, 143, 0.1);
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.option-btn.wrong {
    background-color: rgba(231, 111, 81, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.quiz-feedback {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    border-radius: var(--border-radius-md);
    animation: fadeIn 0.3s ease;
}

.quiz-feedback.success { background-color: rgba(42, 157, 143, 0.1); color: var(--secondary-color); }
.quiz-feedback.error { background-color: rgba(231, 111, 81, 0.1); color: var(--danger-color); }

.quiz-feedback i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    margin-top: 20px;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.primary-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 119, 182, 0.3);
}

/* متجاوب */
@media (max-width: 768px) {
    .split-card { flex-direction: column; }
    .header-content,
    #lesson-view .header-content {
        flex-direction: column !important;
        align-items: center !important;
        gap: 14px !important;
    }
    #lesson-view .home-btn,
    .home-btn {
        width: auto !important;
        max-width: fit-content !important;
        align-self: center !important;
    }
    #lesson-view .stars-container,
    .stars-container {
        width: auto !important;
        max-width: fit-content !important;
        align-self: center !important;
    }
    .lesson-info h1,
    #lesson-view .lesson-info h1 {
        font-size: 1.35rem !important;
    }
}

/* SPA Merged CSS */
/* CSS for Lesson 2 */

        /* أنماط إضافية خاصة بالطحالب */
        .shape-visual.green-algae {
            background: radial-gradient(circle at 30% 30%, #40916c, #1b4332);
            border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
            animation: morph 5s ease-in-out infinite;
        }
        .shape-visual.brown-algae {
            background: linear-gradient(135deg, #7f5539, #9c6644);
            border-radius: 10px;
            width: 100px;
            height: 40px;
        }
        .shape-visual.red-algae {
            background: radial-gradient(circle at 30% 30%, #e63946, #a8dadc); /* نستخدم الأحمر مع تدرج */
            background: #d90429;
            clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
        }

        @keyframes morph {
            0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
            50% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
            100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
        }
        
        .algae-bg {
            background-color: #e9f5db;
        }
    
/* CSS for Lesson 3 */

        .plant-parts-container {
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
            justify-content: center;
            margin-top: 30px;
        }
        .part-card {
            background: white;
            border-radius: var(--border-radius-md);
            padding: 20px;
            width: 250px;
            text-align: center;
            border-bottom: 5px solid var(--secondary-color);
            transition: var(--transition-fast);
        }
        .part-card:hover {
            transform: scale(1.05);
            background: #f0fdf4;
        }
        .part-icon {
            font-size: 2.5rem;
            color: var(--secondary-color);
            margin-bottom: 10px;
        }
        .palm-section {
            background: #fff;
            border-radius: var(--border-radius-lg);
            padding: 40px;
            margin-top: 40px;
            border: 2px dashed var(--accent-warm);
        }
        .palm-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }
        .palm-info-item {
            background: #fff9f0;
            padding: 15px;
            border-radius: var(--border-radius-sm);
            text-align: center;
        }
    
/* CSS for Lesson 4 */

        .animal-classes {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-top: 30px;
        }
        .animal-card {
            background: white;
            padding: 20px;
            border-radius: var(--border-radius-md);
            text-align: center;
            box-shadow: var(--shadow-soft);
            border-top: 5px solid var(--primary-color);
        }
        .animal-card i {
            font-size: 2.5rem;
            color: var(--primary-color);
            margin-bottom: 15px;
        }
        .pigeon-anatomy {
            background: #fff;
            border-radius: var(--border-radius-lg);
            padding: 30px;
            margin-top: 40px;
            border-right: 8px solid var(--accent-warm);
        }
        .tag {
            display: inline-block;
            padding: 4px 10px;
            background: var(--bg-color);
            border-radius: 12px;
            font-size: 0.85rem;
            margin: 5px;
            color: var(--primary-dark);
            font-weight: 700;
        }
    
/* CSS for Lesson 5 */

        .cycle-container {
            display: flex;
            flex-direction: column;
            gap: 30px;
            margin-top: 30px;
        }
        .cycle-step-box {
            display: flex;
            align-items: center;
            gap: 20px;
            background: white;
            padding: 20px;
            border-radius: var(--border-radius-md);
            box-shadow: var(--shadow-soft);
            position: relative;
        }
        .step-num {
            background: var(--primary-color);
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 800;
            flex-shrink: 0;
        }
        .cycle-arrow {
            text-align: center;
            font-size: 1.5rem;
            color: var(--text-muted);
        }
        .examples-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-top: 30px;
        }
        .example-box {
            background: #fdfdfd;
            border: 2px solid var(--bg-color);
            padding: 25px;
            border-radius: var(--border-radius-lg);
            text-align: center;
        }
        .spores-box {
            background: #fff8f0;
            border: 2px dashed #f4a261;
            padding: 20px;
            border-radius: var(--border-radius-md);
            margin: 20px 0;
        }
    
/* CSS for Lesson 6 */

        .seed-anatomy {
            background: #fff;
            padding: 30px;
            border-radius: var(--border-radius-lg);
            border: 3px solid var(--accent-color);
            margin: 30px 0;
            display: flex;
            align-items: center;
            gap: 30px;
            flex-wrap: wrap;
        }
        .seed-part {
            background: var(--bg-color);
            padding: 15px;
            border-radius: var(--border-radius-md);
            flex: 1;
            min-width: 150px;
            text-align: center;
        }
        .dispersal-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
            margin-top: 20px;
        }
        .dispersal-item {
            background: white;
            padding: 15px;
            border-radius: var(--border-radius-sm);
            box-shadow: var(--shadow-soft);
            text-align: center;
        }
        .apple-cycle {
            background: linear-gradient(135deg, #fff, #fff1f2);
            border-radius: var(--border-radius-lg);
            padding: 30px;
            margin-top: 40px;
            position: relative;
            overflow: hidden;
        }
    
/* CSS for Lesson 7 */

        .comparison-container {
            display: flex;
            gap: 20px;
            margin-top: 30px;
            flex-wrap: wrap;
        }
        .cycle-box {
            flex: 1;
            min-width: 300px;
            background: white;
            padding: 25px;
            border-radius: var(--border-radius-lg);
            box-shadow: var(--shadow-soft);
            border-top: 5px solid var(--primary-color);
        }
        .cycle-step {
            display: flex;
            align-items: center;
            gap: 15px;
            margin: 15px 0;
            padding: 10px;
            background: var(--bg-color);
            border-radius: var(--border-radius-sm);
        }
        .molting-alert {
            background: #fff4e6;
            border: 2px solid #ffd8a8;
            padding: 15px;
            border-radius: var(--border-radius-md);
            margin: 20px 0;
        }
        .factor-card {
            text-align: center;
            padding: 20px;
            background: white;
            border-radius: var(--border-radius-md);
            flex: 1;
        }
    
/* CSS for Lesson 8 */

        .backbone-display {
            background: #f8f9fa;
            border-radius: var(--border-radius-lg);
            padding: 30px;
            margin: 30px 0;
            border-left: 10px solid var(--primary-color);
            display: flex;
            align-items: center;
            gap: 20px;
        }
        .cycle-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 30px;
            margin-top: 40px;
        }
        .animal-cycle-card {
            background: white;
            padding: 25px;
            border-radius: var(--border-radius-lg);
            box-shadow: var(--shadow-soft);
        }
        .tadpole-info {
            background: #e7f5ff;
            border: 2px solid #a5d8ff;
            padding: 15px;
            border-radius: var(--border-radius-md);
            margin-top: 15px;
            font-size: 0.9rem;
        }
    
/* CSS for Lesson 9 */

        .property-card {
            background: #e3f2fd;
            border-right: 6px solid #1976d2;
            padding: 20px;
            border-radius: var(--border-radius-md);
            margin: 20px 0;
        }
        .change-examples {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-top: 30px;
        }
        .example-item {
            background: white;
            padding: 25px;
            border-radius: var(--border-radius-lg);
            text-align: center;
            box-shadow: var(--shadow-soft);
            transition: var(--transition-fast);
        }
        .example-item:hover {
            background: #f1f8e9;
            transform: translateY(-5px);
        }
        .warning-box {
            background: #fff3e0;
            border: 2px solid #ffb74d;
            padding: 20px;
            border-radius: var(--border-radius-md);
            margin-top: 30px;
        }
        .mixture-section {
            background: #f3e5f5;
            padding: 30px;
            border-radius: var(--border-radius-lg);
            margin-top: 40px;
            border: 2px dashed #9c27b0;
        }
    
/* CSS for Lesson 10 */

        .phase-container {
            display: flex;
            justify-content: space-around;
            align-items: center;
            margin: 40px 0;
            flex-wrap: wrap;
            gap: 20px;
        }
        .phase-box {
            background: white;
            padding: 20px;
            border-radius: var(--border-radius-lg);
            text-align: center;
            box-shadow: var(--shadow-soft);
            width: 150px;
            border: 2px solid transparent;
        }
        .phase-box.solid { border-color: #4dabf7; }
        .phase-box.liquid { border-color: #339af0; }
        .phase-box.gas { border-color: #adb5bd; }
        
        .transition-arrow {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
        }
        .arrow-label {
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--primary-dark);
        }
        .temp-badge {
            background: var(--primary-dark);
            color: white;
            padding: 5px 15px;
            border-radius: 50px;
            font-size: 1.1rem;
            display: inline-block;
            margin-top: 10px;
        }
        .heat-icon { color: #e03131; }
        .cold-icon { color: #1971c2; }
    
/* CSS for Lesson 11 */

        .chem-card {
            background: #fff0f0;
            border-right: 6px solid #e03131;
            padding: 20px;
            border-radius: var(--border-radius-md);
            margin: 20px 0;
        }
        .signs-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-top: 25px;
        }
        .sign-item {
            background: white;
            padding: 20px;
            border-radius: var(--border-radius-md);
            text-align: center;
            box-shadow: var(--shadow-soft);
            border: 2px solid transparent;
            transition: var(--transition-fast);
        }
        .sign-item:hover {
            border-color: #e03131;
            transform: scale(1.05);
        }
        .importance-list {
            background: #f8f9fa;
            padding: 25px;
            border-radius: var(--border-radius-lg);
            margin-top: 40px;
        }
        .importance-item {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 15px;
            padding: 10px;
            background: white;
            border-radius: var(--border-radius-sm);
        }
        .harmful-box {
            background: #fff5f5;
            border: 2px dashed #fa5252;
            padding: 20px;
            border-radius: var(--border-radius-md);
            margin-top: 30px;
        }
    
/* CSS for Lesson 12 */

        .compare-section {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 25px;
            margin-top: 30px;
        }
        .compare-card {
            background: white;
            padding: 25px;
            border-radius: var(--border-radius-lg);
            box-shadow: var(--shadow-soft);
            position: relative;
            overflow: hidden;
        }
        .compare-card.physical { border-top: 5px solid #228be6; }
        .compare-card.chemical { border-top: 5px solid #e03131; }
        
        .badge-type {
            position: absolute;
            top: 10px;
            left: 10px;
            padding: 5px 10px;
            border-radius: 5px;
            font-size: 0.8rem;
            font-weight: 700;
            color: white;
        }
        .physical .badge-type { background: #228be6; }
        .chemical .badge-type { background: #e03131; }

        .rust-prevention {
            background: #e7f5ff;
            border-radius: var(--border-radius-lg);
            padding: 30px;
            margin-top: 40px;
            display: flex;
            align-items: center;
            gap: 20px;
            border: 2px solid #a5d8ff;
        }
    
/* CSS for Lesson 13 */

        .earth-layers {
            background: linear-gradient(to bottom, #8d6e63, #5d4037, #3e2723);
            border-radius: var(--border-radius-lg);
            padding: 40px;
            color: white;
            margin: 30px 0;
            position: relative;
        }
        .layer-box {
            border: 2px dashed rgba(255,255,255,0.3);
            padding: 20px;
            margin-bottom: 15px;
            border-radius: var(--border-radius-md);
            background: rgba(0,0,0,0.1);
        }
        .fossil-info {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 20px;
            margin-top: 40px;
        }
        .mining-card {
            background: #fff9db;
            border: 2px solid #fcc419;
            padding: 25px;
            border-radius: var(--border-radius-lg);
            display: flex;
            align-items: center;
            gap: 20px;
        }
        .use-item {
            background: white;
            padding: 15px;
            border-radius: var(--border-radius-sm);
            text-align: center;
            box-shadow: var(--shadow-soft);
        }
    
/* CSS for Lesson 14 */

        .forms-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 25px;
            margin-top: 30px;
        }
        .form-card {
            background: white;
            padding: 30px;
            border-radius: var(--border-radius-lg);
            box-shadow: var(--shadow-soft);
            text-align: center;
            border-bottom: 8px solid transparent;
        }
        .form-card.oil { border-bottom-color: #212529; }
        .form-card.gas { border-bottom-color: #4dabf7; }
        .form-card.coal { border-bottom-color: #495057; }

        .derivatives-box {
            background: #f8f9fa;
            padding: 30px;
            border-radius: var(--border-radius-lg);
            margin-top: 40px;
        }
        .derivatives-list {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 15px;
        }
        .derivative-tag {
            background: white;
            padding: 10px 20px;
            border-radius: 50px;
            border: 2px solid #dee2e6;
            font-weight: 500;
        }
    
/* CSS for Lesson 15 */

        .pollution-types {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-top: 30px;
        }
        .pollution-card {
            background: white;
            padding: 25px;
            border-radius: var(--border-radius-lg);
            text-align: center;
            box-shadow: var(--shadow-soft);
            transition: var(--transition-fast);
        }
        .pollution-card:hover { transform: translateY(-5px); }
        .pollution-card i { font-size: 3rem; margin-bottom: 15px; }
        
        .soil-icon { color: #8d6e63; }
        .water-icon { color: #0288d1; }
        .air-icon { color: #546e7a; }
        .noise-icon { color: #d32f2f; }

        .causes-list {
            background: #fff5f5;
            padding: 30px;
            border-radius: var(--border-radius-lg);
            margin-top: 40px;
            border-right: 6px solid #fa5252;
        }
        .cause-item {
            display: flex;
            align-items: center;
            gap: 15px;
            background: white;
            margin-bottom: 10px;
            padding: 15px;
            border-radius: var(--border-radius-sm);
        }
    


#dashboard-view, #lesson-view {
    animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Dashboard & Units Islamic Educational Theme --- */
.dashboard-container {
    padding: 35px 20px 60px;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-banner {
    background: linear-gradient(135deg, #1A5E56 0%, #2B9386 50%, #3DBAA9 100%);
    border-radius: var(--border-radius-lg);
    border: 3.5px solid var(--accent-color);
    padding: 50px 30px;
    color: white;
    text-align: center;
    margin-bottom: 45px;
    box-shadow: 0 14px 35px rgba(43, 147, 134, 0.22);
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(245, 172, 51, 0.15) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.hero-subtag {
    display: inline-block;
    background: rgba(245, 172, 51, 0.22);
    border: 1px solid var(--accent-color);
    color: #FFF0D4;
    padding: 4px 18px;
    border-radius: 20px;
    font-size: 0.92rem;
    font-weight: 700;
    font-family: 'Changa', sans-serif;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.hero-banner h1 {
    font-family: 'Marhey', 'Changa', sans-serif;
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #FFFFFF;
    text-shadow: 0 2px 4px rgba(26, 94, 86, 0.8), 0 0 25px rgba(245, 172, 51, 0.4);
}

.hero-banner p {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.18rem;
    color: #E4F6F3;
    font-weight: 500;
    opacity: 0.95;
    margin: 0;
}

/* قسم إنجازاتي */
.achievements-section.info-card {
    background: #FFFFFF;
    border-radius: var(--border-radius-lg);
    padding: 28px;
    margin-bottom: 45px;
    box-shadow: var(--shadow-soft);
    border: 1px solid #E2E8F0;
    border-right: 6px solid var(--accent-color) !important;
}

.achievements-section h2 {
    font-family: 'Marhey', 'Changa', sans-serif;
    color: var(--primary-dark);
    font-size: 1.6rem;
}

.stars-total {
    background: #FFF7E6 !important;
    border: 1.5px solid #FFE0A3;
    padding: 8px 22px;
    border-radius: 50px;
    font-weight: 800;
    font-family: 'Changa', sans-serif;
    color: #D48B1B !important;
    box-shadow: 0 2px 8px rgba(212, 139, 27, 0.12);
}

/* الأقسام والوحدات التعليمية */
.unit-section {
    margin-bottom: 50px;
    background: #FFFFFF;
    padding: 35px 30px;
    border-radius: var(--border-radius-lg);
    border: 1px solid #E5EBE5;
    border-top: 6px solid var(--primary-color);
    box-shadow: 0 8px 28px rgba(24, 51, 58, 0.06);
    position: relative;
}

.unit-title {
    font-family: 'Marhey', 'Changa', sans-serif;
    font-size: 1.85rem;
    color: var(--primary-dark);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 4px solid var(--accent-color);
    display: inline-block;
}

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

.chapter-title {
    font-family: 'Changa', 'Tajawal', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #F8FBF8;
    padding: 10px 24px;
    border-radius: 50px;
    width: fit-content;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border: 1.5px solid rgba(197, 160, 89, 0.35);
}

.chapter-title i {
    color: var(--accent-warm);
    font-size: 1.2rem;
}

.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.lesson-card {
    background: #FFFFFF;
    border-radius: var(--border-radius-lg);
    padding: 24px 22px;
    text-decoration: none;
    color: var(--text-main);
    box-shadow: 0 6px 18px rgba(24, 51, 58, 0.05);
    border: 2px solid #EAEFEA;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
}

.lesson-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 14px 32px rgba(24, 51, 58, 0.12);
}

.lesson-icon {
    width: 62px;
    height: 62px;
    background: var(--emerald-mint);
    border: 2px solid #B4E8DF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(43, 147, 134, 0.1);
    transition: transform 0.3s ease;
}

.lesson-card:hover .lesson-icon {
    transform: scale(1.1) rotate(5deg);
    border-color: var(--accent-color);
    color: var(--primary-dark);
}

.lesson-card h3 {
    font-family: 'Marhey', 'Tajawal', sans-serif;
    font-size: 1.28rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.3;
}

.lesson-card p {
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #FFFFFF !important;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    font-weight: 700;
    font-family: 'Changa', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(36, 75, 85, 0.25);
    transition: all 0.25s ease;
    text-decoration: none;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(36, 75, 85, 0.35);
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
}

@media (max-width: 768px) {
    .header-nav-bar {
        flex-direction: column !important;
        text-align: center !important;
        gap: 12px !important;
        padding: 0.85rem 0.6rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .nav-title-capsule h1,
    .nav-subject-tag {
        font-size: 1.05rem !important;
        padding: 5px 14px !important;
        white-space: normal !important;
        text-align: center !important;
    }
    .header-actions {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 4px auto 0 auto !important;
    }
    .portal-home-btn {
        padding: 7px 14px !important;
        font-size: 0.88rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
        border-radius: 40px !important;
    }
    .user-profile-badge {
        padding: 4px 10px !important;
        flex-shrink: 0 !important;
    }
    .profile-role-label {
        font-size: 0.82rem !important;
    }
    .mode-toggle-group {
        flex-shrink: 0 !important;
        padding: 2px !important;
    }
    .role-btn {
        padding: 0.3rem 0.75rem !important;
        font-size: 0.82rem !important;
        gap: 0.35rem !important;
    }
    .home-btn,
    #lesson-view .home-btn,
    .main-header .home-btn {
        padding: 8px 18px !important;
        font-size: 0.95rem !important;
        gap: 8px !important;
        width: auto !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        align-self: center !important;
        margin: 0 auto !important;
    }
    .hero-banner h1 {
        font-size: 2rem;
    }
    .unit-title {
        font-size: 1.5rem;
    }
    .unit-section {
        padding: 20px 15px;
    }
}

@media (max-width: 420px) {
    .header-actions {
        gap: 6px !important;
    }
    .portal-home-btn {
        padding: 6px 11px !important;
        font-size: 0.82rem !important;
        gap: 5px !important;
    }
    .portal-home-btn i {
        font-size: 0.9rem !important;
    }
    .user-profile-badge {
        padding: 4px 8px !important;
    }
    .profile-avatar-img {
        width: 28px !important;
        height: 28px !important;
    }
    .profile-role-label {
        font-size: 0.76rem !important;
    }
    .role-btn {
        padding: 0.25rem 0.55rem !important;
        font-size: 0.76rem !important;
    }
    .home-btn,
    #lesson-view .home-btn,
    .main-header .home-btn {
        padding: 7px 14px !important;
        font-size: 0.86rem !important;
        gap: 6px !important;
    }
}

/* ==========================================================================
   أدوات المعلمة التفاعلية لإدارة الدرس والصف (الصف الرابع)
   Classroom Smart Tools: Dock, Wheel, Teams, Timer, Praise, Presentation
   ========================================================================== */

/* 1. Modal Overlay & Container */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(26, 94, 86, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.modal.active {
    display: flex;
    animation: fadeInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body.modal-open {
    overflow: hidden !important;
    touch-action: none;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content.class-tool-modal {
    position: relative;
    max-width: 680px;
    width: 94%;
    max-height: calc(100dvh - 36px);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    border-radius: 24px;
    padding: 26px 28px 40px 28px;
    background: #FFFFFF;
    border: 2px solid rgba(245, 172, 51, 0.45);
    box-shadow: 0 20px 50px rgba(26, 94, 86, 0.22);
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .modal {
        padding: 10px 8px 30px 8px !important;
        align-items: flex-start !important; /* لا تقص الجزء العلوي على الهاتف */
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .modal-content.class-tool-modal {
        width: 100% !important;
        max-width: 100% !important;
        margin: 6px auto 24px auto !important;
        max-height: calc(100dvh - 20px) !important;
        max-height: calc(100vh - 20px) !important;
        padding: 20px 14px 48px 14px !important;
        border-radius: 20px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        touch-action: pan-y !important;
    }

    .modal-content .close-btn {
        top: 10px !important;
        left: 10px !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 1rem !important;
    }

    .tool-modal-header {
        margin-bottom: 14px !important;
        padding-top: 4px !important;
    }

    .tool-modal-header h2 {
        font-size: 1.25rem !important;
    }

    .tool-modal-header p {
        font-size: 0.85rem !important;
    }
}

/* Custom Scrollbar for Modal Content */
.modal-content.class-tool-modal::-webkit-scrollbar {
    width: 7px;
}
.modal-content.class-tool-modal::-webkit-scrollbar-track {
    background: #F4F9F7;
    border-radius: 10px;
}
.modal-content.class-tool-modal::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

.modal-content .close-btn {
    position: absolute;
    top: 16px;
    left: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F4F9F7;
    border: 1.5px solid rgba(43, 147, 134, 0.2);
    color: var(--primary-dark);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-content .close-btn:hover {
    background: var(--primary-dark);
    color: #FFFFFF;
    transform: rotate(90deg) scale(1.1);
}

.tool-modal-header {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 5px;
}

.tool-modal-badge {
    display: inline-block;
    background: var(--emerald-mint);
    color: var(--primary-dark);
    font-size: 0.84rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 8px;
    border: 1px solid rgba(43, 147, 134, 0.25);
}

.tool-modal-header h2 {
    color: var(--primary-dark);
    font-family: 'Marhey', 'Tajawal', sans-serif;
    font-size: 1.55rem;
    margin: 4px 0 6px 0;
}

.tool-modal-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* 2. Classroom Tools Dock (شريط أدوات المعلمة التفاعلية داخل الدرس) */
.classroom-tools-dock {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 251, 249, 0.99));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(245, 172, 51, 0.45);
    border-radius: 20px;
    box-shadow: 0 4px 18px rgba(43, 147, 134, 0.1);
    padding: 10px 18px;
    margin: 12px auto 20px auto;
    max-width: 1200px;
    width: 95%;
    transition: all 0.3s ease;
}

.dock-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.dock-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: var(--islamic-gold-light);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 700;
    border: 1px solid rgba(245, 172, 51, 0.5);
    box-shadow: 0 2px 8px rgba(26, 94, 86, 0.15);
}

.dock-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dock-btn {
    background: #FFFFFF;
    color: var(--primary-dark);
    border: 1.5px solid rgba(43, 147, 134, 0.22);
    border-radius: 40px;
    padding: 7px 15px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.dock-btn:hover {
    background: var(--primary-color);
    color: #FFFFFF;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(43, 147, 134, 0.25);
}

.dock-btn:hover .dock-icon {
    transform: scale(1.18);
}

.dock-icon {
    font-size: 1.15rem;
    transition: transform 0.2s ease;
}

.dock-chip {
    background: var(--accent-color);
    color: var(--text-main);
    font-size: 0.78rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 800;
}

.dock-timer-val {
    background: var(--emerald-mint);
    color: var(--primary-dark);
    font-size: 0.82rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: 'Changa', monospace;
    font-weight: 700;
}

/* 3. Star Wheel Styles (عجلة أرقام نجوم الصف) */
.wheel-controls-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.wheel-preset-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.wheel-preset-btn {
    border: 1.5px solid var(--primary-color);
    background: var(--emerald-mint);
    color: var(--primary-dark);
    padding: 5px 12px;
    border-radius: 20px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wheel-preset-btn.active, .wheel-preset-btn:hover {
    background: var(--primary-color);
    color: #FFFFFF;
    border-color: var(--accent-color);
    box-shadow: 0 2px 6px rgba(43, 147, 134, 0.2);
}

.wheel-stepper-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #F8FBF9;
    border: 1.5px solid var(--accent-color);
    border-radius: 30px;
    padding: 3px 8px;
}

.stepper-btn {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.18s ease;
}

.stepper-btn:hover {
    background: var(--primary-color);
    color: #FFF;
    border-color: var(--primary-color);
}

.stepper-display {
    font-family: 'Changa', monospace;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--primary-dark);
    min-width: 65px;
    text-align: center;
}

.wheel-stage-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 10px 0;
}

.wheel-pointer-arrow {
    position: absolute;
    top: -4px;
    font-size: 2.2rem;
    color: var(--accent-color);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    z-index: 10;
    animation: pointerBounce 1s infinite alternate;
}

@keyframes pointerBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

.wheel-canvas-wrap {
    border-radius: 50%;
    padding: 8px;
    background: linear-gradient(135deg, var(--islamic-gold-light), var(--accent-color), var(--accent-warm));
    box-shadow: 0 10px 30px rgba(43, 147, 134, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

#wheelCanvas {
    border-radius: 50%;
    background: #FFFFFF;
    display: block;
    max-width: 100%;
}

@media (max-width: 600px) {
    .wheel-controls-strip {
        justify-content: center !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
    }
    .wheel-preset-btn {
        padding: 4px 10px !important;
        font-size: 0.8rem !important;
    }
    .stepper-btn {
        width: 32px !important;
        height: 32px !important;
    }
    .wheel-stage-container {
        padding: 6px 0 !important;
    }
    .wheel-canvas-wrap {
        padding: 5px !important;
    }
    #wheelCanvas {
        max-width: min(230px, 66vw) !important;
        max-height: min(230px, 66vw) !important;
        width: auto !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
    }
    .wheel-pointer-arrow {
        font-size: 1.8rem !important;
        top: -6px !important;
    }
    .spin-action-btn {
        margin-top: 12px !important;
        padding: 10px 24px !important;
        font-size: 1rem !important;
    }
    .wheel-winner-card {
        padding: 12px !important;
        margin-top: 10px !important;
    }
    .wheel-card-actions {
        margin-top: 10px !important;
        margin-bottom: 14px !important;
        gap: 8px !important;
    }
}

.spin-action-btn {
    margin-top: 18px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: var(--islamic-gold-light);
    border: 2px solid var(--accent-color);
    border-radius: 50px;
    padding: 12px 32px;
    font-family: 'Changa', 'Tajawal', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(43, 147, 134, 0.25);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spin-action-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 8px 25px rgba(245, 172, 51, 0.4);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.spin-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.wheel-winner-card {
    margin-top: 14px;
    background: #FFFFFF;
    border: 2px solid var(--accent-color);
    border-radius: 18px;
    padding: 16px 20px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(245, 172, 51, 0.2);
    animation: celebratePop 0.4s ease;
}

@keyframes celebratePop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.wheel-winner-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: var(--islamic-gold-light);
    padding: 6px 18px;
    border-radius: 30px;
    font-family: 'Marhey', 'Tajawal', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 10px;
    border: 1.5px solid var(--accent-color);
    box-shadow: 0 3px 10px rgba(43, 147, 134, 0.2);
}

.wheel-question-box {
    background: #F8FBF9;
    border-right: 4px solid var(--primary-color);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 8px 0;
    line-height: 1.5;
    text-align: right;
}

.wheel-card-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.wheel-answer-btn, .wheel-praise-btn {
    border: none;
    border-radius: 20px;
    padding: 8px 18px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wheel-answer-btn {
    background: var(--islamic-gold-light);
    border: 1.5px solid var(--accent-color);
    color: var(--accent-warm);
}

.wheel-answer-btn:hover {
    background: var(--accent-color);
    color: #FFFFFF;
}

.wheel-praise-btn {
    background: var(--emerald-mint);
    border: 1.5px solid var(--primary-color);
    color: var(--primary-dark);
}

.wheel-praise-btn:hover {
    background: var(--primary-color);
    color: #FFFFFF;
}

.wheel-model-answer {
    background: var(--emerald-mint);
    border-radius: 12px;
    padding: 10px 16px;
    color: var(--primary-dark);
    font-size: 0.98rem;
    font-weight: 700;
    margin-top: 10px;
    text-align: right;
    border: 1.5px dashed var(--primary-color);
    animation: celebratePop 0.3s ease;
}

/* 4. Challenge Mission Question Card (Shared by Teams & Timer) */
.challenge-mission-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAF9 100%);
    border: 2px solid rgba(245, 172, 51, 0.45);
    border-radius: 20px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(43, 147, 134, 0.08);
    position: relative;
    transition: all 0.3s ease;
}

.timer-mission-card {
    background: linear-gradient(135deg, #F9FCFB 0%, var(--emerald-mint) 100%);
    border-color: rgba(43, 147, 134, 0.35);
}

.challenge-mission-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    border-bottom: 1px dashed rgba(245, 172, 51, 0.4);
    padding-bottom: 8px;
}

.challenge-lesson-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 800;
}

.challenge-lesson-tag .tag-icon {
    font-size: 1.25rem;
}

.challenge-lesson-tag .tag-title {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.challenge-lesson-tag .tag-name {
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(43, 147, 134, 0.25);
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 800;
}

.challenge-lesson-picker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.challenge-lesson-picker .picker-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 700;
}

.challenge-select {
    background: #FFFFFF;
    border: 1.5px solid var(--primary-color);
    color: var(--text-main);
    border-radius: 12px;
    padding: 5px 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    max-width: 240px;
    outline: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.challenge-select:hover, .challenge-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(245, 172, 51, 0.25);
}

.challenge-q-box {
    background: #FFFFFF;
    border-right: 5px solid var(--primary-color);
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.6;
    text-align: right;
    box-shadow: 0 3px 12px rgba(43, 147, 134, 0.06);
    position: relative;
    transition: all 0.2s ease;
}

.challenge-actions-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 12px;
}

.ch-btn {
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ch-btn:hover {
    transform: translateY(-2px);
}

.ch-btn:active {
    transform: scale(0.96);
}

.ch-btn-next {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: var(--islamic-gold-light);
    border: 1.5px solid var(--accent-color);
    box-shadow: 0 3px 10px rgba(43, 147, 134, 0.2);
}

.ch-btn-next:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    box-shadow: 0 5px 14px rgba(245, 172, 51, 0.35);
}

.ch-btn-ans {
    background: var(--islamic-gold-light);
    color: var(--accent-warm);
    border: 1.5px solid var(--accent-color);
}

.ch-btn-ans:hover {
    background: var(--accent-color);
    color: #FFFFFF;
}

.ch-btn-voice {
    background: var(--emerald-mint);
    color: var(--primary-dark);
    border: 1.5px solid rgba(43, 147, 134, 0.25);
}

.ch-btn-voice:hover {
    background: var(--primary-color);
    color: #FFFFFF;
}

.challenge-model-answer {
    background: linear-gradient(135deg, #F3FAF8, var(--emerald-mint));
    border: 1.5px dashed var(--primary-color);
    border-radius: 14px;
    padding: 12px 18px;
    color: var(--primary-dark);
    font-size: 1.02rem;
    font-weight: 700;
    margin-top: 12px;
    text-align: right;
    line-height: 1.6;
    animation: celebratePop 0.35s ease;
    box-shadow: 0 4px 14px rgba(43, 147, 134, 0.08);
}

/* 5. Teams Scoreboard Styles (لوحة تحدي المجموعات) */
.teams-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

@media (max-width: 580px) {
    .teams-cards-grid {
        grid-template-columns: 1fr;
    }
}

.team-card {
    background: #FFFFFF;
    border-radius: 18px;
    padding: 16px;
    text-align: center;
    border: 2px solid #E2E8E4;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.team-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.team-explorers { border-color: rgba(43, 147, 134, 0.45); }
.team-innovators { border-color: rgba(245, 172, 51, 0.5); }
.team-pioneers { border-color: rgba(72, 188, 174, 0.5); }
.team-stars { border-color: rgba(212, 139, 27, 0.5); }

.team-icon { font-size: 2.2rem; margin-bottom: 4px; }
.team-title {
    font-size: 1.12rem;
    font-weight: 800;
    margin: 4px 0;
    color: var(--primary-dark);
}

.team-score-bubble {
    background: #F8FBF9;
    border-radius: 14px;
    padding: 8px 12px;
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(43, 147, 134, 0.12);
}

.team-score-num {
    font-family: 'Changa', monospace;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1;
}

.team-score-unit {
    font-size: 0.78rem;
    color: var(--text-dim);
    font-weight: 700;
    margin-top: 2px;
}

.team-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.team-point-btn {
    border: none;
    border-radius: 10px;
    padding: 6px 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.18s ease;
}

.btn-add-1 {
    background: var(--emerald-mint);
    color: var(--primary-dark);
}
.btn-add-1:hover {
    background: var(--primary-color);
    color: #FFF;
}

.btn-add-5 {
    background: var(--islamic-gold-light);
    color: var(--accent-warm);
    border: 1px solid rgba(245, 172, 51, 0.5);
}
.btn-add-5:hover {
    background: var(--accent-color);
    color: #FFF;
}

.btn-sub-1 {
    background: #FEE2E2;
    color: #DC2626;
}
.btn-sub-1:hover {
    background: #DC2626;
    color: #FFF;
}

.teams-bottom-bar {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 14px;
    margin-bottom: 8px;
}

@media (max-width: 580px) {
    .teams-cards-grid {
        gap: 10px !important;
        margin-bottom: 14px !important;
    }
    .team-card {
        padding: 12px 10px !important;
        border-radius: 14px !important;
    }
    .team-icon {
        font-size: 1.8rem !important;
    }
    .team-title {
        font-size: 1.05rem !important;
    }
    .team-score-bubble {
        padding: 6px 10px !important;
        margin: 6px 0 !important;
    }
    .team-score-num {
        font-size: 1.8rem !important;
    }
    .team-actions {
        flex-wrap: wrap !important;
        gap: 5px !important;
    }
    .team-point-btn {
        padding: 6px 10px !important;
        font-size: 0.82rem !important;
    }
    .teams-bottom-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 10px !important;
        margin-top: 14px !important;
        margin-bottom: 24px !important;
        padding-bottom: 14px !important;
    }
    .crown-winner-btn,
    .reset-teams-btn {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        padding: 12px 16px !important;
        font-size: 0.95rem !important;
        box-sizing: border-box !important;
    }
}

.crown-winner-btn {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-warm));
    color: #FFFFFF;
    border: none;
    padding: 10px 22px;
    border-radius: 30px;
    font-family: 'Changa', 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(245, 172, 51, 0.4);
    transition: all 0.22s ease;
}

.crown-winner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 172, 51, 0.6);
}

.reset-teams-btn {
    background: #F0F4F2;
    border: 1px solid #CBD5E1;
    color: #475569;
    padding: 10px 18px;
    border-radius: 30px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.reset-teams-btn:hover {
    background: #E2E8F0;
}

/* 6. Classroom Timer Styles (مؤقت الأنشطة) */
.timer-stage {
    display: flex;
    justify-content: center;
    padding: 16px 0;
}

.timer-svg-wrap {
    position: relative;
    width: 220px;
    height: 220px;
}

.timer-ring-svg {
    transform: rotate(-90deg);
}

.timer-ring-bg {
    fill: none;
    stroke: var(--emerald-mint);
    stroke-width: 14;
}

.timer-ring-progress {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 14;
    stroke-linecap: round;
    stroke-dasharray: 596.9; /* 2 * PI * 95 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

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

.timer-digits {
    font-family: 'Changa', monospace;
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1;
}

.timer-caption {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 6px;
}

.timer-preset-chips {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0 20px 0;
}

.preset-chip {
    background: #F8FBF9;
    border: 1.5px solid #D0DBCE;
    border-radius: 20px;
    padding: 6px 14px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-chip.active, .preset-chip:hover {
    background: var(--primary-color);
    border-color: var(--accent-color);
    color: #FFFFFF;
}

.timer-action-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 6px;
    margin-bottom: 12px;
}

@media (max-width: 600px) {
    .timer-stage {
        padding: 8px 0 !important;
    }
    .timer-svg-wrap {
        width: 180px !important;
        height: 180px !important;
    }
    .timer-ring-svg {
        width: 180px !important;
        height: 180px !important;
    }
    .timer-digits {
        font-size: 2.2rem !important;
    }
    .timer-preset-chips {
        gap: 6px !important;
        margin: 8px 0 14px 0 !important;
    }
    .preset-chip {
        padding: 5px 10px !important;
        font-size: 0.82rem !important;
    }
    .timer-action-buttons {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 8px !important;
        margin-top: 10px !important;
        margin-bottom: 24px !important;
        padding-bottom: 12px !important;
    }
    .timer-btn-primary, .timer-btn-secondary {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        padding: 12px 18px !important;
        font-size: 0.95rem !important;
        box-sizing: border-box !important;
    }
}

.timer-btn-primary, .timer-btn-secondary {
    padding: 10px 24px;
    border-radius: 30px;
    font-family: 'Changa', 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    border: none;
    transition: all 0.22s ease;
}

.timer-btn-primary {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: var(--islamic-gold-light);
    border: 1.5px solid var(--accent-color);
    box-shadow: 0 4px 14px rgba(43, 147, 134, 0.2);
}

.timer-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(245, 172, 51, 0.4);
}

.timer-btn-secondary {
    background: #F0F4F2;
    color: #475569;
}

/* 7. Praise Soundboard Styles (بنك التعزيز) */
.praise-soundboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

@media (max-width: 540px) {
    .praise-soundboard-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        margin-bottom: 24px !important;
        padding-bottom: 12px !important;
    }
    .praise-card-btn {
        padding: 12px 14px !important;
    }
}

.praise-card-btn {
    background: #FFFFFF;
    border: 2px solid #E2E8E4;
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
}

.praise-card-btn:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--accent-color);
    box-shadow: 0 8px 22px rgba(43, 147, 134, 0.15);
    background: #FFFDF8;
}

.praise-card-btn:active {
    transform: scale(0.97);
}

.praise-emoji { font-size: 2.2rem; margin-bottom: 4px; }
.praise-title { font-size: 1rem; font-weight: 800; color: var(--primary-dark); font-family: 'Tajawal', sans-serif; }
.praise-sub { font-size: 0.82rem; color: var(--text-dim); margin-top: 2px; }

/* 8. Presentation Mode (وضع العرض الصفي للسبورة الذكية) */
body.presentation-mode {
    font-size: 1.25rem;
}

body.presentation-mode .main-header,
body.presentation-mode .floating-forest-bg {
    display: none;
}

body.presentation-mode .classroom-tools-dock {
    padding: 14px 24px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
}

body.presentation-mode .dock-btn {
    padding: 10px 20px;
    font-size: 1.1rem;
}

body.presentation-mode .info-card,
body.presentation-mode .question-card {
    font-size: 1.35rem !important;
    line-height: 1.8 !important;
}

/* ==========================================================================
   أزرار تبديل أقسام الدرس (الشرح / وقت التحدي والمرح)
   Lesson Section Tabs: 1. Explain / 2. Challenge & Fun
   ========================================================================== */
.lesson-section-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    max-width: 900px;
    margin: 12px auto 28px auto;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 247, 0.95));
    border: 2px solid rgba(43, 147, 134, 0.28);
    border-radius: 60px;
    box-shadow: 0 6px 22px rgba(43, 147, 134, 0.08);
    position: sticky;
    top: 15px;
    z-index: 50;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lesson-nav-btn {
    flex: 1;
    max-width: 420px;
    padding: 13px 24px;
    border-radius: 50px;
    border: 2px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Changa', 'Tajawal', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lesson-nav-btn .nav-btn-icon {
    font-size: 1.35rem;
    transition: transform 0.22s ease;
}

.lesson-nav-btn:hover {
    color: var(--primary-dark);
    background: rgba(43, 147, 134, 0.08);
}

.lesson-nav-btn:hover .nav-btn-icon {
    transform: scale(1.18);
}

/* زر الشرح والتوضيح النشط */
.lesson-nav-btn.active#btn-section-explain {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: #FFFFFF;
    border-color: var(--accent-color);
    box-shadow: 0 6px 20px rgba(43, 147, 134, 0.35);
    transform: scale(1.02);
}

/* زر وقت التحدي والمرح النشط */
.lesson-nav-btn.active#btn-section-quiz {
    background: linear-gradient(135deg, var(--accent-warm), var(--accent-color));
    color: #FFFFFF;
    border-color: var(--islamic-gold-light);
    box-shadow: 0 6px 20px rgba(245, 172, 51, 0.45);
    transform: scale(1.02);
}

.nav-btn-badge {
    background: rgba(255, 255, 255, 0.32);
    color: #FFFFFF;
    font-size: 0.78rem;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 800;
}

.lesson-nav-btn:not(.active) .nav-btn-badge {
    background: var(--islamic-gold-light);
    color: var(--accent-warm);
}

/* تأثير ظهور وانتقال القسم النشط */
.active-section-pane {
    animation: fadeInSectionPane 0.35s ease-out forwards;
}

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

/* بطاقة نهاية الشرح للانتقال للتحدي */
.finish-explanation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #FFFFFF 0%, var(--emerald-mint) 100%);
    border: 2px dashed var(--accent-color);
    border-radius: 24px;
    padding: 24px 30px;
    margin-top: 40px;
    box-shadow: 0 6px 24px rgba(43, 147, 134, 0.08);
}

.banner-text h3 {
    color: var(--primary-dark);
    font-family: 'Marhey', 'Tajawal', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 6px;
}

.banner-text p {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

.challenge-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--accent-warm), var(--accent-color));
    color: #FFFFFF;
    font-family: 'Changa', 'Tajawal', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    padding: 13px 30px;
    border-radius: 50px;
    border: 2px solid #FFF0D4;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(245, 172, 51, 0.4);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.challenge-cta-btn:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 8px 26px rgba(245, 172, 51, 0.55);
    background: linear-gradient(135deg, var(--accent-color), var(--primary-light));
}

.quiz-nav-top-strip {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.back-to-explain-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--emerald-mint);
    color: var(--primary-dark);
    border: 1.5px solid var(--primary-color);
    padding: 8px 18px;
    border-radius: 30px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-to-explain-btn:hover {
    background: var(--primary-color);
    color: #FFFFFF;
    transform: translateY(-2px);
}

/* ==========================================================================
   صالة الألعاب التفاعلية الحركية (لوقت التحدي والمرح)
   Kinetic Interactive Games Arena: Treasure, Rocket, Bubbles, Knights
   ========================================================================== */

/* 1. Hub Wrapper & Hero */
.games-hub-wrapper {
    max-width: 960px;
    margin: 0 auto 30px auto;
}

.games-hub-hero {
    background: linear-gradient(135deg, #FFFFFF 0%, var(--emerald-mint) 60%, rgba(245, 172, 51, 0.15) 100%);
    border: 2px solid rgba(43, 147, 134, 0.3);
    border-radius: 28px;
    padding: 26px 28px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(43, 147, 134, 0.1);
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.hub-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: #FFFFFF;
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(43, 147, 134, 0.25);
}

.hub-badge-icon {
    font-size: 1.15rem;
}

.hub-hero-title {
    color: var(--primary-dark);
    font-family: 'Marhey', 'Tajawal', sans-serif;
    font-size: 1.85rem;
    margin: 6px 0 8px 0;
}

.hub-hero-sub {
    color: var(--text-dim);
    font-size: 1.1rem;
    margin: 0;
    max-width: 680px;
    margin: 0 auto;
}

/* 2. Games Cards Grid */
.games-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.game-hub-card {
    background: #FFFFFF;
    border: 2px solid #E2EAE6;
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.game-hub-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 36px rgba(43, 147, 134, 0.18);
    border-color: var(--accent-color);
}

.game-card-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.6) 50%, transparent 60%);
    transform: rotate(35deg);
    pointer-events: none;
    transition: all 0.6s ease;
    opacity: 0;
}

.game-hub-card:hover .game-card-shine {
    opacity: 1;
    transform: rotate(35deg) translateY(100%);
}

.game-card-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.game-card-emoji {
    font-size: 3rem;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.12));
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-hub-card:hover .game-card-emoji {
    transform: scale(1.22) rotate(6deg);
}

.game-card-chip {
    font-size: 0.8rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--emerald-mint);
    color: var(--primary-dark);
    border: 1px solid rgba(43, 147, 134, 0.25);
}

.game-card-name {
    color: var(--primary-dark);
    font-family: 'Marhey', 'Tajawal', sans-serif;
    font-size: 1.35rem;
    margin: 0 0 8px 0;
}

.game-card-desc {
    color: var(--text-muted);
    font-size: 0.96rem;
    line-height: 1.55;
    margin: 0 0 18px 0;
    flex: 1;
}

.game-card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    border-radius: 40px;
    font-family: 'Changa', 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    transition: all 0.25s ease;
}

.card-treasure .game-card-action {
    background: #FFF9ED;
    color: var(--accent-warm);
    border: 1.5px solid var(--accent-color);
}
.game-hub-card.card-treasure:hover .game-card-action {
    background: var(--accent-color);
    color: #FFFFFF;
}

.card-rocket .game-card-action {
    background: #E8F4F8;
    color: #0E7490;
    border: 1.5px solid #06B6D4;
}
.game-hub-card.card-rocket:hover .game-card-action {
    background: #0E7490;
    color: #FFFFFF;
}

.card-bubbles .game-card-action {
    background: #E6F7F4;
    color: var(--primary-dark);
    border: 1.5px solid var(--primary-color);
}
.game-hub-card.card-bubbles:hover .game-card-action {
    background: var(--primary-color);
    color: #FFFFFF;
}

.card-knights .game-card-action {
    background: #FFF4E5;
    color: #B45309;
    border: 1.5px solid #F59E0B;
}
.game-hub-card.card-knights:hover .game-card-action {
    background: #B45309;
    color: #FFFFFF;
}

/* Quick Play Bar */
.quick-play-bar {
    text-align: center;
    margin-top: 10px;
}

.quick-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--accent-warm), var(--accent-color));
    color: #FFFFFF;
    font-family: 'Changa', 'Tajawal', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    padding: 14px 34px;
    border-radius: 50px;
    border: 2px solid #FFF3D6;
    cursor: pointer;
    box-shadow: 0 6px 22px rgba(245, 172, 51, 0.4);
    transition: all 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quick-play-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 28px rgba(245, 172, 51, 0.55);
}

/* ==========================================================================
   Game Arena Layout & Shared Controls
   ========================================================================== */
.game-arena-wrapper {
    background: #FFFFFF;
    border: 2px solid #DFE8E4;
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    max-width: 960px;
    margin: 0 auto;
}

.game-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1.5px solid #EEF3F0;
}

.game-back-to-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #F0F5F3;
    color: var(--primary-dark);
    border: 1.5px solid #D2DFDB;
    padding: 8px 18px;
    border-radius: 30px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.game-back-to-menu-btn:hover {
    background: var(--primary-color);
    color: #FFFFFF;
    border-color: var(--primary-color);
}

.game-progress-capsule {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--emerald-mint);
    padding: 6px 16px;
    border-radius: 30px;
    border: 1.5px solid rgba(43, 147, 134, 0.2);
}

.game-title-pill {
    font-weight: 800;
    color: var(--primary-dark);
    font-size: 0.95rem;
}

.game-q-counter {
    background: #FFFFFF;
    color: var(--primary-color);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
}

.game-stars-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FFF9ED;
    border: 1.5px solid var(--accent-color);
    color: var(--accent-warm);
    padding: 6px 14px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 1.05rem;
}

.game-streak-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FFF4E5;
    border: 1.5px solid #F59E0B;
    color: #B45309;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.95rem;
}

.streak-flame {
    animation: flamePulse 0.9s infinite alternate;
}

@keyframes flamePulse {
    from { transform: scale(1); }
    to { transform: scale(1.35) rotate(-6deg); }
}

.game-question-banner {
    background: linear-gradient(135deg, #FBFDFD 0%, var(--emerald-mint) 100%);
    border: 2px solid rgba(43, 147, 134, 0.25);
    border-radius: 20px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.game-q-number-badge {
    display: inline-block;
    background: var(--primary-dark);
    color: var(--islamic-gold-light);
    font-size: 0.82rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 6px;
}

.game-q-text {
    color: var(--primary-dark);
    font-family: 'Tajawal', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.6;
    flex: 1;
}

.game-voice-btn {
    background: #FFFFFF;
    border: 2px solid var(--accent-color);
    color: var(--primary-dark);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.22s ease;
    flex-shrink: 0;
}

.game-voice-btn:hover {
    transform: scale(1.15);
    background: var(--accent-color);
    color: #FFFFFF;
}

.game-hint-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dim);
    margin: 0 0 16px 0;
    text-align: center;
}

/* ==========================================================================
   GAME 1: TREASURE CHESTS (صناديق الكنز التفاعلية)
   ========================================================================== */
.treasure-chests-arena {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.treasure-chest-card {
    background: #FFFFFF;
    border: 2px solid #E5EBE8;
    border-radius: 20px;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.treasure-chest-card:hover {
    transform: translateY(-6px) scale(1.03);
    border-color: var(--accent-color);
    box-shadow: 0 12px 28px rgba(245, 172, 51, 0.25);
    background: #FFFDF9;
}

.chest-box {
    width: 90px;
    height: 75px;
    position: relative;
    margin-bottom: 16px;
}

.chest-lid {
    width: 90px;
    height: 34px;
    background: linear-gradient(135deg, #C27803, #92400E);
    border: 3px solid #F59E0B;
    border-radius: 18px 18px 6px 6px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: top center;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.chest-base {
    width: 90px;
    height: 44px;
    background: linear-gradient(135deg, #92400E, #78350F);
    border: 3px solid #F59E0B;
    border-radius: 6px 6px 14px 14px;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 1;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.chest-lock {
    position: absolute;
    top: 26px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.chest-burst-sparkles {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    font-size: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
    white-space: nowrap;
    z-index: 10;
}

/* Open State */
.treasure-chest-card.chest-open .chest-lid {
    transform: rotateX(-65deg) translateY(-14px);
}

.treasure-chest-card.chest-open .chest-burst-sparkles {
    opacity: 1;
    transform: translateX(-50%) scale(1.4) translateY(-10px);
}

.treasure-chest-card.correct-chest {
    border-color: #10B981 !important;
    background: #ECFDF5 !important;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.4) !important;
}

.treasure-chest-card.chest-wrong {
    animation: chestShake 0.5s ease;
    border-color: #EF4444 !important;
    background: #FEF2F2 !important;
}

@keyframes chestShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px) rotate(-3deg); }
    40%, 80% { transform: translateX(8px) rotate(3deg); }
}

.chest-option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.chest-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #FFFFFF;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    flex-shrink: 0;
}

.chest-text {
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.45;
    flex: 1;
}

/* ==========================================================================
   GAME 2: ROCKET LAUNCH (صاروخ العلوم الفضائي)
   ========================================================================== */
.rocket-game-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    margin-top: 15px;
}

.rocket-silo-column {
    background: linear-gradient(to bottom, #0F172A, #1E293B);
    border: 3px solid #334155;
    border-radius: 24px;
    padding: 16px;
    position: relative;
    min-height: 380px;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.silo-sky-bg {
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.silo-checkpoints {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    position: relative;
    z-index: 2;
}

.silo-point {
    font-size: 0.8rem;
    font-weight: 800;
    color: #64748B;
    background: rgba(15, 23, 42, 0.7);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #334155;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.silo-point.active {
    color: #38BDF8;
    border-color: #38BDF8;
    background: rgba(56, 189, 248, 0.15);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.kinetic-rocket-ship {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: bottom 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 5;
    text-align: center;
}

.rocket-body-glyph {
    font-size: 2.8rem;
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.6));
    animation: rocketHover 2s infinite ease-in-out;
}

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

.rocket-fire-tail {
    font-size: 1.5rem;
    animation: thrusterFire 0.3s infinite alternate;
    margin-top: -6px;
}

@keyframes thrusterFire {
    from { transform: scale(0.9); opacity: 0.8; }
    to { transform: scale(1.3) translateY(4px); opacity: 1; }
}

.rocket-boosting {
    animation: rocketBoost 0.8s ease-in-out;
}

@keyframes rocketBoost {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.25); filter: brightness(1.4); }
    100% { transform: translateX(-50%) scale(1); }
}

.rocket-wobble {
    animation: rocketWobble 0.5s ease;
}

@keyframes rocketWobble {
    0%, 100% { transform: translateX(-50%); }
    25% { transform: translateX(-65%) rotate(-8deg); }
    75% { transform: translateX(-35%) rotate(8deg); }
}

.rocket-thruster-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.thruster-pad-card {
    background: #FFFFFF;
    border: 2px solid #E2E8F0;
    border-radius: 18px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    text-align: right;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    width: 100%;
}

.thruster-pad-card:hover {
    transform: translateX(-6px);
    border-color: #0284C7;
    background: #F0F9FF;
    box-shadow: 0 8px 22px rgba(2, 132, 199, 0.15);
}

.thruster-icon {
    font-size: 1.6rem;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #E0F2FE;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.thruster-body {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.thruster-letter {
    font-weight: 800;
    color: #0284C7;
    font-size: 1.05rem;
    background: #E0F2FE;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.thruster-text {
    font-weight: 700;
    color: #1E293B;
    font-size: 1.02rem;
    line-height: 1.5;
}

.thruster-spark {
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.thruster-pad-card:hover .thruster-spark {
    opacity: 1;
}

.thruster-pad-card.thruster-correct {
    background: #ECFDF5 !important;
    border-color: #10B981 !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.35) !important;
}

.thruster-pad-card.thruster-wrong {
    animation: chestShake 0.5s ease;
    background: #FEF2F2 !important;
    border-color: #EF4444 !important;
}

/* ==========================================================================
   GAME 3: SCIENCE BUBBLES (فقاعات العلوم السابحة)
   ========================================================================== */
.bubbles-sky-arena {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 22px;
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(230, 247, 244, 0.6), rgba(255, 255, 255, 0.9));
    border-radius: 26px;
    border: 2px dashed rgba(43, 147, 134, 0.3);
}

.science-bubble-card {
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: bubbleFloat 3.5s infinite ease-in-out;
}

@keyframes bubbleFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(2deg); }
}

.bubble-color-0 {
    background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.95), rgba(43, 147, 134, 0.25) 60%, rgba(43, 147, 134, 0.5) 100%);
    border: 2px solid rgba(43, 147, 134, 0.5);
    box-shadow: inset -8px -8px 18px rgba(43, 147, 134, 0.2), 0 8px 24px rgba(43, 147, 134, 0.15);
}

.bubble-color-1 {
    background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.95), rgba(245, 172, 51, 0.25) 60%, rgba(245, 172, 51, 0.5) 100%);
    border: 2px solid rgba(245, 172, 51, 0.5);
    box-shadow: inset -8px -8px 18px rgba(245, 172, 51, 0.2), 0 8px 24px rgba(245, 172, 51, 0.15);
}

.bubble-color-2 {
    background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.95), rgba(6, 182, 212, 0.25) 60%, rgba(6, 182, 212, 0.5) 100%);
    border: 2px solid rgba(6, 182, 212, 0.5);
    box-shadow: inset -8px -8px 18px rgba(6, 182, 212, 0.2), 0 8px 24px rgba(6, 182, 212, 0.15);
}

.bubble-color-3 {
    background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.95), rgba(16, 185, 129, 0.25) 60%, rgba(16, 185, 129, 0.5) 100%);
    border: 2px solid rgba(16, 185, 129, 0.5);
    box-shadow: inset -8px -8px 18px rgba(16, 185, 129, 0.2), 0 8px 24px rgba(16, 185, 129, 0.15);
}

.science-bubble-card:hover {
    transform: scale(1.12);
    box-shadow: inset -10px -10px 24px rgba(255, 255, 255, 0.6), 0 16px 36px rgba(43, 147, 134, 0.3);
}

.bubble-gloss {
    position: absolute;
    top: 14%;
    left: 22%;
    width: 28%;
    height: 18%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    transform: rotate(-35deg);
    filter: blur(1px);
    pointer-events: none;
}

.bubble-inner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

.bubble-letter {
    font-size: 0.9rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.85);
    color: var(--primary-dark);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bubble-text {
    font-weight: 800;
    color: var(--primary-dark);
    font-size: 0.98rem;
    line-height: 1.35;
}

.bubble-pop-splash {
    position: absolute;
    font-size: 1.8rem;
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
    transition: all 0.3s ease;
}

.science-bubble-card.bubble-burst {
    animation: bubbleBurst 0.4s forwards;
}

@keyframes bubbleBurst {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.45); opacity: 0.8; filter: blur(2px); }
    100% { transform: scale(1.8); opacity: 0; filter: blur(6px); }
}

.science-bubble-card.bubble-jelly {
    animation: jellyWobble 0.5s ease;
}

@keyframes jellyWobble {
    0%, 100% { transform: scale(1, 1); }
    30% { transform: scale(1.25, 0.75); }
    40% { transform: scale(0.75, 1.25); }
    60% { transform: scale(1.15, 0.85); }
}

/* ==========================================================================
   GAME 4: SCIENCE KNIGHTS SPEED RUN (سباق فرسان العلم)
   ========================================================================= */
.knights-banner {
    background: linear-gradient(135deg, #FFFDF8 0%, #FFF4E5 100%);
    border-color: #F59E0B;
}

.knights-emblem-badge {
    font-size: 2.2rem;
    background: #FEF3C7;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid #F59E0B;
}

.knights-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 15px;
}

.knight-choice-card {
    background: #FFFFFF;
    border: 2px solid #E2E8E4;
    border-radius: 18px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    text-align: right;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    width: 100%;
}

.knight-choice-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: #F59E0B;
    background: #FFFBEB;
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.2);
}

.knight-shield-badge {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #FEF3C7;
    color: #B45309;
    font-weight: 800;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #F59E0B;
    flex-shrink: 0;
}

.knight-choice-text {
    flex: 1;
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 1.05rem;
    line-height: 1.5;
}

.knight-choice-icon {
    font-size: 1.2rem;
    color: #F59E0B;
    opacity: 0.6;
}

.knight-choice-card.knight-correct {
    background: #ECFDF5 !important;
    border-color: #10B981 !important;
    box-shadow: 0 0 22px rgba(16, 185, 129, 0.35) !important;
}

.knight-choice-card.knight-wrong {
    animation: chestShake 0.5s ease;
    background: #FEF2F2 !important;
    border-color: #EF4444 !important;
}

/* ==========================================================================
   Inline Feedback Bubbles
   ========================================================================== */
.game-inline-feedback {
    min-height: 52px;
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.feedback-bubble {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    border-radius: 40px;
    font-size: 1.05rem;
    font-weight: 800;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.feedback-bubble.success {
    background: #ECFDF5;
    color: #065F46;
    border: 2px solid #10B981;
}

.feedback-bubble.error {
    background: #FEF2F2;
    color: #991B1B;
    border: 2px solid #EF4444;
}

.animate-pop {
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes popIn {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   VICTORY CARD (شاشة الفوز والتتويج الكبرى)
   ========================================================================== */
.game-victory-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #F4FBF9 50%, #FFF9ED 100%);
    border: 3px solid var(--accent-color);
    border-radius: 32px;
    padding: 40px 30px;
    text-align: center;
    max-width: 760px;
    margin: 20px auto;
    box-shadow: 0 16px 45px rgba(43, 147, 134, 0.18);
    position: relative;
    overflow: hidden;
}

.victory-trophy-wrap {
    width: 120px;
    height: 120px;
    margin: 0 auto 18px auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.victory-trophy-rays {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 172, 51, 0.35) 0%, transparent 70%);
    animation: trophyRaySpin 8s infinite linear;
}

@keyframes trophyRaySpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.victory-trophy-icon {
    font-size: 5rem;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 8px 18px rgba(245, 172, 51, 0.45));
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.victory-headline {
    color: var(--primary-dark);
    font-family: 'Marhey', 'Tajawal', sans-serif;
    font-size: 2rem;
    margin: 0 0 10px 0;
}

.victory-subtext {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin: 0 0 28px 0;
}

.victory-stats-row {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.v-stat-card {
    background: #FFFFFF;
    border: 2px solid #E2EAE6;
    border-radius: 20px;
    padding: 14px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 130px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.v-stat-icon {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.v-stat-num {
    font-family: 'Changa', 'Tajawal', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.v-stat-label {
    font-size: 0.82rem;
    color: var(--text-dim);
    font-weight: 700;
    margin-top: 2px;
}

.victory-actions-grid {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.v-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 50px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.v-btn-replay {
    background: linear-gradient(135deg, var(--accent-warm), var(--accent-color));
    color: #FFFFFF;
    box-shadow: 0 6px 18px rgba(245, 172, 51, 0.35);
}

.v-btn-replay:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 10px 25px rgba(245, 172, 51, 0.5);
}

.v-btn-menu {
    background: var(--primary-dark);
    color: #FFFFFF;
    box-shadow: 0 6px 18px rgba(26, 94, 86, 0.3);
}

.v-btn-menu:hover {
    transform: translateY(-3px) scale(1.04);
    background: var(--primary-color);
}

.v-btn-explain {
    background: var(--emerald-mint);
    color: var(--primary-dark);
    border: 1.5px solid var(--primary-color);
}

.v-btn-explain:hover {
    background: var(--primary-color);
    color: #FFFFFF;
    transform: translateY(-3px);
}

.v-btn-home {
    background: #F1F5F3;
    color: #475569;
}

.v-btn-home:hover {
    background: #E2E8E5;
    transform: translateY(-2px);
}

/* ==========================================================================
   Mobile Responsiveness for Games
   ========================================================================== */
@media (max-width: 680px) {
    .rocket-game-layout {
        grid-template-columns: 1fr;
    }
    .rocket-silo-column {
        min-height: 220px;
        order: 2;
    }
    .rocket-options-side {
        order: 1;
    }
    .games-cards-grid {
        grid-template-columns: 1fr;
    }
    .victory-actions-grid {
        flex-direction: column;
    }
    .v-action-btn {
        width: 100%;
        justify-content: center;
    }
    .game-top-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .game-question-banner {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   لوحة المعلمة التوضيحية والشرح التفاعلي (Teacher Interactive SVG Board)
   ========================================================================== */
.teacher-svg-board {
    background: linear-gradient(180deg, #FFFFFF 0%, #F5FBF9 100%);
    border: 2.5px solid rgba(43, 147, 134, 0.35);
    border-radius: 26px;
    padding: 24px;
    margin: 20px 0 32px 0;
    box-shadow: 0 10px 32px rgba(43, 147, 134, 0.08);
    position: relative;
    overflow: hidden;
}

.svg-board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    border-bottom: 1.5px dashed rgba(43, 147, 134, 0.3);
    padding-bottom: 14px;
}

.svg-board-badge {
    display: inline-block;
    background: var(--emerald-mint);
    color: var(--primary-dark);
    font-size: 0.88rem;
    font-weight: 800;
    padding: 4px 16px;
    border-radius: 20px;
    margin-bottom: 6px;
    border: 1px solid rgba(43, 147, 134, 0.25);
}

.svg-board-title {
    font-family: 'Marhey', 'Tajawal', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin: 2px 0 4px 0;
}

.svg-board-sub {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin: 0;
    font-weight: 600;
}

.svg-board-tools {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.svg-tool-btn {
    background: #FFFFFF;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-dark);
    border-radius: 20px;
    padding: 8px 16px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.svg-tool-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    background: #FFFDF7;
    box-shadow: 0 6px 16px rgba(245, 172, 51, 0.25);
}

.svg-canvas-container {
    width: 100%;
    border-radius: 22px;
    overflow: hidden;
    border: 2.5px solid rgba(43, 147, 134, 0.25);
    box-shadow: 0 12px 36px rgba(43, 147, 134, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    background: #FFFFFF;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    touch-action: manipulation;
    position: relative;
}

.svg-canvas-container:hover {
    border-color: var(--accent-color);
    box-shadow: 0 16px 42px rgba(245, 172, 51, 0.18);
}

.svg-canvas-container svg {
    width: 100%;
    height: auto;
    max-height: 500px;
    display: block;
    overflow: visible;
}

.svg-interactive-part {
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
    transition: opacity 0.35s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.28s ease;
    transform-origin: center center;
}

.svg-interactive-part:hover {
    filter: drop-shadow(0 6px 16px rgba(245, 172, 51, 0.95)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
    -webkit-filter: drop-shadow(0 6px 16px rgba(245, 172, 51, 0.95)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

/* 1. التظليل الذكي للرسم: تعتيم باقي أجزاء الرسم عند اختيار جزء للشرح */
.teacher-svg-board.has-active-part .svg-interactive-part:not(.active-part) {
    opacity: 0.36 !important;
    filter: grayscale(45%) !important;
    -webkit-filter: grayscale(45%) !important;
}

/* 2. تظليل وإبراز الجزء المختار النشط بألوان وتوهج ذهبي ساطع يظهر بوضوح تام على الهاتف */
.teacher-svg-board .svg-interactive-part.active-part {
    opacity: 1 !important;
    filter: drop-shadow(0 0 12px rgba(245, 172, 51, 0.98)) drop-shadow(0 0 24px rgba(43, 147, 134, 0.9)) !important;
    -webkit-filter: drop-shadow(0 0 12px rgba(245, 172, 51, 0.98)) drop-shadow(0 0 24px rgba(43, 147, 134, 0.9)) !important;
    animation: activeSvgGlowPulse 1.8s infinite ease-in-out !important;
}

@keyframes activeSvgGlowPulse {
    0%, 100% {
        transform: scale(1.0);
        filter: drop-shadow(0 0 10px rgba(245, 172, 51, 0.95)) drop-shadow(0 0 20px rgba(43, 147, 134, 0.8));
        -webkit-filter: drop-shadow(0 0 10px rgba(245, 172, 51, 0.95)) drop-shadow(0 0 20px rgba(43, 147, 134, 0.8));
    }
    50% {
        transform: scale(1.025);
        filter: drop-shadow(0 0 18px rgba(245, 172, 51, 1)) drop-shadow(0 0 32px rgba(43, 147, 134, 0.95));
        -webkit-filter: drop-shadow(0 0 18px rgba(245, 172, 51, 1)) drop-shadow(0 0 32px rgba(43, 147, 134, 0.95));
    }
}

/* إبراز مسمى الجزء المختار باللون الذهبي البراق */
.svg-interactive-part.active-part rect[rx="17"],
.svg-interactive-part.active-part rect[rx="15"],
.svg-interactive-part.active-part rect[rx="14"] {
    stroke: #D97706 !important;
    stroke-width: 3.5px !important;
    fill: #FEF3C7 !important;
}

/* إبراز الخطوط والمسارات والأشكال للجزء المختار */
.svg-interactive-part.active-part path[stroke]:not([stroke="none"]),
.svg-interactive-part.active-part line[stroke] {
    stroke: #D97706 !important;
    stroke-width: 4px !important;
}

.svg-interactive-part.active-part text {
    font-weight: 900 !important;
}

.svg-chips-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .teacher-svg-board {
        padding: 16px 12px 20px 12px !important;
        border-radius: 20px !important;
        margin: 14px 0 22px 0 !important;
    }
    .svg-board-header {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 10px !important;
        padding-bottom: 10px !important;
        margin-bottom: 12px !important;
    }
    .svg-board-title {
        font-size: 1.22rem !important;
    }
    .svg-board-sub {
        font-size: 0.88rem !important;
    }
    .svg-board-tools {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 6px !important;
        width: 100% !important;
    }
    .svg-tool-btn {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
        flex: 1 1 auto !important;
        min-width: 95px !important;
        justify-content: center !important;
    }
    .svg-canvas-container {
        padding: 6px !important;
        border-radius: 16px !important;
    }
    .svg-canvas-container svg {
        max-height: 360px !important;
    }
    .svg-chips-strip {
        gap: 6px !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        padding: 4px 2px 8px 2px !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .svg-part-chip {
        padding: 6px 12px !important;
        font-size: 0.85rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    .svg-part-drawer {
        padding: 12px 14px !important;
        margin-top: 12px !important;
    }
    .drawer-header h4 {
        font-size: 1.05rem !important;
    }
    .drawer-speak-btn {
        padding: 5px 12px !important;
        font-size: 0.82rem !important;
    }
    .svg-part-drawer p {
        font-size: 0.95rem !important;
        line-height: 1.55 !important;
    }
}

.svg-part-chip {
    background: #FFFFFF;
    border: 1.5px solid rgba(43, 147, 134, 0.3);
    color: var(--primary-dark);
    border-radius: 22px;
    padding: 7px 16px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.22s ease;
}

.svg-part-chip:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    background: #FFFDF9;
}

.svg-part-chip.active {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: #FFFFFF;
    border-color: var(--accent-color);
    box-shadow: 0 4px 14px rgba(43, 147, 134, 0.3);
}

.svg-part-drawer {
    background: linear-gradient(135deg, var(--emerald-mint), #F5FBF9);
    border: 1.5px solid rgba(43, 147, 134, 0.3);
    border-radius: 18px;
    padding: 16px 22px;
    margin-top: 16px;
    box-shadow: 0 4px 14px rgba(43, 147, 134, 0.06);
    animation: popIn 0.3s ease;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.drawer-header h4 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin: 0;
}

.drawer-speak-btn {
    background: #FFFFFF;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-dark);
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drawer-speak-btn:hover {
    background: var(--primary-color);
    color: #FFFFFF;
}

.svg-part-drawer p {
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--text-color);
    margin: 0;
    font-weight: 600;
}

/* وضع الاختبار الصفي (إخفاء المسميات) */
.hide-labels .label-text-real {
    display: none !important;
}

.hide-labels .label-text-quiz {
    display: inline !important;
    font-weight: 900;
}

.label-text-quiz {
    display: none;
}

/* نافذة تكبير اللوحة للشاشة الكاملة */
.svg-zoom-modal-content {
    max-width: 960px !important;
    width: 95% !important;
    max-height: calc(100dvh - 36px) !important;
    max-height: calc(100vh - 36px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    background: #FFFFFF;
    border-radius: 24px;
    padding: 24px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .svg-zoom-modal-content {
        padding: 16px 12px 32px 12px !important;
        border-radius: 18px !important;
        max-height: calc(100dvh - 20px) !important;
        max-height: calc(100vh - 20px) !important;
    }
}

.svg-zoom-canvas-wrap {
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
    border: 2px solid #CBD5E1;
    margin-top: 14px;
    background: #F8FAFC;
}

.svg-zoom-canvas-wrap svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================
   أزرار اختيار نمط الأبطال (ذكور) والبطلات (إناث) وشارة البروفايل
   Gender Mode Toggle & Profile Avatar Controls
   ========================================================== */
.user-profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.16);
    border: 1.8px solid rgba(245, 172, 51, 0.65);
    padding: 4px 12px 4px 6px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.user-profile-badge:hover {
    transform: scale(1.05);
    border-color: #f59e0b;
    box-shadow: 0 4px 16px rgba(245, 172, 51, 0.45);
}

.profile-avatar-img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center;
    border: 1.5px solid #fff;
    display: block;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.profile-role-label,
.profile-role-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #ffffff;
    font-family: 'Changa', 'Tajawal', sans-serif;
    letter-spacing: 0.3px;
}

.mode-toggle-group {
    display: inline-flex;
    background: rgba(17, 56, 43, 0.42);
    padding: 3px;
    border-radius: 50px;
    border: 1.5px solid rgba(255, 255, 255, 0.32);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    align-items: center;
}

.role-btn {
    border: 1.5px solid transparent;
    background: transparent;
    padding: 0.35rem 0.95rem;
    border-radius: 50px;
    font-family: 'Changa', 'Tajawal', sans-serif;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.role-mini-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center;
    border: 1px solid rgba(255, 255, 255, 0.7);
    display: inline-block;
    vertical-align: middle;
}

body:not(.theme-girls) #roleBoysBtn.active {
    background: #ffffff;
    color: #1A5E56;
    border-color: #a7f3d0;
    box-shadow: 0 3px 10px rgba(6, 95, 70, 0.25);
}

body.theme-girls #roleGirlsBtn.active {
    background: #ffffff;
    color: #be185d;
    border-color: #f472b6;
    box-shadow: 0 3px 10px rgba(190, 24, 93, 0.28);
}

/* ==========================================================
   نمط البطلات (Girls Theme) - الألوان الوردية والتوتية والذهبية الفاخرة
   ========================================================== */
body.theme-girls {
    /* إعادة تعريف متغيرات المنصة لنمط البطلات */
    --primary-color: #be185d;
    --primary-dark: #831843;
    --primary-light: #f472b6;
    --secondary-color: #db2777;
    --accent-color: #f59e0b;
    --accent-warm: #d97706;
    --islamic-gold: #f59e0b;
    --islamic-gold-light: #fef3c7;
    --gold-glow: rgba(245, 158, 11, 0.45);
    --emerald-mint: #fce7f3;
    
    --bg-color: #fff5f8;
    --surface-color: #FFFFFF;
    --text-main: #2b111f;
    --text-muted: #734358;
    --text-dim: #9d6880;
    
    --shadow-soft: 0 8px 24px rgba(190, 24, 93, 0.08);
    --shadow-hover: 0 14px 32px rgba(190, 24, 93, 0.16);

    /* خلفية متناسقة ناعمة ومريحة للعين */
    background-color: #fff5f8;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(190, 24, 93, 0.06), transparent 30%),
        radial-gradient(circle at 90% 40%, rgba(245, 172, 51, 0.07), transparent 35%),
        linear-gradient(180deg, #FFFFFF 0%, #fff0f5 100%);
}

/* الهيدر الرئيسي لنمط البطلات */
body.theme-girls .main-header.masha-premium-header {
    background: linear-gradient(135deg, #70092c 0%, #9d174d 50%, #be185d 100%) !important;
    border-bottom: 4px solid #f59e0b !important;
    box-shadow: 0 10px 28px rgba(157, 23, 77, 0.25) !important;
}

body.theme-girls .main-header.compact-pro-header,
.main-header.compact-pro-header {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1.5px solid #fbcfe8 !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 18px rgba(244, 63, 94, 0.08) !important;
    color: #1f2937 !important;
    padding: 8px 22px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    position: sticky !important;
    top: 10px !important;
    z-index: 100 !important;
    min-height: 56px !important;
    max-width: 1200px !important;
    width: calc(100% - 32px) !important;
    margin: 10px auto 1.2rem auto !important;
    box-sizing: border-box !important;
}

body.theme-girls .islamic-ayah-banner {
    background: rgba(76, 5, 25, 0.82) !important;
    border-bottom: 1.5px solid rgba(245, 172, 51, 0.5) !important;
    color: #fef3c7 !important;
}

body.theme-girls .nav-subject-tag {
    background: rgba(76, 5, 25, 0.55) !important;
    border-color: rgba(245, 158, 11, 0.6) !important;
}

body.theme-girls .nav-user-badge {
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(245, 158, 11, 0.55) !important;
}

body.theme-girls .user-profile-badge {
    border-color: #f472b6;
    background: rgba(255, 255, 255, 0.2);
}

body.theme-girls .user-profile-badge:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 16px rgba(244, 114, 182, 0.45);
}

body.theme-girls .mode-toggle-group {
    background: rgba(76, 5, 25, 0.45);
    border-color: rgba(244, 114, 182, 0.45);
}

body.theme-girls .portal-home-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #2b111f !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4) !important;
}

body.theme-girls .portal-home-btn:hover {
    background: linear-gradient(135deg, #fde68a, #f59e0b) !important;
}

/* الوحدات والدروس والبطاقات في نمط البطلات */
body.theme-girls .unit-title {
    color: #831843 !important;
    border-bottom: 3px solid #fbcfe8 !important;
}

body.theme-girls .chapter-title {
    color: #be185d !important;
}

body.theme-girls .chapter-title i {
    color: #f59e0b !important;
}

body.theme-girls .lesson-card:hover {
    border-color: #f472b6 !important;
    box-shadow: 0 14px 30px rgba(190, 24, 93, 0.16) !important;
}

body.theme-girls .lesson-icon {
    background: linear-gradient(135deg, #fdf2f8, #fce7f3) !important;
    color: #be185d !important;
    border: 1.5px solid #fbcfe8 !important;
}

body.theme-girls .lesson-card:hover .lesson-icon {
    background: linear-gradient(135deg, #be185d, #831843) !important;
    color: #ffffff !important;
    border-color: #be185d !important;
}

/* شريط الأدوات الذكية للمعلمة داخل الدرس */
body.theme-girls .classroom-tools-dock {
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: #fbcfe8 !important;
    box-shadow: 0 8px 24px rgba(190, 24, 93, 0.1) !important;
}

body.theme-girls .dock-badge {
    background: #fdf2f8 !important;
    color: #9d174d !important;
    border-color: #fbcfe8 !important;
}

body.theme-girls .dock-btn:hover {
    background: #fce7f3 !important;
    color: #831843 !important;
    border-color: #f472b6 !important;
}

body.theme-girls .dock-chip {
    background: #be185d !important;
    color: #fff !important;
}

/* شريط التبديل بين الشرح ووقت التحدي والمرح */
body.theme-girls .lesson-section-nav {
    background: #fdf2f8 !important;
    border-color: #fbcfe8 !important;
}

body.theme-girls .lesson-nav-btn.active {
    background: #ffffff !important;
    color: #be185d !important;
    border-color: #f472b6 !important;
    box-shadow: 0 4px 14px rgba(190, 24, 93, 0.18) !important;
}

body.theme-girls .finish-explanation-banner {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%) !important;
    border-color: #f472b6 !important;
}

body.theme-girls .challenge-cta-btn {
    background: linear-gradient(135deg, #be185d, #831843) !important;
}

body.theme-girls .challenge-cta-btn:hover {
    background: linear-gradient(135deg, #9d174d, #70092c) !important;
}

/* النوافذ المنبثقة للأدوات الصفية والتعزيز */
body.theme-girls .modal-content.class-tool-modal {
    border-color: #fbcfe8 !important;
    box-shadow: 0 20px 50px rgba(190, 24, 93, 0.22) !important;
}

body.theme-girls .tool-modal-badge {
    background: linear-gradient(135deg, #fce7f3, #fdf2f8) !important;
    color: #9d174d !important;
    border: 1.5px solid #f472b6 !important;
}

body.theme-girls .praise-card-btn:hover {
    border-color: #f472b6 !important;
    background: #fdf2f8 !important;
    box-shadow: 0 6px 16px rgba(190, 24, 93, 0.16) !important;
}

body.theme-girls .crown-winner-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

/* ==========================================================================
   إخفاء الهيدر الرئيسي للمنصة عند الدخول لأي درس
   بحيث يبقى فقط زر العودة للدروس والعودة للفصول
   ========================================================================== */
body.in-lesson-view .main-header,
body.in-lesson-view .masha-premium-header,
body.in-lesson-view .islamic-ayah-banner {
    display: none !important;
}

/* شريط التنقل العلوي للدرس: يحتوي فقط على زري العودة للدروس والعودة للفصول */
.lesson-top-nav-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid #E2ECE6;
    box-shadow: 0 4px 20px rgba(27, 67, 50, 0.08);
    transition: all 0.3s ease;
}

.lesson-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    border-radius: 50px;
    font-family: 'Changa', 'Tajawal', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.lesson-nav-btn i {
    font-size: 1.1rem;
    transition: transform 0.25s ease;
}

/* زر العودة للدروس (النمط الأساسي - أبطال) */
.lesson-nav-btn.btn-back-lessons {
    background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 100%);
    color: #FFFFFF;
    border-color: #52B788;
    box-shadow: 0 4px 16px rgba(45, 106, 79, 0.28);
}

.lesson-nav-btn.btn-back-lessons:hover {
    transform: translateY(-2px) scale(1.03);
    background: linear-gradient(135deg, #2D6A4F 0%, #40916C 100%);
    box-shadow: 0 8px 22px rgba(45, 106, 79, 0.38);
}

.lesson-nav-btn.btn-back-lessons:hover i {
    transform: translateX(4px);
}

/* زر العودة للفصول (النمط الأساسي - أبطال) */
.lesson-nav-btn.btn-back-chapters {
    background: #F4F9F6;
    color: #1B4332;
    border-color: #B7E4C7;
}

.lesson-nav-btn.btn-back-chapters:hover {
    transform: translateY(-2px) scale(1.03);
    background: #E8F5EE;
    color: #081C15;
    border-color: #74C69D;
    box-shadow: 0 6px 18px rgba(27, 67, 50, 0.15);
}

.lesson-nav-btn.btn-back-chapters:hover i {
    transform: scale(1.15);
}

/* نمط البنات (البطلات) */
body.theme-girls .lesson-top-nav-bar {
    border-bottom-color: #FCE7F3;
    box-shadow: 0 4px 20px rgba(190, 24, 93, 0.08);
}

body.theme-girls .lesson-nav-btn.btn-back-lessons {
    background: linear-gradient(135deg, #BE185D 0%, #DB2777 100%);
    border-color: #F472B6;
    box-shadow: 0 4px 16px rgba(190, 24, 93, 0.28);
}

body.theme-girls .lesson-nav-btn.btn-back-lessons:hover {
    background: linear-gradient(135deg, #9D174D 0%, #BE185D 100%);
    box-shadow: 0 8px 22px rgba(190, 24, 93, 0.38);
}

body.theme-girls .lesson-nav-btn.btn-back-chapters {
    background: #FDF2F8;
    color: #9D174D;
    border-color: #FBCFE8;
}

body.theme-girls .lesson-nav-btn.btn-back-chapters:hover {
    background: #FCE7F3;
    color: #831843;
    border-color: #F472B6;
    box-shadow: 0 6px 18px rgba(190, 24, 93, 0.15);
}

/* تأثير التمييز لبطاقة الدرس عند العودة لتسهيل متابعة التصفح */
@keyframes returnCardPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    }
    50% {
        transform: scale(1.04);
        box-shadow: 0 0 0 6px rgba(45, 106, 79, 0.35), 0 14px 28px rgba(45, 106, 79, 0.3);
        border-color: #2D6A4F;
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    }
}

.lesson-card.highlight-return-card {
    animation: returnCardPulse 1.5s ease-out;
}

@keyframes returnCardPulseGirls {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    }
    50% {
        transform: scale(1.04);
        box-shadow: 0 0 0 6px rgba(219, 39, 119, 0.35), 0 14px 28px rgba(219, 39, 119, 0.3);
        border-color: #DB2777;
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    }
}

body.theme-girls .lesson-card.highlight-return-card {
    animation: returnCardPulseGirls 1.5s ease-out;
}

@media (max-width: 600px) {
    .lesson-top-nav-bar {
        padding: 10px 14px;
        gap: 8px;
        justify-content: stretch;
    }
    .lesson-nav-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 12px;
        font-size: 0.92rem;
    }
}








/* ==========================================================================
   PRINCESS MALAK ROYAL FLORAL THEME OVERHAUL (منصة العلوم للأميرة مَلَك)
   ========================================================================== */

/* 1. Floating Decorations (Fixed, no content push) */
.bg-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floral-watermark {
    position: absolute;
    font-size: 5rem;
    opacity: 0.04;
    user-select: none;
}
.floral-watermark.wm-1 { top: 12%; left: 6%; }
.floral-watermark.wm-2 { top: 48%; right: 5%; }
.floral-watermark.wm-3 { bottom: 10%; left: 8%; }

.floating-petal {
    position: absolute;
    font-size: 1.4rem;
    opacity: 0.45;
    animation: royalFloatPetal 14s infinite linear;
    user-select: none;
}
.floating-petal.p-1 { left: 8%; animation-delay: 0s; animation-duration: 16s; }
.floating-petal.p-2 { left: 28%; animation-delay: 3s; animation-duration: 13s; }
.floating-petal.p-3 { left: 52%; animation-delay: 6s; animation-duration: 18s; }
.floating-petal.p-4 { left: 74%; animation-delay: 1.5s; animation-duration: 15s; }
.floating-petal.p-5 { left: 91%; animation-delay: 4.5s; animation-duration: 12s; }

@keyframes royalFloatPetal {
    0% { transform: translateY(105vh) rotate(0deg) scale(0.85); opacity: 0; }
    10% { opacity: 0.65; }
    90% { opacity: 0.65; }
    100% { transform: translateY(-10vh) rotate(360deg) scale(1.1); opacity: 0; }
}

/* 2. Compact Top Header */
.main-header.compact-pro-header {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1.5px solid #fbcfe8 !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 18px rgba(236, 72, 153, 0.08) !important;
    padding: 8px 22px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    position: sticky !important;
    top: 10px !important;
    z-index: 100 !important;
    min-height: 56px !important;
    max-width: 1200px !important;
    width: calc(100% - 32px) !important;
    margin: 10px auto 1.2rem auto !important;
    box-sizing: border-box !important;
}

.hero-profile-compact {
    display: flex;
    align-items: center;
    gap: 12px;
}

.compact-avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #fff0f5, #ffe4e6);
    border: 2px solid #fbcfe8;
    box-shadow: 0 2px 10px rgba(244, 63, 94, 0.2);
    border-radius: 50%;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.compact-avatar-wrap:hover {
    transform: scale(1.08);
}

.compact-avatar-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

.compact-crown {
    position: absolute;
    top: -9px;
    right: -4px;
    font-size: 1.15rem;
    filter: drop-shadow(0 2px 4px rgba(217, 119, 6, 0.6));
    animation: gentleCrownBob 2.4s infinite ease-in-out;
}

@keyframes gentleCrownBob {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-3px) rotate(4deg); }
}

.compact-title-wrap {
    display: flex;
    flex-direction: column;
}

.compact-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.compact-student-name {
    font-size: 1.3rem !important;
    font-weight: 900 !important;
    color: #831843 !important;
    margin: 0 !important;
    letter-spacing: -0.5px;
}

.compact-subject-badge {
    background: #fff5f8 !important;
    color: #9d174d !important;
    border: 1px solid #fbcfe8 !important;
    border-radius: 12px !important;
    padding: 2px 10px !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
}

.stat-badge-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 6px 14px !important;
    background: #ffffff !important;
    border: 1.5px solid #fbcfe8 !important;
    border-radius: 20px !important;
    color: #831843 !important;
    text-decoration: none !important;
    font-size: 0.88rem !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 6px rgba(236, 72, 153, 0.08) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.stat-badge-link:hover {
    background: #fdf2f8 !important;
    border-color: #ec4899 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.16) !important;
}

.achievements-btn {
    background: linear-gradient(135deg, #fffbeb, #fef3c7) !important;
    border: 1.5px solid #fde68a !important;
    color: #92400e !important;
}

.achievements-btn:hover {
    background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
    border-color: #f59e0b !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25) !important;
}

@media (max-width: 768px) {
    .main-header.compact-pro-header {
        padding: 6px 14px !important;
        gap: 8px !important;
    }
    .compact-student-name {
        font-size: 1.15rem !important;
    }
    .compact-subject-badge {
        font-size: 0.76rem !important;
        padding: 2px 8px !important;
    }
    .stat-badge-link {
        padding: 5px 11px !important;
        font-size: 0.82rem !important;
    }
}

@media (max-width: 600px) {
    .main-header.compact-pro-header {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        padding: 8px 10px !important;
        width: calc(100% - 16px) !important;
        margin: 6px auto 0.8rem auto !important;
    }
    .hero-profile-compact {
        width: 100% !important;
        justify-content: center !important;
        gap: 8px !important;
    }
    .compact-avatar-wrap {
        width: 38px !important;
        height: 38px !important;
    }
    .header-actions {
        width: 100% !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    .stat-badge-link {
        padding: 4px 10px !important;
        font-size: 0.78rem !important;
    }
}

/* 3. Chapter Titles with Avatars */
.chapter-title {
    display: inline-flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 8px 22px 8px 16px !important;
    border-radius: 50px !important;
    background: #ffffff !important;
    border: 1.5px solid #fbcfe8 !important;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.08) !important;
    color: #0f766e !important;
    font-size: 1.25rem !important;
    font-weight: 900 !important;
    margin-bottom: 20px !important;
}

.chapter-avatar-wrap {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fbcfe8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.2);
    background: #fff0f5;
}

.chapter-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.chapter-title:hover .chapter-avatar-img {
    transform: scale(1.15);
}

/* 4. Lesson Cards with Image Thumbnails */
.unit-section {
    margin-bottom: 45px !important;
    background: #ffffff !important;
    padding: 30px !important;
    border-radius: 28px !important;
    border: 2px solid #fbcfe8 !important;
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.06) !important;
}

.unit-title {
    font-size: 1.55rem !important;
    color: #831843 !important;
    margin-bottom: 25px !important;
    padding: 8px 22px !important;
    background: linear-gradient(135deg, #fff0f5, #fce7f3) !important;
    border-radius: 20px !important;
    border-right: 5px solid #ec4899 !important;
    border-bottom: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-weight: 900 !important;
}

.lessons-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 24px !important;
}

.royal-lesson-card {
    background: #ffffff !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 28px !important;
    padding: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.08) !important;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    cursor: pointer !important;
    text-decoration: none !important;
    position: relative !important;
    overflow: hidden !important;
}

.royal-lesson-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    border-color: #ec4899 !important;
    box-shadow: 0 16px 40px rgba(236, 72, 153, 0.22) !important;
}

.lesson-thumb-wrap {
    width: 100%;
    height: 165px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 1.5px solid #fbcfe8;
    background: linear-gradient(135deg, #fff0f5, #fce7f3);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.08);
}

.lesson-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.royal-lesson-card:hover .lesson-thumb-img {
    transform: scale(1.08);
}

.lesson-corner-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid #fbcfe8;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #db2777;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.lesson-fairy-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #fbcfe8;
    color: #9d174d;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(236, 72, 153, 0.1);
}

.lesson-card-body {
    padding: 0 4px;
}

.lesson-card-title {
    font-size: 1.25rem !important;
    font-weight: 900 !important;
    color: #831843 !important;
    margin-bottom: 6px !important;
}

.lesson-card-desc {
    color: #4b5563 !important;
    font-size: 0.92rem !important;
    line-height: 1.5 !important;
    margin: 0 !important;
}

.royal-action-btn {
    width: 100%;
    padding: 10px 18px !important;
    border-radius: 20px !important;
    font-size: 0.92rem !important;
    font-weight: 800 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.25) !important;
    transition: all 0.25s ease !important;
    margin-top: auto !important;
}

.royal-lesson-card:hover .royal-action-btn {
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%) !important;
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.4) !important;
    transform: translateY(-2px) !important;
}

/* 5. In-Lesson Top Bar */
.lesson-top-bar {
    max-width: 1100px;
    margin: 20px auto 25px auto;
    padding: 0 15px;
}

.lesson-top-bar-content {
    background: #ffffff;
    border: 2px solid #fbcfe8;
    border-radius: 24px;
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.08);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.lesson-top-bar .back-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 20px !important;
    background: #ffffff !important;
    color: #9d174d !important;
    border: 1.5px solid #fbcfe8 !important;
    border-radius: 20px !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.08) !important;
    transition: all 0.25s ease !important;
    cursor: pointer !important;
}

.lesson-top-bar .back-btn:hover {
    background: linear-gradient(135deg, #fdf2f8, #fce7f3) !important;
    border-color: #ec4899 !important;
    transform: translateY(-2px) !important;
    color: #831843 !important;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.18) !important;
}

.lesson-top-bar .lesson-info {
    text-align: center;
    flex: 1;
}

.lesson-top-bar .lesson-info .badge {
    display: inline-block;
    background: #fff5f8;
    color: #be185d;
    border: 1px solid #fbcfe8;
    padding: 3px 14px;
    border-radius: 14px;
    font-size: 0.82rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.lesson-top-bar .lesson-info h1 {
    font-size: 1.45rem;
    font-weight: 900;
    color: #831843;
    margin: 0;
}

.lesson-top-bar .stars-container {
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 800;
    color: #b45309;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
}

/* 6. Royal Modal */
.royal-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.royal-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.royal-modal-content {
    background: #ffffff;
    border: 2.5px solid #fbcfe8;
    border-radius: 32px;
    box-shadow: 0 20px 60px rgba(236, 72, 153, 0.25), 0 0 40px rgba(251, 207, 232, 0.4);
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px 24px;
    position: relative;
    box-sizing: border-box;
    animation: royalModalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes royalModalPop {
    0% { transform: scale(0.9) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.royal-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1.5px solid #fce7f3;
}

.royal-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.royal-modal-title h2 {
    font-size: 1.45rem;
    font-weight: 900;
    color: #831843;
    margin: 0;
}

.modal-crown {
    font-size: 1.6rem;
    filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.5));
}

.royal-modal-close {
    background: #fff5f8;
    border: 1.5px solid #fbcfe8;
    color: #9d174d;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.royal-modal-close:hover {
    background: #fee2e2;
    border-color: #f87171;
    color: #b91c1c;
    transform: scale(1.1);
}

.royal-stars-pill {
    background: #fff5f8 !important;
    border: 1.5px solid #fbcfe8 !important;
    padding: 10px 24px !important;
    border-radius: 50px !important;
    font-weight: 800 !important;
    color: #9d174d !important;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.08) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 1rem !important;
}

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



/* ==========================================================================
   PRINCESS MALAK ROYAL IN-LESSON HARMONY OVERRIDE
   ========================================================================== */

/* Completely hide any lingering old top nav bars or docks */
.lesson-top-nav-bar,
.classroom-tools-dock,
#classroom-tools-dock {
    display: none !important;
}

/* 1. In-Lesson Header Bar (.lesson-top-bar) */
.lesson-top-bar,
#lesson-view .lesson-top-bar {
    max-width: 1100px !important;
    margin: 20px auto 25px auto !important;
    padding: 0 15px !important;
    display: block !important;
}

.lesson-top-bar-content,
#lesson-view .lesson-top-bar-content {
    background: #ffffff !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 28px !important;
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.08) !important;
    padding: 16px 26px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
}

.lesson-top-bar .back-btn,
#lesson-view .lesson-top-bar .back-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 9px 22px !important;
    background: #ffffff !important;
    color: #9d174d !important;
    border: 1.5px solid #fbcfe8 !important;
    border-radius: 20px !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.08) !important;
    transition: all 0.25s ease !important;
    cursor: pointer !important;
}

.lesson-top-bar .back-btn:hover,
#lesson-view .lesson-top-bar .back-btn:hover {
    background: linear-gradient(135deg, #fdf2f8, #fce7f3) !important;
    border-color: #ec4899 !important;
    transform: translateY(-2px) !important;
    color: #831843 !important;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.18) !important;
}

.lesson-top-bar .lesson-info,
#lesson-view .lesson-info {
    text-align: center !important;
    flex: 1 !important;
}

.lesson-top-bar .lesson-info .badge,
#lesson-view .lesson-info .badge {
    display: inline-block !important;
    background: #fff5f8 !important;
    color: #be185d !important;
    border: 1.5px solid #fbcfe8 !important;
    padding: 4px 18px !important;
    border-radius: 20px !important;
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    margin-bottom: 6px !important;
    box-shadow: 0 2px 6px rgba(236, 72, 153, 0.08) !important;
}

.lesson-top-bar .lesson-info h1,
#lesson-view .lesson-info h1 {
    font-size: 1.55rem !important;
    font-weight: 900 !important;
    color: #831843 !important;
    margin: 0 !important;
    text-shadow: none !important;
    letter-spacing: -0.3px !important;
}

.lesson-top-bar .stars-container,
#lesson-view .stars-container {
    background: #fffbeb !important;
    border: 1.5px solid #fde68a !important;
    padding: 7px 18px !important;
    border-radius: 20px !important;
    font-weight: 800 !important;
    color: #b45309 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12) !important;
}

/* 2. In-Lesson Navigation Tabs (.lesson-section-nav) */
.lesson-section-nav,
#lesson-view .lesson-section-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    max-width: 650px !important;
    margin: 15px auto 30px auto !important;
    padding: 8px 14px !important;
    background: #ffffff !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 60px !important;
    box-shadow: 0 4px 18px rgba(236, 72, 153, 0.08) !important;
    position: static !important;
}

.lesson-nav-btn,
#lesson-view .lesson-nav-btn {
    flex: 1 !important;
    max-width: 300px !important;
    padding: 11px 22px !important;
    border-radius: 50px !important;
    border: 2px solid transparent !important;
    background: #ffffff !important;
    color: #9d174d !important;
    font-family: 'Tajawal', sans-serif !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    transition: all 0.25s ease !important;
    box-shadow: none !important;
}

.lesson-nav-btn:hover,
#lesson-view .lesson-nav-btn:hover {
    background: #fff5f8 !important;
    color: #831843 !important;
    border-color: #fbcfe8 !important;
}

.lesson-nav-btn.active#btn-section-explain,
.lesson-nav-btn.active#btn-section-quiz,
#lesson-view .lesson-nav-btn.active {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
    color: #ffffff !important;
    border: 2px solid #f472b6 !important;
    box-shadow: 0 4px 16px rgba(236, 72, 153, 0.35) !important;
    transform: scale(1.02) !important;
}

.lesson-nav-btn .nav-btn-badge,
#lesson-view .lesson-nav-btn .nav-btn-badge {
    background: #fff5f8 !important;
    color: #be185d !important;
    border: 1px solid #fbcfe8 !important;
    font-size: 0.78rem !important;
    padding: 2px 10px !important;
    border-radius: 20px !important;
    font-weight: 800 !important;
}

.lesson-nav-btn.active .nav-btn-badge,
#lesson-view .lesson-nav-btn.active .nav-btn-badge {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
}

/* 3. Section Headers & Cards inside lesson */
#lesson-view .lesson-content .section-header,
#lesson-view .exercises-section .section-header {
    background: #ffffff !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 24px !important;
    padding: 22px 28px !important;
    margin-bottom: 25px !important;
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.06) !important;
}

#lesson-view .section-header h2 {
    color: #831843 !important;
    font-size: 1.55rem !important;
    font-weight: 900 !important;
    margin-bottom: 6px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

#lesson-view .section-header p {
    color: #4b5563 !important;
    font-size: 1.05rem !important;
    margin: 0 !important;
}

#lesson-view .info-card {
    background: #ffffff !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 24px !important;
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.06) !important;
    padding: 26px !important;
    margin-bottom: 20px !important;
}

#lesson-view .info-card h3 {
    color: #831843 !important;
    font-size: 1.35rem !important;
    font-weight: 900 !important;
    margin-bottom: 12px !important;
}

#lesson-view .card-icon {
    background: #fff5f8 !important;
    border: 1.5px solid #fbcfe8 !important;
    color: #db2777 !important;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.1) !important;
}

#lesson-view .fact-box {
    background: #fffbeb !important;
    border: 1.5px solid #fde68a !important;
    border-radius: 18px !important;
    padding: 15px 20px !important;
    color: #92400e !important;
    margin-top: 16px !important;
}

/* 4. Teacher Visual SVG Board */
.teacher-svg-board,
#lesson-view .teacher-svg-board {
    background: #ffffff !important;
    border: 2.5px solid #fbcfe8 !important;
    border-radius: 30px !important;
    box-shadow: 0 12px 35px rgba(236, 72, 153, 0.08) !important;
    padding: 24px !important;
    margin-bottom: 30px !important;
}

.svg-board-badge {
    background: #fff5f8 !important;
    color: #9d174d !important;
    border: 1.5px solid #fbcfe8 !important;
    border-radius: 20px !important;
    font-weight: 800 !important;
    padding: 4px 16px !important;
}

.svg-board-title {
    color: #831843 !important;
    font-weight: 900 !important;
}

.board-tool-btn {
    background: #ffffff !important;
    border: 1.5px solid #fbcfe8 !important;
    color: #9d174d !important;
    border-radius: 20px !important;
}

.board-tool-btn:hover {
    background: #fff5f8 !important;
    border-color: #ec4899 !important;
    color: #831843 !important;
}

/* 5. Finish Explanation Banner */
.finish-explanation-banner,
#lesson-view .finish-explanation-banner {
    background: linear-gradient(135deg, #fff0f5 0%, #fce7f3 100%) !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 24px !important;
    padding: 22px 28px !important;
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.1) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    margin-top: 30px !important;
}

.finish-explanation-banner .banner-text h3 {
    color: #831843 !important;
    font-weight: 900 !important;
    font-size: 1.25rem !important;
    margin-bottom: 6px !important;
}

.finish-explanation-banner .banner-text p {
    color: #6b7280 !important;
    font-size: 0.95rem !important;
    margin: 0 !important;
}

.challenge-cta-btn,
#lesson-view .challenge-cta-btn {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 12px 26px !important;
    font-weight: 800 !important;
    font-size: 1.05rem !important;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3) !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
}

.challenge-cta-btn:hover,
#lesson-view .challenge-cta-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.45) !important;
}

.back-to-explain-btn,
#lesson-view .back-to-explain-btn {
    background: #ffffff !important;
    color: #9d174d !important;
    border: 1.5px solid #fbcfe8 !important;
    border-radius: 20px !important;
    padding: 8px 20px !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.08) !important;
}

.back-to-explain-btn:hover,
#lesson-view .back-to-explain-btn:hover {
    background: #fff5f8 !important;
    border-color: #ec4899 !important;
    color: #831843 !important;
}



/* ========================================================
   Royal Natural Female Lesson Audio Controls
   ======================================================== */
.royal-lesson-audio-bar {
    background: linear-gradient(135deg, #ffffff 0%, #fff5f8 50%, #fdf2f8 100%) !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 24px !important;
    padding: 16px 24px !important;
    margin: 15px 0 25px 0 !important;
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.1) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 16px !important;
    flex-wrap: wrap !important;
}

.royal-lesson-audio-bar .audio-bar-info {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
}

.royal-lesson-audio-bar .audio-avatar {
    font-size: 2rem !important;
    background: #ffffff !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 50% !important;
    width: 50px !important;
    height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.15) !important;
    flex-shrink: 0 !important;
}

.royal-lesson-audio-bar .audio-text-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}

.royal-lesson-audio-bar .audio-bar-title {
    font-size: 1.12rem !important;
    font-weight: 900 !important;
    color: #831843 !important;
}

.royal-lesson-audio-bar .audio-bar-desc {
    font-size: 0.9rem !important;
    color: #9d174d !important;
    font-weight: 600 !important;
}

.btn-royal-audio-play {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 11px 26px !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    font-family: 'Tajawal', sans-serif !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.35) !important;
    transition: all 0.25s ease !important;
}

.btn-royal-audio-play:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5) !important;
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
}

.btn-royal-audio-play.speaking-active {
    background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%) !important;
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.25), 0 6px 20px rgba(244, 63, 94, 0.45) !important;
    animation: pulsePlayBtn 1.5s infinite alternate !important;
}

@keyframes pulsePlayBtn {
    0% { transform: scale(1); }
    100% { transform: scale(1.03); }
}

/* Individual Card Listen Button */
.btn-card-listen {
    position: absolute !important;
    top: 16px !important;
    left: 16px !important;
    z-index: 5 !important;
    background: #ffffff !important;
    border: 1.5px solid #fbcfe8 !important;
    color: #be185d !important;
    border-radius: 20px !important;
    padding: 6px 14px !important;
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    font-family: 'Tajawal', sans-serif !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.08) !important;
    transition: all 0.2s ease !important;
}

.btn-card-listen:hover {
    background: #fff5f8 !important;
    border-color: #ec4899 !important;
    color: #831843 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.18) !important;
}

.btn-card-listen.speaking-active {
    background: #fdf2f8 !important;
    border-color: #ec4899 !important;
    color: #be185d !important;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2) !important;
}

/* Animated Sound Wave Bars */
.voice-wave-bars {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    height: 14px !important;
    margin-right: 4px !important;
}

.voice-wave-bars span {
    display: inline-block !important;
    width: 3px !important;
    height: 100% !important;
    background-color: currentColor !important;
    border-radius: 2px !important;
    animation: voiceWave 0.7s ease-in-out infinite alternate !important;
}

.voice-wave-bars span:nth-child(2) { animation-delay: 0.2s !important; }
.voice-wave-bars span:nth-child(3) { animation-delay: 0.4s !important; }

@keyframes voiceWave {
    0% { height: 4px; }
    100% { height: 14px; }
}


/* ========================================================
   Royal Chapter Cards / Buttons (أزرار الفصول الملكية)
   ======================================================== */
.chapters-grid-deck {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)) !important;
    gap: 22px !important;
    margin-top: 15px !important;
    margin-bottom: 30px !important;
}

.chapter-btn-card {
    background: #ffffff !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 26px !important;
    padding: 22px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    gap: 16px !important;
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.08) !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    position: relative !important;
    overflow: hidden !important;
}

.chapter-btn-card::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 5px !important;
    background: linear-gradient(90deg, #ec4899, #f43f5e, #fbbf24) !important;
    opacity: 0.85 !important;
}

.chapter-btn-card:hover {
    transform: translateY(-6px) scale(1.015) !important;
    border-color: #ec4899 !important;
    box-shadow: 0 14px 35px rgba(236, 72, 153, 0.22) !important;
}

.chapter-btn-top {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
}

.chapter-btn-avatar-wrap {
    position: relative !important;
    width: 70px !important;
    height: 70px !important;
    border-radius: 50% !important;
    border: 3px solid #fbcfe8 !important;
    background: #fff0f5 !important;
    padding: 3px !important;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.15) !important;
    flex-shrink: 0 !important;
    transition: transform 0.3s ease !important;
}

.chapter-btn-card:hover .chapter-btn-avatar-wrap {
    transform: scale(1.08) rotate(-3deg) !important;
    border-color: #ec4899 !important;
}

.chapter-btn-avatar-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
}

.chapter-btn-number-badge {
    position: absolute !important;
    bottom: -4px !important;
    right: -4px !important;
    background: linear-gradient(135deg, #ec4899, #be185d) !important;
    color: #ffffff !important;
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    padding: 2px 8px !important;
    border-radius: 12px !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
}

.chapter-btn-text-content {
    flex: 1 !important;
}

.chapter-btn-unit-tag {
    display: inline-block !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    color: #be185d !important;
    background: #fff5f8 !important;
    border: 1px solid #fbcfe8 !important;
    padding: 2px 10px !important;
    border-radius: 20px !important;
    margin-bottom: 6px !important;
}

.chapter-btn-main-title {
    font-size: 1.15rem !important;
    font-weight: 900 !important;
    color: #831843 !important;
    margin: 0 0 6px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.chapter-btn-main-title i {
    color: #ec4899 !important;
    font-size: 1.05rem !important;
}

.chapter-btn-summary {
    font-size: 0.88rem !important;
    color: #6b7280 !important;
    margin: 0 !important;
    line-height: 1.45 !important;
}

.chapter-btn-bottom-bar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-top: 1.5px dashed #fce7f3 !important;
    padding-top: 14px !important;
    margin-top: 4px !important;
}

.chapter-btn-count-pill {
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    color: #9d174d !important;
    background: #fdf2f8 !important;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.chapter-btn-action-label {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: #ec4899 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: transform 0.2s ease, color 0.2s ease !important;
}

.chapter-btn-card:hover .chapter-btn-action-label {
    color: #be185d !important;
    transform: translateX(-5px) !important;
}

/* ========================================================
   Active Chapter Hero Banner & Lessons Deck
   ======================================================== */
.chapter-active-hero-banner {
    background: linear-gradient(135deg, #ffffff 0%, #fff5f8 50%, #fdf2f8 100%) !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 28px !important;
    padding: 20px 28px !important;
    margin-bottom: 30px !important;
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.1) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 20px !important;
    flex-wrap: wrap !important;
}

.chapter-active-info-group {
    display: flex !important;
    align-items: center !important;
    gap: 18px !important;
}

.chapter-active-avatar {
    width: 66px !important;
    height: 66px !important;
    border-radius: 50% !important;
    border: 3px solid #fbcfe8 !important;
    padding: 2px !important;
    background: #ffffff !important;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.15) !important;
    flex-shrink: 0 !important;
}

.chapter-active-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
}

.chapter-active-text-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.chapter-active-unit-badge {
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    color: #be185d !important;
    background: #fff5f8 !important;
    border: 1px solid #fbcfe8 !important;
    padding: 2px 12px !important;
    border-radius: 20px !important;
    width: fit-content !important;
}

.chapter-active-title {
    font-size: 1.45rem !important;
    font-weight: 900 !important;
    color: #831843 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.chapter-active-title i {
    color: #ec4899 !important;
}

.royal-back-to-chapters-btn {
    background: #ffffff !important;
    border: 2px solid #fbcfe8 !important;
    color: #9d174d !important;
    border-radius: 25px !important;
    padding: 10px 24px !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    font-family: 'Tajawal', sans-serif !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.1) !important;
    transition: all 0.25s ease !important;
}

.royal-back-to-chapters-btn:hover {
    background: linear-gradient(135deg, #fdf2f8, #fce7f3) !important;
    border-color: #ec4899 !important;
    color: #831843 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.2) !important;
}


/* ========================================================
   Royal 3-Tier Navigation Styles (Units -> Chapters -> Lessons)
   ======================================================== */
.units-header-banner {
    text-align: center;
    margin: 20px auto 30px auto;
    max-width: 800px;
    padding: 0 15px;
}

.units-header-badge {
    display: inline-block;
    background: #fff5f8;
    color: #be185d;
    border: 1.5px solid #fbcfe8;
    padding: 6px 20px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(236, 72, 153, 0.08);
}

.units-header-title {
    font-size: 2rem;
    font-weight: 900;
    color: #831843;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.units-header-subtitle {
    color: #6b7280;
    font-size: 1.05rem;
    margin: 0;
    font-weight: 600;
}

.units-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
    max-width: 1240px;
    margin: 0 auto 50px auto;
    padding: 0 15px;
}

.unit-btn-card {
    position: relative;
    background: #ffffff;
    border: 2px solid #fbcfe8;
    border-radius: 28px;
    padding: 24px 26px;
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.08);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.unit-btn-card:hover {
    transform: translateY(-6px);
    border-color: #ec4899;
    box-shadow: 0 16px 36px rgba(236, 72, 153, 0.18);
}

.unit-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.unit-avatar-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff5f8, #fce7f3);
    border: 2.5px solid #fbcfe8;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.unit-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.unit-crown-badge {
    position: absolute;
    top: -8px;
    right: -4px;
    font-size: 16px;
    filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.4));
}

.unit-meta-group {
    flex: 1;
}

.unit-number-tag {
    display: inline-block;
    background: #fff5f8;
    color: #be185d;
    border: 1px solid #fbcfe8;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 20px;
    margin-bottom: 4px;
}

.unit-card-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: #831843;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.35;
}

.unit-card-title i {
    color: #ec4899;
    font-size: 1.1rem;
}

.unit-card-desc {
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 20px 0;
    flex-grow: 1;
}

.unit-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1.5px dashed #fce7f3;
    gap: 10px;
    flex-wrap: wrap;
}

.unit-stat-pill {
    font-size: 0.82rem;
    color: #9d174d;
    background: #fdf2f8;
    padding: 5px 12px;
    border-radius: 14px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.unit-action-btn {
    font-size: 0.92rem;
    font-weight: 800;
    color: #be185d;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s ease;
}

.unit-btn-card:hover .unit-action-btn {
    transform: translateX(-4px);
    color: #831843;
}

/* Active Unit Hero Banner */
.unit-active-hero-banner {
    background: linear-gradient(135deg, #ffffff 0%, #fff5f8 50%, #fdf2f8 100%);
    border: 2px solid #fbcfe8;
    border-radius: 28px;
    padding: 22px 30px;
    margin: 15px auto 30px auto;
    max-width: 1240px;
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.unit-active-info-group {
    display: flex;
    align-items: center;
    gap: 18px;
}

.unit-active-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #ffffff;
    border: 2.5px solid #fbcfe8;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.15);
    overflow: hidden;
    flex-shrink: 0;
}

.unit-active-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.unit-active-badge {
    display: inline-block;
    background: #fff5f8;
    color: #be185d;
    border: 1px solid #fbcfe8;
    padding: 3px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.unit-active-title {
    font-size: 1.55rem;
    font-weight: 900;
    color: #831843;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.unit-active-title i {
    color: #ec4899;
}

.unit-active-desc {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0;
    font-weight: 600;
}

.royal-back-to-units-btn,
.royal-back-to-chapters-btn {
    background: #ffffff !important;
    color: #9d174d !important;
    border: 1.5px solid #fbcfe8 !important;
    border-radius: 22px !important;
    padding: 10px 22px !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    font-family: 'Tajawal', sans-serif !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.08) !important;
    transition: all 0.25s ease !important;
}

.royal-back-to-units-btn:hover,
.royal-back-to-chapters-btn:hover {
    background: #fff5f8 !important;
    border-color: #ec4899 !important;
    color: #831843 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.18) !important;
}


/* ==========================================================================
   PRINCESS MALAK ROYAL GAMES ARENA THEME (صالة ألعاب الأميرة مَلَك الملكية)
   ========================================================================== */

/* 1. Hub Wrapper & Hero */
#quiz-container .games-hub-wrapper,
.games-hub-wrapper {
    max-width: 960px !important;
    margin: 0 auto 30px auto !important;
}

#quiz-container .games-hub-hero,
.games-hub-hero {
    background: linear-gradient(135deg, #ffffff 0%, #fff5f8 50%, #fdf2f8 100%) !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 28px !important;
    padding: 26px 28px !important;
    text-align: center !important;
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.1) !important;
    margin-bottom: 25px !important;
    position: relative !important;
    overflow: hidden !important;
}

#quiz-container .hub-hero-badge,
.hub-hero-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
    color: #ffffff !important;
    padding: 6px 20px !important;
    border-radius: 30px !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    margin-bottom: 12px !important;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.28) !important;
    border: 1px solid #f472b6 !important;
}

#quiz-container .hub-hero-title,
.hub-hero-title {
    color: #831843 !important;
    font-family: 'Marhey', 'Tajawal', sans-serif !important;
    font-size: 1.9rem !important;
    margin: 6px 0 10px 0 !important;
    font-weight: 900 !important;
}

#quiz-container .hub-hero-sub,
.hub-hero-sub {
    color: #6b7280 !important;
    font-size: 1.05rem !important;
    margin: 0 auto !important;
    max-width: 680px !important;
    font-weight: 600 !important;
    line-height: 1.6 !important;
}

#quiz-container .hub-hero-sub strong,
.hub-hero-sub strong {
    color: #be185d !important;
}

/* 2. Games Cards Grid */
#quiz-container .games-cards-grid,
.games-cards-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 22px !important;
    margin-bottom: 25px !important;
}

#quiz-container .game-hub-card,
.game-hub-card {
    background: #ffffff !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 26px !important;
    padding: 24px !important;
    display: flex !important;
    flex-direction: column !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    box-shadow: 0 8px 22px rgba(236, 72, 153, 0.08) !important;
}

#quiz-container .game-hub-card:hover,
.game-hub-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 18px 38px rgba(236, 72, 153, 0.22) !important;
    border-color: #ec4899 !important;
}

#quiz-container .game-card-emoji,
.game-card-emoji {
    font-size: 3.2rem !important;
    filter: drop-shadow(0 4px 12px rgba(236, 72, 153, 0.25)) !important;
}

#quiz-container .game-card-chip,
.game-card-chip {
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    padding: 4px 14px !important;
    border-radius: 20px !important;
    background: #fff5f8 !important;
    color: #be185d !important;
    border: 1.5px solid #fbcfe8 !important;
}

#quiz-container .game-card-name,
.game-card-name {
    color: #831843 !important;
    font-family: 'Marhey', 'Tajawal', sans-serif !important;
    font-size: 1.35rem !important;
    margin: 0 0 8px 0 !important;
    font-weight: 800 !important;
}

#quiz-container .game-card-desc,
.game-card-desc {
    color: #6b7280 !important;
    font-size: 0.96rem !important;
    line-height: 1.6 !important;
    margin: 0 0 18px 0 !important;
    flex: 1 !important;
}

#quiz-container .game-card-action,
.game-card-action {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 11px 20px !important;
    border-radius: 40px !important;
    font-family: 'Tajawal', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    transition: all 0.25s ease !important;
    background: #fff5f8 !important;
    color: #be185d !important;
    border: 1.5px solid #fbcfe8 !important;
}

#quiz-container .game-hub-card:hover .game-card-action,
.game-hub-card:hover .game-card-action {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
    color: #ffffff !important;
    border-color: #f472b6 !important;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.3) !important;
}

/* Quick Play Bar */
#quiz-container .quick-play-btn,
.quick-play-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 12px !important;
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
    color: #ffffff !important;
    font-family: 'Tajawal', sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    padding: 14px 34px !important;
    border-radius: 50px !important;
    border: 2px solid #fbcfe8 !important;
    cursor: pointer !important;
    box-shadow: 0 6px 22px rgba(236, 72, 153, 0.35) !important;
    transition: all 0.26s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

#quiz-container .quick-play-btn:hover,
.quick-play-btn:hover {
    transform: translateY(-3px) scale(1.03) !important;
    box-shadow: 0 10px 28px rgba(236, 72, 153, 0.5) !important;
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
}

/* 3. Game Arena Shared Layout */
#quiz-container .game-arena-wrapper,
.game-arena-wrapper {
    background: #ffffff !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 28px !important;
    padding: 24px !important;
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.08) !important;
    max-width: 960px !important;
    margin: 0 auto !important;
}

#quiz-container .game-top-bar,
.game-top-bar {
    border-bottom: 1.5px dashed #fce7f3 !important;
}

#quiz-container .game-back-to-menu-btn,
.game-back-to-menu-btn {
    background: #fff5f8 !important;
    color: #9d174d !important;
    border: 1.5px solid #fbcfe8 !important;
    border-radius: 30px !important;
    font-weight: 800 !important;
    padding: 8px 20px !important;
}

#quiz-container .game-back-to-menu-btn:hover,
.game-back-to-menu-btn:hover {
    background: #fdf2f8 !important;
    border-color: #ec4899 !important;
    color: #831843 !important;
    transform: translateY(-2px) !important;
}

#quiz-container .game-progress-capsule,
.game-progress-capsule {
    background: #fff5f8 !important;
    border: 1.5px solid #fbcfe8 !important;
    border-radius: 30px !important;
    padding: 6px 18px !important;
}

#quiz-container .game-title-pill,
.game-title-pill {
    color: #831843 !important;
    font-weight: 800 !important;
}

#quiz-container .game-q-counter,
.game-q-counter {
    background: #ffffff !important;
    color: #be185d !important;
    border: 1px solid #fbcfe8 !important;
    border-radius: 20px !important;
    font-weight: 800 !important;
}

#quiz-container .game-stars-chip,
.game-stars-chip {
    background: #fffbeb !important;
    border: 1.5px solid #fde68a !important;
    color: #b45309 !important;
    border-radius: 30px !important;
    font-weight: 800 !important;
}

#quiz-container .game-streak-pill,
.game-streak-pill {
    background: #fff0f5 !important;
    border: 1.5px solid #fbcfe8 !important;
    color: #be185d !important;
    border-radius: 30px !important;
    font-weight: 800 !important;
}

#quiz-container .game-question-banner,
.game-question-banner {
    background: linear-gradient(135deg, #ffffff 0%, #fff5f8 100%) !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 22px !important;
    box-shadow: 0 4px 16px rgba(236, 72, 153, 0.08) !important;
}

#quiz-container .game-q-number-badge,
.game-q-number-badge {
    background: #831843 !important;
    color: #fbcfe8 !important;
    font-weight: 800 !important;
    border-radius: 14px !important;
}

#quiz-container .game-q-text,
.game-q-text {
    color: #831843 !important;
    font-weight: 800 !important;
}

#quiz-container .game-voice-btn,
.game-voice-btn {
    background: #ffffff !important;
    border: 2px solid #fbcfe8 !important;
    color: #be185d !important;
}

#quiz-container .game-voice-btn:hover,
.game-voice-btn:hover {
    background: #fff5f8 !important;
    border-color: #ec4899 !important;
    color: #831843 !important;
    transform: scale(1.1) !important;
}

/* 4. Game 1: Royal Jewelry Chests */
#quiz-container .treasure-chest-card,
.treasure-chest-card {
    background: #ffffff !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 22px !important;
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.08) !important;
}

#quiz-container .treasure-chest-card:hover,
.treasure-chest-card:hover {
    border-color: #ec4899 !important;
    background: #fff5f8 !important;
    transform: translateY(-6px) scale(1.03) !important;
    box-shadow: 0 12px 28px rgba(236, 72, 153, 0.22) !important;
}

#quiz-container .chest-lid,
.chest-lid {
    background: linear-gradient(135deg, #f472b6, #ec4899) !important;
    border: 2.5px solid #fbcfe8 !important;
    border-radius: 18px 18px 6px 6px !important;
}

#quiz-container .chest-base,
.chest-base {
    background: linear-gradient(135deg, #db2777, #be185d) !important;
    border: 2.5px solid #fbcfe8 !important;
}

#quiz-container .chest-option-label,
.chest-option-label {
    color: #831843 !important;
    font-weight: 800 !important;
}

#quiz-container .chest-letter,
.chest-letter {
    background: #fff5f8 !important;
    border: 1.5px solid #fbcfe8 !important;
    color: #be185d !important;
}

/* 5. Game 2: Royal Rocket Thruster Cards */
#quiz-container .thruster-pad-card,
.thruster-pad-card {
    background: #ffffff !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 20px !important;
    color: #831843 !important;
}

#quiz-container .thruster-pad-card:hover,
.thruster-pad-card:hover {
    background: #fff5f8 !important;
    border-color: #ec4899 !important;
    transform: translateX(-4px) !important;
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.18) !important;
}

#quiz-container .thruster-letter,
.thruster-letter {
    background: #fff5f8 !important;
    border: 1.5px solid #fbcfe8 !important;
    color: #be185d !important;
}

#quiz-container .thruster-pad-card.thruster-correct,
.thruster-pad-card.thruster-correct {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
    border-color: #f472b6 !important;
    color: #ffffff !important;
}

#quiz-container .thruster-pad-card.thruster-correct .thruster-letter,
.thruster-pad-card.thruster-correct .thruster-letter {
    background: #ffffff !important;
    color: #be185d !important;
}

/* 6. Game 3: Science Blossom Bubbles */
#quiz-container .science-bubble-card,
.science-bubble-card {
    background: radial-gradient(circle at 35% 35%, #ffffff 0%, #fce7f3 45%, #fbcfe8 75%, #f472b6 100%) !important;
    border: 2px solid rgba(244, 114, 182, 0.6) !important;
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.2), inset 0 2px 6px rgba(255, 255, 255, 0.8) !important;
    color: #831843 !important;
    font-weight: 800 !important;
}

#quiz-container .bubble-letter,
.bubble-letter {
    background: #ffffff !important;
    color: #be185d !important;
    border: 1.5px solid #fbcfe8 !important;
}

/* 7. Game 4: Royal Crown Speed Cards */
#quiz-container .knight-choice-card,
.knight-choice-card {
    background: #ffffff !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 20px !important;
    color: #831843 !important;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.08) !important;
}

#quiz-container .knight-choice-card:hover,
.knight-choice-card:hover {
    background: #fff5f8 !important;
    border-color: #ec4899 !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 22px rgba(236, 72, 153, 0.2) !important;
}

#quiz-container .knight-shield-badge,
.knight-shield-badge {
    background: #fff5f8 !important;
    border: 1.5px solid #fbcfe8 !important;
    color: #be185d !important;
}

#quiz-container .knight-choice-card.knight-correct,
.knight-choice-card.knight-correct {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
    border-color: #f472b6 !important;
    color: #ffffff !important;
}

#quiz-container .knight-choice-card.knight-correct .knight-shield-badge,
.knight-choice-card.knight-correct .knight-shield-badge {
    background: #ffffff !important;
    color: #be185d !important;
}

/* 8. Game Victory Royal Crowning Card */
#quiz-container .game-victory-card,
.game-victory-card {
    background: linear-gradient(135deg, #ffffff 0%, #fff5f8 50%, #fdf2f8 100%) !important;
    border: 3px solid #fbcfe8 !important;
    border-radius: 32px !important;
    padding: 38px 30px !important;
    box-shadow: 0 16px 45px rgba(236, 72, 153, 0.16) !important;
    text-align: center !important;
}

#quiz-container .victory-trophy-icon,
.victory-trophy-icon {
    font-size: 4.5rem !important;
    filter: drop-shadow(0 6px 18px rgba(245, 158, 11, 0.4)) !important;
}

#quiz-container .victory-headline,
.victory-headline {
    color: #831843 !important;
    font-family: 'Marhey', 'Tajawal', sans-serif !important;
    font-size: 2rem !important;
    font-weight: 900 !important;
    margin: 16px 0 8px 0 !important;
}

#quiz-container .victory-subtext,
.victory-subtext {
    color: #6b7280 !important;
    font-size: 1.15rem !important;
    font-weight: 600 !important;
}

#quiz-container .v-stat-card,
.v-stat-card {
    background: #ffffff !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 20px !important;
    padding: 16px 20px !important;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.08) !important;
}

#quiz-container .v-stat-num,
.v-stat-num {
    color: #831843 !important;
    font-size: 1.8rem !important;
    font-weight: 900 !important;
}

#quiz-container .v-stat-label,
.v-stat-label {
    color: #9d174d !important;
    font-weight: 700 !important;
}

#quiz-container .v-btn-replay,
.v-btn-replay {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
    color: #ffffff !important;
    border: 2px solid #f472b6 !important;
    border-radius: 25px !important;
}

#quiz-container .v-btn-menu,
.v-btn-menu {
    background: #ffffff !important;
    color: #be185d !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 25px !important;
}

#quiz-container .v-btn-explain,
.v-btn-explain {
    background: #fff5f8 !important;
    color: #831843 !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 25px !important;
}

#quiz-container .v-btn-home,
.v-btn-home {
    background: #ffffff !important;
    color: #9d174d !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 25px !important;
}

#quiz-container .v-action-btn:hover,
.v-action-btn:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 22px rgba(236, 72, 153, 0.25) !important;
}
