:root {
    --bg-color: #1a1a2e;
    --container-bg: #6466e9;
    --accent-color: #0f3460;
    --highlight: #0c0e86;
    --text-color: #6466e9;
    --hud-bg: #000000;
    --neon-blue: #c5284d;
    --neon-pink: #ffffffc4;
    --base-font-size: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: var(--text-color);
    overflow: hidden;
    font-size: 16px;
}

#game-container {
    background-color: var(--container-bg);
    border: 4px solid var(--accent-color);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), 0 0 40px rgba(34, 19, 127, 0.2);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}

#hud {
    display: flex;
    justify-content: space-between;
    width: 100%;
    background-color: var(--hud-bg);
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid var(--accent-color);
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    color: var(--neon-blue);
    text-shadow: 0 0 5px var(--neon-blue);
}

.hud-item.title {
    color: var(--highlight);
    text-shadow: 0 0 5px var(--highlight);
}

#game-area {
    position: relative;
    border: 4px solid var(--hud-bg);
    border-radius: 4px;
    background-color: #000;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

canvas {
    display: block;
    image-rendering: pixelated;
    /* Crucial for pixel art */
}

#message-overlay,
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    text-align: center;
}

.hidden {
    display: none !important;
}

#start-screen .logo {
    font-family: 'Press Start 2P', cursive;
    font-size: 22px;
    color: var(--neon-pink);
    text-shadow: 2px 2px 0px var(--neon-blue);
    line-height: 1.5;
}

.instructions {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    margin-bottom: 20px;
    color: #ccc;
}

.instructions p {
    margin: 10px 0;
}

.controls {
    margin-top: 20px;
    font-size: 12px;
}

button {
    background: linear-gradient(45deg, var(--highlight), #ff6b81);
    border: none;
    padding: 15px 40px;
    color: white;
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s, filter 0.2s;
    box-shadow: 0 4px 0 #900d28;
}

button:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #900d28;
}

button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #900d28;
}

#message-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    color: var(--neon-blue);
    margin-bottom: 20px;
}

#message-subtitle {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: white;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}