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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000005;
    font-family: 'Courier New', Courier, monospace;
    color: #d7f4ff;
}

#canvas-container {
    position: fixed;
    inset: 0;
    z-index: 1;
}

#canvas-container canvas {
    display: block;
}

/* HUD */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    padding: 16px 28px;
    pointer-events: none;
    text-shadow: 0 0 8px rgba(80, 220, 255, 0.8);
    letter-spacing: 1px;
    font-size: 16px;
}

#hud > div {
    background: rgba(10, 15, 35, 0.45);
    border: 1px solid rgba(100, 200, 255, 0.35);
    padding: 6px 14px;
    border-radius: 4px;
}

#lives {
    color: #ff6b8b;
}

/* Overlays */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(ellipse at center, rgba(10, 15, 45, 0.85) 0%, rgba(0, 0, 5, 0.95) 100%);
    gap: 18px;
}

.overlay.hidden {
    display: none;
}

.overlay h1 {
    font-size: 56px;
    color: #7be6ff;
    text-shadow: 0 0 20px rgba(120, 220, 255, 0.9), 0 0 60px rgba(80, 150, 255, 0.5);
    letter-spacing: 6px;
}

.subtitle {
    color: #9db5d6;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.controls-box {
    border: 1px solid rgba(120, 200, 255, 0.4);
    background: rgba(20, 30, 60, 0.5);
    padding: 16px 28px;
    border-radius: 6px;
    line-height: 1.8;
}

.controls-box strong {
    color: #ffe17b;
}

button {
    font-family: inherit;
    font-size: 20px;
    letter-spacing: 3px;
    padding: 14px 36px;
    background: linear-gradient(180deg, #2fd0ff, #0e7fb8);
    color: #001018;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(60, 200, 255, 0.6);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 0 35px rgba(60, 220, 255, 0.9);
}

button:active {
    transform: translateY(0) scale(0.99);
}

#finalScore {
    font-size: 24px;
    color: #d7f4ff;
}

#newHighScore {
    color: #ffe17b;
    font-size: 20px;
    text-shadow: 0 0 12px rgba(255, 225, 123, 0.8);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

#hitFlash {
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgba(255, 30, 60, 0.35);
    pointer-events: none;
    opacity: 0;
}

@media (max-width: 600px) {
    .overlay h1 { font-size: 34px; }
    #hud { font-size: 12px; padding: 10px 14px; }
}
