@property --a {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

:root {
  --rgb: #ff0040, #ff8a00, #ffe600, #2bff6a, #00d4ff, #6a5cff, #ff2bd6, #ff0040;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #6b0909;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: '';
  position: fixed;
  inset: -40px;
  background: url(../images/bg.webp) center / cover no-repeat;
  filter: blur(28px) saturate(1.3) brightness(0.75);
  z-index: 0;
}

img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

button {
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  border: 0;
  background: none;
}

button[aria-busy='true'] {
  cursor: progress;
  filter: brightness(0.85);
}

.stage {
  position: relative;
  z-index: 1;
  width: min(100vw, calc(100dvh * 768 / 1365));
  height: 100dvh;
  overflow: hidden;
  container-type: inline-size;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.55);
}

.stage::before {
  content: '';
  position: absolute;
  inset: -24px;
  background: url(../images/bg.webp) center / 100% 100% no-repeat;
  filter: blur(14px) saturate(1.15);
}

.canvas {
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  aspect-ratio: 768 / 1365;
  transform: translateY(-50%);
  background: url(../images/bg.webp) center / 100% 100% no-repeat;
  -webkit-mask: linear-gradient(transparent, #000 7%, #000 93%, transparent);
  mask: linear-gradient(transparent, #000 7%, #000 93%, transparent);
  container-type: inline-size;
}

.glow {
  position: absolute;
  left: 50%;
  top: 64%;
  width: 90%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 236, 160, 0.55) 0%, rgba(255, 190, 60, 0.18) 38%, transparent 66%);
  mix-blend-mode: screen;
  animation: breathe 3.2s ease-in-out infinite;
  pointer-events: none;
}

.reg {
  position: absolute;
  top: 27.6%;
  width: 31.6%;
  transform: translateX(-50%);
  border-radius: 0.6cqw;
  overflow: hidden;
  animation: regGlow 2.4s ease-in-out infinite;
  z-index: 3;
}

.reg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.75) 48%, transparent 66%);
  transform: translateX(-120%);
  animation: sweep 2.8s ease-in-out infinite;
}

.reg-1 {
  left: 17.4%;
}

.reg-2 {
  left: 50.1%;
  animation-delay: -0.8s;
}

.reg-2::after {
  animation-delay: 0.35s;
}

.reg-3 {
  left: 82.9%;
  animation-delay: -1.6s;
}

.reg-3::after {
  animation-delay: 0.7s;
}

.hb {
  position: absolute;
  top: 38.4%;
  width: 27.4%;
  transform: translateX(-50%);
  z-index: 4;
  animation: bob 2.6s ease-in-out infinite;
  transition: filter 0.2s;
}

.hb img {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 1.4cqw 1.6cqw rgba(90, 0, 0, 0.55));
}

.hb:hover img,
.hb:focus-visible img {
  filter: drop-shadow(0 0 2cqw rgba(255, 230, 120, 0.95));
}

.hb:active {
  animation-play-state: paused;
}

.hb-1 {
  left: 17.4%;
}

.hb-2 {
  left: 50.1%;
  animation-delay: -0.9s;
}

.hb-3 {
  left: 82.9%;
  animation-delay: -1.7s;
}

.rays {
  position: absolute;
  left: 50%;
  top: 34%;
  width: 165%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 235, 1) 0 10%, rgba(255, 230, 120, 0.7) 22%, transparent 42%), repeating-conic-gradient(from var(--a), rgba(255, 252, 215, 1) 0 7deg, rgba(255, 210, 80, 0.35) 9deg, transparent 11deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 26%, transparent 70%);
  mask: radial-gradient(circle, #000 26%, transparent 70%);
  filter: brightness(1.25) drop-shadow(0 0 1.2cqw rgba(255, 220, 110, 0.9));
  animation: spin 9s linear infinite, raysPulse 2.4s ease-in-out infinite;
}

.star {
  position: absolute;
  z-index: 2;
  width: 7%;
  aspect-ratio: 1;
  background: radial-gradient(circle, #fff 0 12%, transparent 14%), conic-gradient(from 45deg, transparent 0 20deg, #fff8c8 22deg 26deg, transparent 28deg 110deg, #fff8c8 112deg 116deg, transparent 118deg 200deg, #fff8c8 202deg 206deg, transparent 208deg 290deg, #fff8c8 292deg 296deg, transparent 298deg);
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%);
  mask: radial-gradient(circle, #000 30%, transparent 70%);
  animation: twinkle 1.8s ease-in-out infinite;
}

.s1 {
  left: 12%;
  top: 14%;
}

.s2 {
  right: 10%;
  top: 30%;
  animation-delay: 0.6s;
}

.s3 {
  left: 22%;
  top: 52%;
  animation-delay: 1.2s;
}

.podium {
  position: absolute;
  left: 50%;
  top: 64.6%;
  width: 76%;
  height: 8.6%;
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
}

.podium-base {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 34%;
  bottom: 0;
  border-radius: 0 0 50% 50% / 0 0 60% 60%;
  background: linear-gradient(90deg, #7a3d00, #f6c454 22%, #fff1b0 50%, #f6c454 78%, #7a3d00);
  box-shadow: 0 2cqw 4cqw rgba(60, 0, 0, 0.6);
}

.podium-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 62%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #fff6c9 0%, #ffd25a 40%, #b56a00 78%, #6d3600 100%);
  z-index: 1;
}

.podium-ring {
  position: absolute;
  left: 1.5%;
  right: 1.5%;
  top: 4%;
  height: 54%;
  border-radius: 50%;
  z-index: 2;
  padding: 0.7cqw;
  background: conic-gradient(from var(--a), var(--rgb));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  filter: drop-shadow(0 0 1.2cqw #fff);
  animation: spin 2.4s linear infinite reverse;
}

.cta {
  position: absolute;
  left: 50%;
  top: 58.6%;
  width: 68%;
  transform: translateX(-50%);
  z-index: 5;
  animation: pulse 1.6s ease-in-out infinite;
}

.cta img {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 1cqw 1.4cqw rgba(80, 0, 0, 0.6));
}

.cta-halo {
  position: absolute;
  inset: 12% 3%;
  border-radius: 999px;
  background: conic-gradient(from var(--a), var(--rgb));
  filter: blur(3cqw);
  opacity: 0.95;
  animation: spin 2.2s linear infinite;
}

.cta-shine {
  position: absolute;
  inset: 14% 5%;
  z-index: 2;
  border-radius: 999px;
  overflow: hidden;
  pointer-events: none;
}

.cta-shine::before {
  content: '';
  position: absolute;
  top: -20%;
  bottom: -20%;
  width: 22%;
  left: -30%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  transform: skewX(-20deg);
  animation: shine 2.4s ease-in-out infinite;
}

.cta:active {
  animation: none;
  transform: translateX(-50%) scale(0.96);
}

.fx {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.coin,
.bit {
  position: absolute;
  top: -8%;
  will-change: transform;
  animation: fall linear forwards;
}

.coin {
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7cf 0 12%, #ffd34d 30%, #e39a00 70%, #9c5a00 100%);
  box-shadow: inset 0 0 0 0.35cqw rgba(255, 240, 170, 0.8), 0 0 1.4cqw rgba(255, 210, 80, 0.7);
}

.bit {
  border-radius: 0.3cqw;
}

.status-note {
  position: absolute;
  left: 50%;
  bottom: 4%;
  transform: translateX(-50%);
  z-index: 7;
  color: #fff;
  font-size: 3.4cqw;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 1px 4px #000;
  white-space: nowrap;
}

@keyframes spin {
  to {
    --a: 360deg;
  }
}

@keyframes breathe {
  50% {
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@keyframes regGlow {
  0%,
  100% {
    box-shadow: 0 0 0.6cqw rgba(255, 215, 80, 0.6), 0 0 0 0.25cqw rgba(255, 210, 90, 0.7);
  }
  50% {
    box-shadow: 0 0 2.6cqw rgba(255, 60, 60, 0.95), 0 0 0 0.25cqw rgba(255, 245, 190, 1);
  }
}

@keyframes sweep {
  0%,
  35% {
    transform: translateX(-120%);
  }
  75%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateX(-50%) translateY(-1.6cqw) rotate(1deg);
  }
}

@keyframes raysPulse {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.3) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1) rotate(45deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.06);
  }
}

@keyframes shine {
  0%,
  40% {
    left: -30%;
  }
  80%,
  100% {
    left: 120%;
  }
}

@keyframes fall {
  to {
    transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--r));
  }
}

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

  .fx {
    display: none;
  }
}
