/* ==========================================================================
   Redeem portal.

   Self-contained rather than importing the shop's stylesheet: this is a
   separate deployment and must not break when that one changes. Same palette,
   deliberately far less of it — one job, one page.
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #08060a;
  --panel: #100c11;
  --ink: #f6f1ec;
  --ink-dim: #cfc4bb;
  --muted: #9a8f86;
  --faint: #6f635b;
  --orange: #ff7a18;
  --amber: #ffb347;
  --ember: #c2410c;
  --line: rgba(255, 122, 24, 0.22);
  --line-soft: rgba(255, 255, 255, 0.07);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Same drifting grid as the shop, so the two feel related without being linked. */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-grid {
  position: absolute; inset: -60px;
  background-image:
    linear-gradient(to bottom, rgba(255, 122, 24, .06) 1px, transparent 1px),
    linear-gradient(to right, rgba(255, 122, 24, .06) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: drift 24s linear infinite;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 30%, transparent 75%);
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(60px, 60px, 0); }
}

.shell {
  position: relative; z-index: 1;
  max-width: 32rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5rem) 1.25rem 4rem;
}

.head { display: flex; align-items: flex-start; gap: 0.9rem; margin-bottom: 2rem; }
.head img {
  border-radius: 0.55rem;
  box-shadow: 0 0 0 1px var(--line), 0 8px 22px -10px rgba(255, 122, 24, 0.6);
}
.head h1 { margin: 0; font-size: 1.6rem; letter-spacing: -0.02em; }
.head p { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.92rem; }

.card {
  position: relative;
  padding: 1.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 1rem;
  background: linear-gradient(168deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.9);
}
.card h2 { margin: 0 0 0.4rem; font-size: 1.25rem; letter-spacing: -0.02em; }
.card > p { margin: 0 0 1.25rem; color: var(--muted); font-size: 0.92rem; }

.muted { color: var(--muted); }
.small { font-size: 0.84rem; }

form { display: grid; gap: 0.65rem; }
label { font-size: 0.85rem; color: var(--muted); }

input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft);
  border-radius: 0.5rem;
  color: var(--ink);
  font: inherit;
  padding: 0.75rem 0.9rem;
}
input:focus {
  outline: none;
  border-color: var(--line);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.12);
}

/* The key is the whole point of the page, so it gets the emphasis. */
.key-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  border: 0; border-radius: 999px;
  font: inherit; font-weight: 650;
  color: #1a0d04; cursor: pointer;
  background: linear-gradient(135deg, var(--amber), var(--orange) 55%, var(--ember));
  box-shadow: 0 10px 26px -10px rgba(255, 122, 24, 0.7), 0 0 0 1px rgba(255, 200, 140, 0.3) inset;
  transition: transform 0.16s var(--ease), filter 0.16s var(--ease);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: saturate(0.5); }

.btn.ghost {
  background: none; color: var(--amber);
  box-shadow: 0 0 0 1px var(--line) inset;
}
.btn.ghost:hover { background: rgba(255, 122, 24, 0.07); }
.btn.small { width: auto; padding: 0.55rem 1.1rem; font-size: 0.9rem; }

:where(a, button, input):focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

/* How much of the key is spent, visible before deciding to claim again. */
.key-meter {
  height: 0.5rem; margin-top: 1rem;
  border-radius: 999px; overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 1px var(--line-soft) inset;
}
.key-meter-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--orange));
  transition: width 0.6s var(--ease);
}

.claimed-box {
  margin-top: 1.25rem;
  border: 1px solid rgba(255, 122, 24, 0.3);
  border-radius: 0.75rem;
  background: rgba(255, 122, 24, 0.07);
  overflow: hidden;
}
.claimed-payload {
  margin: 0; padding: 1.1rem 1.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem; line-height: 1.65; color: var(--amber);
  white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 22rem; overflow-y: auto;
}

.promo {
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0.6rem;
  padding: 0.85rem 1rem;
  color: var(--ink-dim);
  font-size: 0.9rem;
}
.promo.subtle { border-color: var(--line-soft); }

.turnstile-slot { min-height: 65px; margin: 0.35rem 0 0.15rem; }
.turnstile-slot:empty { min-height: 0; margin: 0; }

.foot {
  margin-top: 2.5rem;
  color: var(--faint);
  font-size: 0.88rem;
}
.foot p { margin: 0 0 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  .bg-grid { animation: none; }
  * { transition: none !important; }
}
