:root {
    --primary: #4b0082;
    --secondary: #8b0000;
    --accent: #9370db;
    --dark: #000000;
    --light: #4b0082;
    --ui-bg: rgba(10, 0, 20, 0.9);
    --ui-border: rgba(139, 0, 0, 0.6);
    --xp-bar: linear-gradient(90deg, #00cec9, #6c5ce7);
    --hp-bar: linear-gradient(90deg, #ff7675, #e17055);
    --mp-bar: linear-gradient(90deg, #0984e3, #6c5ce7);
    --text-primary: #dfe6e9;
    --text-secondary: #b2bec3;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    --transition: all 0.3s ease;
    --particle-color: rgba(139, 0, 0, 0.3);
}

/* Theme: Light */  
.theme-light {
    --primary: #6c5ce7;
    --secondary: #00cec9;
    --accent: #ff7675;
    --dark: #f7f7f7;
    --light: #2d3436;
    --ui-bg: rgba(247, 247, 247, 0.9);
    --ui-border: rgba(108, 92, 231, 0.4);
    --xp-bar: linear-gradient(90deg, #00cec9, #6c5ce7);
    --hp-bar: linear-gradient(90deg, #ff7675, #e17055);
    --mp-bar: linear-gradient(90deg, #0984e3, #6c5ce7);
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Theme: Sunset */
.theme-sunset {
    --primary: #e17055;
    --secondary: #fdcb6e;
    --accent: #6c5ce7;
    --dark: #2d3436;
    --light: #f7f7f7;
    --ui-bg: rgba(45, 52, 54, 0.9);
    --ui-border: rgba(225, 112, 85, 0.6);
    --xp-bar: linear-gradient(90deg, #fdcb6e, #e17055);
    --hp-bar: linear-gradient(90deg, #6c5ce7, #00cec9);
    --mp-bar: linear-gradient(90deg, #ff7675, #d63031);
    --text-primary: #f7f7f7;
    --text-secondary: #b2bec3;
}

/* Theme: Ocean */
.theme-ocean {
    --primary: #0984e3;
    --secondary: #00cec9;
    --accent: #6c5ce7;
    --dark: #0f3460;
    --light: #dfe6e9;
    --ui-bg: rgba(15, 52, 96, 0.9);
    --ui-border: rgba(9, 132, 227, 0.6);
    --xp-bar: linear-gradient(90deg, #00cec9, #0984e3);
    --hp-bar: linear-gradient(90deg, #6c5ce7, #a29bfe);
    --mp-bar: linear-gradient(90deg, #74b9ff, #0984e3);
    --text-primary: #dfe6e9;
    --text-secondary: #b2bec3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #000000, #4b0082, #8b0000);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: var(--transition);
}

body.theme-light {
    background: linear-gradient(135deg, #f7f7f7, #e0e0e0, #d1d1d1);
}

body.theme-sunset {
    background: linear-gradient(135deg, #1a1a2e, #2d3436, #636e72);
}

body.theme-ocean {
    background: linear-gradient(135deg, #0f0c29, #0f3460, #1a1a2e);
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(75, 0, 130, 0.2) 0%, transparent 25%),
        radial-gradient(circle at 80% 70%, rgba(139, 0, 0, 0.2) 0%, transparent 25%);
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 10% 20%, var(--particle-color) 1px, transparent 1px),
        radial-gradient(1px 1px at 90% 80%, var(--particle-color) 1px, transparent 1px);
    background-size: 100px 100px;
    animation: floatParticles 20s linear infinite;
    pointer-events: none;
    z-index: -1;
}
@keyframes floatParticles {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 100px 100px, -100px -100px; }
}

/* Pixel art styling */
.pixel {
    image-rendering: pixelated;
}

/* Language and Theme Controls */
.controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 1000;
}

.theme-selector, .language-selector {
    background: var(--ui-bg);
    border: 2px solid var(--ui-border);
    border-radius: 50px;
    padding: 8px 15px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    display: flex;
    gap: 10px;
}

/* === Minimal neon control buttons === */
.theme-btn,
.lang-btn {
    border: 2px solid var(--ui-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 0 rgba(108, 92, 231, 0);
    z-index: 1;
}

/* Neon border effect */
.theme-btn::after,
.lang-btn::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: linear-gradient(45deg, 
        var(--primary), 
        var(--secondary)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, 
                 linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Hover effects */
.theme-btn:hover,
.lang-btn:hover {
    transform: translateY(-3px) scale(1.05);
    color: white;
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

.theme-btn:hover::after,
.lang-btn:hover::after {
    opacity: 0.7;
    animation: pulseGlow 2s infinite;
}

/* Active state */
.theme-btn.active, 
.lang-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.5);
}

.theme-btn.active::after,
.lang-btn.active::after {
    opacity: 1;
    animation: pulseGlow 1.5s infinite;
}

/* Special accent for language button */
.lang-btn {
    border-color: var(--accent);
}

.lang-btn::after {
    background: linear-gradient(45deg, 
        var(--accent), 
        var(--secondary)) border-box;
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    box-shadow: 0 0 20px rgba(255, 118, 117, 0.5);
}

/* Pulse glow animation */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 5px var(--primary);
    }
    50% {
        box-shadow: 0 0 15px var(--primary);
    }
    100% {
        box-shadow: 0 0 5px var(--primary);
    }
}

/* For language button */
.lang-btn.active {
    animation: pulseGlowAccent 1.5s infinite;
}

@keyframes pulseGlowAccent {
    0% {
        box-shadow: 0 0 5px var(--accent);
    }
    50% {
        box-shadow: 0 0 15px var(--accent);
    }
    100% {
        box-shadow: 0 0 5px var(--accent);
    }
}

/* Tooltip for buttons */
.theme-btn::before,
.lang-btn::before {
    content: attr(title);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--ui-bg);
    color: var(--text-primary);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 100;
}

.theme-btn:hover::before,
.lang-btn:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(5px);
}

        /* Main game container */
        .game-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 2rem;
            position: relative;
        }

        /* Start screen */
        #start-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: radial-gradient(circle, #1a1a2e, #0f0c29);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 100;
            transition: opacity 1s ease-out;
        }

        .theme-light #start-screen {
            background: radial-gradient(circle, #f0f0f0, #d1d1d1);
        }

        .theme-sunset #start-screen {
            background: radial-gradient(circle, #2d3436, #1a1a2e);
        }

        .theme-ocean #start-screen {
            background: radial-gradient(circle, #0f3460, #0f0c29);
        }

        .title {
            font-size: 5rem;
            background: linear-gradient(45deg, var(--primary), var(--secondary));
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            text-align: center;
            margin-bottom: 2rem;
            text-shadow: 0 0 10px var(--accent), 0 0 20px var(--secondary);
            font-weight: 800;
            letter-spacing: 3px;
        }

        .subtitle {
            font-size: 1.5rem;
            color: var(--light);
            margin-bottom: 3rem;
            text-align: center;
            max-width: 600px;
            line-height: 1.6;
        }

        .start-button {
            background: linear-gradient(45deg, var(--primary), var(--secondary));
            border: none;
            padding: 1.2rem 3.5rem;
            font-size: 1.5rem;
            color: white;
            border-radius: 50px;
            cursor: pointer;
            transition: var(--transition);
            position: relative;
            overflow: hidden;
            box-shadow: 0 0 20px rgba(108, 92, 231, 0.5);
        }

        .start-button:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(108, 92, 231, 0.7);
        }

        .start-button::after {
            content: "";
            position: absolute;
            top: -50%;
            left: -60%;
            width: 20px;
            height: 200%;
            background: rgba(255, 255, 255, 0.3);
            transform: rotate(25deg);
            transition: all 0.6s;
        }

        .start-button:hover::after {
            left: 120%;
        }

        /* Character section */
        .character-section {
            display: flex;
            flex-wrap: wrap;
            gap: 2rem;
            margin: 3rem 0;
            align-items: center;
            justify-content: center;
        }

        .character-card {
            background: var(--ui-bg);
            border: 2px solid var(--ui-border);
            border-radius: 15px;
            padding: 2rem;
            width: 100%;
            max-width: 500px;
            box-shadow: var(--shadow);
            backdrop-filter: blur(10px);
            transition: var(--transition);
        }

        .character-header {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            margin-bottom: 1.5rem;
        }

        .character-avatar {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            border: 3px solid var(--secondary);
            background: linear-gradient(45deg, var(--dark), var(--text-secondary));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 3rem;
            color: var(--secondary);
        }

        .character-info h2 {
            font-size: 2.2rem;
            margin-bottom: 0.5rem;
            color: var(--secondary);
        }

        .character-info .class {
            font-size: 1.2rem;
            color: var(--accent);
            font-weight: bold;
        }

        .stats {
            margin: 1.5rem 0;
        }

        .stat-bar {
            margin-bottom: 1rem;
        }

        .stat-label {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.3rem;
            color: var(--text-primary);
        }

        .bar-container {
            height: 20px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            overflow: hidden;
        }

        .bar {
            height: 100%;
            border-radius: 10px;
        }

        .xp-bar {
            background: var(--xp-bar);
            width: 85%;
        }

        .hp-bar {
            background: var(--hp-bar);
            width: 90%;
        }

        .mp-bar {
            background: var(--mp-bar);
            width: 80%;
        }

        /* Sections */
        .section-title {
            font-size: 2.5rem;
            text-align: center;
            margin: 3rem 0 2rem;
            color: var(--secondary);
            position: relative;
            display: inline-block;
            left: 50%;
            transform: translateX(-50%);
            text-shadow: 0 0 10px var(--accent), 0 0 20px var(--secondary);
        }

        .section-title::after {
            content: "";
            position: absolute;
            bottom: -10px;
            left: 10%;
            width: 80%;
            height: 3px;
            background: linear-gradient(90deg, transparent, var(--primary), transparent);
        }

        /* Skills Tree */
        .skills-tree {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1.5rem;
            margin: 2rem 0;
        }

        .skill-category {
            background: var(--ui-bg);
            border: 2px solid var(--ui-border);
            border-radius: 15px;
            padding: 1.5rem;
            transition: var(--transition);
        }

        .skill-category:hover {
            transform: translateY(-10px);
            border-color: var(--accent);
        }

        .skill-category h3 {
            color: var(--accent);
            margin-bottom: 1rem;
            font-size: 1.5rem;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .skill-list {
            list-style: none;
        }

        .skill-item {
            padding: 0.8rem;
            margin-bottom: 0.8rem;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            display: flex;
            align-items: center;
            gap: 10px;
            transition: var(--transition);
            color: var(--text-primary);
        }

        .skill-item:hover {
            background: rgba(108, 92, 231, 0.2);
            transform: translateX(5px);
        }

        /* Experience Timeline */
        .timeline {
            position: relative;
            max-width: 800px;
            margin: 3rem auto;
        }

        .timeline::after {
            content: '';
            position: absolute;
            width: 4px;
            background: linear-gradient(to bottom, var(--secondary), var(--primary));
            top: 0;
            bottom: 0;
            left: 50%;
            margin-left: -2px;
            border-radius: 2px;
            box-shadow: 0 0 15px var(--accent);
        }

        .timeline-item {
            padding: 1.5rem;
            position: relative;
            width: 50%;
            box-sizing: border-box;
            margin-bottom: 2rem;
        }

        .timeline-item:nth-child(odd) {
            left: 0;
        }

        .timeline-item:nth-child(even) {
            left: 50%;
        }

        .timeline-content {
            background: var(--ui-bg);
            border: 2px solid var(--ui-border);
            border-radius: 15px;
            padding: 1.5rem;
            position: relative;
            backdrop-filter: blur(5px);
            color: var(--text-primary);
        }

        .timeline-content h3 {
            color: var(--secondary);
            margin-bottom: 0.5rem;
        }

        .timeline-content .date {
            color: var(--accent);
            font-weight: bold;
            margin-bottom: 0.8rem;
            display: block;
        }

        /* Education Achievements */
        .achievements {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 2rem;
            margin: 2rem 0;
        }

        .achievement {
            background: var(--ui-bg);
            border: 2px solid var(--ui-border);
            border-radius: 15px;
            padding: 1.5rem;
            width: 250px;
            text-align: center;
            transition: var(--transition);
            color: var(--text-primary);
        }

        .achievement:hover {
            transform: scale(1.05);
            border-color: var(--accent);
        }

        .achievement-icon {
            font-size: 3rem;
            color: var(--secondary);
            margin-bottom: 1rem;
        }

        /* Contact Terminal */
        .terminal {
            background: rgba(10, 10, 20, 0.9);
            border: 2px solid var(--ui-border);
            border-radius: 15px;
            padding: 2rem;
            max-width: 600px;
            margin: 3rem auto;
            font-family: 'Courier New', monospace;
            box-shadow: var(--shadow);
        }

        .theme-light .terminal {
            background: rgba(240, 240, 240, 0.9);
        }

        .terminal-header {
            display: flex;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .terminal-dots {
            display: flex;
            gap: 8px;
            margin-right: 10px;
        }

        .terminal-dot {
            width: 15px;
            height: 15px;
            border-radius: 50%;
        }

        .dot-red { background: #ff5f56; }
        .dot-yellow { background: #ffbd2e; }
        .dot-green { background: #27c93f; }

        .terminal-title {
            color: var(--light);
        }

        .terminal-body {
            line-height: 1.6;
            color: var(--text-primary);
        }

        .terminal-prompt {
            color: var(--secondary);
            margin-right: 10px;
        }

        .terminal-input {
            background: transparent;
            border: none;
            color: var(--text-primary);
            font-family: 'Courier New', monospace;
            font-size: 1rem;
            width: 80%;
            outline: none;
            caret-color: var(--accent);
        }

        /* Footer */
        footer {
            text-align: center;
            padding: 2rem;
            margin-top: 3rem;
            color: rgba(255, 255, 255, 0.6);
            border-top: 1px solid rgba(108, 92, 231, 0.3);
        }

        .theme-light footer {
            color: rgba(45, 52, 54, 0.7);
            border-top: 1px solid rgba(108, 92, 231, 0.1);
        }

        /* RTL Support */
        body.rtl {
            direction: rtl;
        }

        body.rtl .character-header {
            direction: rtl;
        }

        body.rtl .character-info {
            text-align: right;
        }

        body.rtl .skill-item {
            direction: rtl;
            text-align: right;
        }

        body.rtl .timeline::after {
            left: auto;
            right: 50%;
        }

        body.rtl .timeline-item:nth-child(odd) {
            left: auto;
            right: 0;
        }

        body.rtl .timeline-item:nth-child(even) {
            left: auto;
            right: 50%;
        }

        body.rtl .terminal-body {
            direction: rtl;
            text-align: right;
        }

        body.rtl .controls {
            right: auto;
            left: 20px;
        }

        body.rtl .section-title {
            left: auto;
            right: 50%;
            transform: translateX(50%);
        }

        body.rtl .section-title::after {
            left: auto;
            right: 10%;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .title {
                font-size: 3rem;
            }
            
            .timeline::after {
                left: 31px;
            }
            
            .timeline-item {
                width: 100%;
                padding-left: 70px;
                padding-right: 25px;
            }
            
            .timeline-item:nth-child(even) {
                left: 0;
            }

            body.rtl .timeline::after {
                right: 31px;
            }

            body.rtl .timeline-item {
                padding-left: 25px;
                padding-right: 70px;
            }

            .character-section {
                flex-direction: column;
            }

            .character-card {
                max-width: 100%;
            }

            .skills-tree {
                grid-template-columns: 1fr;
            }

            .achievements {
                flex-direction: column;
                align-items: center;
            }

            .achievement {
                width: 80%;
            }

            .section-title {
                font-size: 2rem;
            }

            .controls {
                top: 10px;
                right: 10px;
                flex-direction: column;
                gap: 10px;
            }

            body.rtl .controls {
                right: auto;
                left: 10px;
            }
        }

        @media (max-width: 480px) {
            .title {
                font-size: 2.5rem;
            }

            .subtitle {
                font-size: 1.2rem;
                padding: 0 1rem;
            }

            .start-button {
                padding: 1rem 2.5rem;
                font-size: 1.2rem;
            }

            .character-avatar {
                width: 100px;
                height: 100px;
            }

            .character-info h2 {
                font-size: 1.8rem;
            }

            .section-title {
                font-size: 1.8rem;
            }

            .skill-category h3 {
                font-size: 1.3rem;
            }

            .timeline-content {
                padding: 1rem;
            }

            .terminal {
                padding: 1rem;
            }

            .easter-egg {
                bottom: 10px;
                right: 10px;
                width: 30px;
                height: 30px;
            }

            body.rtl .easter-egg {
                right: auto;
                left: 10px;
            }
        }
        
        /* Animations */
        @keyframes float {
            0% { transform: translateY(0px); }
            50% { transform: translateY(-15px); }
            100% { transform: translateY(0px); }
        }
        
        .floating {
            animation: float 3s ease-in-out infinite;
        }
        
        .pulse {
            animation: pulse 2s infinite;
        }
        
        @keyframes pulse {
            0% { box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.7); }
            70% { box-shadow: 0 0 0 15px rgba(108, 92, 231, 0); }
            100% { box-shadow: 0 0 0 0 rgba(108, 92, 231, 0); }
        }
        
        /* Easter Egg */
        .easter-egg {
            position: fixed;
            bottom: 20px;
            right: 20px;
            width: 40px;
            height: 40px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: move;
            transition: var(--transition);
            z-index: 50;
            animation: pulse 2s infinite;
            opacity: 0;
        }
        
        .easter-egg:hover {
            background: var(--accent);
            transform: scale(1.1);
            opacity: 1;
            box-shadow: 0 0 20px var(--accent);
        }

        body.rtl .easter-egg {
            right: auto;
            left: 20px;
        } 

        /* copyable contact entries */
        .copyable {
            cursor: pointer;
            color: var(--secondary);
            transition: var(--transition);
        }
        .copyable:hover {
            color: var(--accent);
            text-shadow: 0 0 6px var(--accent);
        }

        /* toast notification */
        .toast {
            position: fixed;
            bottom: 30px;
            right: 30px;
            background: var(--ui-bg);
            border: 2px solid var(--accent);
            padding: 10px 20px;
            border-radius: 10px;
            color: var(--text-primary);
            box-shadow: var(--shadow);
            z-index: 1000;
            pointer-events: none;
        }
        body.rtl .toast {
            right: auto;
            left: 30px;
        }
        /* === End enhancements === */ 

        .mouse-follower {
            position: fixed;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: radial-gradient(circle, var(--accent), transparent 70%);
            pointer-events: none;
            z-index: 9999;
            transform: translate(-50%, -50%);
            mix-blend-mode: screen;
        }

        /* Initialize mouse follower */
        document.body.insertAdjacentHTML('beforeend', '<div class="mouse-follower"></div>');
        document.addEventListener('mousemove', (e) => {
            const follower = document.querySelector('.mouse-follower');
            follower.style.left = e.clientX + 'px';
            follower.style.top = e.clientY + 'px';
        }); 

