* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    background-color: #0d0d1a;
    background-image: radial-gradient(circle at center, #1a1a3a 0%, #050510 100%);
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    touch-action: none; /* Crucial for preventing mobile scroll, bounce, and zoom */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
}

#ui {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through to the canvas */
}

#scoreDisplay, #highScoreDisplay {
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5), 0 0 10px rgba(0, 255, 255, 0.8);
    color: #e0ffff;
    letter-spacing: 2px;
}

#highScoreDisplay {
    text-shadow: 0 0 5px rgba(255, 0, 255, 0.5), 0 0 10px rgba(255, 0, 255, 0.8);
    color: #ffe0ff;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

#gameOverScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 16, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    pointer-events: none; /* Let clicks pass through to the document handler */
}

#gameOverScreen.hidden {
    display: none;
}

#gameOverScreen h1 {
    font-size: 4rem;
    color: #ff0055;
    text-shadow: 0 0 15px #ff0055, 0 0 30px #ff0055;
    margin-bottom: 20px;
    letter-spacing: 4px;
}

#gameOverScreen p {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #fff;
    letter-spacing: 1px;
}

.blink {
    animation: blinker 1.5s linear infinite;
    color: #aaa !important;
}

@keyframes blinker {
    50% { opacity: 0; }
}

/* Responsive adjustments for mobile */
@media (max-width: 600px) {
    #scoreDisplay, #highScoreDisplay {
        font-size: 1.2rem;
    }
    #gameOverScreen h1 {
        font-size: 3rem;
    }
    #gameOverScreen p {
        font-size: 1.2rem;
    }
}
