:root {
  color-scheme: light;
  --paper: #f7f7f1;
  --ink: #1e382e;
  --green: #355b45;
  --muted: #506253;
  --rule: #ccd8cb;
  --soft: #e6eee2;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.65 "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
main { max-width: 735px; margin: 0 auto; padding: clamp(28px, 6vw, 64px) clamp(18px, 4vw, 34px) 52px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 5vw, 41px); line-height: 1.32; }
h2 { font-size: clamp(22px, 3.3vw, 29px); line-height: 1.5; }
h3 { font-size: 18px; }
p + p { margin-top: 7px; }
.intro-info { margin: 12px 0 22px; }
.intro-info, .hint { font-size: 15px; color: var(--muted); }
.card { margin: 16px 0; padding: clamp(16px, 4vw, 24px); border: 1px solid var(--rule); border-radius: 14px; background: white; }
fieldset { padding: 0; border: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin: 0 0 7px; font-weight: 650; }
button, input, textarea { font: inherit; }
button {
  min-height: 44px; padding: 10px 18px; cursor: pointer; line-height: 1.5;
  background: white; color: var(--green); border: 1px solid var(--rule); border-radius: 9px;
}
button.primary { color: white; background: var(--green); border-color: var(--green); font-weight: 650; }
button:disabled { opacity: .44; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #749264; outline-offset: 3px; }
.bar, .round-options { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bar { margin: 21px 0 8px; justify-content: space-between; }
.round-options { gap: 18px; margin: 0 0 16px; }
.round-options label, .checkline { cursor: pointer; }
.checkline { display: block; margin: 17px 0 5px; }
input[type=radio], input[type=checkbox] { width: 17px; height: 17px; vertical-align: -2px; margin: 0 6px 0 0; accent-color: var(--green); }
.metric, .stat strong, #count { font-variant-numeric: tabular-nums; }
.error { color: #8a3b2a; margin: 10px 0; }
.meterline { text-align: right; color: var(--muted); margin: 0 0 8px; font-size: 14px; }
progress { display: block; width: 100%; height: 7px; border: 0; border-radius: 8px; overflow: hidden; background: #e1e7dd; color: var(--green); appearance: none; }
progress::-webkit-progress-bar { background: #e1e7dd; }
progress::-webkit-progress-value { background: var(--green); }
progress::-moz-progress-bar { background: var(--green); }
#question-title { margin: 23px 0 17px; overflow-wrap: anywhere; }
#options { display: grid; gap: 9px; }
.choice { display: flex; gap: 11px; align-items: baseline; padding: 12px 14px; cursor: pointer; background: white; border: 1px solid var(--rule); border-radius: 10px; }
button.choice { width: 100%; color: var(--ink); text-align: left; touch-action: manipulation; }
button.choice:active { background: var(--soft); border-color: var(--green); }
button.choice:focus-visible { outline: 3px solid #749264; outline-offset: 2px; }
.choice.selected { background: #eef4e8; border-color: var(--green); }
.choice:focus-within { outline: 2px solid #78956e; outline-offset: 1px; }
.choice input { flex: none; align-self: center; margin: 0; }
.letter, .tag, .rid, .metric { font-size: 14px; color: var(--muted); }
.letter { flex: none; font-weight: 650; }
.feedback-prompt { margin: 6px 0; }
.quote { border-left: 3px solid #849d79; padding: 2px 0 2px 12px; margin: 9px 0 13px; }
.feedback-label { font-size: 14px; color: var(--muted); }
textarea { display: block; width: 100%; min-height: 78px; padding: 8px; border: 1px solid var(--rule); border-radius: 8px; resize: vertical; }
.lead { background: var(--soft); }
.tag { font-weight: 650; margin-bottom: 7px; }
.member, .stat { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 5px 12px; }
.member strong { font-size: 23px; }
.lead .member strong { font-size: clamp(27px, 4vw, 37px); }
.member:not(:first-of-type) { margin-top: 9px; }
.rid { margin-right: 8px; font-weight: 600; }
.blurb { margin-top: 3px; }
.export-box { border-top: 1px solid var(--rule); margin-top: 24px; padding-top: 17px; }
#download { margin: 8px 0; }
#request-status { margin-top: 9px; }
.closing-note { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 14px; }
@media (max-width: 430px) {
  .member strong { width: 100%; }
  .card { padding: 15px; }
  .choice { padding: 11px 10px; }
}

/* The main role is a printed illustration followed by its original reading. */
#result h1 { margin-bottom: 20px; }
#result .lead { background: #fbfcf6; border-color: #bfccba; }
#result .tag { letter-spacing: .06em; color: #466343; }
.frog + .frog { border-top: 1px solid var(--rule); margin-top: 20px; padding-top: 19px; }
.frog:focus { outline: none; }
.role-art {
  display: block; width: 100%; max-height: 480px; object-fit: contain;
  margin: 16px auto 20px; border-radius: 9px; background: white;
}
.result-poem {
  margin: 12px 0 18px; padding: 8px 0 8px 17px; border-left: 3px solid #96ab88;
  white-space: pre-line; font-size: 17px; line-height: 1.85;
}
.result-analysis { color: #354a3c; max-width: 39em; }
.result-analysis p + p { margin-top: 10px; }
.teaser { font-size: 18px; line-height: 1.75; margin: 2px 0 13px; }
.lead .teaser { font: 500 clamp(20px, 3.4vw, 27px)/1.65 "Songti SC", "SimSun", serif; }
.reveal-button { color: var(--green); border-color: #8caa83; background: #f4f8f0; }
.result-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 12px 0 7px; }
.button-link {
  display: inline-flex; min-height: 44px; align-items: center; padding: 9px 15px; text-decoration: none;
  color: var(--green); background: white; border: 1px solid var(--rule); border-radius: 9px;
}
.button-link:focus-visible { outline: 3px solid #749264; outline-offset: 3px; }
#card-preview { display: block; width: min(100%, 385px); height: auto; margin-top: 16px; border: 1px solid var(--rule); }
.share-panel { margin: 14px 0; }
.share-panel label { font-size: 14px; color: var(--muted); }
#share-text { min-height: 65px; margin: 3px 0 8px; }
.replay-box { margin-top: 17px; }
.confirm-box { margin-top: 13px; background: #f1f2e8; border: 1px solid var(--rule); border-radius: 11px; padding: 15px; }
@media (max-width: 430px) {
  .role-art { max-height: 340px; }
  .result-tools > * { max-width: 100%; }
}
