body {
    font-family: 'Inter', sans-serif;
    background-color: #1a202c; /* Dark blue-gray background */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    color: #e2e8f0; /* Light text color */
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #2d3748; /* Slightly lighter dark background for container */
    border-radius: 1rem;
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.6); /* Cyan glow */
    padding: 1.5rem;
    max-width: 90vw;
    width: 100%;
    box-sizing: border-box;
}

canvas {
    background: radial-gradient(circle at center, #1c2526 0%, #010409 70%); /* Deep space gradient */
    position: relative;
    border: 2px solid #00ffff; /* Cyan border */
    border-radius: 0.75rem;
    display: block;
    touch-action: none; /* Prevent default touch actions */
    width: 100%; /* Make canvas width fluid */
    max-width: 800px; /* Max width for larger screens */
    height: auto; /* Maintain aspect ratio */
    aspect-ratio: 4 / 3; /* Define aspect ratio for canvas */
}

/* Starry background using pseudo-elements */
canvas::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
    background-image:
        radial-gradient(white 1px, transparent 1px),
        radial-gradient(white 1px, transparent 1px),
        radial-gradient(white 1px, transparent 1px);
    background-size: 60px 60px;
    background-position: 0 0, 20px 20px, 40px 40px;
    opacity: 0.3; /* Subtle star effect */
}

.game-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 800px;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: bold;
    color: #00ffff;
}

.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 2rem;
    text-align: center;
    z-index: 100;
    border-radius: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.game-over-screen.active {
    opacity: 1;
    visibility: visible;
}

.game-over-screen h2 {
    font-size: 3rem;
    color: #ff4d4d;
    margin-bottom: 1rem;
}

.game-over-screen p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.restart-button {
    background-color: #00ffff;
    color: #0d1117;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 255, 255, 0.4);
}

.restart-button:hover {
    background-color: #00e6e6;
    transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .game-container {
        padding: 1rem;
    }
    .game-info {
        font-size: 1rem;
    }
    .game-over-screen h2 {
        font-size: 2.5rem;
    }
    .game-over-screen p {
        font-size: 1.2rem;
    }
    .restart-button {
        font-size: 1rem;
        padding: 0.6rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 0.75rem;
    }
    .game-info {
        font-size: 0.9rem;
    }
    .game-over-screen h2 {
        font-size: 2rem;
    }
    .game-over-screen p {
        font-size: 1rem;
    }
    .restart-button {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}