.hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 20;
    display: none;
}

.hud.active {
    display: block;
}

.hud-top-left {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hud-top-center {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.hud-top-right {
    position: absolute;
    top: 12px;
    right: 12px;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hud-bottom {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: 200px;
}

.hud-bar-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 160px;
}

.hud-bar-label {
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text-dim);
    font-weight: 600;
}

.hud-bar {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.08);
}

.hud-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.2s ease;
    position: relative;
}

.shield-fill {
    background: linear-gradient(90deg, #0066cc, var(--shield-color));
    box-shadow: 0 0 6px rgba(0, 170, 255, 0.4);
}

.health-fill {
    background: linear-gradient(90deg, #cc2244, var(--health-color));
    box-shadow: 0 0 6px rgba(255, 68, 102, 0.4);
}

.energy-fill {
    background: linear-gradient(90deg, #cc8800, var(--energy-color));
    box-shadow: 0 0 6px rgba(255, 204, 0, 0.4);
}

.hud-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.hud-score, .hud-crystals, .hud-level, .hud-weapon {
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--text-dim);
    line-height: 1.2;
    font-weight: 600;
}

.hud-score span, .hud-crystals span, .hud-level span, .hud-weapon span {
    font-size: 18px;
    color: #fff;
    font-weight: 700;
    letter-spacing: 1px;
}

.hud-crystals span {
    color: var(--crystal-color);
}

.hud-level span {
    color: var(--warning);
}

.hud-weapon span {
    color: var(--primary);
}

.hud-wave {
    font-size: 12px;
    letter-spacing: 3px;
    color: var(--primary);
    margin-top: 4px;
    font-weight: 600;
}

.hud-combo {
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--warning);
    margin-top: 4px;
    font-weight: 700;
    animation: comboPulse 0.3s ease;
}

@keyframes comboPulse {
    0% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.hud-energy-label {
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-top: 3px;
    font-weight: 600;
}

.minimap {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 150px;
    height: 150px;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    background: rgba(5, 8, 20, 0.7);
    pointer-events: auto;
}

.energy-bar {
    width: 200px;
    height: 8px;
}

.hud-objective {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(10, 14, 30, 0.75);
    border: 1px solid rgba(255, 221, 0, 0.3);
    border-radius: 6px;
    font-size: 11px;
    letter-spacing: 2px;
    color: #ffdd00;
    font-weight: 600;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-obj-icon {
    font-size: 14px;
    color: #ffdd00;
    text-shadow: 0 0 8px rgba(255, 221, 0, 0.5);
}

.hud-alert {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(255, 30, 30, 0.2);
    border: 1px solid rgba(255, 50, 50, 0.5);
    border-radius: 6px;
    font-size: 12px;
    letter-spacing: 3px;
    color: #ff4444;
    font-weight: 700;
    animation: alertPulse 0.6s ease infinite alternate;
}

.hud-alert-icon {
    font-size: 16px;
    font-weight: 900;
    color: #ff3333;
}

@keyframes alertPulse {
    0% { background: rgba(255, 30, 30, 0.15); border-color: rgba(255, 50, 50, 0.4); }
    100% { background: rgba(255, 30, 30, 0.35); border-color: rgba(255, 50, 50, 0.8); }
}

.hud-ability-bar {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    pointer-events: auto;
}

.ability-slot {
    width: 52px;
    height: 62px;
    background: rgba(10, 14, 30, 0.8);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
    cursor: pointer;
    padding: 3px;
}

.ability-slot:hover {
    border-color: rgba(255,255,255,0.3);
}

.ability-slot.on-cooldown {
    border-color: rgba(255,255,255,0.05);
    opacity: 0.6;
}

.ability-slot.no-energy {
    opacity: 0.35;
}

.ability-icon {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    z-index: 2;
    line-height: 1;
}

.ability-key {
    font-size: 8px;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-top: 1px;
    z-index: 2;
}

.ability-cooldown {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.6);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: height 0.1s;
    z-index: 1;
}

.ability-name {
    font-size: 6px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
    z-index: 2;
}

.ability-energy {
    font-size: 7px;
    color: var(--energy-color);
    letter-spacing: 0.5px;
    z-index: 2;
}
