html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
}

body {
    background-color: #222222;
    display: flex;
    flex-direction: column;
}

/* the website's header (highscore/static/style.css), slimmer: the game needs the height */
.site-header {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 16px;
    border-bottom: 2px solid #576674;
    background: #2d1b23;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.site-header .brand img {
    height: 28px;
    display: block;
}
.site-header nav {
    display: flex;
    gap: 4px;
}
.site-header nav a {
    color: #cfc6b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.75rem;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
}
.site-header nav a:hover {
    color: #ffca28;
    background: rgba(255, 255, 255, 0.05);
}
.site-header nav a.active {
    color: #ffca28;
    box-shadow: inset 0 -2px 0 #ffca28;
}

/* phones: logo and all four links have to fit side by side */
@media (max-width: 480px) {
    .site-header {
        padding: 6px 8px;
        gap: 6px;
    }
    .site-header .brand img {
        height: 20px;
    }
    .site-header nav {
        gap: 0;
    }
    .site-header nav a {
        font-size: 0.65rem;
        padding: 6px;
    }
}

/* in fullscreen the game gets the whole screen */
html.fullscreen .site-header {
    display: none;
}

/* the game fills the window below the header; index.html sizes the canvas to the largest 16:9 box that fits */
#embed-html {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

canvas {
    cursor: default;
    outline: none;
    display: block;
    /* scale the 640x360 pixel art without blurring it */
    image-rendering: -moz-crisp-edges;
    image-rendering: pixelated;
}

canvas.shrunk {
    image-rendering: auto;
}

#fullscreen-toggle {
    position: fixed;
    right: 12px;
    bottom: 12px;
    padding: 6px 12px;
    font: 14px sans-serif;
    color: #f0e6d2;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(240, 230, 210, 0.4);
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
}

#fullscreen-toggle:hover,
#fullscreen-toggle:focus-visible {
    opacity: 1;
}

#fullscreen-toggle[hidden] {
    display: none;
}
