:root {
  color-scheme: dark;
  --gold: #ffd34f;
  --gold-deep: #c47a10;
  --green: #00b86b;
  --ink: #050807;
  --white-soft: rgba(255, 255, 255, .86);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  min-height: 100dvh;
  background: #030303;
  color: #fff;
  display: grid;
  place-items: start center;
  overflow: hidden;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  user-select: none;
  touch-action: none;
}

.stage {
  position: relative;
  width: min(100vw, 500px);
  height: 100dvh;
  min-height: 620px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 80px rgba(0, 0, 0, .8);
}

.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .08), rgba(0, 0, 0, .1) 44%, rgba(0, 0, 0, .76));
  pointer-events: none;
}

.scene-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
  background: #000;
  opacity: 0;
  transition: opacity .35s ease;
}

.scene-video.is-playing {
  opacity: 1;
}

.loading {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #000;
  transition: opacity .55s ease, visibility .55s ease;
}

.loading.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.ball-loader {
  font-size: 42px;
  animation: ball-bounce .88s ease-in-out infinite;
}

.loading-track {
  width: min(76vw, 320px);
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, .12);
}

.loading-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, .7), #fff, rgba(255, 211, 79, .8));
  transition: width .2s ease;
}

.loading-meta {
  display: flex;
  gap: 10px;
  color: rgba(255, 255, 255, .46);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tap-start {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 13%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .88);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
  transition: opacity .35s ease, transform .35s ease;
}

.tap-start.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
}

.tap-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .65);
  border-radius: 50%;
  background: rgba(0, 0, 0, .22);
  animation: tap-pulse 1.7s ease-in-out infinite;
}

.tap-icon svg {
  width: 32px;
  height: 32px;
  fill: #fff;
}

.swipe-guide {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 10%;
  width: min(82%, 360px);
  transform: translate(-50%, 28px);
  opacity: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  pointer-events: none;
  transition: opacity .45s ease, transform .45s ease;
}

.swipe-guide.is-visible {
  opacity: 1;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.swipe-guide strong {
  color: #fff;
  font-size: clamp(26px, 8vw, 42px);
  line-height: 1;
  text-shadow: 0 3px 18px rgba(0, 0, 0, .72);
}

.swipe-guide small {
  color: var(--gold);
  font-size: clamp(15px, 4vw, 19px);
  font-weight: 900;
  letter-spacing: .08em;
}

.arrow-stack {
  display: grid;
  gap: 0;
  transform: translateY(0);
  animation: arrow-float 1.2s ease-in-out infinite;
}

.arrow-stack span {
  width: 44px;
  height: 44px;
  border-top: 9px solid #fff;
  border-left: 9px solid #fff;
  transform: rotate(45deg);
  margin-top: -19px;
  opacity: .42;
}

.arrow-stack span:nth-child(2) {
  opacity: .7;
}

.arrow-stack span:nth-child(3) {
  opacity: 1;
}

.shot-effect {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
}

.shot-effect.is-active {
  opacity: 1;
}

.flying-ball {
  position: absolute;
  left: 62%;
  bottom: 26%;
  font-size: 58px;
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, .45));
}

.shot-effect.is-active .flying-ball {
  animation: ball-shot 1.25s cubic-bezier(.16, .86, .26, 1) forwards;
}

.trail {
  position: absolute;
  left: 56%;
  bottom: 25%;
  width: 180px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .82));
  transform: rotate(-38deg);
  opacity: 0;
}

.trail-two {
  bottom: 30%;
  width: 130px;
  background: linear-gradient(90deg, transparent, rgba(255, 211, 79, .92));
}

.shot-effect.is-active .trail {
  animation: trail .78s ease-out forwards;
}

.shot-effect.is-active .goal-flash {
  position: absolute;
  inset: -10%;
  background: radial-gradient(circle at 50% 22%, rgba(255, 255, 255, .96), rgba(255, 211, 79, .42) 24%, transparent 48%);
  animation: flash 1.1s ease-out forwards;
}

.scene-claim {
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.03);
  transition: opacity .62s ease, transform .62s ease, visibility .62s ease;
}

.scene-claim.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}

.stage.is-claiming .scene-play {
  pointer-events: none;
}

.scene-claim::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, .06) 38%, rgba(0, 0, 0, .82) 74%, rgba(0, 0, 0, .94) 100%),
    radial-gradient(circle at 50% 68%, rgba(255, 20, 20, .22), transparent 42%);
}

.claim-photo {
  object-position: center 60%;
}

.claim-panel {
  position: absolute;
  z-index: 90;
  left: 18px;
  right: 18px;
  bottom: max(24px, env(safe-area-inset-bottom));
  padding: 18px 16px 15px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)),
    linear-gradient(180deg, rgba(20, 0, 0, .24), rgba(0, 0, 0, .36)),
    radial-gradient(circle at 50% 0%, rgba(255, 44, 44, .28), transparent 62%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, .36),
    0 0 38px rgba(255, 0, 0, .14),
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 0 0 1px rgba(255, 211, 79, .16);
  text-align: center;
}

.claim-panel::before,
.claim-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.claim-panel::before {
  left: 18px;
  right: 18px;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 40, 40, .9), rgba(255, 211, 79, .72), transparent);
  box-shadow: 0 0 16px rgba(255, 40, 40, .6);
}

.claim-panel::after {
  inset: 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 211, 79, .14);
}

.win-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 80, 80, .58);
  background: rgba(255, 0, 0, .08);
  color: #fff;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  box-shadow: 0 8px 24px rgba(255, 0, 0, .16), inset 0 1px 0 rgba(255, 255, 255, .12);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
}

.claim-panel h1 {
  margin: 11px 0 8px;
  font-size: clamp(27px, 7vw, 36px);
  line-height: 1.08;
  letter-spacing: 0;
  color: #fff;
  text-shadow: 0 6px 24px rgba(0, 0, 0, .74);
}

.claim-panel h1 strong {
  display: inline-block;
  padding: 0 5px;
  color: #ffeded;
  text-shadow: 0 0 18px rgba(255, 0, 0, .62), 0 4px 18px rgba(0, 0, 0, .75);
  transform: translateY(1px);
}

.claim-panel p {
  width: min(100%, 360px);
  margin: 0 auto 12px;
  color: rgba(255, 247, 223, .88);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 800;
}

.bonus-chips {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
}

.bonus-chips span {
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(255, 211, 79, .34);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: rgba(255, 247, 223, .9);
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 25, 25, .16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  font-size: 12px;
  font-weight: 900;
}

.claim-button,
.played-card button {
  min-height: 62px;
  border: 0;
  border-radius: 8px;
  position: relative;
  z-index: 100;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: #141000;
  background: linear-gradient(180deg, #ff7a70 0%, #ff1f1f 42%, #9b0000 100%);
  box-shadow: 0 18px 36px rgba(255, 0, 0, .34), 0 0 34px rgba(255, 35, 35, .34), inset 0 1px 0 rgba(255, 255, 255, .42);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  text-decoration: none;
  animation: cta-heartbeat 1.35s ease-in-out infinite;
}

.claim-button::after {
  content: "";
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: -28%;
  width: 24%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
  transform: skewX(-18deg);
  animation: claim-shine 2.2s ease-in-out infinite;
}

.claim-note {
  display: block;
  margin-top: 12px;
  color: rgba(255, 247, 223, .52);
  font-size: 12px;
  font-weight: 800;
}

.played-modal {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(0, 0, 0, .74);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.played-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.played-card {
  width: min(100%, 320px);
  padding: 24px;
  border-radius: 8px;
  background: #111;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
  text-align: center;
}

.played-card h2 {
  margin: 0 0 8px;
  color: #ff7066;
  font-size: 24px;
}

.played-card p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, .68);
  line-height: 1.55;
}

@keyframes ball-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(160deg); }
}

@keyframes tap-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: .5; }
}

@keyframes arrow-float {
  0%, 100% { transform: translateY(8px); }
  50% { transform: translateY(-8px); }
}

@keyframes ball-shot {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  62% { transform: translate(-108px, -360px) scale(.72) rotate(520deg); }
  100% { transform: translate(-122px, -420px) scale(.1) rotate(760deg); opacity: 0; }
}

@keyframes trail {
  0% { opacity: 0; transform: translate(0, 0) rotate(-38deg) scaleX(.3); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: translate(-92px, -148px) rotate(-46deg) scaleX(1.2); }
}

@keyframes flash {
  0%, 60% { opacity: 0; }
  78% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes claim-shine {
  0%, 36% { left: -30%; }
  62%, 100% { left: 112%; }
}

@keyframes cta-heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.045); }
  28% { transform: scale(1); }
  42% { transform: scale(1.035); }
  58% { transform: scale(1); }
}

@media (min-width: 760px) {
  body {
    background:
      radial-gradient(circle at 50% 20%, rgba(255, 211, 79, .16), transparent 34%),
      #050505;
  }
}

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