:root {
  --ink: #16150f;
  --paper: #fbf9f2;
  --muted: #7d7663;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  display: flex;
}

.panel {
  width: 268px;
  flex: 0 0 268px;
  border-right: 2px solid var(--ink);
  padding: 22px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 17px;
  overflow-y: auto;
}

.brand h1 {
  margin: 0 0 5px;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 27px;
  letter-spacing: 0.01em;
}

.brand p {
  margin: 0;
  font-size: 9.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
}

.walk-link {
  display: block;
  text-align: center;
  padding: 12px 8px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
}

.walk-link:hover {
  background: transparent;
  color: var(--ink);
}

/* the only way into the walker: it has to show where the keyboard is */
.walk-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.lab {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 9.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

output {
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

input[type='number'] {
  width: 100%;
  padding: 8px 9px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

input[type='number']:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

input[type='range'] {
  width: 100%;
  height: 16px;
  margin: 0;
  accent-color: var(--ink);
  cursor: pointer;
}

.row {
  display: flex;
  gap: 6px;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 0;
}

.icon {
  flex: 0 0 34px;
  width: 34px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
}

.icon:hover {
  background: var(--ink);
  color: var(--paper);
}

.styles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.styles button {
  padding: 8px 4px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.styles button:hover {
  background: rgba(22, 21, 15, 0.08);
}

.styles button.on {
  background: var(--ink);
  color: var(--paper);
}

.styles button.on:hover {
  background: var(--ink);
}

.checks {
  display: grid;
  gap: 9px;
  margin-top: 2px;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  letter-spacing: 0.03em;
  cursor: pointer;
  user-select: none;
}

.check input {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border: 1.5px solid var(--ink);
  background: transparent;
  cursor: pointer;
}

.check input:checked {
  background: var(--ink);
  box-shadow: inset 0 0 0 2.5px var(--paper);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: auto;
  padding-top: 4px;
}

.actions .primary {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.actions .primary:hover {
  background: transparent;
  color: var(--ink);
}

.actions button:not(.primary) {
  padding: 9px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.actions button:not(.primary):hover {
  background: var(--ink);
  color: var(--paper);
}

.hint {
  margin: 0;
  font-size: 8.5px;
  line-height: 1.7;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: var(--paper);
}

#board {
  position: absolute;
  inset: 0;
  display: block;
  cursor: grab;
}

#board.dragging {
  cursor: grabbing;
}

@media (max-width: 720px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
    flex-direction: column;
  }

  .panel {
    width: auto;
    flex: 0 0 auto;
    border-right: none;
    border-bottom: 2px solid var(--ink);
  }

  .actions {
    margin-top: 6px;
  }

  .stage {
    flex: 1 1 auto;
    min-height: 68vh;
  }
}
