html, body {
    overflow: hidden;
    height: 100%;
    background: #080810;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    user-select: none;
}

#canvas {
    background: radial-gradient(circle at center, #1a1a3a 0%, #050510 100%), url('bg.jpg') no-repeat;
    background-blend-mode: screen;
    width: 100%;
    height: 100%;
    background-size: cover;
    display: none; 
    transition: transform 0.1s ease-out; /* For screen shake effect */
}

#canvas.playing {
    cursor: url('aim_red.png') 17.5 17.5, auto !important;
}

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #101026 0%, #05050d 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: #ffffff;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #00f0ff;
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    margin-bottom: 25px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

#preloader p {
    font-size: 14px;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 600;
    color: #00f0ff;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

/* Modern UI Overlay HUD */
.ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.interactive {
    pointer-events: auto;
}

/* In-game HUD */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    display: none;
    background: rgba(10, 10, 25, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 240, 255, 0.2);
    padding: 12px 24px;
    border-radius: 12px;
    color: #00f0ff;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

#hud span {
    color: #fff;
    font-family: monospace;
    font-size: 18px;
    margin-left: 5px;
}

 #hud .hud-section {
            display: flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
        }

        #hud .hud-separator {
            color: rgba(0, 240, 255, 0.3);
            font-weight: 300;
            font-size: 16px;
        }

        #hud span {
            color: #fff;
            font-family: monospace;
            font-size: 18px;
            margin-left: 2px;
        }

        #hud-lives {
            color: #ff4466 !important;
            letter-spacing: 3px;
            font-size: 16px !important;
            transition: all 0.3s ease;
        }

        #hud-lives.lost-life {
            animation: pulseLife 0.4s ease-out;
        }


        
/* Menu Overlays (Start/Game Over) */
.menu-card {
    background: rgba(10, 11, 28, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(0, 240, 255, 0.4);
    padding: 40px 60px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 1px 2px rgba(255,255,255,0.1);
    color: white;
    max-width: 400px;
    width: 100%;
    animation: fadeIn 0.4s ease-out;
}

.menu-card h1 {
    margin: 0 0 10px 0;
    font-size: 36px;
    letter-spacing: 2px;
    font-weight: 800;
    background: linear-gradient(45deg, #00f0ff, #ff007f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.menu-card p {
    color: #8fa0dd;
    font-size: 14px;
    margin-bottom: 30px;
}

.btn-action {
    background: linear-gradient(135deg, #00f0ff 0%, #0072ff 100%);
    border: none;
    color: white;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 30px;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.7);
}

.btn-action:active {
    transform: translateY(1px);
}

.btn-restart {
    background: linear-gradient(135deg, #ff0055 0%, #990033 100%);
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.4);
}

.btn-restart:hover {
    box-shadow: 0 0 30px rgba(255, 0, 85, 0.7);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.stat-box {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 12px;
}

.stat-box .label {
    font-size: 11px;
    color: #6c7da5;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-box .val {
    font-size: 24px;
    font-weight: 700;
    font-family: monospace;
}

.stat-box .val.highlight {
    color: #00f0ff;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
