:root {
  --radius: 18px;
  --radius-sm: 12px;
  --bg: #0b0d12;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #e7e9ee;
  --text-dim: #9aa0ac;
  --accent: #7c9cff;
  --accent-2: #b98cff;
  --success: #4ade80;
  --danger: #f87171;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  scrollbar-width: thin;
  scrollbar-color: var(--accent-2) rgba(255, 255, 255, 0.05);
}

/* Custom scrollbar (Webkit) for the page and any scrollable panel (e.g. .list) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  background-clip: padding-box;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.page-header {
  text-align: center;
  margin-bottom: 32px;
}

h1, h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  margin: 0 0 8px;
}

h1 { font-size: 2rem; letter-spacing: -0.02em; }

h2 {
  font-size: 1.1rem;
  color: var(--text);
  position: relative;
  padding-bottom: 14px;
  margin-bottom: 18px;
}

h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.subtitle {
  color: var(--text-dim);
  margin: 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(16px);
}

.form-card { margin-bottom: 24px; }

.info-card { margin-bottom: 24px; }

.steps {
  margin: 0 0 16px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text);
}

.info-note {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.disclaimer {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
  background: rgba(185, 140, 255, 0.08);
  border: 1px solid rgba(185, 140, 255, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.disclaimer strong { color: var(--accent-2); }

form { display: flex; flex-direction: column; gap: 6px; }

label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 12px;
}

input {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease;
}

input::placeholder { color: rgba(154, 160, 172, 0.6); }
input:focus { border-color: var(--accent); }

button {
  margin-top: 20px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0d12;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

button:hover { opacity: 0.92; }
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(11, 13, 18, 0.35);
  border-top-color: #0b0d12;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

/* Fixed to 5 entries server-side, so it never needs to scroll. */
#redemptions-list {
  max-height: none;
  overflow-y: visible;
}

.list li {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.list li.empty {
  justify-content: center;
  color: var(--text-dim);
}

.list .code-value {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-badge {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-success { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.status-failed { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.status-already_claimed { background: rgba(124, 156, 255, 0.15); color: var(--accent); }

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(340px, calc(100vw - 40px));
}

.toast {
  background: rgba(20, 22, 28, 0.92);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.85rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: slide-in 0.2s ease;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

@keyframes slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.page-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-heading);
}
