@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("./assets/albert-sans-latin-300.woff2") format("woff2");
}
:root {
  color-scheme: light;
  color: #171717;
  background: #fff;
  font-family: Georgia, "Times New Roman", serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
main {
  max-width: 1040px;
  margin: auto;
  padding: 24px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 22px;
}
h1 {
  font-size: 24px;
  font-weight: normal;
  margin: 0;
}
nav {
  display: flex;
  gap: 18px;
  font:
    12px Arial,
    sans-serif;
}
a {
  color: #2596be;
  text-decoration: none;
}
a:hover {
  color: #ff6600;
  text-decoration: underline;
}
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.terminal {
  padding: 0;
  width: 100%;
  display: block;
  text-align: left;
  border: 1px solid #39434f;
  background: #101923;
  cursor: pointer;
  color: #cbd5e1;
}
.terminal:hover:enabled {
  background: #101923;
  border-color: #2596be;
  color: #cbd5e1;
  text-decoration: none;
}
.terminal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #202c39;
  font: 11px monospace;
}
.terminal-bar span:last-child {
  color: #94a3b8;
}
.preview {
  display: block;
  aspect-ratio: 8 / 5;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.note {
  font: 11px/1.5 monospace;
  color: #666;
  margin: 12px 0 0;
}
button {
  font:
    300 13px/1.6 "Albert Sans",
    Arial,
    sans-serif;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #2596be;
  min-height: 30px;
  padding: 4px 3px;
  cursor: pointer;
  text-underline-offset: 4px;
}
button:hover:enabled {
  color: #ff6600;
  text-decoration: underline;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button[aria-pressed="true"] {
  color: #171717;
  text-decoration: underline;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid #2596be;
  outline-offset: 5px;
  border-radius: 2px;
}
[hidden] {
  display: none !important;
}
#viewer {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 18px 24px;
  background: #fff;
  color: #171717;
}
.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
h2 {
  font-size: 20px;
  font-weight: normal;
  margin: 0;
  white-space: nowrap;
}
.controls {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.viewport {
  display: flex;
  flex: 1;
  min-height: 0;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
}
.stage {
  position: relative;
  background: #101923;
  overflow: hidden;
  flex: none;
  isolation: isolate;
}
.hud,
.metrics {
  position: absolute;
  left: 14px;
  right: 14px;
  color: #cbd5e1;
  font: 11px/1.5 monospace;
  pointer-events: none;
  z-index: 1;
  text-shadow: 0 1px 2px #101923;
}
.hud {
  top: 12px;
}
.metrics {
  bottom: 12px;
  color: #77d3cf;
}
.result {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #101923;
  color: #e1e6ee;
  z-index: 2;
}
.result p {
  font-size: 24px;
}
#hint {
  margin-top: 10px;
  text-align: center;
}
@media (max-width: 650px) {
  main {
    padding: 16px 10px;
  }
  .gallery {
    gap: 12px;
  }
  .terminal-bar {
    font-size: 10px;
    padding: 7px;
  }
  #viewer {
    padding: 10px;
  }
  .viewer-bar {
    flex-wrap: wrap;
  }
  .hud,
  .metrics,
  #hint {
    font-size: 9px;
  }
}
@media (max-width: 420px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .terminal-bar span:last-child {
    color: #cbd5e1;
  }
}

.fa-icon {
  display: block;
  width: 12px;
  height: 16px;
}
#close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
}
.result button {
  color: #77d3cf;
}
@media (max-width: 650px) {
  .controls {
    gap: 10px;
  }
}

.terminal-card {
  min-width: 0;
}
.game-source {
  display: block;
  width: fit-content;
  margin: 6px 0 0 auto;
  font:
    300 11px/1.6 "Albert Sans",
    Arial,
    sans-serif;
}
#game-source {
  align-self: center;
  font:
    300 13px/1.6 "Albert Sans",
    Arial,
    sans-serif;
}

.stage > canvas {
  position: absolute;
  inset: 0;
}
.viewer-bar,
#hint {
  flex-shrink: 0;
}
