/* Add this CSS to improve Core Web Vitals scores */

/* Prevent layout shifts */
.game-image img {
    width: 100%;
    height: 180px; /* Fixed height to prevent layout shift */
    object-fit: cover;
    background-color: #1a1a1a; /* Placeholder background */
}

/* Optimize font loading */
@font-face {
    font-family: 'Inter';
    font-display: swap; /* Improves loading performance */
    src: url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
}

/* Reduce paint complexity */
.game-card {
    will-change: transform; /* Hints browser for optimization */
    contain: layout style paint; /* CSS containment for performance */
}

/* Lazy loading optimization */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Modal Animation Improvements */
[id$="Modal"] {
    transition: opacity 0.3s ease-in-out;
    backdrop-filter: blur(2px);
}

[id$="Modal"][style*="display: block"] {
    animation: fadeIn 0.3s ease-in-out;
}

[id$="Modal"] > div {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(-20px);
}

[id$="Modal"][style*="display: block"] > div {
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-20px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Close button hover effect */
[onclick^="hide"][onclick$="()"] {
    transition: all 0.2s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

[onclick^="hide"][onclick$="()"]:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: scale(1.1);
}
