
:root {
    --primary-red: #e30613;
    --primary-yellow: #f8c92a;
    --primary-blue: #007bff;
    --text-dark: #333;
    --text-light: #fff;
    --background-color: #f7f3f1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Fredoka One', cursive;
    background-color: var(--background-color);
    color: var(--text-dark);
}

/* --- Header and Navigation (Mobile First) --- */
.header {
    background-color: var(--primary-red);
    color: var(--text-light);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 5px solid var(--primary-yellow);
}

.header-main-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header .logo h1 {
    font-size: 1.5em;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.2);
}

/* Mobile-only category toggle button (☰) */
.category-toggle-button {
    display: block; /* Show on mobile */
    cursor: pointer;
    color: var(--text-light);
    font-size: 2em;
    text-decoration: none;
    line-height: 1; /* Aligns the icon vertically */
}

/* Mobile category links container */
.nav-categories-mobile {
    display: none; /* Hidden by default */
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
}

.nav-categories-mobile.is-open {
    display: flex; /* Display when toggle button is clicked */
}

.nav-categories-mobile a {
    flex-grow: 1;
    text-align: center;
    padding: 8px 15px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.9em;
    transition: background-color 0.3s;
}

.nav-categories-mobile a.active,
.nav-categories-mobile a:hover {
    background-color: var(--primary-yellow);
    color: var(--text-dark);
}

.search-container {
    width: 100%;
    margin-top: 20px;
}

.search-container input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--primary-yellow); /* Restored border */
    border-radius: 50px;
    font-size: 1em;
    outline: none;
    background-color: var(--text-light);
    color: var(--text-dark);
}

/* PC端的分类导航在手机端默认隐藏 */
.nav-categories-desktop {
    display: none;
}

/* --- Desktop Specific Styles --- */
@media (min-width: 768px) {
    .header {
        flex-direction: row;
        justify-content: space-between;
        padding: 20px 40px;
    }

    .header-main-row {
        width: auto;
    }

    .header .logo h1 {
        font-size: 2em;
    }

    .category-toggle-button {
        display: none; /* Hide on desktop */
    }

    .nav-categories-mobile {
        display: none; /* Hide on desktop */
    }

    /* Show desktop nav on PC */
    .nav-categories-desktop {
        display: flex;
        flex-direction: row;
        margin-top: 0;
    }

    .nav-categories-desktop a {
        padding: 0;
        background-color: transparent;
        margin-left: 25px;
        font-size: 1.2em;
        text-decoration: none;
        color: var(--text-light);
        transition: color 0.3s;
    }

    .nav-categories-desktop a.active,
    .nav-categories-desktop a:hover {
        color: var(--primary-yellow);
        background-color: transparent;
    }

    .search-container {
        width: auto;
        margin-top: 0;
        margin-left: 20px;
    }

    .search-container input {
        width: 300px; /* PC端搜索框加长 */
    }
}

/* --- Game Gallery and Cards --- */
.game-gallery-container {
    max-width: 1500px;
    margin: 40px auto;
    padding: 0 20px;
}

.gallery-title {
    font-size: 2em;
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-blue);
    text-shadow: 2px 2px 0 var(--text-dark);
}

.game-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.game-card {
    background-color: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.game-card.hovered-effect {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
}

.game-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.card-content {
    padding: 15px;
}

.card-content h3 {
    font-size: 1.4em;
    margin-bottom: 8px;
    color: var(--primary-red);
}

.game-meta {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 15px;
}

.play-button {
    display: inline-block;
    padding: 10px 25px;
    background-color: var(--primary-yellow);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 50px;
    font-size: 1em;
    text-transform: uppercase;
    font-weight: bold;
    box-shadow: 0 4px 0 var(--primary-yellow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.play-button:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--primary-yellow);
}

.game-card.hidden {
    display: none;
}

a {
    text-decoration: none;
}