:root {
  --bg: #0f1216;
  --card: #171d26;
  --border: #2a3444;
  --text: #f4f4f5;
  --muted: #9aa3b0;
  --gold: #d4af37;
  --gold-light: #f0d47a;
  --gold-dark: #8a6a2f;
  --bronze: #b08d57;
  --green: #22c55e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  min-height: 100%;
}

.glow {
  position: fixed;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.16) 0%, rgba(212, 175, 55, 0.05) 45%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 18px calc(40px + env(safe-area-inset-bottom));
  gap: 18px;
}

.hidden { display: none !important; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.brand-mark {
  width: 13px;
  height: 34px;
  border: 3px solid var(--gold);
  border-right: none;
  border-radius: 2px 0 0 2px;
  flex: none;
}

.brand-text {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 1.5px;
  color: #ffffff;
  line-height: 1;
  border-bottom: 1px solid rgba(176, 141, 87, 0.55);
  padding-bottom: 5px;
}

.brand-gold { color: var(--gold); }

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.4px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  max-width: 320px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px 24px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.btn {
  width: 100%;
  padding: 15px 18px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 55%, var(--gold-dark));
  color: #14100a;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.wheel-wrap {
  position: relative;
  width: min(86vw, 380px);
  aspect-ratio: 1;
  margin-top: 6px;
}

#wheel { width: 100%; height: 100%; display: block; }

.wheel-pointer {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 26px solid var(--gold);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
  z-index: 3;
}

.btn-spin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #14100a;
  background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold) 60%, var(--gold-dark));
  box-shadow: 0 0 0 3px #0f1216, 0 0 0 6px var(--gold), 0 10px 24px rgba(0, 0, 0, 0.55);
  z-index: 4;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-spin:active { transform: translate(-50%, -50%) scale(0.96); filter: brightness(1.08); }
.btn-spin:disabled { filter: saturate(0.4) brightness(0.8); cursor: default; }

.badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.45);
}

.badge-miss {
  background: rgba(154, 163, 176, 0.12);
  color: var(--muted);
  border-color: var(--border);
}

#result-qr {
  width: 200px;
  height: 200px;
  background: #ffffff;
  border-radius: 12px;
  padding: 8px;
}

#result-code {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 19px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1.5px;
  text-align: center;
  word-break: break-all;
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
