body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: rgb(0, 0, 0);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh; /* Ensure the body takes up the full height of the viewport */
}
#mainframe {
    width: 100%;
    max-width: calc(100vh * (16 / 9)); /* Ensure the canvas maintains aspect ratio and doesn't exceed viewport height */
    aspect-ratio: 16 / 9;
    background: rgb(255, 255, 255);
    position: relative;
    overflow: hidden;
    border: none;
}

#screenOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allow clicks to pass through */
    background: rgb(0, 0, 0); /* Initial transparent background */
    z-index: 1; /* Ensure the overlay is below other content when it's not active */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    touch-action: none; /* Prevent touch interactions */
}
#screenOverlay.active {
    opacity: 1;
}
#screenOverlay.flash {
    background: white;
}