:root {
    --bg-color: #E1F5FE; /* Light sky blue background */
    --primary: #2196F3; /* Royal Blue */
    --primary-dark: #1976D2;
    --secondary: #FFCA28; /* Sunshine Yellow */
    --secondary-dark: #FFB300;
    --accent: #FF5252; /* Coral */
    --accent-dark: #D32F2F;
    --success: #66BB6A; /* Vibrant Green */
    --text: #424242; /* Dark text for readability on white */
    --white: #ffffff;
    --shadow: 0 8px 30px rgba(33, 150, 243, 0.3); 
    --border-dark: 2px solid rgba(33, 150, 243, 0.4);
}

body {
    margin: 0;
    font-family: 'Baloo Bhaijaan 2', sans-serif;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 24px;
    line-height: 1.8;
}

/* خلفية التطبيق النظيفة */
.magical-forest-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2;
    background: var(--bg-color);
    transition: background 1s ease;
}
.bg-forest { background: linear-gradient(to bottom, #A5D6A7, #81C784, #4CAF50) !important; }
.bg-ocean { background: linear-gradient(to bottom, #81D4FA, #29B6F6, #03A9F4) !important; }
.bg-sky { background: linear-gradient(to bottom, #B3E5FC, #81D4FA, #4FC3F7) !important; }
.firefly { display: none; }

/* نص متوهج تفاعلي وتفاعل حسي */
.glowing-text {
    animation: goldGlow 0.8s ease-in-out infinite alternate !important;
    color: #FFCA28 !important;
}
@keyframes goldGlow {
    from { text-shadow: 0 0 10px #FFD54F, 0 0 20px #FFD54F; transform: scale(1.1); }
    to { text-shadow: 0 0 20px #FFC107, 0 0 30px #FFB300; transform: scale(1.25); }
}

.pop-on-click {
    animation: popGrow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}
@keyframes popGrow {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) rotate(5deg); }
    100% { transform: scale(1); }
}

/* إدارة الشاشات */
.view { display: none; animation: slideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.view.active-view { display: block; }
@keyframes slideIn { from{ opacity: 0; transform: scale(0.9) translateY(30px); } to{ opacity: 1; transform: scale(1) translateY(0); } }

/* ===== HEADER ===== */
.app-header {
    text-align: center;
    padding: 2rem 1rem 1rem;
    color: var(--primary);
}
.app-header h1 { font-size: 3.2rem; margin: 0; letter-spacing: 1px; text-shadow: 0 4px 10px rgba(142,68,173,0.2); }
.app-header p { font-size: 1.4rem; font-weight: bold; color: var(--rose); margin-top: 0.5rem; }

/* ===== LESSONS GRID ===== */
.lessons-path {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    display: block; 
}
.user-stats {
    background: white;
    padding: 10px 22px;
    border-radius: 30px;
    box-shadow: var(--shadow);
    display: inline-block;
    margin-bottom: 10px;
    border: var(--border-dark);
}

.stars-badge {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-dark);
    display: flex;
    align-items: center;
    gap: 5px;
    text-shadow: 1px 1px 0px #2f3542;
}

/* زر مستكشف الأحرف (Explorer Letters Button) */
.explorer-letters-btn {
    background: var(--primary);
    color: var(--white);
    padding: 15px 40px;
    font-size: 2.2rem;
    border-radius: 50px; /* Rounded pill shape */
    border: 6px solid var(--secondary);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2), inset 0 -5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.2);
    font-family: inherit;
    font-weight: 800;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-top: 20px;
}
.explorer-letters-btn:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 25px rgba(0,0,0,0.3), inset 0 -5px 15px rgba(0,0,0,0.1);
    background: var(--success);
    border-color: var(--white);
}

/* تخطيط خريطة الاستكشاف (Exploration Map Layout) */
.map-container {
    background: 
        radial-gradient(circle at 15% 25%, #a5d6a7 0%, transparent 50%),
        radial-gradient(circle at 85% 65%, #a5d6a7 0%, transparent 50%),
        radial-gradient(circle at 40% 85%, #c8e6c9 0%, transparent 70%),
        #81c784; /* لون التضاريس العشبية */
    background-size: 100% 1200px;
    border-radius: 30px;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.15), 0 15px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    margin: 0 auto;
    max-width: 1200px;
    border: 8px solid #558b2f; /* إطار الغابة */
}

#base-camp, #treasure-chest {
    text-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.branch-wrapper {
    position: absolute;
    width: 180px;
    height: 180px;
    transform: translate(-50%, 0); /* Center horizontally based on left % */
    z-index: 10;
}

/* ===== LESSON CARD (COMPASS STYLE) ===== */
.lesson-node {
    margin-top: 0;
    transform-origin: center center;
    animation: none;
    background: var(--white);
    border-radius: 50%;
    padding: 0;
    color: var(--text);
    border: 6px dashed var(--secondary);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1), inset 0 0 15px rgba(255, 202, 40, 0.2);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    text-align: center;
    width: 180px;
    height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 15px;
    z-index: 2;
}
.lesson-node:hover {
    transform: scale(1.1) rotate(5deg);
    border-style: solid;
}
.lesson-node.completed {
    border-color: var(--success);
    background: #e8f5e9;
}
.lesson-num { font-size: 1.1rem; color: #555; font-weight: bold; margin-bottom: 5px; }
.lesson-name { font-size: 1.6rem; color: #2c3e50; font-weight: 800; margin-bottom: auto; }
.lesson-emoji { font-size: 3.5rem; margin-bottom: 10px; }

.rainbow-play-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #ff4757, #ffa502, #2ed573, #1e90ff, #9b59b6, #ff4757);
    border: 4px solid white;
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    margin-top: auto;
}
.rainbow-play-btn:hover {
    transform: scale(1.1) rotate(10deg);
}

@keyframes gentleSwing {
    0% { transform: rotate(-6deg); }
    100% { transform: rotate(6deg); }
}

.lesson-node:hover {
    animation-play-state: paused;
    transform: scale(1.05) rotate(0deg);
    box-shadow: inset 15px 0 20px rgba(0,0,0,0.05), -12px 12px 0 rgba(10, 20, 30, 0.9), 0 0 40px rgba(46, 204, 113, 0.8); /* stronger magical glow */
}

.lesson-node.completed {
    background: #e8f8f5;
}
.lesson-node.completed::after {
    content: '✅';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 1.8rem;
    background: white;
    border-radius: 50%;
    border: 2px solid #2ecc71;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* الدرس الداخلي - الكتاب المفتوح */
#lesson-view { max-width: 950px; margin: 2rem auto; background: transparent; padding: 0; border: none; box-shadow: none; }
.lesson-header-top { display: flex; justify-content: flex-start; align-items: center; margin-bottom: 10px; padding: 0 20px; }
.back-btn { background: #8bc34a; color: white; border: none; padding: 10px 20px; border-radius: 20px; font-size: 1.2rem; cursor: pointer; font-family: inherit; font-weight: bold; margin: 0; box-shadow: 0 4px 10px rgba(139, 195, 74, 0.4); transition: 0.2s; }
.back-btn:active { transform: translateY(4px); box-shadow: none; }
.lesson-title { text-align: center; font-size: 3.5rem; color: #fff; margin-top: 0; text-shadow: 0 4px 15px rgba(255,255,255,0.4); font-weight: 900; }

/* أدوات المستكشف (Explorer Tools) بدلاً من الشجرة */
.lesson-tabs { 
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px; 
    max-width: 800px;
    margin: 0 auto 30px; 
    position: relative; 
    z-index: 10; 
}

/* الأزرار على شكل ألواح خشبية */
.tab-btn { 
    background: linear-gradient(to bottom, #8D6E63, #5D4037);
    border: 3px solid #3E2723;
    border-radius: 10px; 
    padding: 12px 25px; 
    font-size: 1.2rem; 
    font-weight: bold; 
    cursor: pointer; 
    color: #FFECB3; 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    box-shadow: 0 6px 0 #3E2723, 0 8px 15px rgba(0,0,0,0.4); 
    font-family: inherit; 
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 2;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
    min-width: 150px;
}
.tab-btn:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 #3E2723, 0 2px 5px rgba(0,0,0,0.4);
}
.tab-btn.active, .tab-btn:hover {
    background: linear-gradient(to bottom, #FFCA28, #FFA000);
    border-color: #FF6F00;
    color: #3E2723;
    box-shadow: 0 6px 0 #FF6F00, 0 8px 15px rgba(0,0,0,0.4);
    text-shadow: none;
    transform: scale(1.05);
}
.tab-btn.active:active, .tab-btn:active:hover {
    transform: scale(1.05) translateY(6px);
    box-shadow: 0 0 0 #FF6F00, 0 2px 5px rgba(0,0,0,0.4);
}

/* المسامير على الألواح الخشبية */
.tab-btn::before, .tab-btn::after {
    content: '';
    position: absolute;
    width: 6px; height: 6px;
    background: #3E2723;
    border-radius: 50%;
    box-shadow: inset 1px 1px 2px rgba(255,255,255,0.2);
}
.tab-btn::before { left: 8px; top: 50%; transform: translateY(-50%); }
.tab-btn::after { right: 8px; top: 50%; transform: translateY(-50%); }

/* صفحات الكتاب */
.tab-content { display: none; text-align: center; padding: 3rem 2rem; background: var(--white); border-radius: 40px; min-height: 450px; border: 5px solid var(--primary); box-shadow: 0 10px 30px rgba(0,0,0,0.1); position: relative; z-index: 5; }
.tab-content.active-tab { display: block; animation: fadeIn 0.4s; }
.instruction-text { font-size: 1.5rem; color: #fff; margin-bottom: 25px; font-weight: bold; background: var(--primary); display: inline-block; padding: 10px 30px; border-radius: 20px; border: none; box-shadow: 0 4px 10px rgba(3,169,244,0.4); }

/* قسم الاستماع */
.listen-zone { display: flex; flex-direction: column; align-items: center; gap: 30px; }
.big-letter { font-size: 8rem; font-weight: bold; color: #4e342e; background: #fff8e1; width: 200px; height: 200px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 20px rgba(139,69,19,0.2), 0 10px 20px rgba(0,0,0,0.3); cursor: pointer; border: 5px solid #8d6e63; }
.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.05) rotate(3deg); } 100% { transform: scale(1) rotate(0deg); } }

/* أزرار تفاعلية */
.action-btn { background: var(--secondary); color: var(--text); border: none; padding: 15px 35px; border-radius: 50px; font-size: 1.5rem; font-weight: bold; cursor: pointer; font-family: inherit; transition: all 0.2s; box-shadow: 0 5px 15px rgba(255, 202, 40, 0.6); }
.action-btn:active { transform: translateY(4px); box-shadow: none; }
.bouncy:hover { animation: bouncy 0.5s; }
@keyframes bouncy { 0%, 100%{ transform: translateY(0); } 50%{ transform: translateY(-10px) rotate(-5deg); } }

/* قسم الحركات (قطع خشبية سحرية) */
.harakat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; padding: 10px; }
.haraka-card { background: linear-gradient(135deg, #8d6e63, #5d4037); border: 3px solid #3e2723; border-radius: 15px; padding: 15px; text-align: center; cursor: pointer; transition: all 0.2s; box-shadow: 0 6px 0 #3e2723, 0 10px 15px rgba(0,0,0,0.3); color: white; }
.haraka-card:hover { transform: scale(1.05) translateY(-3px); box-shadow: 0 6px 0 #3e2723, 0 15px 25px rgba(46, 204, 113, 0.4); }
.haraka-display { font-size: 4rem; font-weight: bold; color: #fff; line-height: 1.2; text-shadow: 2px 2px 0 rgba(0,0,0,0.5); }
.haraka-name { font-size: 1.2rem; color: #fdf6e3; margin-top: 5px; font-weight: bold; }

/* قسم المد */
.mad-machine { display: flex; justify-content: center; gap: 15px; align-items: flex-start; flex-wrap: wrap; padding: 10px; }
.mad-block { background: linear-gradient(135deg, #8bc34a, #558b2f); border: 3px solid #33691e; border-radius: 15px; padding: 20px 15px; width: 160px; text-align: center; cursor: pointer; transition: 0.2s; box-shadow: 0 6px 0 #33691e, 0 10px 15px rgba(0,0,0,0.3); }
.mad-block:hover { transform: scale(1.05) translateY(-3px); box-shadow: 0 6px 0 #33691e, 0 15px 25px rgba(255, 235, 59, 0.5); }
.mad-label { font-size: 1.1rem; color: #fff; margin-bottom: 8px; font-weight: bold; text-shadow: 1px 1px 0 rgba(0,0,0,0.3); }
.mad-letters { font-size: 4rem; color: #fff; display: block; margin-bottom: 10px; text-shadow: 2px 2px 0px rgba(0,0,0,0.5); }
.mad-block:hover .mad-letters { color: white; }
.mad-block button { display: block; margin: 10px auto 0; font-family: inherit; font-size: 1.1rem; padding: 8px 18px; background: #fff; color: #33691e; border-radius: 10px; border: none; font-weight: bold; cursor: pointer; }

/* تبويبات الكتابة الداخلية */
.draw-sub-tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 15px; }
.draw-sub-btn { background: white; border: var(--border-dark); color: var(--text); padding: 8px 22px; border-radius: 20px; font-size: 1.2rem; font-weight: bold; cursor: pointer; font-family: inherit; transition: all 0.1s; box-shadow: 3px 4px 0px #2f3542; }
.draw-sub-btn.active, .draw-sub-btn:hover { background: var(--primary); color: white; transform: translateY(-3px); box-shadow: 4px 6px 0px #2f3542; }
.draw-hint { font-size: 1.2rem; color: #888; margin: 5px 0 12px; font-style: italic; }

/* لوحة الكتابة (السبورة الخشبية) */
.drawing-zone { display: block; width: 100%; position: relative; background: #5d4037; padding: 15px; border-radius: 15px; box-shadow: 0 10px 20px rgba(0,0,0,0.4); border: 4px solid #3e2723; }
canvas { background: #f4f1ea; border: 3px solid #8d6e63; border-radius: 5px; cursor: crosshair; box-shadow: inset 0 0 15px rgba(0,0,0,0.1); display: block; width: 100%; }
.tools { margin-top: 15px; display: flex; justify-content: center; gap: 15px; }

/* اللعبة (كلمات ورونية) */
.game-zone { min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.syllable-draggable { background: linear-gradient(135deg, #8e44ad, #5e3370); color: white; padding: 20px 30px; border-radius: 10px; font-size: 3rem; font-weight: bold; box-shadow: 0 8px 0 #3e1f4f, 0 15px 20px rgba(0,0,0,0.3); cursor: pointer; transition: all 0.1s; min-width: 100px; text-align: center; border: 2px solid #3e1f4f; text-shadow: 2px 2px 0 rgba(0,0,0,0.4); }
.syllable-draggable:hover { transform: translateY(-5px); box-shadow: 0 8px 0 #3e1f4f, 0 20px 30px rgba(142, 68, 173, 0.6); }
.syllable-draggable:active { transform: translateY(8px); box-shadow: 0 0 0 transparent; }
.wrong-shake { animation: shake 0.5s; background: #e74c3c !important; border-color: #c0392b !important; box-shadow: 0 8px 0 #c0392b !important; }
.game-result { font-size: 3.5rem; margin-top: 20px; color: #f1c40f; text-shadow: 2px 2px 0px #3e2723, 4px 4px 10px rgba(0,0,0,0.5); text-align: center; line-height: 1.4; background: rgba(62, 39, 35, 0.8); padding: 20px; border-radius: 20px; border: 3px solid #f1c40f; transform: rotate(-2deg); box-shadow: 0 10px 25px rgba(0,0,0,0.5); }

/* أين الحرف (البطاقات على شكل أوراق شجر) */
.find-zone { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 30px; }
.find-card { background: linear-gradient(135deg, #f39c12, #d35400); border: 3px solid #8e44ad; border-radius: 15px 30px 15px 30px; padding: 22px 15px; text-align: center; cursor: pointer; transition: 0.2s; width: 150px; font-size: 1.8rem; box-shadow: 0 6px 0 #8e44ad, 0 10px 20px rgba(0,0,0,0.3); color: white; font-weight: bold; }
.find-card:hover { transform: translateY(-10px) rotate(-3deg); box-shadow: 0 6px 0 #8e44ad, 0 15px 30px rgba(241, 196, 15, 0.6); }
.find-card.correct { background: linear-gradient(135deg, #2ecc71, #27ae60); border-color: #1e8449; color: white; animation: pulse 0.5s; pointer-events: none; box-shadow: 0 0 30px rgba(46, 204, 113, 0.8), 0 5px 0 #1e8449; }
.find-card .emoji { font-size: 4rem; display: block; margin-bottom: 15px; text-shadow: 2px 2px 5px rgba(0,0,0,0.3); }

/* نجمة طائرة */
.flying-star {
    position: fixed;
    font-size: 3rem;
    z-index: 9999;
    pointer-events: none;
    animation: flystar 1s ease-out forwards;
}
@keyframes flystar {
    0%   { transform: translate(-50%, -50%) scale(0.5) rotate(0deg); opacity: 1; }
    60%  { transform: translate(-50%, -140%) scale(1.4) rotate(180deg); opacity: 1; }
    100% { transform: translate(-50%, -260%) scale(0.8) rotate(360deg); opacity: 0; }
}

@keyframes fadeIn { from{ opacity:0; } to{ opacity:1; } }
@keyframes shake { 0%,100%{ transform: translateX(0); } 25%{ transform: translateX(-10px) rotate(-5deg); } 75%{ transform: translateX(10px) rotate(5deg); } }

/* صندوق تسجيل الدخول */
.login-box {
    background: white;
    max-width: 400px;
    margin: 3rem auto;
    padding: 2.5rem;
    border-radius: 25px;
    box-shadow: var(--shadow);
    text-align: center;
    border: var(--border-dark);
    position: relative;
    z-index: 10;
}
.login-box input {
    width: 80%;
    padding: 15px;
    margin-bottom: 20px;
    border: var(--border-dark);
    border-radius: 12px;
    font-size: 1.5rem;
    font-family: inherit;
    text-align: center;
    color: var(--text);
    transition: 0.3s;
}
.login-box input:focus {
    border-color: var(--secondary);
    outline: none;
    transform: scale(1.05) rotate(1deg);
}

/* تنسيق النص الكامل للدرس التفاعلي */
.lesson-full-text {
    direction: rtl;
    line-height: 2.2;
    font-size: 32px;
    color: var(--text);
    background: var(--white);
    border-radius: 15px;
    border: 3px solid var(--primary);
    padding: 35px;
    margin: 25px auto;
    max-width: 800px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.lesson-line {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.word-clickable {
    cursor: pointer;
    padding: 2px 12px;
    border-radius: 15px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
    color: #3e2723; /* Dark brown text */
    font-weight: 800;
    border: 3px solid transparent;
}

.word-clickable:hover {
    background: #8e44ad; /* Magical purple */
    color: #ffffff; /* White text on purple */
    transform: scale(1.15) translateY(-3px) rotate(-3deg);
    border: 3px solid #5e3370;
}

.word-clickable.speaking {
    background: var(--rose) !important;
    color: white !important;
    transform: scale(1.22) translateY(-5px) rotate(3deg);
    box-shadow: 4px 6px 0px #2f3542;
    border: var(--border-dark) !important;
}

/* التجاوب مع جميع أحجام الشاشات */
@media screen and (max-width: 768px) {
    .app-header h1 { font-size: 2.2rem; }
    .app-header p { font-size: 1.2rem; }
    
    .lessons-path {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0 10px;
    }

    .lesson-node {
        width: 140px;
        height: 140px;
        padding: 10px;
        font-size: 1rem;
    }
    
    #lesson-view {
        margin: 1rem;
        padding: 1rem;
        border-radius: 20px;
    }

    .lesson-title { font-size: 2rem; }

    .lesson-tabs { max-width: 100%; padding: 10px 0 40px; }
    
    .tab-btn {
        padding: 8px 10px;
        font-size: 0.95rem;
    }
    .tab-btn .speaker-icon {
        font-size: 1rem;
        padding: 2px 5px;
    }

    .tab-content { padding: 1rem; min-height: auto; }
    
    .lesson-full-text {
        font-size: 2.2rem;
        padding: 20px;
        line-height: 2;
    }
    
    .big-letter {
        width: 150px;
        height: 150px;
        font-size: 6rem;
    }

    .haraka-display { font-size: 3rem; }
    .haraka-card { padding: 10px; }
    
    .mad-block { width: 120px; padding: 15px 10px; }
    .mad-letters { font-size: 3rem; }

    .action-btn { padding: 10px 25px; font-size: 1.2rem; border-radius: 20px; }

    .game-result { font-size: 2.2rem; }
    .syllable-draggable { padding: 10px 15px; font-size: 1.8rem; }
    
    .login-box {
        margin: 2rem 1rem;
        padding: 1.5rem;
    }
    
    .login-box input {
        width: 100%;
        box-sizing: border-box;
        padding: 12px;
        font-size: 1.2rem;
    }
    
    .draw-sub-btn {
        padding: 8px 15px;
        font-size: 1rem;
    }
}

@media screen and (max-width: 480px) {
    .app-header h1 { font-size: 1.8rem; }
    .tab-btn { flex: 1 1 100%; }
    .big-letter { width: 120px; height: 120px; font-size: 5rem; }
    .harakat-grid { grid-template-columns: repeat(2, 1fr); }
    .lesson-tabs { gap: 10px 5px; }
    .lesson-full-text { font-size: 1.8rem; padding: 15px; line-height: 1.8; }
}

/* التبويب 7: المصحح الصوتي */
.mic-btn {
    background: var(--primary);
    color: white;
    font-size: 4rem;
    border: none;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(255, 71, 87, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
}
.mic-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 25px rgba(255, 71, 87, 0.5);
}
.mic-btn:active {
    transform: translateY(5px) scale(0.95);
    box-shadow: 0 5px 10px rgba(255, 71, 87, 0.4);
}
.mic-btn.listening {
    background: var(--success, #2ecc71);
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    animation: micPulse 1.5s infinite;
}
@keyframes micPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 30px rgba(46, 204, 113, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* تبويب الإملاء */
@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    80% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
.dictation-answer {
    text-align: center;
    background: var(--bg-color);
    padding: 10px;
    border-radius: 15px;
    border: 2px dashed var(--primary);
}

/* مستكشف الأحرف */
.letter-form-card {
    background: #fff;
    border: 3px solid var(--secondary);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    width: 100%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}
.letter-form-card:hover {
    transform: translateY(-5px);
}
.letter-form-card .form-title {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 15px;
    font-weight: bold;
}
.letter-form-card .form-char {
    font-size: 5rem;
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 15px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.letter-btn {
    background: var(--white);
    border: 4px solid var(--secondary);
    border-radius: 50% 40% 50% 40% / 40% 50% 40% 50%;
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--primary);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1), inset 0 -5px 10px rgba(0,0,0,0.05);
    z-index: 2;
}

.letter-btn:nth-child(even) {
    border-color: var(--success);
    border-radius: 40% 50% 40% 50% / 50% 40% 50% 40%;
}

.letter-btn:nth-child(3n) {
    border-color: var(--primary);
    border-radius: 45% 55% 45% 55% / 55% 45% 55% 45%;
}

.letter-btn:hover {
    transform: scale(1.15) rotate(5deg);
    background: var(--secondary);
    color: var(--white);
    border-color: var(--white);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2), inset 0 -5px 10px rgba(0,0,0,0.1);
}

.letter-btn:nth-child(even):hover {
    background: var(--success);
}

.letter-btn:nth-child(3n):hover {
    background: var(--primary);
}


/* شريط التقدم */
.progress-container {
    width: 100%;
    max-width: 600px;
    background-color: #E0E0E0;
    border-radius: 20px;
    margin: 15px auto;
    height: 25px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}
.progress-bar {
    height: 100%;
    background-color: var(--success);
    width: 0%;
    border-radius: 20px;
    transition: width 0.5s ease-in-out;
    background-image: linear-gradient(45deg, rgba(255,255,255,0.2) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.2) 75%, transparent 75%, transparent);
    background-size: 30px 30px;
    animation: moveStripes 1s linear infinite;
}
@keyframes moveStripes {
    0% { background-position: 0 0; }
    100% { background-position: 30px 0; }
}

/* المستكشف الصغير (المرشد) */
.little-explorer-mascot {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 80px;
    height: 80px;
    background: white;
    border: 3px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
    z-index: 10000;
    transition: top 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}
.mascot-bubble {
    position: absolute;
    bottom: 90px;
    left: 0;
    background: white;
    padding: 15px 20px;
    border-radius: 20px 20px 20px 0;
    border: 2px solid var(--primary);
    font-size: 1.2rem;
    color: var(--text);
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    pointer-events: none;
}
.mascot-bubble.show {
    opacity: 1;
    transform: scale(1);
}
@keyframes floatMascot {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
