:root {
  --ink: #121212;
  --graphite: #1d1d1d;
  --graphite-2: #242424;
  --line: #3d3d3d;
  --mute: #828585;
  --paper: #e8eaed;
  --crate: #ff7c01;
  --crate-mid: #ba7205;
  --crate-deep: #83530d;
  --you: #5beaff;
  --done: #2ef098;
  --shard: #ff4f8b;
  --t-common: #939393;
  --t-uncommon: #4d78e4;
  --t-rare: #ad8fff;
  --t-grail: #ff7c01;
  --gold: #f2c14e;
  --gold-mid: #c8912a;
  --gold-deep: #8a5d14;
  --gold-hi: #fff3c4;
  --display: "Urbanist", system-ui, sans-serif;
  --ui: "Manrope", system-ui, sans-serif;
  --tier: var(--t-common);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ink);
  background-image:
    radial-gradient(900px 520px at 50% -12%, rgba(255, 124, 1, 0.16), transparent 62%),
    radial-gradient(760px 460px at 50% 112%, rgba(242, 193, 78, 0.12), transparent 60%),
    radial-gradient(420px 300px at 100% 40%, rgba(173, 143, 255, 0.05), transparent 60%);
  background-attachment: fixed;
  color: var(--paper);
  font: 400 16px/1.5 var(--ui);
  min-height: 100vh;
  padding-bottom: calc(var(--safe-bottom) + 40px);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--you); text-decoration: none; }
a:hover { text-decoration: none; }
button { font: inherit; color: inherit; }
.muted { color: var(--mute); }
.k {
  color: var(--mute);
  font: 700 12px/1 var(--ui);
  letter-spacing: .1em;
  text-transform: uppercase;
}
[hidden] { display: none !important; }

/* ——— top bar ——— */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(var(--safe-top) + 10px) 18px 10px;
  background: rgba(18, 18, 18, 0.72);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--paper); }
.brand img { width: 32px; height: 32px; }
.brand-name { font: 800 20px/1 var(--display); letter-spacing: -.01em; }
.topbar .spacer { flex: 1; }

/* ——— buttons ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 24px;
  border: 0; border-radius: 999px;
  font: 700 15px/1 var(--ui); letter-spacing: .01em;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, filter .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary {
  background: var(--crate); color: #1c0f00;
  box-shadow: 0 12px 30px -12px rgba(255, 124, 1, 0.8), inset 0 1px 0 rgba(255,255,255,.28);
}
.btn.primary:hover { background: #ff8c1f; filter: brightness(1.04); }
.btn.primary:active { box-shadow: 0 6px 18px -8px rgba(255, 124, 1, 0.8), inset 0 1px 0 rgba(255,255,255,.2); }
.btn.gold {
  background: linear-gradient(180deg, #f7cf6a, var(--gold) 60%, var(--gold-mid));
  color: #2a1c02;
  box-shadow: 0 12px 30px -12px rgba(242, 193, 78, 0.7), inset 0 1px 0 rgba(255,255,255,.5);
}
.btn.gold:hover { filter: brightness(1.05); }
.btn.ghost { background: var(--graphite-2); color: var(--paper); border: 1px solid var(--line); }
.btn.ghost:hover { background: #2b2b2b; }
.btn.sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn.big { height: 60px; padding: 0 34px; font-size: 17px; }
.btn[disabled], .btn[aria-disabled] { opacity: .45; pointer-events: none; }

/* ——— layout ——— */
.layout {
  max-width: 640px; margin: 0 auto; padding: 48px 20px;
  display: flex; flex-direction: column; gap: 18px;
}
.card {
  background: linear-gradient(180deg, #1f1f1f, var(--graphite));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.card-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
h1, h2, h3 { margin: 0; font-family: var(--display); }
h1 { font-size: 48px; }
h2 { font-size: 19px; letter-spacing: -.01em; }
h3 { font-size: 16px; }

/* ——— hero ——— */
.hero { text-align: center; padding: 48px 20px 52px; }
.crate-wrap {
  position: relative; width: 160px; height: 160px; margin: 0 auto 30px;
  display: grid; place-items: center;
}
.crate-halo {
  position: absolute; inset: -34px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 124, 1, 0.5), rgba(242, 193, 78, 0.16) 55%, transparent 70%);
  animation: halo 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes halo { 0%, 100% { opacity: .75; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.06); } }
.crate-art { width: 150px; height: 150px; position: relative; z-index: 1; animation: float 3.6s ease-in-out infinite; filter: drop-shadow(0 18px 32px rgba(0,0,0,.5)); }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-10px) rotate(1.5deg); } }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  font: 700 12px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold-hi);
  background: rgba(242, 193, 78, 0.08);
  border: 1px solid rgba(242, 193, 78, 0.28);
  margin-bottom: 20px;
}
.hero-title {
  font: 900 clamp(40px, 9vw, 68px)/1 var(--display);
  letter-spacing: -.03em; text-transform: uppercase;
  background: linear-gradient(180deg, #fff3c4, var(--gold) 48%, var(--gold-mid));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 18px rgba(242, 193, 78, 0.25));
}
.hero-sub { color: var(--mute); max-width: 460px; margin: 18px auto 0; font-size: 16.5px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }

/* ——— result card (tier-glow) ——— */
.result-card {
  --tier: var(--t-common);
  display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center;
  padding: 30px 24px; border-radius: 24px;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--tier) 12%, transparent), transparent 55%),
    var(--graphite-2);
  border: 2px solid var(--tier);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--tier) 38%, transparent),
    0 0 44px -4px color-mix(in srgb, var(--tier) 55%, transparent),
    0 24px 50px rgba(0,0,0,.55);
  transition: --tier .4s ease, border-color .4s ease, box-shadow .4s ease;
}
.result-card.ok { --tier: var(--gold); }
.result-card.no { --tier: var(--shard); }
.result-stamp {
  font: 900 26px/1.1 var(--display); letter-spacing: -.02em; text-transform: uppercase;
}
.result-stamp.pending { color: var(--mute); }
.result-stamp.ok { color: var(--gold-hi); text-shadow: 0 0 24px rgba(242, 193, 78, .5); }
.result-stamp.no { color: #ff9fb8; text-shadow: 0 0 24px rgba(255, 79, 139, .45); }
.result-note { margin: 0; font-size: 14px; max-width: 380px; }

/* ——— steps ——— */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; }
.steps .no {
  flex: none; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  font: 800 15px/1 var(--display); border-radius: 12px;
  background: var(--graphite-2); border: 1px solid var(--line); color: var(--crate);
}
.steps b { color: var(--paper); }
.steps p { margin: 3px 0 0; color: var(--mute); font-size: 14px; }

/* ——— footer ——— */
.footer {
  max-width: 640px; margin: 0 auto; padding: 22px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  color: var(--mute); font-size: 13px;
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--mute); }
.footer-links a:hover { color: var(--paper); }

/* toast */
.toast {
  position: fixed; top: calc(var(--safe-top) + 72px); left: 50%; transform: translateX(-50%); z-index: 40;
  background: var(--graphite-2); border: 1px solid var(--line); color: var(--paper);
  padding: 10px 16px; border-radius: 12px; font: 600 14px/1 var(--ui);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

@media (max-width: 560px) {
  .layout { padding: 32px 14px; gap: 14px; }
  .card { padding: 22px; border-radius: 20px; }
  .hero { padding: 34px 10px 40px; }
  .crate-wrap { width: 128px; height: 128px; }
  .crate-art { width: 120px; height: 120px; }
  .brand-name { font-size: 18px; }
}
