:root {
  --paper: #f5efe3;
  --ink: #42352d;
  --muted: #99836c;
  --red: #a53429;
  --gold: #b18b51;
}

body {
  background:
    radial-gradient(ellipse at 50% 12%, #fffdf5b3, transparent 65%),
    radial-gradient(#997a4414 .6px, transparent .8px),
    #f5efe3;
  background-size: auto, 6px 6px, auto;
}

.masthead {
  max-width: 1180px;
  padding: 25px 36px;
  border-color: #ad8e6026;
}

.brand {
  gap: 13px;
  font-size: 22px;
  letter-spacing: 2px;
}

.brand small {
  font-size: 8px;
  letter-spacing: 2.3px;
}

.seal {
  width: 31px;
  height: 35px;
  background: #a53429;
  box-shadow: 2px 3px 0 #a5342910;
}

.header-note {
  font-size: 10px;
  letter-spacing: 2px;
}

main {
  max-width: 1100px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: minmax(0, 650px) minmax(290px, 1fr);
  column-gap: 32px;
  align-items: start;
}

.intro {
  grid-column: 1 / -1;
  padding: 33px 0 19px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 4px;
  color: #a1865b;
}

.eyebrow span {
  width: 32px;
  background: linear-gradient(90deg, transparent, #b69a6c);
}

.eyebrow span:last-child {
  transform: rotate(180deg);
}

.intro h1 {
  font-size: clamp(30px, 3.5vw, 42px);
  letter-spacing: 4px;
  margin: 15px 0 13px;
  font-weight: 500;
}

.intro p {
  color: #9b8974;
  font-size: 11px;
  letter-spacing: 1.5px;
  line-height: 1.8;
}

.ritual-steps {
  display: flex !important;
  grid-column: 1 / -1;
  margin: 0 0 23px;
  gap: 28px;
  font: 11px/1.6 "Songti SC", serif;
  letter-spacing: 1px;
}

.ritual-steps li {
  padding: 7px 0 9px;
  color: #b2a18b;
  border-bottom-width: 1px;
}

.ritual-steps li.active {
  color: #a53429;
  border-bottom-color: #a53429;
}

.ritual-steps li.finished {
  color: #8d7959;
}

.ritual-tip {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 710px;
  margin: 0 auto 24px;
  padding: 14px 43px 14px 48px;
  border: 1px solid #b9996142;
  border-radius: 12px;
  background: #fffaf0b8;
  box-shadow: 0 4px 18px #75562e05;
}

.ritual-tip::before {
  content: "引";
  position: absolute;
  left: 17px;
  top: 17px;
  width: 21px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid #a5342940;
  border-radius: 3px;
  color: #a53429;
  font-size: 13px;
}

.ritual-tip::after {
  display: none;
}

.ritual-tip strong {
  font-size: 15px;
  font-weight: 500;
}

.ritual-tip > span:not(.tip-close) {
  color: #8b7862;
  font-size: 11px;
  line-height: 1.8;
}

.ritual-tip small {
  font-size: 9px;
  color: #b2a18a;
  margin-top: 4px;
}

.tip-close {
  top: 10px;
  right: 14px;
}

.shrine {
  grid-column: 1;
  grid-row: 4;
  width: 100%;
  height: 470px;
  border: 1px solid #c6ab7d59;
  border-radius: 180px 180px 16px 16px / 62px 62px 16px 16px;
  background:
    radial-gradient(ellipse at 50% 32%, #f9df9b26, transparent 58%),
    linear-gradient(180deg, #fbf6eeb3, #f0e6d642);
  box-shadow: inset 0 0 0 5px #fffaf059, 0 14px 40px #68502b05;
  overflow: visible;
}

.shrine::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 29px;
  width: 202px;
  height: 326px;
  transform: translateX(-50%);
  border-radius: 100px 100px 5px 5px;
  border: 1px solid #c2a26d45;
  background: linear-gradient(#f1dfbd45, #f8eddb88);
  box-shadow: inset 0 0 0 7px #fff9ed65;
  pointer-events: none;
}

.scene-top {
  top: 26px;
  left: 34px;
  right: 34px;
  font-size: 8px;
  letter-spacing: 3px;
  color: #b59d76;
}

.shrine .god.god-portrait {
  top: 54px;
  height: 282px;
  width: auto;
  max-width: none;
  border: 3px solid #d0ab61;
  border-radius: 4px;
  box-shadow: 0 0 0 3px #f7e8bd, 0 9px 20px #7b4d2421;
  opacity: 1;
}

.shrine .halo {
  top: 37px;
  width: 320px;
  height: 320px;
  opacity: .6;
  background: radial-gradient(circle, #f0d59a32, transparent 68%);
}

.shrine .couplet {
  top: 84px;
  font-size: 14px;
  letter-spacing: 10px;
  padding: 12px 4px 3px;
  color: #ae936b;
  border-color: #c9b28a70;
}

.shrine .couplet.left {
  left: 29px;
}

.shrine .couplet.right {
  right: 29px;
}

.cloud {
  opacity: .17;
}

.cloud-left {
  left: 88px;
  top: 80px;
}

.cloud-right {
  right: 82px;
  top: 140px;
}

.shrine .jar-area {
  top: 163px;
  width: 135px;
}

.shrine .red-area {
  left: 61px;
}

.shrine .blue-area {
  right: 61px;
}

.shrine .jar:not(.held) {
  transform: scale(.9);
}

.shrine .jar.available .jar-body {
  filter: drop-shadow(0 2px 8px #b785403d);
}

.shrine .jar-body {
  left: 13.5px;
  width: 108px;
  height: 184px;
  border-radius: 0;
  background: url("assets/jar-red-approved-v12.webp") center bottom / contain no-repeat;
  box-shadow: none;
}

.shrine .blue-jar .jar-body {
  background-image: url("assets/jar-blue-approved-v12.webp");
  background-position: center bottom;
}

.shrine .jar::before {
  display: none;
}

.shrine .jar:not(.held):hover {
  filter: drop-shadow(0 5px 7px #77502b26);
}

.jar-caption {
  margin-top: 3px;
  font-family: "Songti SC", serif;
  flex-wrap: wrap;
  font-size: 12px;
  letter-spacing: 1px;
}

.jar-caption span {
  flex-basis: 100%;
  font: 8px/1.8 system-ui, sans-serif;
  letter-spacing: 1px;
  color: #ad9981;
}

.shrine .altar,
.shrine.holding-incense .altar,
.shrine.holding-jar .altar {
  width: 290px;
  height: 93px;
  top: 325px;
  bottom: auto;
  transform: translateX(-50%) scale(.9);
  transform-origin: 50% 100%;
}

.shrine .burner,
.shrine .incense::before {
  position: absolute;
  bottom: 0;
  left: -19px;
  width: 106px;
  height: 64px;
  background: url("assets/bronze-burner-v9.webp") center / contain no-repeat;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.shrine .burner {
  z-index: 0;
  filter: drop-shadow(0 3px 2px #4e391a26);
}

.shrine .burner::before,
.shrine .burner::after {
  display: none;
}

.shrine .incense::before {
  content: "";
  z-index: 3;
  clip-path: inset(20px 0 0);
  pointer-events: none;
}

.shrine .incense-sticks {
  z-index: 1;
  bottom: 39px;
  left: 23px;
  gap: 7px;
}

.shrine .incense-sticks i {
  width: 3px;
  background: linear-gradient(#67574c 3px, #b48f68 4px, #856342 80%, #a7362d 80%);
  box-shadow: 1px 0 #e1c19b88;
}

.shrine .incense-smoke {
  bottom: 91px;
}

.shrine .offering {
  width: 84px;
  height: 79px;
}

.shrine .offering img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 3px 2px #5b402820);
}

.shrine .bundle-art {
  gap: 10px;
}

.shrine .bundle-art i,
.shrine .incense-bundle.carried .bundle-art i {
  width: 3px;
  background: linear-gradient(0deg, #9c3029 0 16%, transparent 16%), linear-gradient(90deg, #765437, #d3b287 55%, #8b6641);
  box-shadow: 1px 0 #f0d6ac99, 2px 2px 3px #63452e20;
}

.shrine .incense-bundle.burning .bundle-art i {
  background: linear-gradient(#b8aba0 2px, #e7783e 2px 4px, #655247 4px 7px, transparent 7px), linear-gradient(0deg, #9c3029 0 16%, transparent 16%), linear-gradient(90deg, #765437, #d3b287 55%, #8b6641);
}

.shrine .incense-bundle.burning .bundle-art i::after {
  width: 4px;
  height: 4px;
  left: -.5px;
  top: 1px;
}

.incense {
  cursor: default;
}

.shrine .table-edge,
.shrine.holding-incense .table-edge,
.shrine.holding-jar .table-edge {
  top: 417px;
  bottom: auto;
  left: 20px;
  right: 20px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(#bd9165, #8d603c 24%, #bb8c5b 40%, #a57546 75%, #7c522f);
  box-shadow: 0 7px 13px #72502b12;
}

.shrine .incense-bundle {
  top: 356px;
  left: 28px;
  bottom: auto;
  height: 62px;
  transform: scale(.86);
  transform-origin: 50% 100%;
}

.shrine:has(.incense-bundle:not(.offered)):not(.holding-incense) {
  height: 560px;
}

.shrine .incense-bundle:not(.carried):not(.offered) {
  top: 453px;
  left: calc(50% - 45px);
  height: 82px;
  transform: none;
}

.shrine .incense-bundle:not(.carried):not(.offered) .bundle-label {
  bottom: 0;
  left: -30px;
  width: 150px;
  font-size: 11px;
}

.shrine .bundle-label {
  font-size: 9px;
  color: #997b53;
}

.shrine.holding-incense {
  height: 620px;
}

.shrine .incense-bundle.carried {
  top: 465px;
  left: calc(50% - 45px);
  transform: none;
  height: 120px;
}

.shrine.holding-jar {
  height: 685px;
}

.shrine.holding-jar .red-area:has(.held),
.shrine.holding-jar .blue-area:has(.held) {
  left: calc(50% - 67.5px);
  right: auto;
  top: 488px;
}

.shrine.holding-jar .jar.held {
  --held-scale: .88;
}

.shrine.holding-jar .falling-stick,
.shrine.holding-jar .falling-stick.blue {
  top: 491px;
}

.shake-tip {
  top: 444px;
  border-radius: 8px;
  padding: 8px 26px 8px 12px;
  border-color: #c4a46e66;
  background: #fffbf2;
  box-shadow: 0 4px 14px #65432308;
  font-size: 11px;
  color: #967444;
}

.draw-panel {
  grid-column: 2;
  grid-row: 4;
  position: sticky;
  top: 24px;
  width: 100%;
  margin: 0;
  padding: 30px 23px 23px;
  border: 1px solid #c3a57175;
  border-radius: 4px 4px 15px 15px;
  background:
    linear-gradient(90deg, #a53429, #c36a45 50%, #a53429) top / 100% 3px no-repeat,
    #fffcf5d4;
  box-shadow: 0 12px 35px #74532b08, inset 0 0 0 5px #fffdf580;
}

main:has(#instruction[hidden]) .shrine,
main:has(#instruction[hidden]) .draw-panel {
  grid-row: 3;
}

.collection-kicker {
  display: block;
  color: #b0956c;
  font-size: 10px;
  letter-spacing: 2px;
}

.collection-intro h2 {
  margin: 11px 0 12px;
  font-size: 29px;
  font-weight: 500;
  letter-spacing: 3px;
  color: #724e36;
}

.collection-intro p {
  color: #a38f77;
  font: 11px/1.9 system-ui, sans-serif;
  margin: 0 0 29px;
}

.panel-head {
  display: block;
  margin-bottom: 17px;
}

.tiny-label {
  font-size: 10px;
  color: #a28b69;
}

#collection-count {
  color: #98754b;
  font-size: 11px;
}

.panel-head #status {
  display: block;
  font-size: 10px;
  margin-top: 7px;
  color: #9a8266;
}

.numbers {
  justify-content: space-between;
  gap: 4px;
  margin: 0 0 25px;
}

.number {
  width: clamp(25px, 2.6vw, 34px);
  height: clamp(36px, 3.8vw, 48px);
  flex-shrink: 0;
  border-radius: 7px 7px 12px 12px;
  border-color: #c3866740;
  background: linear-gradient(#fffdf5, #f5ead9);
  color: #b79371;
  box-shadow: inset 0 0 0 3px #fffaf2;
  font-size: 17px;
}

.number.blue {
  background: linear-gradient(#fffdf8, #e8eff0);
  border-color: #76959f54;
}

.number.collected.red {
  background: linear-gradient(135deg, #bf5040, #a53229 70%);
  box-shadow: inset 0 0 0 3px #f6ce8626, 0 3px 6px #a5342912;
}

.number.collected.blue {
  background: linear-gradient(135deg, #52818e, #2f5b70 70%);
  box-shadow: inset 0 0 0 3px #d9f3ef26, 0 3px 6px #35678512;
}

.plus {
  font-size: 13px;
  color: #bba98e;
}

.actions {
  flex-direction: column;
  gap: 9px;
}

.actions button {
  width: 100%;
  min-height: 46px;
  font-size: 12px;
  border-radius: 7px;
}

.draw-button {
  background: linear-gradient(110deg, #a93429, #b23d2f);
  border-color: #982f26;
  box-shadow: 0 4px 11px #a5342917, inset 0 1px #e0a88438;
  color: #fff0d5;
}

.copy-button {
  background: #f6efe255;
  border-color: #c2a87855;
  color: #967d56;
}

.copy-button:disabled {
  opacity: .45;
}

footer {
  grid-column: 1 / -1;
  padding: 31px 0 28px;
  color: #a08967;
  font-size: 11px;
  letter-spacing: 2px;
}

.footer-mark {
  display: block;
  width: 24px;
  height: 24px;
  line-height: 22px;
  margin: 0 auto 12px;
  border: 1px solid #a5342959;
  border-radius: 50%;
  color: #a534298c;
  font-size: 13px;
  letter-spacing: 0;
}

footer small {
  color: #b4a48c;
  font-size: 9px;
}

@media (max-width: 900px) and (min-width: 681px) {
  main {
    padding: 0 24px;
    column-gap: 20px;
    grid-template-columns: minmax(0, 1fr) 275px;
  }

  .shrine .red-area {
    left: 0;
  }

  .shrine .blue-area {
    right: 0;
  }

  .shrine .jar:not(.held) {
    transform: scale(.68);
  }

  .shrine .couplet {
    display: none;
  }

  .shrine .incense-bundle {
    left: 0;
    top: 350px;
    transform: scale(.68);
  }

  .shrine .altar,
  .shrine.holding-incense .altar,
  .shrine.holding-jar .altar {
    transform: translateX(-50%) scale(.7);
  }
}

@media (max-width: 680px) {
  .masthead {
    padding: 18px 22px;
  }

  .brand {
    font-size: 19px;
    gap: 11px;
  }

  .seal {
    width: 27px;
    height: 31px;
    font-size: 20px;
  }

  .header-note {
    font-size: 9px;
    letter-spacing: 1px;
  }

  main {
    display: flex;
    flex-direction: column;
    padding: 0 16px;
    max-width: 480px;
  }

  main:has(#instruction:not([hidden])) .intro,
  .intro {
    display: block;
    width: 100%;
    padding: 25px 0 13px;
  }

  .eyebrow {
    font-size: 9px;
    letter-spacing: 2px;
    gap: 11px;
  }

  .eyebrow span {
    width: 22px;
  }

  .intro h1 {
    font-size: clamp(24px, 6.7vw, 31px);
    letter-spacing: 1px;
    margin: 11px 0 10px;
  }

  .intro p {
    font-size: 10px;
    letter-spacing: .1px;
  }

  .ritual-steps {
    width: 100%;
    font-size: 9px;
    letter-spacing: 0;
    gap: clamp(12px, 4vw, 24px);
    margin-bottom: 17px;
  }

  .ritual-steps li {
    padding: 4px 0 7px;
    white-space: nowrap;
  }

  .ritual-tip {
    margin: 0 0 15px;
    padding: 11px 31px 10px 42px;
    border-radius: 9px;
  }

  .ritual-tip::before {
    left: 12px;
    top: 14px;
    width: 20px;
    height: 23px;
  }

  .ritual-tip strong {
    font-size: 13px;
  }

  .ritual-tip > span:not(.tip-close) {
    font-size: 10px;
    line-height: 1.7;
  }

  .ritual-tip small {
    font-size: 8px;
  }

  .tip-close {
    right: 11px;
    top: 7px;
    font-size: 20px;
  }

  .shrine,
  .shrine.holding-jar,
  .shrine.holding-incense {
    --scene-height: clamp(320px, calc(100svh - 245px), 365px);
    max-width: 100%;
    height: var(--scene-height);
    flex-shrink: 0;
    border-radius: 120px 120px 12px 12px / 37px 37px 12px 12px;
    scroll-margin-top: 8px;
  }

  .shrine::before {
    top: 20px;
    width: calc(var(--scene-height) * .36);
    height: calc(var(--scene-height) * .65);
    border-radius: 70px 70px 4px 4px;
    box-shadow: inset 0 0 0 5px #fff9ed65;
  }

  .scene-top {
    top: 18px;
    left: 18px;
    right: 18px;
    font-size: 7px;
    letter-spacing: 1px;
  }

  .shrine .god.god-portrait {
    top: 34px;
    height: calc(var(--scene-height) * .56);
    border-width: 2px;
    box-shadow: 0 0 0 2px #f7e8bd, 0 7px 15px #7b4d2417;
  }

  .shrine .halo {
    top: 27px;
    width: calc(var(--scene-height) * .7);
    height: calc(var(--scene-height) * .7);
    opacity: .5;
  }

  .shrine .couplet {
    top: 53px;
    font-size: 10px;
    letter-spacing: 6px;
    padding: 8px 3px 2px;
  }

  .shrine .couplet.left {
    left: 15px;
  }

  .shrine .couplet.right {
    right: 15px;
  }

  .cloud-left {
    left: 49px;
    top: 61px;
  }

  .cloud-right {
    right: 47px;
    top: 104px;
  }

  .shrine .jar-area {
    width: 108px;
    top: calc(var(--scene-height) - 256px);
  }

  .shrine .red-area {
    left: 1px;
  }

  .shrine .blue-area {
    right: 1px;
  }

  .shrine .jar:not(.held) {
    transform: scale(.68);
  }

  .jar-caption {
    font-size: 10px;
    margin-top: 2px;
    gap: 2px 4px;
  }

  .jar-caption span {
    font-size: 7px;
    line-height: 1.6;
    letter-spacing: .5px;
  }

  .shrine .altar,
  .shrine.holding-incense .altar,
  .shrine.holding-jar .altar {
    width: 290px;
    top: calc(var(--scene-height) - 113px);
    transform: translateX(-50%) scale(.72);
  }

  .shrine .incense {
    left: 111px;
  }

  .shrine .offering.fruit {
    left: 6px;
  }

  .shrine .offering.buns {
    right: 6px;
  }

  .shrine .table-edge,
  .shrine.holding-incense .table-edge,
  .shrine.holding-jar .table-edge {
    top: calc(var(--scene-height) - 20px);
    left: 10px;
    right: 10px;
    height: 8px;
  }

  .shrine .incense-bundle {
    top: calc(var(--scene-height) - 66px);
    left: 1px;
    height: 51px;
    transform: scale(.66);
  }

  .shrine .bundle-label {
    font-size: 10px;
    bottom: -1px;
  }

  .shrine:has(.incense-bundle:not(.offered)):not(.holding-incense) {
    height: calc(var(--scene-height) + 100px);
  }

  .shrine .incense-bundle:not(.carried):not(.offered) {
    top: calc(var(--scene-height) + 8px);
    left: calc(50% - 45px);
    height: 76px;
    transform: none;
  }

  .shrine.holding-incense {
    height: calc(var(--scene-height) + 150px);
  }

  .shrine .incense-bundle.carried {
    top: calc(var(--scene-height) + 20px);
    left: calc(50% - 45px);
    height: 110px;
    transform: none;
  }

  .shrine .incense-bundle.carried .bundle-label {
    font-size: 11px;
  }

  .shrine.holding-jar {
    height: calc(var(--scene-height) + 210px);
  }

  .shrine.holding-jar .red-area:has(.held),
  .shrine.holding-jar .blue-area:has(.held) {
    top: calc(var(--scene-height) + 33px);
    left: calc(50% - 67.5px);
    right: auto;
    width: 135px;
  }

  .shrine.holding-jar .jar.held {
    --held-scale: .8;
  }

  .shrine.holding-jar .falling-stick,
  .shrine.holding-jar .falling-stick.blue {
    top: calc(var(--scene-height) + 38px);
  }

  .shake-tip {
    top: calc(var(--scene-height) + 4px);
    width: 275px;
    max-width: calc(100% - 16px);
    padding: 6px 25px 6px 10px;
    font-size: 10px;
  }

  .draw-panel {
    position: relative;
    top: auto;
    margin-top: 18px;
    padding: 22px 19px 18px;
    border-radius: 4px 4px 12px 12px;
  }

  .collection-intro {
    padding-bottom: 16px;
    border-bottom: 1px solid #c4aa7a2b;
    margin-bottom: 15px;
  }

  .collection-kicker {
    font-size: 8px;
    letter-spacing: 1.5px;
  }

  .collection-intro h2 {
    font-size: 22px;
    letter-spacing: 2px;
    margin: 7px 0 0;
  }

  .collection-intro p {
    display: none;
  }

  .panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
  }

  .panel-head #status {
    margin: 0;
    font-size: 9px;
    text-align: right;
    max-width: 62%;
    line-height: 1.6;
  }

  .tiny-label {
    font-size: 9px;
    white-space: nowrap;
  }

  #collection-count {
    font-size: 10px;
    margin-left: 3px;
  }

  .numbers {
    gap: 4px;
    margin-bottom: 19px;
  }

  .number {
    width: clamp(26px, 8vw, 35px);
    height: 43px;
    font-size: 17px;
    border-radius: 6px 6px 10px 10px;
  }

  .actions {
    flex-direction: row;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .actions .draw-button {
    flex-basis: auto;
  }

  .actions .copy-button {
    width: auto;
    min-width: 107px;
    padding: 0 12px;
  }

  .actions button {
    min-height: 45px;
    font-size: 11px;
    letter-spacing: .4px;
  }

  footer {
    width: 100%;
    padding: 25px 0 27px;
    font-size: 10px;
    letter-spacing: 1.5px;
  }

  .footer-mark {
    margin-bottom: 10px;
  }

  footer small {
    font-size: 8px;
    letter-spacing: .5px;
  }
}

@media (max-width: 359px) {
  main {
    padding: 0 12px;
  }

  .masthead {
    padding: 16px 17px;
  }

  .header-note {
    font-size: 8px;
  }

  .shrine .red-area {
    left: -8px;
  }

  .shrine .blue-area {
    right: -8px;
  }

  .shrine .jar:not(.held) {
    transform: scale(.61);
  }

  .shrine .jar-area:not(:has(.held)) {
    top: calc(var(--scene-height) - 306px);
  }

  .draw-panel {
    padding-left: 15px;
    padding-right: 15px;
  }

  .number {
    width: 26px;
    font-size: 15px;
  }
}
