:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background: #111310;
  color: #f4f1e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

header,
main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 0 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  line-height: 1;
}

h2 {
  font-size: 1.35rem;
}

.eyebrow {
  margin-bottom: 6px;
  color: #e2a74d;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#load-status,
.count {
  color: #b8b9b1;
  font-size: 0.9rem;
}

main {
  display: grid;
  gap: 24px;
  padding-bottom: 48px;
}

.panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid #353a32;
  border-radius: 14px;
  background: #1a1d18;
  box-shadow: 0 18px 60px rgb(0 0 0 / 22%);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 90px;
  color: #cbcfc6;
  font-size: 0.8rem;
  font-weight: 650;
}

label.wide {
  flex: 1 1 260px;
}

label.checkbox {
  display: flex;
  align-items: center;
  min-height: 38px;
  gap: 8px;
}

input,
select,
button {
  min-height: 38px;
  border: 1px solid #4d5547;
  border-radius: 7px;
  background: #252920;
  color: #fff;
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 8px 10px;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
}

button {
  padding: 8px 14px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: #d7a451;
}

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

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.stage {
  display: grid;
  place-items: center;
  min-height: 340px;
  max-height: 72vh;
  overflow: auto;
  border: 1px solid #3c4237;
  border-radius: 8px;
}

.checkerboard {
  background-color: #252925;
  background-image:
    linear-gradient(45deg, #30352e 25%, transparent 25%),
    linear-gradient(-45deg, #30352e 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #30352e 75%),
    linear-gradient(-45deg, transparent 75%, #30352e 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

canvas {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  image-rendering: auto;
}

.details {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 5px 18px;
  margin: 16px 0 0;
  color: #c9ccc3;
  font-size: 0.85rem;
}

.details dt {
  color: #858c80;
}

.details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

audio {
  display: block;
  width: 100%;
  margin-top: 8px;
}

@media (max-width: 700px) {
  header {
    align-items: start;
    flex-direction: column;
  }

  .panel {
    padding: 16px;
  }

  .stage {
    min-height: 220px;
  }
}
