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 {
  width: 95%;
  max-width: 640px;
  padding: 20px;
  border-radius: 16px;
  background:
    radial-gradient(circle at center, #1a2f6b 0%, #111a2e 55%, #0e1629 100%);
  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;
}

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;
}

.logoMain {
  width: 80px;
  max-width: 80%;
  height: auto;
}

.logoSub {
  width: 280px;
  max-width: 75%;
  height: auto;
}

#username { margin-bottom: 6px; }
#code { margin-top: 10px; }

.small {
  opacity: .85;
  font-size: 12px;
  margin-top: 6px;
  margin-bottom: 8px;
  line-height: 1.35;
}

button {
  --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:
    0 0 20px rgba(71, 184, 255, 0.5),
    0 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;
}

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; }
}

.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 0 7px -5px rgba(0,0,0,.5);
  transition: all .2s ease;
}

.claimBtn::before { display: none; }

.claimBtn:hover {
  background: rgb(193,228,248);
  color: rgb(33,0,85);
}

.claimBtn:active { transform: scale(.97); }

.claimGlow {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: -1;
  pointer-events: none;
}

.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); }
}

@media (prefers-reduced-motion: reduce) {
  button { transition: linear; }
  button::before { animation: none; }
}

.wheelWrap {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  position: relative;
  padding-top: 18px;
}

.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 {
  width: min(360px, 86vw);
  height: min(360px, 86vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 10px solid #0c1324;
  transition: transform 4.2s cubic-bezier(.15,.95,.2,1);
  position: relative;
  overflow: hidden;
  will-change: transform;
}

#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;
  will-change: transform;
}

.labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 50% 50%;
  font-weight: 800;
  color: #000;
  text-shadow: 0 2px 8px rgba(0,0,0,.35);
  white-space: normal;
  text-align: center;
  pointer-events: none;
  line-height: 1.02;
  width: 92px;
  font-size: 14px !important;
}

.label.multiline {
  width: 108px;
  font-size: 13px !important;
}

.label.specialPrize {
  font-weight: 900;
  letter-spacing: .2px;
  text-transform: uppercase;
  line-height: 1.02;
  text-shadow: none;
}

.label.specialPrize.specialWhite {
  color: #ffffff !important;
  text-shadow:
    0 0 2px rgba(0,0,0,.95),
    0 0 8px rgba(0,0,0,.75),
    0 2px 10px rgba(0,0,0,.85);
}

.label.specialPrize.specialBlack {
  color: #111111 !important;
  text-shadow:
    0 0 2px rgba(255,255,255,.95),
    0 0 8px rgba(255,255,255,.8),
    0 2px 10px rgba(255,255,255,.7);
}

.label.specialPrize.multiline {
  width: 116px;
  font-size: 14px !important;
}

.centerDot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #ffdd57;
  z-index: 7;
}

.msg {
  margin-top: 14px;
  min-height: 26px;
  font-weight: 700;
}

.msg.ok { color: #7CFC9A; }
.msg.err { color: #ff7676; }

.no-conic #wheel { display: none; }
.no-conic #wheelCanvas { display: block; }

.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;
}

.winnerUsername {
  color: #ffd54a;
  text-shadow:
    0 0 8px rgba(255,213,74,.45),
    0 0 16px rgba(255,213,74,.25);
}

.popupClose {
  width: 42px !important;
  height: 42px;
  min-height: 42px !important;
  margin-top: 0;
  padding: 0;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
  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;
}

.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;
}

@media (max-width: 480px) {
  .card { padding: 16px; }
  .logoSub { width: 230px; }

  .label {
    width: 82px;
    font-size: 12px !important;
  }

  .label.multiline {
    width: 94px;
    font-size: 11px !important;
  }

  .label.specialPrize.multiline {
    width: 98px;
    font-size: 11px !important;
  }
}