:root {
  color-scheme: light;
  --canvas: #f7f3e9;
  --paper: #fffcf5;
  --ink: #30362c;
  --muted: #65685d;
  --line: #ded8c8;
  --green: #344e40;
  --green-wash: #e6ecdf;
  --rust: #8d452e;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; line-height: 1.5; font-size: 1.0625rem; }
.masthead, main, noscript { width: min(calc(100% - 2rem), 36rem); margin-inline: auto; }
.masthead {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: max(1.3rem, env(safe-area-inset-top)) .15rem 1.05rem;
  border-bottom: 1px solid var(--line);
  font: bold 1.45rem/1.2 var(--serif);
}
.brand-mark { position: relative; display: inline-block; width: 1.65rem; height: 1.55rem; }
.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1.3rem;
  border-radius: 3px;
}
.brand-mark::before { top: 0; left: .05rem; background: #d7a47f; transform: rotate(-15deg); }
.brand-mark::after { top: .2rem; right: 0; background: var(--green); transform: rotate(12deg); }
main { padding-block: clamp(1.5rem, 5vh, 3.25rem) max(3rem, env(safe-area-inset-bottom)); }
noscript { display: block; }
.loading, .subtle, .progress-note, .intro, .empty, .total { color: var(--muted); }
.loading { text-align: center; }
.paper {
  padding: clamp(1.35rem, 5.5vw, 2.4rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  box-shadow: 0 3px 0 #e7e1d3;
}
h1, h2, h3, p, ul { margin: 0; }
h1, h2 { font-family: var(--serif); line-height: 1.08; letter-spacing: -.035em; }
h1 { font-size: clamp(2.4rem, 8.8vw, 3.4rem); }
h2 { font-size: clamp(1.8rem, 6vw, 2.25rem); }
h1, h2, .your-answer, .answer-name, .rounds a { overflow-wrap: anywhere; }
.intro { margin-top: .9rem; }
.best-score, .goal-status { margin-top: .35rem; font-weight: 650; }
.paper-pair { position: relative; width: 5.6rem; height: 4.1rem; margin: .25rem 0 1.6rem .1rem; }
.paper-pair i {
  position: absolute;
  top: .3rem;
  width: 2.45rem;
  height: 3.1rem;
  border: 1px solid #9c7156;
  border-radius: .4rem;
  background: #e5ba94;
  transform: rotate(-15deg);
}
.paper-pair i:first-child { left: .42rem; }
.paper-pair i:last-child { top: .6rem; left: 2.05rem; background: #c8d6bf; border-color: #69836b; transform: rotate(14deg); }
.paper-pair i::before {
  content: "";
  position: absolute;
  inset: .79rem .54rem;
  border: 2px solid #835038;
  border-radius: 50%;
}
.paper-pair i:last-child::before { border-color: var(--green); }
form { margin-top: 1.9rem; }
label { display: block; margin-bottom: .45rem; font-weight: 650; }
input, button, a { -webkit-tap-highlight-color: transparent; }
input {
  width: 100%;
  min-height: 3.4rem;
  padding: .65rem .9rem;
  border: 1px solid #a6a897;
  border-radius: .65rem;
  background: #fffef9;
  color: var(--ink);
  font: inherit;
  font-size: 1.125rem;
}
input::placeholder { color: #707366; opacity: 1; }
input[aria-invalid="true"] { border-color: #993e30; }
:focus-visible { outline: 3px solid #a26924; outline-offset: 3px; }
.form-error { margin-top: .55rem; color: #91382d; font-size: .96rem; }
.primary, .secondary, .rounds a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  min-height: 3.4rem;
  padding: .72rem 1.05rem;
  border: 0;
  border-radius: .68rem;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.primary { width: 100%; margin-top: 1.25rem; background: var(--green); color: #fffdf5; }
.primary span[aria-hidden] { font-size: 1.35rem; line-height: 1; }
.primary:disabled { opacity: .6; cursor: wait; }
.secondary { justify-content: center; margin-top: .5rem; color: var(--green); }
@media (hover: hover) {
  .primary:hover { background: #263d31; }
  .secondary:hover, .rounds a:hover { background: #eae7db; }
}
.notice, .match { display: flex; align-items: flex-start; gap: .72rem; color: var(--green); }
.notice { margin-top: 1.1rem; padding: 1rem; border-radius: .8rem; background: var(--green-wash); }
.match-mark { position: relative; flex: 0 0 1.6rem; height: 1.25rem; margin-top: .17rem; }
.match-mark::before, .match-mark::after {
  content: "";
  position: absolute;
  top: .1rem;
  width: .88rem;
  height: .88rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.match-mark::before { left: 0; }
.match-mark::after { right: 0; }
.history { margin-top: 2.1rem; }
.empty { margin-top: .7rem; }
ul { padding: 0; list-style: none; }
.rounds { margin-top: 1rem; border-top: 1px solid var(--line); }
.rounds:empty { border: 0; }
.rounds li { border-bottom: 1px solid var(--line); }
.rounds a { padding-inline: .5rem; color: var(--ink); }
.rounds a span[aria-hidden] { color: var(--green); }
.progress-labels, .field-label, .stats-heading, .answer-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .6rem;
}
.progress-labels { color: var(--muted); font-size: .94rem; font-variant-numeric: tabular-nums; }
.round-label { font-weight: 700; color: var(--green); }
.steps { display: flex; gap: .3rem; margin-top: .65rem; }
.steps i { flex: 1; height: .28rem; border-radius: 2px; background: #e7e3d6; }
.steps .filled { background: #6a8067; }
.word { margin: clamp(2.1rem, 8vh, 4.6rem) 0; font-size: clamp(2.8rem, 11vw, 4rem); }
.field-label span, .subtle, .total, .answer-count { font-size: .9rem; color: var(--muted); }
.result-summary { margin: 0 .1rem 1.4rem; }
.result-title { margin-top: .25rem; }
.results { display: grid; gap: 1.2rem; }
.result { padding: clamp(1.2rem, 4.8vw, 1.8rem); }
.result h2 { margin-bottom: 1.25rem; }
.your-response { display: grid; justify-items: start; gap: .25rem; }
.answer-line { max-width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .55rem; }
.your-answer { max-width: 100%; font-size: 1.25rem; line-height: 1.25; }
.on-target { padding: .06rem .5rem; border-radius: 1rem; background: var(--green); color: var(--paper); font-size: .8rem; font-weight: 650; }
.badge {
  display: inline-block;
  margin-top: .25rem;
  padding: .24rem .65rem;
  border-radius: 1rem;
  font-size: .88rem;
  font-weight: 650;
  background: #eee8da;
  color: #5a5039;
}
.badge.familiar { background: #f3e6ce; color: #715629; }
.badge.unexpected { background: var(--green-wash); color: var(--green); }
.match { margin: 1rem 0 1.35rem; padding: .65rem .72rem; background: #eeefe6; border-radius: .6rem; font-size: .96rem; }
.match.rare { background: #f6e5d7; color: var(--rust); }
.rare-title { display: block; }
.stats-heading { flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 1rem; }
h3 { font-size: 1rem; }
.distribution { margin-top: .5rem; }
.distribution li + li { margin-top: .5rem; }
.answer-row { align-items: center; }
.answer-metrics { display: flex; align-items: baseline; gap: .65rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.answer-metrics strong { min-width: 3ch; text-align: right; }
.answer-name { min-width: 0; }
.bar { display: block; height: 3px; border-radius: 4px; background: #8d9f83; }
.actions { margin-top: 1.5rem; }
@media (max-width: 340px) {
  .paper { padding: 1.1rem; }
  .answer-metrics { gap: .35rem; }
}
