:root {
  font: 16px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color: #202e35;
  background: #f7f7f2;
  --ink: #174e48;
  --edge: #cbd4ca;
  --mono: ui-monospace,SFMono-Regular,Consolas,monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  padding: 17px max(5vw,calc((100vw - 1090px)/2));
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #203832;
  color: white;
}
header a {
  color: inherit;
  text-decoration: none;
}
nav {
  display: flex;
  gap: 20px;
}
a {
  color: var(--ink);
}
main {
  max-width: 1140px;
  margin: auto;
  padding: 32px 25px 70px;
}
.byline {
  color: var(--ink);
  font-weight: 650;
  margin: 0;
}
h1,h2 {
  font-family: Georgia,serif;
  font-weight: 500;
}
h1 {
  font-size: clamp(38px,5vw,66px);
  line-height: 1;
  margin: 8px 0 10px;
  letter-spacing: -.045em;
}
.intro {
  margin: 0 0 24px;
  color: #49574e;
}
form,.controls,.titlebar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
form {
  padding: 16px 0;
  border-block: 1px solid var(--edge);
  align-items: end;
}
label {
  font-size: .82rem;
  color: #43534b;
  display: grid;
  gap: 5px;
  font-weight: 600;
}
select,input,button {
  font: inherit;
  font-size: .9rem;
  color: inherit;
  border: 1px solid #a8b8aa;
  border-radius: 5px;
  background: #fff;
  padding: 8px 10px;
  min-height: 38px;
  max-width: 100%;
}
input {
  font-family: var(--mono);
  width: 150px;
}
button {
  cursor: pointer;
  font-weight: 600;
}
button:hover:enabled {
  border-color: var(--ink);
  background: #e6efea;
}
button:disabled {
  opacity: .5;
  cursor: default;
}
.primary,.primary:hover:enabled {
  background: var(--ink);
  color: white;
}
.titlebar {
  justify-content: space-between;
}
.titlebar a {
  font-size: .85rem;
}
h2 {
  font-size: 1.5rem;
  margin: 0;
}
.board,#inspector {
  background: white;
  border: 1px solid var(--edge);
  padding: 18px 20px;
  border-radius: 8px;
  margin: 16px 0;
}
#status {
  color: var(--ink);
  font-size: .9rem;
  margin: 10px 0;
}
.titlebar output,#position,.scale,figcaption,.bubble,.edge {
  font-family: var(--mono);
}
#grid {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(64vh, 660px);
  margin: 12px auto;
  border: 0;
  image-rendering: auto;
}
.dimensions, .dimensions label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dimensions {
  margin-top: 8px;
  gap: 18px;
}
.dimensions input { width: 5em; }
#speed { width: 100px; padding: 0; accent-color: var(--ink); }
#rate { font-variant-numeric: tabular-nums; min-width: 6em; }
.controls {
  gap: 8px;
}
.limit input { width: 7em; }
.limit, .speed {
  display: flex;
  align-items: center;
  margin-left: 6px;
}
#position {
  margin-left: auto;
  font-size: .83rem;
}
#detail {
  padding: 18px 0 0;
}
.transition {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 0 16px;
}
.bubble {
  border-radius: 50%;
  border: 2px solid #326c62;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  color: #174e48;
  background: #edf5ed;
}
.edge {
  text-align: center;
  border-bottom: 2px solid #326c62;
  position: relative;
  min-width: 130px;
  padding: 0 10px 6px;
  line-height: 1.3;
}
.edge:after {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 0;
  border-left: 9px solid #326c62;
  border-block: 5px solid transparent;
}
.caption {
  font-size: .85rem;
  color: #526356;
  text-align: center;
  margin: 0;
}
.maps {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 18px;
}
figure {
  margin: 0;
}
figcaption {
  font-weight: bold;
  margin-bottom: 6px;
}
canvas {
  width: 100%;
  height: 145px;
  image-rendering: pixelated;
  border: 1px solid #cbd4ca;
}
.scale {
  font-size: .74rem;
  margin: 2px 0;
  color: #45544b;
}
.info {
  font-size: .87rem;
  margin: 0 0 14px;
}
[hidden] {
  display: none !important;
}
@media (max-width:720px) {
  main {
    padding: 22px 12px;
  }
  .board,#inspector {
    padding: 12px;
  }
  .maps {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  form label {
    max-width: 100%;
  }
  #position {
    margin-left: 0;
  }
  .controls {
    row-gap: 10px;
  }
}
