body {
    font-family: 'Arial', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    background-color: #f0f8ff;
    box-sizing: border-box;
}

.main-menu {
    text-align: center;
}

h1 {
    font-size: min(36px, 8vw);
    color: #0056b3;
    margin-bottom: min(40px, 5vw);
}

.game-selection {
    display: grid; /* 使用 Grid 布局 */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 響應式格子 */
    gap: min(40px, 5vw); /* 按鈕間距 */
    max-width: 900px; /* 調整最大寬度以容納3個按鈕 */
    width: 100%;
}

.game-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 250px;
    aspect-ratio: 1;
    padding: min(20px, 4vw);
    border-radius: 20px;
    background-color: #ffffff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #333;
    transition: transform 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.game-button:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

.game-icon {
    font-size: min(80px, 12vw);
    margin-bottom: 10px;
}

h2 {
    font-size: min(24px, 4.5vw);
    margin: 10px 0;
    color: #0056b3;
}

p {
    font-size: min(16px, 3.5vw);
    color: #555;
}

/* iPad 媒體查詢 */
@media (min-width: 768px) and (max-width: 1024px) {
    .game-selection {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        max-width: 600px;
    }
    
    .game-button {
        min-width: 280px;
        max-width: 300px;
        padding: 25px;
    }
    
    .game-icon {
        font-size: 90px;
        margin-bottom: 15px;
    }
    
    h1 {
        font-size: 42px;
        margin-bottom: 40px;
    }
    
    h2 {
        font-size: 26px;
    }
    
    p {
        font-size: 18px;
    }
}

/* iPad 橫向模式 */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .game-selection {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
        max-width: 800px;
    }
    
    .game-button {
        min-width: 240px;
        max-width: 260px;
        padding: 20px;
    }
    
    .game-icon {
        font-size: 75px;
        margin-bottom: 10px;
    }
    
    h1 {
        font-size: 38px;
        margin-bottom: 30px;
    }
    
    h2 {
        font-size: 22px;
    }
    
    p {
        font-size: 16px;
    }
}

/* 手機版媒體查詢 */
@media (max-width: 767px) {
    .game-selection {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .game-button {
        min-width: 280px;
        max-width: 350px;
        margin: 0 auto;
    }
    
    h1 {
        font-size: 28px;
        margin-bottom: 30px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    .game-button {
        min-width: 260px;
        padding: 15px;
    }
    
    .game-icon {
        font-size: 60px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    p {
        font-size: 14px;
    }
}
