/* ==========================================================================
   ✨ K-POP IDOL STAGE THEME - DIRASATI PLATFORM - NATALIE HAITHAM (MATH GRADE 3) 💖🔢
   ========================================================================== */

:root {
    /* K-Pop Signature Colors */
    --kpop-pink: #FF2E93;
    --kpop-pink-dark: #C90064;
    --kpop-pink-glow: rgba(255, 46, 147, 0.5);
    --kpop-purple: #8A2BE2;
    --kpop-purple-light: #A855F7;
    --kpop-purple-glow: rgba(138, 43, 226, 0.45);
    --kpop-cyan: #00F5D4;
    --kpop-cyan-glow: rgba(0, 245, 212, 0.45);
    --kpop-gold: #FFD166;
    --kpop-gold-glow: rgba(255, 209, 102, 0.45);
    --kpop-lilac: #E0AAFF;
    --kpop-rose: #FF758F;
    
    /* Dark Stage Arena Palette */
    --kpop-bg: #0C0819;
    --kpop-panel: #140F27;
    --kpop-card: rgba(26, 19, 48, 0.85);
    --kpop-card-hover: rgba(38, 28, 70, 0.95);
    --kpop-border: rgba(255, 46, 147, 0.3);
    --kpop-border-glow: rgba(138, 43, 226, 0.4);

    /* System Variable Mapping & Compatibility */
    --roblox-red: #FF2E93;
    --roblox-red-dark: #C90064;
    --roblox-red-glow: rgba(255, 46, 147, 0.5);
    --roblox-blue: #8A2BE2;
    --roblox-blue-glow: rgba(138, 43, 226, 0.45);
    --roblox-green: #00F5D4;
    --roblox-green-glow: rgba(0, 245, 212, 0.45);
    --roblox-gold: #FFD166;
    --roblox-gold-glow: rgba(255, 209, 102, 0.45);
    
    --roblox-bg: #0C0819;
    --roblox-panel: #140F27;
    --roblox-card: rgba(26, 19, 48, 0.85);
    --roblox-card-hover: rgba(38, 28, 70, 0.95);
    --roblox-border: rgba(255, 46, 147, 0.3);
    --roblox-border-glow: rgba(138, 43, 226, 0.4);

    --primary-color: #FF2E93;
    --primary-light: #FF6BAA;
    --secondary-color: #8A2BE2;
    --secondary-light: #B76DF2;
    --accent-color: #00F5D4;
    --accent-light: #70FFF0;
    --success-color: #00F5D4;
    --danger-color: #FF2E93;
    --background-color: #0C0819;
    --card-bg: rgba(26, 19, 48, 0.85);
    --text-main: #FFFFFF;
    --text-muted: #B8A9D9;
    --text-dim: #7B6E9C;
    
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 12px 35px rgba(255, 46, 147, 0.4);
    --border-radius: 16px;
    --radius-xl: 24px;
    --radius-lg: 18px;
    --transition-speed: 0.25s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body.roblox-theme,
body.kpop-theme {
    font-family: 'Cairo', 'Changa', 'Tajawal', 'Fredoka', 'Quicksand', 'Nunito', sans-serif;
    background-color: var(--kpop-bg);
    background-image: 
        radial-gradient(ellipse at 20% 0%, rgba(255, 46, 147, 0.24) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 0%, rgba(138, 43, 226, 0.24) 0%, transparent 55%),
        radial-gradient(circle at 50% 95%, rgba(0, 245, 212, 0.14) 0%, transparent 60%),
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 38px 38px, 38px 38px;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    direction: rtl;
    position: relative;
}

/* Hide header automatically when inside a lesson */
body.lesson-mode .app-header {
    display: none !important;
}

/* =========================================
   Floating K-Pop Stage Background Elements
   ========================================= */
.roblox-floating-bg,
.kpop-floating-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.r-blox {
    position: absolute;
    font-size: 2.3rem;
    opacity: 0.35;
    filter: drop-shadow(0 0 15px rgba(255, 46, 147, 0.45));
    animation: floatBlox 7s ease-in-out infinite alternate;
}

.blox-1 { top: 12%; right: 8%; animation-delay: 0s; font-size: 2.6rem; }
.blox-2 { top: 35%; left: 6%; animation-delay: 1.5s; font-size: 2.8rem; }
.blox-3 { top: 75%; right: 12%; animation-delay: 3s; font-size: 2.4rem; }
.blox-4 { top: 55%; right: 4%; animation-delay: 2s; font-size: 2.5rem; }
.blox-5 { top: 22%; left: 18%; animation-delay: 4s; font-size: 2.2rem; }
.blox-6 { top: 82%; left: 10%; animation-delay: 2.5s; font-size: 2.6rem; }
.blox-7 { top: 68%; left: 45%; animation-delay: 5s; font-size: 2.3rem; }
.blox-8 { top: 8%; left: 40%; animation-delay: 3.5s; font-size: 2.7rem; }
.blox-9 { top: 44%; left: 88%; animation-delay: 1s; font-size: 2.2rem; }
.blox-10 { top: 90%; right: 35%; animation-delay: 4.5s; font-size: 2.4rem; }

@keyframes floatBlox {
    0% { transform: translateY(0) rotate(0deg) scale(1); }
    50% { transform: translateY(-26px) rotate(14deg) scale(1.1); }
    100% { transform: translateY(12px) rotate(-12deg) scale(0.95); }
}

/* =========================================
   K-Pop Concert Stage Header & Navigation
   ========================================= */
.app-header.roblox-header,
.app-header.kpop-header {
    background: linear-gradient(180deg, #18112E 0%, #0F0A1E 100%);
    color: #FFF;
    padding: 1.5rem 4% 1.2rem 4%;
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, #FF2E93, #8A2BE2, #00F5D4, #FFD166, #FF2E93) 1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 4px 20px var(--kpop-pink-glow);
    position: relative;
    z-index: 10;
    border-radius: 0 0 24px 24px;
    margin-bottom: 2rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
    gap: 1rem;
    flex-wrap: wrap;
}

/* VIP K-Pop Idol Pass Badge */
.user-info.roblox-badge,
.user-info.kpop-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(28, 20, 52, 0.85);
    padding: 0.5rem 1.2rem 0.5rem 0.6rem;
    border-radius: 16px;
    border: 2px solid var(--kpop-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.1);
    transition: transform var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.user-info.roblox-badge:hover,
.user-info.kpop-badge:hover {
    transform: translateY(-3px);
    border-color: var(--kpop-pink);
    box-shadow: 0 6px 25px rgba(255, 46, 147, 0.45);
}

.user-profile {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    position: relative;
    background: #251A45;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid var(--kpop-gold);
    box-shadow: 0 0 16px rgba(255, 209, 102, 0.6), 0 0 22px rgba(255, 46, 147, 0.35);
    overflow: hidden;
    flex-shrink: 0;
}

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

.gamer-lvl {
    display: none !important;
}

.user-text-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.user-name {
    font-weight: 800;
    font-size: 1.18rem;
    color: #FFF;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    line-height: 1.2;
}

.user-meta-sub {
    display: flex;
    align-items: center;
    gap: 7px;
}

.user-sub {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--kpop-pink);
    letter-spacing: 0.5px;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    text-shadow: 0 0 8px rgba(255, 46, 147, 0.4);
}

.idol-tag {
    background: linear-gradient(135deg, var(--kpop-pink), var(--kpop-purple));
    color: #FFF;
    font-size: 0.68rem;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    font-family: 'Cairo', 'Tajawal', 'Changa', 'Quicksand', sans-serif;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 6px rgba(255, 46, 147, 0.4);
}

/* 3D K-Pop Glowing Heart Logo */
.logo.roblox-logo,
.logo.kpop-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    user-select: none;
}

.roblox-cube,
.kpop-heart-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #FF2E93 0%, #8A2BE2 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 46, 147, 0.5), 0 0 25px rgba(138, 43, 226, 0.5);
    transform: rotate(-6deg);
    border: 2px solid rgba(255, 255, 255, 0.6);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 1.6rem;
}

.logo.roblox-logo:hover .roblox-cube,
.logo.kpop-logo:hover .kpop-heart-icon {
    transform: rotate(0deg) scale(1.12);
    box-shadow: 0 6px 25px rgba(255, 46, 147, 0.8), 0 0 35px rgba(0, 245, 212, 0.6);
}

.roblox-cube span,
.kpop-heart-icon span {
    color: #FFF;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-weight: 900;
    font-size: 1.6rem;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.logo-text h1 {
    font-size: 1.65rem;
    font-weight: 900;
    color: #FFF;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 0 15px rgba(255, 46, 147, 0.4);
}

.logo-sub {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--kpop-cyan);
    letter-spacing: 1px;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    display: block;
    text-shadow: 0 0 10px rgba(0, 245, 212, 0.4);
}

/* Header Navigation Actions */
.header-nav-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.roblox-header-btn,
.header-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.3rem;
    border-radius: 14px;
    border: 2px solid var(--kpop-border);
    background: rgba(30, 21, 55, 0.85);
    color: #FFF;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.22s ease;
    white-space: nowrap;
}

.roblox-header-btn:hover,
.header-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 46, 147, 0.45);
    border-color: var(--kpop-pink);
    background: rgba(45, 32, 85, 0.95);
}

.roblox-header-btn:active,
.header-action-btn:active {
    transform: translateY(2px);
}

.roblox-header-btn.game-btn,
.header-action-btn.game-btn {
    border-color: rgba(255, 46, 147, 0.5);
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.4) 0%, rgba(255, 46, 147, 0.35) 100%);
}

.roblox-header-btn.game-btn:hover,
.header-action-btn.game-btn:hover {
    border-color: var(--kpop-cyan);
    box-shadow: 0 6px 25px rgba(0, 245, 212, 0.5);
}

.roblox-header-btn.trophy-btn:hover {
    border-color: var(--kpop-gold);
    color: var(--kpop-gold);
    box-shadow: 0 6px 20px rgba(255, 209, 102, 0.45);
}

.portal-home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(30, 21, 55, 0.85);
    border: 2px solid var(--kpop-border);
    border-radius: 14px;
    color: #FFF;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.portal-home-btn:hover {
    background: rgba(45, 32, 85, 0.95);
    border-color: var(--kpop-cyan);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 245, 212, 0.4);
}

/* Welcome Hero Strip */
.header-hero-strip {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-strip-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    text-align: center;
}

.hero-roblox-greeting,
.hero-gamer-greeting {
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--kpop-gold);
    text-shadow: 0 0 12px rgba(255, 209, 102, 0.5);
}

.hero-divider {
    color: rgba(255, 46, 147, 0.4);
    font-size: 1.2rem;
}

.hero-subtitle {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* =========================================
   App Container & Views
   ========================================= */
.app-container,
.view {
    max-width: 1300px;
    width: 92%;
    margin: 1.5rem auto;
    flex: 1;
    position: relative;
    z-index: 1;
}

.hidden,
.view.hidden,
.ai-bot-modal.hidden,
#ai-bot-modal.hidden {
    display: none !important;
}

.section-title-wrap {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title-wrap h2 {
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 2.1rem;
    font-weight: 900;
    color: #FFF;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 15px rgba(255, 46, 147, 0.45);
}

.section-title-wrap p {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-weight: 700;
}

/* =========================================
   Multiplication Big Button (K-Pop Neon Style)
   ========================================= */
.mult-simple-btn-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.mult-simple-btn.roblox-btn,
.mult-simple-btn.kpop-mult-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: linear-gradient(135deg, #FF2E93 0%, #8A2BE2 100%);
    color: #FFFFFF;
    border: 2.5px solid rgba(255, 255, 255, 0.85);
    padding: 0.85rem 2.2rem;
    border-radius: 50px;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 46, 147, 0.5), 0 0 20px rgba(138, 43, 226, 0.5);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    line-height: 1.4;
    white-space: nowrap;
}

.mult-simple-btn.roblox-btn:hover,
.mult-simple-btn.kpop-mult-btn:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 35px rgba(255, 46, 147, 0.7), 0 0 35px rgba(0, 245, 212, 0.5);
    border-color: #FFFFFF;
    filter: brightness(1.08);
}

.mult-simple-btn.roblox-btn:active,
.mult-simple-btn.kpop-mult-btn:active {
    transform: translateY(2px);
}

.mult-simple-btn .btn-tag {
    background: rgba(0, 0, 0, 0.25);
    color: #FFD166;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 209, 102, 0.4);
    display: inline-flex;
    align-items: center;
}

/* =========================================
   Chapter Grid & K-Pop Stage Concert Cards
   ========================================= */
.math-chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.8rem;
}

.math-chapter-card {
    background: rgba(24, 18, 44, 0.88);
    backdrop-filter: blur(10px);
    border: 2px solid var(--kpop-border);
    border-radius: 22px;
    padding: 1.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
}

.math-chapter-card:hover {
    transform: translateY(-6px);
    border-color: var(--chapter-color, var(--kpop-pink));
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.7), 0 0 25px var(--kpop-pink-glow);
    background: rgba(38, 28, 70, 0.95);
}

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

.math-chapter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 46, 147, 0.15);
    border: 1px solid rgba(255, 46, 147, 0.35);
    padding: 4px 14px;
    border-radius: 20px;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--kpop-gold);
}

.card-speaker-btn {
    background: rgba(40, 28, 75, 0.9);
    border: 1px solid var(--kpop-border);
    border-radius: 10px;
    width: 38px;
    height: 38px;
    color: #FFF;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-speaker-btn:hover {
    background: var(--kpop-pink);
    border-color: #FFF;
    transform: scale(1.1);
}

.math-card-stage {
    position: relative;
    text-align: center;
    margin-bottom: 1.2rem;
}

.math-masha-bubble {
    width: 110px;
    height: 110px;
    border-radius: 22px;
    background: #19122B;
    border: 3px solid var(--chapter-color, var(--kpop-pink));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--kpop-pink-glow);
    transition: transform 0.25s ease;
    overflow: hidden;
}

.math-chapter-card:hover .math-masha-bubble {
    transform: scale(1.08) rotate(-4deg);
    border-color: #FFF;
    box-shadow: 0 0 30px var(--kpop-cyan-glow);
}

.math-masha-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.math-operator-stamp {
    position: absolute;
    bottom: -10px;
    right: 50%;
    transform: translateX(50%);
    background: linear-gradient(135deg, var(--kpop-pink), var(--kpop-purple));
    border: 2px solid #FFF;
    padding: 4px 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    color: #FFF;
    box-shadow: 0 4px 12px rgba(255, 46, 147, 0.5);
    white-space: nowrap;
}

.math-card-info {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.math-topic-badge {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--kpop-cyan);
    margin-bottom: 0.4rem;
    display: block;
}

.math-card-title {
    font-family: 'Cairo', 'Changa', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: #FFF;
    margin-bottom: 1.2rem;
    line-height: 1.4;
}

.math-progress-wrap {
    margin-top: auto;
}

.math-progress-text {
    display: flex;
    justify-content: space-between;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.math-progress-bar {
    height: 12px;
    background: rgba(18, 12, 36, 0.9);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--kpop-border);
}

.math-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--kpop-pink), var(--kpop-cyan));
    border-radius: 6px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.6);
}

.math-card-action {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--kpop-pink) 0%, var(--kpop-purple) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    color: #FFF;
    padding: 0.75rem 1.4rem;
    border-radius: 14px;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    margin-top: 1.2rem;
    transition: all 0.22s ease;
    box-shadow: 0 4px 15px rgba(255, 46, 147, 0.4);
}

.math-chapter-card:hover .math-card-action {
    background: linear-gradient(135deg, var(--kpop-cyan) 0%, var(--kpop-purple) 100%);
    border-color: #FFF;
    box-shadow: 0 6px 20px rgba(0, 245, 212, 0.5);
}

/* =========================================
   Sub-view Headers (Multiplication, Chapters, Achievements)
   ========================================= */
.sub-view-header {
    background: rgba(24, 18, 44, 0.88);
    backdrop-filter: blur(10px);
    border: 2px solid var(--kpop-border);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.sub-view-header .back-btn,
.roblox-back-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(36, 26, 68, 0.9);
    border: 2px solid var(--kpop-border);
    color: #FFF;
    padding: 0.6rem 1.3rem;
    border-radius: 12px;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.sub-view-header .back-btn:hover,
.roblox-back-btn:hover {
    background: var(--kpop-pink);
    border-color: #FFF;
    box-shadow: 0 6px 20px rgba(255, 46, 147, 0.45);
}

.sub-view-title-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 0.5rem;
}

.view-bear-badge {
    font-size: 2.2rem;
    filter: drop-shadow(0 0 10px rgba(255, 46, 147, 0.6));
}

.sub-view-header h1 {
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    color: #FFF;
    margin: 0;
    text-shadow: 0 0 15px rgba(255, 46, 147, 0.45);
}

.sub-view-header p {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 700;
}

/* =========================================
   Multiplication Table Styling
   ========================================= */
.mult-nav-bar {
    margin-bottom: 2rem;
}

.mult-tabs-scroll {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding: 0.6rem 0.2rem;
    scrollbar-width: thin;
}

.mult-tab-btn {
    background: rgba(28, 20, 52, 0.85);
    border: 2px solid var(--kpop-border);
    color: #FFF;
    padding: 0.65rem 1.4rem;
    border-radius: 14px;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.mult-tab-btn:hover {
    background: rgba(45, 32, 85, 0.95);
    border-color: var(--kpop-pink);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 46, 147, 0.4);
}

.mult-tab-btn.active {
    background: linear-gradient(135deg, var(--kpop-pink), var(--kpop-purple));
    border-color: #FFF;
    box-shadow: 0 4px 18px rgba(255, 46, 147, 0.5);
}

.mult-tab-btn.full-grid-tab.active {
    background: linear-gradient(135deg, var(--kpop-cyan), #00A896);
    border-color: #FFF;
    box-shadow: 0 4px 18px rgba(0, 245, 212, 0.5);
}

.mult-tab-btn.quiz-tab.active {
    background: linear-gradient(135deg, #FFD166, #FF9E00);
    color: #241600;
    border-color: #FFF;
    box-shadow: 0 4px 18px rgba(255, 209, 102, 0.6);
}

.mult-grid-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(20, 15, 39, 0.9);
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid var(--kpop-border);
}

.mult-grid-table th, .mult-grid-table td {
    padding: 0.8rem;
    text-align: center;
    border: 1px solid var(--kpop-border);
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
}

.mult-grid-table th {
    background: rgba(35, 25, 65, 0.95);
    color: var(--kpop-gold);
}

.mult-grid-table td {
    cursor: pointer;
    transition: all 0.15s ease;
    color: #FFF;
}

.mult-grid-table td:hover {
    background: var(--kpop-pink);
    color: #FFF;
    transform: scale(1.15);
    box-shadow: 0 0 15px var(--kpop-pink);
    z-index: 2;
    position: relative;
}

/* Quiz Challenge Box */
.mult-quiz-box {
    background: rgba(24, 18, 44, 0.92);
    border: 3px solid var(--kpop-gold);
    border-radius: 24px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(255, 209, 102, 0.4);
}

/* =========================================
   Lessons Grid / Single Album Adventure Cards
   ========================================= */
.lesson-path-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.4rem;
    margin: 1.2rem 0 2.5rem 0;
}

.lesson-adventure-card {
    background: rgba(24, 18, 44, 0.88);
    backdrop-filter: blur(10px);
    border: 2px solid var(--kpop-border);
    border-radius: 20px;
    padding: 1rem 0.9rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    min-height: 235px;
}

.lesson-adventure-card:hover {
    transform: translateY(-6px);
    border-color: var(--kpop-pink);
    box-shadow: 0 12px 30px rgba(255, 46, 147, 0.45);
    background: rgba(38, 28, 70, 0.95);
}

.card-header-pill {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.card-stage-bubble {
    width: 92px;
    height: 92px;
    border-radius: 18px;
    background: #18112E;
    border: 2px solid rgba(255, 46, 147, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.6rem;
    position: relative;
    box-shadow: 0 0 15px rgba(255, 46, 147, 0.25);
    overflow: hidden;
    flex-shrink: 0;
}

.card-stage-bubble .stage-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 46, 147, 0.35) 0%, rgba(138, 43, 226, 0.2) 60%, transparent 80%);
}

.card-masha-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    transition: transform 0.25s ease;
}

.lesson-adventure-card:hover .card-masha-img {
    transform: scale(1.1);
}

.card-info-section {
    width: 100%;
    text-align: center;
    margin-bottom: 0.65rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-title {
    font-size: 1rem;
    font-weight: 800;
    color: #FFF;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    line-height: 1.4;
    margin-bottom: 0;
}

.card-type-chip {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--kpop-gold);
    background: rgba(255, 209, 102, 0.15);
    border: 1px solid rgba(255, 209, 102, 0.35);
    padding: 2px 8px;
    border-radius: 8px;
    display: inline-block;
    margin-top: 4px;
}

.card-action-btn {
    width: 100%;
    padding: 0.55rem 0.8rem;
    background: linear-gradient(135deg, var(--kpop-pink) 0%, var(--kpop-purple) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    color: #FFF;
    border-radius: 12px;
    font-weight: 800;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 3px 12px rgba(255, 46, 147, 0.4);
    transition: all 0.22s ease;
}

.lesson-adventure-card:hover .card-action-btn {
    background: linear-gradient(135deg, var(--kpop-cyan) 0%, var(--kpop-purple) 100%);
    box-shadow: 0 4px 18px rgba(0, 245, 212, 0.5);
    border-color: #FFF;
}

/* =========================================
   Achievements View & Badges
   ========================================= */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.badge-card {
    background: rgba(24, 18, 44, 0.88);
    backdrop-filter: blur(10px);
    border: 2px solid var(--kpop-border);
    border-radius: 20px;
    padding: 1.8rem;
    text-align: center;
    transition: all 0.25s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

.badge-card:hover {
    transform: translateY(-5px);
    border-color: var(--kpop-pink);
    box-shadow: 0 10px 25px rgba(255, 46, 147, 0.4);
}

.badge-card.unlocked {
    border-color: var(--kpop-gold);
    box-shadow: 0 0 25px rgba(255, 209, 102, 0.4);
}

.badge-icon {
    font-size: 3rem;
    margin-bottom: 0.8rem;
    display: block;
}

.badge-card h3 {
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: #FFF;
    margin-bottom: 0.4rem;
}

.badge-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 700;
}

/* =========================================
   Lesson View & Interactive Components
   ========================================= */
.lesson-header-bar.roblox-lesson-bar,
.lesson-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
    background: #150F28;
    padding: 1rem 1.8rem;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    border: 2px solid var(--kpop-border);
    border-right: 6px solid var(--kpop-pink);
}

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

.lesson-bear-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 0 12px rgba(255, 46, 147, 0.6));
}

.lesson-title-box h1 {
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    color: #FFF;
    margin: 0;
}

.lesson-sub-chapter {
    font-size: 0.85rem;
    color: var(--kpop-cyan);
    font-weight: 700;
    display: block;
}

.home-nav-btn {
    background: rgba(36, 26, 68, 0.9);
    border: 2px solid var(--kpop-border);
    color: #FFF;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.home-nav-btn:hover {
    background: var(--kpop-pink);
    border-color: #FFF;
}

/* Lesson Navigation Tabs */
.lesson-tabs {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 140px;
    background: rgba(28, 20, 52, 0.85);
    border: 2px solid var(--kpop-border);
    color: #FFF;
    padding: 0.85rem 1.4rem;
    border-radius: 14px;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.22s ease;
    text-align: center;
}

.tab-btn:hover {
    background: rgba(45, 32, 85, 0.95);
    border-color: var(--kpop-pink);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--kpop-pink) 0%, var(--kpop-purple) 100%);
    border-color: #FFF;
    box-shadow: 0 4px 18px rgba(255, 46, 147, 0.5);
}

/* Content Wrapper & Cards */
.content-wrapper {
    background: rgba(20, 15, 39, 0.92);
    backdrop-filter: blur(12px);
    border: 2px solid var(--kpop-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.pane {
    display: none;
}

.pane.active {
    display: block;
}

.card {
    background: rgba(28, 20, 52, 0.7);
    border: 1px solid var(--kpop-border);
    border-radius: 18px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Blackboard / Interactive Teacher Zone */
#teacher-blackboard {
    background: rgba(14, 10, 26, 0.95);
    border: 3px dashed var(--kpop-pink);
    border-radius: 16px;
    padding: 1.8rem;
    margin-bottom: 1.5rem;
    color: #FFF;
}

.speech-bubble {
    background: rgba(35, 25, 65, 0.95);
    border: 2px solid var(--kpop-border);
    border-radius: 18px;
    padding: 1rem 1.5rem;
    color: #FFF;
    font-family: 'Cairo', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.teacher-emoji,
.student-emoji {
    font-size: 3rem;
}

/* =========================================
   Math Games Section (K-Pop Stage Themed)
   ========================================= */
.games-menu-header {
    text-align: center;
    margin-bottom: 2rem;
}

.games-menu-header h2 {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--kpop-gold);
    text-shadow: 0 0 15px rgba(255, 209, 102, 0.5);
    margin-bottom: 8px;
}

.games-menu-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 700;
}

.games-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 2rem;
}

.game-card {
    background: linear-gradient(145deg, rgba(32, 22, 60, 0.95) 0%, rgba(16, 11, 32, 0.98) 100%);
    border: 2.5px solid rgba(255, 46, 147, 0.4);
    border-radius: 22px;
    padding: 1.8rem 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 46, 147, 0.18);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #FF2E93, #8A2BE2, #00F5D4);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.game-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: #FF2E93;
    box-shadow: 0 16px 35px rgba(255, 46, 147, 0.45), 0 0 30px rgba(0, 245, 212, 0.4);
    background: linear-gradient(145deg, rgba(42, 28, 78, 0.98) 0%, rgba(22, 14, 44, 1) 100%);
}

.game-card:hover::before {
    opacity: 1;
    box-shadow: 0 0 12px #FF2E93;
}

.game-card:active {
    transform: translateY(2px) scale(0.98);
}

.game-card .game-icon {
    font-size: 3.2rem;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 46, 147, 0.25) 0%, rgba(138, 43, 226, 0.15) 70%, transparent 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(255, 46, 147, 0.35);
    transition: transform 0.3s ease;
}

.game-card:hover .game-icon {
    transform: scale(1.18) rotate(8deg);
    border-color: #00F5D4;
    box-shadow: 0 0 25px rgba(0, 245, 212, 0.6);
}

.game-card .game-title {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    color: #FFFFFF;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
    margin: 4px 0;
}

.game-card .game-tag {
    background: linear-gradient(135deg, rgba(255, 46, 147, 0.25), rgba(138, 43, 226, 0.3));
    border: 1.5px solid rgba(255, 209, 102, 0.5);
    color: #FFD166;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.92rem;
    font-weight: 800;
    box-shadow: 0 0 12px rgba(255, 209, 102, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.game-card.game-card-meteor:hover {
    border-color: #FFD166;
    box-shadow: 0 16px 35px rgba(255, 209, 102, 0.4), 0 0 25px rgba(255, 46, 147, 0.35);
}
.game-card.game-card-race:hover {
    border-color: #FF2E93;
    box-shadow: 0 16px 35px rgba(255, 46, 147, 0.5), 0 0 25px rgba(138, 43, 226, 0.4);
}
.game-card.game-card-cards:hover {
    border-color: #00F5D4;
    box-shadow: 0 16px 35px rgba(0, 245, 212, 0.5), 0 0 25px rgba(0, 180, 216, 0.4);
}
.game-card.game-card-bot:hover {
    border-color: #8A2BE2;
    box-shadow: 0 16px 35px rgba(138, 43, 226, 0.5), 0 0 25px rgba(255, 209, 102, 0.35);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(24, 18, 44, 0.95);
    border: 2px solid var(--kpop-border);
    border-radius: 16px;
    padding: 0.9rem 1.6rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 10px;
}

.game-header .back-btn {
    background: linear-gradient(135deg, #FF2E93 0%, #8A2BE2 100%);
    color: #FFFFFF;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    padding: 6px 20px;
    border-radius: 25px;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 46, 147, 0.4);
    transition: all 0.2s ease;
}

.game-header .back-btn:hover {
    transform: scale(1.06);
    background: linear-gradient(135deg, #00F5D4, #00B4D8);
    color: #070913;
    border-color: #00F5D4;
    box-shadow: 0 4px 20px rgba(0, 245, 212, 0.5);
}

.game-header h3 {
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--kpop-gold);
    margin: 0;
}

.game-question {
    background: rgba(20, 15, 39, 0.95);
    border: 2.5px solid var(--kpop-gold);
    border-radius: 18px;
    padding: 1.5rem;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 1.7rem;
    font-weight: 800;
    color: #FFF;
    text-align: center;
    margin: 1.5rem 0;
    box-shadow: 0 0 20px rgba(255, 209, 102, 0.3);
}

/* 1. Meteor Game */
.meteor-container {
    position: relative;
    height: 360px;
    background: rgba(12, 8, 25, 0.95);
    border: 2px solid var(--kpop-border);
    border-radius: 20px;
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: inset 0 0 25px rgba(0,0,0,0.8);
}

.meteor {
    position: absolute;
    width: 85px;
    height: 85px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF2E93, #8A2BE2);
    border: 3px solid #FFF;
    color: #FFF;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(255, 46, 147, 0.7);
    transition: transform 0.15s ease;
    user-select: none;
    z-index: 5;
}

.meteor:hover {
    transform: scale(1.12);
    box-shadow: 0 0 35px rgba(0, 245, 212, 0.9);
    border-color: #00F5D4;
}

/* 2. Energy Race */
.energy-track {
    position: relative;
    height: 40px;
    background: rgba(18, 12, 36, 0.95);
    border: 2px solid var(--kpop-border);
    border-radius: 20px;
    margin: 1.5rem 0;
    overflow: visible;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}

.energy-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #FF2E93, #00F5D4);
    border-radius: 20px;
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 18px rgba(0, 245, 212, 0.6);
}

.robot-runner {
    position: absolute;
    top: -12px;
    transform: translateX(-50%);
    font-size: 2.5rem;
    transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 0 12px var(--kpop-gold));
    line-height: 1;
}

.energy-options {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.energy-btn {
    background: rgba(32, 23, 60, 0.9);
    border: 2px solid var(--kpop-border);
    color: #FFF;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    padding: 12px 32px;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    min-width: 100px;
}

.energy-btn:hover {
    background: rgba(48, 35, 88, 0.95);
    border-color: var(--kpop-cyan);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 245, 212, 0.45);
}

/* 3. Circuit / Blox Matching Cards */
.circuit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
    max-width: 580px;
    margin: 1.5rem auto;
}

.circuit-card {
    height: 110px;
    perspective: 1000px;
    cursor: pointer;
}

.circuit-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s;
    transform-style: preserve-3d;
    border-radius: 14px;
}

.circuit-card.flipped .circuit-inner {
    transform: rotateY(180deg);
}

.circuit-front, .circuit-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 2px solid var(--kpop-border);
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-weight: 800;
    text-align: center;
    padding: 8px;
    box-sizing: border-box;
}

.circuit-front {
    background: rgba(28, 20, 52, 0.95);
    color: var(--kpop-gold);
    font-size: 2.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.circuit-back {
    background: linear-gradient(135deg, var(--kpop-pink), var(--kpop-purple));
    color: #FFF;
    transform: rotateY(180deg);
    border-color: #FFF;
    font-size: 1.25rem;
    box-shadow: 0 4px 15px rgba(255, 46, 147, 0.4);
}

.circuit-card.matched .circuit-back {
    background: linear-gradient(135deg, var(--kpop-cyan), #00A896);
    border-color: #FFF;
    box-shadow: 0 0 20px rgba(0, 245, 212, 0.6);
}

/* 4. Processor / Bot Assembly */
.processor-container {
    max-width: 520px;
    margin: 1.5rem auto;
    text-align: center;
}

.robot-screen {
    background: rgba(14, 10, 26, 0.95);
    border: 3px solid var(--kpop-border);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1.8rem;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: #FFF;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.8);
    transition: all 0.3s ease;
}

.missing-slot {
    display: inline-block;
    width: 75px;
    height: 42px;
    border-bottom: 3px dashed var(--kpop-gold);
    vertical-align: middle;
    margin: 0 6px;
}

.processor-parts {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.part {
    background: rgba(32, 23, 60, 0.9);
    border: 2px solid var(--kpop-border);
    color: #FFF;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    padding: 12px 30px;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.part:hover {
    background: rgba(48, 35, 88, 0.95);
    border-color: var(--kpop-gold);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 209, 102, 0.45);
}

/* =========================================
   AI K-Pop Math Bot Modal & Floating Button
   ========================================= */
#ai-bot-toggle,
.roblox-bot-btn,
.ai-bot-btn {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--kpop-pink), var(--kpop-purple));
    border: 2.5px solid rgba(255, 255, 255, 0.85);
    color: #FFF;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 25px rgba(255, 46, 147, 0.5), 0 0 20px rgba(138, 43, 226, 0.5);
    z-index: 9999;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#ai-bot-toggle:hover,
.roblox-bot-btn:hover {
    transform: scale(1.12) rotate(8deg);
    box-shadow: 0 8px 30px rgba(255, 46, 147, 0.7), 0 0 30px rgba(0, 245, 212, 0.6);
}

.ai-bot-modal.roblox-bot-modal,
.ai-bot-modal {
    position: fixed;
    bottom: 100px;
    left: 25px;
    width: 380px;
    max-width: 90vw;
    background: rgba(20, 15, 39, 0.96);
    backdrop-filter: blur(16px);
    border: 2.5px solid var(--kpop-pink);
    border-radius: 24px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8), 0 0 30px var(--kpop-pink-glow);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.ai-bot-header.roblox-panel-header,
.ai-bot-header {
    background: linear-gradient(135deg, var(--kpop-pink) 0%, var(--kpop-purple) 100%);
    color: #FFF;
    padding: 0.9rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bot-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bot-header-title h3 {
    margin: 0;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
}

.close-bot-btn {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #FFF;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-bot-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-bot-messages {
    padding: 1rem;
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bot-message {
    background: rgba(35, 25, 65, 0.9);
    border: 1px solid var(--kpop-border);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    color: #FFF;
    font-size: 0.95rem;
    line-height: 1.5;
    align-self: flex-start;
}

.user-message {
    background: linear-gradient(135deg, var(--kpop-pink), var(--kpop-purple));
    color: #FFF;
    border-radius: 14px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    align-self: flex-end;
    font-weight: 700;
}

.ai-bot-input-area {
    display: flex;
    gap: 8px;
    padding: 0.8rem 1rem;
    background: rgba(14, 10, 26, 0.95);
    border-top: 1px solid var(--kpop-border);
}

.ai-bot-input-area input {
    flex: 1;
    background: rgba(28, 20, 52, 0.9);
    border: 1.5px solid var(--kpop-border);
    border-radius: 12px;
    padding: 0.6rem 0.9rem;
    color: #FFF;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    outline: none;
}

.ai-bot-input-area input:focus {
    border-color: var(--kpop-pink);
    box-shadow: 0 0 10px var(--kpop-pink-glow);
}

.send-bot-btn {
    background: linear-gradient(135deg, var(--kpop-pink), var(--kpop-purple));
    border: none;
    color: #FFF;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.send-bot-btn:hover {
    transform: scale(1.05);
}

/* =========================================
   Concert Party Mode, Lasers & Lightsticks
   ========================================= */
body.roblox-party-mode {
    animation: stageStrobe 1.8s ease-in-out infinite alternate;
}

@keyframes stageStrobe {
    0% { filter: brightness(1) drop-shadow(0 0 15px rgba(255, 46, 147, 0.2)); }
    50% { filter: brightness(1.06) drop-shadow(0 0 25px rgba(138, 43, 226, 0.3)); }
    100% { filter: brightness(1) drop-shadow(0 0 20px rgba(0, 245, 212, 0.2)); }
}

.roblox-screen-lasers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99997;
    opacity: 0;
    transition: opacity 0.4s ease;
    box-shadow: inset 0 0 60px rgba(255, 46, 147, 0.6), inset 0 0 120px rgba(138, 43, 226, 0.4);
}

.roblox-screen-lasers.active {
    opacity: 1;
    animation: laserPulse 1.2s ease-in-out infinite alternate;
}

@keyframes laserPulse {
    0% { box-shadow: inset 0 0 50px #FF2E93, inset 0 0 100px #8A2BE2; }
    50% { box-shadow: inset 0 0 70px #00F5D4, inset 0 0 130px #FF2E93; }
    100% { box-shadow: inset 0 0 60px #FFD166, inset 0 0 110px #8A2BE2; }
}

.roblox-powerup-toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, #FF2E93, #8A2BE2);
    border: 2px solid #FFF;
    color: #FFF;
    padding: 0.85rem 2rem;
    border-radius: 30px;
    font-family: 'Cairo', 'Tajawal', 'Changa', sans-serif;
    font-size: 1.2rem;
    font-weight: 900;
    box-shadow: 0 10px 30px rgba(255, 46, 147, 0.6), 0 0 25px rgba(0, 245, 212, 0.5);
    z-index: 100000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
}

.roblox-powerup-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.roblox-burst-particle {
    position: fixed;
    pointer-events: none;
    font-size: 2rem;
    z-index: 99999;
    animation: burstAnim 2s forwards cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes burstAnim {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--tx, 100px), var(--ty, -100px)) scale(0) rotate(360deg); opacity: 0; }
}

/* Floating K-Pop Concert Lightsticks Stage */
.roblox-walkers-stage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99998;
    overflow: hidden;
    transition: opacity 0.8s ease;
}

.roblox-walkers-stage.fade-out {
    opacity: 0;
}

.roblox-walker {
    position: absolute;
    width: 90px;
    height: 140px;
    pointer-events: auto;
    cursor: pointer;
    filter: drop-shadow(0 0 16px rgba(255, 46, 147, 0.75)) drop-shadow(0 10px 24px rgba(0, 0, 0, 0.6));
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
    z-index: 99999;
    animation: lightstickSway 1.8s ease-in-out infinite alternate;
}

.roblox-walker:hover {
    filter: drop-shadow(0 0 25px #FF2E93) drop-shadow(0 0 40px #00F5D4) drop-shadow(0 0 50px #FFD166);
    transform: scale(1.18);
}

.roblox-character-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 4px 12px rgba(255, 46, 147, 0.4));
}

@keyframes lightstickSway {
    0% { transform: translateY(0) rotate(-10deg) scale(1); }
    50% { transform: translateY(-15px) rotate(0deg) scale(1.04); }
    100% { transform: translateY(-5px) rotate(12deg) scale(1); }
}

.walker-path-1 {
    bottom: 30px;
    animation: walkTrackRtl 10s linear forwards, lightstickSway 1.6s ease-in-out infinite alternate;
}

.walker-path-2 {
    bottom: 75px;
    animation: walkTrackLtr 9.2s linear 0.4s forwards, lightstickSway 1.9s ease-in-out infinite alternate;
}

.walker-path-3 {
    bottom: 120px;
    animation: walkTrackRtl 10.5s linear 0.8s forwards, lightstickSway 1.7s ease-in-out infinite alternate;
}

.walker-path-4 {
    bottom: 50px;
    animation: walkTrackLtr 8.8s linear 1.2s forwards, lightstickSway 2s ease-in-out infinite alternate;
}

@keyframes walkTrackRtl {
    0% { left: 105vw; opacity: 0; }
    5% { opacity: 1; }
    92% { opacity: 1; }
    100% { left: -140px; opacity: 0; }
}

@keyframes walkTrackLtr {
    0% { left: -140px; opacity: 0; }
    5% { opacity: 1; }
    92% { opacity: 1; }
    100% { left: 105vw; opacity: 0; }
}

.roblox-walker.jump-flip {
    animation: lightstickSpinPulse 0.75s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

@keyframes lightstickSpinPulse {
    0% { transform: translateY(0) rotate(0deg) scale(1); }
    50% { transform: translateY(-70px) rotate(180deg) scale(1.35); filter: drop-shadow(0 0 35px #FFF) drop-shadow(0 0 50px #00F5D4); }
    100% { transform: translateY(0) rotate(360deg) scale(1); }
}

/* =========================================
   Site Footer
   ========================================= */
.site-footer,
.app-footer {
    text-align: center;
    padding: 2.5rem 1rem 3rem;
    margin-top: auto;
    position: relative;
    z-index: 2;
}

.footer-link {
    color: #9DA3AE;
    text-decoration: none;
    font-family: 'Cairo', 'Changa', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 8px 22px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.25s ease;
    display: inline-block;
}

.footer-link:hover {
    color: #FF2E93;
    background: rgba(255, 46, 147, 0.15);
    border-color: #FF2E93;
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(255, 46, 147, 0.35);
}

/* =========================================
   Responsive Adjustments
   ========================================= */
@media (max-width: 768px) {
    .app-header.roblox-header { padding: 1.2rem 4%; }
    .header-top { flex-direction: column; gap: 0.9rem; text-align: center; }
    .header-nav-actions { justify-content: center; width: 100%; flex-wrap: wrap; }
    .hero-strip-content { flex-direction: column; gap: 0.3rem; }
    .hero-divider { display: none; }
    .math-chapters-grid { grid-template-columns: 1fr; }
    .lesson-header-bar { flex-direction: column; text-align: center; }
    .lesson-tabs { flex-direction: column; }
    .sub-view-header .back-btn { position: static; transform: none; margin-bottom: 1rem; display: inline-block; }
}

/* =========================================
   K-Pop Idol Profile Avatar Badge
   ========================================= */
.user-profile {
    position: relative;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.user-profile:hover {
    transform: scale(1.08);
}

.avatar-game-badge {
    position: absolute;
    bottom: -3px;
    left: -3px;
    background: linear-gradient(135deg, #FF2E93 0%, #8A2BE2 100%);
    color: #FFFFFF;
    font-size: 0.85rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 12px rgba(255, 46, 147, 0.85), 0 0 20px rgba(0, 245, 212, 0.6);
    animation: avatarBadgePulse 1.8s infinite ease-in-out;
    pointer-events: none;
}

@keyframes avatarBadgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 46, 147, 0.8);
    }
    50% {
        transform: scale(1.22);
        box-shadow: 0 0 20px rgba(0, 245, 212, 0.95), 0 0 10px rgba(255, 209, 102, 0.9);
    }
}

/* =========================================
   K-Pop Idol Rhythm Stage Modal
   ========================================= */
.kpop-game-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

.kpop-game-modal.hidden {
    display: none !important;
}

.kpop-game-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 7, 20, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.kpop-game-window {
    position: relative;
    z-index: 2;
    width: 95%;
    max-width: 660px;
    max-height: 92vh;
    background: linear-gradient(180deg, #130d2d 0%, #0a0618 100%);
    border: 2.5px solid #FF2E93;
    border-radius: 28px;
    box-shadow: 0 0 50px rgba(255, 46, 147, 0.45), 0 0 80px rgba(138, 43, 226, 0.35), 0 25px 60px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    will-change: transform, opacity;
    animation: modalPopIn 0.16s ease-out;
}

@keyframes modalPopIn {
    from { transform: scale(0.94); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.kpop-game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.6rem;
    background: rgba(255, 46, 147, 0.12);
    border-bottom: 2px solid rgba(255, 46, 147, 0.3);
    position: relative;
}

.game-stage-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stage-pulse-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 8px #FF2E93);
    animation: iconBounce 1.5s infinite ease-in-out;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.1); }
}

.game-stage-title h3 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 900;
    color: #FFFFFF;
    text-shadow: 0 0 12px rgba(255, 46, 147, 0.6);
}

.stage-sub {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--kpop-cyan);
    letter-spacing: 0.5px;
    display: block;
}

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

.stage-music-btn,
.stage-close-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.stage-music-btn:hover {
    background: rgba(0, 245, 212, 0.2);
    border-color: #00F5D4;
    color: #00F5D4;
    transform: scale(1.1);
}

.stage-close-btn:hover {
    background: rgba(255, 46, 147, 0.25);
    border-color: #FF2E93;
    color: #FF2E93;
    transform: scale(1.1);
}

.kpop-stage-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 480px;
    padding: 1.5rem;
    background: 
        radial-gradient(circle at 50% 20%, rgba(255, 46, 147, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 50% 80%, rgba(138, 43, 226, 0.15) 0%, transparent 60%);
}

/* --- Start Screen --- */
.rhythm-start-screen {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    max-width: 480px;
}

.idol-stage-avatar-wrap {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto;
}

.idol-stage-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3.5px solid #FF2E93;
    box-shadow: 0 0 25px rgba(255, 46, 147, 0.7), 0 0 40px rgba(0, 245, 212, 0.4);
    animation: avatarFloat 2.5s infinite ease-in-out;
}

@keyframes avatarFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.idol-lightstick-float {
    position: absolute;
    bottom: -5px;
    right: -5px;
    font-size: 2rem;
    filter: drop-shadow(0 0 10px #FFD166);
    animation: lightstickWave 1.2s infinite ease-in-out alternate;
}

@keyframes lightstickWave {
    from { transform: rotate(-15deg); }
    to { transform: rotate(20deg); }
}

.rhythm-start-screen h2 {
    font-size: 1.85rem;
    font-weight: 900;
    color: #FFFFFF;
    margin: 0;
    text-shadow: 0 0 20px rgba(255, 46, 147, 0.7);
}

.rhythm-start-desc {
    color: #CBD5E1;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.6;
    margin: 0;
}

.rhythm-lanes-preview {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 0.5rem 0;
}

.preview-lane-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 1.4rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 8px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.preview-lane-dot span.key {
    font-size: 0.75rem;
    color: #94A3B8;
    font-weight: 800;
}

.start-rhythm-btn {
    background: linear-gradient(135deg, #FF2E93 0%, #8A2BE2 100%);
    color: #FFFFFF;
    border: 2.5px solid rgba(255, 255, 255, 0.9);
    padding: 0.9rem 2.8rem;
    border-radius: 50px;
    font-size: 1.35rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 46, 147, 0.6), 0 0 30px rgba(0, 245, 212, 0.4);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.start-rhythm-btn:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 12px 35px rgba(255, 46, 147, 0.8), 0 0 40px rgba(0, 245, 212, 0.6);
}

/* --- Active Rhythm Gameplay Field --- */
.rhythm-playfield-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* HUD Top */
.rhythm-hud {
    width: 100%;
    max-width: 520px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 46, 147, 0.3);
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 800;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.05rem;
}

.hud-score {
    color: #FFD166;
    font-size: 1.3rem;
    text-shadow: 0 0 10px rgba(255, 209, 102, 0.6);
}

.hud-combo {
    color: #00F5D4;
    font-size: 1.15rem;
    transition: transform 0.15s ease;
}

.hud-combo.bump {
    transform: scale(1.3);
}

.hud-timer {
    color: #FF758F;
}

/* Fever Bar */
.fever-bar-wrap {
    width: 100%;
    max-width: 520px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #E2E8F0;
}

.fever-track {
    flex: 1;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.fever-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8A2BE2, #FF2E93, #00F5D4);
    border-radius: 10px;
    transition: width 0.2s ease;
    box-shadow: 0 0 12px rgba(255, 46, 147, 0.7);
}

.fever-bar-wrap.fever-active .fever-fill {
    animation: feverRainbow 0.6s infinite linear;
}

@keyframes feverRainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* The 4 Lanes */
.rhythm-stage-lanes {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 320px;
    background: rgba(10, 6, 26, 0.7);
    border: 2px solid rgba(255, 46, 147, 0.4);
    border-radius: 20px;
    display: flex;
    overflow: hidden;
    box-shadow: inset 0 0 40px rgba(138, 43, 226, 0.25);
}

.rhythm-lane {
    flex: 1;
    height: 100%;
    position: relative;
    border-left: 1px dashed rgba(255, 255, 255, 0.12);
}

.rhythm-lane:last-child {
    border-left: none;
}

.rhythm-lane-0 { background: linear-gradient(180deg, transparent, rgba(255, 46, 147, 0.08)); }
.rhythm-lane-1 { background: linear-gradient(180deg, transparent, rgba(138, 43, 226, 0.08)); }
.rhythm-lane-2 { background: linear-gradient(180deg, transparent, rgba(0, 245, 212, 0.08)); }
.rhythm-lane-3 { background: linear-gradient(180deg, transparent, rgba(255, 209, 102, 0.08)); }

/* Target Hit Line */
.rhythm-target-line {
    position: absolute;
    bottom: 64px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #FF2E93, #8A2BE2, #00F5D4, #FFD166);
    box-shadow: 0 0 15px rgba(255, 46, 147, 0.8), 0 0 25px rgba(0, 245, 212, 0.8);
    z-index: 5;
    pointer-events: none;
}

/* Dropping Rhythm Note */
.rhythm-note {
    position: absolute;
    width: 52px;
    height: 52px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    box-shadow: 0 0 18px currentColor;
    z-index: 10;
    pointer-events: none;
    transition: transform 0.05s linear;
}

.rhythm-note.note-0 { color: #FF2E93; background: radial-gradient(circle, #FF2E93 20%, rgba(255,46,147,0.3) 100%); border: 2px solid #FFF; }
.rhythm-note.note-1 { color: #8A2BE2; background: radial-gradient(circle, #8A2BE2 20%, rgba(138,43,226,0.3) 100%); border: 2px solid #FFF; }
.rhythm-note.note-2 { color: #00F5D4; background: radial-gradient(circle, #00F5D4 20%, rgba(0,245,212,0.3) 100%); border: 2px solid #FFF; }
.rhythm-note.note-3 { color: #FFD166; background: radial-gradient(circle, #FFD166 20%, rgba(255,209,102,0.3) 100%); border: 2px solid #FFF; }

.rhythm-note.bonus-math {
    border-color: #FFD166 !important;
    animation: bonusSpin 1s infinite linear;
    box-shadow: 0 0 25px #FFD166, 0 0 40px #FF2E93 !important;
}

@keyframes bonusSpin {
    from { transform: translateX(-50%) rotate(0deg); }
    to { transform: translateX(-50%) rotate(360deg); }
}

/* 4 Hit Pads Bottom Controls */
.rhythm-hit-controls {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    display: flex;
    height: 56px;
    z-index: 15;
}

.rhythm-hit-pad {
    flex: 1;
    margin: 0 4px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.08s ease;
    font-size: 1.3rem;
}

.rhythm-hit-pad span.pad-key {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 800;
}

.rhythm-hit-pad:active,
.rhythm-hit-pad.pressed {
    transform: scale(0.92);
    filter: brightness(1.4);
    box-shadow: 0 0 25px currentColor;
}

.rhythm-hit-pad.pad-0 { color: #FF2E93; border-color: #FF2E93; }
.rhythm-hit-pad.pad-1 { color: #8A2BE2; border-color: #8A2BE2; }
.rhythm-hit-pad.pad-2 { color: #00F5D4; border-color: #00F5D4; }
.rhythm-hit-pad.pad-3 { color: #FFD166; border-color: #FFD166; }

/* Hit Popup Animation */
.hit-popup {
    position: absolute;
    left: 50%;
    bottom: 85px;
    transform: translateX(-50%);
    font-size: 1.6rem;
    font-weight: 900;
    pointer-events: none;
    z-index: 20;
    animation: hitPop 0.55s ease-out forwards;
    white-space: nowrap;
}

.hit-popup.perfect {
    color: #FFD166;
    text-shadow: 0 0 15px #FFD166, 0 0 25px #FF2E93;
}

.hit-popup.great {
    color: #00F5D4;
    text-shadow: 0 0 15px #00F5D4;
}

.hit-popup.good {
    color: #FF758F;
    text-shadow: 0 0 12px #FF758F;
}

.hit-popup.miss {
    color: #EF4444;
    text-shadow: 0 0 12px #EF4444;
}

@keyframes hitPop {
    0% { transform: translate(-50%, 0) scale(0.7); opacity: 0; }
    30% { transform: translate(-50%, -15px) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -40px) scale(1); opacity: 0; }
}

/* --- Victory / Result Screen --- */
.rhythm-result-screen {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    width: 100%;
    max-width: 480px;
    animation: modalPopIn 0.4s ease;
}

.rank-badge-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.rank-badge-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 0 15px #FFD166);
    animation: iconBounce 1.8s infinite ease-in-out;
}

.rank-title {
    font-size: 2.1rem;
    font-weight: 900;
    color: #FFD166;
    text-shadow: 0 0 20px rgba(255, 209, 102, 0.7), 0 0 35px rgba(255, 46, 147, 0.5);
    margin: 0;
}

.rank-subtitle {
    font-size: 1.2rem;
    color: #FFFFFF;
    font-weight: 800;
}

.result-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    margin: 0.5rem 0;
}

.result-stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 46, 147, 0.3);
    border-radius: 18px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.result-stat-val {
    font-size: 1.5rem;
    font-weight: 900;
    color: #00F5D4;
}

.result-stat-lbl {
    font-size: 0.85rem;
    color: #94A3B8;
    font-weight: 700;
}

.result-xp-reward {
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.2), rgba(255, 46, 147, 0.2));
    border: 1.5px solid #FFD166;
    color: #FFD166;
    padding: 8px 22px;
    border-radius: 50px;
    font-weight: 900;
    font-size: 1.1rem;
    box-shadow: 0 0 15px rgba(255, 209, 102, 0.3);
}

.result-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.result-btn {
    padding: 10px 26px;
    border-radius: 50px;
    font-size: 1.15rem;
    font-weight: 900;
    border: none;
    cursor: pointer;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    transition: all 0.2s ease;
}

.result-btn.retry {
    background: linear-gradient(135deg, #FF2E93, #8A2BE2);
    color: #FFFFFF;
    box-shadow: 0 4px 18px rgba(255, 46, 147, 0.5);
}

.result-btn.close {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
}

.result-btn:hover {
    transform: translateY(-3px) scale(1.03);
}
