:root {
  color-scheme: dark;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gold: #fff269;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #11191b;
}

body,
button {
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

button {
  color: inherit;
}

.experience {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
  background: #162022;
}

.scene-bg {
  position: absolute;
  inset: -3%;
  z-index: -7;
  width: 106%;
  height: 106%;
  object-fit: cover;
  filter: brightness(0.82) saturate(0.82);
  transform: scale(1.015);
  animation: background-breathe 12s ease-in-out infinite alternate;
  user-select: none;
}

.background-grade {
  position: absolute;
  inset: 0;
  z-index: -6;
  background:
    radial-gradient(
      ellipse 42% 38% at 44% 48%,
      rgba(245, 244, 177, 0.07),
      transparent 68%
    ),
    radial-gradient(
      ellipse 78% 45% at 52% 108%,
      rgba(255, 248, 183, 0.58),
      rgba(217, 207, 138, 0.18) 42%,
      transparent 76%
    ),
    linear-gradient(
      180deg,
      rgba(3, 10, 15, 0.24),
      transparent 48%,
      rgba(245, 238, 173, 0.08)
    );
  box-shadow:
    inset 0 0 180px rgba(0, 0, 0, 0.36),
    inset 0 -100px 160px rgba(255, 248, 191, 0.12);
}

.prism-light {
  position: absolute;
  top: -3%;
  left: 50%;
  z-index: -3;
  width: min(1460px, 104vw);
  height: auto;
  opacity: 0.42;
  mix-blend-mode: screen;
  filter: saturate(1.2) brightness(1.08);
  transform: translateX(-50%) scale(1.06);
  animation: prism-pulse 6.5s ease-in-out infinite;
  pointer-events: none;
  user-select: none;
}

#fx-canvas {
  position: absolute;
  inset: 0;
  z-index: 20;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.controls {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 50;
  display: flex;
  gap: 7px;
  opacity: 0.22;
  transition: opacity 180ms ease;
}

.controls:hover,
.controls:focus-within {
  opacity: 1;
}

.controls button {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  background: rgba(4, 11, 13, 0.54);
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.controls button:hover {
  border-color: rgba(255, 242, 105, 0.52);
  color: #fff8b2;
}

.card-stage {
  --tilt-x: -1deg;
  --tilt-y: -2deg;
  position: absolute;
  top: 46%;
  left: 44%;
  z-index: 5;
  width: min(1160px, 79vw);
  aspect-ratio: 1664 / 1100;
  outline: none;
  transform:
    translate(-50%, -50%)
    perspective(1400px)
    rotateX(var(--tilt-x))
    rotateY(var(--tilt-y));
  transform-style: preserve-3d;
  cursor: pointer;
  animation: stage-enter 1.25s var(--ease-out) both;
  transition: transform 180ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

.card-stage:focus-visible::after {
  position: absolute;
  inset: 13% 8%;
  border: 1px solid rgba(255, 245, 147, 0.58);
  border-radius: 50%;
  content: "";
  filter: drop-shadow(0 0 10px #fff27a);
}

.layer,
.moon-part {
  position: absolute;
  display: block;
  max-width: none;
  pointer-events: none;
  user-select: none;
}

.stage-shadow {
  position: absolute;
  top: 31%;
  left: 13%;
  z-index: -1;
  width: 82%;
  height: 48%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  filter: blur(48px);
  transform: translateZ(-80px);
}

.geometry {
  z-index: 0;
  width: 125%;
  height: auto;
  opacity: 0.42;
  mix-blend-mode: screen;
  filter: brightness(1.3);
}

.geometry-a {
  top: 23%;
  left: -16%;
  animation: geometry-drift-a 18s ease-in-out infinite alternate;
}

.geometry-b {
  top: 24%;
  left: 5%;
  opacity: 0.32;
  animation: geometry-drift-b 22s ease-in-out infinite alternate;
}

.ornament {
  z-index: 1;
  width: 128%;
  height: auto;
  mix-blend-mode: screen;
  pointer-events: none;
}

.ornament-gold {
  top: 11%;
  left: -13%;
  opacity: 0.8;
  filter: saturate(1.28) brightness(1.22);
}

.ornament-cyan {
  top: 12%;
  left: -10%;
  opacity: 0.32;
  filter: brightness(1.2);
}

.card-shadow {
  top: 25%;
  left: 17%;
  z-index: 2;
  width: 70%;
  height: 61%;
  opacity: 0.76;
  filter: blur(7px);
  transform: translate(18px, 17px) rotate(2.3deg);
}

.card-face {
  top: 25%;
  left: 17%;
  z-index: 3;
  width: 69.25%;
  height: auto;
  border-radius: 1.5%;
  filter:
    drop-shadow(0 20px 24px rgba(0, 0, 0, 0.48))
    drop-shadow(0 0 7px rgba(255, 255, 241, 0.7));
  transform: rotate(2.3deg) translateZ(5px);
}

.card-sheen {
  top: 27%;
  left: 17.8%;
  z-index: 4;
  width: 69%;
  height: 57%;
  opacity: 0.23;
  mix-blend-mode: screen;
  filter: brightness(1.35);
  transform: rotate(2.3deg) translateZ(9px);
  animation: card-sheen 4.8s ease-in-out infinite;
}

.moon-system {
  position: absolute;
  top: 12%;
  left: 42.2%;
  z-index: 6;
  width: 34.4%;
  aspect-ratio: 572 / 636;
  transform: translateZ(24px);
  animation: moon-float 5s ease-in-out infinite;
  pointer-events: none;
}

.core {
  top: 20.5%;
  left: 14%;
  z-index: 1;
  width: 72%;
  height: auto;
  filter:
    brightness(1.05)
    drop-shadow(0 0 18px rgba(255, 252, 206, 0.7));
  animation: core-breathe 3.2s ease-in-out infinite;
}

.edge {
  top: 14%;
  left: 9%;
  z-index: 2;
  width: 82%;
  height: auto;
  mix-blend-mode: screen;
  filter: saturate(1.28) brightness(1.22);
}

.edge-left {
  animation: edge-left 14s ease-in-out infinite;
}

.edge-right {
  animation: edge-right 17s ease-in-out infinite;
}

.star {
  z-index: 6;
  mix-blend-mode: screen;
  filter:
    saturate(1.32)
    brightness(1.08)
    drop-shadow(0 0 12px rgba(91, 170, 255, 0.72));
}

.star-one,
.star-shadow-one {
  inset: 0;
  width: 100%;
  height: 100%;
}

.star-two,
.star-shadow-two {
  top: 24%;
  left: 24%;
  width: 53%;
  height: auto;
}

.star-three,
.star-shadow-three {
  top: 33.2%;
  left: 33.3%;
  width: 32%;
  height: auto;
}

.star-shadow {
  z-index: 5;
  opacity: 0.72;
  mix-blend-mode: multiply;
  filter: blur(3px);
  transform: translate(12px, 13px);
}

.star-one {
  animation: star-turn 12s linear infinite;
}

.star-two {
  animation: star-counter 8s linear infinite;
}

.star-three {
  animation: star-pulse 2.6s ease-in-out infinite;
}

.frame-glow,
.main-frame {
  inset: 0;
  width: 100%;
  height: 100%;
}

.frame-glow {
  z-index: 7;
  opacity: 0.46;
  mix-blend-mode: screen;
  filter: blur(14px) brightness(1.52);
}

.main-frame {
  z-index: 8;
  filter:
    brightness(1.05)
    saturate(1.08)
    drop-shadow(0 0 10px rgba(255, 245, 147, 0.38));
  transform: translateZ(32px);
}

.bubbles {
  top: 54%;
  left: 77%;
  z-index: 9;
  width: 39%;
  height: auto;
  opacity: 0.86;
  filter:
    brightness(1.15)
    drop-shadow(0 0 13px rgba(255, 255, 218, 0.35));
  transform: translateZ(18px);
  animation: bubbles-float 7s ease-in-out infinite;
}

.left-rings {
  top: 28%;
  left: 0;
  z-index: 2;
  width: 21%;
  opacity: 0.85;
  filter: brightness(1.5);
  mix-blend-mode: screen;
  animation: slow-spin 24s linear infinite;
}

.right-rings {
  top: 28%;
  left: 78%;
  z-index: 2;
  width: 32%;
  opacity: 0.44;
  mix-blend-mode: screen;
  filter: brightness(1.6);
  animation: slow-counter 20s linear infinite;
}

.fine-line {
  z-index: 9;
  opacity: 0.72;
  mix-blend-mode: screen;
}

.fine-line-a {
  top: 42%;
  left: 70%;
  width: 33%;
}

.fine-line-b {
  top: 54%;
  left: 11%;
  width: 30%;
}

.sign {
  z-index: 10;
  opacity: 0.68;
  mix-blend-mode: screen;
  filter: brightness(1.45);
  animation: sign-flicker 4.2s steps(1, end) infinite;
}

.sign-a {
  top: 41%;
  left: 75%;
  width: 12%;
}

.sign-b {
  top: 45%;
  left: 80%;
  width: 8%;
  animation-delay: -1.3s;
}

.sign-c {
  top: 50%;
  left: 84%;
  width: 5%;
  animation-delay: -2.1s;
}

.claim-flash {
  position: absolute;
  top: 42%;
  left: 60%;
  z-index: 19;
  width: 7%;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  background: white;
  box-shadow:
    0 0 30px 16px white,
    0 0 90px 55px #fff578,
    0 0 190px 80px rgba(122, 208, 255, 0.74);
  transform: translate(-50%, -50%) scale(0.1);
  pointer-events: none;
}

.claim-ring {
  position: absolute;
  top: 42%;
  left: 60%;
  z-index: 18;
  width: 8%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 252, 205, 0.9);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2);
  pointer-events: none;
}

.card-stage.claimed .claim-flash {
  animation: claim-flash 950ms ease-out both;
}

.card-stage.claimed .claim-ring-a {
  animation: claim-ring 980ms ease-out both;
}

.card-stage.claimed .claim-ring-b {
  animation: claim-ring 980ms 100ms ease-out both;
}

.card-stage.claimed .moon-system {
  animation: claim-moon 1s var(--ease-out);
}

.reward-copy {
  position: absolute;
  bottom: 7.4%;
  left: 50%;
  z-index: 31;
  width: 100%;
  display: grid;
  justify-items: center;
  color: white;
  text-align: center;
  text-shadow:
    0 2px 2px rgba(0, 0, 0, 0.95),
    0 0 5px rgba(0, 0, 0, 0.92),
    1px 0 0 rgba(0, 0, 0, 0.75),
    -1px 0 0 rgba(0, 0, 0, 0.75);
  transform: translateX(-50%);
}

.reward-copy p {
  margin: 0;
}

.remaining {
  font-size: clamp(26px, 2.25vw, 42px);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.remaining strong {
  color: #fff45e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22em;
  font-weight: 500;
  -webkit-text-stroke: 1px rgba(55, 61, 60, 0.92);
  text-shadow:
    0 0 18px rgba(255, 239, 58, 0.42),
    0 2px 1px rgba(0, 0, 0, 0.7);
}

#claim-copy {
  margin-top: 3px;
  font-size: clamp(15px, 1.35vw, 24px);
  font-weight: 750;
}

.user-id {
  position: absolute;
  right: 10px;
  bottom: 4px;
  z-index: 31;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(10px, 0.9vw, 17px);
  font-weight: 700;
  text-shadow:
    0 1px 2px black,
    0 0 4px black;
}

.interaction-hint {
  position: absolute;
  left: 16px;
  bottom: 13px;
  z-index: 31;
  color: rgba(255, 255, 255, 0.32);
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0;
  transition: opacity 180ms ease;
}

.experience:hover .interaction-hint {
  opacity: 1;
}

.experience.paused *,
.experience.paused *::before,
.experience.paused *::after {
  animation-play-state: paused !important;
}

@keyframes stage-enter {
  0% {
    opacity: 0;
    filter: blur(18px) brightness(2.4);
    transform:
      translate(-50%, -45%)
      perspective(1400px)
      rotateX(-12deg)
      rotateY(-18deg)
      scale(0.55);
  }
  58% {
    opacity: 1;
    filter: blur(0) brightness(1.28);
  }
  100% {
    filter: blur(0) brightness(1);
  }
}

@keyframes background-breathe {
  to {
    transform: scale(1.045) translate3d(-0.6%, -0.4%, 0);
    filter: brightness(0.88) saturate(0.86);
  }
}

@keyframes prism-pulse {
  0%,
  100% {
    opacity: 0.31;
    transform: translateX(-50%) scale(1.03);
  }
  48% {
    opacity: 0.51;
    transform: translateX(-50%) scale(1.08);
  }
}

@keyframes geometry-drift-a {
  to {
    transform: translate3d(3%, -2%, 0) rotate(1.5deg);
  }
}

@keyframes geometry-drift-b {
  to {
    transform: translate3d(-3%, 2%, 0) rotate(-2deg);
  }
}

@keyframes card-sheen {
  0%,
  30%,
  100% {
    opacity: 0.12;
    filter: brightness(1.1);
  }
  52% {
    opacity: 0.36;
    filter: brightness(1.7);
  }
}

@keyframes moon-float {
  0%,
  100% {
    transform: translateZ(24px) translateY(0);
  }
  50% {
    transform: translateZ(24px) translateY(-6px);
  }
}

@keyframes core-breathe {
  50% {
    filter:
      brightness(1.18)
      drop-shadow(0 0 28px rgba(255, 253, 205, 0.96));
    transform: scale(1.025);
  }
}

@keyframes edge-left {
  50% {
    transform: rotate(10deg) scale(1.01);
  }
}

@keyframes edge-right {
  50% {
    transform: rotate(-11deg) scale(1.025);
  }
}

@keyframes star-turn {
  to {
    transform: rotate(360deg);
  }
}

@keyframes star-counter {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes star-pulse {
  50% {
    transform: scale(1.14) rotate(8deg);
    filter:
      saturate(1.55)
      brightness(1.42)
      drop-shadow(0 0 22px rgba(110, 211, 255, 1));
  }
}

@keyframes bubbles-float {
  50% {
    transform: translate3d(5px, -16px, 18px) rotate(-2deg);
    opacity: 1;
  }
}

@keyframes slow-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes slow-counter {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes sign-flicker {
  0%,
  8%,
  12%,
  100% {
    opacity: 0.68;
  }
  9%,
  11% {
    opacity: 0.18;
  }
  58% {
    opacity: 0.86;
  }
}

@keyframes claim-flash {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.08);
  }
  24% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(3.8);
  }
}

@keyframes claim-ring {
  0% {
    opacity: 0.92;
    transform: translate(-50%, -50%) scale(0.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(12);
  }
}

@keyframes claim-moon {
  0% {
    transform: translateZ(24px) scale(1);
  }
  28% {
    transform: translateZ(70px) scale(1.12) rotate(4deg);
    filter: brightness(2);
  }
  100% {
    transform: translateZ(24px) scale(1);
  }
}

@media (max-width: 820px) {
  .experience {
    min-height: 500px;
  }

  .card-stage {
    top: 45%;
    left: 46%;
    width: 105vw;
  }

  .reward-copy {
    bottom: 11%;
  }

  .controls {
    top: 10px;
    right: 10px;
  }

  .user-id,
  .interaction-hint {
    display: none;
  }
}

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