/* 像素王国建设者 - 游戏样式 */

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

body {
    font-family: 'Courier New', monospace;
    background: #2c3e50;
    color: #ecf0f1;
    user-select: none;
    overflow: hidden;
    touch-action: none;
}

/* 游戏容器 */
#gameContainer {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

/* 游戏UI */
#gameUI {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 状态栏 */
#statusBar {
    height: 60px;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-bottom: 2px solid #f39c12;
    padding: 0 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: bold;
}

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

/* 游戏区域 */
#gameArea {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#gameCanvas {
    border: 3px solid #f39c12;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.3);
    background: #34495e;
    max-width: 100%;
    max-height: 100%;
}

/* 建造菜单 */
#buildMenu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #f39c12;
    border-radius: 12px;
    padding: 20px;
    min-width: 300px;
    box-shadow: 0 0 30px rgba(243, 156, 18, 0.5);
    z-index: 1000;
}

.menu-title {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #f39c12;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.building-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.building-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(52, 73, 94, 0.8);
    border: 1px solid #f39c12;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.building-option:hover {
    background: rgba(243, 156, 18, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.building-icon {
    font-size: 24px;
    width: 30px;
    text-align: center;
}

.building-name {
    font-size: 14px;
    font-weight: bold;
    flex: 1;
}

.building-cost {
    font-size: 12px;
    color: #f39c12;
}

.hidden {
    display: none !important;
}

/* 控制栏 */
#controlBar {
    height: 80px;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    border-top: 2px solid #f39c12;
    padding: 0 20px;
}

.control-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    min-width: 80px;
}

.control-btn:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.control-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 信息面板 */
#infoPanel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #f39c12;
    border-radius: 12px;
    padding: 20px;
    min-width: 350px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(243, 156, 18, 0.5);
    z-index: 1000;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f39c12;
}

.panel-header h3 {
    color: #f39c12;
    font-size: 18px;
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.btn-close:hover {
    background: rgba(231, 76, 60, 0.2);
}

.panel-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-section {
    background: rgba(52, 73, 94, 0.6);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.info-section h4 {
    color: #f39c12;
    margin-bottom: 10px;
    font-size: 14px;
}

.info-section p {
    margin: 5px 0;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #statusBar {
        height: 50px;
        padding: 0 10px;
    }
    
    .stat-item {
        font-size: 14px;
    }
    
    .stat-icon {
        font-size: 16px;
    }
    
    #controlBar {
        height: 70px;
        gap: 10px;
        padding: 0 10px;
    }
    
    .control-btn {
        padding: 10px 15px;
        font-size: 12px;
        min-width: 70px;
    }
    
    #buildMenu, #infoPanel {
        min-width: 280px;
        padding: 15px;
    }
}

/* 像素字体效果 */
@font-face {
    font-family: 'PixelFont';
    src: url('assets/fonts/pixel.ttf') format('truetype');
}

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

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(243, 156, 18, 0.5); }
    50% { box-shadow: 0 0 20px rgba(243, 156, 18, 0.8); }
    100% { box-shadow: 0 0 5px rgba(243, 156, 18, 0.5); }
}

.pulse {
    animation: pulse 2s infinite;
}

.glow {
    animation: glow 2s infinite;
}