:root {
  --page-max-width: 720px;
  --vh: 1vh;
  --hero-height: calc(var(--vh) * 100);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: var(--hero-height);
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  -webkit-text-size-adjust: 100%;
}

.bg-wrap {
  position: relative;
  width: min(100vw, var(--page-max-width));
  min-height: var(--hero-height);
  height: var(--hero-height);
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  background: #120024;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.bg-img {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center top;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.bg-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 0, 20, 0.1), transparent 24%, rgba(4, 0, 20, 0.24) 100%),
    radial-gradient(circle at 50% 55%, rgba(255, 80, 230, 0.12), transparent 42%);
}

.top-bar,
.caishen,
.banner1,
.caishen-buttons {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.top-bar {
  top: calc(env(safe-area-inset-top) + 2.6%);
  z-index: 5;
  width: 60%;
  max-width: 390px;
  aspect-ratio: 538 / 106;
  background: url("../img/toplogo.png") no-repeat center / contain;
  pointer-events: none;
}

.banner1 {
  top: calc(env(safe-area-inset-top) + 51.5%);
  z-index: 4;
  width: 92%;
  max-width: 650px;
  aspect-ratio: 930 / 612;
  background: url("../img/banner1.png") no-repeat center / contain;
  pointer-events: none;
  transform-origin: center center;
  animation: banner1-breathe 2.1s ease-in-out infinite;
  will-change: transform;
  backface-visibility: hidden;
}

.caishen {
  top: calc(env(safe-area-inset-top) + 3.8%);
  z-index: 3;
  width: 108%;
  max-width: 760px;
  aspect-ratio: 941 / 1360;
  background: url("../img/caishen.png") no-repeat center top / contain;
  pointer-events: none;
}

.caishen-buttons {
  bottom: calc(env(safe-area-inset-bottom) + 34px);
  z-index: 6;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: clamp(8px, 2.4vw, 16px);
  width: 88%;
  max-width: 560px;
}

.caishen-buttons .btn {
  display: block;
  width: 100%;
  aspect-ratio: 558 / 176;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 10px 18px rgba(255, 46, 213, 0.28));
}

.caishen-buttons .btn:active {
  transform: scale(0.985);
}

.caishen-buttons .btn:focus-visible {
  outline: 3px solid rgba(255, 118, 238, 0.62);
  outline-offset: 4px;
  border-radius: 999px;
}

.caishen-buttons .chplay {
  background-image: url("../img/chplay.png");
}

.caishen-buttons .appstore {
  background-image: url("../img/appstore.png");
}

.caishen-buttons .openh5 {
  background-image: url("../img/openh5.png");
}

@keyframes banner1-breathe {
  0% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.035);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

@media (max-width: 520px) {
  .top-bar {
    top: calc(env(safe-area-inset-top) + 2.8%);
    width: 64%;
  }

  .banner1 {
    top: calc(env(safe-area-inset-top) + 53%);
    width: 94%;
  }

  .caishen {
    top: calc(env(safe-area-inset-top) + 4.8%);
    width: 112%;
  }

  .caishen-buttons {
    bottom: calc(env(safe-area-inset-bottom) + 30px);
    width: 90%;
  }
}

@media (max-width: 390px) {
  .top-bar {
    top: calc(env(safe-area-inset-top) + 2.4%);
    width: 66%;
  }

  .banner1 {
    top: calc(env(safe-area-inset-top) + 50%);
    width: 96%;
  }

  .caishen {
    top: calc(env(safe-area-inset-top) + 5.4%);
    width: 116%;
  }

  .caishen-buttons {
    bottom: calc(env(safe-area-inset-bottom) + 24px);
    width: 92%;
    column-gap: 8px;
  }
}

@media (max-height: 760px) {
  .top-bar {
    top: calc(env(safe-area-inset-top) + 2%);
    width: 56%;
  }

  .banner1 {
    top: calc(env(safe-area-inset-top) + 55%);
    width: 76%;
  }

  .caishen {
    top: calc(env(safe-area-inset-top) + 4.2%);
    width: 98%;
  }

  .caishen-buttons {
    bottom: calc(env(safe-area-inset-bottom) + 18px);
    width: 84%;
  }
}

@media (min-width: 721px) {
  .bg-wrap {
    max-width: 500px;
    box-shadow: 0 0 44px rgba(255, 86, 229, 0.14);
  }

  .top-bar {
    width: 58%;
  }

  .banner1 {
    top: calc(env(safe-area-inset-top) + 55%);
    width: 88%;
  }

  .caishen {
    top: calc(env(safe-area-inset-top) + 4%);
    width: 104%;
  }

  .caishen-buttons {
    bottom: calc(env(safe-area-inset-bottom) + 30px);
    width: 88%;
  }
}
