/* 全局樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(to bottom, #87CEEB, #1E90FF);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* 遊戲容器 */
.game-container {
    width: 100%;
    max-width: 500px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    padding: 20px;
    text-align: center;
}

/* 遊戲標題和分數 */
.game-header {
    margin-bottom: 15px;
}

.game-header h1 {
    color: #FF6B6B;
    margin-bottom: 10px;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.score-container, .best-score-container {
    display: inline-block;
    margin: 0 10px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

/* 遊戲畫布 */
#game-canvas {
    width: 100%;
    height: 400px;
    background-color: #F0F8FF;
    border-radius: 10px;
    border: 3px solid #4682B4;
    margin-bottom: 15px;
    touch-action: manipulation;
}

/* 遊戲控制按鈕 */
.game-controls {
    margin-bottom: 15px;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

button:active {
    transform: scale(0.95);
}

#restart-button, #play-again-button {
    background-color: #FF6B6B;
}

#restart-button:hover, #play-again-button:hover {
    background-color: #ff5252;
}

/* 導航連結 */
.nav-links {
    margin-top: 15px;
}

.nav-button {
    display: inline-block;
    background-color: #4682B4;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.nav-button:hover {
    background-color: #3a6d99;
    transform: scale(1.05);
}

.nav-button:active {
    transform: scale(0.95);
}

/* 遊戲結束畫面 */
.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    z-index: 10;
}

.game-over h2 {
    color: #FF6B6B;
    margin-bottom: 15px;
}

.game-over p {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

/* 響應式設計 */
@media (max-width: 600px) {
    .game-container {
        width: 95%;
        padding: 15px;
    }
    
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    #game-canvas {
        height: 350px;
    }
    
    button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .game-header h1 {
        font-size: 1.3rem;
    }
    
    .score-container, .best-score-container {
        font-size: 1rem;
        margin: 0 5px;
    }
    
    #game-canvas {
        height: 300px;
    }
}