/* Laser Game Overlay & UI */
#laser-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    /* Behind content */
    background: #000;
    transition: background 0.5s;
    overflow: hidden;
    display: none;
}

body.laser-mode #laser-overlay {
    display: block;
}

/* Make body transparent in laser mode to see enemies behind */
body.laser-mode {
    background: rgba(0, 0, 0, 0.7) !important;
    /* Semi-transparent */
    cursor: none;
}

/* Canvas for drawing lasers and particles */
#laser-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Scope / Cursor */
#laser-scope {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    display: none;
}

body.laser-mode #laser-scope {
    display: block;
    left: var(--mouse-x, 50%);
    top: var(--mouse-y, 50%);
}

.scope-circle {
    width: 100%;
    height: 100%;
    border: 2px solid #ff0055;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 10px #ff0055, inset 0 0 10px #ff0055;
}

.scope-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: #ff0055;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    box-shadow: 0 0 5px #fff;
}

/* HUD */
#laser-hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
    display: none;
    font-family: "Press Start 2P", monospace;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
}

body.laser-mode #laser-hud {
    display: block;
}

.hud-top {
    position: absolute;
    top: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    font-size: 20px;
}

.hud-score {
    color: #ffeb3b;
}

.hud-timer {
    color: #ff0055;
}

.hud-bottom {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    align-items: flex-end;
}

.hud-health {
    display: flex;
    gap: 5px;
}

.heart {
    width: 24px;
    height: 24px;
    background: red;
    display: inline-block;
    clip-path: polygon(15% 0, 35% 0, 50% 20%, 65% 0, 85% 0, 100% 20%, 100% 50%, 50% 100%, 0 50%, 0 20%);
    box-shadow: 0 0 5px red;
}

.hud-ammo {
    text-align: right;
}

.ammo-count {
    font-size: 24px;
    color: #00e5ff;
}

.reload-msg {
    font-size: 12px;
    color: #ff0055;
    animation: blink 0.5s infinite;
    display: none;
}

.reload-msg.visible {
    display: block;
}

/* Animations */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

.flash-red {
    animation: flashRed 0.2s ease-out;
}

@keyframes flashRed {
    0% {
        box-shadow: inset 0 0 0 50px rgba(255, 0, 0, 0.5);
    }

    100% {
        box-shadow: inset 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

/* Floating Score */
.floating-score {
    position: fixed;
    color: #ffeb3b;
    font-family: "Press Start 2P", monospace;
    font-size: 16px;
    pointer-events: none;
    z-index: 10001;
    animation: floatUp 1s ease-out forwards;
    text-shadow: 2px 2px 0 #000;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-50px) scale(1.5);
        opacity: 0;
    }
}

/* Game Over Screen */
#game-over-screen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #111;
    border: 4px solid #ff0055;
    padding: 40px;
    text-align: center;
    z-index: 10002;
    display: none;
    box-shadow: 0 0 20px #ff0055;
}

#game-over-screen.visible {
    display: block;
}

#game-over-screen h1 {
    color: #ff0055;
    font-size: 40px;
    margin-bottom: 20px;
}

#game-over-screen p {
    font-size: 18px;
    margin-bottom: 30px;
}