/* --- 1. ГЛОБАЛЬНЫЕ НАСТРОЙКИ И CRT-ЭФФЕКТ --- */
body { 
    margin: 0; 
    background: #000; 
    color: #0f0; 
    font-family: 'Courier New', monospace; 
    overflow: hidden; 
    user-select: none;
}

/* Эффект сканирующих линий */
body::after {
    content: " ";
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 10000;
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
}

canvas { 
    display: block; 
    image-rendering: pixelated; 
    filter: contrast(1.1) brightness(1.1);
}

/* --- 2. ВЕРХНИЙ HUD (ОБЪЕДИНЕННАЯ ПАНЕЛЬ) --- */

/* Контейнер для статов в левом верхнем углу */
#ui {
    position: absolute;
    top: 15px;      /* Перенесли вниз от верхнего края */
    left: 20px;     /* Отступ слева */
    z-index: 1100;
    display: flex;
    flex-direction: column; /* Статы друг под другом */
    gap: 4px;
    pointer-events: none;
}

.stat {
    background: rgba(0, 15, 0, 0.7);
    color: #fff;
    padding: 6px 15px;
    border-left: 4px solid #0f0;
    font-size: 13px;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    min-width: 160px;
    backdrop-filter: blur(5px);
    box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%); /* Технологичный срез */
}

/* Цвета индикаторов */
#hp { border-left-color: #ff0044; }
#hp span { color: #ff4444; font-weight: bold; }

#clip { border-left-color: #ffaa00; }
#clip span { color: #ffaa00; font-weight: bold; }

#xp { border-left-color: #4444ff; font-size: 11px; }
#xp span { color: #8888ff; }

/* Панель выбора оружия (в центре сверху) */
#weapon-selection-hud {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 1100;
    pointer-events: none;
}

.weapon-cell {
    width: 85px;
    height: 35px;
    background: rgba(0, 20, 0, 0.8);
    border: 1px solid #1a331a;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0% 30%);
}

.weapon-cell .w-name {
    font: bold 9px 'Courier New';
    color: #2a552a;
}

.weapon-cell.active {
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid #0f0;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}

.weapon-cell.active .w-name { color: #fff; text-shadow: 0 0 5px #0f0; }

/* --- 3. ГЕО-СКАНЕР (РАДАР СПРАВА) --- */
#radar-ui {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 120px;
    height: 120px;
    border: 2px solid rgba(0, 255, 0, 0.3);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 30, 0, 0.6) 0%, rgba(0, 0, 0, 0.9) 100%);
    z-index: 1000;
    overflow: hidden;
}

#minimap { width: 100%; height: 100%; opacity: 0.8; }

.radar-scanner {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: conic-gradient(from 0deg, rgba(0,255,0,0.15) 0%, transparent 40%);
    animation: rotate-scanner 4s linear infinite;
}

/* --- 4. ЭФФЕКТЫ И УВЕДОМЛЕНИЯ --- */

/* Всплывающий текст при подборе */
.pickup-notice {
    position: fixed;
    left: 50%;
    top: 45%; /* Чуть выше центра, чтобы не мешать прицелу */
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 10px #0f0;
    pointer-events: none;
    z-index: 2000;
    animation: floatUp 0.6s ease-out forwards;
}

@keyframes floatUp {
    0% { opacity: 0; transform: translate(-50%, 20px); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -40px); }
}

/* Вспышка урона */
#damage-flash {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, transparent 30%, rgba(255, 0, 0, 0.3) 100%);
    pointer-events: none; 
    opacity: 0; 
    z-index: 1500;
    transition: opacity 0.1s;
}

/* --- 5. МЕНЮ --- */
.overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 5, 0, 0.95);
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    z-index: 5000;
}

button {
    background: transparent; 
    border: 1px solid #0f0;
    color: #0f0; 
    padding: 12px 40px;
    cursor: pointer; 
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    margin: 10px;
    transition: 0.3s;
}

button:hover { 
    background: #0f0; 
    color: #000;
    box-shadow: 0 0 20px #0f0;
}

@keyframes rotate-scanner {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.pickup-notice, #weapon-selection-hud, #ui, #radar-ui {
    pointer-events: none !important;
    user-select: none !important;
}

/* Полная изоляция интерфейса от мыши */
#ui, #weapon-selection-hud, #radar-ui, .pickup-notice, #damage-flash, #fps {
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none;
    z-index: 1000; /* Ниже, чем меню паузы */
}

/* Только само меню и кнопки могут принимать клики */
.overlay, .overlay button {
    pointer-events: auto !important;
    z-index: 9999 !important;
}

#death-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(50, 0, 0, 0.9) !important; /* Усилил фон */
    display: none; /* Скрыто по умолчанию */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10001; 
}