@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

:root {
    --text-main: #2c3e50;
    --text-sub: #5c6b7a;
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --btn-bg: rgba(255, 255, 255, 0.5);
    --btn-hover: rgba(255, 255, 255, 0.8);
    --icon-bg: rgba(255, 255, 255, 0.6);
    --bg-image: url('tupian/5.png');
}

body.dark-theme {
    --text-main: #f5f6fa;
    --text-sub: #dcdde1;
    --glass-bg: rgba(0, 0, 0, 0.35);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --btn-bg: rgba(255, 255, 255, 0.1);
    --btn-hover: rgba(255, 255, 255, 0.25);
    --icon-bg: rgba(0, 0, 0, 0.5);
    --bg-image: url('tupian/6.png');
}

body {
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-main);
    min-height: 100vh;
    padding: 5vh 20px;
    overflow-x: hidden;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.theme-switch {
    position: fixed;
    top: 30px;
    right: 40px;
    border-radius: 30px;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.theme-switch i {
    font-size: 1.1rem;
    margin-right: 10px;
}

.theme-switch:hover {
    transform: translateY(-3px);
    background: var(--btn-hover);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    padding: 50px 0;
    margin-bottom: 40px;
    border-radius: 24px;
}

h1 {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 3px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-sub);
    letter-spacing: 1px;
    font-weight: 300;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
}

.game-card {
    border-radius: 24px;
    padding: 35px 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.6);
}

.game-icon {
    width: 75px;
    height: 75px;
    background: var(--icon-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.game-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.game-description {
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.7;
    flex-grow: 1;
    margin-bottom: 25px;
    font-weight: 300;
}

.play-btn {
    display: inline-block;
    background: var(--btn-bg);
    color: var(--text-main);
    padding: 10px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 2px;
    border: 1px solid var(--glass-border);
}

.play-btn:hover {
    background: var(--btn-hover);
    transform: scale(1.05);
}

footer {
    text-align: center;
    padding: 25px 0;
    margin-top: 50px;
    border-radius: 24px;
    font-size: 0.85rem;
    color: var(--text-sub);
    font-weight: 300;
    letter-spacing: 1px;
}

#live2d-widget {
    position: fixed !important;
    right: 20px;
    bottom: 10px;
    z-index: 1000;
    pointer-events: none;
}

@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
    header {
        padding: 30px 0;
    }
    h1 {
        font-size: 2.2rem;
    }
    .theme-switch {
        top: 20px;
        right: 20px;
        padding: 8px 16px;
    }
    #live2d-widget {
        transform: scale(0.65);
        transform-origin: bottom right;
    }
}