:root {
  --bg: #0b0b0b;
  --surface: #161616;
  --surface-2: #1f1f1f;
  --line: #2c2c2c;
  --text: #f5f2ea;
  --muted: #a39e93;
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.14);
  --danger: #ff6b6b;
  --radius: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 460px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
  min-height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 8px 0 24px; }
.brand__mark { border-radius: 10px; }
.brand__name { font-weight: 700; font-size: 20px; letter-spacing: 0.2px; }
.brand__tag {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--gold); border: 1px solid var(--gold); border-radius: 999px; padding: 2px 8px;
}

.view { display: flex; flex-direction: column; gap: 16px; }
.view[hidden] { display: none; }

.eyebrow { margin: 0; color: var(--gold); font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase; }
.title { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 700; }
.subtitle { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.lede { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.fine { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; color: var(--muted); }
.field__hint { font-size: 12px; color: var(--muted); }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"] {
  width: 100%;
  font-size: 17px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  min-height: 50px;
}
input:focus { border-color: var(--gold); }
input[aria-invalid="true"] { border-color: var(--danger); }

.phone { display: flex; align-items: stretch; }
.phone__prefix {
  display: flex; align-items: center; padding: 0 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-right: 0;
  border-radius: 12px 0 0 12px; color: var(--muted); font-size: 17px;
}
.phone input { border-radius: 0 12px 12px 0; }

.code-input { letter-spacing: 10px; text-align: center; font-size: 26px !important; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); line-height: 1.45; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--gold); flex: none; }
.check a, .lede a { color: var(--gold); }

.referral summary { color: var(--gold); font-size: 14px; cursor: pointer; padding: 4px 0; }
.referral .field { margin-top: 10px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 52px; padding: 0 18px;
  border-radius: 14px; border: 1px solid transparent;
  font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn--gold { background: var(--gold); color: #111; }
.btn--gold:disabled { opacity: 0.55; cursor: default; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--wallet { background: #000; color: #fff; border-color: #3a3a3a; }
.btn--wallet svg { flex: none; }

.link { background: none; border: 0; color: var(--gold); font-size: 14px; padding: 8px 0; cursor: pointer; text-align: left; }
.link:disabled { color: var(--muted); cursor: default; }
.row { display: flex; justify-content: space-between; }

.error { margin: 0; color: var(--danger); font-size: 14px; }

.notice {
  background: var(--gold-soft); border: 1px solid var(--gold); color: var(--text);
  border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45;
}

.card {
  background: linear-gradient(160deg, #1d1a12 0%, #121212 55%);
  border: 1px solid #3a3322;
  border-radius: 20px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 16px;
}
.card__top { display: flex; justify-content: space-between; gap: 12px; }
.card__label { margin: 0; font-size: 11px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--gold); }
.card__name { margin: 4px 0 0; font-size: 18px; font-weight: 600; }
.card__points { text-align: right; }
.card__value { margin: 4px 0 0; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card__meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 14px; }
.card__code { margin-left: auto; color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

.stamps__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.stamps__brand { font-weight: 600; }
.stamps__count { color: var(--gold); font-variant-numeric: tabular-nums; }
.stamps__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.stamp {
  aspect-ratio: 1; border-radius: 50%; border: 2px solid #5a5a5a;
  display: flex; align-items: center; justify-content: center; font-size: 16px; color: #111;
}
.stamp--on { background: var(--gold); border-color: var(--gold); }
.stamp--reward { border-style: dashed; border-color: var(--gold); color: var(--gold); }
.stamps__reward { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.stamps__empty { margin: 0; color: var(--muted); font-size: 14px; }

.wallets { display: flex; flex-direction: column; gap: 10px; }

.live__panel {
  margin-top: 12px; background: #fff; color: #111; border-radius: 16px; padding: 18px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}
.live__panel .fine { color: #555; }
.live__qr svg { width: 220px; height: 220px; display: block; }
.live__short { margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: 22px; letter-spacing: 3px; font-weight: 700; }

.cards__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cards__list li {
  display: flex; justify-content: space-between; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 15px;
}
.cards__list span:last-child { color: var(--gold); font-variant-numeric: tabular-nums; }

.appnudge { border-top: 1px solid var(--line); padding-top: 18px; display: flex; flex-direction: column; gap: 10px; }

.foot { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 12px; }

.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100% - 32px); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; font-size: 14px; margin: 0;
}

.spinner {
  width: 32px; height: 32px; margin: 80px auto; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--gold); animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
