:root {
  color-scheme: dark;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  background: #0b0706;
  color: #f6e6c8;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body { background: #0b0706; }

button { font: inherit; }

.temple {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100svh;
  place-items: end center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(5, 3, 3, .04) 34%, rgba(6, 3, 2, .58) 74%, rgba(6, 3, 2, .94) 100%),
    url("/assets/guandi-temple.png") center 38% / cover no-repeat;
}

.temple__shade,
.temple__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.temple__shade {
  background: radial-gradient(circle at 50% 37%, transparent 10%, rgba(4, 2, 2, .14) 60%, rgba(2, 1, 1, .58) 100%);
}

.temple__glow {
  opacity: .5;
  background: radial-gradient(circle at 50% 58%, rgba(201, 89, 31, .28), transparent 28%);
  animation: breathe 4.8s ease-in-out infinite;
}

.seal {
  position: absolute;
  top: clamp(20px, 4vw, 52px);
  right: clamp(20px, 5vw, 72px);
  display: grid;
  width: 54px;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid rgba(255, 218, 157, .7);
  color: #ffe2aa;
  background: rgba(93, 16, 12, .72);
  box-shadow: 0 0 28px rgba(198, 52, 25, .24), inset 0 0 0 4px rgba(255, 225, 173, .08);
  font-size: 31px;
  line-height: 1;
  transform: rotate(2deg);
}

.offering {
  width: min(680px, calc(100% - 32px));
  margin: 0 auto clamp(54px, 7vh, 86px);
  padding: 22px 24px 18px;
  text-align: center;
  text-shadow: 0 2px 16px #000, 0 1px 2px #000;
}

.eyebrow {
  margin: 0 0 8px;
  color: #dbb575;
  font-size: clamp(13px, 1.4vw, 17px);
  letter-spacing: .48em;
  text-indent: .48em;
}

h1 {
  margin: 0;
  color: #fff0cf;
  font-size: clamp(36px, 5.2vw, 68px);
  font-weight: 700;
  letter-spacing: .11em;
  text-indent: .11em;
}

.blessing {
  margin: 12px 0 18px;
  color: rgba(249, 227, 190, .82);
  font-size: clamp(14px, 1.7vw, 18px);
  letter-spacing: .09em;
}

.pray-button {
  position: relative;
  min-width: min(290px, 90%);
  padding: 13px 28px 11px;
  border: 1px solid rgba(255, 221, 163, .65);
  border-radius: 3px;
  color: #fff0cf;
  background: linear-gradient(180deg, rgba(158, 37, 26, .94), rgba(92, 14, 12, .96));
  box-shadow: 0 10px 38px rgba(0, 0, 0, .48), inset 0 0 0 3px rgba(255, 221, 163, .08);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.pray-button:hover {
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow: 0 14px 44px rgba(0, 0, 0, .55), 0 0 28px rgba(205, 67, 32, .2);
}

.pray-button:focus-visible { outline: 3px solid #f4c778; outline-offset: 4px; }
.pray-button:active { transform: translateY(1px) scale(.99); }
.pray-button__main, .pray-button__hint { display: block; }
.pray-button__main { font-size: 20px; letter-spacing: .23em; text-indent: .23em; }
.pray-button__hint { margin-top: 3px; color: rgba(255, 231, 190, .68); font-family: system-ui, sans-serif; font-size: 11px; letter-spacing: .08em; }

.wish {
  min-height: 1.6em;
  margin: 13px 0 0;
  color: rgba(244, 216, 171, .72);
  font-size: 13px;
  letter-spacing: .08em;
  transition: color .3s ease, transform .3s ease;
}

.incense {
  position: relative;
  width: 72px;
  height: 36px;
  margin: 0 auto 8px;
  opacity: .26;
  transition: opacity .5s ease;
}

.incense i {
  position: absolute;
  bottom: 0;
  width: 2px;
  height: 25px;
  background: linear-gradient(#e9783e 0 8%, #8b321d 9% 100%);
}

.incense i:nth-child(1) { left: 27px; transform: rotate(-2deg); }
.incense i:nth-child(2) { left: 35px; }
.incense i:nth-child(3) { left: 43px; transform: rotate(2deg); }

.incense span {
  position: absolute;
  left: 34px;
  bottom: 23px;
  width: 9px;
  height: 24px;
  border-left: 2px solid rgba(235, 220, 198, .7);
  border-radius: 50%;
  opacity: 0;
}

.incense span:nth-of-type(2) { animation-delay: .55s; }
.incense span:nth-of-type(3) { animation-delay: 1.1s; }

.is-praying .incense { opacity: 1; }
.is-praying .incense span { animation: smoke 2.2s ease-out infinite; }
.is-praying .wish { color: #ffe4ae; transform: translateY(-2px); }
.is-praying .temple__glow { opacity: .9; }

footer {
  position: absolute;
  right: 18px;
  bottom: 14px;
  left: 18px;
  color: rgba(231, 205, 164, .44);
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: .08em;
  text-align: center;
}

@keyframes breathe { 50% { opacity: .72; transform: scale(1.04); } }
@keyframes smoke {
  0% { opacity: 0; transform: translate(0, 0) scale(.7); }
  22% { opacity: .46; }
  100% { opacity: 0; transform: translate(10px, -31px) scale(1.4); }
}

@media (max-width: 680px) {
  .temple { background-position: 50% 26%; }
  .offering { margin-bottom: 48px; padding-inline: 8px; }
  .seal { width: 45px; font-size: 26px; }
  .blessing { line-height: 1.7; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
