* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --dark-bg: #0f172a;
    --dark-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.hero-content {
    text-align: center;
    z-index: 1;
    position: relative;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
}

/* Games Section */
.games-section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.games-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.game-card {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 18px;
    padding: 1.75rem 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.6);
}

.game-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.game-card::before {
    content: '';
    position: absolute;
    inset-inline-end: -80px;
    top: -80px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35), transparent 70%);
    opacity: 0.4;
    pointer-events: none;
}

.game-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    display: inline-block;
}

/* أيقونة كصورة */
.game-icon-image {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.5);
    padding: 4px;
    transition: transform 0.3s;
}

.game-icon-image:hover {
    transform: scale(1.1);
}

.game-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.game-description {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.9;
}

.game-features-wrapper {
    margin-top: 0.5rem;
}

.game-paragraph {
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 0.35rem;
}

/* Feature مع صورة جانبية أو نص فقط */
.feature-with-image {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
    padding: 1.25rem;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.feature-with-image:hover {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(-5px);
}

.feature-image-side {
    flex-shrink: 0;
    width: 250px;
    min-width: 250px;
    max-width: 250px;
}

.feature-image-side img {
    width: 100%;
    height: auto;
    max-height: 300px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    object-fit: contain;
    background: rgba(15, 23, 42, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-image-side img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.feature-text-side {
    flex: 1;
    min-width: 0;
}

.feature-text-side .game-paragraph {
    margin: 0;
    font-size: 1rem;
    line-height: 1.8;
}

/* صندوق نص فقط (بدون صورة) */
.feature-text-box {
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.feature-text-box .game-paragraph {
    margin-bottom: 0.5rem;
}

/* روابط الفيديو داخل الصندوق */
.feature-videos {
    margin-top: 0.35rem;
}

.feature-video-link {
    font-size: 0.95rem;
    margin: 0.15rem 0;
    color: var(--text-secondary);
}

.feature-video-link a {
    color: var(--accent-color);
    font-weight: 500;
    text-decoration: underline;
}

.feature-video-link a:hover {
    color: var(--primary-color);
}

.paragraph-image {
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: 14px;
    margin: 0.75rem 0;
    display: block;
    border: 1px solid rgba(148, 163, 184, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    background: rgba(30, 41, 59, 0.3);
}

.paragraph-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

/* إصلاح مشكلة عدم ظهور الصور */
.paragraph-image[src] {
    min-height: 50px;
    object-fit: contain;
}

.paragraph-image:not([src]) {
    display: none;
}

/* معرض الصور - عرض عدة صور */
.images-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.images-gallery .paragraph-image {
    margin: 0;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* إذا كانت صورة واحدة فقط */
.images-gallery:has(img:only-child) {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 1rem auto;
}

.game-description a,
.game-paragraph a {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: 500;
}

.game-description a:hover,
.game-paragraph a:hover {
    color: var(--primary-color);
}

/* About Section */
.about-section {
    padding: 5rem 0;
    background: rgba(30, 41, 59, 0.3);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 2;
}

/* Footer */
.footer {
    background: var(--dark-card);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* معرض الصور على الموبايل */
    .images-gallery {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .paragraph-image {
        border-radius: 10px;
    }
    
    /* Feature مع صورة على الموبايل */
    .feature-with-image {
        flex-direction: column;
        gap: 1rem;
    }
    
    .feature-image-side {
        width: 100%;
        max-width: 100%;
        min-width: auto;
    }
    
    .feature-image-side img {
        max-height: 250px;
    }
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

