:root {
  color-scheme: dark;
  color: #eeede2;
  background: #171d17;
  font: 16px/1.45 system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 42% 0, #313a29, #171d17 690px); }
.shell { width: min(1050px, calc(100% - 32px)); margin-inline: auto; }
header, .heading, .controls, .actions { display: flex; align-items: center; gap: 12px; }
header, .heading, .controls { justify-content: space-between; }
header { min-height: 64px; }
a { color: #d3ddc1; text-underline-offset: .25em; font-size: .88rem; }
button {
  background: #283026;
  color: inherit;
  border: 1px solid #53634b;
  border-radius: 6px;
  padding: 8px 11px;
  font: inherit;
  font-size: .84rem;
  cursor: pointer;
}
button[aria-pressed="true"] { background: #435441; }
button:disabled { opacity: .5; cursor: default; }
.heading { align-items: end; margin: 10px 0 16px; }
h1 { margin: 0; font: 500 clamp(2.4rem, 7vw, 4.25rem)/1 Georgia, serif; letter-spacing: -.05em; }
p { margin: 7px 0 0; color: #c4cbbb; }
.meter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  width: clamp(100px, 22vw, 185px);
  flex-shrink: 0;
  color: #dce5d2;
  font-size: .87rem;
  font-variant-numeric: tabular-nums;
}
progress { grid-column: span 2; width: 100%; height: 9px; accent-color: #bed88b; }
.yard {
  position: relative;
  width: min(100%, max(700px, calc((100dvh - 195px) * 1.5)));
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid #5b654e;
  border-radius: 12px;
  background: #303d22;
  box-shadow: 0 14px 45px #0007;
}
canvas { width: 100%; height: auto; aspect-ratio: 3 / 2; display: block; touch-action: none; cursor: crosshair; }
canvas:focus-visible { outline: 2px solid #d5efad; outline-offset: -3px; }
.overlay {
  position: absolute;
  inset: auto 12px 12px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 10px 15px;
  border-radius: 6px;
  background: #162014eb;
  color: #e7f1cf;
  pointer-events: none;
}
.overlay:empty { display: none; }
.controls { flex-wrap: wrap; padding: 11px 0 22px; font-size: .84rem; }
.controls p { margin: 0; }
fieldset { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; }
legend { float: left; padding: 0 8px 0 0; color: #c4cbbb; }
fieldset label { padding: 5px 7px; border-radius: 5px; background: #283026; cursor: pointer; }
input { accent-color: #bed88b; }
@media (max-width: 560px) {
  .shell { width: calc(100% - 22px); }
  .heading { flex-wrap: wrap; gap: 10px; }
  .meter { width: 100%; }
}
.yard { width: 100%; }
canvas { aspect-ratio: auto; height: clamp(330px, calc(100dvh - 214px), 660px); }
.walk { display: none; }
@media (pointer: coarse), (max-width: 700px) {
  canvas { height: clamp(335px, 58dvh, 590px); }
  .keyboard { display: none; }
  .walk {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: grid;
    grid-template-columns: repeat(3, 43px);
    gap: 3px;
  }
  .walk button {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    padding: 0;
    background: #202820de;
    font-size: 1.15rem;
    touch-action: none;
    user-select: none;
  }
  .walk button:first-child { grid-column: 2; }
  .walk button:nth-child(2) { grid-column: 1; }
  .overlay { top: 10px; bottom: auto; }
}
