/* 游戏样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
}

.game-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    max-width: 840px;
    width: 100%;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.game-header h1 {
    color: #388E3C;
    font-size: 28px;
    margin-right: 20px;
}

.score-container, .level-container {
    background-color: #f5f5f5;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    margin: 5px;
}

#gameCanvas {
    display: block;
    background-color: #E8F5E9;
    border: 2px solid #81C784;
    border-radius: 5px;
    margin: 0 auto;
}

.game-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    gap: 10px;
    margin: 5px 0;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #388E3C;
}

button:active {
    transform: scale(0.98);
}

#pauseBtn {
    background-color: #FFC107;
}

#pauseBtn:hover {
    background-color: #FFA000;
}

#customizeBtn {
    background-color: #2196F3;
}

#customizeBtn:hover {
    background-color: #1976D2;
}

#upgradeBtn {
    background-color: #9C27B0;
}

#upgradeBtn:hover {
    background-color: #7B1FA2;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal h2 {
    color: #388E3C;
    margin-bottom: 20px;
}

.modal p {
    margin-bottom: 15px;
    font-size: 18px;
}

.modal button {
    margin-top: 10px;
    margin-right: 10px;
}

#restartBtn, #nextLevelBtn {
    background-color: #F44336;
}

#restartBtn:hover, #nextLevelBtn:hover {
    background-color: #D32F2F;
}

/* 皮肤选择样式 */
.skin-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.skin-option {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.skin-option.selected {
    border-color: #4CAF50;
    background-color: #E8F5E9;
}

.skin-preview {
    height: 60px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.skin-name {
    font-weight: bold;
    font-size: 14px;
}

.skin-price {
    color: #F57C00;
    font-size: 12px;
    margin-top: 5px;
}

.skin-locked {
    color: #D32F2F;
    font-size: 12px;
    margin-top: 5px;
}

/* 升级选项样式 */
.upgrade-points {
    background-color: #E8F5E9;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: bold;
}

.upgrade-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 20px 0;
    text-align: left;
}

.upgrade-option {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
}

.upgrade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.upgrade-name {
    font-weight: bold;
    font-size: 16px;
}

.upgrade-level {
    display: flex;
    align-items: center;
}

.level-indicator {
    display: flex;
    margin-right: 10px;
}

.level-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ddd;
    margin: 0 2px;
}

.level-dot.filled {
    background-color: #4CAF50;
}

.upgrade-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.upgrade-effect {
    color: #388E3C;
    font-size: 14px;
    font-weight: bold;
}

.upgrade-cost {
    color: #F57C00;
    font-size: 14px;
    margin-top: 5px;
}

.upgrade-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.upgrade-button:disabled {
    background-color: #ddd;
    cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .game-header h1 {
        font-size: 24px;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
    }
    
    .game-controls {
        flex-direction: column;
    }
    
    .control-group {
        width: 100%;
        justify-content: space-between;
    }
    
    button {
        padding: 8px 15px;
        font-size: 14px;
    }
}