:root {
  --bg: #0e0b07;
  --bg2: #171108;
  --card: #1d160d;
  --line: #3a2c16;
  --fg: #f3e9d6;
  --muted: #b39b74;
  --amber: #e8a33d;
  --amber2: #ffc766;
  --accent-rgb: 232, 163, 61; /* drives the #bgfx lattice tint */
  --ok: #6fcf7a;
  --err: #e06c5a;
  --radius: 14px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4ecdd; --bg2: #efe4cf; --card: #fffaf0; --line: #e0cfa8;
    --fg: #2a2114; --muted: #7a6646; --amber: #b9791a; --amber2: #d08f28;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, var(--bg2), var(--bg)) fixed;
  color: var(--fg);
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 16px 8px;
}
/* background FX lattice (drifting nodes + hash pulses + block builds) */
#bgfx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

#app { width: 100%; max-width: 440px; flex: 1; position: relative; z-index: 1; }
.foot { position: relative; z-index: 1; }
.card, .dash {
  /* slightly translucent + blurred so the #bgfx lattice shows through */
  background: color-mix(in srgb, var(--card) 88%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: .5px; }

/* brand logo + catchphrase on onboarding / locked screens */
.hero-card { text-align: center; }
.hero-card .row { justify-content: center; }
.brand-logo { display: block; margin: 2px auto 10px; width: 132px; height: auto; filter: drop-shadow(0 0 18px rgba(232,163,61,.35)); animation: capfloat 6s ease-in-out infinite; }
@keyframes capfloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.catch { font-size: 17px; color: var(--amber2); letter-spacing: .3px; margin: 0 0 8px; font-weight: 600; }
.brand-mini { width: 26px; height: 26px; vertical-align: -7px; margin-right: 7px; filter: drop-shadow(0 0 6px rgba(232,163,61,.4)); }
@media (prefers-reduced-motion: reduce) { .brand-logo { animation: none; } }
h2 { font-size: 19px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.dim { color: var(--amber); font-weight: 700; }
.net { color: var(--muted); font-size: 13px; margin-top: 16px; }
.net a { color: var(--amber); }
.warn { color: var(--amber2); background: rgba(232,163,61,.08); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; }

.row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.btn {
  flex: 1; min-width: 120px; cursor: pointer;
  background: #241a0e; color: var(--fg);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; font-size: 15px; font-weight: 600;
  transition: transform .06s ease, border-color .2s, background .2s;
}
.btn:hover { border-color: var(--amber); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--amber2), var(--amber)); color: #1a1205; border-color: var(--amber); }
.btn.small { flex: 0 0 auto; min-width: 0; padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: default; }

.field { margin-top: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
input, textarea {
  width: 100%; background: #120d07; color: var(--fg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  font: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--amber); }
textarea { resize: vertical; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 14px; }
.check input { width: auto; }

ol.seed { list-style: none; padding: 0; margin: 14px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
ol.seed li { background: #120d07; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; font-weight: 600; }
ol.seed li span { color: var(--amber); display: inline-block; width: 22px; font-size: 12px; }

/* dashboard */
.dash header { display: flex; justify-content: space-between; align-items: center; }
.brand { font-size: 20px; font-weight: 800; letter-spacing: 1px; color: var(--amber2); }
.badge { font-size: 11px; background: #241a0e; border: 1px solid var(--line); color: var(--muted); padding: 2px 7px; border-radius: 20px; vertical-align: middle; text-transform: uppercase; letter-spacing: .5px; }
.balance { display: flex; justify-content: space-between; align-items: flex-end; margin: 22px 0 16px; }
.amt { font-size: 30px; font-weight: 800; }
.amt b { font-size: 15px; color: var(--muted); font-weight: 600; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { background: none; border: none; color: var(--muted); padding: 9px 12px; cursor: pointer; font: inherit; font-weight: 600; border-bottom: 2px solid transparent; }
.tab.active { color: var(--amber2); border-bottom-color: var(--amber); }

.panel { animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.qr { display: block; width: 190px; height: 190px; margin: 4px auto 14px; image-rendering: pixelated; border-radius: 10px; background: #fff; padding: 8px; }
.addr { word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: #120d07; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-align: center; }

.review { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.review .line { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.review .line span { color: var(--muted); }
.review .line b { word-break: break-all; text-align: right; max-width: 70%; }
.review.ok b { color: var(--ok); font-family: ui-monospace, monospace; font-size: 12px; }
.review .btn { margin-top: 12px; width: 100%; }

ul.hist { list-style: none; padding: 0; margin: 0; }
ul.hist li { display: flex; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.mono { font-family: ui-monospace, monospace; color: var(--amber); }

.foot { color: var(--muted); font-size: 12px; margin-top: 18px; text-align: center; }
.foot p { margin: 0; }
.foot-links {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px 20px; margin-bottom: 10px;
}
.foot-links a {
  color: var(--amber); text-decoration: none;
  font-size: 12.5px; letter-spacing: 1px; text-transform: uppercase;
}
.foot-links a:hover { color: var(--amber2); text-decoration: underline; }

.toast { position: fixed; left: 50%; bottom: 26px; translate: -50% 20px; background: #241a0e; border: 1px solid var(--line); color: var(--fg); padding: 11px 16px; border-radius: 10px; opacity: 0; transition: opacity .3s, translate .3s; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; translate: -50% 0; }
.toast.err { border-color: var(--err); color: #ffd7cf; }
.toast.ok { border-color: var(--ok); color: #d6ffd9; }

/* ── Beta notice modal ────────────────────────────────────────────────────
   Shown once per browser: the wallet is live on mainnet but still in active
   development, and the seed phrase is the user's only recovery path. */
.beta-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(5,4,2,.82);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  opacity: 0; transition: opacity .3s ease;
}
.beta-overlay.show { opacity: 1; }
.beta-box {
  position: relative; overflow: hidden;
  width: min(520px,100%); max-height: 88vh; overflow-y: auto;
  padding: 28px 24px 24px; text-align: center;
  background: linear-gradient(180deg,#221a0f,#180f07);
  border: 1px solid var(--amber); border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0,0,0,.7);
  animation: betaIn .45s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes betaIn { from { opacity:0; transform: translateY(14px) scale(.97);} to { opacity:1; transform:none; } }
.beta-scan { position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.beta-scan::after {
  content:""; position:absolute; left:0; right:0; height:40%;
  background: linear-gradient(180deg,transparent,rgba(232,163,61,.07),transparent);
  animation: betaSweep 3s linear infinite;
}
@keyframes betaSweep { from { top:-40%; } to { top:100%; } }
.beta-eyebrow { font-size:11px; letter-spacing:5px; text-transform:uppercase; color:var(--muted); margin-bottom:14px; }
.beta-title { font-size:22px; line-height:1.25; color:#fff; letter-spacing:1px; margin-bottom:14px; }
.beta-lede { font-size:14.5px; color:var(--fg); line-height:1.6; margin-bottom:16px; }
.beta-lede b { color: var(--amber); }
.beta-list { list-style:none; padding:0; margin:0 0 18px; text-align:left; font-size:13.5px; line-height:1.55; }
.beta-list li { position:relative; padding:7px 0 7px 22px; border-bottom:1px solid var(--line); color:var(--muted); }
.beta-list li:last-child { border-bottom:0; }
.beta-list li::before { content:"\25B8"; position:absolute; left:4px; color:var(--amber); }
.beta-list b { color: var(--amber2); }
.beta-foot { font-size:12.5px; color:var(--amber2); margin-bottom:18px; }
.beta-btn {
  width:100%; cursor:pointer; font:inherit; font-size:15px; font-weight:700;
  letter-spacing:2px; text-transform:uppercase; padding:12px 18px; border-radius:10px;
  border:1px solid var(--amber);
  background: linear-gradient(180deg,var(--amber2),var(--amber)); color:#1a1205;
}
.beta-btn:hover { box-shadow: 0 0 22px rgba(232,163,61,.45); }
.beta-btn:focus-visible { outline:2px solid var(--amber2); outline-offset:2px; }
@media (prefers-reduced-motion: reduce) { .beta-box, .beta-scan::after { animation:none; } }
