@font-face {
  font-family: "Ma Shan Zheng";
  src: url("assets/ma-shan-zheng.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  font-family: Inter,"PingFang SC","Microsoft YaHei",sans-serif;
  color: #172239;
  background: #f8faff;
  font-synthesis: none;
  font-size: 16px
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden
}

.ambient {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 87% 54%,#dce6ff99,transparent 55%);
  pointer-events: none
}

header,main,footer {
  position: relative;
  max-width: 1320px;
  margin: auto
}

header {
  padding: 30px 56px;
  display: flex;
  justify-content: space-between;
  align-items: center
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 750;
  font-size: 20px;
  color: inherit;
  text-decoration: none
}

button {
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent
}

button:focus-visible,a:focus-visible {
  outline: 3px solid #ec9e29;
  outline-offset: 5px
}

.icon-btn {
  border: 1px solid #dfe4ef;
  background: #fff9;
  border-radius: 30px;
  padding: 10px 16px;
  color: #68748c;
  font-size: 18px
}

.icon-btn span {
  font-size: 13px;
  margin-left: 6px
}

main {
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  gap: 65px;
  padding: 55px 70px 45px;
  align-items: center
}

h1 {
  position: relative;
  font-size: clamp(40px,4.5vw,62px);
  line-height: 1.3;
  letter-spacing: -2px;
  font-weight: 850;
  margin: 28px 0 20px
}

.blue {
  color: #123aff
}

.asterisk {
  font-style: normal;
  color: #c7d4ff;
  font-size: 58px;
  position: absolute;
  right: 5px;
  top: 2px
}

.intro {
  font-size: 15px;
  color: #6a768b;
  line-height: 1.8;
  margin-bottom: 30px
}

.ticket {
  background: white;
  border: 1px solid #e3e8f4;
  border-radius: 15px;
  padding: 23px 25px;
  box-shadow: 0 10px 40px #29488c06;
  transform: rotate(-1.5deg)
}

.ticket-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  font-size: 11px;
  letter-spacing: 2px;
  color: #8390aa
}

.pending {
  font-size: 12px;
  letter-spacing: 0;
  color: #123aff;
  background: #edf1ff;
  padding: 5px 10px;
  border-radius: 20px
}

.ticket-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-size: 14px;
  margin: 16px 0
}

.ticket-row>span {
  color: #7b869a
}

.ticket-row strong {
  font-weight: 500
}

.tiny {
  color: #123aff
}

.ticket-bottom {
  border-top: 1px dashed #d9dfeb;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #8993a8
}

.barcode {
  height: 20px;
  width: 63px;
  background: repeating-linear-gradient(90deg,#b3bdd0 0 2px,transparent 2px 4px,#b3bdd0 4px 5px,transparent 5px 8px)
}

.footnote {
  font-size: 12px;
  color: #8b95a9;
  margin: 24px 0 0
}

.playground {
  position: relative;
  min-height: 570px;
  border: 1px solid #fff;
  border-radius: 32px;
  background: linear-gradient(145deg,#edf2ffdd,#e3ebff88);
  padding: 26px 30px 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: inset 0 0 80px #ffffff60,0 25px 90px #314c9710
}

.stage-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #7a87a3
}

.stage-top span:last-child {
  color: #3c5a9e
}

.orbital {
  position: absolute;
  width: 330px;
  height: 330px;
  border: 1px solid #fff9;
  border-radius: 50%;
  top: 88px;
  pointer-events: none
}

.orbital:after {
  content: "";
  position: absolute;
  inset: 26px;
  border: 1px solid #ffffff77;
  border-radius: 50%
}

.speech {
  position: relative;
  margin-top: 31px;
  background: white;
  border-radius: 14px;
  padding: 12px 19px;
  font-size: 14px;
  color: #536685;
  box-shadow: 0 5px 20px #526ec509;
  transition: transform .3s
}

.speech:after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: white;
  bottom: -5px;
  left: 48%;
  transform: rotate(45deg)
}

.character-wrap {
  position: relative;
  margin-top: 12px;
  animation: float 3.6s ease-in-out infinite;
  z-index: 1
}

.character {
  font-size: 168px;
  line-height: 1.4;
  filter: drop-shadow(0 13px 10px #ad83151c);
  will-change: transform;
  transition: transform .23s cubic-bezier(.2,.8,.3,1)
}

.emoji-image {
  width: 1em;
  height: 1em;
  object-fit: contain;
  vertical-align: -.12em;
}

.spark {
  position: absolute;
  color: #4062ff;
  font-size: 31px
}

.spark-one {
  top: 22px;
  right: -29px;
  animation: twinkle 3s infinite
}

.spark-two {
  bottom: 32px;
  left: -32px;
  font-size: 22px;
  animation: twinkle 3s 1s infinite
}

.shadow {
  height: 13px;
  width: 105px;
  border-radius: 50%;
  background: #637acc1c;
  filter: blur(6px);
  margin-top: -8px
}

.meter {
  width: 205px;
  margin: 25px 0 22px
}

.meter>div:first-child {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #7987a4;
  margin-bottom: 9px
}

.meter strong {
  font-weight: 500;
  color: #123aff
}

.meter-track {
  height: 4px;
  background: #d1dcf8;
  border-radius: 4px;
  overflow: hidden
}

.meter-track span {
  display: block;
  width: 82%;
  height: 100%;
  background: #4767ff;
  transition: width .4s
}

.actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 57px
}

.accept {
  background: #123aff;
  color: white;
  border: 0;
  padding: 17px 22px;
  border-radius: 13px;
  box-shadow: 0 7px 20px #123aff30;
  font-size: 15px;
  font-weight: 600;
  transition: transform .25s,box-shadow .25s;
  white-space: nowrap
}

.accept span {
  margin-left: 20px
}

.accept:hover {
  box-shadow: 0 9px 30px #123aff50
}

.reject {
  background: #ffffffaa;
  border: 1px solid #cbd5ed;
  color: #7484a3;
  border-radius: 13px;
  min-width: 90px;
  height: 52px;
  font-size: 14px;
  z-index: 5;
  touch-action: manipulation;
  transition: left .2s ease,top .2s ease,transform .2s
}

.hint {
  font-size: 12px;
  color: #8591ab;
  margin: 22px 0 0;
  min-height: 18px;
  text-align: center
}

.restart {
  border: 0;
  background: transparent;
  color: #123aff;
  font-size: 14px;
  margin-top: 15px;
  padding: 7px
}

.stamp {
  position: absolute;
  right: 22px;
  top: 105px;
  border: 3px solid #123aff;
  color: #123aff;
  font-weight: 900;
  font-size: 33px;
  text-align: center;
  line-height: 1.05;
  padding: 13px;
  transform: rotate(15deg) scale(2);
  opacity: 0;
  pointer-events: none;
  transition: all .5s cubic-bezier(.3,1.5,.5,1)
}

.stamp small {
  font-size: 9px;
  letter-spacing: 1px
}

.celebrating .stamp {
  opacity: .85;
  transform: rotate(15deg) scale(1)
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 18px 56px 30px;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #8994aa
}

footer span:last-child {
  letter-spacing: 0;
  font-size: 12px
}

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10
}

@keyframes float {
  50% {
    transform: translateY(-12px)
  }
}

@keyframes twinkle {
  50% {
    opacity: .4;
    transform: scale(.75) rotate(30deg)
  }
}

@media(min-width:1450px) {
  main {
    padding-top: 80px;
    padding-bottom: 70px
  }
}

@media(max-width:800px) {
  header {
    padding: 22px 24px
  }
  main {
    gap: 30px;
    padding: 24px;
    grid-template-columns: 1fr
  }
  .request {
    max-width: 540px;
    width: 100%;
    margin: auto
  }
  h1 {
    font-size: 43px;
    margin: 18px 0 13px
  }
  .intro {
    margin-bottom: 22px
  }
  .ticket {
    padding: 17px 22px
  }
  .ticket-heading {
    margin-bottom: 12px
  }
  .ticket-row {
    margin: 12px 0
  }
  .footnote {
    margin-top: 18px
  }
  .playground {
    width: 100%;
    max-width: 540px;
    min-height: 555px;
    margin: auto
  }
  .asterisk {
    right: 20px
  }
  footer {
    padding: 12px 24px 28px;
    gap: 15px;
    flex-wrap: wrap
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    animation: none!important;
    transition: none!important
  }
  .character {
    will-change: auto
  }
}

[hidden] {
  display: none!important
}

.reject.fleeing {
  transition: none;
  z-index: 30;
  background: #fff;
  border-color: #b8c6ed;
  box-shadow: 0 8px 26px #23459624;
  will-change: left,top
}

body {
  transition: background 1s ease
}

body.caught-page {
  background: #ffeadf
}

body.approved-page {
  background: #dceeff
}

.caught-page .ambient {
  background: radial-gradient(ellipse at center,#ffd3a7aa,transparent 75%)
}

.approved-page .ambient {
  background: radial-gradient(ellipse at center,#85baff77,transparent 75%)
}

.caught-page main,.caught-page header,.caught-page footer {
  animation: page-rumble .65s ease both
}

.approved-page main,.approved-page header,.approved-page footer {
  animation: page-cheer .85s ease both
}

.caught-page .playground {
  background: linear-gradient(145deg,#ffe6d0,#ffcfc1)
}

.caught-page .blue,.caught-page .stamp {
  color: #bf4934
}

.caught-page .stamp {
  border-color: #bf4934
}

#result {
  position: fixed;
  inset: 0;
  width: min(540px,calc(100% - 32px));
  max-height: calc(100svh - 32px);
  overflow: auto;
  margin: auto;
  border: 1px solid #ffffffbb;
  border-radius: 30px;
  padding: 36px 28px;
  text-align: center;
  background: #ffffffed;
  box-shadow: 0 35px 140px #20336740;
  color: #172239
}

#result[open] {
  animation: result-in .5s cubic-bezier(.2,.8,.3,1) both
}

#result::backdrop {
  background: radial-gradient(ellipse at center,#244bff12,#12225265);
  backdrop-filter: blur(3px)
}

.caught-page #result::backdrop {
  background: radial-gradient(ellipse at center,#ffad6522,#732d4855)
}

.result-emoji {
  font-size: 100px;
  line-height: 1.3;
  animation: result-bounce 1.4s ease-in-out 3
}

#result h2 {
  font-size: clamp(25px,5vw,36px);
  margin: 12px 0;
  line-height: 1.4
}

#result-copy {
  font-size: 16px;
  line-height: 1.8;
  color: #64748b;
  margin: 16px 0 26px
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap
}

.result-actions .reject {
  padding: 0 20px
}

#confetti {
  z-index: 100;
  position: fixed
}

@keyframes page-rumble {
  0%,100% {
    transform: translate(0)
  }
  20% {
    transform: translate(-6px,3px) rotate(-.4deg)
  }
  40% {
    transform: translate(6px,-3px) rotate(.4deg)
  }
  60% {
    transform: translate(-4px,2px)
  }
  80% {
    transform: translate(3px,-1px)
  }
}

@keyframes page-cheer {
  0%,100% {
    transform: translateY(0)
  }
  45% {
    transform: translateY(-10px)
  }
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: scale(.82) translateY(24px)
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0)
  }
}

@keyframes result-bounce {
  50% {
    transform: translateY(-10px) rotate(6deg)
  }
}

/* Rejection turns the whole page into a ruined holiday. */
body.caught-page {
  background: #171b29;
  color: #cad0dc
}

.caught-page .ambient {
  background: linear-gradient(160deg,#171b29ed,#394052dd);
  animation: storm-arrives .6s ease both
}

.caught-page .ambient:after {
  content: "";
  position: absolute;
  inset: -20%;
  background: repeating-linear-gradient(110deg,transparent 0 35px,#9aabc022 36px 37px,transparent 38px 76px);
  animation: rain-falls .65s linear infinite
}

.caught-page:after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  background: #dfeaff;
  opacity: 0;
  animation: lightning-strike .65s ease-out both
}

.caught-page main,.caught-page header,.caught-page footer {
  animation: world-shock 1s ease both
}

.caught-page .playground {
  background: linear-gradient(145deg,#3b4358,#242a3d);
  border-color: #62708b;
  color: #e6eaf4;
  box-shadow: 0 30px 90px #0006
}

.caught-page .ticket {
  background: #30374a;
  border-color: #596278;
  color: #d5dceb;
  animation: ticket-falls .9s .15s ease both
}

.caught-page .ticket strong {
  color: #e5e9ef
}

.caught-page .ticket-bottom {
  border-color: #69748a
}

.caught-page .intro,.caught-page .footnote,.caught-page .hint,.caught-page .stage-top,.caught-page .stage-top span:last-child {
  color: #aebbd0
}

.caught-page .blue,.caught-page .stamp {
  color: #f29292
}

.caught-page .stamp {
  border-color: #e47b7b
}

.caught-page .pending {
  background: #713f50;
  color: #ffcece
}

.caught-page .speech {
  background: #424b62;
  color: #f2f4fa
}

.caught-page .speech:after {
  background: #424b62
}

.caught-page .character-wrap {
  animation: despair 1.2s ease both
}

.caught-page .spark {
  opacity: 0
}

.caught-page #result {
  background: #202637f5;
  color: #f4f5fa;
  border-color: #66718b;
  box-shadow: 0 35px 140px #0008
}

.caught-page #result::backdrop {
  background: #10152355;
  backdrop-filter: blur(2px)
}

.caught-page #result-copy {
  color: #b5c0d3
}

.caught-page #result h2 {
  color: #ffb6b6
}

.caught-page .result-emoji {
  animation: despair 1.2s ease both
}

.caught-page .result-actions .reject {
  background: #374158;
  color: #e3e9f4;
  border-color: #69768e
}

@keyframes lightning-strike {
  0% {
    opacity: .78
  }
  100% {
    opacity: 0
  }
}

@keyframes storm-arrives {
  from {
    opacity: 0
  }
  to {
    opacity: 1
  }
}

@keyframes world-shock {
  0%,100% {
    transform: translate(0)
  }
  15% {
    transform: translate(-9px,5px) rotate(-.6deg)
  }
  30% {
    transform: translate(8px,-5px) rotate(.5deg)
  }
  50% {
    transform: translate(-5px,3px)
  }
  70% {
    transform: translate(3px,-2px)
  }
}

@keyframes ticket-falls {
  to {
    transform: translateY(18px) rotate(5deg);
    filter: saturate(.2)
  }
}

@keyframes despair {
  0% {
    transform: scale(1.15) rotate(-8deg)
  }
  35% {
    transform: scale(.95) rotate(8deg)
  }
  70% {
    transform: translateY(10px) rotate(-4deg)
  }
  100% {
    transform: translateY(14px) rotate(-7deg)
  }
}

@keyframes rain-falls {
  to {
    transform: translate(-25px,65px)
  }
}

html.opening-active {
  overflow: hidden;
}

#opening {
  --handwriting-font: "Ma Shan Zheng", KaiTi, "Microsoft YaHei", serif;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
}

#opening::backdrop {
  background: transparent;
}

#opening paper-burn {
  display: block;
  height: 100%;
  --motion-min-height: 0px;
}
