:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #233a30;
  background: #f6f3eb;
  --green: #214e3c;
  --line: #dedfd3;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { max-width: 32rem; margin: auto; padding: 1.25rem 1rem 1rem; }
h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 3px solid #aa5a20; outline-offset: 3px; }
.masthead, .brand, .puzzle-header, .actions, .dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.masthead { margin-bottom: 1rem; }
.brand h1 { font-family: Georgia, serif; font-size: clamp(1.55rem, 6vw, 2.15rem); letter-spacing: -.05em; }
.mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: .55rem;
  background: var(--green);
  color: #fff;
  font: bold 1.25rem Georgia, serif;
  transform: rotate(-7deg);
}
.round { font-size: .85rem; font-weight: 650; white-space: nowrap; }
.puzzle {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: .8rem;
  box-shadow: 0 4px 14px #253c3010;
}
.puzzle-header h2 { font-size: .95rem; }
#progress { font-size: .8rem; color: #526357; }
.board-wrap { min-height: 10.5rem; display: grid; place-items: center; padding: .6rem 0; }
.board {
  --gap: 2px;
  --size: min(2rem, calc((100vw - 3.75rem - (var(--cols) - 1) * var(--gap)) / var(--cols)));
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--size));
  grid-auto-rows: var(--size);
  gap: var(--gap);
}
.cell {
  display: grid;
  place-items: center;
  border: 1px solid #d5dacd;
  border-radius: .23rem;
  background: #eceee5;
  font-weight: 750;
  font-size: calc(var(--size) * .59);
}
.cell.hinted { background: #f6e2ae; border-color: #e6c982; }
.cell.solved { background: #d3e6d5; border-color: #bfd8c1; }
.actions button, .dialog-header button {
  min-height: 2.6rem;
  padding: .35rem .7rem;
  font-size: .85rem;
  font-weight: 650;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: .55rem;
}
#points { display: inline-block; min-width: 1.3rem; padding: .1rem .24rem; border-radius: .4rem; background: #f6e2ae; }
.play { text-align: center; padding-top: .65rem; }
#status { min-height: 1.8rem; font-weight: 700; }
.wheel {
  position: relative;
  width: min(66vw, 14rem);
  aspect-ratio: 1;
  margin: .15rem auto .65rem;
  border-radius: 50%;
  background: #dce8d9;
  touch-action: none;
  user-select: none;
}
#trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#trail polyline { fill: none; stroke: #659477; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.letter, .mix {
  position: absolute;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  width: 23%;
  aspect-ratio: 1;
}
.letter { background: #fffdf8; box-shadow: 0 2px 3px #183a302b; font: bold clamp(1.25rem, 6vw, 1.85rem) Georgia, serif; }
.letter.selected, .primary { background: var(--green); color: #fff; }
.mix { top: 50%; left: 50%; font-size: 1.6rem; background: #c9dbc6; }
.instruction, footer { font-size: .8rem; color: #526357; }
.primary { border: 0; border-radius: .6rem; padding: .7rem 1rem; font-weight: 700; }
footer { text-align: center; margin-top: .9rem; }
footer a { color: inherit; }
dialog { border: 1px solid var(--line); color: inherit; border-radius: 1rem; width: min(29rem, calc(100% - 2rem)); max-height: 80vh; }
dialog::backdrop { background: #182b25a0; }
.dialog-header h2 { font-size: 1.25rem; }
dt { font-weight: 750; margin-top: .8rem; }
dd { margin: .3rem 0; }
