:root {
  color-scheme: dark;
  --bg: #191d1b;
  --ink: #e5e1d2;
  --muted: #a4a99b;
  --line: #41473e;
  --brass: #cfb587;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px system-ui,
    sans-serif;
}
main {
  max-width: 1040px;
  margin: auto;
  padding: 24px clamp(16px, 4vw, 50px) 40px;
}
header {
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 15px;
  color: var(--brass);
}
h1,
h2 {
  font-family: Georgia, serif;
  font-weight: normal;
  margin: 0;
}
h1 {
  font-size: 37px;
  letter-spacing: -1.5px;
  color: var(--ink);
}
header span {
  margin-left: auto;
  color: var(--muted);
  font:
    italic 16px Georgia,
    serif;
}
.work {
  position: relative;
  width: min(100%, 790px);
  aspect-ratio: 1.2;
  margin: 0 auto;
}
.wheel {
  position: absolute;
  width: 55%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
#board {
  width: 100%;
  height: auto;
  display: block;
  cursor: grab;
}
#board:active {
  cursor: grabbing;
}
button {
  font: inherit;
  color: inherit;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}
button:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
.arc,
#choose {
  position: absolute;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--brass);
  padding: 0;
}
.arc {
  width: 17%;
  height: 10%;
  border: 0;
  border-radius: 50%;
  bottom: 3%;
}
.arc svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
}
.arc:hover,
#choose:hover {
  color: #fff5d6;
}
#left {
  left: 19%;
}
#right {
  right: 19%;
}
#choose {
  width: clamp(34px, 6vw, 46px);
  height: clamp(34px, 6vw, 46px);
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 45%) rotate(45deg);
  border-color: #897956;
}
#choose svg {
  width: 80%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  transform: rotate(-45deg);
}
.pick {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  width: 17%;
  padding: 4px 0 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(11px, 2vw, 16px);
}
.pick[aria-pressed="true"] {
  border-color: var(--brass);
  color: var(--brass);
}
.pick canvas {
  width: 78%;
  height: auto;
}
.pick:nth-child(1) {
  --x: 29%;
  --y: 12%;
}
.pick:nth-child(2) {
  --x: 71%;
  --y: 12%;
}
.pick:nth-child(3) {
  --x: 92%;
  --y: 50%;
}
.pick:nth-child(4) {
  --x: 71%;
  --y: 88%;
}
.pick:nth-child(5) {
  --x: 29%;
  --y: 88%;
}
.pick:nth-child(6) {
  --x: 8%;
  --y: 50%;
}
.trans {
  border-top: 1px solid var(--line);
  padding-top: 15px;
}
#slots {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.slot {
  border-bottom: 1px solid var(--line);
  padding: 8px 2px;
  min-height: 68px;
  text-align: center;
}
.slot small {
  font-size: 12px;
  color: var(--brass);
  letter-spacing: 0.14em;
}
.slot strong {
  display: block;
  font-weight: 400;
  font-size: 14px;
}
.slot button {
  border: 0;
  padding: 2px 7px;
}
.send {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
#submit {
  background: var(--brass);
  color: var(--bg);
  padding: 7px 14px;
}
#status {
  font-size: 13px;
}
pre {
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.6;
  max-width: 72ch;
}
body,
header span,
h1,
h2 {
  font-family:
    ui-monospace, "Cascadia Mono", "Lucida Console", Consolas, monospace;
}
header span {
  font-style: normal;
}
@media (max-width: 600px) {
  main {
    padding-inline: 10px;
  }
  .work {
    aspect-ratio: 1;
    min-height: 340px;
  }
  .wheel {
    width: 59%;
  }
  .pick {
    width: 18%;
  }
  #slots {
    grid-template-columns: repeat(3, 1fr);
  }
  header span {
    font-size: 12px;
  }
  .arc {
    min-height: 30px;
  }
}

.goblin {
  width: 68px;
  flex: none;
  height: auto;
}
.clue {
  max-width: 49ch;
  margin: 0 0 0 auto;
  font-size: clamp(12px, 1.6vw, 15px);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#submit {
  display: grid;
  place-items: center;
  min-width: 62px;
  min-height: 44px;
  background: transparent;
  color: var(--brass);
  border: 1px solid var(--line);
  transition:
    border-color 0.18s,
    color 0.18s;
}
#submit svg {
  width: 38px;
  height: 32px;
}
#submit:enabled:hover {
  border-color: var(--brass);
}
.pick {
  transition:
    color 0.18s,
    border-color 0.18s;
}
.pick canvas {
  transition: transform 0.18s;
}
.pick[aria-pressed="true"] canvas {
  transform: scale(1.07);
}
#choose:active:not(:disabled) {
  transform: translate(-50%, 45%) rotate(45deg) scale(0.92);
}
#choose {
  transition: transform 0.12s;
}
.refused :is(.pick canvas, #board, #choose svg, .arc svg, .goblin) {
  animation: red-pulse 0.53s ease-out 1;
}
.refused .slot strong {
  animation: ember 0.53s ease-out 1;
}
.refused #submit {
  animation: refusal 0.42s ease-out 1;
}
.iris {
  filter: drop-shadow(0 0 2px #ef795c);
}
@keyframes red-pulse {
  0%,
  100% {
    filter: none;
  }
  20%,
  38% {
    filter: sepia(1) saturate(8) hue-rotate(318deg);
  }
}
@keyframes ember {
  24%,
  45% {
    color: #ff715e;
  }
}
@keyframes refusal {
  0%,
  100% {
    transform: none;
  }
  22% {
    transform: translateX(-5px);
    color: #ff715e;
  }
  52% {
    transform: translateX(4px);
  }
  78% {
    transform: translateX(-2px);
  }
}
@media (max-width: 650px) {
  header {
    flex-wrap: wrap;
  }
  .goblin {
    width: 50px;
  }
  .clue {
    flex-basis: 100%;
    max-width: none;
    margin: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
  .refused #submit,
  .refused .slot strong {
    color: #ff715e;
  }
  .refused .pick {
    border-color: #a65141;
  }
}

.trans .send {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  text-align: center;
}

#submit {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0;
  overflow: hidden;
}

#submit::before,
#submit::after {
  content: "";
  flex: 1;
  border-top: 2px solid currentColor;
}

#submit svg {
  display: block;
  flex: none;
  width: min(48%, 240px);
  height: auto;
}

.send [role="status"]:not(:empty) {
  margin-top: 0.5rem;
}

.send #status:not(:empty) + #announce {
  display: none;
}
