:root {
  color-scheme: dark;
  --ink: #e8e1cf;
  --muted: #aaa695;
  --gold: #c8a965;
  --gold-bright: #f0d892;
  --dark: #101718;
  --yellow: #ffd33d;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: #090d0d;
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", "Microsoft YaHei", serif;
}

button { font: inherit; }

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.page {
  position: absolute;
  inset: 0;
  min-height: 100vh;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.035);
  transition: opacity .65s ease, transform .8s cubic-bezier(.2,.8,.2,1);
}

.page.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.reward-page {
  isolation: isolate;
  background:
    radial-gradient(circle at 75% 28%, rgba(209, 190, 137, .22), transparent 23%),
    linear-gradient(108deg, rgba(8, 14, 15, .98) 0 34%, rgba(24, 36, 35, .87) 57%, rgba(12, 20, 21, .95) 100%);
}

.reward-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  opacity: .58;
  background-image:
    linear-gradient(115deg, transparent 0 48%, rgba(240, 225, 183, .04) 49%, transparent 50%),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(255,255,255,.018) 80px);
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 80px));
  margin: 0 auto;
  padding-top: 36px;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 47px;
  aspect-ratio: 1;
  border: 1px solid rgba(227, 208, 157, .65);
  color: var(--gold-bright);
  font-size: 25px;
  transform: rotate(45deg);
}
.brand-mark::first-letter { transform: rotate(-45deg); }
.brand strong { display: block; font-size: 22px; letter-spacing: .2em; font-weight: 500; }
.brand small { display: block; margin-top: 3px; color: #918c7f; font: 9px/1.2 Arial, sans-serif; letter-spacing: .28em; }
.event-tag {
  padding: 8px 17px;
  border: 1px solid rgba(213, 189, 126, .36);
  color: #c5b88f;
  font-size: 13px;
  letter-spacing: .25em;
}

.hero-copy {
  position: relative;
  z-index: 5;
  width: min(530px, calc(100% - 48px));
  margin: clamp(70px, 11vh, 130px) 0 70px max(7vw, calc((100vw - 1180px) / 2));
}

.eyebrow {
  margin: 0 0 16px;
  color: #a3a092;
  font-size: 14px;
  letter-spacing: .42em;
}

h1 {
  margin: 0;
  color: #eee8d8;
  font-size: clamp(55px, 6.6vw, 100px);
  font-weight: 300;
  line-height: .98;
  letter-spacing: .06em;
  text-shadow: 0 8px 28px rgba(0,0,0,.45);
}

h1 em {
  color: var(--gold-bright);
  font-style: normal;
  font-size: .88em;
}

.lead {
  margin: 24px 0;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: .1em;
}

.reward-card {
  position: relative;
  display: flex;
  align-items: center;
  width: min(420px, 100%);
  min-height: 118px;
  padding: 16px 24px 16px 18px;
  overflow: hidden;
  border: 1px solid rgba(218, 192, 124, .35);
  background: linear-gradient(110deg, rgba(230, 212, 163, .11), rgba(16, 23, 24, .76));
  box-shadow: 0 24px 55px rgba(0,0,0,.25), inset 0 0 50px rgba(221, 194, 121, .035);
  backdrop-filter: blur(8px);
}

.item-icon { position: relative; display: grid; place-items: center; width: 78px; aspect-ratio: 1; margin-right: 18px; }
.item-core {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  border: 1px solid #dfc77d;
  border-radius: 50%;
  background: radial-gradient(circle, #d6bd72 0 12%, #4d523d 14% 46%, #181f1f 48%);
  color: #e8dca9;
  font-size: 19px;
  box-shadow: 0 0 25px rgba(216, 188, 107, .32);
}
.ring { position: absolute; inset: 6px; border: 1px solid rgba(231, 207, 137, .45); border-radius: 50%; }
.ring-a { animation: spin 9s linear infinite; clip-path: polygon(0 0, 100% 0, 100% 42%, 0 77%); }
.ring-b { inset: 15px; animation: spin 6s linear infinite reverse; border-style: dashed; }
.reward-info { display: flex; flex-direction: column; gap: 5px; }
.reward-info span { color: #aaa18b; font-size: 12px; letter-spacing: .28em; }
.reward-info strong { color: #eee5cb; font-size: 23px; font-weight: 500; letter-spacing: .12em; }
.reward-info strong b { color: var(--gold-bright); font-size: 16px; }
.reward-info small { color: #777c75; font-size: 12px; }
.card-stamp { position: absolute; right: 17px; top: 14px; color: rgba(213, 181, 96, .3); font-size: 44px; font-style: normal; }

.claim-button {
  position: relative;
  width: min(420px, 100%);
  margin-top: 20px;
  padding: 15px 28px 14px;
  border: 1px solid #dfc77d;
  cursor: pointer;
  background: linear-gradient(100deg, #9e8249, #d2b769 52%, #927642);
  color: #111817;
  box-shadow: 0 9px 30px rgba(195, 159, 82, .2);
  transition: transform .22s ease, filter .22s ease, box-shadow .22s ease;
}
.claim-button::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(26, 30, 26, .23);
  pointer-events: none;
}
.claim-button:hover { transform: translateY(-3px); filter: brightness(1.13); box-shadow: 0 13px 40px rgba(220, 183, 95, .35); }
.claim-button:active { transform: translateY(0) scale(.99); }
.claim-button span { display: block; font-size: 20px; font-weight: 700; letter-spacing: .28em; }
.claim-button small { display: block; margin-top: 3px; opacity: .68; font-size: 11px; letter-spacing: .15em; }
.hint { width: min(420px, 100%); margin: 12px 0 0; text-align: center; color: #666d68; font-size: 11px; letter-spacing: .18em; }

.landscape { position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.sun { position: absolute; right: 17vw; top: 18vh; width: 30vw; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(238, 224, 185, .15), rgba(226, 207, 161, .02) 62%, transparent 63%); filter: blur(1px); }
.mountain { position: absolute; right: -8vw; bottom: -12vh; width: 67vw; height: 82vh; background: #182624; clip-path: polygon(0 100%, 8% 64%, 18% 69%, 29% 35%, 36% 52%, 50% 13%, 63% 49%, 72% 39%, 83% 67%, 100% 55%, 100% 100%); }
.mountain-far { right: 5vw; bottom: 4vh; opacity: .33; filter: blur(5px); transform: scale(.85); background: #718077; }
.mountain-near { background: linear-gradient(120deg, #263632, #111b1b 66%); opacity: .83; }
.bird { position: absolute; color: rgba(222, 211, 177, .42); font: 46px Arial, sans-serif; transform: rotate(-9deg); }
.bird-one { right: 24vw; top: 27vh; }
.bird-two { right: 19vw; top: 32vh; font-size: 29px; }
.mist { position: absolute; z-index: 1; width: 65vw; height: 25vh; border-radius: 50%; background: rgba(211, 218, 203, .06); filter: blur(45px); animation: drift 13s ease-in-out infinite alternate; }
.mist-one { right: -8vw; bottom: 17vh; }
.mist-two { right: 20vw; top: 29vh; animation-delay: -6s; }

.prank-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 15%, #fffadd 0 2%, transparent 28%),
    radial-gradient(circle at 50% 55%, #fff4a9 0, #ffdf55 42%, #f7a91c 100%);
  color: #32220b;
}

.prank-page::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.22) 0deg 9deg, transparent 9deg 18deg);
  animation: spin 28s linear infinite;
}

.prank-content { position: relative; z-index: 3; width: min(620px, calc(100% - 30px)); padding: 42px 0 34px; text-align: center; }
.burst-label { display: inline-block; padding: 8px 20px; border-radius: 999px; background: #302006; color: #ffe56b; font-weight: 800; letter-spacing: .2em; transform: rotate(-2deg); box-shadow: 0 8px 0 rgba(111,67,0,.17); }
.dragon-frame {
  position: relative;
  width: min(330px, 69vw);
  height: min(430px, 51vh);
  margin: 16px auto 5px;
  overflow: hidden;
  border: 8px solid #fff9d7;
  border-radius: 45% 45% 42% 42% / 28% 28% 17% 17%;
  background: white;
  box-shadow: 0 24px 60px rgba(108, 61, 0, .3), 0 0 0 4px #3e2a0b;
  animation: dragonBounce .48s ease-in-out infinite alternate;
}
.dragon-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 39%; transform: scale(1.2); }
.laugh { position: absolute; z-index: 2; display: grid; place-items: center; width: 48px; aspect-ratio: 1; border: 3px solid #352100; border-radius: 50%; background: #fff; color: #ed6d16; font-size: 27px; font-weight: 900; box-shadow: 4px 5px 0 #352100; animation: laughPop .55s ease-in-out infinite alternate; }
.laugh-one { left: 8px; top: 70px; transform: rotate(-16deg); }
.laugh-two { right: 12px; top: 120px; animation-delay: -.2s; }
.laugh-three { left: 24px; bottom: 62px; animation-delay: -.4s; }
.laugh-line { margin: 20px 0 18px; color: #362100; font-size: clamp(18px, 3vw, 25px); font-weight: 900; letter-spacing: .08em; }
.replay-button, .back-button { border-radius: 999px; cursor: pointer; font-family: "Microsoft YaHei", sans-serif; transition: transform .2s ease; }
.replay-button { padding: 12px 24px; border: 3px solid #2e1c00; background: #fff8c7; color: #362200; font-weight: 800; box-shadow: 0 6px 0 #9a6509; }
.back-button { margin-left: 8px; padding: 12px 18px; border: 2px solid rgba(51,30,0,.45); background: transparent; color: #543500; }
.replay-button:hover, .back-button:hover { transform: translateY(-3px) rotate(-1deg); }
.confetti { position: absolute; z-index: 2; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -30px; width: 10px; height: 18px; border-radius: 2px; animation: confettiFall var(--duration) linear var(--delay) infinite; transform: rotate(var(--rotate)); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { to { transform: translate(90px, -25px) scale(1.15); } }
@keyframes dragonBounce { from { transform: translateY(0) rotate(-1deg); } to { transform: translateY(-9px) rotate(1deg); } }
@keyframes laughPop { from { scale: .88; } to { scale: 1.12; } }
@keyframes confettiFall { to { transform: translate3d(var(--drift), 110vh, 0) rotate(760deg); } }

@media (max-width: 700px) {
  .topbar { width: calc(100% - 36px); padding-top: 22px; }
  .brand strong { font-size: 17px; }
  .brand-mark { width: 39px; }
  .event-tag { padding: 6px 9px; font-size: 10px; letter-spacing: .15em; }
  .hero-copy { margin: 10vh auto 40px; }
  .eyebrow { font-size: 11px; }
  .lead { font-size: 13px; }
  .landscape { opacity: .68; }
  .mountain { width: 115vw; height: 63vh; }
  .bird { display: none; }
  .dragon-frame { height: min(405px, 49vh); }
  .prank-content { padding-top: 24px; }
}

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