/* ============================================================
   DM SPACE INVADERS
   ============================================================ */

/* --- Footer Trigger --- */
.dm-game-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.dm-game-trigger:hover {
    color: var(--dm-teal);
    border-color: rgba(var(--dm-teal-rgb), 0.4);
    transform: translateY(-2px);
}

/* --- Game Overlay --- */
#dm-game-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #060d13;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#dm-game-overlay.is-visible {
    opacity: 1;
    pointer-events: all;
}

#dm-game-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

/* --- HUD --- */
#dm-game-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(1.5rem, 4vw, 3rem);
    background: rgba(6, 13, 19, 0.9);
    border-bottom: 1px solid rgba(0, 168, 120, 0.2);
    z-index: 10;
    pointer-events: none;
}

.dm-game-hud-item {
    text-align: center;
    min-width: 60px;
}

.dm-game-hud-lbl {
    display: block;
    font-family: 'Orbitron', monospace;
    font-size: 0.5rem;
    letter-spacing: 0.12em;
    color: #8a9fa3;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.dm-game-hud-val {
    display: block;
    font-family: 'Orbitron', monospace;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 700;
    color: #00a878;
    letter-spacing: 0.04em;
    line-height: 1;
}

.dm-game-hud-item--hi .dm-game-hud-val {
    color: #BF7345;
}

/* --- Mobile Controls --- */
#dm-game-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 24px 28px;
    display: none;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    background: linear-gradient(to top, rgba(6, 13, 19, 0.95) 60%, transparent);
    pointer-events: none;
}

@media (pointer: coarse) {
    #dm-game-controls {
        display: flex;
    }
}

@media (max-width: 768px) {
    #dm-game-controls {
        display: flex;
    }
}

.dm-game-btn {
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 2px solid rgba(0, 168, 120, 0.35);
    background: rgba(0, 168, 120, 0.08);
    color: #00a878;
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: none;
    transition: background 0.1s, border-color 0.1s, transform 0.1s;
}

.dm-game-btn:active,
.dm-game-btn.is-pressed {
    background: rgba(0, 168, 120, 0.25);
    border-color: #00a878;
    transform: scale(0.93);
}

.dm-game-btn--fire {
    width: 88px;
    height: 88px;
    background: rgba(0, 168, 120, 0.15);
    border-color: rgba(0, 168, 120, 0.5);
    border-width: 2px;
}

/* --- Close Button --- */
#dm-game-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #8a9fa3;
    cursor: pointer;
    z-index: 20;
    transition: background 0.15s, color 0.15s;
}

#dm-game-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* --- Name Input (high score entry) --- */
#dm-game-name-input {
    position: absolute;
    left: 50%;
    top: 55%;
    transform: translate(-50%, -50%);
    z-index: 20;
    width: 140px;
    padding: 12px 16px;
    font-family: 'Orbitron', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-align: center;
    text-transform: uppercase;
    color: #00a878;
    background: rgba(6, 13, 19, 0.95);
    border: 2px solid #00a878;
    border-radius: 8px;
    outline: none;
    caret-color: #00a878;
    box-shadow: 0 0 30px rgba(0, 168, 120, 0.3);
}

#dm-game-name-input::placeholder {
    color: rgba(0, 168, 120, 0.3);
}

/* --- Body lock --- */
body.dm-game-open {
    overflow: hidden;
}
