:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background: #0b1020;
  color: #e5edf7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
}

main {
  width: min(100%, 72rem);
  margin: 0 auto;
  padding: clamp(0.75rem, 2vw, 1.5rem);
}

header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

header img {
  width: 5.5rem;
  height: auto;
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.25rem, 4vw, 2rem);
}

header p,
.status {
  color: #b7c6d9;
}

.controls,
.controls fieldset {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.controls {
  margin-bottom: 0.75rem;
}

.controls fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.controls legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

button {
  min-height: 2.5rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid #475569;
  border-radius: 0.45rem;
  background: #1e293b;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

input {
  width: 4.5rem;
  min-height: 2.5rem;
  padding: 0.45rem;
  border: 1px solid #475569;
  border-radius: 0.45rem;
  background: #111827;
  color: inherit;
  font: inherit;
}

button:disabled,
input:disabled {
  cursor: wait;
  opacity: 0.55;
}

button:hover,
button:focus-visible,
button[aria-current="true"] {
  border-color: #60a5fa;
  background: #263b59;
  outline: none;
}

input:focus-visible {
  border-color: #60a5fa;
  outline: 2px solid #60a5fa;
  outline-offset: 1px;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  background: #111827;
  touch-action: manipulation;
}

.status {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.status ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.status li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.key {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: #38bdf8;
}

.key.goal {
  background: #4ade80;
}

.key.unreachable {
  background: #fb7185;
}

@media (max-width: 36rem) {
  header img {
    display: none;
  }

  button {
    flex: 1 1 auto;
  }
}
