/* ── Global resets ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Prevent scrollbars so left-click is the only interaction */
    background: #1a1a2e;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    cursor: pointer; /* pointer cursor across the entire canvas */
    user-select: none; /* no text selection during gameplay */
}

/* ── Score overlay (top-center) ── */
#score-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none; /* let clicks pass through to canvas */
}

#score {
    font-size: 52px;
    font-weight: 800;
    color: #fff;
    text-shadow:
        0 0 8px rgba(0, 0, 0, 0.7),
        0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

/* High score shown in the HUD below the current score */
#high-score-display {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #ffd700;
    text-shadow:
        0 0 6px rgba(0, 0, 0, 0.7),
        0 1px 2px rgba(0, 0, 0, 0.5);
    margin-top: 2px;
}

/* ── Game Over overlay ── */
#game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: rgba(0, 0, 0, 0.65);
    pointer-events: none; /* clicks pass through to body (left-click handler) */
}

/* Hidden state toggled via JS */
#game-over.hidden {
    display: none;
}

#game-over h1 {
    font-size: 64px;
    font-weight: 900;
    color: #ff4757;
    text-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
    margin-bottom: 16px;
}

#game-over p {
    font-size: 28px;
    color: #eee;
    margin-bottom: 10px;
}

#final-score {
    font-weight: 800;
    color: #ffd700;
}

#high-score {
    font-weight: 800;
    color: #ffd700;
}

.restart-prompt {
    font-size: 22px !important;
    color: #aaa !important;
    margin-top: 24px;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Subtle pulsing animation on the restart prompt */
@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
