:root {
    --bg-color: #1a1a2e;
    --panel-color: #16213e;
    --accent-color: #0f3460;
    --text-color: #e94560;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
    user-select: none;
}

/* UI 布局 */
#ui-layer {
    width: 900px;
    display: flex;
    justify-content: space-between;
    padding: 15px 25px;
    background-color: var(--panel-color);
    border-radius: 12px 12px 0 0;
    box-sizing: border-box;
    border: 2px solid var(--accent-color);
    border-bottom: none;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.3);
}

.stat-group {
    display: flex;
    gap: 20px;
}

.stat-box {
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.icon { margin-right: 8px; font-size: 20px; }
.money { color: #FFD700; }
.health { color: #FF4136; }
.wave { color: #4DB6AC; }

/* 游戏主容器 */
#game-wrapper {
    position: relative;
    display: flex;
    box-shadow: 0 0 30px rgba(0,0,0,0.6);
}

canvas {
    background-color: #2c2c3e;
    border: 2px solid var(--accent-color);
    cursor: crosshair;
    display: block;
}

/* 建造菜单 */
#build-menu {
    width: 140px;
    background-color: var(--panel-color);
    border: 2px solid var(--accent-color);
    border-left: none;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tower-btn {
    background: #252a41;
    border: 2px solid #444;
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tower-btn:hover { background: #363d5c; }
.tower-btn.selected { border-color: #FFD700; background: #363d5c; box-shadow: 0 0 10px rgba(255, 215, 0, 0.3); }
.tower-btn span { font-size: 12px; margin-top: 5px; color: #aaa; }
.tower-btn .cost { color: #FFD700; font-weight: bold; }

/* 游戏结束屏幕 */
#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    backdrop-filter: blur(5px);
}

h1 { margin-bottom: 10px; color: #e94560; font-size: 48px; text-shadow: 0 0 10px #e94560; }

button.restart-btn {
    padding: 12px 30px;
    font-size: 20px;
    background: linear-gradient(45deg, #e94560, #c0392b);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
    transition: transform 0.2s;
}

button.restart-btn:hover { transform: scale(1.1); }

.tooltip {
    width: 900px;
    background: #222;
    color: #888;
    text-align: center;
    padding: 5px;
    font-size: 13px;
}