/* Glassmorphism Tactical HUD */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    display: none;
    flex-direction: column;
    gap: 12px;
    z-index: 15;
    pointer-events: none;
}

.hud-card {
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 12px 18px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    min-width: 220px;
}

.hud-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #94a3b8;
    margin-bottom: 4px;
    font-weight: 600;
}

.hud-val {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
}

.bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 6px;
}

.bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    transition: width 0.2s ease-out;
}

.bar-stamina {
    background: linear-gradient(90deg, #06b6d4, #0284c7);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
    transition: width 0.1s linear;
}

/* Weapon Selector */
#weaponSelector {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 10px;
    z-index: 15;
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    padding: 8px;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65);
}

.weapon-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px 16px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    pointer-events: auto;
}

.weapon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.weapon-btn.active {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(14, 116, 144, 0.35));
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 16px var(--accent-glow);
    transform: translateY(-2px);
}

.weapon-key {
    font-size: 10px;
    color: #64748b;
    background: rgba(0, 0, 0, 0.45);
    padding: 2px 6px;
    border-radius: 4px;
}

.weapon-btn.active .weapon-key {
    color: var(--accent);
    background: rgba(6, 182, 212, 0.2);
}

/* Crosshair & Hit Indicator */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    display: none;
}

.ch-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
}

.ch-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
}
.ch-top { width: 2px; height: 7px; top: 0; left: 11px; }
.ch-bottom { width: 2px; height: 7px; bottom: 0; left: 11px; }
.ch-left { width: 7px; height: 2px; left: 0; top: 11px; }
.ch-right { width: 7px; height: 2px; right: 0; top: 11px; }

#hitMarker {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 26px;
    height: 26px;
    transform: translate(-50%, -50%) rotate(45deg);
    pointer-events: none;
    z-index: 12;
    opacity: 0;
    transition: opacity 0.05s ease-out;
}

#hitMarker::before, #hitMarker::after {
    content: '';
    position: absolute;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}
#hitMarker::before { width: 100%; height: 2px; top: 12px; left: 0; }
#hitMarker::after { width: 2px; height: 100%; top: 0; left: 12px; }

#damageFlash {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, transparent 45%, rgba(239, 68, 68, 0.65) 100%);
    pointer-events: none;
    z-index: 8;
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

/* Minimap Tactical Radar */
#minimapContainer {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(5, 10, 22, 0.85);
    border: 2px solid rgba(6, 182, 212, 0.35);
    box-shadow: 0 0 24px rgba(6, 182, 212, 0.25), inset 0 0 18px rgba(0, 0, 0, 0.85);
    overflow: hidden;
    display: none;
    z-index: 15;
}

#minimapCanvas {
    width: 100%;
    height: 100%;
}

/* In-game Top Action Bar (Back to Games & Pause) */
#hudTopBar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 12px;
    z-index: 20;
    pointer-events: auto;
}

.hud-action-btn {
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    color: #e2e8f0;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    font-family: inherit;
    user-select: none;
}

.hud-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 0 16px var(--accent-glow);
}

.hud-action-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    #hud { top: 10px; left: 10px; gap: 8px; }
    .hud-card { min-width: 150px; padding: 8px 12px; }
    .hud-val { font-size: 17px; }
    #weaponSelector { bottom: 115px; padding: 4px; gap: 6px; }
    .weapon-btn { padding: 6px 10px; font-size: 11px; }
    #minimapContainer { width: 110px; height: 110px; top: 10px; right: 10px; }
    #hudTopBar { top: 10px; gap: 6px; }
    .hud-action-btn { padding: 6px 12px; font-size: 11px; gap: 5px; }
}
