body {
    font-family: "Nunito", sans-serif;
    background-color: #F9F9F9;
    margin: 0;
    padding-top: 7.5rem; /* Add padding to body to avoid content being hidden by the fixed header */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: linear-gradient(90deg, #8E44AD, #3498DB);
    color: white;
    padding: 1rem 7rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
}

.logo-link {
    text-decoration: none;
    color: white;
}

.logo {
    font-family: "Baloo 2", cursive;
    font-size: 2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.logo img {
    width: 40px;
    height: 40px;
    margin-right: 1rem;
}

.slogan {
    font-size: 1.2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.search-bar {
    display: block; /* Show by default for desktop */
}

.search-bar input {
    padding: 0.8rem;
    padding-left: 2.5rem;
    border-radius: 20px;
    border: none;
    min-width: 300px;
    background-image: url('../icons/search.svg');
    background-repeat: no-repeat;
    background-position: 10px center;
    background-color: #F9F9F9;
}

.search-bar input:focus {
    outline: none;
}

.mobile-search-bar {
    display: none; /* Hidden by default */
    padding: 1rem;
    background-color: #F9F9F9;
    position: fixed;
    top: 7.5rem; /* Adjust based on header height */
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 999;
}

.mobile-search-bar input {
    width: 100%;
    padding: 0.8rem;
    padding-left: 2.5rem;
    border-radius: 20px;
    border: none;
    background-image: url('../icons/search.svg');
    background-repeat: no-repeat;
    background-position: 10px center;
    background-color: white;
    box-sizing: border-box;
}

.mobile-search-bar input:focus {
    outline: none;
}

h1 {
    font-family: "Baloo 2", cursive;
    color: #8E44AD;
}

.game-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 2rem auto;
}

.game-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.game-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.game-card h3 {
    font-family: "Baloo 2", cursive;
    margin: 0;
    padding: 1rem;
    font-size: 1.2rem;
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #F39C12;
}

/* Game page specific styles */
#game-container {
    background-color: white;
    padding: 2rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
}

#game-container h1 {
    margin: 0;
}

#game-frame-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    margin-bottom: 1.5rem;
}

#game-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.back-link-container {
    margin-bottom: 0.6rem;
}

.main-section {
    margin: 0 auto;
    max-width: 1000px;
    min-width: 70%;
}

.back-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #2ECC71;
    font-weight: bold;
}

#hub {
    font-family: "Poppins", sans-serif;
    font-size: 1.5rem;
    font-weight: 300;
}

.back-link img {
    margin-right: 0.5rem;
}

.back-link:hover {
    text-decoration: underline;
}

.title-and-button-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

#fullscreen-button {
    background: linear-gradient(90deg, #8E44AD, #3498DB);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

#fullscreen-button:hover {
    transform: scale(1.05);
}

#seo-article {
    max-width: 1000px;
    margin: 2rem auto;
    background-color: white;
    padding: 2rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
}

#seo-article h2{
    color: #3498DB;
}

#seo-article h3{
    color: #2ECC71;
}

footer {
    text-align: center;
    margin-top: auto;
    color: #888;
    padding-bottom: 2rem;
}


@media (max-width: 768px) {
    body {
        padding: 1rem;
        padding-top: 12rem; /* Adjusted padding-top for mobile header + search bar */
    }
    .game-list {
        gap: 1rem;
        grid-template-columns: repeat(2, 1fr);
    }
    header {
        flex-direction: column;
        padding: 1rem;
    }
    header .search-bar {
        display: none; /* Hide desktop search bar on mobile */
    }
    .mobile-search-bar {
        display: block; /* Show mobile search bar on mobile */
    }
    .search-bar input {
        min-width: unset;
    }

    header .slogan {
        font-size: 0.7rem;
    }

    #game-frame-wrapper {
        min-height: 200px;
    }
}

@media (max-width: 480px) {
    .game-card h3 {
        font-size: 0.9rem;
    }
}