:root {
  color-scheme: dark;
  --bg: #090a0f;
  --surface: rgba(23, 25, 34, .82);
  --surface-strong: #191c25;
  --border: rgba(255, 255, 255, .09);
  --text: #f5f7fb;
  --muted: #9aa1b3;
  --gold: #e8b95a;
  --gold-soft: #ffe1a3;
  --violet: #8d71ff;
  --danger: #ff7c86;
  --success: #72d7a1;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% -10%, #29223b 0, var(--bg) 42%);
  color: var(--text);
  overflow-x: hidden;
}
button, input { font: inherit; }
button { color: inherit; }
.shell { width: min(100%, 760px); margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px calc(38px + env(safe-area-inset-bottom)); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.55rem, 5vw, 2.35rem); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 1.15rem; }
.eyebrow { margin-bottom: 5px; color: var(--gold); font-size: .7rem; font-weight: 800; letter-spacing: .18em; }
.avatar { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(145deg, var(--gold-soft), var(--gold)); color: #241704; font-weight: 900; box-shadow: 0 12px 30px rgba(232, 185, 90, .22); }
.panel { border: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(18px); border-radius: var(--radius); box-shadow: 0 18px 50px rgba(0, 0, 0, .2); }
.hero { position: relative; overflow: hidden; padding: 24px; margin-bottom: 14px; }
.hero::after { content: ""; position: absolute; width: 170px; height: 170px; border-radius: 50%; right: -55px; top: -75px; background: radial-gradient(circle, rgba(232, 185, 90, .38), transparent 68%); }
.muted { color: var(--muted); }
.balance { font-size: clamp(2.2rem, 10vw, 4.2rem); line-height: 1; font-weight: 900; letter-spacing: -.06em; margin: 12px 0 18px; }
.balance small { color: var(--gold); font-size: .26em; letter-spacing: .12em; }
.balance-split { display: flex; flex-wrap: wrap; gap: 10px 24px; color: var(--muted); font-size: .9rem; }
.balance-split strong { color: var(--text); margin-left: 5px; }
.quick-grid, .stats-grid { display: grid; gap: 10px; margin-bottom: 14px; }
.quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quick-card { min-height: 88px; display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--border); border-radius: 18px; background: var(--surface-strong); padding: 15px; cursor: pointer; transition: transform .15s ease, border-color .15s ease; }
.quick-card:active { transform: scale(.98); }
.quick-card:hover { border-color: rgba(232, 185, 90, .38); }
.quick-icon { font-size: 1.55rem; }
.stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { padding: 15px; min-width: 0; }
.stat span, .stat small { display: block; font-size: .72rem; }
.stat strong { display: block; font-size: 1.5rem; margin: 6px 0 3px; }
.stat small { color: var(--muted); overflow-wrap: anywhere; }
.section { padding: 20px; margin-top: 14px; }
.section-title { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 16px; }
.section-title .eyebrow { margin-bottom: 3px; }
.section-title > .muted { font-size: .72rem; text-align: right; }
.list { display: grid; gap: 9px; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.055); border-radius: 15px; padding: 13px 14px; }
.list-item strong, .list-item small { display: block; }
.list-item small { margin-top: 3px; color: var(--muted); }
.price { color: var(--gold-soft); font-weight: 800; white-space: nowrap; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.card { min-height: 118px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--border); border-radius: 16px; padding: 14px; background: linear-gradient(150deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); }
.card .rarity { color: var(--gold); font-size: .7rem; text-transform: uppercase; letter-spacing: .11em; }
.card small { color: var(--muted); }
.alert { padding: 24px; }
.alert h2 { margin-bottom: 10px; }
.button { border: 0; border-radius: 14px; background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: #241704; font-weight: 850; padding: 13px 17px; cursor: pointer; }
.button.secondary { background: #2a2e3b; color: var(--text); }
.modal { width: min(calc(100% - 28px), 520px); border: 1px solid var(--border); border-radius: 24px; background: #171923; color: var(--text); padding: 0; box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.modal::backdrop { background: rgba(3,4,7,.75); backdrop-filter: blur(6px); }
.modal form { position: relative; padding: 24px; }
.modal h2 { margin-bottom: 10px; font-size: 1.45rem; }
.close { position: absolute; top: 13px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 12px; background: rgba(255,255,255,.07); font-size: 1.4rem; cursor: pointer; }
label { display: grid; gap: 7px; color: var(--muted); margin: 19px 0 14px; }
input { width: 100%; border: 1px solid var(--border); border-radius: 13px; background: #0e1017; color: var(--text); padding: 13px 14px; outline: none; }
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,185,90,.12); }
.result { margin-top: 15px; border-radius: 13px; background: rgba(255,255,255,.05); padding: 13px; overflow-wrap: anywhere; white-space: pre-line; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 32px), 560px); padding: 13px 16px; border-radius: 14px; background: #292d39; border: 1px solid var(--border); box-shadow: 0 16px 50px rgba(0,0,0,.5); text-align: center; }
.toast.error { color: var(--danger); }
.toast.success { color: var(--success); }
.hidden { display: none !important; }
.skeleton { height: 62px; border-radius: 14px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.ambient { position: fixed; width: 300px; height: 300px; filter: blur(90px); opacity: .18; pointer-events: none; }
.ambient-a { background: var(--violet); top: 12%; left: -170px; }
.ambient-b { background: var(--gold); bottom: 2%; right: -190px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (min-width: 620px) {
  .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quick-card { flex-direction: column; align-items: flex-start; justify-content: center; }
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 430px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .stat strong { grid-row: 1 / span 2; grid-column: 2; }
}
