@font-face {
  font-family: 'Fixel Text';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/fixel/fixel-text-400.woff2) format('woff2');
}
@font-face {
  font-family: 'Fixel Text';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/fixel/fixel-text-700.woff2) format('woff2');
}
@font-face {
  font-family: 'Fixel Text';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/fonts/fixel/fixel-text-800.woff2) format('woff2');
}

:root {
  color-scheme: dark;
  --bg: #11161e;
  --card: #1a2230;
  --card-2: #222b3a;
  --line: rgba(255, 255, 255, 0.06);
  --text: #f4f6fb;
  --secondary: #9aa3b2;
  --muted: #6d7686;
  --accent: #8b7cf7;
  --cta: #d8ff00;
  --danger: #ff6b6b;
  --ok: #3ecf8e;
  font-family: 'Fixel Text', ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.45; cursor: default; }

#app {
  min-height: 100dvh;
  padding:
    calc(0.75rem + env(safe-area-inset-top))
    1rem
    calc(1.25rem + env(safe-area-inset-bottom));
}

.screen {
  width: min(26.5rem, 100%);
  margin: 0 auto;
  animation: rise 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

h1, .title, .total {
  font-family: 'Fixel Text', ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.title {
  margin: 0 0 0.4rem;
  font-size: 1.55rem;
  line-height: 1.15;
}
.lead {
  margin: 0;
  color: var(--secondary);
  font-size: 0.95rem;
  line-height: 1.45;
}

.identity {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  margin-bottom: 1.35rem;
  text-align: center;
}
.user-id {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0;
}
.user-id svg { width: 13px; height: 13px; }
.addr-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  padding: 0;
}
.addr-chip svg { width: 15px; height: 15px; color: var(--muted); }

.balance {
  text-align: center;
  margin: 0.2rem 0 1.35rem;
}
.total {
  margin: 0;
  font-size: 2.55rem;
  line-height: 1;
}
.asset {
  margin: 0.45rem 0 0;
  color: var(--secondary);
  font-size: 0.95rem;
  font-weight: 700;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1.35rem;
}
.action {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  padding: 1rem 0.6rem 0.85rem;
  border: 0;
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
}
.action .glyph {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  color: var(--text);
}
.action .glyph svg { width: 26px; height: 26px; }
.action span { font-size: 0.86rem; font-weight: 700; color: var(--secondary); }

.section {
  margin: 0 0 0.7rem;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

.card {
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
}
.card + .section { margin-top: 1.25rem; }

.token {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  padding: 0.95rem 1rem;
  border: 0;
  background: transparent;
  color: inherit;
}
.token img {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #0e1116;
}
.token .meta { flex: 1; min-width: 0; }
.token .meta strong { display: block; font-size: 1rem; }
.token .meta small { color: var(--muted); font-size: 0.78rem; }
.token .amt {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.token .amt small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
}
.token .chev { color: var(--muted); width: 18px; height: 18px; }

.history {
  list-style: none;
  margin: 0;
  padding: 0;
}
.history li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--secondary);
}
.history li:first-child { border-top: 0; }
.history b { color: var(--text); font-weight: 700; }
.empty {
  padding: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.stack { display: grid; gap: 0.7rem; margin-top: 1.25rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 52px;
  padding: 0 1.1rem;
  border: 0;
  border-radius: 16px;
  font-weight: 700;
  width: 100%;
}
.btn svg { width: 18px; height: 18px; }
.btn-cta { background: var(--cta); color: #11161e; }
.btn-soft { background: var(--card); color: var(--text); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.notice {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}
.status {
  min-height: 1.2rem;
  margin: 0.7rem 0 0;
  color: var(--accent);
  font-size: 0.86rem;
}
.status.error { color: var(--danger); }

.seed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 1.1rem 0 0.4rem;
}
.seed-word {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
  padding: 0.7rem 0.75rem;
  border-radius: 14px;
  background: var(--card);
  font-size: 0.92rem;
}
.seed-word b {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.72rem;
  min-width: 1.05rem;
}

.check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0.8rem 0;
  color: var(--secondary);
  font-size: 0.88rem;
  line-height: 1.35;
}
.check input {
  margin-top: 0.15rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
}

.qr-wrap {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  margin: 1.1rem 0 0.4rem;
  padding: 1.15rem 1rem 1rem;
  background: var(--card);
  border-radius: 22px;
}
.qr-wrap svg, .qr-wrap img {
  width: min(13.5rem, 72vw);
  height: auto;
  border-radius: 12px;
}
.recv-addr {
  text-align: center;
  word-break: break-all;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.recv-meta {
  margin: 0.85rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}
.field-box, .field input {
  min-height: 52px;
  border-radius: 16px;
  border: 0;
  background: var(--card);
  color: var(--text);
  padding: 0 0.95rem;
  font-size: 16px;
  font-weight: 500;
}
.addr-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--card);
  border-radius: 16px;
  padding-right: 0.35rem;
}
.addr-field input {
  flex: 1;
  min-width: 0;
  background: transparent;
  padding-right: 0;
}
.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--card-2);
  color: var(--text);
  display: grid;
  place-items: center;
}
.icon-btn svg { width: 20px; height: 20px; }

.picker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  min-height: 52px;
  padding: 0.55rem 0.85rem;
  border: 0;
  border-radius: 16px;
  background: var(--card);
  color: inherit;
}
.picker img { width: 32px; height: 32px; border-radius: 999px; }
.picker strong { display: block; font-size: 0.95rem; }
.picker small { color: var(--muted); font-size: 0.75rem; }
.picker .chev { margin-left: auto; color: var(--muted); width: 18px; height: 18px; }

.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(8, 10, 14, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: min(26.5rem, 100%);
  background: #161c27;
  border-radius: 22px 22px 0 0;
  padding: 0.85rem 1rem calc(1.1rem + env(safe-area-inset-bottom));
  animation: up 200ms ease;
}
@keyframes up {
  from { transform: translateY(16px); }
  to { transform: translateY(0); }
}
.sheet h2 {
  margin: 0.35rem 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 800;
}
.sheet-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 0.2rem;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.sheet-option img { width: 36px; height: 36px; border-radius: 999px; }
.sheet-option .ok { margin-left: auto; color: var(--ok); width: 20px; height: 20px; }

.fee-line {
  margin: 0.15rem 0 1rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.token-hero {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0 1.1rem;
  text-align: center;
}
.token-hero img { width: 56px; height: 56px; border-radius: 999px; }
.token-hero h1 { margin: 0; font-size: 1.15rem; }
.token-hero p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.token-hero .total { font-size: 2.1rem; }

.gate-card {
  margin-top: 2.5rem;
  background: var(--card);
  border-radius: 22px;
  padding: 1.25rem 1.1rem;
}
