:root {
  --bg: #0b0905; --bg2: #120e08; --card: #1a150d; --line: #33291a; --text: #f5ecd8; --muted: #a99c80;
  --gold: #f2c14e; --gold2: #d9a032; --deep: #7a4f12; --ok: #7fd19b; --bad: #ef8a6b;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 Inter, system-ui, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; background: radial-gradient(900px 600px at 80% -10%, rgba(242, 193, 78, .12), transparent 60%), var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; width: 100%; outline: none; }
input:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 193, 78, .15); }
textarea { resize: none; font-family: var(--mono); font-size: 14px; }
label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin: 16px 0 6px; }
h1, h2 { font-family: Cinzel, Georgia, serif; margin: 0 0 10px; line-height: 1.2; }
h1 { font-size: 30px; color: var(--gold); }
h2 { font-size: 22px; }
code { font-family: var(--mono); font-size: .9em; }
.mono { font-family: var(--mono); font-size: 13px; word-break: break-all; }
.muted { color: var(--muted); }
.center { text-align: center; }
.err { color: var(--bad); font-size: 14px; min-height: 1em; margin: 8px 0 0; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
[hidden] { display: none !important; }

.app { max-width: 460px; margin: 0 auto; padding: 0 18px calc(40px + var(--safe-b)); }
.top { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font: 700 18px Cinzel, Georgia, serif; }
.brand img { width: 30px; height: 30px; }
.brand span { color: var(--gold); margin-left: 2px; }
.net { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); background: var(--card); border: 1px solid var(--line); padding: 5px 10px; border-radius: 99px; }
.net i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.net.on i { background: var(--ok); box-shadow: 0 0 0 3px rgba(127, 209, 155, .18); }
.net.off i { background: var(--gold); }
.net b { font-weight: 500; }

.view { animation: in .35s ease both; padding-top: 8px; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } }
.hero-coin { display: block; margin: 10px auto 18px; width: 220px; height: auto; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .6)) drop-shadow(0 0 30px rgba(242, 193, 78, .2)); }
.hero-coin.sm { width: 110px; }
#v-welcome h1, #v-welcome > p, #v-unlock h2, #v-unlock p { text-align: center; }
.ticks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; color: var(--muted); font-size: 14px; }
.ticks li::before { content: "✓"; color: var(--ok); font-weight: 700; margin-right: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 16px; padding: 15px 20px; font-weight: 600; text-decoration: none; transition: transform .1s, filter .15s; }
.btn:active { transform: scale(.98); }
.btn.block { width: 100%; margin-top: 12px; }
.btn.gold { background: linear-gradient(180deg, #ffdc82, var(--gold2)); color: #231a08; box-shadow: 0 10px 30px -12px rgba(242, 193, 78, .7); }
.btn.gold:disabled { filter: grayscale(.8) brightness(.6); cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: var(--card); border-color: var(--line); color: var(--text); }
.btn.danger { background: transparent; border-color: rgba(239, 138, 107, .4); color: var(--bad); }
.btn.sm { padding: 10px 14px; font-size: 14px; border-radius: 12px; }
.link { background: none; border: 0; color: var(--muted); display: block; margin: 14px auto 0; text-decoration: underline; font-size: 14px; }
.back { background: none; border: 0; color: var(--muted); padding: 0; margin-bottom: 10px; font-size: 14px; }
.row { display: flex; gap: 10px; margin-top: 10px; }
.row > * { flex: 1; }

.stepper { display: flex; gap: 6px; margin-bottom: 14px; }
.stepper i { height: 4px; flex: 1; border-radius: 4px; background: var(--line); }
.stepper i.on { background: var(--gold); }
.secret { position: relative; background: var(--bg2); border: 1px dashed var(--gold2); border-radius: 14px; padding: 16px; margin-top: 14px; }
.secret code { display: block; word-break: break-all; color: #f6e7bf; font-size: 15px; line-height: 1.7; letter-spacing: .03em; }
.veil { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(18, 14, 8, .82); backdrop-filter: blur(6px); border-radius: 14px; }
.warn { background: rgba(239, 138, 107, .08); border: 1px solid rgba(239, 138, 107, .3); color: #f3c3b2; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-top: 14px; }
.check { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: 15px; font-weight: 500; margin: 18px 0 4px; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }
#v-password input + input { margin-top: 10px; }
.meter { height: 5px; background: var(--line); border-radius: 5px; margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--bad); transition: width .25s, background .25s; }

/* Tarjeta de saldo */
.card { position: relative; overflow: hidden; border-radius: 24px; padding: 22px 22px 18px; color: #2a1d06;
  background: radial-gradient(120% 140% at 0% 0%, #fff2c2 0%, #f5c955 38%, #d39a2c 70%, #9b6a1c 100%);
  box-shadow: 0 24px 50px -20px rgba(242, 193, 78, .45), inset 0 1px 0 rgba(255, 255, 255, .5); }
.card::after { content: ""; position: absolute; right: -60px; bottom: -70px; width: 220px; height: 220px; opacity: .14;
  background: conic-gradient(from 45deg, #000 0 25%, transparent 0 50%, #000 0 75%, transparent 0); border-radius: 50%; }
.card-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; opacity: .8; }
.card-top img { width: 34px; height: 34px; }
.balance { margin: 10px 0 2px; display: flex; align-items: baseline; gap: 8px; }
.balance b { font: 700 clamp(34px, 11vw, 46px)/1 Cinzel, Georgia, serif; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.balance span { font-weight: 700; opacity: .75; }
.pending { font-size: 13px; font-weight: 600; opacity: .8; }
.addr { display: block; margin-top: 14px; background: rgba(42, 29, 6, .12); border: 0; border-radius: 10px; padding: 8px 10px; font: 13px var(--mono); color: inherit; width: 100%; text-align: left; position: relative; z-index: 1; }
.addr.full { background: var(--bg2); border: 1px solid var(--line); color: var(--text); word-break: break-all; text-align: center; margin-top: 14px; }

.actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; margin: 18px 0 8px; }
.actions button { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 4px; display: grid; gap: 4px; justify-items: center; font-size: 13px; font-weight: 600; }
.actions button i { font-style: normal; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; background: rgba(242, 193, 78, .12); color: var(--gold); }
.actions button:active { transform: scale(.97); }
.sec { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin: 22px 0 8px; }
.activity { display: grid; gap: 8px; }
.tx { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; text-decoration: none; color: inherit; }
.tx .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; }
.tx.in .ic { background: rgba(127, 209, 155, .14); color: var(--ok); }
.tx.out .ic { background: rgba(239, 138, 107, .12); color: var(--bad); }
.tx.mint .ic { background: rgba(242, 193, 78, .14); color: var(--gold); }
.tx .t1 { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .t2 { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.tx.in .amt, .tx.mint .amt { color: var(--ok); }
.tx .st { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.tx .st.final { color: var(--ok); }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; border: 1px dashed var(--line); border-radius: 16px; font-size: 14px; }

/* Hojas inferiores */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); z-index: 20; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 520px; margin: 0 auto; max-height: 92dvh; overflow-y: auto;
  background: var(--bg2); border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0; padding: 10px 20px calc(24px + var(--safe-b)); animation: up .28s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes up { from { transform: translateY(100%); } }
.grab { width: 42px; height: 5px; border-radius: 5px; background: var(--line); margin: 4px auto 14px; }
.field-row { display: flex; gap: 8px; }
.field-row input { flex: 1; min-width: 0; }
.icon { width: 50px; flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; font-size: 18px; }
.pill-btn { flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 16px; color: var(--gold); font-weight: 600; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; font-weight: 600; display: grid; }
.seg button small { color: var(--muted); font-weight: 500; font-size: 12px; }
.seg button.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.big-amount { text-align: center; margin: 8px 0 14px; color: var(--muted); font-weight: 600; }
.big-amount b { display: block; font: 700 40px/1.1 Cinzel, Georgia, serif; color: var(--gold); }
.review { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 0; }
.review dt { color: var(--muted); font-size: 14px; }
.review dd { margin: 0; text-align: right; font-weight: 500; }
.qr { background: #fff8e6; border-radius: 22px; padding: 16px; width: min(280px, 100%); margin: 4px auto 0; box-shadow: 0 20px 40px -20px rgba(242, 193, 78, .5); }
.qr svg { display: block; width: 100%; height: auto; }
.req { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.req summary { cursor: pointer; font-weight: 600; }
.req .field-row { margin-top: 10px; }
#cam { width: 100%; border-radius: 18px; background: #000; aspect-ratio: 1; object-fit: cover; }
.check-anim { width: 84px; height: 84px; margin: 10px auto 12px; }
.check-anim svg { width: 100%; height: 100%; fill: none; stroke: var(--ok); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.check-anim circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .6s ease forwards; }
.check-anim path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s .5s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%); z-index: 40; background: var(--text); color: #1a1206; font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 99px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: fade .2s both; max-width: 90vw; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
