.proof-forge {
  --proof-ink: #172945;
  --proof-stone: #e8eee8;
  --proof-spark: #ffcc78;
  color: #f8f6ec;
  background: #192b47;
  border: 2px solid #344d68;
  border-radius: 22px;
  overflow: clip;
  padding: clamp(12px, 2.8vw, 23px);
  text-align: left;
}
.proof-target {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 12px;
  margin-bottom: 16px;
}
.proof-target-title {
  color: #f3d9ac;
  align-self: end;
  font-size: .79rem;
  font-weight: 700;
}
.proof-target strong {
  align-self: start;
  line-height: 1.15;
  font-size: clamp(1.05rem, 3vw, 1.45rem);
}
.proof-emblem {
  grid-row: span 2;
  min-width: 46px;
  min-height: 46px;
  display: grid;
  place-items: center;
  background: #57442d;
  color: #ffdfa7;
  border: 2px solid #cfab69;
  border-radius: 15px 7px 15px 7px;
  font: bold 1.3rem Georgia, serif;
}
.proof-rack > summary {
  cursor: pointer;
  width: fit-content;
  min-height: 40px;
  line-height: 40px;
  font-weight: 800;
}
.proof-tray {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}
.proof-forge button {
  font: inherit;
  cursor: pointer;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.proof-rule {
  background: #2b415a;
  color: #eff5f5;
  border: 1px solid #849dac;
  border-radius: 9px;
  padding: 6px 9px;
  min-height: 36px;
  line-height: 1.16;
}
.proof-rule[aria-pressed=true] {
  border-color: var(--proof-spark);
  background: #f8dba4;
  color: var(--proof-ink);
  box-shadow: inset 0 -3px 0 #c28839;
}
.proof-rule[aria-pressed=true]::before { content: '✓ '; }
.proof-detail, .proof-guidance, .proof-feedback {
  margin: 6px 0;
  line-height: 1.42;
  color: #f1f3eb;
}
.proof-detail { font-size: .94rem; }
.proof-guidance { font-weight: 800; }
.proof-board {
  background: linear-gradient(110deg, #162e47bb, #203751d8), url('assets/refuge-void.webp') center / cover;
  border: 1px solid #668398;
  border-radius: 14px;
  position: relative;
  isolation: isolate;
}
.proof-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.proof-pieces {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(126px, 100%), 1fr));
  gap: 20px 11px;
  padding: 16px 10px;
  position: relative;
}
.proof-node {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-height: 50px;
  padding: 7px;
  border-radius: 12px 7px 12px 7px;
  border: 2px solid #b1c9ca;
  background: var(--proof-stone);
  color: var(--proof-ink);
  box-shadow: 0 3px 0 #132c43;
}
.proof-node-name {
  font-size: .86rem;
  line-height: 1.18;
  font-weight: 700;
  text-align: left;
}
.proof-node-mark {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  min-height: 24px;
  border-radius: 50%;
  font: bold .8rem Georgia, serif;
  background: #c4d9d7;
  color: #224b51;
}
.proof-node.is-derived {
  background: #d3eee2;
  border-color: #72b99f;
  animation: proof-temper .24s ease-out both;
}
.proof-node[aria-pressed=true] {
  border: 2px solid #ffcc78;
  box-shadow: 0 0 0 2px #472f15, 0 0 0 4px #ffcc78;
  background: #ffebc5;
}
.proof-node[aria-pressed=true] .proof-node-mark {
  background: #77551e;
  color: white;
}
.proof-node[aria-pressed=true] .proof-node-mark::before { content: '✓'; }
.proof-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin: 14px 0 0;
}
.proof-strike, .proof-undo {
  border-radius: 12px;
  padding: 8px 13px;
  min-height: 44px;
  line-height: 1.2;
}
.proof-strike {
  border: 2px solid #ffe6b4;
  background: var(--proof-spark);
  color: var(--proof-ink);
  font-weight: 800 !important;
  box-shadow: 0 3px 0 #aa7342;
}
.proof-undo { border: 1px solid #8296a3; color: #f5f4ed; background: transparent; }
.proof-forge button:disabled { cursor: default; }
.proof-strike:disabled:not(.is-solved .proof-strike), .proof-undo:disabled { opacity: .58; }
.proof-forge :focus-visible { outline: 3px solid white; outline-offset: 3px; }
.proof-feedback:not(:empty) { border-left: 3px solid var(--proof-spark); padding: 4px 10px; margin-top: 12px; }
@keyframes proof-temper { from { opacity: .6; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .proof-node.is-derived { animation: none; } }
@media (max-width: 450px) {
  .proof-pieces { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 7px; padding: 12px 6px; }
  .proof-node { flex-direction: column; justify-content: center; padding: 5px; gap: 4px; }
  .proof-node-name { text-align: center; }
  .proof-node-mark { flex-basis: auto; min-width: 24px; }
}
