:root {
    --primary-color: #6a1b9a;
    --secondary-color: #f39c12;
    --text-color: #333;
    --background-color: #f4f4f4;
    --section-bg-color: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    max-width: 1200px; /* 或者您想要的最大宽度 */
    margin: 0 auto;
    padding: 0 20px; /* 添加一些左右内边距 */
    width: 100%; /* 确保容器占满可用宽度 */
}

h1, h2, h3 {
    font-family: 'Fredoka One', cursive;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
}

h2 {
    font-size: 2rem;
    color: var(--secondary-color);
}

h3 {
    font-size: 1.5rem;
}

main {
    padding: 0;
}

.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background-color: var(--background-color);
    width: 100%;
}

section {
    background-color: var(--section-bg-color);
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 2;
    overflow: hidden;

}

.game-container iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(106, 27, 154, 0.8), rgba(243, 156, 18, 0.8));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.game-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
}

.play-button {
    padding: 10px 20px;
    font-size: 1.2rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.play-button:hover {
    background-color: #e67e22;
}

#fullscreen-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    padding: 5px;
    cursor: pointer;
    z-index: 20;
}

#fullscreen-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    padding-top:20px;
    padding-bottom: 10px;
}

.game-item {
    position: relative;
    border-radius: 10px;

    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.game-item:hover {
    transform: translateY(-5px);
}

.game-item img {
    width: 100%;
    height: auto;
    display: block;
}

.game-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-item:hover .game-overlay {
    opacity: 1;
}

.game-overlay h3 {
    color: white;
    text-align: center;
    padding: 10px;
}

#how-to-play {
    padding-top: 30px;
    margin: 40px auto; /* 使用 auto 左右边距来居中 */
    text-align: center; /* 居中标题文本 */
}

.how-to-play-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mode-item, .controls-info {
    background-color: var(--section-bg-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mode-item {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mode-text h3, .controls-info h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.how-to-play-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
}

ul, ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

.faq-item {
    margin-bottom: 20px;
}

footer {
    background-color: var(--primary-color);
    color: white;
    padding: 40px 0;
    text-align: center;
}

footer nav ul {
    list-style-type: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

footer nav ul li {
    margin: 0 10px;
}

footer nav ul li a {
    color: white;
    text-decoration: none;
}

footer nav ul li a:hover {
    text-decoration: underline;
}

@media (min-width: 768px) {
    .mode-item {
        flex-direction: row;
        align-items: center;
    }

    .mode-text {
        flex: 1;
    }

    .how-to-play-image {
        flex: 1;
        max-width: 50%;
    }
}

@media (max-width: 768px) {
    .hero-section {
        min-height: auto;
    }

    .game-container {
        aspect-ratio: 4 / 3;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .how-to-play-content {
        flex-direction: column;
    }

    footer nav ul {
        flex-direction: column;
    }

    footer nav ul li {
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    .game-container {
        aspect-ratio: 1 / 1;
    }

    .game-grid {
        grid-template-columns: 1fr;
    }
}

.how-to-play-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.gameplay-instructions {
    flex: 1;
    min-width: 300px;
    margin-right: 20px;
}

.gameplay-images {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 10px;
}

.gameplay-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .how-to-play-content {
        flex-direction: column;
    }

    .gameplay-instructions,
    .gameplay-images {
        width: 100%;
        margin-right: 0;
        border-radius: 10px;
    }

    .gameplay-image {
        margin-bottom: 10px;
        border-radius: 10px;
    }
}