* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    overflow: hidden;
    font-family: 'Courier New', monospace;
    background: #000;
    color: #fff;
}

#game-canvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hidden {
    display: none !important;
}

/* ===== 通用覆盖层 ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#menu {
    background: radial-gradient(ellipse at center, rgba(20,10,5,0.95), rgba(0,0,0,0.98));
    backdrop-filter: blur(8px);
}

#game-over {
    background: radial-gradient(ellipse at center, rgba(30,5,5,0.92), rgba(0,0,0,0.97));
    backdrop-filter: blur(8px);
}

#loading {
    background: #000;
    z-index: 200;
}

/* ===== 菜单内容 ===== */
.menu-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
}

.game-title {
    font-size: 72px;
    font-weight: 900;
    letter-spacing: 8px;
    color: #ff3300;
    text-shadow: 0 0 30px rgba(255,51,0,0.5), 0 0 60px rgba(255,51,0,0.3);
    margin-bottom: 8px;
    animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 0 0 30px rgba(255,51,0,0.5), 0 0 60px rgba(255,51,0,0.3); }
    50% { text-shadow: 0 0 50px rgba(255,51,0,0.7), 0 0 80px rgba(255,51,0,0.5); }
}

.game-subtitle {
    font-size: 24px;
    letter-spacing: 12px;
    color: #aaa;
    margin-bottom: 32px;
}

.menu-info {
    text-align: center;
    margin-bottom: 28px;
    line-height: 2;
    color: #ccc;
    font-size: 15px;
}

.menu-info .warning {
    color: #ff6644;
    font-weight: bold;
}

.controls-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    margin-bottom: 36px;
    padding: 20px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #aaa;
}

.key {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    font-weight: bold;
    color: #fff;
    min-width: 30px;
    text-align: center;
}

.btn-start {
    padding: 16px 60px;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 4px;
    color: #fff;
    background: linear-gradient(180deg, #cc3300, #882200);
    border: 2px solid #ff4400;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    text-transform: uppercase;
}

.btn-start:hover {
    background: linear-gradient(180deg, #ff4400, #cc3300);
    box-shadow: 0 0 30px rgba(255,68,0,0.5);
    transform: scale(1.05);
}

.btn-start:active {
    transform: scale(0.98);
}

/* ===== 加载 ===== */
.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: #ff3300;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    letter-spacing: 4px;
    color: #888;
}

/* ===== 结算统计 ===== */
.end-stats {
    margin: 24px 0;
    color: #aaa;
    font-size: 15px;
    line-height: 2;
}

.end-stats span {
    color: #ff8844;
    font-weight: bold;
}

/* ===== HUD ===== */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.hud-panel {
    position: absolute;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    padding: 8px 14px;
    backdrop-filter: blur(4px);
}

/* 准星 */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
}

.crosshair-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 3px;
    background: #00ff66;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0,255,102,0.8);
}

.crosshair-line {
    position: absolute;
    background: #00ff66;
    box-shadow: 0 0 4px rgba(0,255,102,0.6);
}

.crosshair-line.top, .crosshair-line.bottom {
    width: 2px;
    height: 7px;
    left: 50%;
    transform: translateX(-50%);
}

.crosshair-line.top { top: 0; }
.crosshair-line.bottom { bottom: 0; }

.crosshair-line.left, .crosshair-line.right {
    width: 7px;
    height: 2px;
    top: 50%;
    transform: translateY(-50%);
}

.crosshair-line.left { left: 0; }
.crosshair-line.right { right: 0; }

/* 血量面板 */
.bottom-left {
    bottom: 24px;
    left: 24px;
    min-width: 200px;
}

.hud-label {
    font-size: 11px;
    color: #888;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.bar-container {
    position: relative;
    width: 100%;
    height: 18px;
    background: rgba(255,255,255,0.05);
    border-radius: 2px;
    overflow: hidden;
}

.bar {
    height: 100%;
    transition: width 0.3s;
    border-radius: 2px;
}

.health-bar {
    background: linear-gradient(90deg, #ff0000, #ff6600, #00ff66);
    width: 100%;
}

.bar-text {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* 弹药面板 */
.bottom-right {
    bottom: 24px;
    right: 24px;
    text-align: right;
    min-width: 140px;
}

.ammo-display {
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
}

.ammo-current { color: #fff; }
.ammo-separator { color: #666; margin: 0 4px; font-size: 24px; }
.ammo-reserve { color: #aaa; font-size: 24px; }

.reload-hint {
    margin-top: 4px;
    font-size: 12px;
    color: #ffaa00;
    animation: blink 0.6s ease-in-out infinite;
}

@keyframes blink {
    50% { opacity: 0.3; }
}

/* 目标面板 */
.top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
}

.objective-icon {
    font-size: 28px;
    color: #00aaff;
    animation: bob 1.5s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

.objective-title {
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}

.objective-detail {
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
}

/* 敌人计数 */
.top-right {
    top: 20px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.enemy-label {
    font-size: 11px;
    color: #888;
    letter-spacing: 2px;
}

.enemy-count {
    font-size: 20px;
    font-weight: bold;
    color: #ff4444;
}

/* 击杀提示 */
.kill-feed {
    position: absolute;
    top: 80px;
    right: 24px;
    text-align: right;
}

.kill-feed-item {
    background: rgba(255,68,0,0.15);
    border-left: 3px solid #ff4400;
    padding: 4px 12px;
    margin-bottom: 4px;
    font-size: 13px;
    color: #ffaa66;
    animation: killFade 3s ease forwards;
}

@keyframes killFade {
    0% { opacity: 0; transform: translateX(20px); }
    10%, 80% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(20px); }
}

/* 拾取提示 */
.pickup-notification {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(0,255,102,0.4);
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 15px;
    color: #00ff88;
    animation: pickupShow 1.5s ease forwards;
}

@keyframes pickupShow {
    0% { opacity: 0; transform: translate(-50%, -30%); }
    20%, 70% { opacity: 1; transform: translate(-50%, -50%); }
    100% { opacity: 0; transform: translate(-50%, -70%); }
}

/* 受伤红屏 */
.damage-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(255,0,0,0.6) 100%);
    opacity: 0;
    transition: opacity 0.1s;
    pointer-events: none;
}

.damage-overlay.flash {
    opacity: 1;
}

/* 罗盘指引 */
.compass {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.compass-arrow {
    font-size: 32px;
    color: #00aaff;
    text-shadow: 0 0 10px rgba(0,170,255,0.6);
    transition: transform 0.1s;
}

.compass-label {
    font-size: 10px;
    color: #00aaff;
    letter-spacing: 2px;
    margin-top: 2px;
}
