/* CSS 样式设计 */
:root {
    --primary: #0ff;
    --danger: #f05;
    --friendly: #0f5;
    --elite: #b0f;
    --bg: #050510;
}

body {
    margin: 0;
    overflow: hidden;
    background-color: var(--bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --webkit-user-select: none;
    user-select: none;
    cursor: none; /* 隐藏默认鼠标 */
}

/* 游戏场景容器 - 模拟3D透视 */
#game-world {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    perspective: 800px; /* 关键：3D透视深度 */
    overflow: hidden;
    background: radial-gradient(circle at center, #1a1a2e 0%, #000 100%);
}

/* 准星 */
#crosshair {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 100;
    transition: width 0.1s, height 0.1s;
}
#crosshair::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--primary);
    transform: translate(-50%, -50%);
}
#crosshair.reloading {
    border-color: #555;
    animation: spin 1s infinite linear;
}

/* 敌人与物体 */
.entity {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px currentColor;
    cursor: pointer;
}

.enemy {
    width: 60px;
    height: 60px;
    background: rgba(255, 0, 85, 0.2);
    border: 2px solid var(--danger);
    color: var(--danger);
}

.friendly {
    width: 50px;
    height: 50px;
    background: rgba(0, 255, 85, 0.2);
    border: 2px solid var(--friendly);
    color: var(--friendly);
    border-radius: 50%;
}

.elite {
    width: 50px;
    height: 50px;
    background: rgba(187, 0, 255, 0.2);
    border: 2px solid var(--elite);
    color: var(--elite);
    transform: rotate(45deg);
}

/* HUD 界面 */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    color: var(--primary);
    font-size: 20px;
    z-index: 90;
    text-shadow: 0 0 5px var(--primary);
}

#ammo-display {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 32px;
    color: var(--primary);
    z-index: 90;
}
.low-ammo { color: var(--danger) !important; animation: blink 0.5s infinite; }

#damage-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    box-shadow: inset 0 0 0 0 var(--danger);
    pointer-events: none;
    transition: box-shadow 0.1s;
    z-index: 80;
}

/* 菜单屏幕 */
.screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 200;
}
.hidden { display: none; }

h1 { font-size: 60px; color: var(--primary); text-transform: uppercase; margin: 0; text-shadow: 0 0 20px var(--primary); }
p { font-size: 18px; color: #ccc; max-width: 600px; text-align: center; line-height: 1.6; }
button {
    margin-top: 30px;
    padding: 15px 40px;
    font-size: 24px;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}
button:hover { background: var(--primary); color: black; box-shadow: 0 0 20px var(--primary); }

/* 动画 */
@keyframes spin { 100% { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes blink { 50% { opacity: 0.5; } }

/* 枪火特效 */
.muzzle-flash {
    position: absolute;
    width: 100px; height: 100px;
    background: radial-gradient(circle, #fff, transparent);
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: 99;
}
