:root {
  color-scheme: light;
  --paper: #f5f0e6;
  --ink: #292d28;
  --muted: #635e54;
  --rule: #cec5b4;
  --red: #963a2b;
  --serif: "STIX Two Text", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", SimSun, serif;
  font: 16px/1.65 "DM Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 75% 20%, #fffdf490, transparent 52%),
    repeating-linear-gradient(0deg, transparent 0 4px, #ac987307 4px 5px);
}
main { max-width: 880px; margin: auto; padding: 30px 36px 60px; }
a { color: inherit; text-underline-offset: .24em; }
.masthead, .mark, .intro, .actions { display: flex; align-items: center; }
.masthead { justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--ink); }
.mark { gap: .65em; font: 600 1.2rem var(--serif); letter-spacing: .12em; }
.mark span { display: grid; place-items: center; width: 28px; height: 28px; background: var(--red); color: #fffaf0; font: 23px/1 serif; }
.masthead a, small, .source { font-size: .85rem; color: var(--muted); }
.intro { justify-content: space-between; gap: 25px; padding: 50px 6px 38px 0; }
h1, h2, h3 { font-family: var(--serif); margin: 0; }
h1 { font-size: clamp(3.1rem, 7vw, 5rem); letter-spacing: .07em; line-height: 1.22; }
.intro p { max-width: 26em; color: var(--muted); margin: 16px 0 0; }
.coins { position: relative; flex: 0 0 178px; height: 112px; }
.coin {
  position: absolute; width: 78px; height: 78px; border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 2px, #51371926 3px, transparent 4px 6px),
    conic-gradient(from 25deg, #887047, #c0a473, #776440, #b09560, #8a734c, #887047);
  border: 2px solid #746045;
  box-shadow: inset 0 0 0 2px #c1a87a, inset 0 0 0 5px #79623f, 1px 3px 0 #61533b, 3px 6px 10px #41372230;
}
.coin::before, .coin::after { content: ""; position: absolute; }
.coin::before { inset: 8px; border: 1px dashed #705937; border-radius: 50%; }
.coin::after { inset: 35%; background: #eee7d8; border: 3px ridge #8b7857; box-shadow: inset 1px 2px 3px #513e2a66; }
.coin:nth-child(1) { left: 0; top: 32px; transform: rotate(-17deg); }
.coin:nth-child(2) { right: 0; top: 30px; transform: rotate(25deg); }
.coin:nth-child(3) { left: 51px; top: 0; transform: rotate(7deg); }
.sheet { padding: 26px 30px; background: #fffcf3; border: 1px solid var(--rule); border-top: 3px solid var(--ink); }
label { font-weight: 650; }
label small { margin-left: 8px; font-weight: 400; }
input { display: block; width: 100%; font: inherit; color: var(--ink); padding: 11px 13px; border: 1px solid #aea493; background: #fffef9; border-radius: 2px; margin: 10px 0 19px; }
input::placeholder { color: #716c63; }
.actions { gap: 12px 24px; flex-wrap: wrap; }
button { border: 0; border-radius: 2px; background: var(--red); color: white; font: 650 1rem/1.5 var(--serif); letter-spacing: .13em; padding: 11px 32px; cursor: pointer; }
button:hover { background: #782d22; }
button:disabled { opacity: .65; cursor: progress; }
:focus-visible { outline: 3px solid #816730; outline-offset: 3px; }
.source a { margin-left: .3em; }
#status { color: var(--red); }
#status:empty { display: none; }
#result { margin-top: 26px; }
.result-heading h2 { font-size: clamp(1.45rem, 4vw, 2.15rem); }
#reading-question { overflow-wrap: anywhere; margin: 4px 0; }
#moving { color: var(--red); margin: 5px 0 14px; }
.reading { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.reading th, .reading td { text-align: center; padding: 7px 2px; }
.reading thead { border-block: 1px solid var(--rule); font-size: .85rem; color: var(--muted); }
.reading td, .reading tbody th { border-bottom: 1px solid #e7dfcf; }
.reading th:first-child { text-align: left; }
.bar { display: inline-block; vertical-align: middle; width: clamp(48px, 12vw, 106px); height: 10px; background: currentColor; }
.bar.yin { background: linear-gradient(to right, currentColor 43%, transparent 43% 57%, currentColor 57%); }
.moving { color: var(--red); }
.change { font-size: .8rem; }
#meanings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; padding: 22px 0 12px; }
#meanings h3 { font-size: 1.15rem; }
#meanings p { margin: 4px 0 0; }
details { border-top: 1px solid var(--rule); }
summary { cursor: pointer; font-weight: 600; }
.record { padding-top: 12px; color: var(--muted); }
.record ol { padding-left: 1.8em; margin-bottom: 0; }
.method { margin-top: 27px; padding: 16px 0; }
.method p { max-width: 45em; }
.key { display: flex; flex-wrap: wrap; gap: 14px 30px; }
.key dt { font-weight: 650; }
.key dd { margin: 0; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 570px) {
  main { padding: 20px 16px 40px; }
  .intro { padding: 31px 0 26px; gap: 10px; align-items: flex-start; }
  h1 { font-size: clamp(2.35rem, 9vw, 3.1rem); }
  .intro p { margin-top: 12px; }
  .coins { flex-basis: 80px; height: 72px; }
  .coin { width: 44px; height: 44px; }
  .coin:nth-child(1) { top: 27px; }
  .coin:nth-child(2) { top: 24px; }
  .coin:nth-child(3) { top: 0; left: 18px; }
  .sheet { padding: 19px 15px; }
}
