body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #222;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: 'Press Start 2P', cursive;
    /* 8-bit style font */
    color: white;
}

#game-container {
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border: 4px solid #fff;
}

canvas {
    display: block;
    image-rendering: pixelated;
    /* Essential for 8-bit look */
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#score {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 20px;
    text-shadow: 2px 2px #000;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    pointer-events: auto;
}

.screen h1 {
    font-size: 40px;
    margin-bottom: 20px;
    color: #ff0055;
    text-shadow: 4px 4px #000;
}

.screen p {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* Famicom Style Tweaks */
#title-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0.4;
    /* Darken slightly to make text readable */
    image-rendering: pixelated;
}

.game-title {
    font-size: 48px;
    line-height: 1.2;
    color: #ff0000;
    /* Famicom Red */
    text-shadow:
        4px 4px 0 #000,
        -2px -2px 0 #fff;
    /* Retro shadow effect */
    margin-bottom: 40px;
    transform: rotate(-5deg);
    /* Jaunty angle */
}

.blink {
    animation: blinker 1s linear infinite;
    color: #ffd700;
    text-shadow: 2px 2px #000;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

.instructions {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border: 2px solid white;
    margin-top: 20px;
}

/* Credits Screen */
/* Credits Screen */
#credits-screen {
    background-color: black;
    z-index: 200;
    display: flex;
    /* Flexbox for centering */
    justify-content: center;
    align-items: center;
    color: white;
    font-family: 'Press Start 2P', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
}

.credits-content {
    background-color: #111;
    /* Dark background for the card */
    border: 4px double white;
    /* The "Frame" */
    padding: 40px;
    width: 80%;
    max-width: 600px;
    text-align: center;
    position: relative;
    /* Reset positioning */
    top: auto;
    left: auto;
    animation: none;
    /* Stop scrolling */
}

.instructions {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border: 2px solid white;
    margin-top: 20px;
}