/* ── CSS Variables / Branding ──────────────────────────── */
:root {
  --gold: #b8860b;
  --gold-light: #d4a843;
  --gold-pale: #fef9e7;
  --dark: #1a1a2e;
  --dark-mid: #16213e;
  --text: #f0e6d3;
  --text-muted: #a89b8c;
  --white: #ffffff;
  --success: #2ecc71;
  --danger: #e74c3c;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-mid) 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--gold-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ───────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--white);
  border-bottom: 3px solid #6b2d7b;
}

.logo-slot {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-slot img {
  height: 52px;
  width: auto;
}

.logo-slot span {
  font-size: 0.75rem;
  color: #666;
  max-width: 120px;
  line-height: 1.2;
}

/* ── Main Container ───────────────────────────────────── */
.page-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(184, 134, 11, 0.3);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow);
  text-align: center;
}

.card h1 {
  font-size: 1.8rem;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.card .subtitle {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 0.95rem;
}

/* ── Forms ─────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(184, 134, 11, 0.4);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--gold-light);
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--dark);
  box-shadow: 0 4px 16px rgba(184, 134, 11, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid rgba(184, 134, 11, 0.4);
}

.site-header .btn-secondary {
  background: var(--dark);
  color: var(--text);
}

.btn-large {
  padding: 18px 48px;
  font-size: 1.2rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Bundle Cards ─────────────────────────────────────── */
.bundles {
  display: flex;
  gap: 16px;
  margin: 24px 0;
  flex-wrap: wrap;
  justify-content: center;
}

.bundle-card {
  flex: 1;
  min-width: 130px;
  padding: 24px 16px;
  border: 2px solid rgba(184, 134, 11, 0.3);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
  background: rgba(0, 0, 0, 0.2);
}

.bundle-card:hover {
  border-color: var(--gold-light);
  transform: translateY(-3px);
}

.bundle-card.selected {
  border-color: var(--gold);
  background: rgba(184, 134, 11, 0.15);
}

.bundle-card .spins {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-light);
}

.bundle-card .spin-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.bundle-card .price {
  font-size: 1.3rem;
  font-weight: 600;
}

/* ── Roulette ─────────────────────────────────────────── */
.roulette-area {
  max-width: 600px;
  width: 100%;
}

.wheel-container {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 0 auto 24px;
}

.wheel-container canvas {
  width: 100%;
  height: 100%;
}

.wheel-pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 24px solid var(--gold);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  z-index: 2;
}

.spin-info {
  margin-bottom: 20px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.spin-info strong { color: var(--gold-light); }

.result-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.result-overlay.show { display: flex; }

.result-card {
  background: var(--dark-mid);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  animation: popIn 0.4s ease;
}

.result-card h2 { font-size: 1.6rem; margin-bottom: 12px; }
.result-card.win h2 { color: var(--success); }
.result-card.lose h2 { color: var(--text-muted); }

.result-card .voucher-name {
  background: var(--gold-pale);
  color: var(--dark);
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  margin: 16px 0;
  font-size: 1.1rem;
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ── Thank-You ────────────────────────────────────────── */
.thankyou-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

/* ── Admin ────────────────────────────────────────────── */
.admin-wrap {
  max-width: 960px;
  width: 100%;
  padding: 32px 16px;
  margin: 0 auto;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(184, 134, 11, 0.3);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-box .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-light);
}

.stat-box .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 32px;
}

.admin-table th, .admin-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
}

.admin-table th {
  color: var(--gold-light);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-available {
  background: rgba(46, 204, 113, 0.2);
  color: var(--success);
}

.badge-claimed {
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger);
}

.admin-section h2 {
  color: var(--gold-light);
  font-size: 1.2rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(184, 134, 11, 0.3);
}

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 20px 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  line-height: 1.7;
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--gold-light);
}

/* ── Utilities ────────────────────────────────────────── */
.hidden { display: none !important; }
.mt-12 { margin-top: 12px; }
.mt-24 { margin-top: 24px; }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold-light); }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 600px) {
  .card { padding: 28px 20px; }
  .bundles { flex-direction: column; }
  .bundle-card { min-width: auto; }
  .wheel-container { width: 260px; height: 260px; }
  .site-header { flex-direction: column; gap: 12px; }
}
