:root {
  --bg: #0d131d;
  --panel: #16202e;
  --gold: #f7a600;
  --green: #28a745;
  --green-2: #1e7e34;
  --ink: #ffffff;
  --muted: #93a2b5;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(120% 80% at 50% 0%, #16202e 0%, #0d131d 60%);
  color: var(--ink);
  font-family: "Arial", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100%;
  text-align: center;
}

.container {
  max-width: 500px;
  margin: 0 auto;
  padding: 22px 18px calc(24px + env(safe-area-inset-bottom));
}

.brand { font-size: 34px; font-weight: 800; letter-spacing: 0.3px; color: var(--gold); margin-bottom: 12px; }
.brand span { color: var(--green); }

h1 { font-size: 22px; line-height: 1.35; margin: 6px 0 8px; }
h1 strong { color: var(--gold); }

.sub { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 6px; }

/* Wheel */
.wheel-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 26px auto 10px;
}

.wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 8px solid var(--gold);
  background: conic-gradient(
    #1e293b 0 60deg, #334155 60deg 120deg,
    #1e293b 120deg 180deg, #334155 180deg 240deg,
    #1e293b 240deg 300deg, #334155 300deg 360deg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 3.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 0 4px rgba(247, 166, 0, 0.18), inset 0 0 40px rgba(0, 0, 0, 0.55);
}

.wheel-ring { position: absolute; inset: 14px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, 0.16); }
.wheel-face { position: absolute; inset: 0; border-radius: 50%; }
/* 8 segments with prize labels */
.wheel::before {
  content: "";
  position: absolute; inset: 0; border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, transparent 0 43deg, rgba(255,255,255,0.06) 43deg 45deg);
}
.wheel-label {
  position: absolute; left: 50%; top: 50%;
  transform-origin: 0 0;
  font-size: 11px; font-weight: 700; color: #ffe9b8; letter-spacing: 0.2px;
  white-space: nowrap;
}

.pointer {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; z-index: 5;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid var(--green);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.spin {
  position: absolute; z-index: 6;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: var(--green); color: #fff; border: 0;
  padding: 15px 30px; font-size: 18px; font-weight: 800;
  border-radius: 25px; cursor: pointer;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.45);
}
.spin:disabled { opacity: 0.75; cursor: default; }

.hint { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.status-pill {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11.5px;
  color: #9fb0c4; border: 1px solid rgba(159, 176, 196, 0.3); margin-bottom: 8px;
}
.legal { margin: 14px 0 0; font-size: 11.5px; color: #6f7f93; }

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(0, 0, 0, 0.85);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  position: relative;
  background: var(--panel); border: 2px solid var(--gold); border-radius: 14px;
  padding: 26px 22px; max-width: 340px; width: 100%; box-shadow: var(--shadow);
  animation: pop 0.25s ease-out;
}
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-card h2 { color: var(--gold); margin: 0 0 10px; font-size: 24px; }
.modal-card p { color: var(--ink); font-size: 15px; line-height: 1.5; }
.modal-card p strong { color: var(--gold); }
.modal-close {
  position: absolute; top: 6px; right: 10px; background: transparent; border: 0;
  color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer;
}
.cta {
  display: block; margin-top: 16px; padding: 15px; border-radius: 8px;
  background: var(--green); color: #fff; text-decoration: none;
  font-weight: 800; font-size: 18px;
  box-shadow: 0 6px 18px rgba(40, 167, 69, 0.4);
}
.cta:active { transform: translateY(1px); }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  max-width: 88vw; background: #16202e; color: #fff;
  border: 1px solid rgba(247, 166, 0, 0.35); border-radius: 12px;
  padding: 12px 14px; font-size: 14px; box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
  .wheel { transition: none; }
}
