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

:root {
    --primary-color: #ff007f; /* Vibrant K-Pop Pink */
    --secondary-color: #7209b7; /* Deep Purple */
    --accent-color: #00f0ff; /* Glowing Demon Cyan */
    --gold-accent: #ffd32a; /* Stardust Gold */
    --background-color: #090414; /* Dark Demon Realm */
    --card-bg: rgba(255, 255, 255, 0.96); /* Bright frosted glass for text readability */
    --text-main: #10002b; /* Very Dark Purple for contrast inside cards */
    --text-muted: #5a189a;
    --success-color: #00f0ff;
    --error-color: #ff007f;
    --border-radius: 30px; 
    --shadow: 0 15px 35px rgba(255, 0, 127, 0.4);
    --fairy-glow: 0 0 25px rgba(255, 0, 127, 0.85), 0 0 45px rgba(0, 240, 255, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

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;
    display: flex;
    flex-direction: column;
}

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

/* Header & Gamification */
/* Professional Fairy Header */
.fairy-header {
    background: linear-gradient(135deg, rgba(26, 8, 48, 0.96) 0%, rgba(10, 2, 22, 0.98) 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 35px rgba(255, 0, 127, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 3px solid #ff007f;
    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;
    transition: all 0.3s ease;
}

/* Lesson Mode Header (Active inside Lessons: keeps only Profile, Return to Chapters, and Home) */
.fairy-header.lesson-mode-header {
    padding: 0.5rem 1.8rem !important;
    justify-content: space-between !important;
}

.fairy-header.lesson-mode-header .fairy-header-center {
    display: none !important;
}

.fairy-header.lesson-mode-header #multTableBtn,
.fairy-header.lesson-mode-header #playFairiesBtn {
    display: none !important;
}

.fairy-header.lesson-mode-header #headerBackToChaptersBtn {
    display: inline-flex !important;
}

.btn-header-back-chapters {
    background: linear-gradient(135deg, #7209b7 0%, #ff007f 100%);
    border: 1.5px solid #00f0ff;
    color: #ffffff !important;
    padding: 7px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Alexandria', 'Cairo', sans-serif;
    text-decoration: none;
}

.btn-header-back-chapters:hover {
    background: linear-gradient(135deg, #00f0ff 0%, #ff007f 100%);
    color: #090414 !important;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.8);
}

/* 1. Student Profile (Right side in RTL) */
.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, #ff007f 0%, #3c096c 100%);
    border: 2.5px solid #00f0ff;
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.8), 0 0 30px rgba(0, 240, 255, 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.1) rotate(5deg);
    box-shadow: 0 0 30px rgba(255, 0, 127, 1), 0 0 45px rgba(0, 240, 255, 0.9);
}

.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: linear-gradient(135deg, #ff007f, #00f0ff);
    border: 1.5px solid #ffd32a;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.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 12px rgba(255, 0, 127, 0.9);
    margin: 0;
    line-height: 1.2;
}

.student-grade-pill {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 800;
    color: #00f0ff;
    background: rgba(255, 0, 127, 0.25);
    border: 1px solid rgba(0, 240, 255, 0.5);
    border-radius: 20px;
    padding: 3px 10px;
    margin-top: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* 2. 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.25rem, 2.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.8rem;
    color: #e0aaff;
    margin: 3px 0 0 0;
    font-weight: 600;
}

/* 3. Actions / Buttons (Left side in RTL) */
.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%);
}

.btn-play-fairies:active {
    transform: scale(0.95);
}

.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.1);
    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.3);
    border-color: #fee440;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(247, 37, 133, 0.4);
}

/* Header 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: 4px;
    }
    .user-profile-header {
        order: 1;
    }
    .header-actions {
        order: 2;
    }
    .user-avatar-glow {
        width: 52px;
        height: 52px;
    }
    .student-name {
        font-size: 1.1rem;
    }
    .btn-play-fairies {
        padding: 6px 12px;
        font-size: 0.82rem;
    }
    .btn-magical-back {
        padding: 6px 12px;
        font-size: 0.82rem;
    }
}

/* --- 7-Second Profile Magic Effects & Lighting --- */
.magic-glow-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    box-shadow: inset 0 0 100px rgba(247, 37, 133, 0.7), inset 0 0 160px rgba(254, 228, 64, 0.5), inset 0 0 200px rgba(76, 201, 240, 0.4);
    animation: magicalAuraPulse 1.2s ease-in-out infinite alternate;
    transition: opacity 0.8s ease;
}

@keyframes magicalAuraPulse {
    0% {
        box-shadow: inset 0 0 90px rgba(247, 37, 133, 0.8), inset 0 0 160px rgba(254, 228, 64, 0.6);
        background: radial-gradient(circle at 50% 10%, rgba(247, 37, 133, 0.18), transparent 70%);
    }
    50% {
        box-shadow: inset 0 0 130px rgba(76, 201, 240, 0.8), inset 0 0 190px rgba(254, 228, 64, 0.7);
        background: radial-gradient(circle at 50% 50%, rgba(76, 201, 240, 0.22), transparent 75%);
    }
    100% {
        box-shadow: inset 0 0 110px rgba(254, 228, 64, 0.8), inset 0 0 170px rgba(247, 37, 133, 0.7);
        background: radial-gradient(circle at 50% 90%, rgba(254, 228, 64, 0.2), transparent 70%);
    }
}

/* Avatar Royal Halo during Magic */
.user-avatar-glow.magic-active {
    animation: royalFairyGlow 1.2s ease-in-out infinite alternate !important;
}

@keyframes royalFairyGlow {
    0% {
        transform: scale(1.18) rotate(0deg);
        box-shadow: 0 0 35px #fee440, 0 0 60px #f72585, 0 0 90px #4cc9f0;
    }
    100% {
        transform: scale(1.26) rotate(6deg);
        box-shadow: 0 0 50px #f72585, 0 0 80px #fee440, 0 0 120px #ff70a6;
    }
}

/* Cute Platform Dancing & Bobbing (7 seconds) */
.magic-platform-dancing {
    animation: cutePlatformDance 1.4s ease-in-out infinite alternate;
}

@keyframes cutePlatformDance {
    0% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-6px) scale(1.008);
    }
    100% {
        transform: translateY(4px) scale(1);
    }
}

.magic-sparkle-card {
    animation: cardMagicSparkle 1.2s ease-in-out infinite alternate !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);
    }
}

/* Floating Magical Visual Sprites (Pure visual magic, No text) */
.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);
    }
}

/* --- Fairy Multiplication Button & Table Section --- */
.btn-mult-fairy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #4cc9f0 0%, #7209b7 100%);
    color: #FFFFFF !important;
    border-radius: 50px;
    font-weight: 900;
    font-size: 0.95rem;
    box-shadow: 0 4px 18px rgba(76, 201, 240, 0.45), 0 0 15px rgba(254, 228, 64, 0.3);
    border: 2px solid #fee440;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-mult-fairy:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(76, 201, 240, 0.7), 0 0 25px rgba(254, 228, 64, 0.6);
    background: linear-gradient(135deg, #7209b7 0%, #4cc9f0 100%);
}

.btn-mult-fairy .mult-btn-icon {
    font-size: 1.15rem;
    animation: rotateIcon 4s linear infinite;
}

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

.mult-nav-bar {
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 8px;
    width: 100%;
}

.mult-tabs-scroll {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.mult-tab-btn {
    background: rgba(36, 0, 70, 0.75);
    border: 2px solid rgba(255, 255, 255, 0.25);
    color: #f1c0e8;
    font-family: 'Alexandria', 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    padding: 9px 18px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mult-tab-btn:hover {
    transform: translateY(-3px);
    border-color: #ff70a6;
    color: #fee440;
    box-shadow: 0 6px 18px rgba(247, 37, 133, 0.4);
}

.mult-tab-btn.active {
    background: linear-gradient(135deg, #f72585, #7209b7);
    color: #FFFFFF;
    border-color: #fee440;
    box-shadow: 0 6px 20px rgba(247, 37, 133, 0.6);
    transform: translateY(-2px) scale(1.05);
}

.mult-tab-btn.full-grid-tab.active {
    background: linear-gradient(135deg, #4cc9f0, #0077b6);
    color: #FFFFFF;
    box-shadow: 0 6px 20px rgba(76, 201, 240, 0.6);
}

.mult-tab-btn.quiz-tab.active {
    background: linear-gradient(135deg, #fee440, #ff9e00);
    color: #12002b;
    border-color: #FFFFFF;
    box-shadow: 0 6px 20px rgba(254, 228, 64, 0.7);
}

.mult-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.4rem;
    margin-bottom: 2.5rem;
    width: 100%;
}

.mult-equation-card {
    background: linear-gradient(135deg, rgba(46, 0, 85, 0.9) 0%, rgba(20, 0, 48, 0.95) 100%);
    border-radius: 24px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top: 5px solid #ff70a6;
    padding: 1.4rem 1.2rem;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    cursor: pointer;
}

.mult-equation-card:hover {
    transform: translateY(-6px) scale(1.03);
    border-color: #fee440;
    box-shadow: 0 14px 30px rgba(247, 37, 133, 0.4);
}

.mult-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.mult-item-tag {
    font-size: 0.82rem;
    font-weight: 800;
    background: rgba(254, 228, 64, 0.18);
    color: #fee440;
    border: 1px solid rgba(254, 228, 64, 0.4);
    padding: 3px 12px;
    border-radius: 12px;
}

.mult-speaker-btn {
    background: rgba(36, 0, 70, 0.9);
    border: 1.5px solid #ff70a6;
    color: #FFFFFF;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.mult-speaker-btn:hover {
    background: #fee440;
    color: #12002b;
    transform: scale(1.15);
}

.mult-equation-text {
    font-size: 1.85rem;
    font-weight: 900;
    color: #FFFFFF;
    margin-bottom: 0.6rem;
    line-height: 1.2;
}

.mult-result-highlight {
    color: #fee440;
    background: rgba(254, 228, 64, 0.16);
    padding: 3px 12px;
    border-radius: 14px;
    border: 1.5px solid rgba(254, 228, 64, 0.4);
    display: inline-block;
    text-shadow: 0 0 12px rgba(254, 228, 64, 0.5);
}

.mult-visual-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    align-items: center;
    min-height: 36px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
    font-size: 1.1rem;
}

/* Full Grid Table */
.mult-full-grid-wrap {
    background: linear-gradient(135deg, rgba(36, 0, 70, 0.95), rgba(18, 0, 43, 0.98));
    border-radius: 25px;
    padding: 1.8rem;
    border: 2.5px solid #fee440;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), 0 0 30px rgba(247, 37, 133, 0.3);
    overflow-x: auto;
    width: 100%;
}

.mult-grid-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.mult-grid-table th, .mult-grid-table td {
    padding: 12px 10px;
    border: 2px solid rgba(114, 9, 183, 0.5);
    font-size: 1.15rem;
    font-weight: 800;
    transition: all 0.2s ease;
}

.mult-grid-table th {
    background: linear-gradient(135deg, #f72585, #7209b7);
    color: #FFFFFF;
    font-size: 1.25rem;
}

.mult-grid-table th.grid-corner {
    background: #12002b;
    color: #fee440;
    font-size: 1.5rem;
}

.mult-grid-table td {
    background: rgba(36, 0, 70, 0.6);
    color: #fce7f3;
    cursor: pointer;
}

.mult-grid-table td:hover, .mult-grid-table td.active-cell {
    background: #fee440;
    color: #12002b;
    transform: scale(1.18);
    box-shadow: 0 0 18px rgba(254, 228, 64, 0.85);
    z-index: 2;
    border-radius: 8px;
    font-weight: 900;
}

/* Quiz Box */
.mult-quiz-box {
    background: linear-gradient(135deg, rgba(60, 9, 108, 0.95) 0%, rgba(26, 0, 56, 0.98) 100%);
    border-radius: 28px;
    border: 2.5px solid #fee440;
    padding: 2rem 1.8rem;
    text-align: center;
    max-width: 650px;
    margin: 0 auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 35px rgba(254, 228, 64, 0.4);
    width: 100%;
}

.quiz-fairy-avatar {
    font-size: 3.5rem;
    margin-bottom: 8px;
    animation: gentleFloat 2.5s infinite ease-in-out;
}

.gamification {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #FFF;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    border: 2px solid var(--accent-color);
}

.star-icon {
    color: #FFD700;
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

.score-text {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-main);
}

/* Main Layout */
.container {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem;
    gap: 2rem;
}

/* Sidebar */
.sidebar-panel {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mascot-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Curriculum Nav */
.curriculum-nav {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.5);
    backdrop-filter: blur(10px);
}

.nav-title {
    color: var(--secondary-color);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    border-bottom: 2px dashed rgba(46,196,182,0.3);
    padding-bottom: 0.8rem;
}

.nav-chapter {
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 1rem;
    margin-top: 1.5rem; /* Space between chapters */
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-chapter:first-child {
    margin-top: 0;
}

.nav-lessons-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.nav-lesson-item {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px; /* Rounded box feel */
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    color: var(--text-main);
    border: 2px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.nav-lesson-item::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; right: -50%; bottom: -50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.4), transparent);
    opacity: 0;
    transition: opacity 0.4s;
    transform: rotate(45deg);
}

.nav-lesson-item:hover {
    border-color: var(--accent-color);
    color: var(--primary-color);
    transform: translateX(-5px) scale(1.02);
    box-shadow: var(--fairy-glow);
}
.nav-lesson-item:hover::before {
    opacity: 1;
}

.nav-lesson-item.active {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    border-color: transparent;
    box-shadow: var(--fairy-glow);
}
.nav-lesson-item.active i {
    color: #FFF;
}

.emoji-mascot {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.5));
    box-shadow: var(--fairy-glow);
    border: 5px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 5rem;
    animation: floatMascot 4s ease-in-out infinite, magicGlow 2s infinite alternate;
    backdrop-filter: blur(10px);
}

@keyframes floatMascot {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}
@keyframes magicGlow {
    0% { box-shadow: 0 0 20px rgba(247, 37, 133, 0.4); }
    100% { box-shadow: 0 0 40px rgba(76, 201, 240, 0.8); }
}

.mascot-message {
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    font-weight: 600;
    color: var(--secondary-color);
}
.mascot-message::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px 10px;
    border-style: solid;
    border-color: transparent transparent white transparent;
}

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Navigation Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    background: var(--card-bg);
    padding: 0.5rem;
    border-radius: 50px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 50px;
    background: transparent;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    box-shadow: var(--fairy-glow);
}

.tab-btn:hover:not(.active) {
    background: rgba(206, 147, 216, 0.15);
    color: var(--text-main);
}

/* Cards */
.card {
    background: var(--card-bg);
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 10 Q 25 25 10 40' stroke='%23ce93d8' stroke-width='1' fill='none' opacity='0.3'/%3E%3Ccircle cx='50' cy='50' r='2' fill='%23f48fb1' opacity='0.3'/%3E%3C/svg%3E");
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
    border: 2px solid rgba(244, 143, 177, 0.3);
    display: none;
    animation: fadeIn 0.5s ease forwards;
}

.card.active {
    display: block;
}

.card-title {
    color: var(--secondary-color);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px dashed rgba(46,196,182,0.3);
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* Explanation Section */
.explanation-block {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    border-right: 5px solid var(--primary-color);
    font-size: 1.2rem;
    line-height: 1.8;
}
.highlight-block {
    background: #FFF9E6;
    border-right-color: #FFD700;
    font-weight: bold;
}

/* Vocabulary */
.vocab-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}
.vocab-tag {
    background: var(--secondary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(46,196,182,0.3);
}

/* Exercises */
.exercise {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px solid #E2E8F0;
    transition: border-color 0.3s;
}
.exercise:hover {
    border-color: var(--primary-color);
}

.exercise-prompt {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
}

/* Pattern Sequence */
.pattern-sequence {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    direction: ltr; /* Render LTR visually, but logical right-to-left in data */
    justify-content: center;
}

.pattern-item {
    padding: clamp(0.5rem, 1.5vw, 1rem);
    background: #F8FAFC;
    border-radius: 10px;
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: bold;
    color: var(--secondary-color);
    min-width: 0;
    flex: 1 1 0;
    text-align: center;
    border: 2px solid #E2E8F0;
    white-space: nowrap;
}

.pattern-input {
    width: 100%;
    max-width: 120px;
    min-width: 60px;
    padding: clamp(0.5rem, 1.5vw, 1rem);
    font-size: clamp(1rem, 3vw, 1.5rem);
    text-align: center;
    border: 3px dashed var(--primary-color);
    border-radius: 10px;
    outline: none;
    transition: all 0.3s;
    background: #FFF;
    color: var(--primary-color);
    font-weight: bold;
}

.pattern-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(46,196,182,0.2);
}

.pattern-input.correct {
    border-color: var(--success-color);
    border-style: solid;
    color: var(--success-color);
    background: #F0FDF4;
}

.pattern-input.incorrect {
    border-color: var(--error-color);
    background: #FEF2F2;
    animation: shake 0.5s;
}

.rule-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    background: #F8FAFC;
    padding: 1rem;
    border-radius: 10px;
}
.rule-input {
    width: 100px;
    padding: 0.5rem;
    font-size: 1.2rem;
    text-align: center;
    border: 2px solid #CBD5E1;
    border-radius: 8px;
    outline: none;
}

/* Fill Blanks & Word Problems */
.fill-blanks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}
.fill-item {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    white-space: nowrap;
}
.fill-input {
    flex: 1;
    padding: 0.8rem;
    font-size: 1.2rem;
    border: 2px solid #CBD5E1;
    border-radius: 8px;
    text-align: center;
    outline: none;
    transition: all 0.3s;
}

/* Vertical Math Layout */
.vertical-math {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1.2;
    margin: 0 1rem;
    direction: ltr; /* Numbers should align right/LTR */
}

.math-row {
    display: flex;
    justify-content: flex-end;
    gap: 0.2rem;
}

.math-row span {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1.5rem;
    height: 1.5rem;
}

.carry-row {
    font-size: 1rem;
    min-height: 1.5rem;
    margin-bottom: 0.2rem;
    align-items: center;
}

.carry-digit {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1.5rem;
    height: 1.5rem;
    background-color: #3B82F6; /* Blue circle */
    color: white;
    border-radius: 50%;
    font-size: 0.9rem;
    margin: 0;
}

/* Long Division Layout */
.long-division {
    display: inline-table;
    vertical-align: middle;
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.5rem;
    font-weight: bold;
    direction: ltr; /* Math is LTR */
    margin: 0 10px;
}
.ld-row {
    display: table-row;
}
.ld-quotient {
    display: table-cell;
    padding-bottom: 2px;
}
.ld-dividend {
    display: table-cell;
    border-top: 2px solid var(--text-main);
    border-right: 2px solid var(--text-main);
    padding: 2px 8px 0 8px;
    letter-spacing: 2px;
}
.ld-divisor {
    display: table-cell;
    vertical-align: top;
    padding: 2px 8px 0 8px;
}

/* Fraction Layout */
.fraction {
    display: inline-flex;
    flex-direction: column;
    vertical-align: middle;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    margin: 0 5px;
    line-height: 1.2;
}
.fraction .num {
    border-bottom: 2px solid var(--text-main);
    padding: 0 5px;
}
.fraction .den {
    padding: 0 5px;
}

/* Mixed Number Layout */
.mixed-number {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    direction: rtl;
    vertical-align: middle;
    margin: 0 5px;
}
.mixed-number .whole {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--secondary-color);
}

.op-row {
    position: relative;
}

.op-row .op {
    position: absolute;
    left: -2rem; /* Place operator to the left */
    color: var(--primary-color);
}

.math-divider {
    width: 100%;
    height: 3px;
    background-color: var(--text-main);
    margin: 0.5rem 0;
}

.fill-input.vertical-input {
    width: 100%;
    margin-top: 0;
}

.btn-check {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(46,196,182,0.3);
    transition: all 0.3s;
    display: block;
    margin: 2rem auto 0;
    width: fit-content;
}
.btn-check:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46,196,182,0.4);
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Fairy Garden Custom Elements */
.lesson-fairy-btn {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cdefs%3E%3CradialGradient id='g2' cx='50%25' cy='50%25' r='50%25'%3E%3Cstop offset='0%25' stop-color='%23ffffff' /%3E%3Cstop offset='40%25' stop-color='%2380deea' /%3E%3Cstop offset='100%25' stop-color='%23b39ddb' /%3E%3C/radialGradient%3E%3CradialGradient id='c1' cx='50%25' cy='50%25' r='50%25'%3E%3Cstop offset='0%25' stop-color='%23fff59d' /%3E%3Cstop offset='100%25' stop-color='%23ffb300' /%3E%3C/radialGradient%3E%3C/defs%3E%3Cg fill='url(%23g2)'%3E%3Ccircle cx='100' cy='55' r='45' /%3E%3Ccircle cx='142.7' cy='86' r='45' /%3E%3Ccircle cx='126.1' cy='136.4' r='45' /%3E%3Ccircle cx='73.9' cy='136.4' r='45' /%3E%3Ccircle cx='57.3' cy='86' r='45' /%3E%3C/g%3E%3Ccircle cx='100' cy='100' r='30' fill='url(%23c1)' /%3E%3C/svg%3E") center/contain no-repeat;
    border: none;
    border-radius: 0; 
    width: 150px;
    height: 150px;
    min-width: unset;
    padding: 0;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    font-family: var(--font-main);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: visible;
    filter: drop-shadow(0 0 15px rgba(76, 201, 240, 0.6));
    margin: 15px;
}
.lesson-fairy-btn::before {
    display: none;
}
.lesson-fairy-btn:hover {
    transform: scale(1.15) translateY(-5px) rotate(-10deg);
    filter: drop-shadow(0 0 35px rgba(76, 201, 240, 0.9));
}
.lesson-fairy-btn:hover::before {
    display: none;
}
.lesson-icon {
    font-size: 2.2rem;
    position: relative;
    color: var(--primary-color);
    filter: drop-shadow(0 4px 5px rgba(0,0,0,0.3));
    transition: transform 0.3s;
}
.lesson-fairy-btn:hover .lesson-icon {
    transform: rotate(10deg) scale(1.1);
}
.lesson-icon .audio-icon {
    position: absolute;
    bottom: -5px;
    right: -10px;
    font-size: 1.5rem;
    color: #fff;
    background: var(--primary-color);
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.lesson-info {
    text-align: right;
    z-index: 1;
}
.lesson-num {
    font-size: 1.2rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.lesson-title {
    font-size: 1rem;
    color: #fff;
    font-weight: bold;
    opacity: 0.95;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.stardust-trail {
    position: absolute;
    top: 50px;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 15px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 100' preserveAspectRatio='none'%3E%3Cpath d='M10,0 C20,25 0,75 10,100' stroke='%23fee440' stroke-width='4' fill='none' stroke-dasharray='10 5'/%3E%3C/svg%3E");
    background-size: 100% 200px;
    filter: drop-shadow(0 0 10px var(--gold-accent));
    z-index: 1;
    opacity: 0.9;
    animation: stardustFlow 3s linear infinite;
}
@keyframes stardustFlow {
    from { background-position: 0 0; }
    to { background-position: 0 200px; }
}

/* Chapter fairy gate */
.chapter-fairy-btn {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cdefs%3E%3CradialGradient id='g1' cx='50%25' cy='50%25' r='50%25'%3E%3Cstop offset='0%25' stop-color='%23ffffff' /%3E%3Cstop offset='40%25' stop-color='%23f48fb1' /%3E%3Cstop offset='100%25' stop-color='%23ce93d8' /%3E%3C/radialGradient%3E%3CradialGradient id='c1' cx='50%25' cy='50%25' r='50%25'%3E%3Cstop offset='0%25' stop-color='%23fff59d' /%3E%3Cstop offset='100%25' stop-color='%23ffb300' /%3E%3C/radialGradient%3E%3C/defs%3E%3Cg fill='url(%23g1)'%3E%3Ccircle cx='100' cy='55' r='45' /%3E%3Ccircle cx='142.7' cy='86' r='45' /%3E%3Ccircle cx='126.1' cy='136.4' r='45' /%3E%3Ccircle cx='73.9' cy='136.4' r='45' /%3E%3Ccircle cx='57.3' cy='86' r='45' /%3E%3C/g%3E%3Ccircle cx='100' cy='100' r='30' fill='url(%23c1)' /%3E%3C/svg%3E") center/contain no-repeat;
    border: none;
    border-radius: 0;
    width: 160px;
    height: 160px;
    min-width: unset;
    padding: 0;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: visible;
    filter: drop-shadow(0 0 20px rgba(247, 37, 133, 0.6));
    margin: 15px;
}
.chapter-fairy-btn::before {
    display: none;
}
.chapter-fairy-btn:hover {
    transform: translateY(-15px) scale(1.1) rotate(15deg);
    filter: drop-shadow(0 0 40px rgba(254, 228, 64, 0.9));
}
.chapter-fairy-btn:hover .fairy-gate-icon {
    transform: scale(1.1) rotate(-15deg);
}
.fairy-gate-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.3));
    z-index: 1;
    transition: all 0.4s;
}
.fairy-gate-title {
    font-size: 1.2rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0,0,0,0.8);
    z-index: 1;
    max-width: 180px;
    text-align: center;
    line-height: 1.3;
}

/* Confetti */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: var(--primary-color);
    z-index: 1000;
    pointer-events: none;
    animation: fall 3s linear forwards;
}

@keyframes fall {
    to { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Responsive */
@media (max-width: 1100px) {
    .container {
        gap: 1.5rem;
        padding: 1.5rem;
    }
    .sidebar-panel {
        width: 280px;
    }
}

@media (max-width: 850px) {
    .container {
        flex-direction: column;
    }
    .sidebar-panel {
        width: 100%;
    }
    .mascot-section {
        flex-direction: row;
        gap: 1.5rem;
        align-items: center;
        background: var(--card-bg);
        padding: 1rem;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
    }
    .emoji-mascot {
        width: 90px;
        height: 90px;
        font-size: 3rem;
        flex-shrink: 0;
    }
    .mascot-message {
        margin-top: 0;
        text-align: right;
        flex: 1;
    }
    .mascot-message::before {
        display: none;
    }
    .curriculum-nav {
        margin-top: 0;
    }
    .nav-lessons-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 0.5rem;
    }
    .nav-lesson-item {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }


    .tabs {
        flex-direction: column;
        border-radius: 20px;
    }
    .tab-btn {
        padding: 0.8rem;
        font-size: 1rem;
    }
    .card-title {
        font-size: 1.4rem;
    }
    .nav-lessons-list {
        grid-template-columns: 1fr;
    }
}

/* Visual Fraction Models Container Fix */
div[style*="justify-content:center"] {
    flex-wrap: wrap !important;
    gap: 10px !important;
}

/* Visual Fraction Models */
.fraction-model {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    border: 2px solid var(--text-main);
    height: 40px;
    margin: 10px 5px;
    background-color: white;
    direction: ltr;
    width: fit-content;
    min-width: 100px;
    max-width: 100%;
}
.fraction-model .part {
    border-right: 1px solid var(--text-main);
    height: 100%;
}
.fraction-model .part:last-child {
    border-right: none;
}
.fraction-model .part.shaded {
    background-color: var(--primary-color);
    opacity: 0.8;
}

.models-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    width: 100%;
    margin-bottom: 10px;
}

/* 100-Grid Model for Decimals */
.grid-100 {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    width: 180px;
    height: 180px;
    border: 2px solid var(--text-main);
    background-color: var(--text-main);
    gap: 1px;
    margin: 10px auto;
    direction: ltr;
}
.grid-100 .cell {
    background-color: white;
}
.grid-100 .cell.shaded {
    background-color: var(--primary-color);
    opacity: 0.8;
}
.grid-100 .cell.shaded-secondary {
    background-color: var(--secondary-color);
    opacity: 0.8;
}

/* Number Line */
.number-line-container {
    padding: 20px 40px;
    margin: 10px 0;
    position: relative;
    direction: ltr;
}
.number-line {
    height: 4px;
    background-color: var(--text-main);
    position: relative;
    display: flex;
    justify-content: space-between;
}
.number-line::before, .number-line::after {
    content: '';
    position: absolute;
    top: -4px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}
.number-line::before {
    left: -10px;
    border-right: 10px solid var(--text-main);
}
.number-line::after {
    right: -10px;
    border-left: 10px solid var(--text-main);
}
.tick {
    position: relative;
    width: 2px;
    height: 15px;
    background-color: var(--text-main);
    top: -5px;
}
.tick.point::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -6px;
    width: 14px;
    height: 14px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    z-index: 2;
}
.tick-label {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    font-weight: bold;
    white-space: nowrap;
}
.tick-letter {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Place Value Table for Comparison */
.place-value-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 1rem;
}
.place-value-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 10px;
    border: 1px solid var(--text-main);
}
.place-value-table td {
    padding: 10px;
    border: 1px solid var(--text-main);
    text-align: center;
    font-weight: bold;
}
.place-value-table .comma-col {
    background-color: #f8f9fa;
    color: var(--secondary-color);
    font-size: 1.4rem;
}

/* Grid Map for Location and Direction */
.grid-map-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}
.grid-map {
    display: grid;
    grid-template-columns: repeat(11, 30px);
    grid-template-rows: repeat(11, 30px);
    border: 2px solid #64748b;
    background-image: 
        linear-gradient(#cbd5e1 1px, transparent 1px),
        linear-gradient(90deg, #cbd5e1 1px, transparent 1px);
    background-size: 30px 30px;
    background-color: white;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    border-radius: 4px;
    direction: ltr;
}
.grid-map .item {
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}
.grid-map .label {
    font-size: 10px;
    color: #64748b;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}
.grid-map .path-h {
    border-bottom: 3px solid #ef4444;
    z-index: 1;
}
.grid-map .path-v {
    border-left: 3px solid #ef4444;
    z-index: 1;
}
.grid-map .point-marker {
    width: 10px;
    height: 10px;
    background-color: #ef4444;
    border: 2px solid white;
    border-radius: 50%;
    z-index: 3;
    margin: auto;
}

/* Fractions and Mixed Numbers Styling */
.fraction {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    margin: 0 5px;
    direction: ltr; /* Ensure numbers and fractions are always LTR */
}
.fraction .num {
    padding: 2px 5px;
    line-height: 1.2;
    font-weight: bold;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 25px;
    border-bottom: none !important;
}
.fraction .den {
    padding: 2px 5px;
    border-top: 2px solid var(--text-main);
    line-height: 1.2;
    font-weight: bold;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 25px;
}
.mixed-number {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    direction: ltr;
}
.mixed-number .whole {
    margin-right: 5px; /* LTR margin */
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--text-main);
}
/* Ensure input boxes inside fractions are properly sized and aligned */
.fraction input {
    width: 40px !important;
    height: 30px !important;
    font-size: 1.2rem !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 2px 0 !important;
    border: 2px solid #2EC4B6 !important; /* Secondary color for input borders */
    border-radius: 4px !important;
    color: var(--secondary-color) !important;
}

/* Chapters View (Cakes) Styles */
.chapters-grid {
    padding: 3rem;
    gap: 3rem;
}

.chapter-cake-btn {
    background: #FDF1E7; /* Sponge cake color */
    border: none;
    border-radius: 15px; /* Base of the cake */
    padding: 3.5rem 1.5rem 1.5rem 1.5rem;
    min-width: 200px;
    height: 220px;
    cursor: pointer;
    box-shadow: 0 8px 0 #DABBA6, 0 15px 35px rgba(255, 133, 161, 0.2); /* Cake 3D base */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

/* The main frosting at the top */
.chapter-cake-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--primary-color); /* Strawberry frosting */
    border-radius: 15px 15px 0 0;
}

/* Frosting drips using box-shadows on pseudo-element */
.chapter-cake-btn::after {
    content: '';
    position: absolute;
    top: 30px;
    left: 15px;
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 
        45px 5px 0 5px var(--primary-color), 
        90px -5px 0 5px var(--primary-color), 
        135px 10px 0 5px var(--primary-color);
}

.chapter-cake-btn:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 12px 0 #DABBA6, 0 25px 45px rgba(255, 133, 161, 0.3);
}

.chapter-cake-btn .cake-icon {
    font-size: 4.5rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.1));
    z-index: 2; /* To appear above frosting drips if overlapping */
}

.chapter-cake-btn .cake-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-align: center;
    z-index: 2;
}

.btn-back-chapters {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-back-chapters:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* ===================================================================== */
/* BOT UI STYLES                                                         */
/* ===================================================================== */
.bot-floating-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), #20c997);
    color: white;
    border: 4px solid white;
    box-shadow: 0 10px 25px rgba(32, 201, 151, 0.4);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.bot-floating-btn:hover {
    transform: scale(1.1) rotate(10deg);
}
.bot-emoji {
    font-size: 2.5rem;
}
.bot-tooltip {
    position: absolute;
    left: 80px;
    background: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--secondary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    white-space: nowrap;
}
.bot-floating-btn:hover .bot-tooltip {
    opacity: 1;
    visibility: visible;
    left: 90px;
}
.bot-chat-window {
    position: fixed;
    bottom: 110px;
    left: 30px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom left;
}
.bot-chat-window.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}
.bot-chat-header {
    background: linear-gradient(135deg, var(--secondary-color), #20c997);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}
.bot-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.bot-header-emoji {
    font-size: 1.8rem;
}
.bot-chat-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
}
#bot-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}
#bot-close-btn:hover {
    transform: scale(1.2);
}
.bot-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8f9fa;
}
.bot-message, .user-message {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 1rem;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}
.bot-message {
    align-self: flex-start;
    background: white;
    color: var(--text-main);
    border-bottom-right-radius: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.user-message {
    align-self: flex-end;
    background: var(--primary-color);
    color: white;
    border-bottom-left-radius: 5px;
    box-shadow: 0 4px 10px rgba(255, 133, 161, 0.2);
}
.bot-quick-prompts {
    display: flex;
    gap: 8px;
    padding: 10px 15px;
    overflow-x: auto;
    background: #fdfdfd;
    border-top: 1px solid #f1f5f9;
}
.bot-quick-prompts::-webkit-scrollbar {
    height: 6px;
}
.bot-quick-prompts::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.quick-prompt-btn {
    background: white;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.quick-prompt-btn:hover {
    background: var(--secondary-color);
    color: white;
}
.bot-chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}
#bot-input-field {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}
#bot-input-field:focus {
    border-color: var(--secondary-color);
}
#bot-send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: transform 0.2s, background 0.3s;
}
#bot-send-btn:hover {
    transform: scale(1.1);
    background: #20c997;
}

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

.bot-typing {
    align-self: flex-start;
    background: white;
    padding: 10px 15px;
    border-radius: 20px;
    border-bottom-right-radius: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex;
    gap: 5px;
}
.typing-dot {
    width: 8px;
    height: 8px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Force Flex Row Layout for Chapters */
.chapters-grid {
    display: flex;
    flex-wrap: wrap !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 26px !important;
    width: 100% !important;
    margin: 1.5rem auto !important;
    max-width: 1200px !important;
    padding: 0 1rem;
}

/* --- K-Pop Demon Hunter Chapter Album Cards --- */
.chapter-fairy-btn {
    background: linear-gradient(135deg, rgba(45, 10, 80, 0.92) 0%, rgba(20, 3, 40, 0.98) 100%) !important;
    border: 2.5px solid rgba(0, 240, 255, 0.45) !important;
    border-radius: 28px !important;
    padding: 1.4rem 1.2rem !important;
    width: 260px !important;
    min-height: 290px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
    text-align: center !important;
    cursor: pointer !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(255, 0, 127, 0.3) !important;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    color: #FFFFFF !important;
    backdrop-filter: blur(16px) !important;
}

.chapter-fairy-btn:hover {
    transform: translateY(-8px) scale(1.04) !important;
    border-color: #00f0ff !important;
    box-shadow: 0 18px 45px rgba(255, 0, 127, 0.75), 0 0 35px rgba(0, 240, 255, 0.8) !important;
    background: linear-gradient(135deg, rgba(85, 12, 120, 0.95) 0%, rgba(30, 4, 60, 0.98) 100%) !important;
}

.chapter-fairy-btn:hover .chapter-hero-thumb img {
    transform: scale(1.1);
}

.fairy-gate-title {
    font-family: 'Alexandria', 'Cairo', sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 900 !important;
    color: #FFFFFF !important;
    text-shadow: 0 2px 12px rgba(255, 0, 127, 0.8) !important;
    line-height: 1.4 !important;
    margin: 4px 0 !important;
}

/* =========================================================
   Modern K-Pop Tracklist Grid for Lessons inside Chapters
========================================================= */
.math-lessons-deck-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 22px !important;
    width: 100% !important;
    max-width: 1100px !important;
    margin: 0 auto !important;
    padding: 0.5rem 1rem !important;
}

.math-lesson-track-card {
    background: linear-gradient(135deg, rgba(36, 8, 68, 0.94) 0%, rgba(16, 4, 30, 0.98) 100%);
    border: 2px solid rgba(0, 240, 255, 0.4);
    border-radius: 24px;
    padding: 1.3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 0, 127, 0.25);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(16px);
}

.math-lesson-track-card:hover {
    transform: translateY(-6px) scale(1.03);
    border-color: #ff007f;
    box-shadow: 0 15px 35px rgba(255, 0, 127, 0.6), 0 0 25px rgba(0, 240, 255, 0.6);
    background: linear-gradient(135deg, rgba(60, 12, 100, 0.96) 0%, rgba(26, 6, 50, 0.98) 100%);
}

.track-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.track-number-badge {
    background: rgba(255, 0, 127, 0.3);
    border: 1px solid #ff007f;
    color: #ff758f;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 800;
    font-family: 'Orbitron', monospace;
    letter-spacing: 0.5px;
}

.track-rating-badge {
    color: #ffd32a;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.track-card-body {
    display: flex;
    align-items: center;
    gap: 14px;
}

.track-hero-avatar {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 18px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #ff007f, #00f0ff);
    padding: 2.5px;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
}

.track-hero-avatar .track-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    display: block;
    transition: transform 0.3s ease;
}

.math-lesson-track-card:hover .track-hero-avatar .track-img {
    transform: scale(1.1);
}

.track-stage-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #090414;
    border: 1.5px solid #00f0ff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    box-shadow: 0 0 6px #00f0ff;
}

.track-title-info {
    flex: 1;
    text-align: right;
}

.track-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.35;
    margin: 0 0 4px 0;
    font-family: 'Cairo', 'Alexandria', sans-serif;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.track-subtitle {
    font-size: 0.78rem;
    color: #cbd5e1;
    font-weight: 700;
}

.track-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.track-launch-btn {
    background: linear-gradient(135deg, #ff007f 0%, #7209b7 100%);
    border: 1.5px solid #00f0ff;
    color: #ffffff;
    padding: 6px 18px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 12px rgba(255, 0, 127, 0.5);
    transition: all 0.25s ease;
    font-family: 'Alexandria', 'Cairo', sans-serif;
}

.math-lesson-track-card:hover .track-launch-btn {
    background: linear-gradient(135deg, #00f0ff 0%, #ff007f 100%);
    color: #090414;
    font-weight: 900;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.8);
    transform: scale(1.05);
}

/* ==========================================================================
   K-POP SUPERSTAR CONCERT STAGE & LASER LIGHT SHOW
   مسرح غناء كيبوب متكامل مع أضواء ليزر وموسيقى إيقاعية لسارة زياد
   ========================================================================== */
.kpop-concert-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 30%, rgba(30, 8, 55, 0.98) 0%, rgba(8, 2, 18, 0.99) 70%, #030008 100%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 2rem;
    box-sizing: border-box;
    overflow: hidden;
    animation: stageFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    backdrop-filter: blur(12px);
    font-family: 'Alexandria', 'Cairo', sans-serif;
    user-select: none;
    --laser-c1: #ff007f;
    --laser-c2: #00f0ff;
    --laser-c3: #ffd700;
}

.kpop-concert-modal-overlay.stage-closing {
    animation: stageFadeOut 0.5s forwards ease-in;
}

@keyframes stageFadeIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes stageFadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.92); }
}

/* -------------------------------------------------------------
   Overhead Laser Beams & Spotlight Cones
   ------------------------------------------------------------- */
.concert-lasers-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.laser-beam {
    position: absolute;
    top: -20px;
    height: 140vh;
    width: 4px;
    opacity: 0.85;
    filter: blur(1.5px);
    transform-origin: top center;
}

.laser-1 {
    left: 15%;
    background: linear-gradient(to bottom, var(--laser-c1), transparent);
    box-shadow: 0 0 25px var(--laser-c1), 0 0 50px var(--laser-c1);
    animation: laserSweepLeft 3.6s ease-in-out infinite alternate;
}

.laser-2 {
    left: 35%;
    background: linear-gradient(to bottom, var(--laser-c2), transparent);
    box-shadow: 0 0 25px var(--laser-c2), 0 0 50px var(--laser-c2);
    animation: laserSweepRight 4.2s ease-in-out infinite alternate 0.5s;
}

.laser-3 {
    left: 50%;
    background: linear-gradient(to bottom, var(--laser-c3), transparent);
    box-shadow: 0 0 30px var(--laser-c3), 0 0 60px var(--laser-c3);
    animation: laserSweepCenter 2.8s ease-in-out infinite alternate 0.2s;
}

.laser-4 {
    left: 65%;
    background: linear-gradient(to bottom, var(--laser-c1), transparent);
    box-shadow: 0 0 25px var(--laser-c1), 0 0 50px var(--laser-c1);
    animation: laserSweepLeft 4.5s ease-in-out infinite alternate 0.8s;
}

.laser-5 {
    left: 85%;
    background: linear-gradient(to bottom, var(--laser-c2), transparent);
    box-shadow: 0 0 25px var(--laser-c2), 0 0 50px var(--laser-c2);
    animation: laserSweepRight 3.4s ease-in-out infinite alternate 1.1s;
}

@keyframes laserSweepLeft {
    0% { transform: rotate(-35deg); opacity: 0.5; }
    50% { opacity: 1; }
    100% { transform: rotate(25deg); opacity: 0.6; }
}

@keyframes laserSweepRight {
    0% { transform: rotate(35deg); opacity: 0.6; }
    50% { opacity: 1; }
    100% { transform: rotate(-25deg); opacity: 0.5; }
}

@keyframes laserSweepCenter {
    0% { transform: rotate(-20deg) scaleX(1.5); }
    100% { transform: rotate(20deg) scaleX(1.5); }
}

/* Spotlight Cones */
.spotlight-cone {
    position: absolute;
    top: -50px;
    width: 280px;
    height: 120vh;
    opacity: 0.22;
    transform-origin: top center;
    pointer-events: none;
}

.spot-left {
    left: 10%;
    background: radial-gradient(ellipse at top, var(--laser-c1) 0%, transparent 75%);
    animation: spotWobbleLeft 5s infinite ease-in-out alternate;
}

.spot-right {
    right: 10%;
    background: radial-gradient(ellipse at top, var(--laser-c2) 0%, transparent 75%);
    animation: spotWobbleRight 5.5s infinite ease-in-out alternate;
}

.spot-center {
    left: calc(50% - 140px);
    background: radial-gradient(ellipse at top, var(--laser-c3) 0%, transparent 80%);
    opacity: 0.28;
    animation: spotPulseCenter 3s infinite ease-in-out alternate;
}

@keyframes spotWobbleLeft {
    0% { transform: rotate(-25deg); }
    100% { transform: rotate(15deg); }
}

@keyframes spotWobbleRight {
    0% { transform: rotate(25deg); }
    100% { transform: rotate(-15deg); }
}

@keyframes spotPulseCenter {
    0% { transform: scale(0.9); opacity: 0.2; }
    100% { transform: scale(1.15); opacity: 0.35; }
}

/* -------------------------------------------------------------
   Top Billboard & Header
   ------------------------------------------------------------- */
.concert-top-billboard {
    position: relative;
    z-index: 10;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.billboard-badge-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.concert-live-pill {
    background: linear-gradient(135deg, #ff0055 0%, #ff0000 100%);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 900;
    padding: 4px 14px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.8);
    letter-spacing: 0.5px;
}

.live-blink-dot {
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    animation: liveBlink 0.8s infinite alternate;
}

@keyframes liveBlink {
    from { opacity: 0.3; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1.3); }
}

.concert-stadium-tag {
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid #00f0ff;
    color: #00f0ff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 20px;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.concert-main-title {
    font-size: 2.2rem;
    font-weight: 900;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.2;
}

.neon-pink-text {
    color: #ff007f;
    text-shadow: 0 0 20px #ff007f, 0 0 40px #ff007f;
}

.neon-cyan-text {
    color: #00f0ff;
    text-shadow: 0 0 20px #00f0ff, 0 0 40px #00f0ff;
}

.neon-gold-icon {
    filter: drop-shadow(0 0 15px #ffd700);
}

.concert-sub-slogan {
    font-size: 0.9rem;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Equalizer Live Visualizer */
.concert-equalizer-live {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 24px;
    padding: 0 10px;
}

.concert-equalizer-live span {
    width: 5px;
    background: linear-gradient(to top, #ff007f, #00f0ff, #ffd700);
    border-radius: 3px;
    box-shadow: 0 0 8px #00f0ff;
    animation: eqPulse 0.6s infinite ease-in-out alternate;
}

.concert-equalizer-live span:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.concert-equalizer-live span:nth-child(2) { height: 80%; animation-delay: 0.3s; }
.concert-equalizer-live span:nth-child(3) { height: 100%; animation-delay: 0.05s; }
.concert-equalizer-live span:nth-child(4) { height: 60%; animation-delay: 0.4s; }
.concert-equalizer-live span:nth-child(5) { height: 90%; animation-delay: 0.2s; }
.concert-equalizer-live span:nth-child(6) { height: 50%; animation-delay: 0.5s; }
.concert-equalizer-live span:nth-child(7) { height: 85%; animation-delay: 0.15s; }
.concert-equalizer-live span:nth-child(8) { height: 95%; animation-delay: 0.35s; }
.concert-equalizer-live span:nth-child(9) { height: 70%; animation-delay: 0.25s; }
.concert-equalizer-live span:nth-child(10) { height: 45%; animation-delay: 0.45s; }

@keyframes eqPulse {
    0% { transform: scaleY(0.3); opacity: 0.6; }
    100% { transform: scaleY(1.3); opacity: 1; }
}

/* -------------------------------------------------------------
   Main Stage Arena & Superstar Sara
   ------------------------------------------------------------- */
.concert-stage-arena {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3rem;
    width: 100%;
    max-width: 950px;
    margin: auto 0;
}

/* Backup Dancers Cards */
.stage-dancer-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s;
    animation: dancerGroove 2.4s infinite ease-in-out alternate;
}

.dancer-left {
    animation-delay: 0.3s;
}

.dancer-right {
    animation-delay: 0.6s;
}

.stage-dancer-card .dancer-img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 24px;
    border: 3px solid #00f0ff;
    background: rgba(15, 3, 35, 0.8);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.6), 0 10px 20px rgba(0, 0, 0, 0.8);
}

.dancer-label {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

@keyframes dancerGroove {
    0% { transform: translateY(0) rotate(-4deg) scale(0.96); }
    50% { transform: translateY(-14px) rotate(3deg) scale(1.02); }
    100% { transform: translateY(0) rotate(-4deg) scale(0.96); }
}

/* Center Superstar Idol: Sara */
.stage-superstar-center {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 15;
    animation: superstarDance 2s infinite ease-in-out alternate;
}

@keyframes superstarDance {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-18px) scale(1.05); }
    100% { transform: translateY(0) scale(1); }
}

.idol-star-crown {
    font-size: 2.4rem;
    margin-bottom: -15px;
    z-index: 20;
    filter: drop-shadow(0 0 15px #ffd700);
    animation: crownFloat 1.8s infinite ease-in-out alternate;
}

@keyframes crownFloat {
    from { transform: translateY(0) rotate(-5deg); }
    to { transform: translateY(-8px) rotate(5deg); }
}

.idol-avatar-frame {
    position: relative;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    padding: 6px;
    background: linear-gradient(135deg, #ff007f 0%, #00f0ff 50%, #ffd700 100%);
    box-shadow: 0 0 45px rgba(255, 0, 127, 0.9), 0 0 70px rgba(0, 240, 255, 0.7);
}

.idol-main-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    border: 4px solid #ffffff;
}

.golden-mic-badge {
    position: absolute;
    bottom: 0px;
    right: -5px;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #ffd700, #ff8800);
    border: 3px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 0 20px #ffd700, 0 4px 10px rgba(0, 0, 0, 0.6);
    animation: micPulse 1.2s infinite alternate ease-in-out;
}

@keyframes micPulse {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.15) rotate(15deg); }
}

.idol-energy-sparkles {
    position: absolute;
    top: 5px;
    left: -10px;
    font-size: 2rem;
    filter: drop-shadow(0 0 10px #00f0ff);
    animation: sparkleGlow 1s infinite alternate;
}

@keyframes sparkleGlow {
    from { opacity: 0.4; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1.3); }
}

.idol-nameplate {
    margin-top: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.idol-arabic-name {
    font-size: 1.8rem;
    font-weight: 900;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 0 20px #ff007f, 0 0 35px #00f0ff;
    letter-spacing: 0.5px;
}

.idol-korean-name {
    font-size: 0.8rem;
    color: #ffd700;
    font-weight: 800;
    letter-spacing: 1px;
}

.idol-rank-badge {
    background: linear-gradient(135deg, rgba(255, 0, 127, 0.4) 0%, rgba(112, 0, 255, 0.5) 100%);
    border: 1.5px solid #ffd700;
    color: #ffffff;
    padding: 3px 14px;
    border-radius: 14px;
    font-size: 0.72rem;
    font-weight: 900;
    margin-top: 4px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* -------------------------------------------------------------
   Stage Floor & Smoke
   ------------------------------------------------------------- */
.concert-stage-floor {
    position: absolute;
    bottom: 80px;
    width: 650px;
    height: 90px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 5;
}

.stage-neon-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255, 0, 127, 0.6) 0%, rgba(0, 240, 255, 0.3) 50%, transparent 75%);
    border: 3px solid rgba(0, 240, 255, 0.7);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.8), inset 0 0 30px rgba(255, 0, 127, 0.7);
    animation: stagePulse 2s infinite alternate;
}

@keyframes stagePulse {
    0% { transform: scale(0.96); opacity: 0.7; }
    100% { transform: scale(1.04); opacity: 1; }
}

/* -------------------------------------------------------------
   Lightstick Audience Sea
   ------------------------------------------------------------- */
.concert-audience-sea {
    position: relative;
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0 5px;
    z-index: 12;
    pointer-events: none;
}

.lightstick {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 15px #ff007f);
    animation: lightstickSway 1.6s infinite ease-in-out alternate;
}

.stick-1 { animation-delay: 0.1s; filter: drop-shadow(0 0 15px #ff007f); }
.stick-2 { animation-delay: 0.3s; filter: drop-shadow(0 0 15px #00f0ff); }
.stick-3 { animation-delay: 0.5s; filter: drop-shadow(0 0 15px #ffd700); }
.stick-4 { animation-delay: 0.2s; filter: drop-shadow(0 0 15px #ff0055); }
.stick-5 { animation-delay: 0.6s; filter: drop-shadow(0 0 15px #7000ff); }
.stick-6 { animation-delay: 0.4s; filter: drop-shadow(0 0 15px #00e1ff); }
.stick-7 { animation-delay: 0.15s; filter: drop-shadow(0 0 15px #ff007f); }
.stick-8 { animation-delay: 0.45s; filter: drop-shadow(0 0 15px #ffd700); }
.stick-9 { animation-delay: 0.25s; filter: drop-shadow(0 0 15px #00f0ff); }
.stick-10 { animation-delay: 0.55s; filter: drop-shadow(0 0 15px #ff007f); }
.stick-11 { animation-delay: 0.35s; filter: drop-shadow(0 0 15px #ffd700); }
.stick-12 { animation-delay: 0.05s; filter: drop-shadow(0 0 15px #00f0ff); }

@keyframes lightstickSway {
    0% { transform: translateY(0) rotate(-20deg) scale(0.9); }
    100% { transform: translateY(-15px) rotate(20deg) scale(1.15); }
}

/* -------------------------------------------------------------
   Floating Music Notes
   ------------------------------------------------------------- */
.concert-notes-floating {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
    overflow: hidden;
}

.floating-concert-note {
    position: absolute;
    color: #ffffff;
    text-shadow: 0 0 15px #ff007f, 0 0 25px #00f0ff;
    animation: floatNoteUp linear forwards;
    pointer-events: none;
}

@keyframes floatNoteUp {
    0% { opacity: 0; transform: translateY(0) scale(0.5) rotate(0deg); }
    20% { opacity: 1; transform: translateY(-40px) scale(1.2) rotate(15deg); }
    80% { opacity: 0.9; }
    100% { opacity: 0; transform: translateY(-350px) scale(1.4) rotate(-30deg); }
}

/* -------------------------------------------------------------
   Action Controls Bar
   ------------------------------------------------------------- */
.concert-controls-bar {
    position: relative;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.concert-ctrl-btn {
    border: none;
    padding: 10px 22px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 900;
    cursor: pointer;
    font-family: 'Alexandria', 'Cairo', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
}

.btn-cheer {
    background: linear-gradient(135deg, #ff0055 0%, #ff5500 100%);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.7);
    border: 2px solid #ffd700;
}

.btn-cheer:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 0 30px rgba(255, 0, 85, 1);
}

.btn-lasers {
    background: linear-gradient(135deg, #7000ff 0%, #00f0ff 100%);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.6);
    border: 2px solid #00f0ff;
}

.btn-lasers:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 0 30px rgba(0, 240, 255, 1);
}

.btn-close-stage {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
}

.btn-close-stage:hover {
    background: rgba(255, 0, 50, 0.8);
    border-color: #ff0055;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.7);
}

/* Responsive adjust for mobile */
@media (max-width: 768px) {
    .concert-main-title {
        font-size: 1.5rem;
    }
    .stage-dancer-card {
        display: none;
    }
    .stage-superstar-center .idol-avatar-frame {
        width: 130px;
        height: 130px;
    }
    .concert-controls-bar {
        gap: 8px;
    }
    .concert-ctrl-btn {
        padding: 8px 14px;
        font-size: 0.82rem;
    }
}

