@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Tajawal:wght@400;500;700;900&display=swap');

:root {
    /* Kuromi Kawaii Pink Theme */
    --primary-color: #ec4899;   /* Hot Pink */
    --primary-dark: #db2777;
    --secondary-color: #9333ea; /* Kuromi Purple */
    --secondary-dark: #7e22ce;
    --accent-color: #f43f5e;    /* Rose Pink */
    --accent-dark: #e11d48;
    --pink-soft: #fdf2f8;
    --pink-light: #fce7f3;
    --bg-color: #fdf2f8;        /* Soft Pastel Pink */
    --card-bg: #FFFFFF;
    --text-main: #2e1065;       /* Deep Velvet Violet */
    --text-muted: #86198f;      /* Muted Magenta */
    --glass-blur: blur(16px);
    --shadow-sm: 0 2px 4px rgba(236, 72, 153, 0.08);
    --shadow-md: 0 6px 12px -2px rgba(236, 72, 153, 0.15);
    --shadow-lg: 0 12px 24px -4px rgba(236, 72, 153, 0.2);
}

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

body {
    font-family: 'Outfit', 'Tajawal', sans-serif;
    background-color: var(--pink-soft);
    background-image: 
        radial-gradient(#f472b6 2px, transparent 2px), 
        radial-gradient(#c084fc 2px, transparent 2px),
        radial-gradient(#fda4af 2px, transparent 2px);
    background-size: 50px 50px, 50px 50px, 50px 50px;
    background-position: 0 0, 25px 25px, 12px 37px;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header Styles --- */
.main-header {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(236, 72, 153, 0.18);
    padding: 0.35rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    flex-wrap: wrap;
    gap: 10px;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.main-header.hidden {
    display: none !important;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.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;
}

.logo-text-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-text {
    font-size: 1.05rem;
    font-weight: 800;
    color: #be185d;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.subject-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #7e22ce;
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.header-right-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.portal-back-btn {
    text-decoration: none;
    background: #fdf2f8;
    color: #be185d;
    padding: 5px 12px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.85rem;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1px solid #fbcfe8;
}

.portal-back-btn:hover {
    background: #fce7f3;
    transform: translateY(-1px);
}

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

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

.main-nav {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.star-counter {
    background: #fdf2f8;
    border: 1px solid #fbcfe8;
    padding: 3px 9px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 800;
    color: #db2777;
    font-size: 0.85rem;
}

.nav-btn {
    padding: 4px 11px;
    border: 1px solid transparent;
    background: #fdf2f8;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.84rem;
    color: #9d174d;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.nav-btn.active {
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: white;
    box-shadow: 0 2px 6px rgba(236, 72, 153, 0.3);
}

@media screen and (max-width: 480px) {
    .main-header {
        padding: 0.25rem 0.6rem !important;
    }
    .logo-text {
        font-size: 0.95rem !important;
    }
    .subject-tag {
        font-size: 0.7rem !important;
        padding: 1px 6px !important;
    }
    .portal-back-btn, .nav-btn {
        padding: 4px 8px !important;
        font-size: 0.78rem !important;
    }
    .header-avatar {
        width: 32px !important;
        height: 32px !important;
    }
}

/* --- Content Area --- */
#content-area {
    flex: 1;
    padding: 2.5rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.welcome-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.welcome-content {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 30px;
    box-shadow: var(--shadow-lg);
    border: 3px solid #fbcfe8;
    width: 100%;
    max-width: 900px;
}

/* --- Buttons --- */
button {
    font-family: inherit;
    outline: none;
}

.btn-back {
    background: white !important;
    color: #db2777 !important;
    border: 2px solid #fbcfe8 !important;
    border-radius: 15px !important;
    padding: 0.6rem 1.2rem !important;
    font-size: 1rem !important;
    font-weight: bold !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 6px rgba(236, 72, 153, 0.1) !important;
}

.btn-back:hover {
    background: #fdf2f8 !important;
    border-color: #ec4899 !important;
    transform: translateY(-2px);
}

/* --- Tracing Canvas --- */
#tracing-canvas, #dotCanvas {
    background-image: linear-gradient(#fce7f3 1px, transparent 1px), linear-gradient(90deg, #fce7f3 1px, transparent 1px);
    background-size: 20px 20px;
    background-color: #ffffff;
    border: 3px solid #fbcfe8 !important;
    border-radius: 16px;
    box-shadow: 0 6px 15px rgba(236, 72, 153, 0.1);
}

/* --- Responsive Design --- */
@media (max-width: 880px) {
    .main-header {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 12px !important;
        padding: 12px 16px !important;
    }
    .logo {
        width: 100% !important;
        justify-content: center !important;
    }
    .header-right-group {
        width: 100% !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
    }
    .main-nav {
        width: 100% !important;
        justify-content: center !important;
        gap: 6px !important;
    }
    .portal-back-btn {
        font-size: 0.95rem !important;
        padding: 6px 16px !important;
    }
    .nav-btn {
        padding: 6px 12px !important;
        font-size: 0.92rem !important;
    }
    .header-top {
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
        text-align: center !important;
    }
    .unit-header h2 {
        font-size: 1.25rem !important;
        text-align: center !important;
    }
    #content-area {
        padding: 1rem;
    }
    .welcome-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 10px !important;
    }
    .header-avatar {
        width: 40px !important;
        height: 40px !important;
    }
    .header-kuromi {
        width: 38px !important;
        height: 38px !important;
    }
    .logo-text {
        font-size: 1.35rem !important;
    }
    .subject-tag {
        font-size: 0.75rem !important;
        padding: 0.2rem 0.5rem !important;
    }
    .portal-back-btn {
        font-size: 0.88rem !important;
        padding: 5px 12px !important;
    }
    .nav-btn {
        padding: 5px 10px !important;
        font-size: 0.85rem !important;
    }
    .star-counter {
        padding: 3px 8px !important;
        font-size: 0.9rem !important;
    }
}



/* ==========================================================================
   UPGRADED 3D KUROMI BUTTONS FOR ENGLISH PLATFORM
   ========================================================================== */
.eng-unit-card {
    background: linear-gradient(150deg, #ffffff 0%, #fff0f7 100%) !important;
    border: 3.5px solid #f472b6 !important;
    border-bottom: 9px solid #db2777 !important;
    border-radius: 30px !important;
    padding: 22px 18px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-shadow: 0 10px 0 #be185d, 0 15px 30px rgba(236, 72, 153, 0.22) !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    cursor: pointer !important;
    min-height: 270px !important;
}

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

.eng-unit-card:active {
    transform: translateY(4px) 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;
}

.eng-unit-card.kuromi-eng-activity-btn {
    border-color: #c084fc !important;
    border-bottom-color: #7e22ce !important;
    box-shadow: 0 10px 0 #581c87, 0 15px 30px rgba(168, 85, 247, 0.25) !important;
}

.eng-unit-card.kuromi-eng-activity-btn:hover {
    box-shadow: 0 16px 0 #581c87, 0 22px 35px rgba(168, 85, 247, 0.38) !important;
    border-color: #a855f7 !important;
}

.eng-mascot-cameo {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #ffffff;
    border: 3.5px solid #f472b6;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(236, 72, 153, 0.25);
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.eng-unit-card:hover .eng-mascot-cameo {
    transform: scale(1.1) rotate(6deg);
}

.eng-mascot-cameo img {
    width: 78px;
    height: 78px;
    object-fit: contain;
}

.eng-unit-badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ec4899, #c084fc);
    color: white;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 3px 14px;
    border-radius: 20px;
    white-space: nowrap;
    border: 2px solid white;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.eng-unit-info {
    text-align: center;
    margin: 5px 0 12px;
    flex-grow: 1;
}

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

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

.eng-btn-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.eng-start-pill {
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: white;
    padding: 8px 22px;
    border-radius: 25px;
    font-weight: 800;
    font-size: 1.05rem;
    box-shadow: 0 4px 10px rgba(236, 72, 153, 0.3);
    border: 1.5px solid white;
}

.eng-arrow-icon {
    font-size: 1.2rem;
    font-weight: 900;
    color: #db2777;
    transition: transform 0.2s;
}

.eng-unit-card:hover .eng-arrow-icon {
    transform: translateX(4px);
}



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

/* أزرار الوحدات والكتب (3D Arcade 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;
}

/* حالة اكتمال النشاط */
.kuromi-figure-button.completed {
    border-color: #34d399 !important;
    border-bottom-color: #059669 !important;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 40%, #dcfce7 100%) !important;
    box-shadow: 
        inset 0 3px 0 rgba(255, 255, 255, 0.9),
        0 6px 0 #047857,
        0 12px 20px rgba(16, 185, 129, 0.25) !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-pedestal-ribbon span:first-child {
    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;
}

/* تفاعل التحويم (Hover) للزر المجسم */
.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;
}

/* تفاعل الضغط الحقيقي (3D Active Click / Press) */
.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;
}

/* زر الصوت الصغير */
.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;
}

/* تجاوب إضافي للشاشات الصغيرة لتجنب خروج النصوص */
@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;
    }
    
    .figure-pedestal-ribbon span:first-child {
        font-size: 0.95rem !important;
    }

    .eng-units-grid,
    .eng-lessons-grid,
    .eng-activity-lessons-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
        gap: 14px !important;
    }
}

.eng-units-grid,
.eng-lessons-grid,
.eng-activity-lessons-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 22px !important;
    justify-items: center !important;
    padding: 15px 0 !important;
}

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

.platform-footer .footer-info {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 15px;
}

.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: 'Outfit', 'Tajawal', sans-serif;
    max-width: 90%;
    word-break: break-word;
    direction: rtl;
}

.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;
}
