 /*
        =============================================================
        BASE STYLES
        =============================================================
        */

        :root {
            /* Define color palette */
            --primary-color: #007bff; /* Blue */
            --secondary-color: #6c757d; /* Gray */
            --accent-color: #ffc107; /* Yellow/Gold for stars */
            --background-dark: #1a1a1a; /* Dark background */
            --card-background: #2c2c2c; /* Slightly lighter card background */
            --text-light: #ffffff; /* White text */
            --header-height-base: 60px;
        }

        body {
            font-family: 'Inter', Arial, sans-serif;
            background-color: var(--background-dark);
            color: var(--text-light);
            margin: 0;
            padding-top: var(--header-height-base); /* Space for fixed header */
        }

        /* --- Typography and Links --- */
        h2, h3, h4 {
            color: var(--text-light);
        }

        a {
            color: var(--primary-color);
            text-decoration: none;
            transition: color 0.3s;
        }

        a:hover {
            color: var(--accent-color);
        }

        .btn {
            padding: 10px 15px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-weight: bold;
            transition: background-color 0.3s, transform 0.2s;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
        }

        .btn-primary {
            background-color: var(--primary-color);
            color: var(--text-light);
        }

        .btn-secondary {
            background-color: var(--secondary-color);
            color: var(--text-light);
        }

        .btn:hover {
            transform: translateY(-2px);
            opacity: 0.9;
        }

        /* --- Header Styles --- */
        header {
            background-color: #0e0e0e; /* Even darker header */
            padding: 10px 5%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: fixed; /* Fixed header */
            top: 0;
            left: 0;
            width: 90%; /* Adjusted width because of 5% padding on each side */
            z-index: 1000;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
            /* Ensure smooth wrapping transition */
            transition: padding-top 0.3s, padding-bottom 0.3s, height 0.3s;
        }

        header h1 {
            font-size: 1.3rem;
            font-weight: bold;
            color: var(--accent-color);
        }

        
       h3{
        color: #007bff;
       }
        /* --- Game Grid --- */
        .game-grid {
            display: grid; /* Changed from flex to grid for better layout control */
            /* Default for large screens: 4 columns */
            grid-template-columns: repeat(4, 1fr);
            gap: 55px;
            margin-bottom: 30px;
            padding: 20px 55px; /* Added padding to the grid container */
        }

        .game-card {
            background-color: var(--card-background);
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
            /* Removed position: relative as the button is no longer absolutely positioned */
            transition: transform 0.3s, box-shadow 0.3s;
            /* Added for vertical stacking */
            display: flex;
            flex-direction: column;
        }

        .game-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
        }

        .game-thumbnail {
            width: 100%;
            height: 150px; /* Fixed height for thumbnails */
            object-fit: cover;
            display: block;
        }
        
        /* Fallback styling for missing images */
        .game-thumbnail[src^="placeholder"], .hero-image[src^="placeholder"] {
            background-color: #444;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--secondary-color);
            font-size: 0.9rem;
            /* The 'content' property below won't work on img tags, this is for demonstration */
            /* content: "Image Missing"; */ 
        }
        /* Using :before for content on images is generally not supported, removing the original line */
        /* .game-thumbnail:before { content: "Loading Image..."; } */


        .card-info {
            padding: 10px;
            flex-grow: 1; /* Allows info to take up remaining vertical space */
        }

        .card-info h4 {
            margin: 0 0 5px 0;
            font-size: 1.1rem;
        }

        .card-meta {
            font-size: 0.85rem;
            color: var(--secondary-color);
        }

        .card-meta .rating {
            color: var(--accent-color);
        }

        /* --- UPDATED: Play Button Styling (Underneath the picture/info) --- */
        .card-play-btn {
            /* Removed absolute positioning properties */
            
            display: block; 
            text-align: center;
            text-decoration: none;
            font-weight: bold;
            
            /* Sizing and positioning */
            width: 90%;
            margin: 10px auto 15px auto; /* Center button horizontally, add vertical margins */
            padding: 10px 0;
            
            /* Theme Colors */
            background-color: var(--primary-color); 
            color: var(--text-light);
            border-radius: 5px;
            
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
            transition: background-color 0.3s, transform 0.2s;
            
            /* Ensure it is always visible */
            opacity: 1;
        }
        
        /* Removed .game-card:hover .card-play-btn since it's now always visible */

        .card-play-btn:hover {
            background-color: #0056b3; /* Darker shade of primary-color for hover */
            color: var(--accent-color); 
            transform: translateY(-1px);
        }

        .card-play-btn i {
            font-size: 1.2rem; /* Adjusted icon size for the new button */
            margin-right: 8px; 
        }
        /* --- END UPDATED PLAY BUTTON --- */

        .section-footer {
            text-align: center;
            margin-top: 20px;
        }

        /* --- Footer --- */
        .main-footer {
            background-color: #0e0e0e;
            padding: 20px;
            text-align: center;
            border-top: 1px solid var(--card-background);
            margin-top: 40px;
        }

        .footer-links a {
            margin: 0 10px;
            color: var(--secondary-color);
        }

        .main-footer p {
            margin-top: 10px;
            font-size: 0.9rem;
            color: var(--secondary-color);
        }
        
        /* New Back to Top Anchor Styling */
        .main-footer a[href="#top"] {
            display: inline-block;
            margin: 10px 0;
            padding: 5px 10px;
            background-color: #444;
            color: #eee;
            text-decoration: none;
            border-radius: 3px;
        }

        .main-footer a[href="#top"]:hover {
            background-color: #555;
            color: var(--accent-color);
        }


        /*
        =============================================================
        RESPONSIVE STYLES (The Key to Responsiveness)
        =============================================================
        */

        /* 1. Tablet View (max-width: 992px) */
        @media (max-width: 992px) {
            
            header {
                /* Reduced padding to reclaim some width */
                padding: 10px 2%;
                width: 96%;
            }

            body {
                /* Adjust padding for the fixed header */
                padding-top: 80px; 
            }
            
            /* Adjust Game Grid: Show 3 columns */
            .game-grid {
                grid-template-columns: repeat(3, 1fr);
                gap: 25px; /* Reduced gap */
                padding: 20px;
            }
        }

        /* 2. Smaller Tablet/Mobile Landscape View (max-width: 768px) */
        @media (max-width: 768px) {
            
            body {
                padding-top: 100px; /* Slightly more padding for smaller screens */
            }
            
            /* Adjust Game Grid: Show 2 columns */
            .game-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 15px;
            }
            
            .game-thumbnail {
                height: 120px; /* Slightly smaller thumbnail height */
            }
        }

        /* 3. Mobile Portrait View (max-width: 500px) */
        @media (max-width: 500px) {
            
            body {
                padding-top: 80px; /* Max adjusted padding for fixed header */
            }

            /* Adjust Game Grid: Show 1 column with a standard vertical card layout */
            .game-grid {
                grid-template-columns: 1fr;
                gap: 20px;
                padding: 10px;
            }
            
            /* Reset game card to single column stacking */
            .game-card {
                display: flex;
                flex-direction: column;
                height: auto;
            }
            
            .game-thumbnail {
                width: 100%;
                height: 150px;
                border-radius: 8px 8px 0 0;
            }
            
            .card-info {
                padding: 10px;
            }

            /* Ensure the play button appears correctly on mobile */
            .card-play-btn {
                width: 90%;
                margin: 0 auto 15px auto;
                display: block; /* Keep it as a block element */
            }
            
            .game-card:hover {
                transform: none; /* Disable hover movement on small screens */
            }
    
            /* Footer adjustments */
            .footer-links {
                display: flex;
                flex-direction: column;
                gap: 5px;
            }
            
            .footer-links a {
                margin: 5px 0;
            }
        }