:root {
  --brand-red: #e31346;
  --brand-red-bright: #ff315f;
  --brand-red-deep: #850224;
  --page-bg: #090306;
  --safe-bottom: max(12px, env(safe-area-inset-bottom));
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--page-bg);
}

body {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  place-items: center;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  position: fixed;
  inset: -64px;
  z-index: -2;
  background:
    linear-gradient(rgba(5, 0, 2, 0.52), rgba(5, 0, 2, 0.78)),
    url("fortune9-promo.jpg") center / cover no-repeat;
  content: "";
  filter: blur(54px) saturate(1.3);
  transform: scale(1.14);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 34%, transparent 0%, rgba(7, 0, 3, 0.2) 44%, rgba(4, 0, 2, 0.78) 100%),
    linear-gradient(110deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.42));
  content: "";
  pointer-events: none;
}

.fortune9-background {
  position: relative;
  width: min(calc(100vw - 48px), 49.5vh, 480px);
  width: min(calc(100vw - 48px), 49.5dvh, 480px);
  aspect-ratio: 941 / 1672;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 36px;
  background: #100307 url("fortune9-promo.jpg") center top / cover no-repeat;
  box-shadow:
    0 42px 100px rgba(0, 0, 0, 0.58),
    0 12px 34px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: translateZ(0);
}

.fortune9-try-button {
  position: absolute;
  right: 22px;
  bottom: 54px;
  left: 22px;
  z-index: 2;
  display: grid;
  min-height: 58px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 19px;
  background:
    linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.3) 42%, transparent 64%) -160% 0 / 48% 100% no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 44%),
    linear-gradient(135deg, var(--brand-red-bright), var(--brand-red) 50%, var(--brand-red-deep));
  box-shadow:
    0 14px 34px rgba(159, 0, 38, 0.48),
    0 0 0 0 rgba(255, 49, 95, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Arial, sans-serif;
  font-size: 17px;
  font-weight: 780;
  letter-spacing: 0.015em;
  line-height: 1;
  text-decoration: none;
  text-shadow: 0 1px 1px rgba(87, 0, 21, 0.42);
  touch-action: manipulation;
  transform-origin: center;
  transition: filter 160ms ease;
  animation:
    button-pulse 1.7s ease-in-out infinite,
    button-attract 3.8s ease-in-out 1.2s infinite;
}

.fortune9-try-button::before {
  content: "JOIN NOW";
}

.fortune9-try-button:hover {
  filter: brightness(1.1);
}

.fortune9-try-button:active {
  animation: none;
  filter: brightness(0.96);
  transform: scale(0.96);
}

.fortune9-try-button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.96);
  outline-offset: 4px;
}

@keyframes button-attract {
  0%,
  66%,
  100% {
    background-position: -160% 0, 0 0, 0 0;
    box-shadow:
      0 14px 34px rgba(159, 0, 38, 0.48),
      0 0 0 0 rgba(255, 49, 95, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.38);
  }

  78% {
    background-position: 280% 0, 0 0, 0 0;
    box-shadow:
      0 16px 38px rgba(177, 0, 43, 0.56),
      0 0 0 9px rgba(255, 49, 95, 0),
      inset 0 1px 0 rgba(255, 255, 255, 0.42);
  }
}

@keyframes button-pulse {
  0%,
  100% {
    transform: scale(0.98);
  }

  50% {
    transform: scale(1.045);
  }
}

@media (max-width: 820px) {
  body::before,
  body::after {
    display: none;
  }

  .fortune9-background {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    background-position: center top;
    box-shadow: none;
  }

  .fortune9-try-button {
    right: 18px;
    bottom: calc(var(--safe-bottom) + 40px);
    left: 18px;
    min-height: 58px;
    border-radius: 18px;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  body::before,
  body::after {
    display: block;
  }

  .fortune9-background {
    width: min(calc(100vw - 32px), 54vh);
    width: min(calc(100vw - 32px), 54dvh);
    height: auto;
    aspect-ratio: 941 / 1672;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 24px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48);
  }

  .fortune9-try-button {
    right: 14px;
    bottom: 30px;
    left: 14px;
    min-height: 44px;
    border-radius: 14px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fortune9-try-button {
    animation: none;
    transition: none;
  }
}
