#games {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    position: relative;
    overflow: hidden;
    background-color: #21435b;
    color: white;
    transition: background-color 0.3s ease-in-out;
}

#games:hover {
    background-color: #054883;
}

/* Dynamic Grid Background */
.grid-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg);
    transform-origin: top;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0);
    }
    100% {
        transform: perspective(500px) rotateX(60deg) translateY(50px);
    }
}

/* Header Styles */
.games-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
    color: white;
    transition: transform 0.3s ease, color 0.3s ease;
}

.section-title:hover {
    transform: scale(1.1);
    color: #1ab2b0;
}

.title-underline {
    width: 60px;
    height: 2px;
    background: rgba(26, 178, 176, 0.3);
    margin: 1rem auto;
    position: relative;
}

.title-underline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 100%;
    background: #1ab2b0;
    animation: slideRight 2s ease-in-out infinite;
}

@keyframes slideRight {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(30px);
    }
    100% {
        transform: translateX(0);
    }
}

/* Games Container */
.games-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

/* Game Card */
.game-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(26, 178, 176, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 450px;
    margin: 0 auto;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(26, 178, 176, 0.2);
}

.game-content {
    position: relative;
    width: 100%;
    height: 100%;
}

.game-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.game-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.game-card:hover .game-image img {
    transform: scale(1.1);
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-card:hover .game-overlay {
    opacity: 1;
}

.play-button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: #1ab2b0;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.game-card:hover .play-button {
    transform: translateY(0);
    opacity: 1;
}

.play-button:hover {
    background: #169c9a;
    transform: scale(1.05);
}

.game-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.game-card:hover .game-info {
    transform: translateY(0);
}

.game-info h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: white;
}

.game-info p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .games-container {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
    
    .game-card {
        max-width: 400px;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .game-info h3 {
        font-size: 1.2rem;
    }
    
    .game-info p {
        font-size: 0.85rem;
    }
    
    .play-button {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .game-card {
        max-width: 350px;
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: 1.8rem;
    }
    
    .game-info {
        padding: 1.2rem;
    }
    
    .game-info h3 {
        font-size: 1.1rem;
    }
    
    .game-info p {
        font-size: 0.8rem;
    }
    
    .play-button {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .game-card {
        max-width: 300px;
    }
}
