:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-color: #2d3748;
    --text-light: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.9);
    --hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.5;
    background-image: radial-gradient(#ffffff 2px, transparent 2px);
    background-size: 30px 30px;
}

.container {
    width: 100%;
    max-width: 900px;
    text-align: center;
}

header {
    margin-bottom: 50px;
    color: var(--text-light);
    animation: fadeInDown 0.8s ease-out;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 10px;
}

.game-card {
    background: var(--card-bg);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease-out backwards;
}

.game-card:nth-child(1) { animation-delay: 0.2s; }
.game-card:nth-child(2) { animation-delay: 0.4s; }

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--hover-shadow);
}

.card-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 2;
    position: relative;
}

.icon {
    font-size: 4rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.game-card h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.game-card p {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 20px;
}

.play-btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.game-card:hover .play-btn {
    transform: scale(1.05);
}

/* Specific styling for cards to give them flavor */
.game-card.sudoku::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(76, 81, 191, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.game-card.crossword::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(237, 137, 54, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.game-card.hangman::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(229, 62, 62, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.game-card.snakes::before {
    content: '';
    position: absolute;
    bottom: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(72, 187, 120, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.game-card:hover::before {
    opacity: 1;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 2.5rem;
    }
    .games-grid {
        grid-template-columns: 1fr;
    }
}
