:root {
  --bg: #0b0b0d;
  --card: #15151d;
  --gold: #f7c84b;
  --gold2: #ffda6b;
  --neon: #28e070;
  --text: #e7e7ee;
  --muted: #a0a0b3;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: radial-gradient(
      1200px 800px at 70% -10%,
      #17171f 0%,
      var(--bg) 60%
    )
    fixed;
  color: var(--text);
  font: 500 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.wrap {
  width: min(100%, 460px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  text-align: center;
}

.logo {
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(247, 200, 75, 0.12);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--neon);
  background: rgba(40, 224, 112, 0.09);
  border: 1px solid rgba(40, 224, 112, 0.25);
  font-size: 0.9rem;
}
.pill strong {
  display: none;
  font-weight: 700;
}
.pill strong.visible {
  display: inline;
}
.card {
  width: 100%;
  background: linear-gradient(180deg, #171722, #101018);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.scratch-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  user-select: none;
  -webkit-user-select: none;
}
.prize-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(1.15) brightness(0.92);
  transform: scale(1.02);
  pointer-events: none;
  z-index: 0;
}
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: auto;
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.overlay-label {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  backdrop-filter: blur(4px);
  text-align: center;
}

.cta {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  border: 0;
  cursor: pointer;
  width: 100%;
  background: linear-gradient(180deg, var(--gold), #f5b911);
  color: #111;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(247, 200, 75, 0.25);
  transition: 0.2s transform, 0.2s box-shadow, 0.2s filter;
  text-decoration: none;
}
.cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(247, 200, 75, 0.33);
}
.cta:active {
  transform: translateY(0);
  filter: saturate(0.95);
}
.cta[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.meta {
  color: var(--muted);
  font-size: 0.8rem;
}

/* Modal + confete */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 20;
}
.modal.on {
  display: grid;
}
.modal-card {
  width: min(92vw, 460px);
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(180deg, #14141c, #0f0f16);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
  overflow: hidden;
  transform: scale(0.9);
  opacity: 0;
}
.modal.on .modal-card {
  animation: prize-pop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.modal.on .modal-card .shine {
  animation-delay: 0.2s;
}
@keyframes prize-pop {
  0% {
    transform: scale(0.82);
    opacity: 0;
  }
  60% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.shine {
  position: absolute;
  inset: -40% -80%;
  rotate: 15deg;
  background: radial-gradient(
    closest-side,
    rgba(255, 255, 255, 0.08),
    transparent 60%
  );
  animation: sweep 2.3s linear infinite;
  pointer-events: none;
}
@keyframes sweep {
  from {
    transform: translateX(-40%);
  }
  to {
    transform: translateX(40%);
  }
}
.modal h3 {
  margin: 8px 0 6px;
  font-size: 1.35rem;
}
.modal p {
  margin: 0 0 14px;
  color: var(--muted);
}
.confetti {
  pointer-events: none;
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 30;
}
.confetti i {
  position: absolute;
  width: 8px;
  height: 14px;
  background: #f7c84b;
  left: 50%;
  top: -20px;
  opacity: 0.9;
  animation: fall 2.2s linear forwards;
  transform: translateX(var(--x)) rotate(var(--r));
}
.confetti i:nth-child(odd) {
  background: #ffda6b;
}
@keyframes fall {
  to {
    transform: translate(calc(var(--x) * 1.2), 110vh)
      rotate(calc(var(--r)+360deg));
    opacity: 1;
  }
}
