* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    overflow: hidden;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #0a0f1e;
}

#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ===== 顶部 HUD ===== */
#hud {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    padding: 10px 20px;
    background: rgba(10, 15, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    z-index: 20;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 15px;
    color: #e0e6ff;
}

.stat .icon { font-size: 16px; }
.stat .label { opacity: 0.6; font-size: 13px; }
.stat .value { font-weight: bold; font-size: 17px; color: #ffd700; }

#stat-life .value { color: #ff6b6b; }
#stat-wave .value { color: #4dd0e1; }
#stat-enemies .value { color: #c792ea; }

/* ===== 波次横幅 ===== */
#wave-banner {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 42px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 20px #4dd0e1, 0 2px 4px rgba(0,0,0,0.6);
    opacity: 0;
    pointer-events: none;
    z-index: 30;
    transition: opacity 0.3s ease;
    letter-spacing: 4px;
}

#wave-banner.show { opacity: 1; }

/* ===== 右下角提示 ===== */
#info-tip {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    background: rgba(0, 0, 0, 0.35);
    padding: 6px 16px;
    border-radius: 20px;
    z-index: 20;
    pointer-events: none;
}

/* ===== 炮塔选择面板 ===== */
#tower-select {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 190px;
    background: rgba(10, 15, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 14px;
    z-index: 20;
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.panel-title {
    font-size: 15px;
    color: #9aa7d6;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 2px;
}

.tower-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.tower-card:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: #4dd0e1;
    transform: translateX(4px);
}

.tower-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.tower-card.selected {
    background: rgba(77, 208, 225, 0.18);
    border-color: #4dd0e1;
    box-shadow: 0 0 12px rgba(77, 208, 225, 0.4);
}

.tower-emoji { font-size: 28px; margin-bottom: 4px; }
.tower-name { color: #e0e6ff; font-weight: bold; font-size: 14px; }
.tower-desc { color: #8b94b8; font-size: 11px; margin: 3px 0; }
.tower-cost { color: #ffd700; font-size: 12px; }

/* ===== 炮塔操作面板 ===== */
#tower-actions {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 170px;
    background: rgba(10, 15, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 14px;
    z-index: 20;
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.hidden { display: none !important; }

.action-row { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.action-row button {
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    color: #fff;
    transition: all 0.15s ease;
}

#upgrade-btn {
    background: linear-gradient(135deg, #4dd0e1, #2196f3);
}
#upgrade-btn:hover { filter: brightness(1.15); transform: scale(1.03); }

#sell-btn {
    background: linear-gradient(135deg, #ff6b6b, #e53935);
}
#sell-btn:hover { filter: brightness(1.15); transform: scale(1.03); }

/* ===== 弹窗 ===== */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(4px);
}

.menu {
    background: rgba(15, 20, 40, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px 50px;
    text-align: center;
    color: #e0e6ff;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.menu h1 {
    font-size: 36px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #4dd0e1, #ffd700);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.menu p { color: #8b94b8; margin-bottom: 20px; }

.menu ul {
    text-align: left;
    list-style: none;
    margin: 0 auto 24px;
    color: #c0c9ea;
    font-size: 14px;
    line-height: 2;
}

.menu button {
    padding: 14px 44px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #2196f3, #4dd0e1);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(77, 208, 225, 0.4);
}

.menu button:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 25px rgba(77, 208, 225, 0.6);
}
