/* =================== 小镇地图样式 =================== */

/* 小镇地图容器 */
.town-map-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(circle at 30% 30%, rgba(124, 252, 0, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 70% 70%, rgba(107, 142, 35, 0.1) 0%, transparent 40%),
        linear-gradient(45deg, #7CFC00 0%, #90EE90 100%);
    padding: 20px;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* 小镇地图游戏区域 */
#town-map-game-area {
    width: 100%;
    max-width: 1000px;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 8px;
    box-shadow: 
        0 0 0 3px #654321,
        0 0 0 6px #8B4513,
        0 15px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    background: #7CFC00;
}

#town-map-game-area canvas {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.town-map-header {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-family: 'Courier New', monospace;
    animation: townMapHeaderPulse 3s ease-in-out infinite;
}

.town-map-header h2 {
    font-size: 2.2em;
    margin: 0;
    text-shadow: 
        2px 2px 0px #000,
        -1px -1px 0px #fff,
        1px -1px 0px #fff,
        -1px 1px 0px #fff,
        1px 1px 0px #fff;
    font-weight: bold;
    letter-spacing: 1px;
    color: #2E8B57;
}

.town-map-header p {
    font-size: 1.1em;
    margin: 10px 0;
    opacity: 0.85;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.3);
    font-weight: bold;
    color: #556B2F;
}

/* 建筑菜单样式 */
.building-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.building-menu-content {
    background: #F5F5DC;
    border: 4px solid #654321;
    border-radius: 12px;
    padding: 25px;
    max-width: 500px;
    width: 85%;
    max-height: 75vh;
    overflow-y: auto;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    animation: slideIn 0.3s ease;
    font-family: 'Courier New', monospace;
}

.building-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #8B4513;
}

.building-icon {
    font-size: 2.5em;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #FFF8DC;
    border: 2px solid #8B4513;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.building-info h3 {
    margin: 0 0 8px 0;
    font-size: 1.5em;
    color: #2F4F4F;
    font-family: 'Courier New', monospace;
}

.building-info p {
    margin: 0;
    color: #696969;
    font-size: 1em;
    font-family: 'Courier New', monospace;
}

.building-menu .levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 10px;
    margin-bottom: 25px;
}

.building-menu .level-item {
    background: #FFF8DC;
    border: 2px solid #DEB887;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-family: 'Courier New', monospace;
}

.building-menu .level-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.building-menu .level-item.unlocked {
    border-color: #32CD32;
    background: #F0FFF0;
}

.building-menu .level-item.unlocked:hover {
    border-color: #228B22;
    background: #E6FFE6;
}

.building-menu .level-item.locked {
    border-color: #A9A9A9;
    background: #F5F5F5;
    cursor: not-allowed;
    opacity: 0.6;
}

.building-menu .level-item.locked:hover {
    transform: none;
    box-shadow: none;
}

.building-menu .level-number {
    font-size: 1.1em;
    font-weight: bold;
    color: #2F4F4F;
    margin-bottom: 3px;
}

.building-menu .level-status {
    font-size: 1.2em;
}

.building-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.building-actions .btn {
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.building-actions .btn-primary {
    background: #32CD32;
    color: white;
    border-color: #228B22;
}

.building-actions .btn-primary:hover {
    background: #228B22;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(50, 205, 50, 0.3);
}

.building-actions .btn-secondary {
    background: #696969;
    color: white;
    border-color: #2F4F4F;
}

.building-actions .btn-secondary:hover {
    background: #2F4F4F;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(105, 105, 105, 0.3);
}

/* 小镇地图屏幕样式 */
.town-map-screen {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #87CEEB 0%, #98FB98 100%);
    position: relative;
}

.town-map-screen.active {
    display: flex;
}

.town-map-screen:not(.active) {
    display: none;
}

/* 小镇地图导航按钮 */
.town-map-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 100;
}

.town-nav-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #333;
    border-radius: 25px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    backdrop-filter: blur(10px);
}

.town-nav-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 小镇地图动画 */
@keyframes townMapFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes townMapSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes townMapHeaderPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.02);
        filter: brightness(1.1);
    }
}

@keyframes pixelGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .building-menu-content {
        padding: 20px;
        margin: 20px;
    }
    
    .building-header {
        flex-direction: column;
        text-align: center;
    }
    
    .building-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .building-menu .levels-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 10px;
    }
    
    .building-menu .level-item {
        padding: 10px;
    }
    
    .building-actions {
        flex-direction: column;
    }
    
    .building-actions .btn {
        width: 100%;
    }
    
    .town-map-nav {
        position: fixed;
        bottom: 10px;
        flex-direction: column;
        gap: 10px;
    }
    
    .town-nav-btn {
        padding: 8px 16px;
        font-size: 0.9em;
    }
}

/* 导航按钮样式 */
.level-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.nav-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.nav-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.nav-btn.active {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
} 