/* ===== GLOBAL ===== */
html, body{ width:100%; overflow-x:hidden; }

body{
  font-family: Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 12px;
  box-sizing: border-box;

  background: url("/assets/bg.webp") no-repeat center center fixed;
  background-size: cover;
  color: #fff;
}

/* ===== CARD ===== */
.card{
  width: 95%;
  max-width: 640px;
  padding: 20px;
  border-radius: 16px;

  /* Radial gradient fill (center → outward) */
  background:
    radial-gradient(
      circle at center,
      #1a2f6b 0%,
      #111a2e 55%,
      #0e1629 100%
    );

  /* Outer glowing dark-blue edge */
  box-shadow:
    0 0 0 1px rgba(80,140,255,.25),
    0 0 18px rgba(60,120,255,.35),
    0 0 36px rgba(40,90,220,.25),
    0 16px 40px rgba(0,0,0,.65);

  position: relative;
}

h2{
  margin: 0 0 12px;
}

/* ===== INPUT ===== */
input{
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #2a3554;
  background: #0c1324;
  color: #fff;
  font-size: 16px;
  letter-spacing: .6px;
  outline: none;
}

.headerLogos{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

/* Main logo */
.logoMain{
  width: 80px;
  max-width: 80%;
  height: auto;
}

/* Lucky draw image */
.logoSub{
  width: 280px;
  max-width: 75%;
  height: auto;
}

/* ================= SPIN BUTTON ================= */
button{
  /* Uiverse variables */
  --clr-font-main: hsla(0 0% 20% / 100);
  --btn-bg-1: hsla(194 100% 69% / 1);
  --btn-bg-2: hsla(217 100% 56% / 1);
  --btn-bg-color: hsla(360 100% 100% / 1);
  --radii: 0.5em;

  cursor: pointer;
  margin-top: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0.9em 1.4em;

  font-size: 16px;
  font-weight: 700;
  color: var(--btn-bg-color);

  border: none;
  border-radius: var(--radii);

  background-size: 280% auto;
  background-image: linear-gradient(
    325deg,
    var(--btn-bg-2) 0%,
    var(--btn-bg-1) 55%,
    var(--btn-bg-2) 90%
  );

  box-shadow:
    0px 0px 20px rgba(71, 184, 255, 0.5),
    0px 5px 5px -1px rgba(58, 125, 233, 0.25),
    inset 4px 4px 8px rgba(175, 230, 255, 0.5),
    inset -4px -4px 8px rgba(19, 95, 216, 0.35);

  transition: 0.8s;
  position: relative;
  overflow: hidden;
}

/* ================= LEFT → RIGHT GLOW SWEEP ================= */
button::before{
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 80%;
  height: 100%;
  pointer-events: none;

  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(120,190,255,0.15) 30%,
    rgba(160,215,255,0.35) 45%,
    rgba(200,235,255,0.55) 50%,
    rgba(160,215,255,0.35) 55%,
    rgba(120,190,255,0.15) 70%,
    transparent 100%
  );

  animation: glowSweep 2.6s cubic-bezier(.4,0,.2,1) infinite;
}

button:hover{
  background-position: right top;
}

button:is(:focus, :focus-visible, :active){
  outline: none;
  box-shadow:
    0 0 0 3px var(--btn-bg-color),
    0 0 0 6px var(--btn-bg-2);
}

button:disabled{
  opacity: .6;
  cursor: not-allowed;
  box-shadow: none;
}

button:disabled::before{
  animation: none;
}

@keyframes glowSweep{
  0%{ transform: translateX(-130%); opacity: 0; }
  12%{ opacity: 1; }
  88%{ opacity: 1; }
  100%{ transform: translateX(230%); opacity: 0; }
}

/* ================= CLAIM BUTTON (NO CONFLICT) ================= */
.claimBtn{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-top: 12px;
  padding: 15px 32px;
  border: none;
  border-radius: 999px;

  font-weight: 800;
  font-size: 14px;
  text-align: center;

  cursor: pointer;
  color: rgb(37, 37, 37);
  background: #ffffff;

  position: relative;
  overflow: hidden;
  z-index: 0;

  box-shadow: 0 0px 7px -5px rgba(0,0,0,.5);
  transition: all .2s ease;
}

/* kill global sweep for claim button */
.claimBtn::before{ display:none; }

.claimBtn:hover{
  background: rgb(193,228,248);
  color: rgb(33,0,85);
}

.claimBtn:active{
  transform: scale(.97);
}

/* Glow wrapper */
.claimGlow{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: -1;
  pointer-events: none;
}

/* Animated glow blob */
.claimGlow span{
  width: 10rem;
  height: 10rem;
  border-radius: 50%;

  background: linear-gradient(
    90deg,
    rgba(222,0,75,1) 0%,
    rgba(191,70,255,1) 49%,
    rgba(0,212,255,1) 100%
  );

  filter: blur(20px);
  opacity: .55;
  animation: claimRotate 3s linear infinite;
}

.claimBtn:hover .claimGlow span{
  width: 8rem;
  height: 8rem;
}

@keyframes claimRotate{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}

/* ================= REDUCED MOTION ================= */
@media (prefers-reduced-motion: reduce){
  button{ transition: linear; }
  button::before{ animation: none; }
}

/* ===== SMALL TEXT ===== */
.small{
  opacity: .75;
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.35;
}

/* ===== WHEEL WRAP ===== */
.wheelWrap{
  margin-top: 18px;
  display: flex;
  justify-content: center;
  position: relative;
  padding-top: 18px;
}

/* ===== POINTER ===== */
.pointer{
  position: absolute;
  top: 0;
  width: 0;
  height: 0;

  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 18px solid #ff2d2d;

  z-index: 6;
}

/* ===== WHEEL ===== */
.wheel{
  width: min(360px, 86vw);
  height: min(360px, 86vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 10px solid #0c1324;
  transition: transform 4s cubic-bezier(.2,.9,.2,1);
  position: relative;
  overflow: hidden;
}

/* ===== CANVAS FALLBACK ===== */
#wheelCanvas{
  display: none;
  width: min(360px, 86vw);
  height: min(360px, 86vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 10px solid #0c1324;
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
}

/* ===== LABELS ===== */
.labels{
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.label{
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 50% 50%;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
}

/* ===== CENTER DOT ===== */
.centerDot{
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #ffdd57;
  z-index: 7;
}

/* ===== MESSAGE ===== */
.msg{
  margin-top: 14px;
  min-height: 26px;
  font-weight: 700;
}

.msg.ok{ color: #7CFC9A; }
.msg.err{ color: #ff7676; }

/* ===== CONIC FALLBACK ===== */
.no-conic #wheel{ display: none; }
.no-conic #wheelCanvas{ display: block; }

/* ================= POPUP MODAL ================= */
.popupOverlay{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;

  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
}

.popupOverlay.show{
  display: flex;
}

.popupModal{
  width: 95%;
  max-width: 640px;
  border-radius: 16px;
  border: 1px solid rgba(80,140,255,.25);

  background:
    radial-gradient(circle at 20% 0%, rgba(55,125,255,.18), transparent 42%),
    radial-gradient(circle at 100% 100%, rgba(250,204,21,.14), transparent 46%),
    #0c1324;

  box-shadow:
    0 0 0 1px rgba(80,140,255,.18),
    0 18px 50px rgba(0,0,0,.7);

  padding: 16px;
  position: relative;
}

.popupHeader{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.popupTitle{
  font-weight: 900;
  font-size: 18px;
  letter-spacing: .2px;
}

.popupClose{
  width: 42px;
  height: 42px;
  margin-top: 0;
  padding: 0;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
}

/* Make close button not full-width */
.popupClose{
  width: 42px !important;
  min-height: 42px !important;
  flex: 0 0 auto;
}

.popupMessage{
  margin-top: 6px;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.35;
}

.tokenBox{
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(80,140,255,.18);
}

.tokenLabel{
  font-size: 12px;
  opacity: .85;
  margin-bottom: 8px;
}

.tokenRow{
  display: flex;
  align-items: center;
  gap: 10px;
}

.tokenValue{
  flex: 1 1 auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12.5px;
  letter-spacing: .6px;
  word-break: break-all;
}

/* Copy button must be compact (override global button width) */
.copyBtn{
  width: auto !important;
  min-height: 40px !important;
  padding: 0.7em 1em !important;
  margin-top: 0 !important;
  flex: 0 0 auto;
  border-radius: 12px;
}

.copyHint{
  margin-top: 8px;
  font-size: 12px;
  min-height: 16px;
  opacity: .9;
}

.popupOkBtn{
  margin-top: 14px;
}
