/* 重置默認樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

/* 主遊戲容器 */
.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 600px;
    width: 100%;
}

/* 遊戲標題 */
.game-header h1 {
    font-size: 2.5em;
    color: #4a5568;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 分數顯示 */
.score-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: bold;
}

.current-score {
    color: #38a169;
}

.high-score {
    color: #d69e2e;
}

/* 遊戲控制按鈕 */
.game-controls {
    margin-bottom: 20px;
}

.control-btn {
    background: linear-gradient(45deg, #4299e1, #3182ce);
    color: white;
    border: none;
    padding: 12px 24px;
    margin: 0 10px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
}

.control-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    box-shadow: none;
}

/* 遊戲區域 */
.game-area {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

#gameCanvas {
    border: 4px solid #4a5568;
    border-radius: 10px;
    background-color: #1a202c;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

/* 遊戲結束畫面 */
.game-over-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.game-over-screen h2 {
    font-size: 2em;
    margin-bottom: 15px;
    color: #fc8181;
}

.game-over-screen p {
    font-size: 1.2em;
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* 遊戲說明 */
.instructions {
    text-align: left;
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
}

.instructions h3 {
    color: #2d3748;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.3em;
}

.instructions ul {
    list-style: none;
    padding-left: 0;
}

.instructions li {
    margin-bottom: 8px;
    padding: 5px 0;
    color: #4a5568;
}

.food-info {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.food-type {
    font-size: 1.5em;
    margin-right: 10px;
    display: inline-block;
    width: 20px;
    text-align: center;
}

.food-1 {
    color: #e53e3e;
}

.food-2 {
    color: #3182ce;
}

.food-3 {
    color: #38a169;
}

/* 遊戲設定 */
.game-settings {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-group label {
    font-weight: bold;
    color: #4a5568;
}

.setting-select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.setting-select:focus {
    outline: none;
    border-color: #4299e1;
}

.setting-btn {
    background: linear-gradient(45deg, #38a169, #2f855a);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(56, 161, 105, 0.3);
}

.setting-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(56, 161, 105, 0.4);
}

/* 特殊能力狀態顯示 */
.powerup-status {
    background: linear-gradient(45deg, #9f7aea, #805ad5);
    color: white;
    padding: 10px 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(159, 122, 234, 0.3);
}

.powerup-timer {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.powerup-timer::after {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    width: var(--progress, 100%);
    transition: width 0.1s linear;
    border-radius: 2px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        margin: 10px;
    }
    
    .game-header h1 {
        font-size: 2em;
    }
    
    .score-display {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .control-btn {
        margin: 5px;
        padding: 10px 20px;
    }
    
    .game-settings {
        flex-direction: column;
        gap: 15px;
    }
    
    .setting-group {
        justify-content: center;
    }
    
    .speed-info {
        color: #667eea;
        font-weight: bold;
        font-size: 14px;
        text-align: center;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 400px;
        height: auto;
    }
}
