:root {
    --bg-color: #fdf2f8;
    --primary: #ec4899;
    --primary-dark: #be185d;
    --secondary: #c084fc;
    --secondary-dark: #9333ea;
    --accent: #f472b6;
    --accent-dark: #db2777;
    --success: #10b981;
    --text: #2e1065;
    --white: #ffffff;
    --shadow: 0 8px 30px rgba(236, 72, 153, 0.15); 
    --border-dark: 2px solid rgba(236, 72, 153, 0.3);
}

body {
    margin: 0;
    font-family: 'Baloo Bhaijaan 2', 'Tajawal', sans-serif;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 26px; /* Increased font size for better readability of diacritics */
    line-height: 1.8;
}

/* خلفية التطبيق - عالم كورومي الوردي */
.racing-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2;
    background: radial-gradient(circle at 10% 20%, #fdf2f8 0%, #fce7f3 45%, #f3e8ff 100%);
}

.racing-header {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0.35rem 1.2rem;
    border-bottom: 1px solid rgba(236, 72, 153, 0.18);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    position: relative;
    z-index: 50;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.25s ease;
}

.racing-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 1050px;
    margin: 0 auto;
    box-sizing: border-box;
}

.racing-header .header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.racing-header .header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 20%;
    border: 1.5px solid #f472b6;
    box-shadow: 0 1px 4px rgba(236, 72, 153, 0.2);
    flex-shrink: 0;
}

.racing-header .header-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.racing-header .student-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #be185d;
    white-space: nowrap;
}

.racing-header .subject-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #db2777;
    background: #fdf2f8;
    border: 1px solid #fbcfe8;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.racing-header .header-nav-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.racing-header .header-nav-btn {
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}

.racing-header .header-nav-btn.home-btn {
    background: #fdf2f8;
    color: #be185d;
    border-color: #fbcfe8;
}

.racing-header .header-nav-btn.home-btn:hover {
    background: #fce7f3;
    transform: translateY(-1px);
}

.racing-header .header-nav-btn.game-btn {
    background: linear-gradient(135deg, #a855f7, #9333ea);
    color: white;
    box-shadow: 0 2px 6px rgba(168, 85, 247, 0.25);
}

.racing-header .header-nav-btn.game-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(168, 85, 247, 0.35);
}

@media screen and (max-width: 480px) {
    .racing-header {
        padding: 0.25rem 0.6rem !important;
    }
    .racing-header .student-name {
        font-size: 0.95rem !important;
    }
    .racing-header .subject-badge {
        font-size: 0.7rem !important;
        padding: 1px 6px !important;
    }
    .racing-header .header-nav-btn {
        padding: 4px 8px !important;
        font-size: 0.78rem !important;
    }
    .racing-header .header-avatar {
        width: 32px !important;
        height: 32px !important;
    }
}

/* نص متوهج تفاعلي وتفاعل حسي */
.glowing-text {
    animation: goldGlow 0.8s ease-in-out infinite alternate !important;
    color: #db2777 !important;
}
@keyframes goldGlow {
    from { text-shadow: 0 0 10px #f472b6, 0 0 20px #f472b6; transform: scale(1.1); }
    to { text-shadow: 0 0 20px #ec4899, 0 0 30px #db2777; 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); }
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    20% { opacity: 0.8; }
    100% { transform: translateY(-200px) scale(1.5); opacity: 0; }
}

/* إدارة الشاشات */
.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(236, 72, 153, 0.2); color: #be185d; }
.app-header p { font-size: 1.4rem; font-weight: bold; color: var(--accent); 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 #fbcfe8;
}

/* زر مستكشف الأحرف (تصميم كورومي الوردي) */
.explorer-letters-btn {
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: #FFF;
    border: 4px solid #fbcfe8;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.4), 0 4px 0 #be185d;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
/* إزالة الأشرطة الحمراء */
.explorer-letters-btn::before, .explorer-letters-btn::after {
    display: none;
}

.explorer-letters-btn:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 25px rgba(236, 72, 153, 0.5);
    color: #ffffff;
}

/* تخطيط خريطة الاستكشاف - عالم كورومي الوردي */
.map-container {
    background: rgba(255, 255, 255, 0.95);
    background-size: 100% 1200px;
    border-radius: 40px;
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.15);
    overflow: hidden;
    margin: 0 auto;
    max-width: 1200px;
    border: 6px solid #f472b6;
}

#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 (CAR SVG WRAPPER) ===== */
.lesson-node {
    margin-top: 0;
    transform-origin: center center;
    background: transparent;
    border-radius: 0;
    padding: 0;
    color: #FFF;
    border: none;
    box-shadow: none;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    text-align: center;
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.lesson-node.cloud-style, .lesson-node.scale-style {
    border-radius: 0;
    background: transparent;
    border-color: transparent;
}

.lesson-node:hover {
    transform: scale(1.15) !important;
}

.lesson-node.completed {
    /* No CSS change needed here, handled by SVG car color in app.js */
}

/* استجابة حجم النوافذ للشاشات الصغيرة */
@media (max-width: 650px) {
    .lesson-node {
        width: 160px;
    }
    .lesson-node .lesson-name {
        font-size: 1rem !important;
    }
}

@media (max-width: 880px) {
    .racing-header {
        padding: 12px 14px !important;
    }
    .racing-header-container {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 12px !important;
    }
    .header-right {
        width: 100% !important;
        justify-content: center !important;
        gap: 10px !important;
    }
    .header-center {
        width: 100% !important;
    }
    .header-title-box {
        justify-content: center !important;
    }
    .main-platform-title {
        font-size: clamp(1.2rem, 4.8vw, 1.7rem) !important;
        text-align: center !important;
    }
    .header-left {
        width: 100% !important;
        justify-content: center !important;
    }
    .header-home-btn {
        width: auto !important;
        max-width: 90% !important;
        font-size: 1rem !important;
        padding: 7px 18px !important;
    }
    .lesson-header-top {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 12px !important;
        padding: 12px 14px !important;
    }
    .lesson-header-top > div {
        justify-content: center !important;
        width: 100% !important;
    }
    .lesson-header-top .lesson-title {
        font-size: clamp(1.3rem, 5vw, 2rem) !important;
        text-align: center !important;
    }
    .lesson-header-top div[style*="width: 100px"],
    .lesson-header-top div[style*="width:100px"] {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .header-right .user-profile-icon {
        width: 48px !important;
        height: 48px !important;
    }
    .header-kuromi-badge {
        width: 38px !important;
        height: 38px !important;
    }
    .user-name {
        font-size: 1.15rem !important;
    }
    .mini-speaker, .title-speaker {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.95rem !important;
    }
    .main-platform-title {
        font-size: 1.3rem !important;
    }
}

.lesson-num { font-size: 1.1rem; color: #FFF !important; font-weight: bold; margin-bottom: 2px; }
.lesson-name { font-size: 1.5rem; color: #FFCA28 !important; font-weight: 900; margin-bottom: 5px; text-shadow: 1px 1px 3px rgba(0,0,0,0.8) !important; }
.lesson-emoji { font-size: 3rem; margin-bottom: 0; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2)); }

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

/* ===== RACE TRACK UNITS MENU ===== */
.race-unit-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    z-index: 5;
    transform: translateX(-50%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.race-unit-node:hover {
    transform: translateX(-50%) scale(1.15) !important;
    z-index: 10;
}

.race-unit-node .car-svg {
    filter: drop-shadow(0 8px 10px rgba(0,0,0,0.4));
    margin-bottom: 5px;
}

.unit-label-card {
    background: #222;
    border: 3px solid #FFCA28;
    border-radius: 12px;
    padding: 10px 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    min-width: 140px;
    position: relative;
}

.unit-label-card::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px 10px;
    border-style: solid;
    border-color: transparent transparent #FFCA28 transparent;
}

.unit-label-card .label-title {
    font-size: 1rem;
    color: #FFF;
    margin-bottom: 5px;
    opacity: 0.8;
}

.unit-label-card .label-subtitle {
    font-size: 1.4rem;
    color: #FFCA28;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

.mini-speaker {
    position: absolute;
    bottom: -15px;
    right: -15px;
    font-size: 1.5rem;
    background: #FFF;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFCA28;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* ===== RACE TRACK UNITS MENU ===== */
.race-unit-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    z-index: 5;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.race-unit-node:hover {
    transform: translateX(-50%) scale(1.15) !important;
    z-index: 10;
}

.race-unit-node .car-svg {
    filter: drop-shadow(0 8px 10px rgba(0,0,0,0.4));
    margin-bottom: 5px;
}

.unit-label-card {
    background: #222;
    border: 3px solid #FFCA28;
    border-radius: 12px;
    padding: 10px 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    min-width: 140px;
    position: relative;
}

.unit-label-card .label-title {
    color: #FFCA28;
    font-size: 1.2rem;
    font-weight: 900;
    margin-bottom: 2px;
}

.unit-label-card .label-subtitle {
    color: #FFF;
    font-size: 1.1rem;
    font-weight: bold;
}

.unit-label-card .mini-speaker {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
}

.unit-label-card .mini-speaker:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    #units-race-track {
        min-height: 1000px !important;
    }
    #units-race-track > svg:first-of-type {
        height: 1000px !important;
    }
    .race-unit-node {
        transform: scale(0.85);
    }
}


/* الدرس الداخلي - الكتاب المفتوح */
#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: #333; color: white !important; border: 3px solid #FFCA28; padding: 10px 20px; border-radius: 30px; font-size: 1.2rem; cursor: pointer; font-family: inherit; font-weight: bold; margin: 0; box-shadow: 0 6px 0 #FF8F00, 0 8px 15px rgba(0,0,0,0.3); transition: 0.2s; text-decoration: none; display: inline-block; text-align: center; }
.back-btn:active { transform: translateY(6px); box-shadow: 0 0 0 #FF8F00; }
.lesson-title { text-align: center; font-size: 3.5rem; color: #fff; margin-top: 0; text-shadow: 0 4px 15px rgba(0,0,0,0.8); 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: #424242;
    border: 3px solid #FFCA28; 
    border-radius: 15px; 
    padding: 10px 20px; 
    font-size: 1.2rem; 
    font-weight: bold; 
    cursor: pointer; 
    color: #FFF; 
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    box-shadow: 0 4px 0 #FF8F00, 0 6px 10px rgba(0,0,0,0.3); 
    font-family: inherit; 
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 2;
    min-width: 150px;
}
.tab-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #FF8F00, 0 2px 5px rgba(0,0,0,0.2);
}
.tab-btn.active, .tab-btn:hover {
    background: #FFCA28;
    border-color: #FF8F00;
    color: #333;
    box-shadow: 0 4px 0 #F57F17, 0 6px 15px rgba(0,0,0,0.3);
    text-shadow: none;
    transform: scale(1.05);
}
.tab-btn.active:active, .tab-btn:active:hover {
    transform: scale(1.05) translateY(4px);
    box-shadow: 0 0 0 #F57F17, 0 2px 5px rgba(0,0,0,0.2);
}

/* المسامير على الألواح الخشبية تم إزالتها للثيم السحري */
.tab-btn::before, .tab-btn::after {
    display: none;
}

/* صفحات الكتاب (لوحة المحتوى الإسفلتية/الجراج) */
.tab-content { display: none; text-align: center; padding: 3rem 2rem; background: #F5F5F5; border-radius: 20px; min-height: 450px; border: 8px solid #333; box-shadow: inset 0 0 20px rgba(0,0,0,0.1), 0 10px 30px rgba(0,0,0,0.3); 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: #333; display: inline-block; padding: 10px 30px; border-radius: 20px; border: 2px solid #FFCA28; box-shadow: 0 4px 10px rgba(0,0,0,0.4); }

/* قسم الاستماع */
.listen-zone { display: flex; flex-direction: column; align-items: center; gap: 30px; }
.big-letter { font-size: 8rem; font-weight: bold; color: #333; background: #FFF; width: 200px; height: 200px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 20px rgba(0,0,0,0.1), 0 10px 20px rgba(0,0,0,0.3); cursor: pointer; border: 6px solid #FFCA28; }
.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: #FFCA28; 
    color: #333; 
    border: 3px solid #333; 
    padding: 12px 40px; 
    border-radius: 30px; 
    font-size: 1.5rem; 
    font-weight: 900; 
    cursor: pointer; 
    font-family: inherit; 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    box-shadow: 0 5px 15px rgba(129,212,250,0.5), inset 0 0 10px rgba(255,255,255,0.8); 
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.action-btn::before, .action-btn::after {
    display: none;
}

.action-btn:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 15px 25px rgba(129,212,250,0.6), inset 0 0 20px rgba(255,255,255,1); 
    border-color: #FFCA28; 
}

.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, #E1BEE7, #CE93D8); border: 4px solid #FFFFFF; border-radius: 20px; padding: 15px; text-align: center; cursor: pointer; transition: all 0.2s; box-shadow: 0 6px 0 #BA68C8, 0 10px 15px rgba(225,190,231,0.5); color: #311B92; }
.haraka-card:hover { transform: scale(1.05) translateY(-3px); box-shadow: 0 6px 0 #BA68C8, 0 15px 25px rgba(225,190,231,0.8); }
.haraka-display { font-size: 4rem; font-weight: bold; color: #311B92; line-height: 1.2; text-shadow: none; }
.haraka-name { font-size: 1.2rem; color: #4A148C; 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, #81D4FA, #4FC3F7); border: 4px solid #FFFFFF; border-radius: 20px; padding: 20px 15px; width: 160px; text-align: center; cursor: pointer; transition: 0.2s; box-shadow: 0 6px 0 #0288D1, 0 10px 15px rgba(129,212,250,0.4); }
.mad-block:hover { transform: scale(1.05) translateY(-3px); box-shadow: 0 6px 0 #0288D1, 0 15px 25px rgba(129,212,250,0.6); }
.mad-label { font-size: 1.1rem; color: #fff; margin-bottom: 8px; font-weight: bold; text-shadow: 1px 1px 0 rgba(0,0,0,0.1); }
.mad-letters { font-size: 4rem; color: #fff; display: block; margin-bottom: 10px; text-shadow: 2px 2px 0px rgba(0,0,0,0.2); }
.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: #0288D1; border-radius: 10px; border: none; font-weight: bold; cursor: pointer; }

/* تأثيرات إضافية لقسم التهيئة */
.speaking-highlight {
    background-color: #ffeaa7;
    border-radius: 10px;
    padding: 0 10px;
    box-shadow: 0 4px 10px rgba(253, 203, 110, 0.5);
    transition: all 0.3s ease;
    transform: scale(1.05);
    display: inline-block;
}

.chant-part {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}
.chant-part:hover {
    background-color: #f1f2f6;
    border-radius: 10px;
}
.draw-sub-tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 15px; }
.draw-sub-btn { background: white; border: 3px solid #81D4FA; color: var(--text); padding: 8px 22px; border-radius: 20px; font-size: 1.2rem; font-weight: bold; cursor: pointer; font-family: inherit; transition: all 0.2s; box-shadow: 0 4px 10px rgba(129,212,250,0.3); }
.draw-sub-btn.active, .draw-sub-btn:hover { background: var(--primary); color: var(--text); transform: translateY(-3px); box-shadow: 0 8px 15px rgba(129,212,250,0.5); }
.draw-hint { font-size: 1.2rem; color: #888; margin: 5px 0 12px; font-style: italic; }

/* لوحة الكتابة (السبورة الخشبية) */
.drawing-zone { display: block; width: 100%; position: relative; background: linear-gradient(135deg, #F8BBD0, #F48FB1); padding: 15px; border-radius: 20px; box-shadow: 0 10px 20px rgba(248,187,208,0.4); border: 6px solid #FFFFFF; }
canvas { background: #FFFFFF; border: 4px solid #F8BBD0; border-radius: 15px; cursor: crosshair; box-shadow: inset 0 0 15px rgba(248,187,208,0.3); 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, #E1BEE7, #CE93D8); color: #311B92; padding: 20px 30px; border-radius: 20px; font-size: 3rem; font-weight: bold; box-shadow: 0 8px 0 #BA68C8, 0 15px 20px rgba(225,190,231,0.3); cursor: pointer; transition: all 0.1s; min-width: 100px; text-align: center; border: 4px solid #FFFFFF; text-shadow: none; }
.syllable-draggable:hover { transform: translateY(-5px); box-shadow: 0 8px 0 #BA68C8, 0 20px 30px rgba(225,190,231,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, #FCE4EC, #F8BBD0); border: 4px solid #FFFFFF; border-radius: 20px; padding: 22px 15px; text-align: center; cursor: pointer; transition: 0.2s; width: 150px; font-size: 1.8rem; box-shadow: 0 6px 0 #F06292, 0 10px 20px rgba(248,187,208,0.3); color: #311B92; font-weight: bold; text-shadow: none; }
.find-card:hover { transform: translateY(-10px) rotate(-3deg); box-shadow: 0 6px 0 #F06292, 0 15px 30px rgba(248,187,208,0.6); }
.find-card.correct { background: linear-gradient(135deg, #81D4FA, #4FC3F7); border-color: #FFFFFF; color: #311B92; animation: pulse 0.5s; pointer-events: none; box-shadow: 0 0 30px rgba(129,212,250,0.8), 0 5px 0 #0288D1; }
.find-card .emoji { font-size: 4rem; display: block; margin-bottom: 15px; text-shadow: none; }

/* نجمة طائرة */
.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: #311B92 !important; /* لون أرجواني داكن صارم للتباين */
    background: #ffffff !important;
    border-radius: 15px;
    border: 3px solid #E0F7FA !important;
    padding: 35px;
    margin: 25px auto;
    max-width: 800px;
    text-align: center;
    box-shadow: none !important;
    background-image: none !important;
}

.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: #FFCA28 !important; /* لون أصفر فاقع للتظليل */
    color: #333 !important; /* نص داكن ليكون واضحاً جداً */
    transform: scale(1.22) translateY(-5px) rotate(3deg);
    box-shadow: 4px 6px 0px #333;
    border: 3px solid #FF8F00 !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: 4px solid #333;
    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: #333;
    text-shadow: 2px 2px 0px #FFCA28;
    font-weight: bold;
    margin-bottom: 15px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.letter-btn {
    background: #333; /* لون الإطار المطاطي الداكن */
    border: 5px solid #FFCA28; /* الحافة الصفراء الرياضية */
    border-radius: 50%;
    font-size: 3.5rem;
    font-weight: 900;
    color: #FFF !important; /* نص أبيض ساطع */
    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 6px 15px rgba(0,0,0,0.4), 
        inset 0 0 15px rgba(0,0,0,0.8); /* عمق الإطار */
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

/* إلغاء الأشكال العشوائية السابقة لجعلها كلها إطارات سيارات دائرية */
.letter-btn:nth-child(even), .letter-btn:nth-child(3n) {
    border-radius: 50%;
}

.letter-btn:hover {
    transform: scale(1.15) translateY(-8px);
    background: #FFCA28; /* يضيء باللون الأصفر عند الوقوف عليه */
    color: #333 !important;
    border-color: #333;
    box-shadow: 0 10px 20px rgba(255, 202, 40, 0.5), inset 0 0 10px rgba(255,255,255,0.5);
    text-shadow: none;
}

.letter-btn:nth-child(even):hover, .letter-btn:nth-child(3n):hover {
    background: #FFCA28;
}


/* شريط التقدم */
.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); }
}

.speaking {
    background-color: #f39c12 !important;
    color: white !important;
}

.glowing-text {
    text-shadow: 0 0 10px #f1c40f, 0 0 20px #f1c40f;
    transform: scale(1.1);
    transition: all 0.2s;
}

.pop-on-click {
    animation: pop 0.3s ease-out;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1.1); }
}



/* ==========================================================================
   KUROMI UNITS & LESSONS GRID SYSTEM (صفوف وأعمدة لكورومي)
   ========================================================================== */

/* شبكة الوحدات الدراسية الرئيسية */
.kuromi-units-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)) !important;
    gap: 30px !important;
    width: 100% !important;
    direction: rtl !important;
    padding: 10px 0 30px !important;
}

/* بطاقة الوحدة الدراسية لكورومي */
.kuromi-unit-card {
    background: linear-gradient(150deg, #ffffff 0%, #fff0f7 100%) !important;
    border: 3.5px solid #f472b6 !important;
    border-radius: 30px !important;
    padding: 24px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.16) !important;
    cursor: pointer !important;
    position: relative !important;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    overflow: hidden !important;
}

.kuromi-unit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #ec4899, #a855f7, #ec4899);
    border-radius: 30px 30px 0 0;
}

.kuromi-unit-card:hover {
    transform: translateY(-8px) scale(1.025) !important;
    border-color: #ec4899 !important;
    box-shadow: 0 18px 38px rgba(236, 72, 153, 0.32) !important;
}

.unit-card-badge {
    background: linear-gradient(135deg, #ec4899, #c084fc);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    padding: 5px 16px;
    border-radius: 20px;
    box-shadow: 0 3px 8px rgba(236, 72, 153, 0.3);
    border: 1.5px solid #ffffff;
    letter-spacing: 0.5px;
}

.unit-kuromi-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: #ffffff;
    border: 4px solid #f472b6;
    margin: 16px auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.22);
    transition: transform 0.3s ease;
}

.kuromi-unit-card:hover .unit-kuromi-avatar {
    transform: scale(1.08) rotate(4deg);
    border-color: #ec4899;
}

.unit-kuromi-avatar img {
    width: 82px;
    height: 82px;
    object-fit: contain;
}

.unit-number-tag {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #ec4899, #9333ea);
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.1rem;
    border: 2.5px solid #ffffff;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.unit-card-content {
    flex-grow: 1;
    margin-bottom: 15px;
}

.unit-title {
    font-size: 1.85rem !important;
    font-weight: 900 !important;
    color: #be185d !important;
    margin: 4px 0 6px !important;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.8);
}

.unit-desc {
    font-size: 1.05rem !important;
    color: #64748b !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.unit-card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.unit-enter-btn {
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: #ffffff;
    border: 2px solid #ffffff;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(236, 72, 153, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.unit-enter-btn:hover {
    background: linear-gradient(135deg, #db2777, #be185d);
    transform: scale(1.05);
}

.unit-speaker-btn {
    background: #ffffff;
    border: 2.5px solid #f472b6;
    color: #ec4899;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
}

.unit-speaker-btn:hover {
    background: #fdf2f8;
    transform: scale(1.1);
    border-color: #ec4899;
}

/* --------------------------------------------------------------------------
   شبكة وأزرار الدروس داخل الوحدات
   -------------------------------------------------------------------------- */
.unit-lessons-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 25px !important;
    padding: 15px 0 30px !important;
    direction: rtl !important;
    width: 100% !important;
}

.kuromi-lesson-card {
    background: linear-gradient(145deg, #ffffff 0%, #fff1f7 100%) !important;
    border: 3px solid #f472b6 !important;
    border-radius: 26px !important;
    padding: 20px 16px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    box-shadow: 0 8px 22px rgba(236, 72, 153, 0.16) !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    position: relative !important;
}

.kuromi-lesson-card:hover {
    transform: translateY(-8px) scale(1.03) !important;
    border-color: #ec4899 !important;
    box-shadow: 0 16px 32px rgba(236, 72, 153, 0.32) !important;
}

.lesson-kuromi-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 12px;
    width: 100%;
}

.lesson-char-circle {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    font-weight: 900;
    box-shadow: 0 6px 15px rgba(236, 72, 153, 0.3);
    border: 3px solid #ffffff;
    line-height: 1;
}

.lesson-kuromi-sticker {
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
    transition: transform 0.3s ease;
}

.kuromi-lesson-card:hover .lesson-kuromi-sticker {
    transform: scale(1.12) rotate(6deg);
}

.lesson-card-details {
    flex-grow: 1;
    margin-bottom: 14px;
}

.lesson-title-text {
    font-size: 1.5rem !important;
    font-weight: 900 !important;
    color: #be185d !important;
    margin: 0 0 4px !important;
}

.lesson-sub-text {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 600;
}

.lesson-card-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.lesson-play-pill {
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: #ffffff;
    padding: 7px 20px;
    border-radius: 20px;
    font-size: 1.05rem;
    font-weight: 800;
    box-shadow: 0 3px 10px rgba(236, 72, 153, 0.3);
    border: 1.5px solid #ffffff;
}

.lesson-speaker-mini {
    background: #ffffff;
    border: 2px solid #f472b6;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.2s;
}

.lesson-speaker-mini:hover {
    background: #fdf2f8;
    transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   تحديث الرؤوس والأزرار العامة لكورومي
   -------------------------------------------------------------------------- */
.lesson-header-top {
    background: linear-gradient(135deg, #ec4899, #9333ea) !important;
    padding: 16px 24px !important;
    border-radius: 25px !important;
    border: 3px solid #fbcfe8 !important;
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.3) !important;
    margin-bottom: 25px !important;
}

.back-btn {
    background: linear-gradient(135deg, #f472b6, #db2777) !important;
    color: white !important;
    border: 2px solid #ffffff !important;
    border-radius: 30px !important;
    box-shadow: 0 4px 12px rgba(219, 39, 119, 0.3) !important;
}

.letter-btn {
    background: linear-gradient(135deg, #fce7f3, #fbcfe8) !important;
    border: 4px solid #f472b6 !important;
    color: #be185d !important;
    text-shadow: none !important;
    box-shadow: 0 6px 15px rgba(236, 72, 153, 0.2) !important;
}

.letter-btn:hover {
    background: linear-gradient(135deg, #ec4899, #db2777) !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(236, 72, 153, 0.4) !important;
}

.tab-btn {
    background: #ffffff !important;
    border: 2.5px solid #f472b6 !important;
    color: #be185d !important;
    font-weight: 800 !important;
    border-radius: 20px !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06) !important;
}

.tab-btn.active {
    background: linear-gradient(135deg, #ec4899, #9333ea) !important;
    color: white !important;
    border-color: #fbcfe8 !important;
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.35) !important;
}

@media (max-width: 600px) {
    .kuromi-units-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    .unit-lessons-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}



/* ==========================================================================
   SEAMLESS MASCOT & 3D TACTILE BUTTONS UPGRADE
   ========================================================================== */

/* أزرار الانطلاق ثلاثية الأبعاد */
.kuromi-3d-btn:hover {
    transform: translateY(-4px) scale(1.03) !important;
    box-shadow: 0 12px 25px rgba(236, 72, 153, 0.45) !important;
}

.kuromi-3d-btn:active {
    transform: translateY(4px) scale(0.98) !important;
    border-bottom-width: 3px !important;
    box-shadow: 0 4px 10px rgba(236, 72, 153, 0.3) !important;
}

/* بطاقة/زر الوحدة كزر تفاعلي كامل ومجسم */
.kuromi-unit-card {
    border-bottom: 9px solid #db2777 !important;
    box-shadow: 0 10px 0 #be185d, 0 15px 30px rgba(236, 72, 153, 0.25) !important;
}

.kuromi-unit-card:hover {
    transform: translateY(-8px) scale(1.025) !important;
    box-shadow: 0 16px 0 #be185d, 0 22px 35px rgba(236, 72, 153, 0.35) !important;
    border-color: #ec4899 !important;
}

.kuromi-unit-card:active {
    transform: translateY(5px) scale(0.98) !important;
    border-bottom-width: 4px !important;
    box-shadow: 0 4px 0 #be185d, 0 8px 15px rgba(236, 72, 153, 0.2) !important;
}

/* بطاقات أزرار الدروس كأزرار متكاملة 3D */
.kuromi-lesson-card {
    border-bottom: 8px solid #db2777 !important;
    box-shadow: 0 8px 0 #be185d, 0 12px 25px rgba(236, 72, 153, 0.2) !important;
    padding: 18px 16px !important;
}

.kuromi-lesson-card:hover {
    transform: translateY(-7px) scale(1.03) !important;
    box-shadow: 0 14px 0 #be185d, 0 20px 30px rgba(236, 72, 153, 0.32) !important;
    border-color: #ec4899 !important;
}

.kuromi-lesson-card:active {
    transform: translateY(4px) scale(0.98) !important;
    border-bottom-width: 3px !important;
    box-shadow: 0 3px 0 #be185d, 0 6px 12px rgba(236, 72, 153, 0.2) !important;
}

/* تكامل مظهر ملصق الحرف وكورومي معاً */
.lesson-kuromi-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(253, 242, 248, 0.7);
    padding: 10px 14px;
    border-radius: 24px;
    border: 2px dashed #fbcfe8;
    margin-bottom: 12px;
}

.lesson-char-circle {
    box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important;
}



/* ==========================================================================
   🎮 3D ARCADE BUTTONS FOR READING - أزرار القراءة المجسمة ثلاثية الأبعاد
   دمج حقيقي واحترافي لشخصية كورومي داخل هيكل الزر كعنصر مجسم متكامل
   ========================================================================== */

/* أزرار الوحدات الكبرى (3D Arcade Unit Buttons) */
.kuromi-figure-button {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
    cursor: pointer !important;
    position: relative !important;
    box-sizing: border-box !important;
    user-select: none !important;

    /* جسم الزر المجسم 3D */
    width: 250px !important;
    min-height: 260px !important;
    padding: 18px 16px 14px !important;
    border-radius: 32px !important;
    
    /* خلفية متدرجة مستوحاة من ألعاب الآركيد */
    background: linear-gradient(180deg, #ffffff 0%, #fff0f7 40%, #fed7e2 100%) !important;
    
    /* حدود ثلاثية الأبعاد بارزة مع عمق سفلي حقيقي */
    border: 3.5px solid #f472b6 !important;
    border-bottom: 9px solid #db2777 !important;
    
    /* لمعان داخلي وظلال مجسمة */
    box-shadow: 
        inset 0 4px 0 rgba(255, 255, 255, 0.9),
        inset 0 -3px 0 rgba(219, 39, 119, 0.15),
        0 8px 0 #be185d,
        0 16px 25px rgba(236, 72, 153, 0.28) !important;
        
    transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* قبة عرض صورة كورومي داخل الزر */
.figure-avatar-holder {
    position: relative !important;
    width: 140px !important;
    height: 140px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: radial-gradient(circle, #ffffff 50%, #fce7f3 100%) !important;
    border: 3px solid #ffffff !important;
    box-shadow: 
        inset 0 3px 8px rgba(236, 72, 153, 0.2),
        0 4px 12px rgba(219, 39, 119, 0.2) !important;
    margin-bottom: 12px !important;
    transition: transform 0.25s ease !important;
}

/* صورة كورومي المدمجة داخل القبة */
.figure-mascot-img {
    width: 105px !important;
    height: 105px !important;
    max-width: 105px !important;
    max-height: 105px !important;
    object-fit: contain !important;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15)) !important;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* شارة رقم الوحدة المدمجة بإطار القبة */
.figure-badge-pill {
    position: absolute !important;
    top: -6px !important;
    right: -6px !important;
    background: linear-gradient(135deg, #ec4899, #c084fc) !important;
    color: white !important;
    font-size: 0.95rem !important;
    font-weight: 900 !important;
    padding: 3px 12px !important;
    border-radius: 16px !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2) !important;
    z-index: 4 !important;
}

/* شريط عنوان الوحدة داخل الزر - يلتف بأناقة ولا يخرج أبداً */
.figure-pedestal-ribbon {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    background: linear-gradient(135deg, #ec4899, #db2777) !important;
    color: #ffffff !important;
    padding: 8px 10px !important;
    border-radius: 20px !important;
    border: 2px solid #ffffff !important;
    border-bottom: 4px solid #9d174d !important;
    box-shadow: 
        inset 0 2px 0 rgba(255, 255, 255, 0.5),
        0 4px 10px rgba(219, 39, 119, 0.3) !important;
    font-weight: 900 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    white-space: normal !important;
    text-align: center !important;
    min-height: 42px !important;
    z-index: 3 !important;
    transition: all 0.18s ease !important;
    overflow: hidden !important;
}

.figure-title {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !important;
    font-weight: 900 !important;
    font-size: clamp(0.95rem, 2.6vw, 1.25rem) !important;
    line-height: 1.25 !important;
    text-align: center !important;
    flex: 1 1 auto !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
}

/* تفاعلات التحويم والضغط لأزرار الوحدات */
.kuromi-figure-button:hover {
    transform: translateY(-6px) !important;
    border-bottom-width: 12px !important;
    box-shadow: 
        inset 0 4px 0 rgba(255, 255, 255, 0.95),
        0 10px 0 #be185d,
        0 22px 35px rgba(236, 72, 153, 0.42) !important;
}

.kuromi-figure-button:hover .figure-avatar-holder {
    transform: scale(1.06) !important;
    border-color: #fbcfe8 !important;
}

.kuromi-figure-button:hover .figure-mascot-img {
    transform: scale(1.1) rotate(4deg) !important;
}

.kuromi-figure-button:hover .figure-pedestal-ribbon {
    background: linear-gradient(135deg, #f43f5e, #e11d48) !important;
    transform: scale(1.02) !important;
}

.kuromi-figure-button:active {
    transform: translateY(6px) !important;
    border-bottom-width: 3px !important;
    box-shadow: 
        inset 0 2px 0 rgba(255, 255, 255, 0.5),
        0 2px 0 #be185d,
        0 6px 12px rgba(236, 72, 153, 0.2) !important;
}

.kuromi-figure-button:active .figure-pedestal-ribbon {
    border-bottom-width: 2px !important;
    transform: scale(0.98) !important;
}

/* ==========================================================================
   🎮 3D ARCADE LESSON BUTTONS - أزرار الدروس المجسمة 3D
   ========================================================================== */
.kuromi-lesson-figure-btn {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
    cursor: pointer !important;
    position: relative !important;
    box-sizing: border-box !important;
    user-select: none !important;

    /* أبعاد وهيكل زر الدرس المجسم */
    width: 215px !important;
    max-width: 100% !important;
    min-height: 215px !important;
    padding: 12px 10px 10px !important;
    border-radius: 28px !important;
    
    background: linear-gradient(180deg, #ffffff 0%, #fff5f8 40%, #fee2e2 100%) !important;
    border: 3px solid #f472b6 !important;
    border-bottom: 7px solid #db2777 !important;
    
    box-shadow: 
        inset 0 3px 0 rgba(255, 255, 255, 0.9),
        0 6px 0 #be185d,
        0 12px 20px rgba(236, 72, 153, 0.22) !important;
        
    transition: all 0.16s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* قبة عرض صورة الدرس */
.lesson-character-scene {
    position: relative !important;
    width: 105px !important;
    height: 105px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: radial-gradient(circle, #ffffff 50%, #fce7f3 100%) !important;
    border: 2.5px solid #ffffff !important;
    box-shadow: 
        inset 0 2px 6px rgba(236, 72, 153, 0.15),
        0 3px 10px rgba(219, 39, 119, 0.18) !important;
    margin-bottom: 8px !important;
    transition: transform 0.2s ease !important;
}

.lesson-mascot-img {
    width: 78px !important;
    height: 78px !important;
    max-width: 78px !important;
    max-height: 78px !important;
    object-fit: contain !important;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.15)) !important;
    transition: transform 0.2s ease !important;
}

/* وسام الحرف (ب، م، د، ف...) المدمج بالقبة */
.lesson-char-cameo {
    position: absolute !important;
    bottom: -4px !important;
    left: -4px !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #ec4899, #a855f7) !important;
    color: #ffffff !important;
    font-size: 1.35rem !important;
    font-weight: 900 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2.5px solid #ffffff !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22) !important;
    z-index: 4 !important;
    margin: 0 !important;
}

/* شريط عنوان الدرس - يلتف بأناقة ولا يخرج أبداً */
.lesson-pedestal-ribbon {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    background: linear-gradient(135deg, #a855f7, #7e22ce) !important;
    color: #ffffff !important;
    padding: 6px 8px !important;
    border-radius: 18px !important;
    border: 2px solid #ffffff !important;
    border-bottom: 3.5px solid #581c87 !important;
    box-shadow: 
        inset 0 1.5px 0 rgba(255, 255, 255, 0.5),
        0 3px 8px rgba(126, 34, 206, 0.25) !important;
    font-weight: 900 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    white-space: normal !important;
    text-align: center !important;
    min-height: 38px !important;
    z-index: 3 !important;
    transition: all 0.16s ease !important;
    overflow: hidden !important;
}

.lesson-title-span {
    color: #ffffff !important;
    font-weight: 900 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !important;
    font-size: clamp(0.9rem, 2.4vw, 1.15rem) !important;
    line-height: 1.25 !important;
    text-align: center !important;
    flex: 1 1 auto !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
}

/* تفاعل التحويم والضغط لأزرار الدروس */
.kuromi-lesson-figure-btn:hover {
    transform: translateY(-5px) !important;
    border-bottom-width: 10px !important;
    box-shadow: 
        inset 0 3px 0 rgba(255, 255, 255, 0.95),
        0 8px 0 #be185d,
        0 18px 25px rgba(236, 72, 153, 0.35) !important;
}

.kuromi-lesson-figure-btn:hover .lesson-character-scene {
    transform: scale(1.08) !important;
}

.kuromi-lesson-figure-btn:hover .lesson-mascot-img {
    transform: scale(1.1) rotate(5deg) !important;
}

.kuromi-lesson-figure-btn:hover .lesson-pedestal-ribbon {
    background: linear-gradient(135deg, #c084fc, #9333ea) !important;
}

.kuromi-lesson-figure-btn:active {
    transform: translateY(5px) !important;
    border-bottom-width: 2.5px !important;
    box-shadow: 
        inset 0 1.5px 0 rgba(255, 255, 255, 0.5),
        0 1.5px 0 #be185d,
        0 4px 8px rgba(236, 72, 153, 0.18) !important;
}

.kuromi-lesson-figure-btn:active .lesson-pedestal-ribbon {
    border-bottom-width: 1.5px !important;
    transform: scale(0.98) !important;
}

/* زر الصوت الصغير */
.mini-speaker-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.95rem !important;
    background: rgba(255, 255, 255, 0.28) !important;
    border: 1.5px solid #ffffff !important;
    border-radius: 50% !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15) !important;
    transition: transform 0.2s, background 0.2s !important;
}

.mini-speaker-btn:hover {
    background: rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.18) !important;
}

/* أزرار الإطلاق السريع العلوية (3D Capsule Buttons) */
.kuromi-feature-btn {
    border-bottom: 6px solid rgba(0, 0, 0, 0.25) !important;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2), 0 10px 20px rgba(0,0,0,0.15) !important;
    transition: all 0.16s ease !important;
    max-width: 95% !important;
    font-size: clamp(1rem, 3.2vw, 1.35rem) !important;
    padding: 10px 18px !important;
    white-space: normal !important;
    box-sizing: border-box !important;
    text-align: center !important;
}

.kuromi-feature-btn span:nth-of-type(1) {
    white-space: normal !important;
    line-height: 1.25 !important;
    word-break: break-word !important;
}

.kuromi-feature-btn:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 9px 0 rgba(0, 0, 0, 0.25), 0 16px 25px rgba(0,0,0,0.2) !important;
}

.kuromi-feature-btn:active {
    transform: translateY(4px) !important;
    border-bottom-width: 2px !important;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0,0,0,0.1) !important;
}

/* تجاوب إضافي للشاشات الصغيرة لتجنب خروج النصوص */
@media screen and (max-width: 600px) {
    .kuromi-figure-button {
        width: 100% !important;
        max-width: 230px !important;
        min-height: 220px !important;
        padding: 12px 10px 10px !important;
    }
    
    .figure-avatar-holder {
        width: 115px !important;
        height: 115px !important;
    }
    
    .figure-mascot-img {
        width: 85px !important;
        height: 85px !important;
        max-width: 85px !important;
        max-height: 85px !important;
    }

    .kuromi-lesson-figure-btn {
        width: 100% !important;
        max-width: 190px !important;
        min-height: 200px !important;
        padding: 10px 8px 8px !important;
    }

    .lesson-character-scene {
        width: 95px !important;
        height: 95px !important;
    }

    .lesson-mascot-img {
        width: 70px !important;
        height: 70px !important;
    }
    
    .figure-title,
    .lesson-title-span {
        font-size: 0.95rem !important;
    }

    .kuromi-units-grid {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
        gap: 15px !important;
    }

    .unit-lessons-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
        gap: 12px !important;
    }
}

.kuromi-units-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 25px !important;
    direction: rtl !important;
    justify-items: center !important;
    padding: 15px 0 !important;
}

.unit-lessons-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
    gap: 20px !important;
    direction: rtl !important;
    justify-items: center !important;
    padding: 15px 0 !important;
}

/* ==========================================
   OFFICIAL BUTTERFLY COPYRIGHT FOOTER
   ========================================== */
.platform-footer {
    text-align: center;
    padding: 35px 15px 45px;
    margin-top: 40px;
    width: 100%;
    position: relative;
    z-index: 10;
    box-sizing: border-box;
}

.platform-footer .platform-footer-link {
    color: #9d174d;
    text-decoration: none;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 800;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2.5px solid #f472b6;
    padding: 10px 24px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: inherit;
    max-width: 90%;
    word-break: break-word;
}

.platform-footer .platform-footer-link:hover {
    color: #db2777;
    border-color: #ec4899;
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 8px 22px rgba(236, 72, 153, 0.35);
    background: #ffffff;
}

/* ========================================================
   أزرار وواجهة فصل الألعاب عن الدروس (Lesson Games Separation)
   ======================================================== */

.lesson-nav-mode-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin: 0 auto 25px;
    max-width: 620px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50px;
    border: 3px solid #fbcfe8;
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.18);
    direction: rtl;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.mode-tab-btn {
    flex: 1;
    min-width: 180px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 40px;
    border: 2px solid transparent;
    background: #fdf2f8;
    color: #831843;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 6px rgba(236, 72, 153, 0.1);
}

.mode-tab-btn:hover {
    color: #be185d;
    background: #fce7f3;
    transform: translateY(-2px);
}

.mode-tab-btn.active {
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: #ffffff !important;
    box-shadow: 0 5px 16px rgba(236, 72, 153, 0.4);
    border-color: #ffffff;
    transform: scale(1.03);
}

.mode-tab-btn.game-tab-btn {
    background: #faf5ff;
    color: #6b21a8;
    border-color: #e9d5ff;
}

.mode-tab-btn.game-tab-btn:hover {
    background: #f3e8ff;
    color: #581c87;
}

.mode-tab-btn.game-tab-btn.active {
    background: linear-gradient(135deg, #a855f7, #7e22ce);
    color: #ffffff !important;
    border-color: #ffffff;
    box-shadow: 0 5px 16px rgba(168, 85, 247, 0.4);
    transform: scale(1.03);
}

.games-pill-count {
    background: #fef08a;
    color: #854d0e;
    font-size: 0.8rem;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 900;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ساحة ألعاب الدرس الخاصة */
.lesson-games-arena {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-radius: 30px;
    border: 4px solid #fbcfe8;
    box-shadow: 0 12px 30px rgba(236, 72, 153, 0.18);
    padding: 24px;
    margin-bottom: 25px;
    animation: fadeIn 0.35s ease-in-out;
    direction: rtl;
    box-sizing: border-box;
}

.games-arena-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    border-bottom: 2px dashed #fbcfe8;
    padding-bottom: 18px;
    margin-bottom: 20px;
}

.games-arena-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: #be185d;
    display: flex;
    align-items: center;
    gap: 10px;
}

.games-pills-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.game-nav-pill {
    background: #fdf2f8;
    color: #9d174d;
    border: 2px solid #fbcfe8;
    border-radius: 25px;
    padding: 8px 20px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 6px rgba(236, 72, 153, 0.1);
}

.game-nav-pill:hover {
    background: #fce7f3;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(236, 72, 153, 0.2);
}

.game-nav-pill.active {
    background: linear-gradient(135deg, #ec4899, #be185d);
    color: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 6px 15px rgba(236, 72, 153, 0.35);
    transform: scale(1.05);
}

.games-content-box {
    min-height: 380px;
    padding: 10px;
}

.active-game-card {
    background: #faf5ff;
    border-radius: 24px;
    border: 2.5px solid #e9d5ff;
    padding: 20px 15px;
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.08);
}

.games-nav-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    border-top: 2px dashed #fbcfe8;
    padding-top: 20px;
    margin-top: 20px;
}

.return-to-lesson-btn {
    background: linear-gradient(135deg, #06b6d4, #0891b2) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3) !important;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    font-family: inherit;
}

.return-to-lesson-btn:hover {
    background: linear-gradient(135deg, #0891b2, #0e7490) !important;
    transform: translateY(-2px);
}

/* زر الألعاب السريع في بطاقات الوحدات */
.card-games-quick-btn {
    background: linear-gradient(135deg, #a855f7, #7e22ce);
    color: white;
    border: 1.5px solid #ffffff;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 3px 10px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(168, 85, 247, 0.3);
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.card-games-quick-btn:hover {
    transform: scale(1.08);
    background: linear-gradient(135deg, #9333ea, #6b21a8);
}

/* ========================================================
   واجهة التقسيم الرئيسية: (قراءتي) و (النشاط)
   ======================================================== */
.portal-hero-section {
    text-align: center;
    padding: 30px 20px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.portal-badge-pill {
    display: inline-block;
    background: linear-gradient(135deg, #fbcfe8, #f472b6);
    color: #831843;
    padding: 8px 22px;
    border-radius: 30px;
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 15px;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 15px rgba(244, 114, 182, 0.3);
}

.portal-main-title {
    font-size: 2.6rem;
    color: #831843;
    margin: 0 0 10px;
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(236, 72, 153, 0.15);
}

.portal-subtitle {
    font-size: 1.35rem;
    color: #6b21a8;
    margin: 0 0 25px;
    font-weight: 700;
}

/* شبكة بطاقات الأقسام (قراءتي / النشاط) */
.subject-branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 35px;
    max-width: 950px;
    margin: 10px auto 40px;
    padding: 0 20px;
    box-sizing: border-box;
    direction: rtl;
}

.branch-card {
    position: relative;
    border-radius: 36px;
    padding: 35px 25px 30px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.95);
    border: 3.5px solid transparent;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.branch-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 10px;
}

/* بطاقة قراءتي */
.branch-card.branch-qiraati {
    border-color: #fbcfe8;
    background: linear-gradient(180deg, #ffffff 0%, #fff1f2 100%);
}

.branch-card.branch-qiraati::before {
    background: linear-gradient(90deg, #ec4899, #f43f5e, #fb7185);
}

.branch-card.branch-qiraati:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: #ec4899;
    box-shadow: 0 20px 45px rgba(236, 72, 153, 0.28);
}

/* بطاقة النشاط */
.branch-card.branch-activity {
    border-color: #ddd6fe;
    background: linear-gradient(180deg, #ffffff 0%, #f5f3ff 100%);
}

.branch-card.branch-activity::before {
    background: linear-gradient(90deg, #8b5cf6, #6366f1, #3b82f6);
}

.branch-card.branch-activity:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: #8b5cf6;
    box-shadow: 0 20px 45px rgba(139, 92, 246, 0.28);
}

.branch-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 800;
}

.branch-qiraati .branch-badge {
    background: #fce7f3;
    color: #be185d;
    border: 1px solid #fbcfe8;
}

.branch-activity .branch-badge {
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

.branch-character {
    width: 140px;
    height: 140px;
    margin: 15px auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.branch-mascot-img {
    width: 130px;
    height: 130px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.12));
    transition: transform 0.3s ease;
}

.branch-card:hover .branch-mascot-img {
    transform: scale(1.1) rotate(-3deg);
}

.branch-title {
    font-size: 2.5rem;
    margin: 10px 0 8px;
    font-weight: 900;
}

.branch-qiraati .branch-title {
    color: #be185d;
}

.branch-activity .branch-title {
    color: #6d28d9;
}

.branch-desc {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #4b5563;
    margin: 0 0 25px;
    padding: 0 10px;
    min-height: 58px;
}

.branch-action-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.branch-start-btn {
    flex: 1;
    max-width: 200px;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 1.25rem;
    font-weight: 900;
    color: #ffffff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    transition: all 0.25s ease;
}

.branch-qiraati .branch-start-btn {
    background: linear-gradient(135deg, #ec4899, #be185d);
}

.branch-activity .branch-start-btn {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.branch-audio-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.branch-audio-btn:hover {
    transform: scale(1.15);
    background: #ffffff;
}

/* شريط التنقل الفرعي والتبديل السريع بين قراءتي والنشاط */
.portal-subnav-bar {
    max-width: 1050px;
    margin: 15px auto 20px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    direction: rtl;
    box-sizing: border-box;
}

.portal-nav-btn {
    background: linear-gradient(135deg, #475569, #1e293b);
    color: #ffffff;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 30px;
    padding: 10px 22px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.portal-nav-btn:hover {
    background: linear-gradient(135deg, #334155, #0f172a);
    transform: translateY(-2px);
}

.portal-switcher-pills {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px;
    border-radius: 30px;
    border: 2px solid #fbcfe8;
    box-shadow: 0 4px 15px rgba(236,72,153,0.1);
    gap: 5px;
}

.switcher-pill {
    border: none;
    background: transparent;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    color: #64748b;
    transition: all 0.25s ease;
}

.switcher-pill.active {
    background: linear-gradient(135deg, #ec4899, #be185d);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(236, 72, 153, 0.3);
}

.switcher-pill.active-activity {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3) !important;
}

/* واجهة النشاط والتمارين */
.activity-hub-wrapper {
    max-width: 960px;
    margin: 10px auto 40px;
    padding: 0 20px;
    box-sizing: border-box;
    direction: rtl;
}

.activity-welcome-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 32px;
    border: 3px solid #ddd6fe;
    padding: 35px 30px;
    box-shadow: 0 12px 35px rgba(139, 92, 246, 0.15);
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.activity-mascot-scene {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #ffffff;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.2);
    margin: 0 auto;
}

.activity-mascot-img {
    width: 110px;
    height: 110px;
    object-fit: contain;
}

.activity-welcome-info {
    flex: 1;
    min-width: 280px;
}

.activity-pill-tag {
    display: inline-block;
    background: #ede9fe;
    color: #6d28d9;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.activity-welcome-info h2 {
    font-size: 2.2rem;
    color: #4c1d95;
    margin: 0 0 10px;
    font-weight: 900;
}

.activity-welcome-info p {
    font-size: 1.25rem;
    color: #4b5563;
    line-height: 1.8;
    margin: 0 0 20px;
}

.activity-status-note {
    background: #fdf4ff;
    border: 2px dashed #f0abfc;
    border-radius: 20px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.15rem;
    font-weight: 800;
    color: #86198f;
}

.activity-status-note .status-icon {
    font-size: 1.8rem;
}



/* ==========================================================================
   تنسيقات كِتَابِ النَّشَاطِ والتَّمارِينِ التَّفاعُلِيَّة (الوحدة الأولى: أُسْرَتي)
   ========================================================================== */

.activity-top-navigator {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-unit-banner {
    background: linear-gradient(135deg, #fef08a 0%, #fde047 100%);
    border: 3px solid #eab308;
    color: #854d0e;
    padding: 12px 25px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.6rem;
    font-weight: 900;
    box-shadow: 0 6px 15px rgba(234, 179, 8, 0.25);
    align-self: center;
}

.activity-unit-banner .unit-sparkle {
    font-size: 1.8rem;
}

.activity-letters-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.activity-letter-tab {
    background: #ffffff;
    border: 3px solid #f1f5f9;
    border-radius: 20px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.activity-letter-tab:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.activity-letter-tab.active-letter-tab {
    border-color: var(--tab-color, #ec4899);
    background: linear-gradient(180deg, #ffffff 0%, #fdf2f8 100%);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.25);
    transform: scale(1.02);
}

.activity-letter-tab .tab-char {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--tab-color, #ec4899);
    line-height: 1;
}

.activity-letter-tab .tab-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1e293b;
}

.activity-letter-tab .tab-pages {
    font-size: 0.95rem;
    font-weight: bold;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 12px;
    border-radius: 12px;
}

.activity-letter-tab .tab-stars {
    font-size: 0.95rem;
    font-weight: 900;
    color: #d97706;
}

/* بطاقة الحرف النشط */
.active-letter-header-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 25px 30px;
    display: flex;
    align-items: center;
    gap: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    border: 3px solid #f1f5f9;
    border-right: 8px solid #ec4899;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.letter-header-visual {
    display: flex;
    align-items: center;
    gap: 15px;
}

.letter-mascot-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.letter-big-badge {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    color: white;
    font-size: 3rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.letter-header-details {
    flex: 1;
    min-width: 280px;
}

.letter-tag-pill {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.letter-display-title {
    font-size: 2.2rem;
    color: #0f172a;
    margin: 0 0 6px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 10px;
}

.letter-display-subtitle {
    color: #64748b;
    font-size: 1.15rem;
    margin: 0 0 16px;
    font-weight: 600;
}

.letter-quick-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-pill {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.quick-pill:hover {
    background: #ede9fe;
    color: #6d28d9;
    border-color: #c4b5fd;
    transform: translateY(-2px);
}

/* بطاقات الأنشطة (Activity Block Cards) */
.activities-stream {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.activity-block-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 30px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
    position: relative;
    scroll-margin-top: 100px;
}

.act-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.act-badge.yellow-badge {
    background: linear-gradient(135deg, #fef08a, #fde047);
    border: 2px solid #eab308;
    color: #854d0e;
    font-size: 1.1rem;
    font-weight: 900;
    padding: 6px 18px;
    border-radius: 30px;
    box-shadow: 0 2px 6px rgba(234,179,8,0.2);
}

.act-title {
    font-size: 1.7rem;
    color: #dc2626; /* اللون الأحمر المستوحى من الكتاب المدرسي */
    font-weight: 900;
    margin: 0;
    flex: 1;
}

.act-instruction {
    font-size: 1.15rem;
    color: #475569;
    margin: 0 0 20px;
    font-weight: 700;
    line-height: 1.6;
}

/* شريط أدوات الرسم والتلوين */
.canvas-paint-toolbar {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.color-palette-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-dot:hover {
    transform: scale(1.15);
}

.color-dot.active-color {
    outline: 3px solid #0f172a;
    transform: scale(1.18);
}

.color-dot.eraser-dot {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    font-size: 1.1rem;
}

.brush-size-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brush-btn {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    color: #334155;
    transition: all 0.2s ease;
}

.brush-btn.active-brush {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.act-action-btn {
    padding: 8px 18px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.act-action-btn.clear-btn {
    background: #fee2e2;
    color: #b91c1c;
    border: 2px solid #fca5a5;
}

.act-action-btn.check-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
}

/* نشاط 1: شبكة التمرير والتلوين */
.act1-tracing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    justify-content: center;
}

.tracing-card {
    background: #fafafa;
    border: 3px dashed #f472b6;
    border-radius: 20px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.tracing-model-label {
    font-size: 1.2rem;
    font-weight: 900;
    color: #be185d;
    background: #fdf2f8;
    padding: 4px 14px;
    border-radius: 12px;
}

.tracing-stage-wrapper {
    position: relative;
    width: 220px;
    height: 170px;
    background: #ffffff;
    border-radius: 16px;
    border: 2px solid #f1f5f9;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.03);
    overflow: hidden;
    touch-action: none;
}

.tracing-svg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.interactive-trace-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.mini-clear-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

/* نشاط 2: رسم الدائرة */
.letter-circle-box {
    background: #f0fdf4;
    border: 3px solid #86efac;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.1);
}

.circle-letters-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.circle-letter-cell {
    width: 85px;
    height: 85px;
    border-radius: 20px;
    background: #ffffff;
    border: 2px solid #bbf7d0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    transition: all 0.25s ease;
}

.circle-letter-cell:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

.circle-char-text {
    font-size: 2.8rem;
    font-weight: 900;
    color: #15803d;
    user-select: none;
}

.drawn-ring {
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 4px dashed #ec4899;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.circle-letter-cell.circled-correct .drawn-ring {
    opacity: 1;
    transform: scale(1);
    background: rgba(236, 72, 153, 0.1);
}

.circle-letter-cell.circled-correct {
    border-color: #ec4899;
    background: #fdf2f8;
}

.circle-letter-cell.shake-wrong {
    animation: shakeAnim 0.5s ease;
    border-color: #ef4444;
}

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

/* نشاط 3: تجريد الحرف */
.act3-words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 20px;
}

.isolation-word-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.iso-word-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.iso-full-word {
    font-size: 2rem;
    font-weight: 900;
    color: #0f172a;
}

.mini-speaker-btn {
    background: #e0f2fe;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.mini-speaker-btn:hover {
    transform: scale(1.15);
}

.iso-slot-box {
    width: 100%;
    height: 60px;
    border: 3px dashed #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 900;
    color: #94a3b8;
    transition: all 0.3s ease;
}

.iso-slot-box.slot-filled {
    border-color: #10b981;
    background: #ecfdf5;
    border-style: solid;
}

.iso-slot-correct {
    color: #059669;
    font-size: 2.2rem;
    font-weight: 900;
}

.iso-options-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.iso-opt-pill {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    padding: 6px 14px;
    font-size: 1.3rem;
    font-weight: 900;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.iso-opt-pill:hover {
    border-color: #ec4899;
    color: #be185d;
    transform: translateY(-2px);
}

.iso-opt-pill.opt-correct-btn {
    background: #10b981;
    color: #ffffff;
    border-color: #059669;
}

.iso-opt-pill.opt-wrong-btn {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #ef4444;
}

/* نشاط 4: الحركات في الفراغ */
.act4-pictures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
}

.picture-fill-card {
    background: #ffffff;
    border: 3px solid #fecdd3;
    border-radius: 22px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(244,63,94,0.06);
}

.picture-card-image-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.picture-emoji {
    font-size: 4rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.picture-caption-pill {
    background: #ffe4e6;
    color: #be123c;
    font-size: 0.95rem;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 12px;
}

.picture-card-word-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 16px;
    width: 90%;
    justify-content: center;
}

.picture-word-display {
    font-size: 1.8rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: 1px;
}

.picture-word-display.word-done {
    color: #059669;
}

.picture-options-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.pic-opt-btn {
    background: #ffffff;
    border: 2px solid #fda4af;
    color: #be123c;
    font-size: 1.4rem;
    font-weight: 900;
    padding: 6px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pic-opt-btn:hover {
    background: #fff1f2;
    transform: translateY(-2px);
}

.pic-opt-btn.opt-correct-btn {
    background: #10b981;
    color: #ffffff;
    border-color: #059669;
}

.pic-opt-btn.opt-wrong-btn {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #ef4444;
}

/* نشاط 5: أسطر الكتابة المدرسية */
.ruled-writing-section {
    background: #fffbeb;
    border: 2px solid #fef3c7;
    border-radius: 20px;
    padding: 20px;
}

.writing-section-label {
    font-size: 1.3rem;
    font-weight: 900;
    color: #b45309;
    margin-bottom: 15px;
}

.ruled-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 20px;
}

.ruled-item-cell {
    background: #ffffff;
    border: 2px solid #fde68a;
    border-radius: 18px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.ruled-model-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-char.red-text {
    font-size: 2.2rem;
    font-weight: 900;
    color: #dc2626;
}

.ruled-canvas-wrapper {
    position: relative;
    width: 180px;
    height: 120px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    overflow: hidden;
    touch-action: none;
}

.notebook-lines-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 0;
    box-sizing: border-box;
}

.line-red {
    width: 100%;
    height: 2px;
    background: #f87171;
}

.line-blue.mid-line {
    width: 100%;
    height: 2px;
    border-top: 2px dashed #60a5fa;
}

.dotted-guide-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: 900;
    color: #e2e8f0;
    pointer-events: none;
    user-select: none;
}

.interactive-line-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.cell-clear-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #64748b;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.act-bottom-bar {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

/* نشاط 6: أكتب (الكلمات) */
.words-model-display-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.word-model-pill {
    background: #ffffff;
    border: 3px solid #fecdd3;
    padding: 10px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.word-model-pill:hover {
    transform: translateY(-3px);
    border-color: #ec4899;
}

.word-model-pill .word-text.red-text {
    font-size: 2.2rem;
    font-weight: 900;
    color: #dc2626;
}

.word-model-pill .mini-speaker {
    font-size: 1.2rem;
}

.notebook-full-board {
    background: #ffffff;
    border: 3px solid #e2e8f0;
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}

.board-top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 12px;
}

.board-title-label {
    font-size: 1.2rem;
    font-weight: 900;
    color: #475569;
}

.board-btn-group {
    display: flex;
    gap: 10px;
}

.notebook-ruled-page-wrapper {
    position: relative;
    width: 100%;
    height: 320px;
    background: #fafaf9;
    border: 2px solid #e7e5e4;
    border-radius: 16px;
    overflow: hidden;
    touch-action: none;
}

.ruled-notebook-paper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 20px 0;
    box-sizing: border-box;
}

.ruled-row {
    width: 100%;
    height: 2px;
    border-bottom: 2px dashed #cbd5e1;
}

.full-writing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* نافذة وسام كورومي للتشجيع */
.activity-praise-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.activity-praise-dialog {
    background: #ffffff;
    border: 4px solid #f472b6;
    border-radius: 30px;
    padding: 35px 30px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(236,72,153,0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.praise-mascot-box {
    width: 100px;
    height: 100px;
    background: #fdf2f8;
    border-radius: 50%;
    border: 3px solid #ec4899;
    display: flex;
    align-items: center;
    justify-content: center;
}

.praise-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.praise-title {
    font-size: 1.8rem;
    color: #be185d;
    font-weight: 900;
    margin: 0;
}

.praise-desc {
    font-size: 1.25rem;
    color: #475569;
    font-weight: 700;
    line-height: 1.6;
    margin: 0;
}

.praise-stars-row {
    font-size: 2rem;
    letter-spacing: 4px;
}

.praise-close-btn {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: #ffffff;
    border: none;
    padding: 12px 35px;
    border-radius: 50px;
    font-size: 1.25rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(236,72,153,0.3);
    margin-top: 10px;
}

/* ==========================================================================
   تنسيقات شريط اختيار الوحدة التعليمية لكتاب النشاط
   ========================================================================== */
.activity-unit-selector-bar {
    background: #ffffff;
    border: 3px solid #fdf2f8;
    border-radius: 24px;
    padding: 16px 25px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.06);
}

.unit-selector-label {
    font-size: 1.25rem;
    font-weight: 900;
    color: #831843;
}

.unit-pills-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.unit-toggle-pill {
    background: #f8fafc;
    border: 3px solid #e2e8f0;
    border-radius: 50px;
    padding: 10px 24px;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.unit-toggle-pill:hover {
    transform: translateY(-3px);
    border-color: #cbd5e1;
    color: #0f172a;
}

.unit-toggle-pill.active-unit-pill {
    background: linear-gradient(135deg, var(--unit-color, #ec4899) 0%, #db2777 100%);
    color: #ffffff;
    border-color: var(--unit-color, #ec4899);
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.25);
    transform: scale(1.04);
}

.unit-pill-icon {
    font-size: 1.4rem;
}

.unit-pill-text {
    font-weight: 900;
}
