/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 游戏容器 */
#gameContainer {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid #333;
}

/* 游戏标题栏 */
#gameHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 2px solid #444;
}

#gameHeader h1 {
    font-size: 28px;
    color: #ff6b6b;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#gameStats {
    display: flex;
    gap: 20px;
}

.stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #555;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 80px;
}

.stat .icon {
    font-size: 18px;
}

/* 游戏主体 */
#gameMain {
    display: flex;
    gap: 20px;
    position: relative;
}

/* Canvas 样式 */
#gameCanvas {
    border: 3px solid #666;
    border-radius: 10px;
    background: #2c3e50;
    cursor: crosshair;
}

#gameCanvas:hover {
    border-color: #888;
}

/* 游戏UI */
#gameUI {
    position: relative;
    width: 300px;
}

/* 菜单样式 */
.menu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #555;
    border-radius: 10px;
    padding: 20px;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
}

.menu.hidden {
    display: none;
}

.menu h3 {
    color: #ff6b6b;
    margin-bottom: 15px;
    text-align: center;
    font-size: 20px;
}

.menu h2 {
    color: #ffd93d;
    margin-bottom: 15px;
    text-align: center;
    font-size: 24px;
}

/* 建造菜单按钮 */
.menu-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.build-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 15px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.build-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

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

.build-btn small {
    display: block;
    margin-top: 5px;
    color: #ffd93d;
    font-weight: bold;
}

/* 通用按钮 */
button {
    background: #ff6b6b;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

button:hover {
    background: #ee5a52;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

#upgradeBtn {
    background: #4ecdc4;
    margin-right: 10px;
    width: calc(50% - 5px);
}

#upgradeBtn:hover {
    background: #45b7b8;
}

#sellBtn {
    background: #ffa726;
    width: calc(50% - 5px);
}

#sellBtn:hover {
    background: #ef6c00;
}

#restartBtn {
    background: #6c5ce7;
    font-size: 18px;
    padding: 15px 20px;
}

#restartBtn:hover {
    background: #5f3dc4;
}

/* 升级信息 */
#upgradeInfo {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #555;
}

#upgradeInfo p {
    margin-bottom: 8px;
    font-size: 14px;
}

#upgradeInfo .current {
    color: #4ecdc4;
}

#upgradeInfo .next {
    color: #ffd93d;
}

/* 游戏结束统计 */
#gameStats2 {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #555;
}

#gameStats2 p {
    margin-bottom: 10px;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
}

#gameStats2 span {
    color: #ffd93d;
    font-weight: bold;
}

/* 游戏说明 */
#gameInstructions {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid #444;
}

#gameInstructions h4 {
    color: #ff6b6b;
    margin-bottom: 10px;
    font-size: 16px;
}

#gameInstructions p {
    margin-bottom: 5px;
    font-size: 14px;
    color: #ccc;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    #gameMain {
        flex-direction: column;
    }
    
    #gameUI {
        width: 100%;
    }
    
    #gameCanvas {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 800px) {
    #gameContainer {
        padding: 10px;
        margin: 10px;
    }
    
    #gameHeader {
        flex-direction: column;
        gap: 10px;
    }
    
    #gameStats {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .stat {
        min-width: auto;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.menu {
    animation: fadeIn 0.3s ease-in-out;
}

/* 禁用按钮样式 */
button:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

button:disabled:hover {
    background: #666;
    transform: none;
} 