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

:root {
    --primary-color: #f72585; /* Vibrant Fuchsia */
    --primary-light: #ff70a6;
    --secondary-color: #7209b7; /* Deep Purple */
    --accent-color: #4cc9f0; /* Glowing Cyan */
    --gold-accent: #fee440; /* Stardust Gold */
    --background-color: #10002b; /* Dark Magic Night */
    --card-bg: rgba(255, 255, 255, 0.95); /* Bright frosted glass */
    --text-main: #240046; /* Very Dark Purple for high contrast inside cards */
    --text-muted: #5a189a;
    --text-light: #ffffff;
    --border-radius: 25px; 
    --shadow: 0 15px 35px rgba(114, 9, 183, 0.35);
    --fairy-glow: 0 0 20px rgba(247, 37, 133, 0.8), 0 0 40px rgba(76, 201, 240, 0.4);
    --grammar-color: #7209b7;
    --reading-color: #f72585;
    --font-main: 'Cairo', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background-color: var(--background-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(114, 9, 183, 0.6), transparent 600px),
        radial-gradient(circle at 85% 30%, rgba(247, 37, 133, 0.5), transparent 600px),
        url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='1.5' fill='%23fee440' opacity='0.7'/%3E%3Ccircle cx='90' cy='60' r='2' fill='%234cc9f0' opacity='0.5'/%3E%3Ccircle cx='150' cy='130' r='1.5' fill='%23f72585' opacity='0.8'/%3E%3C/svg%3E");
    background-size: auto, auto, 300px 300px;
    background-attachment: fixed;
    animation: breathingBackground 15s ease-in-out infinite alternate;
    color: var(--text-main);
    direction: rtl;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: scroll;
}

@keyframes breathingBackground {
    0% { background-position: 0% 0%, 0% 0%, 0 0; }
    100% { background-position: 5% 5%, -5% 5%, 0 50px; }
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================================================
   FAIRY HEADER (Matching Math Platform)
   ========================================================================== */
.fairy-header {
    background: linear-gradient(135deg, rgba(36, 0, 70, 0.92) 0%, rgba(18, 0, 43, 0.96) 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 35px rgba(247, 37, 133, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(254, 228, 64, 0.45);
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    padding: 0.85rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px;
    margin-bottom: 25px;
}

/* Student Profile in Header */
.user-profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-glow {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle, #f72585 0%, #3c096c 100%);
    border: 2.5px solid #fee440;
    box-shadow: 0 0 18px rgba(254, 228, 64, 0.7), 0 0 28px rgba(247, 37, 133, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

.user-avatar-glow:hover {
    transform: scale(1.08) rotate(4deg);
    box-shadow: 0 0 25px rgba(254, 228, 64, 0.9), 0 0 35px rgba(247, 37, 133, 0.8);
}

.user-profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.avatar-fairy-badge {
    position: absolute;
    bottom: -4px;
    left: -4px;
    background: #f72585;
    border: 1.5px solid #fee440;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.user-info-text {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.student-name {
    font-size: 1.25rem;
    font-weight: 900;
    color: #FFFFFF;
    text-shadow: 0 0 10px rgba(247, 37, 133, 0.8);
    margin: 0;
    line-height: 1.2;
}

.student-grade-pill {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fee440;
    background: rgba(114, 9, 183, 0.6);
    border: 1px solid rgba(254, 228, 64, 0.4);
    border-radius: 20px;
    padding: 2px 10px;
    margin-top: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Center Magical Title */
.fairy-header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.magical-title {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    margin: 0;
    background: linear-gradient(135deg, #ffffff 0%, #ffb3c6 45%, #fee440 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(247, 37, 133, 0.35);
    font-weight: 900;
    line-height: 1.2;
}

.magical-subtitle {
    font-size: 0.85rem;
    color: #e0aaff;
    margin: 3px 0 0 0;
    font-weight: 600;
}

/* Action Buttons */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-play-fairies {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #f72585 0%, #7209b7 100%);
    color: #FFFFFF !important;
    text-decoration: none !important;
    border-radius: 50px;
    font-weight: 900;
    font-size: 0.95rem;
    box-shadow: 0 4px 18px rgba(247, 37, 133, 0.6), 0 0 16px rgba(254, 228, 64, 0.4);
    border: 2px solid #fee440;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.btn-play-fairies:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(247, 37, 133, 0.85), 0 0 25px rgba(254, 228, 64, 0.7);
    background: linear-gradient(135deg, #7209b7 0%, #f72585 100%);
}

.fairy-btn-icon {
    font-size: 1.25rem;
    animation: gentleWiggle 2s infinite ease-in-out;
}

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

.fairy-sparkle-star {
    font-size: 0.85rem;
    animation: pulseStar 1.5s infinite alternate;
}

@keyframes pulseStar {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.2); opacity: 1; filter: drop-shadow(0 0 6px #fee440); }
}

.btn-magical-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF !important;
    text-decoration: none !important;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.95rem;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.btn-magical-back:hover {
    background: rgba(247, 37, 133, 0.35);
    border-color: #fee440;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(247, 37, 133, 0.4);
}

/* ==========================================================================
   7-SECOND MAGICAL SYMPHONY STYLES
   ========================================================================== */
.magic-glow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    background: radial-gradient(circle at center, rgba(247, 37, 133, 0.25) 0%, rgba(114, 9, 183, 0.35) 50%, rgba(16, 0, 43, 0.5) 100%);
    box-shadow: inset 0 0 100px rgba(254, 228, 64, 0.5);
    animation: glowOverlayPulse 2.3s infinite alternate ease-in-out;
    transition: opacity 0.7s ease;
}

@keyframes glowOverlayPulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

.user-avatar-glow.magic-active {
    animation: avatarRoyalGlow 0.9s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95);
    border-color: #FFFFFF;
}

@keyframes avatarRoyalGlow {
    0% {
        box-shadow: 0 0 25px #fee440, 0 0 45px #f72585;
        transform: scale(1.06) rotate(-3deg);
    }
    100% {
        box-shadow: 0 0 50px #fee440, 0 0 85px #4cc9f0, 0 0 110px #f72585;
        transform: scale(1.16) rotate(3deg);
    }
}

.magic-platform-dancing {
    animation: platformJoyBounce 1.4s infinite ease-in-out;
}

@keyframes platformJoyBounce {
    0%, 100% { transform: translateY(0px); }
    25% { transform: translateY(-7px) rotate(0.4deg); }
    75% { transform: translateY(4px) rotate(-0.4deg); }
}

.magic-sparkle-card {
    animation: cardMagicSparkle 1.1s infinite alternate ease-in-out !important;
}

@keyframes cardMagicSparkle {
    0% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 25px rgba(247, 37, 133, 0.6);
        transform: translateY(-4px);
    }
    100% {
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 45px rgba(254, 228, 64, 0.85);
        transform: translateY(-10px) scale(1.03);
    }
}

.magic-floating-sprite {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    font-size: 2.2rem;
    filter: drop-shadow(0 0 15px rgba(254, 228, 64, 0.9));
    animation: floatSpriteUp 2.5s ease-out forwards;
}

@keyframes floatSpriteUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.5) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: translateY(0px) scale(1.35) rotate(-15deg);
    }
    80% {
        opacity: 0.9;
        transform: translateY(-90px) scale(1.1) rotate(20deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-160px) scale(0.4) rotate(45deg);
    }
}

/* ==========================================================================
   DASHBOARD VIEW & BOOKS
   ========================================================================== */
.welcome-section {
    text-align: center;
    margin: 25px 0 45px 0;
}

.welcome-fairy-title {
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    font-weight: 900;
    color: #FFFFFF;
    text-shadow: 0 0 20px rgba(247, 37, 133, 0.8), 0 0 40px rgba(76, 201, 240, 0.6);
    margin-bottom: 12px;
}

.welcome-fairy-sub {
    font-size: clamp(1rem, 2.2vw, 1.25rem);
    color: #f1c0e8;
    font-weight: 600;
}

.books-container {
    display: flex;
    justify-content: center;
    gap: 35px;
    flex-wrap: wrap;
}

.book-card {
    background: linear-gradient(145deg, rgba(36, 0, 70, 0.85) 0%, rgba(18, 0, 43, 0.95) 100%);
    border: 2px solid rgba(254, 228, 64, 0.35);
    border-radius: 30px;
    width: 320px;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 35px 25px;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(114, 9, 183, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(15px);
}

.book-glow-aura {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(247, 37, 133, 0.15), transparent 70%);
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.book-card:hover {
    transform: translateY(-12px) scale(1.03);
    border-color: #fee440;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(247, 37, 133, 0.8);
}

.book-card:hover .book-glow-aura {
    background: radial-gradient(circle, rgba(254, 228, 64, 0.25), transparent 70%);
}

.book-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.2rem;
    position: relative;
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.book-card:hover .book-icon {
    transform: scale(1.15) rotate(8deg);
}

.grammar-book .book-icon {
    background: linear-gradient(135deg, #7209b7, #3a0ca3);
    color: #4cc9f0;
    box-shadow: 0 0 25px rgba(76, 201, 240, 0.6);
    border: 2px solid #4cc9f0;
}

.reading-book .book-icon {
    background: linear-gradient(135deg, #f72585, #b5179e);
    color: #fee440;
    box-shadow: 0 0 25px rgba(254, 228, 64, 0.6);
    border: 2px solid #fee440;
}

.book-info {
    position: relative;
    z-index: 2;
}

.book-info h3 {
    font-size: 1.7rem;
    margin-bottom: 12px;
    font-weight: 900;
    color: #FFFFFF;
    text-shadow: 0 0 15px rgba(247, 37, 133, 0.6);
}

.book-info p {
    color: #fce7f3;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 18px;
}

.book-badge-fairy {
    display: inline-block;
    background: rgba(254, 228, 64, 0.15);
    color: #fee440;
    border: 1.5px solid #fee440;
    padding: 6px 18px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.card-decoration {
    position: absolute;
    bottom: 15px;
    left: 20px;
    font-size: 2rem;
    opacity: 0.3;
    pointer-events: none;
    transition: all 0.3s ease;
}

.book-card:hover .card-decoration {
    opacity: 0.8;
    transform: scale(1.2) rotate(15deg);
}

/* ==========================================================================
   LESSONS LIST VIEW
   ========================================================================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    gap: 20px;
    flex-wrap: wrap;
    background: rgba(36, 0, 70, 0.7);
    padding: 15px 25px;
    border-radius: 25px;
    border: 1.5px solid rgba(254, 228, 64, 0.3);
    backdrop-filter: blur(10px);
}

.back-btn {
    background: linear-gradient(135deg, #f72585, #7209b7);
    border: 2px solid #fee440;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(247, 37, 133, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: #FFFFFF;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.back-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(247, 37, 133, 0.7), 0 0 20px rgba(254, 228, 64, 0.6);
    background: linear-gradient(135deg, #7209b7, #f72585);
}

.section-header h2 {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: #FFFFFF;
    font-weight: 900;
    margin: 0;
    background: linear-gradient(135deg, #ffffff, #ffb3c6, #fee440);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(247, 37, 133, 0.4);
}

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

.lesson-card {
    background: var(--card-bg);
    border-radius: 25px;
    padding: 18px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2.5px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.lesson-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: #f72585;
    box-shadow: 0 15px 35px rgba(247, 37, 133, 0.5), 0 0 25px rgba(254, 228, 64, 0.4);
}

.lesson-emoji-container {
    width: 100%;
    height: 135px;
    background: linear-gradient(135deg, rgba(36, 0, 70, 0.95), rgba(18, 0, 43, 0.98));
    border-radius: 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 2px solid rgba(254, 228, 64, 0.35);
    box-shadow: inset 0 0 20px rgba(114, 9, 183, 0.5);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lesson-emoji-container svg {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 4px 10px rgba(247, 37, 133, 0.5));
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
}

.lesson-card:hover .lesson-emoji-container {
    border-color: #fee440;
    box-shadow: inset 0 0 25px rgba(247, 37, 133, 0.6), 0 0 25px rgba(254, 228, 64, 0.5);
    background: linear-gradient(135deg, rgba(114, 9, 183, 0.8), rgba(247, 37, 133, 0.4));
}

.lesson-card:hover .lesson-emoji-container svg {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 0 20px rgba(254, 228, 64, 0.9));
}

.lesson-card h4 {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1.4;
    margin: 5px 0;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 860px) {
    .fairy-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 10px;
    }
    .fairy-header-center {
        order: 3;
        width: 100%;
        margin-top: 5px;
    }
    .header-actions {
        order: 2;
    }
    .user-profile-header {
        order: 1;
    }
    .book-card {
        width: 100%;
        max-width: 350px;
    }
}

/* ==========================================================================
   FAIRY CANVAS WHITEBOARD MODAL (Coloring & Drawing Board)
   ========================================================================== */
#fairyCanvasModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(16, 0, 43, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 15px;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.fairy-canvas-card {
    background: linear-gradient(145deg, rgba(36, 0, 70, 0.98) 0%, rgba(18, 0, 43, 0.99) 100%);
    border: 2.5px solid #fee440;
    border-radius: 28px;
    width: 100%;
    max-width: 1050px;
    height: 94vh;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 50px rgba(247, 37, 133, 0.5);
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

.canvas-header {
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(254, 228, 64, 0.4);
    background: linear-gradient(135deg, rgba(114, 9, 183, 0.55), rgba(247, 37, 133, 0.3));
    flex-shrink: 0;
    box-sizing: border-box;
}

.canvas-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.canvas-title {
    font-size: clamp(1.1rem, 2.2vw, 1.4rem);
    font-weight: 900;
    color: #FFFFFF;
    background: linear-gradient(135deg, #ffffff, #ffb3c6, #fee440);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1.4;
    text-shadow: 0 0 15px rgba(247, 37, 133, 0.5);
}

.canvas-close-btn {
    background: #f72585;
    border: 2px solid #fee440;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.canvas-close-btn:hover {
    transform: scale(1.15) rotate(90deg);
    background: #e01e74;
    box-shadow: 0 0 20px rgba(254, 228, 64, 0.9);
}

/* Templates Selection Bar - Prominent & Beautiful */
.fairy-templates-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 12px 18px;
    background: linear-gradient(135deg, rgba(76, 201, 240, 0.2), rgba(114, 9, 183, 0.5));
    border-bottom: 2px solid rgba(254, 228, 64, 0.4);
    flex-shrink: 0;
    flex-wrap: wrap;
    z-index: 5;
}

.templates-section-label {
    color: #fee440;
    font-weight: 900;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 0 10px rgba(254, 228, 64, 0.6);
    white-space: nowrap;
}

.templates-buttons-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fairy-template-btn {
    padding: 8px 18px;
    border-radius: 50px;
    border: 2px solid rgba(254, 228, 64, 0.7);
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 0 10px rgba(254, 228, 64, 0.2);
    backdrop-filter: blur(10px);
}

.fairy-template-btn .tpl-icon {
    font-size: 1.25rem;
    filter: drop-shadow(0 0 5px rgba(254, 228, 64, 0.7));
}

.fairy-template-btn:hover {
    transform: translateY(-2px) scale(1.04);
    border-color: #fee440;
    background: rgba(247, 37, 133, 0.4);
    box-shadow: 0 6px 20px rgba(247, 37, 133, 0.7), 0 0 15px rgba(254, 228, 64, 0.6);
    color: #ffffff;
}

.fairy-template-btn.active {
    background: linear-gradient(135deg, #f72585 0%, #7209b7 100%);
    color: #ffffff;
    border: 2.5px solid #fee440;
    box-shadow: 0 0 22px rgba(247, 37, 133, 0.95), 0 0 15px rgba(254, 228, 64, 0.85);
    transform: translateY(-2px) scale(1.05);
}

/* Toolbar Controls */
.canvas-toolbar {
    display: flex;
    gap: 12px;
    padding: 8px 16px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    background: rgba(18, 0, 43, 0.98);
    border-bottom: 2px solid rgba(254, 228, 64, 0.3);
    flex-shrink: 0;
    z-index: 4;
}

.color-palette {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.color-swatch:hover {
    transform: scale(1.2);
}

.color-swatch.active {
    transform: scale(1.28);
    border-color: #fee440;
    box-shadow: 0 0 12px #fee440;
}

.color-picker-input {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid #fee440;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
}

.brush-sizes {
    display: flex;
    gap: 6px;
    align-items: center;
}

.brush-size-btn {
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}

.brush-size-btn:hover, .brush-size-btn.active {
    background: var(--primary-color);
    border-color: #fee440;
    box-shadow: 0 0 10px rgba(247, 37, 133, 0.5);
}

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

.tool-btn {
    padding: 6px 14px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid #fee440;
    background: rgba(114, 9, 183, 0.5);
    color: white;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tool-btn:hover {
    transform: translateY(-2px);
    background: var(--primary-color);
    box-shadow: 0 4px 15px rgba(247, 37, 133, 0.5);
}

.tool-btn.active {
    background: linear-gradient(135deg, #f72585, #fee440);
    color: #12002b;
    border-color: white;
    box-shadow: 0 0 15px rgba(254, 228, 64, 0.8);
}

.save-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #fee440;
}

.save-btn:hover {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.6);
}

/* Canvas Viewport */
.fairy-canvas-viewport {
    flex: 1;
    min-height: 250px;
    position: relative;
    background: #ffffff;
    overflow: hidden;
    border-bottom-left-radius: 25px;
    border-bottom-right-radius: 25px;
    cursor: crosshair;
}

.fairy-template-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.55;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.fairy-template-layer svg {
    width: 100%;
    height: 100%;
    max-height: 90%;
    object-fit: contain;
}

#fairyDrawingBoard {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    z-index: 2;
}

@media (max-width: 768px) {
    .fairy-canvas-card {
        height: 98vh;
        max-height: 98vh;
        border-radius: 18px;
    }
    .canvas-header {
        padding: 10px 14px;
    }
    .fairy-templates-nav {
        padding: 8px 10px;
        gap: 8px;
    }
    .fairy-template-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    .canvas-toolbar {
        padding: 6px 10px;
        gap: 8px;
    }
}

/* Classroom & Interactive Teacher Styles */
.classroom-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), #fff0f5);
    padding: 30px 25px;
    border-radius: 28px;
    border: 2.5px solid rgba(247, 37, 133, 0.35);
    box-shadow: 0 15px 40px rgba(114, 9, 183, 0.15), 0 0 25px rgba(254, 228, 64, 0.2);
    margin: 25px 0;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.whiteboard {
    background: linear-gradient(145deg, #10002b 0%, #240046 100%);
    border: 10px solid #7209b7;
    outline: 3px solid #fee440;
    border-radius: 20px;
    width: 100%;
    max-width: 820px;
    min-height: 280px;
    padding: 30px 25px;
    color: #ffffff;
    box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.85), 0 12px 30px rgba(114, 9, 183, 0.35);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.teacher-area {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 820px;
    gap: 20px;
    margin-top: 10px;
    box-sizing: border-box;
}

.teacher-avatar {
    width: 110px !important;
    height: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
    border-radius: 50% !important;
    border: 3.5px solid #fee440 !important;
    background: linear-gradient(135deg, #f72585, #7209b7) !important;
    overflow: hidden !important;
    box-shadow: 0 0 25px rgba(247, 37, 133, 0.6), 0 0 15px rgba(254, 228, 64, 0.5) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

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

.speech-bubble {
    background: #ffffff;
    border: 2px solid rgba(247, 37, 133, 0.35);
    border-radius: 22px;
    padding: 18px 25px;
    position: relative;
    box-shadow: 0 8px 25px rgba(114, 9, 183, 0.12);
    flex-grow: 1;
    font-size: 1.25rem;
    line-height: 1.7;
    color: #240046;
    font-weight: 800;
}

/* ==========================================================================
   FAIRY GAMES & CANVASES STYLING (Fairy Garden Theme)
   ========================================================================== */
.games-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    box-sizing: border-box;
}

.games-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 15px 10px;
    box-sizing: border-box;
}

.games-menu h3 {
    color: #fee440 !important;
    font-size: clamp(1.6rem, 3vw, 2.2rem) !important;
    font-weight: 900 !important;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(254, 228, 64, 0.6);
}

.game-menu-btn {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(135deg, rgba(36, 0, 70, 0.95), rgba(114, 9, 183, 0.9));
    border: 2px solid #fee440;
    border-radius: 50px;
    padding: 18px 25px;
    font-size: 1.3rem;
    font-weight: 900;
    color: #ffffff !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35), 0 0 15px rgba(247, 37, 133, 0.4);
    box-sizing: border-box;
}

.game-menu-btn i {
    font-size: 1.6rem;
    color: #fee440;
    filter: drop-shadow(0 0 8px rgba(254, 228, 64, 0.8));
    transition: transform 0.3s ease;
}

.game-menu-btn:hover {
    transform: translateY(-5px) scale(1.03);
    background: linear-gradient(135deg, #f72585, #7209b7);
    border-color: #ffffff;
    box-shadow: 0 12px 35px rgba(247, 37, 133, 0.7), 0 0 25px rgba(254, 228, 64, 0.8);
}

.game-menu-btn:hover i {
    transform: rotate(15deg) scale(1.2);
}

#games-views {
    width: 100%;
    display: flex;
    justify-content: center;
}

.game-card {
    background: linear-gradient(135deg, rgba(26, 0, 51, 0.98), rgba(46, 0, 89, 0.98));
    border: 3px solid #fee440 !important;
    border-radius: 28px !important;
    padding: 30px 25px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5), 0 0 30px rgba(247, 37, 133, 0.4), inset 0 0 20px rgba(114, 9, 183, 0.3);
    width: 100%;
    max-width: 900px;
    margin: 10px auto;
    position: relative;
    box-sizing: border-box;
    animation: fairyFadeIn 0.35s ease-out;
}

.back-to-menu-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #f72585, #7209b7);
    color: #ffffff;
    border: 2px solid #fee440;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.back-to-menu-btn:hover {
    transform: translateY(-2px) scale(1.06);
    background: linear-gradient(135deg, #fee440, #f72585);
    color: #12002b;
    border-color: #ffffff;
    box-shadow: 0 0 20px rgba(254, 228, 64, 0.8);
}

.game-title {
    color: #fee440 !important;
    font-size: clamp(1.6rem, 3vw, 2.3rem) !important;
    font-weight: 900 !important;
    text-align: center;
    margin-bottom: 12px;
    margin-top: 15px;
    text-shadow: 0 0 18px rgba(254, 228, 64, 0.6);
}

.game-desc {
    color: #f1c0e8 !important;
    font-size: clamp(1.1rem, 2vw, 1.3rem) !important;
    font-weight: 700 !important;
    text-align: center;
    margin-bottom: 25px;
    line-height: 1.6;
}

.game-msg {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 900;
    margin-top: 20px;
    min-height: 35px;
    color: #fee440;
    text-shadow: 0 0 10px rgba(254, 228, 64, 0.8);
}

/* Drag & Drop in Fairy Theme */
.drag-drop-game {
    display: flex;
    flex-direction: column;
    gap: 35px;
    align-items: center;
    margin-top: 10px;
}

.ships-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    width: 100%;
}

.spaceship {
    width: 115px;
    height: 115px;
    border: 3px dashed #fee440;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 900;
    background: rgba(247, 37, 133, 0.2);
    box-shadow: 0 0 20px rgba(114, 9, 183, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spaceship i {
    font-size: 2.2rem;
    color: #fee440;
    margin-bottom: 5px;
    filter: drop-shadow(0 0 8px rgba(254, 228, 64, 0.8));
}

.spaceship.drag-over {
    background: rgba(254, 228, 64, 0.35);
    border-color: #ffffff;
    border-style: solid;
    transform: scale(1.15);
    box-shadow: 0 0 30px rgba(254, 228, 64, 0.9);
}

.meteors-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    min-height: 80px;
}

.meteor {
    background: linear-gradient(135deg, #f72585, #7209b7);
    color: #ffffff;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 900;
    font-size: 1.35rem;
    border: 2px solid #fee440;
    cursor: grab;
    box-shadow: 0 0 20px rgba(247, 37, 133, 0.6);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.meteor:hover {
    transform: translateY(-3px) scale(1.06);
    box-shadow: 0 0 25px rgba(254, 228, 64, 0.8);
}

.meteor:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.meteor.hide {
    display: none;
}

/* Fairy Memory Game */
.memory-game {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 18px;
    max-width: 650px;
    margin: 0 auto;
    perspective: 1000px;
}

.mem-card {
    height: 110px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.mem-card.flip {
    transform: rotateY(180deg);
}

.mem-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 900;
    border: 2.5px solid #fee440;
    box-shadow: 0 0 15px rgba(247, 37, 133, 0.4);
    box-sizing: border-box;
}

.mem-front {
    background: linear-gradient(135deg, #240046, #12002b);
    color: #fee440;
}

.mem-front::after {
    content: '🧚‍♀️';
    font-size: 2.2rem;
}

.mem-back {
    background: linear-gradient(135deg, #f72585, #7209b7);
    color: #ffffff;
    transform: rotateY(180deg);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

/* Sequence Game */
.sequence-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.portal-target {
    display: flex;
    gap: 14px;
    justify-content: center;
}

.portal-slot {
    width: 65px;
    height: 65px;
    border: 2.5px solid #fee440;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 900;
    color: #fee440;
    background: rgba(247, 37, 133, 0.15);
    box-shadow: inset 0 0 15px rgba(254, 228, 64, 0.4);
}

.floating-orbs {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.letter-orb {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f72585, #fee440);
    color: #12002b;
    font-size: 2rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(254, 228, 64, 0.7);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: orbFloat 3s ease-in-out infinite alternate;
}

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

.letter-orb:hover {
    transform: scale(1.18);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.9);
}

/* Cannon & Ammo Buttons */
.cannons-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cannon-btn {
    background: linear-gradient(135deg, #7209b7, #f72585);
    color: #ffffff;
    border: 2px solid #fee440;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 1.15rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.25s ease;
}

.cannon-btn:hover, .cannon-btn.active {
    background: linear-gradient(135deg, #fee440, #f72585);
    color: #12002b;
    border-color: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(254, 228, 64, 0.8);
}

/* ==========================================================================
   READING LESSON & VOCABULARY STYLES (Fairy Garden Theme)
   ========================================================================== */
.reading-content-box {
    background: #ffffff;
    border: 3px solid rgba(247, 37, 133, 0.35);
    border-radius: 28px;
    margin: 25px 0 35px 0;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(114, 9, 183, 0.15), 0 0 25px rgba(254, 228, 64, 0.15);
    box-sizing: border-box;
}

.reading-header {
    background: linear-gradient(135deg, #7209b7, #f72585);
    color: #ffffff;
    padding: 16px 25px;
    font-weight: 900;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    font-size: 1.3rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.reading-header span {
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.reading-header span i {
    color: #fee440;
    filter: drop-shadow(0 0 8px rgba(254, 228, 64, 0.8));
}

.audio-btn {
    background: #fee440 !important;
    color: #12002b !important;
    border: 2px solid #ffffff !important;
    padding: 9px 22px;
    border-radius: 50px;
    font-size: 1.05rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 900;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.audio-btn:hover {
    background: #ffffff !important;
    color: #f72585 !important;
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(254, 228, 64, 0.8);
}

.audio-btn.playing {
    background: #ef4444 !important;
    color: #ffffff !important;
    animation: pulseBtn 1s infinite alternate;
}

@keyframes pulseBtn {
    from { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }
    to { transform: scale(1.06); box-shadow: 0 0 22px rgba(239, 68, 68, 0.9); }
}

.reading-text-body {
    padding: 35px 30px;
    font-size: clamp(1.35rem, 2.3vw, 1.7rem);
    line-height: 2.3;
    color: #12002b;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
}

.reading-text-body .verse {
    font-family: 'Alexandria', 'Cairo', sans-serif;
    font-size: clamp(1.45rem, 2.5vw, 1.95rem);
    color: #065f46;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    padding: 30px 35px;
    border-radius: 22px;
    display: block;
    margin: 15px auto;
    border: 2.5px solid #10b981;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.15), inset 0 0 20px rgba(16, 185, 129, 0.05);
    line-height: 2.4;
    text-align: center;
    position: relative;
}

.reading-text-body .source {
    font-size: 1.1rem;
    color: #92400e;
    background: rgba(254, 228, 64, 0.2);
    border: 1.5px solid rgba(245, 158, 11, 0.35);
    padding: 8px 24px;
    border-radius: 50px;
    display: inline-block;
    margin-top: 18px;
    font-weight: 900;
    text-align: center;
}

.clickable-sentence {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: inline;
}

.clickable-sentence:hover {
    background: rgba(247, 37, 133, 0.15);
    color: #f72585;
    box-shadow: 0 2px 8px rgba(247, 37, 133, 0.2);
}

.clickable-sentence.playing-sentence {
    background: rgba(254, 228, 64, 0.45);
    color: #7209b7;
    font-weight: 900;
    box-shadow: 0 0 12px rgba(254, 228, 64, 0.8);
    border-radius: 8px;
}

/* Poem / Anthems (المحفوظات والأناشيد) */
.poem-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 25px;
    background: linear-gradient(135deg, #fff0f5, #fdf2f8);
    border-radius: 24px;
    border: 2px solid rgba(247, 37, 133, 0.3);
    margin: 15px auto;
    max-width: 850px;
    box-sizing: border-box;
}

.poem-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 12px 25px;
    background: #ffffff;
    border-radius: 18px;
    border: 1.5px solid rgba(254, 228, 64, 0.6);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

.poem-row .shatr {
    flex: 1;
    font-size: 1.45rem;
    font-weight: 800;
    color: #240046;
    text-align: center;
}

/* Ordered Expression (التعبير الكتابي المرتب) */
.expression-ordered {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: right;
    margin: 20px auto;
    max-width: 850px;
    box-sizing: border-box;
}

.expression-ordered p {
    background: linear-gradient(135deg, #ffffff 0%, #fff7fa 100%);
    border: 2px solid rgba(247, 37, 133, 0.25);
    border-right: 7px solid #7209b7;
    border-radius: 18px;
    padding: 18px 24px;
    font-size: 1.35rem;
    line-height: 1.85;
    color: #240046;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
    margin: 0;
    box-sizing: border-box;
}

.expression-ordered p:hover {
    transform: translateX(-6px);
    border-color: #fee440;
    border-right-color: #f72585;
    box-shadow: 0 8px 25px rgba(247, 37, 133, 0.2);
}

/* Control Section: Vocabulary & Concepts (معاني المفردات والمعنى العام) */
.control-section {
    background: linear-gradient(135deg, #ffffff 0%, #fff7fa 100%);
    border: 2.5px solid rgba(247, 37, 133, 0.35);
    border-radius: 26px;
    padding: 30px;
    margin: 35px 0;
    box-shadow: 0 12px 35px rgba(114, 9, 183, 0.1), 0 0 20px rgba(254, 228, 64, 0.15);
    position: relative;
    box-sizing: border-box;
}

.control-head {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.85rem;
    font-weight: 900;
    color: #7209b7;
    margin-bottom: 12px;
    border-bottom: 2px dashed rgba(247, 37, 133, 0.25);
    padding-bottom: 12px;
}

.badge {
    background: linear-gradient(135deg, #f72585, #fee440);
    color: #12002b;
    min-width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 15px rgba(247, 37, 133, 0.4);
    border: 2px solid #ffffff;
    flex-shrink: 0;
}

.control-section > p {
    font-size: 1.15rem;
    color: #5c0d75;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Vocabulary Grid Cards (شبكة بطاقات معاني المفردات المنظمة) */
.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 18px;
    margin: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

.highlight-box {
    background: #ffffff;
    border: 2px solid rgba(114, 9, 183, 0.2);
    border-right: 7px solid #f72585;
    padding: 16px 20px;
    border-radius: 18px;
    font-size: 1.25rem;
    line-height: 1.7;
    color: #1e1b4b;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.highlight-box:hover {
    transform: translateY(-4px);
    border-color: #fee440;
    border-right-color: #7209b7;
    box-shadow: 0 10px 25px rgba(247, 37, 133, 0.25);
}

.highlight-box strong {
    color: #f72585;
    font-weight: 900;
    font-size: 1.35rem;
    background: rgba(247, 37, 133, 0.1);
    padding: 3px 10px;
    border-radius: 8px;
    border: 1px solid rgba(247, 37, 133, 0.2);
}

.example-item {
    background: #ffffff;
    padding: 14px 20px;
    border-radius: 16px;
    border: 2px solid rgba(247, 37, 133, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 1.35rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.example-item .old {
    color: #9ca3af;
    text-decoration: line-through;
}

.example-item .new {
    color: #10b981;
    font-weight: 900;
}

.word-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.word-cloud span {
    background: linear-gradient(135deg, #fdf2f8, #f5d0fe);
    border: 1.5px solid rgba(247, 37, 133, 0.3);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 800;
    color: #7209b7;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

/* Q & A Box */
.qa-box {
    background: #ffffff;
    border: 2.5px solid rgba(16, 185, 129, 0.4);
    border-radius: 22px;
    padding: 22px 25px;
    margin: 20px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.qa-box .question {
    color: #065f46;
    font-weight: 900;
    font-size: 1.35rem;
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.qa-box .q-mark {
    background: #10b981;
    color: white;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 1rem;
}

.qa-box .answer {
    color: #1f2937;
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.7;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.qa-box .a-mark {
    background: #f72585;
    color: white;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 1rem;
}

/* Final Sentence & Highlight Text */
.highlight-text {
    background: linear-gradient(135deg, rgba(254, 228, 64, 0.2), rgba(247, 37, 133, 0.15));
    border: 2px solid #fee440;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.final-sentence {
    color: #7209b7;
    font-size: 2rem;
    font-weight: 900;
    margin-top: 8px;
}

/* ==========================================================================
   DICTATION & VOICE COACH (Fairy Garden Theme)
   ========================================================================== */
.dictation-container {
    background: linear-gradient(135deg, #ffffff 0%, #fff7fa 100%);
    border-radius: 28px;
    padding: 35px 25px;
    border: 3px solid rgba(247, 37, 133, 0.35);
    color: #240046;
    box-shadow: 0 15px 40px rgba(114, 9, 183, 0.15), 0 0 25px rgba(254, 228, 64, 0.15);
    max-width: 900px;
    margin: 20px auto;
    box-sizing: border-box;
}

.dictation-header {
    text-align: center;
    margin-bottom: 25px;
}

.dictation-header h3 {
    color: #7209b7;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin-bottom: 10px;
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(114, 9, 183, 0.2);
}

.dictation-header h3 i {
    color: #fee440;
    filter: drop-shadow(0 0 8px rgba(254, 228, 64, 0.8));
}

.dictation-header p {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    color: #f72585;
    font-weight: 700;
    margin: 0;
}

.sub-tabs-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.dictation-sub-btn {
    background: #ffffff;
    color: #7209b7;
    border: 2px solid rgba(114, 9, 183, 0.25);
    border-radius: 50px;
    padding: 8px 18px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 900;
    font-size: 1.05rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.dictation-sub-btn.active, .dictation-sub-btn:hover {
    background: linear-gradient(135deg, #f72585, #7209b7);
    color: #ffffff !important;
    border-color: #fee440;
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 6px 18px rgba(247, 37, 133, 0.4), 0 0 10px rgba(254, 228, 64, 0.4);
}

.dictation-workspace {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.dictation-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
    flex-wrap: wrap;
}

/* Action Buttons (Fairy Garden Style) */
.action-btn {
    padding: 13px 26px !important;
    border-radius: 50px !important;
    font-size: 1.15rem !important;
    font-weight: 900 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    border: 2px solid #fee440 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

.action-btn:hover {
    transform: translateY(-3px) scale(1.05) !important;
}

.action-btn i {
    font-size: 1.25rem;
}

/* Play Dictation Button */
.cosmic-btn {
    background: linear-gradient(135deg, #f72585, #7209b7) !important;
    color: #ffffff !important;
}

.cosmic-btn:hover {
    background: linear-gradient(135deg, #7209b7, #f72585) !important;
    box-shadow: 0 10px 25px rgba(247, 37, 133, 0.6), 0 0 15px rgba(254, 228, 64, 0.6) !important;
}

/* Clear Canvas Button */
.btn-secondary {
    background: linear-gradient(135deg, #4cc9f0, #7209b7) !important;
    color: #ffffff !important;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7209b7, #4cc9f0) !important;
    box-shadow: 0 10px 25px rgba(76, 201, 240, 0.6) !important;
}

/* Show Answer Button */
.success-btn {
    background: linear-gradient(135deg, #fee440, #f72585) !important;
    color: #12002b !important;
    border-color: #ffffff !important;
    text-shadow: none !important;
}

.success-btn:hover {
    background: linear-gradient(135deg, #f72585, #fee440) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 25px rgba(254, 228, 64, 0.8) !important;
}

/* Dictation Blackboard Canvas Frame */
.canvas-wrapper {
    background: #180b2c;
    border: 3.5px solid #fee440;
    border-radius: 24px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(114, 9, 183, 0.35), 0 0 25px rgba(254, 228, 64, 0.3);
    width: 100%;
    max-width: 750px;
    box-sizing: border-box;
}

#dictation-board {
    display: block;
    width: 100%;
    cursor: crosshair;
    touch-action: none;
}

.dictation-actions {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 5px;
}

.dictation-answer {
    font-size: clamp(2rem, 4vw, 2.6rem);
    font-weight: 900;
    color: #7209b7;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 3px dashed #f59e0b;
    border-radius: 22px;
    padding: 16px 40px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.25);
    margin-top: 15px;
    letter-spacing: 2px;
    animation: fairyAnswerPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fairyAnswerPop {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}



