body {
    background-color: #000;
    color: #fff;

    /* Allow mouse dragging. */
    -moz-user-select: none;
    -ms-user-select: none;
    -o-user-select: none;
    -webkit-user-select: none;
    user-select: none;

    /* disable touch panning/zooming */
    -ms-touch-action: none;
    touch-action: none;

    /* Allow canvas to hit the edges of the browser viewport. */
    margin: 0;
}

#screen canvas {
    margin: auto;

    /* Hide the gap for font descenders. */
    display: block;

    /* disable scaling interpolation */
    image-rendering: optimizeSpeed;
    image-rendering: -moz-crisp-edges;
    image-rendering: -o-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
    image-rendering: pixelated;
    -ms-interpolation-mode: nearest-neighbor;
}

/* Landscape-only game: on narrow/portrait mobile screens, hide the canvas
   and show a "please rotate" prompt instead of a tiny squished playfield. */
#rotate-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background-color: #000;
    color: #fff;
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
}

#rotate-overlay__icon {
    font-size: 64px;
    animation: rotate-overlay-spin 1.8s ease-in-out infinite;
}

#rotate-overlay__text {
    font-size: 18px;
    max-width: 280px;
}

@keyframes rotate-overlay-spin {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

@media screen and (max-width: 900px) and (orientation: portrait) {
    #screen {
        display: none;
    }
    #rotate-overlay {
        display: flex;
    }
}
