:root {
    font-family: 'Nunito', sans-serif;
}

body {
    text-align: center;
    background: rgb(126, 126, 126);
    color: rgb(23 60 102 / 84%);
    background-image: url("../images/general/bg2.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    /* background-size: 2025px; */
    background-position-x: center;
    margin: 0;
    color: white;
    /* layout the page as a column so the canvas can size relative to available space */
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

h1 {
    letter-spacing: 2px;
    font-size: 60px;
    margin: 15px 0;
}

canvas {
    /* background: rgb(0, 0, 0); */
    background-image: url("../images/general/maps_bg.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    background-position-x: center;
    border: 2px solid #444;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.7);
    /* Preserve the game's design aspect ratio (1700x1080) while letting the canvas
       scale down to fit the viewport without distortion or scrollbars. */
    aspect-ratio: 1700 / 1080;
    /* Compute the largest width that still fits viewport width or height.
       The multiplier 1.574074... = 1700 / 1080. */
    width: min(1100px, calc(100vw - 40px), calc((100vh - 180px) * 1.5740740741));
    height: auto; /* keep aspect ratio */
    max-height: calc(100vh - 180px); /* reserve space for header, buttons and footer; tweak if needed */
    display: block;
    box-sizing: border-box;
}

/* For short viewports, ensure the canvas height doesn't exceed available space and let width shrink */
@media (max-height: 700px) {
    canvas {
        /* On very short screens, limit canvas height and let width scale with aspect-ratio */
        height: calc(100vh - 140px);
        width: calc((100vh - 140px) * 1.5740740741);
        max-width: calc(100vw - 40px);
    }
}

.gameplayButton {
    font-size: 1.5rem;
    background-color: rgba(56, 97, 102, 0.904);
    border: 5px solid rgb(114, 155, 155);
    color: rgb(194, 214, 214);
    border-radius: 200px;
    margin: 10px;
    padding: 5px 20px 5px 20px;
    font-weight: bold;
    transition-duration: 0.3s;
    cursor: pointer;
}

.gameplayButton:hover {
    background-color: rgba(77, 123, 129, 0.904);
    border: 5px solid rgb(114, 155, 155);
    color: rgb(255, 255, 255);
    transition-duration: 0.3s;
}

span {
    color: white;
    font-size: x-large;
}
footer {
    text-align: left;
    padding: 0 30px;
    position: fixed;
    bottom: 0;
    left: 0;
}
footer * {
    font-family: sans-serif;
}