:root {
  color-scheme: dark;
  color: #deded6;
  background: #141414;
  font: 14px/1.5 system-ui, sans-serif;
}

body {
  min-height: 100dvh;
  margin: 0;
  display: grid;
  place-content: center;
}

main {
  width: min(864px, 100vw);
  margin: auto;
}

#stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(576px, calc(100vw * 2 / 3));
  background: #000;
}

#game {
  display: block;
  width: var(--game-width, 100%);
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  outline: none;
}

#stage:fullscreen,
#stage:-webkit-full-screen {
  display: grid;
  place-items: center;
}

#startup {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 1rem;
  place-content: center;
  justify-items: center;
  padding: 1.5rem;
  text-align: center;
  background: #000;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.tools {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
}

summary { cursor: pointer; }
summary:hover { color: #fff; }
details p { margin: 0.5rem 0 0; }
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

button, .file-button {
  box-sizing: border-box;
  border: 1px solid #53534e;
  border-radius: 4px;
  background: #262624;
  color: inherit;
  font: inherit;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
}

button:hover, .file-button:hover { background: #363633; }
button:disabled { cursor: default; opacity: 0.55; }

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.file-button:has(+ input:disabled) { opacity: 0.55; cursor: default; }
.file-button:has(+ input:focus-visible) { outline: 2px solid #fff; outline-offset: 2px; }
#file-status[data-error="true"] { color: #ffb4a8; }
