:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --panel: #151924;
  --ink: #d6dae4;
  --dim: #8b93a7;
  --accent: #d8542a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 24px 16px 48px;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
main { max-width: 720px; margin: 0 auto; }
h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sub { margin: 4px 0 20px; color: var(--dim); }

#stage {
  position: relative;
  background: #000;
  border: 1px solid #262c3b;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
#canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  outline: none;
  background: #000;
}
#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(8, 10, 15, 0.86);
  text-align: center;
  padding: 16px;
}
/* Several elements here are display:flex, which outranks the hidden
   attribute's default styling, so enforce it. */
[hidden] { display: none !important; }
button {
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 5px;
  padding: 11px 22px;
  cursor: pointer;
}
button:hover:not(:disabled) { filter: brightness(1.1); }
button:disabled { background: #3a4152; cursor: default; }
#status { margin: 0; color: var(--dim); font-size: 13px; }

#controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}
#controls button { background: var(--panel); padding: 7px 14px; font-weight: 500; }
.hint { color: var(--dim); font-size: 13px; }

.keys { margin-top: 28px; }
.keys h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); margin: 0 0 8px; }
.keys ul { margin: 0; padding-left: 20px; color: var(--dim); }
.keys b { color: var(--ink); font-weight: 600; }

#failure {
  margin-top: 12px;
  border: 1px solid #a33;
  border-left-width: 4px;
  border-radius: 5px;
  background: #1b1315;
  padding: 12px 14px;
}
#failure h2 { margin: 0 0 4px; font-size: 15px; color: #ff8f6b; }
#failure p { margin: 0 0 8px; color: var(--dim); font-size: 13px; }
#failure-detail {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 12px;
  color: var(--ink);
}

/* The unsupported-browser notice replaces the size hint under the button. */
#status a { color: var(--accent); }
