:root {
  color-scheme: dark;
  color: #fff0d2;
  background: #17201d;
  font-family: "PingFang TC", "Microsoft JhengHei", sans-serif;
  --gold: #e6b875;
  --paper: #fff0d2;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(ellipse at 50% 0, #3b3428 0, #202823 47%, #131b19 86%);
}
main { width: min(100% - 24px, 680px); margin-inline: auto; padding: 24px 0 22px; }
header { text-align: center; }
.kicker { color: #e9be80; margin: 0 0 6px; font-size: .84rem; letter-spacing: .26em; }
h1, h2, .plaque, .seal { font-family: "Songti TC", "PMingLiU", serif; }
h1 {
  margin: 0;
  font-size: clamp(2.35rem, 9vw, 4.1rem);
  line-height: 1.15;
  letter-spacing: .095em;
  color: #ffe2a6;
  text-shadow: 0 3px #5c3027, 0 0 28px #b9784559;
}
h2 { font-size: 1.12rem; margin: 0 0 8px; }
.wish-picker { margin: 20px 0 25px; }
.wishes { display: flex; flex-wrap: wrap; gap: 7px; }
button {
  font: inherit;
  cursor: pointer;
  min-height: 44px;
  color: inherit;
  border: 1px solid #876444;
  border-radius: 8px;
  background: #332b24;
}
button:focus-visible { outline: 3px solid #ffe6a4; outline-offset: 3px; }
button:disabled { cursor: wait; }
.wish { flex: 1 0 auto; padding: 6px 9px; font-size: .91rem; }
.wish[aria-pressed="true"] { background: #813524; border-color: #f0b66c; box-shadow: inset 0 0 0 1px #bd754a; }
.wish span { color: #f7c980; padding-inline-end: .33em; }
.temple { position: relative; isolation: isolate; }
.roof {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: start;
  height: clamp(37px, 8vw, 58px);
  padding: 0 2%;
  border-bottom: 5px double #e1a66b;
  border-radius: 44% 44% 4% 4% / 100% 100% 12% 12%;
  background: repeating-linear-gradient(90deg, #231f1dcc 0 3px, transparent 4px 11px),
    linear-gradient(#b17c54 0 8%, #58453b 10%, #332d2b 52%, #893f30 85%);
  box-shadow: 0 5px 11px #180d0bba;
}
.roof span {
  color: #edbd78;
  font: clamp(1.6rem, 6vw, 2.6rem) serif;
  text-shadow: 0 2px #763729;
  transform: translateY(20%) rotate(-17deg);
}
.roof span+span { transform: translateY(20%) scaleX(-1) rotate(-17deg); }
.hall {
  position: relative;
  isolation: isolate;
  overflow: clip;
  margin-inline: 3%;
  padding: 17px 12% 22px;
  border: 1px solid #a67147;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: radial-gradient(ellipse at 50% 54%, #80462e, #4d2a23 56%, #291b1a);
  box-shadow: 0 15px 46px #0f1210;
}
.pillar {
  position: absolute;
  width: 7.3%;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(0deg, transparent 0 44px, #eaaa6e38 45px 46px),
    linear-gradient(90deg,#55221e,#9b3c30 37%,#763021);
  border-inline: 2px solid #db9a61;
  box-shadow: 0 0 14px #211410;
}
.pillar.left { left: 0; } .pillar.right { right: 0; }
.floor {
  position: absolute;
  z-index: -1;
  inset: auto 0 0;
  height: 31px;
  background: repeating-linear-gradient(90deg,#4c2b24 0 1px, transparent 1px 12%), linear-gradient(#6a4231,#3b2823);
  border-top: 2px solid #a46e47;
}
.plaque {
  position: relative;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 13px;
  padding: 5px 13px;
  color: #ffd891;
  font-weight: 700;
  font-size: clamp(.83rem, 3.3vw, 1.1rem);
  border: 3px double #dca070;
  background: #37221d;
  border-radius: 7px;
  box-shadow: 0 3px 8px #221510aa;
}
.lantern {
  position: absolute;
  z-index: 3;
  top: 13px;
  display: grid;
  place-items: center;
  width: clamp(23px, 6.5vw, 43px);
  aspect-ratio: 1.04;
  border-radius: 43%;
  border-block: 3px solid #e1a664;
  color: #ffe0a3;
  font-family: "Songti TC", serif;
  font-size: clamp(.77rem, 3vw, 1.2rem);
  background: repeating-linear-gradient(90deg,#94413033 0 1px,transparent 1px 5px),
    radial-gradient(#db7e45,#a1372e);
  box-shadow: 0 0 19px #ffd58f5e;
  pointer-events: none;
}
.lantern.left { left: 4%; } .lantern.right { right: 4%; }
.lantern::before, .lantern::after {
  content: "";
  position: absolute;
  width: 2px;
  left: calc(50% - 1px);
  background: #c58a51;
}
.lantern::before { height: 16px; bottom: 100%; }
.lantern::after { height: 11px; top: 100%; border-bottom: 3px solid #f2b65f; }
.lamp-wall {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  gap: clamp(3px,1.3vw,9px);
  padding: clamp(5px,1.7vw,12px);
  background: linear-gradient(135deg,#291a19,#422621);
  border: 3px double #ac7a50;
  border-radius: 10px;
}
.lamp {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 52px;
  aspect-ratio: .78;
  border: 1px solid #a37352;
  border-radius: 48% 48% 6px 6px / 32% 32% 6px 6px;
  padding: 0;
  background: radial-gradient(ellipse at 50% 65%, #714539, #37221e 76%);
  box-shadow: inset 0 -3px #200f10aa;
}
.lamp:hover:not([aria-disabled="true"]) { border-color: #f8c880; }
.wick {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: end;
  height: 66%;
  width: 71%;
  z-index: 1;
}
.wick::before {
  content: "";
  display: block;
  width: 36%;
  height: 55%;
  border-radius: 72% 38% 58% 46%;
  transform: rotate(12deg) scale(.55);
  background: radial-gradient(at 40% 77%,#603c28,#a06a4a);
}
.wick::after {
  content: "";
  width: 90%;
  height: 22%;
  border-radius: 5px 5px 42% 42%;
  background: linear-gradient(#bd8a56,#69412d);
  border-top: 2px solid #ddb172;
}
.lamp::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 63%,#ffc16c91, #de906438 50%,transparent 80%);
  opacity: 0;
  pointer-events: none;
}
.lamp.lit::after { opacity: 1; }
.lamp.lit .wick::before {
  transform: rotate(12deg) scale(1);
  background: radial-gradient(at 45% 74%,#fff3b9,#ffbd56 63%,#e97d39);
  box-shadow: 0 0 15px 2px #ffac58a8;
}
.lighting .lamp.newly-lit::after { animation: light-lamp 3.4s ease-out both; }
.lighting .lamp.newly-lit .wick::before { animation: light-wick 2.5s ease-out both; }
.lighting .lamp:not(.newly-lit) { animation: warm-wall 4s 1.3s ease-in-out; }
.spark {
  position: absolute;
  left: 50%;
  top: 55%;
  z-index: 2;
  opacity: 0;
  color: #ffdf90;
  text-shadow: 0 0 7px #e7873a;
  pointer-events: none;
  font-style: normal;
}
.lighting .newly-lit .spark { animation: float-gold 3.7s var(--delay) ease-out both; }
@keyframes light-lamp { from { opacity: 0; } to { opacity: 1; } }
@keyframes light-wick {
  from { opacity: .2; transform: rotate(12deg) scale(.35); filter: saturate(.3); }
  to { opacity: 1; transform: rotate(12deg) scale(1); filter: none; }
}
@keyframes warm-wall {
  0%, 100% { filter: brightness(1); }
  43% { filter: brightness(1.16); }
  68% { filter: brightness(1.06); }
}
@keyframes float-gold {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.45); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift), -55px) scale(1.12); }
}
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin: 10px 0; }
.toolbar p { margin: 0; font-size: .92rem; color: #f3dbb4; }
#sound { flex: 0 0 auto; padding: 4px 9px; font-size: .88rem; }
#sound span { color: #ffd78d; padding-left: 2px; }
.notice { color: #e3caaa; text-align: right; font-size: .75rem; margin: 0; }
dialog {
  width: min(100% - 26px, 465px);
  max-height: calc(100% - 26px);
  padding: 11px;
  border: 1px solid #bb9262;
  border-radius: 14px;
  background: #34231e;
  color: var(--paper);
}
dialog::backdrop { background: #17110edb; }
dialog[open] { animation: unfold .48s ease-out both; }
@keyframes unfold { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
.blessing {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 20px 19px;
  text-align: center;
  border: 5px double #b67747;
  color: #542821;
  background: radial-gradient(ellipse at center,#fff0cd,#f2d5a5);
  border-radius: 8px;
}
.blessing .kicker { color: #885236; }
.blessing h2 { font-size: clamp(1.4rem, 6vw, 2.15rem); margin: 0; }
.blessing .notice { color: #734839; }
.seal { color: #ffe1a9; background: #872f26; border: 3px double #e4a265; border-radius: 5px; padding: 3px 9px; font-size: 1.55rem; margin: 0; transform: rotate(-6deg); }
#card-message { font-size: 1.12rem; font-weight: 600; line-height: 1.55; margin: 0; min-height: 3em; display: grid; place-items: center; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.card-actions button:first-child { background: #84412d; }
#share-status { margin: 6px 0 0; text-align: center; font-size: .88rem; }
#share-status:empty { display: none; }
@media (max-width: 410px) {
  .wishes { gap: 5px; }
  .wish { flex-basis: 30%; }
  .lamp-wall { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .hall { padding-inline: 11%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}

/* The foreground frame, lamp cabinet, and tiled floor use separate depth layers. */
.temple {
  perspective: 820px;
  filter: drop-shadow(0 17px 25px #10110f78);
}
.roof {
  height: clamp(42px, 8vw, 62px);
  margin-inline: -1%;
  border-radius: 48% 48% 4% 4% / 92% 92% 14% 14%;
  border-bottom: 6px double #e9b271;
  background:
    repeating-linear-gradient(90deg, #100e143c 0 2px, #ede0a71b 3px 4px, transparent 5px 10px),
    linear-gradient(#d89b59 0 9%, #835038 12%, #292a25 39%, #4b3832 67%, #8c3e2c 93%);
  box-shadow: inset 0 -4px #6c3225, 0 4px 9px #1b1212b3;
}
.roof span { transform: translate(-8%, 39%) rotate(-21deg); }
.roof span+span { transform: translate(8%, 39%) scaleX(-1) rotate(-21deg); }
.architrave {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: space-evenly;
  align-items: start;
  height: clamp(17px, 4.6vw, 28px);
  margin: -2px 1.5% 0;
  border: 3px double #cd8b52;
  border-radius: 0 0 8px 8px;
  background: repeating-linear-gradient(135deg, #8b4e3799 0 2px, transparent 3px 9px),
    linear-gradient(#49271f, #853c2b 54%, #4c231d);
  box-shadow: 0 6px 10px #201310cb;
}
.architrave i {
  width: 8%;
  height: 115%;
  clip-path: polygon(0 0,100% 0,100% 30%,85% 30%,85% 59%,68% 59%,61% 100%,39% 100%,32% 59%,15% 59%,15% 30%,0 30%);
  background: linear-gradient(0deg, #9a5635, #f1c588 35%, #893e2c 37% 47%, #dc995c 49% 65%, #803526 67% 76%, #f0b579 78%);
}
.hall {
  margin-inline: 1.5%;
  padding: clamp(23px, 5vw, 33px) 15% clamp(60px, 13vw, 88px);
  border-color: #ae7856;
  border-radius: 0 0 18px 18px;
  background:
    radial-gradient(ellipse at 50% 35%, #aa6c3c76, transparent 66%),
    repeating-linear-gradient(90deg, #2a19173b 0 2px, transparent 2px 9%),
    linear-gradient(90deg, #30221d 0%, #653828 25%, #6e402b 50%, #5d3227 75%, #2f201c 100%);
  box-shadow: inset 0 22px 30px #21130f90, inset 0 -4px #bd8553, 0 14px 24px #14120e;
}
.ceiling {
  position: absolute;
  inset: 0 9% auto;
  height: 24%;
  z-index: -1;
  background: repeating-linear-gradient(105deg, #94624020 0 5px, transparent 5px 17%),
    linear-gradient(#2b211c, #38241e55 72%, transparent);
  clip-path: polygon(0 0,100% 0,79% 100%,21% 100%);
}
.pillar {
  z-index: 3;
  width: 10.9%;
  bottom: 2%;
  pointer-events: none;
  border-inline: 1px solid #c4804f;
  border-radius: 0 0 19% 19% / 0 0 4% 4%;
  background:
    linear-gradient(90deg, #451c1b, #812b25 12%, #bd5240 38%, #a33f30 53%, #60261f 89%, #43201d),
    #9a4030;
  box-shadow: 5px 4px 11px #21120ebd, inset 0 -6px #642820;
}
.pillar.right { transform: scaleX(-1); }
.pillar::before {
  content: "";
  position: absolute;
  inset: 6% -3% 7%;
  background: url("dragon.svg") center / 100% 100% no-repeat;
  filter: drop-shadow(1px 2px 1px #481c15);
}
.pillar::after {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 0;
  height: 7%;
  border-block: 3px double #e9b775;
  border-radius: 20%;
  background: linear-gradient(#82382c, #a85c3e 50%, #583129);
  box-shadow: 0 2px 5px #1f1110;
}
.lantern {
  z-index: 4;
  top: 16px;
  width: clamp(27px, 7.3vw, 50px);
  border: 1px solid #f4a263;
  border-block: 4px double #f4c488;
  background: repeating-linear-gradient(90deg, #8d251c44 0 1px, transparent 1px 5px),
    radial-gradient(ellipse at 48% 38%,#ed9053,#bd4930 68%,#7b2d25);
  box-shadow: 0 0 26px #f799526b, inset 0 -3px 7px #8f362b;
}
.lantern.left { left: 6%; }
.lantern.right { right: 6%; }
.lantern::after { height: 14px; border-bottom: 5px solid #e6aa62; }
.plaque {
  text-shadow: 0 1px #a15c35;
  background: linear-gradient(#563025, #321e1b);
  box-shadow: 0 4px #271813, 0 6px 11px #2a1919ac;
}
.lamp-wall {
  z-index: 2;
  border: 4px double #d09560;
  background:
    repeating-linear-gradient(135deg, #b2693e22 0 1px, transparent 1px 7px),
    radial-gradient(ellipse at 50% 38%, #64372a, #32201a);
  box-shadow: 0 4px #5b3527, 0 8px #43261e, 0 12px 18px #281812ad, inset 0 4px 9px #281813;
}
.lamp {
  border: 1px solid #ab7850;
  background:
    linear-gradient(126deg, #ffe0a719, transparent 45%),
    radial-gradient(ellipse at 50% 75%,#563a32,#301f1c 79%);
  box-shadow: inset 2px 2px 0 #d4a26d36, inset -2px -4px 0 #1e1515c4, 0 3px 4px #251613;
  transition: border-color .8s, box-shadow 1.2s;
}
.lamp::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid #e2b28236;
  border-top-color: #ffdb9259;
  border-radius: inherit;
  background: linear-gradient(133deg, #ffe5b21b, transparent 32% 64%, #fbc39512);
  pointer-events: none;
}
.wick::before {
  width: 38%;
  height: clamp(9px, 2.5vw, 21px);
  opacity: .75;
  border-radius: 80% 32% 64% 58%;
}
.wick::after { background: linear-gradient(#d69e63,#78432a 40%,#5d3429); }
.lamp::after {
  background: radial-gradient(ellipse at 50% 56%, #ffebaeae, #ffc05e8c 41%, #c679373d 71%, transparent 94%);
}
.lamp.lit {
  border-color: #fbcb77;
  box-shadow: inset 0 0 13px #f8b8598f, 0 2px 5px #3c221a, 0 0 12px #ffb94f69;
}
.lamp.lit + .lamp:not(.lit),
.lamp:not(.lit):has(+ .lamp.lit) {
  border-color: #d0975c;
  box-shadow: inset 0 0 10px #ffb7623d, 0 3px 4px #251613;
  transition-duration: 2.7s;
}
.lamp.lit .wick::before {
  opacity: 1;
  background: radial-gradient(at 50% 74%, #fffdea 0 22%, #ffe27b 49%, #ffb34e 73%, #dc7332);
  box-shadow: 0 0 7px 2px #ffed9ace, 0 0 18px 3px #fbb44c9c;
}
.lighting .lamp.newly-lit::after { animation: light-lamp 4.9s ease-out both; }
.lighting .lamp.newly-lit .wick::before { animation: kindle 2.9s ease-out both; }
.lighting .lamp:not(.newly-lit) { animation: warm-wall 4.5s 1.25s ease-in-out; }
.lighting .newly-lit .spark { animation-duration: 4.5s; }
.lamp.lit:not(.newly-lit) .spark:nth-child(2),
.lamp.lit:not(.newly-lit) .spark:nth-child(3) {
  animation: float-gold 5s var(--delay) ease-in-out infinite;
  font-size: .75rem;
}
@keyframes kindle {
  0% { opacity: .12; transform: rotate(12deg) scale(.25); filter: saturate(.34); }
  23% { opacity: .7; transform: rotate(15deg) scale(.59); }
  100% { opacity: 1; transform: rotate(12deg) scale(1); filter: none; }
}
.floor {
  z-index: 0;
  height: 19%;
  inset: auto -8% -3%;
  transform: perspective(185px) rotateX(22deg);
  transform-origin: bottom;
  background:
    linear-gradient(0deg, #50281f77, transparent),
    repeating-linear-gradient(90deg,#684132 0 1px, transparent 1px 13%),
    repeating-linear-gradient(0deg,#7a5140 0 1px, #b17855 1px 18px);
  border-top-color: #ca895c;
  box-shadow: inset 0 8px 18px #4430269e;
}
.floor::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 12%, #ffd58e9c, #f2a55136 40%, transparent 70%);
  opacity: 0;
  transition: opacity 3.8s ease;
}
.hall:has(.lamp.lit) .floor::after { opacity: .85; }
.steps {
  position: absolute;
  z-index: 1;
  bottom: 8%;
  left: 18%;
  right: 18%;
  height: clamp(23px, 4.7vw, 34px);
  border: 1px solid #c48b61;
  border-radius: 5px;
  background: linear-gradient(#aa7455 0 22%,#60382b 23% 43%,#c88b5e 44% 60%,#81503b 61% 81%,#d09c6d 82% 86%,#9c6549 87%);
  box-shadow: 0 4px 7px #5031278c;
  transform: perspective(250px) rotateX(12deg);
}
.censer {
  position: absolute;
  z-index: 3;
  bottom: 4%;
  left: 48%;
  width: clamp(21px, 6vw, 40px);
  height: clamp(14px, 3.6vw, 25px);
  border: 1px solid #e4af65;
  border-top: 4px double #ecc282;
  border-radius: 17% 17% 44% 44%;
  background: radial-gradient(at 38% 25%,#e4af64,#a66a3b 57%,#653723);
  box-shadow: 0 3px 4px #43271f, inset 0 -3px #694227;
  pointer-events: none;
}
.censer::before { content: ""; position: absolute; inset: 22% -17% auto; height: 45%; border: 2px solid #aa764c; border-radius: 50%; z-index: -1; }
.censer b { position: absolute; bottom: 100%; left: 46%; width: 2px; height: 55%; background: #815441; transform: rotate(-13deg); border-top: 2px solid #ffc67a; }
.censer i {
  position: absolute;
  width: 65%;
  height: 160%;
  left: 23%;
  bottom: 100%;
  background: radial-gradient(ellipse,#fff1cc62,transparent 67%);
  border-radius: 50%;
  opacity: 0;
  animation: incense 6.5s linear infinite;
}
.censer i:nth-child(2) { animation-delay: 2.1s; }
.censer i:nth-child(3) { animation-delay: 4.2s; }
@keyframes incense {
  0% { opacity: 0; transform: translateY(32%) scale(.45); }
  32% { opacity: .64; }
  100% { opacity: 0; transform: translate(66%,-138%) scale(1.35); }
}
@media (max-width: 410px) {
  .hall { padding-inline: 13%; }
  .pillar { width: 10%; }
  .lantern.left { left: 5%; } .lantern.right { right: 5%; }
}
@media (prefers-reduced-motion: reduce) {
  .temple *, .temple *::before, .temple *::after { transition: none !important; }
}
@media (max-width: 350px) {
  .wish { padding-inline: 5px; font-size: .83rem; white-space: nowrap; }
}
