* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #e6e0d4;
  color: #1c1916;
  font-family: Inter, "Noto Sans", "Liberation Sans", sans-serif;
  font-synthesis: none;
  color-scheme: light;
}

main {
  display: grid;
  grid-template-columns: minmax(300px, 440px) minmax(280px, 1fr);
  gap: 36px;
  align-items: start;
  min-height: 100vh;
  padding: 32px 40px 48px;
}

.mark {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5e574e;
}

h1 {
  margin: 0;
  font-family: "Noto Serif", "Liberation Serif", Georgia, serif;
  font-size: 42px;
  font-weight: 400;
  line-height: 1.1;
}

.lede {
  margin: 12px 0 22px;
  max-width: 38em;
  font-size: 16px;
  line-height: 1.45;
  color: #3f3a34;
}

.panel, .field {
  display: grid;
  gap: 12px;
}

.field {
  margin-top: 2px;
}

.label, .sheet-label {
  margin: 0;
  color: #5e574e;
}

.label {
  font-size: 13px;
}

.sheet-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #3f3a34;
}

label span {
  color: #1c1916;
  font-variant-numeric: tabular-nums;
}

textarea, input[type="text"] {
  width: 100%;
  border: 1px solid #c9c0b2;
  border-radius: 6px;
  background: #fffcf7;
  color: #1c1916;
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
  min-height: 92px;
  line-height: 1.4;
}

textarea::placeholder {
  color: #8a8175;
}

input[type="range"] {
  padding: 0;
  accent-color: #1c1916;
}

input[type="color"] {
  padding: 4px;
  width: 46px;
  height: 42px;
  border: 1px solid #c9c0b2;
  border-radius: 6px;
  background: #fffcf7;
}

.color-line {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 8px;
  align-items: center;
}

.hint, .fine, .empty {
  margin: 0;
  max-width: 46em;
  font-size: 13px;
  line-height: 1.4;
  color: #5e574e;
}

.fine {
  margin-top: 4px;
}

.empty {
  margin-top: 18px;
  font-size: 15px;
  line-height: 1.45;
}

.choices, .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

button {
  justify-self: start;
  border: 1px solid #1c1916;
  border-radius: 6px;
  background: transparent;
  color: #1c1916;
  font: inherit;
  font-size: 15px;
  padding: 10px 16px;
  cursor: pointer;
}

.choices button {
  min-width: 44px;
}

button:hover:not(:disabled):not([aria-pressed="true"]) {
  background: #f3ece1;
}

button[aria-pressed="true"] {
  background: #1c1916;
  color: #fffcf7;
}

button[aria-pressed="true"]:hover:not(:disabled) {
  background: #34302b;
  color: #fffcf7;
}

button:disabled {
  cursor: default;
  opacity: 0.5;
}

:focus-visible {
  outline: 2px solid #1c1916;
  outline-offset: 2px;
}

input.error {
  border-color: #8a2e24;
}

#status {
  min-height: 1.2em;
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

#status.error {
  color: #8a2e24;
}

.stage {
  display: flex;
  justify-content: center;
}

.sheet {
  width: min(100%, 560px);
  min-height: 280px;
  padding: 22px 22px 26px;
  background: #fffcf7;
  box-shadow: 0 12px 32px rgba(48, 38, 22, 0.12);
}

.frame {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

canvas {
  width: min(100%, 420px);
  height: auto;
  image-rendering: pixelated;
}

[hidden] {
  display: none !important;
}

noscript {
  display: block;
  padding: 16px 20px;
  background: #fff4e8;
}

@media (min-width: 861px) {
  .stage {
    position: sticky;
    top: 24px;
  }
}

@media (max-width: 860px) {
  main {
    grid-template-columns: 1fr;
    padding: 24px 18px 40px;
  }

  h1 {
    font-size: 34px;
  }
}
