:root {
    --primary-color: #0081a7;
    --secondary-color: #00afb9;
    --accent-color: #f07167;
    --glass-bg: rgba(253, 252, 220, 0.1);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    --border-radius: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --highlight-color: rgba(253, 252, 220, 0.3);
    --hover-bg: rgba(0, 0, 0, 0.15);
    --button-hover: #f07167;
    --footer-bg: #0081a7;
    --footer-text: #fff;
    --background-bg: #fff;
    --background-movebg: #fed9b7;
}

body {
    margin: 0;
    padding: 0;
    color: #333;
    font-family: 'BerkshireSwash-Regular', sans-serif;
}

h1 {
    font-size: 1.7rem;
    font-weight: 700;
    margin: 0;
    color: var(--accent-color);

}

.more-games {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--background-bg);
    text-align: center;
    margin: 2rem 0 0;
    position: relative;
}

.more-games::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--background-bg);
    border-radius: 5px;
}

a {
    text-decoration: none;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(45deg, #0081a7, #00afb9, #f07167, #fed9b7);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

.background::after {
    content: '';
    position: fixed;
    bottom: 50px;
    left: 2vw;
    width: 70px;
    height: 70px;
    background: url('../images/beer.gif') no-repeat;
    background-size: contain;
    z-index: 10;
    opacity: 0.8;
}

.background::before {
    content: '';
    position: fixed;
    top: 70px;
    right: 2vw;
    width: 70px;
    height: 70px;
    background: url('../images/forest.gif') no-repeat;
    background-size: contain;
    z-index: 10;
    opacity: 0.8;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* 水滴效果 */
.drip-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

/* 水滴效果 */
.drip {
    position: absolute;
    top: -50px;
    width: 15px;
    height: 18px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: dripFall 3s linear infinite;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

@keyframes dripFall {
    0% {
        transform: translateY(0);
        opacity: 0.6;
    }

    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

@keyframes moveBackground {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(50%, 50%);
    }

    100% {
        transform: translate(0, 0);
    }
}

header {
    padding: 0.5rem;
    background-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    transition: box-shadow 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    gap: 20px;
}

.header-title {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    width: 40px;
    transition: transform 0.3s ease;
}

.site-logo:hover {
    transform: scale(1.05);
}

.navbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.menu {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
}

.menu a {
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    /* padding: 0.5rem; */
    border-radius: 5px;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 30px;
    text-align: center;
}

.menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu a:hover {
    background-color: var(--primary-color);
    color: var(--button-hover);
}

.menu a:hover::after {
    opacity: 1;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.menu-toggle img {
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease;
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
}

.search-item {
    display: flex;
    align-items: center;
    margin-left: auto;
}

#search-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 200px;
}

#search-input {
    width: 100%;
    padding: 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease, background 0.3s ease;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#search-input:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.2);
}

#search-form button {
    /* background: var(--accent-color); */
    color: #fff;
    border: none;
    padding: .1rem .35rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#search-form button:hover {
    background: var(--button-hover);
}

@media (max-width: 1150px) {

    .menu {
        display: none;
        position: absolute;
        top: 60px;
        right: 0;
        height: calc(100vh - 120px);
        background-color: var(--secondary-color);
        width: 200px;
        border-radius: 15px;
        flex-direction: column;
        padding: 1.5rem;
        margin: 0;
        gap: 1.2rem;
        transform: translateX(100%);
        transition: transform 0.3s ease, background-color 0.3s ease;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }

    .menu.active {
        display: flex;
        transform: translateX(0);
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        z-index: 11;
    }

    .menu-toggle span {
        width: 30px;
        height: 3px;
        background-color: var(--background-bg);
        border-radius: 2px;
        transition: background-color 0.3s ease;
    }

    .menu-toggle:hover span {
        background-color: #ccc;
    }

    .menu a {
        text-decoration: none;
        color: #fff;
        font-weight: 600;
        font-size: 1.1rem;
        padding: 0.8rem 1.5rem;
        border-radius: 10px;
        position: relative;
        transition: background-color 0.3s ease, transform 0.3s ease;
        line-height: 3rem;
    }

    .menu a:hover {
        background-color: var(--secondary-color);
        transform: scale(1.05);
    }

    .menu a::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 0;
        width: 0;
        height: 2px;
        background-color: var(--primary-color);
        transition: width 0.3s ease;
    }

    .menu a:hover::after {
        width: 100%;
    }

    .menu a.active {
        background-color: var(--primary-color);
        color: #fff;
    }

    .search-item {
        margin-left: 0;
    }
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    grid-auto-rows: 1fr;
    gap: 1.5rem;
    padding: 1rem;
    max-width: 1200px;
    margin: calc(60px + 1rem) auto 1rem;
    min-height: calc(100vh - 250px);
    grid-auto-flow: dense;
    /* padding-top: 250px; */
}

.game-card {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow);
    transition: var(--transition);
    aspect-ratio: 1;
    cursor: pointer;
    backdrop-filter: blur(20px);
}

.game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
    /* 确保遮罩层不阻止点击 */
}

.game-card:hover::before {
    opacity: 1;
}

.game-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 0;
    border-radius: 15px;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.3));
    mask: linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 1) 8%,
            rgba(0, 0, 0, 1) 92%,
            rgba(0, 0, 0, 0) 100%);
    transition: transform 0.3s ease;
}

.game-card:hover .game-logo {
    transform: scale(1.1);
    filter: brightness(1) contrast(1);
}

.game-card::after {
    content: '►';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(45deg, var(--accent-color), var(--button-hover));
    padding: 0.8rem 1.1rem;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(240, 113, 103, 0.4);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.game-card:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: pulse 1.5s infinite;
}

.game-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.game-card.large {
    grid-column: span 2;
    grid-row: span 2;
}

.game-card.medium {
    grid-column: span 1;
    grid-row: span 1;
}

@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 1rem;
    }

    .game-card.large {
        grid-column: span 2;
        grid-row: span 2;
    }
}

@media (min-width: 1200px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 2rem .5rem;
    text-align: center;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 10px;
}

.footer-logo img {
    width: 80px;
    height: 100%;
    border-radius: 10px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-links ul li {
    display: inline;
    margin: 0 auto;
}

.footer-links a {
    text-decoration: none;
    color: var(--footer-text);
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--button-hover);
}

.footer-copyright {
    font-size: 0.9rem;
}

.pag {
    margin: calc(80px + 1rem) auto 1rem;
    max-width: 1200px;
    min-height: calc(100vh - 250px);
    font-size: 1.2rem;
    line-height: 2.2rem;
}