:root {
  --ink: #f6efe0;
  --mute: #b9ab8f;
  --dim: #7d7260;
  --gold: #f2b544;
  --gold-2: #ffd77a;
  --deep: #07090f;
  --steel: #1a1f2b;
  --steel-2: #2a3142;
  --red: #ff6464;
  --ok: #7fe0a4;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: clip; }
body { margin: 0; min-height: 100svh; background: var(--deep); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }

.bg { position: fixed; inset: 0; z-index: -2;
  background: linear-gradient(#07090fcc, #07090f 85%), url('../img/vault.webp') center top / cover no-repeat; filter: saturate(1.05); }
.coins { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1080px; margin: 0 auto; padding: 22px 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 900 22px var(--sans); letter-spacing: -0.02em; }
.brand img { width: 40px; height: 40px; border-radius: 12px; }
.counter { font: 500 13px var(--mono); color: var(--mute); padding: 8px 14px; border-radius: 999px; background: #0d111bcc; box-shadow: 0 0 0 1px #3a3020; }
.counter b { color: var(--gold); }

main { max-width: 760px; margin: 0 auto; padding: 24px 20px 40px; }
.stage { text-align: center; animation: in .5s ease both; }
@keyframes in { from { opacity: 0; transform: translateY(16px); } }
.kicker { margin: 0; font: 500 13px var(--mono); color: var(--gold); letter-spacing: .08em; }
h1 { margin: 10px 0 0; font-size: clamp(44px, 9vw, 84px); line-height: .98; letter-spacing: -0.045em; font-weight: 900; }
.lede { margin: 16px auto 34px; max-width: 46ch; color: var(--mute); font-size: 18px; }
.lede.small { font-size: 14px; margin-top: 22px; }

/* ---------- the vault ---------- */
.vault { position: relative; width: min(440px, 100%); margin: 0 auto; aspect-ratio: 1; perspective: 1400px; }
.inside { position: absolute; inset: 6%; border-radius: 50%; overflow: hidden; box-shadow: inset 0 0 60px #000; }
.inside img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.door { position: absolute; inset: 0; z-index: 2; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3b4458, #1a1f2b 55%, #0d1018);
  box-shadow: 0 0 0 10px #12161f, 0 0 0 12px #3a3020, 0 40px 80px -20px #000, inset 0 2px 0 #ffffff1a;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  transform-origin: 2% 50%; transition: transform 1.2s cubic-bezier(.6, 0, .2, 1); }
.vault.open .door { transform: rotateY(-108deg); }
.vault.shake .door { animation: shake .45s; }
@keyframes shake { 20%, 60% { translate: -10px 0; } 40%, 80% { translate: 10px 0; } }
.bolts i { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #8a7a55, #3a3020); }
.bolts i:nth-child(1) { left: 50%; top: 4%; } .bolts i:nth-child(2) { left: 50%; bottom: 4%; }
.bolts i:nth-child(3) { left: 8%; top: 25%; } .bolts i:nth-child(4) { right: 8%; top: 25%; }
.bolts i:nth-child(5) { left: 8%; bottom: 25%; } .bolts i:nth-child(6) { right: 8%; bottom: 25%; }
.dial { width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(from 0deg, #c8963a, #ffd77a, #c8963a, #8a6420, #c8963a);
  box-shadow: 0 6px 16px #000a; position: relative; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.dial span { position: absolute; left: 50%; top: 6px; width: 4px; height: 16px; margin-left: -2px; border-radius: 2px; background: #2a1d08; }
.display { display: flex; gap: 8px; }
.display b { width: 42px; height: 52px; border-radius: 10px; background: #05070c; box-shadow: inset 0 0 0 1px #3a3020;
  display: grid; place-items: center; font: 700 28px var(--mono); color: var(--gold); }
.vault.wrong .display b { color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.keys { display: grid; grid-template-columns: repeat(3, 54px); gap: 8px; }
.keys button { height: 42px; border: 0; border-radius: 10px; background: linear-gradient(#2a3142, #1a1f2b); color: var(--ink);
  font: 700 18px var(--mono); cursor: pointer; box-shadow: 0 3px 0 #0a0d14, inset 0 1px 0 #ffffff14; }
.keys button:active { transform: translateY(2px); box-shadow: 0 1px 0 #0a0d14; }
.keys .ok { background: linear-gradient(var(--gold-2), var(--gold)); color: #2a1d08; font-size: 13px; text-transform: uppercase; }
.hint { margin: 26px 0 0; font: 500 14px var(--mono); color: var(--mute); }
.hint.err-msg { color: var(--red); }

/* ---------- jobs ---------- */
.jobs { list-style: none; margin: 0 auto 30px; padding: 0; max-width: 520px; display: grid; gap: 12px; text-align: left; }
.jobs li { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 18px; background: #0d111bdd; box-shadow: 0 0 0 1px #2a2418; transition: box-shadow .2s; }
.jobs li.done { box-shadow: 0 0 0 1px var(--ok); }
.jobs .n { font: 700 14px var(--mono); color: var(--gold); }
.jobs div { flex: 1; }
.jobs b { display: block; font-size: 17px; }
.jobs i { font-style: normal; color: var(--dim); font-size: 14px; }
.go { padding: 10px 18px; border-radius: 999px; background: var(--steel-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.jobs li.done .go { background: transparent; color: var(--ok); pointer-events: none; }
.jobs li.done .go::before { content: '✓ '; }

.cta { display: inline-flex; align-items: center; justify-content: center; padding: 16px 30px; border: 0; border-radius: 14px;
  background: linear-gradient(var(--gold-2), var(--gold)); color: #2a1d08; font: 700 17px var(--sans); cursor: pointer; text-decoration: none; }
.cta:disabled { opacity: .35; cursor: not-allowed; }
.cta.ghost { background: transparent; color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }

/* ---------- claim ---------- */
.claim { max-width: 460px; margin: 0 auto; display: grid; gap: 14px; text-align: left; }
.claim label { display: grid; gap: 6px; font: 500 13px var(--mono); color: var(--mute); }
.claim input { padding: 14px 16px; border-radius: 12px; border: 0; background: #0d111bee; box-shadow: 0 0 0 1px #3a3020; color: var(--ink); font: 500 16px var(--mono); outline: none; }
.claim input:focus { box-shadow: 0 0 0 1px var(--gold); }
.err { min-height: 1.4em; margin: 0; color: var(--red); font-size: 14px; }
.claim .cta { justify-self: stretch; }

/* ---------- crew card ---------- */
.card { display: flex; align-items: center; gap: 22px; max-width: 520px; margin: 26px auto 0; padding: 20px; text-align: left;
  border-radius: 24px; background: linear-gradient(135deg, #2a1d08, #12161f 60%); box-shadow: 0 0 0 1px var(--gold), 0 30px 60px -20px #000; }
.card img { width: 132px; height: 132px; border-radius: 18px; }
.card div { display: grid; gap: 2px; min-width: 0; }
.card .tag { font: 700 12px var(--mono); color: var(--gold); letter-spacing: .1em; }
.card .num { font: 900 56px/1 var(--sans); letter-spacing: -0.04em; }
.card .who { font-weight: 600; font-size: 18px; }
.card .wal { font: 500 12px var(--mono); color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
#share { margin-top: 8px; }

.foot { max-width: 760px; margin: 0 auto; padding: 10px 20px 40px; text-align: center; color: var(--dim); font-size: 12px; }
.foot .demo { font-family: var(--mono); color: #5a5040; }

@media (max-width: 520px) {
  .keys { grid-template-columns: repeat(3, 46px); gap: 6px; } .keys button { height: 38px; }
  .display b { width: 36px; height: 44px; font-size: 22px; }
  .dial { width: 48px; height: 48px; }
  .card { flex-direction: column; text-align: center; }
  .counter { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { .door { transition: none; } .stage { animation: none; } }
