:root {
  font-family: "DM Sans", system-ui, sans-serif;
  color: #1d352b;
  background: #f6f5ee;
  font-size: 16px;
  --green: #173e31;
  --ink: #183c30;
  --line: #cbd0c3;
  --orange: #ffd071;
  --paper: #fffef8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
a {
  color: inherit;
  text-underline-offset: 3px;
}
button,
.action {
  cursor: pointer;
  color: var(--ink);
  border: 1px solid #8c9b88;
  background: var(--paper);
  border-radius: 7px;
  padding: 0.55rem 0.85rem;
  font-weight: 650;
}
.action {
  text-decoration: none;
  display: inline-block;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
button:hover,
.action:hover {
  filter: brightness(0.94);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #ef9b33;
  outline-offset: 2px;
}
header {
  background: var(--green);
  color: white;
}
.mast,
main,
footer {
  max-width: 1160px;
  margin: auto;
  padding: 0 28px;
}
.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 69px;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font:
    bold 1.65rem Georgia,
    serif;
  letter-spacing: -0.055em;
  text-decoration: none;
}
.mark {
  background: var(--orange);
  color: var(--green);
  border-radius: 9px;
  width: 34px;
  height: 34px;
  text-align: center;
  font: bold 30px/32px Georgia;
}
.mast nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.mast nav a {
  text-decoration: none;
  font-size: 0.9rem;
}
.mast button {
  background: transparent;
  color: white;
  border-color: #8ca697;
}
main {
  min-height: 75vh;
}
.hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 48px 0 40px;
}
.hero h1,
h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.045em;
}
.hero h1 {
  font-size: clamp(3.7rem, 7vw, 6.5rem);
  font-weight: 500;
  line-height: 0.88;
  margin: 0 0 20px;
}
.hero h1 em {
  color: #367155;
}
.hero p {
  max-width: 480px;
  line-height: 1.55;
  margin-bottom: 22px;
}
.buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}
.puzzle {
  position: relative;
  background-color: #e5eddb;
  background-image: radial-gradient(#a8bba6 0.85px, transparent 1px);
  background-size: 14px 14px;
  border: 1px solid #adbea7;
  border-radius: 14px;
  padding: 16px 20px;
  transform: rotate(1deg);
  box-shadow: 4px 5px 0 #ced9c5;
}
.puzzle h3 {
  margin: 0;
  font-size: 1.4rem;
}
.puzzle p {
  margin: 0;
  font-size: 0.86rem;
}
.graph {
  height: 145px;
  display: block;
  width: 100%;
  touch-action: manipulation;
}
.edge {
  stroke: #39694d;
  stroke-width: 4;
  stroke-linecap: round;
}
.used {
  stroke: #dc9027;
  stroke-width: 6;
}
.dot circle {
  fill: #fff9e6;
  stroke: #243f31;
  stroke-width: 2;
}
.dot {
  cursor: pointer;
}
.dot text {
  font: bold 15px system-ui;
  fill: var(--ink);
  pointer-events: none;
  text-anchor: middle;
}
.active circle {
  fill: #ffcf70;
}
.puzzle-foot,
.board-head,
.bar,
.meta,
.rowfoot {
  display: flex;
  align-items: center;
  gap: 10px;
}
.puzzle-foot,
.board-head,
.bar {
  justify-content: space-between;
}
.puzzle-foot button {
  padding: 3px 8px;
  font-size: 0.8rem;
}
.board-head {
  border-top: 2px solid var(--ink);
  padding-top: 24px;
}
.board-head h2,
h1.thread {
  font-size: clamp(2rem, 4vw, 3.3rem);
  margin: 0;
}
.board-head small,
.tag,
.meta,
.stat span,
.count {
  font-size: 0.82rem;
}
.bar {
  margin: 17px 0;
  flex-wrap: wrap;
}
.filters {
  display: flex;
  gap: 5px;
}
.filters button {
  background: transparent;
  border-color: transparent;
}
.filters button.selected {
  background: #dbe8d6;
  border-color: #a5b89d;
}
.tools {
  display: flex;
  gap: 6px;
}
.tools input,
.tools select,
form input,
form textarea,
form select {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 0.55rem;
  color: var(--ink);
}
.tools input {
  width: 170px;
}
.list {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper);
}
.row {
  display: grid;
  grid-template-columns: 58px 65px 1fr;
  gap: 12px;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
}
.row:last-child {
  border: 0;
}
.stat {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-weight: 650;
  font-size: 1.25rem;
}
.stat span {
  font-weight: 400;
  color: #516253;
}
.row h3 {
  margin: 3px 0 8px;
  font-size: 1.45rem;
}
.row h3 a {
  text-decoration: none;
}
.row h3 a:hover {
  text-decoration: underline;
}
.rowfoot,
.meta {
  flex-wrap: wrap;
}
.tag {
  background: #edf0e5;
  border-radius: 4px;
  padding: 3px 7px;
}
.proven {
  background: #c5ead0;
}
.open {
  background: #ffedbd;
}
.meta,
.muted {
  color: #506356;
}
.detail {
  max-width: 840px;
  margin: 38px auto;
}
.detail h1 {
  line-height: 1.05;
  margin: 14px 0;
}
.text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
}
.note,
form.box,
.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 18px 22px;
  margin: 14px 0;
}
.detail h2 {
  font-size: 1.9rem;
}
.note:target {
  outline: 2px solid #b98523;
}
.detailslink {
  font-size: 0.9rem;
}
label {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-size: 0.9rem;
  font-weight: 600;
}
form textarea {
  min-height: 115px;
  width: 100%;
  resize: vertical;
}
.note small {
  color: #506356;
}
.quiet {
  color: #506356;
  font-size: 0.9rem;
}
.error {
  color: #903c1e;
}
.empty {
  padding: 22px;
}
.author-icon {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
}
footer {
  display: flex;
  gap: 22px;
  align-items: center;
  margin: 44px auto 0;
  padding-top: 18px;
  padding-bottom: 25px;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
}
footer strong {
  margin-right: auto;
}
dialog {
  width: min(520px, 95vw);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  padding: 24px;
}
dialog::backdrop {
  background: #0a241ccc;
}
dialog h2 {
  font-size: 2rem;
  margin: 4px 0 16px;
}
#close {
  float: right;
}
#toast:not(:empty) {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  z-index: 5;
}
.graph .dot:focus circle {
  stroke: #e37f13;
  stroke-width: 4;
}
@media (max-width: 720px) {
  .mast,
  main,
  footer {
    padding-left: 15px;
    padding-right: 15px;
  }
  .mast {
    flex-wrap: wrap;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 8px;
  }
  .mast nav {
    gap: 12px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 28px 2px;
  }
  .hero h1 {
    font-size: 4.1rem;
  }
  .puzzle {
    max-width: 490px;
    width: 100%;
    justify-self: center;
  }
  .graph {
    height: 117px;
  }
  .row {
    grid-template-columns: 39px 48px 1fr;
    gap: 7px;
    padding: 14px 9px;
  }
  .tools {
    flex-wrap: wrap;
  }
  .bar {
    gap: 10px;
  }
  .row h3 {
    font-size: 1.22rem;
  }
  footer {
    flex-wrap: wrap;
  }
  .mast nav a {
    font-size: 0.8rem;
  }
  .brand {
    font-size: 1.4rem;
  }
  .tools input {
    width: 150px;
  }
}
