:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #36291f;
  background: #f6f1e7;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 0%, #fdf9ef 0, #f6f1e7 65%);
}
main { width: min(100%, 540px); margin: 0 auto; padding: 32px 22px 34px; }
.site-heading { text-align: center; margin-bottom: 23px; }
.brand { color: #8a513a; font-size: .78rem; letter-spacing: .3em; }
h1, h2, .message-heading label { font-family: "Songti SC", "Noto Serif CJK SC", "SimSun", serif; }
h1 { margin: 6px 0 0; font-size: clamp(1.85rem, 6vw, 2.35rem); font-weight: 600; letter-spacing: .12em; }
fieldset { border: 0; min-inline-size: 0; margin: 0; padding: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.deity-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.deity { position: relative; min-width: 0; cursor: pointer; }
.deity input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.deity-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 1px 9px;
  border: 1px solid #ded3c1;
  border-radius: 11px;
  background: #fcf8ef;
  color: #514435;
  font-size: clamp(.72rem, 3.25vw, .87rem);
  white-space: nowrap;
}
.deity input:checked + .deity-card { border-color: #a86649; box-shadow: inset 0 0 0 1px #a86649; background: #f5e8d8; color: #6c3121; }
.deity input:disabled + .deity-card { cursor: default; }
.deity input:focus-visible + .deity-card, button:focus-visible, a:focus-visible { outline: 2px solid #895538; outline-offset: 3px; }
.portrait { display: block; width: min(100%, 84px); aspect-ratio: 1; background: url("./portraits.webp") no-repeat 0 0 / 200% 200%; }
.guanyin { background-position: 100% 0; }
.dizang { background-position: 0 100%; }
.mile { background-position: 100% 100%; }
.wish-paper { margin-top: 19px; padding: 15px; background: #fffdf7; border: 1px solid #e4d8c5; border-radius: 13px; box-shadow: 0 6px 18px #6043200c; }
.message-heading { display: flex; justify-content: space-between; align-items: center; gap: 7px; margin-bottom: 10px; }
.message-heading label { font-size: 1.14rem; font-weight: 600; }
.counter { color: #776653; font-size: .75rem; flex-shrink: 0; font-variant-numeric: tabular-nums; }
textarea, input[name="name"] { font: inherit; font-size: 1rem; color: #36291f; }
textarea {
  width: 100%;
  min-height: 116px;
  padding: 10px 11px;
  resize: vertical;
  border-radius: 7px;
  border: 1px solid #e1d5c2;
  background: #fbf7ee;
  line-height: 1.65;
}
textarea:focus-visible, input[name="name"]:focus-visible { outline: 2px solid #b68763; outline-offset: 1px; }
textarea::placeholder, input[name="name"]::placeholder { color: #756653; }
.name-row { display: flex; align-items: center; gap: 10px; margin-top: 9px; font-size: .85rem; }
.name-row label { flex-shrink: 0; }
.name-row input { min-width: 0; min-height: 40px; flex: 1; padding: 0 8px; border: 1px solid #eadfce; border-radius: 6px; background: #fffdf7; }
.privacy { margin: 12px 1px 0; font-size: .78rem; color: #776653; }
.status { margin: 8px 1px; color: #8c3f2a; font-size: .85rem; line-height: 1.5; }
.status:empty { margin: 0; }
.primary {
  width: 100%;
  min-height: 46px;
  display: inline-grid;
  place-items: center;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #813f2b;
  color: #fff9eb;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
#send-wish { margin-top: 14px; }
.primary:disabled { background: #d8cbb8; color: #584c3d; cursor: default; }
@media (max-width: 380px) {
  main { padding-inline: 14px; }
  .deity-row { gap: 5px; }
  .wish-paper { padding: 12px; }
}
