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

body {
    overflow: hidden;
    background: #000;
    font-family: 'Courier New', monospace;
}

canvas { display: block; }

/* ── Overlay ─────────────────────────────────────────────────────────────── */
#overlay {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
    z-index: 10;
}

.title {
    font-size: clamp(2rem, 8vw, 5rem);
    font-weight: bold;
    color: #c8c050;
    letter-spacing: 0.35em;
    text-shadow:
        0 0 30px rgba(200, 192, 80, 0.9),
        0 0 80px rgba(200, 192, 80, 0.35);
    margin-bottom: 1rem;
    animation: flicker 9s infinite;
}

.subtitle {
    font-size: 1rem;
    color: #908830;
    letter-spacing: 0.25em;
    margin-bottom: 3rem;
}

.controls {
    font-size: 0.8rem;
    color: #605820;
    letter-spacing: 0.1em;
}

@keyframes flicker {
    0%,100% { opacity: 1; }
    91%     { opacity: 1; }
    92%     { opacity: 0.5; }
    93%     { opacity: 1; }
    95%     { opacity: 0.7; }
    96%     { opacity: 1; }
}

/* ── Death screen ────────────────────────────────────────────────────────── */
#death {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    z-index: 20;
    cursor: pointer;
}

.death-title {
    font-size: clamp(1.5rem, 5vw, 3rem);
    color: #cc1010;
    letter-spacing: 0.3em;
    text-shadow: 0 0 40px rgba(200, 10, 10, 0.8);
    margin-bottom: 1.2rem;
    animation: flicker 3s infinite;
}

.death-msg {
    font-size: 1rem;
    color: #804040;
    letter-spacing: 0.15em;
    margin-bottom: 3rem;
}

.death-restart {
    font-size: 0.8rem;
    color: #503030;
    letter-spacing: 0.12em;
}

/* ── HUD ─────────────────────────────────────────────────────────────────── */
#hud {
    position: fixed;
    top: 1rem;
    right: 1.2rem;
    color: rgba(200, 190, 80, 0.5);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    pointer-events: none;
    z-index: 5;
}

/* ── Danger vignette (entity proximity) ─────────────────────────────────── */
#danger {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 6;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(80,0,0,0) 100%);
    opacity: 0;
    transition: opacity 0.4s;
}

/* ── Crosshair ───────────────────────────────────────────────────────────── */
#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.4rem;
    line-height: 1;
    pointer-events: none;
    z-index: 5;
    display: none;
}
