:root {
    --bg: #000;
    --fg: #ccc;
    --muted: #888;
    --button: #222;
    --button-hover: #333;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--fg);
    font: 14px/1.4 system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#screen {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

#screen:fullscreen {
    width: 100vw;
    height: 100vh;
}

#screen:fullscreen #game {
    width: min(100vw, calc(100vh * 4 / 3)) !important;
    height: min(100vh, calc(100vw * 3 / 4)) !important;
}

#game {
    display: block;
    image-rendering: pixelated;
    outline: none;
}

#overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(0 0 0 / 70%);
}

#overlay[hidden] {
    display: none;
}

#message {
    margin: 0 16px;
    font-size: 18px;
    text-align: center;
}

#bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
    justify-content: space-between;
    width: min(100%, 960px);
    padding: 8px 16px;
    color: var(--muted);
    font-size: 12px;
}

button {
    padding: 4px 10px;
    border: 1px solid #444;
    border-radius: 4px;
    background: var(--button);
    color: var(--fg);
    font: inherit;
    cursor: pointer;
}

button:hover {
    background: var(--button-hover);
}
