:root {
  --ink: #0e1a12; --ink-2: #3b4a3f; --muted: #6b786e;
  --paper: #f3f4ee; --paper-2: #e9ece2; --line: rgba(14,26,18,.1);
  --forest: #14281a; --forest-2: #1d3a24; --moss: #2f5a35; --leaf: #8fc96a; --glow: #d6f5b0;
  --sky: #a9d4f2; --red: #c8624a;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }
p { margin: 0; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
svg { display: block; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 22px; border-radius: 999px; background: var(--forest); color: #f1f7ea; font-weight: 500; box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 20px rgba(20,40,26,.22); transition: transform .2s var(--ease), background .2s; }
.btn:hover { transform: translateY(-2px); background: var(--forest-2); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.wide { width: 100%; padding: 16px; font-size: 16px; }
.btn-glow { background: var(--glow); color: var(--forest); }
.btn-glow:hover { background: #e4fbc8; }
.arr { transition: transform .2s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- gate ---------- */
.gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; transition: opacity .6s var(--ease), visibility .6s; }
.gate.hide { opacity: 0; visibility: hidden; }
.gate-bg { position: absolute; inset: -5%; background: url("/assets/banner.jpg") center 60% / cover; filter: blur(16px) saturate(1.1); transform: scale(1.1); }
.gate-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,26,18,.25), rgba(14,26,18,.75)); }
.gate-card { position: relative; width: min(520px, 100%); padding: 44px 40px; border-radius: 32px; background: rgba(20,40,26,.55); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); color: #f1f7ea; box-shadow: 0 40px 80px rgba(0,0,0,.35); animation: gateIn .9s var(--ease) both; }
@keyframes gateIn { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.gate-mark { width: 64px; height: 64px; margin-bottom: 22px; filter: drop-shadow(0 8px 16px rgba(0,0,0,.35)); animation: spin 16s linear infinite; }
@keyframes spin { to { transform: rotate(-360deg); } }
.gate-kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--leaf); }
.gate h1 { font-size: 52px; line-height: 1; letter-spacing: -0.04em; margin: 14px 0 16px; }
.gate h1 em { color: var(--glow); }
.gate-body { color: #c3d5bf; font-size: 16px; margin-bottom: 28px; }
.gate .btn { background: var(--glow); color: var(--forest); }
.gate-alt { display: block; margin-top: 18px; font-size: 14px; color: #a9c2a4; }
.gate-alt:hover { color: #fff; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 26px 18px; background: var(--forest); color: #dfeadb; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 19px; padding: 0 10px; color: #f1f7ea; }
.mark { width: 30px; height: 30px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 38px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; color: #a9bfa5; font-size: 15px; transition: background .2s, color .2s; text-align: left; }
.nav-item svg, .tab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #e9f2e4; }
.nav-item.active { background: rgba(143,201,106,.14); color: var(--glow); }
.side-foot { margin-top: auto; padding: 0 10px; font-size: 13px; }
.chain { display: flex; align-items: center; gap: 8px; color: #a9bfa5; }
.live { width: 8px; height: 8px; border-radius: 99px; background: var(--leaf); box-shadow: 0 0 10px var(--leaf); }
.side-back { display: block; margin-top: 14px; color: #7f977c; }
.side-back:hover { color: #fff; }

.main { padding: 28px 36px 60px; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; gap: 16px; }
.hello { font-size: 14px; color: var(--muted); }
.page-title { font-size: 34px; letter-spacing: -0.03em; }
.top-right { display: flex; align-items: center; gap: 14px; }
.demo { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 7px 12px; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--moss); white-space: nowrap; }
.avatar { width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(135deg, var(--moss), var(--forest)); color: var(--glow); display: grid; place-items: center; font-weight: 600; font-size: 14px; }

.view { display: none; }
.view.active { display: block; }
.rise { opacity: 0; transform: translateY(16px); animation: rise .7s var(--ease) forwards; animation-delay: var(--d, 0s); }
@keyframes rise { to { opacity: 1; transform: none; } }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.panel-head h3 { font-size: 18px; }
.link { color: var(--moss); font-size: 13px; font-weight: 500; }

/* home grid */
.grid-home { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-areas: "bal card" "hold tier" "hold act"; gap: 18px; }
.balance-panel { grid-area: bal; position: relative; overflow: hidden; background: radial-gradient(120% 100% at 0% 0%, #24472c, var(--forest) 60%); color: #eef5e8; border: 0; padding: 28px; }
.card-wrap { grid-area: card; }
.tier-panel { grid-area: tier; }
.holdings { grid-area: hold; }
.activity-mini { grid-area: act; }

.bal-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: #a9bfa5; }
.eye { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.06); }
.eye svg { width: 18px; height: 18px; fill: none; stroke: #cfe0ca; stroke-width: 1.7; }
.bal { font-size: 58px; font-weight: 600; letter-spacing: -0.04em; margin: 8px 0 4px; font-variant-numeric: tabular-nums; transition: filter .3s; }
.bal.hidden { filter: blur(14px); }
.bal-sub { font-size: 14px; color: #a9bfa5; }
.up { color: var(--leaf); font-weight: 600; }
.cb-total { color: var(--glow); }
.quick { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 26px; }
.q { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 18px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); font-size: 13px; color: #e6efe1; transition: background .2s, transform .2s var(--ease); }
.q:hover { background: rgba(143,201,106,.16); transform: translateY(-2px); }
.qi { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--glow); color: var(--forest); font-weight: 700; }
.spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 90px; opacity: .55; pointer-events: none; }
.spark-line { fill: none; stroke: var(--leaf); stroke-width: 2.5; stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 2s var(--ease) .4s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* card */
.mcard { position: relative; aspect-ratio: 1.586; border-radius: 22px; padding: 22px 24px; overflow: hidden; color: #eef6e6; display: flex; flex-direction: column;
  background: radial-gradient(120% 90% at 85% 0%, rgba(214,245,176,.2), transparent 50%), linear-gradient(135deg, #3d6e3f 0%, #2a5530 40%, #1c3d22 72%, #13291a 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 30px 50px -20px rgba(10,30,14,.55); transition: transform .5s var(--ease), filter .4s; transform-style: preserve-3d; }
.mcard::before { content: ""; position: absolute; inset: 0; opacity: .2; mix-blend-mode: overlay; background: repeating-linear-gradient(90deg, rgba(255,255,255,.35) 0 1px, transparent 1px 3px); }
.mcard-facet { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 52%, rgba(255,255,255,.08) 52.2%, rgba(255,255,255,.02) 66%, rgba(0,0,0,.12) 66.2%, transparent 80%); }
.mcard.frozen { filter: grayscale(.8) brightness(.8); }
.mcard.frozen::after { content: "Frozen"; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 14px; letter-spacing: .3em; text-transform: uppercase; background: rgba(169,212,242,.18); backdrop-filter: blur(2px); color: #fff; }
.mcard-top { position: relative; display: flex; justify-content: space-between; }
.mcard-top b { display: block; font-size: 22px; letter-spacing: -0.03em; }
.mcard-top small { font-family: var(--mono); font-size: 9px; letter-spacing: .3em; opacity: .75; }
.mcard-top svg { width: 40px; height: 40px; }
.mcard-chip { position: relative; width: 44px; height: 32px; border-radius: 7px; margin-top: 18px; background: linear-gradient(135deg, #e9eee6, #b7bfb3 50%, #dfe5db); }
.mcard-num { position: relative; margin-top: auto; font-family: var(--mono); letter-spacing: .14em; }
.mcard-foot { position: relative; display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: #c9dcc4; }
.mcard-foot b { color: var(--glow); font-weight: 600; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; }
.chip-btn { flex: 1; padding: 11px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-weight: 500; font-size: 14px; transition: background .2s; }
.chip-btn:hover { background: var(--paper-2); }
.chip-btn.on { background: var(--sky); border-color: transparent; }

/* tier ring */
.ring-wrap { position: relative; width: 140px; height: 140px; margin: 2px auto 14px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--paper-2); stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--moss); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 314; stroke-dashoffset: 314; transition: stroke-dashoffset 1.6s var(--ease) .3s; }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; }
.ring-label b { font-size: 34px; letter-spacing: -0.03em; color: var(--forest); }
.ring-label span { font-size: 13px; color: var(--muted); }
.prog { height: 8px; border-radius: 99px; background: var(--paper-2); margin-top: 12px; overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--leaf), var(--moss)); animation: grow 1.4s var(--ease) .5s forwards; }
@keyframes grow { to { width: var(--w); } }
.prog.light { background: rgba(255,255,255,.12); }
.prog-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; font-family: var(--mono); }

/* lists */
.hold-list, .act-list, .mkt-list, .ep-list { list-style: none; margin: 0; padding: 0; }
.hold-list li, .mkt-list li { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-radius: 14px; transition: background .2s; }
.hold-list li + li, .mkt-list li + li { border-top: 1px solid var(--line); }
.hold-list li:hover, .mkt-list li:hover { background: var(--paper); }
.tk { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-family: var(--mono); font-size: 11px; font-weight: 500; color: #fff; flex-shrink: 0; }
.h-main { flex: 1; min-width: 0; }
.h-main b { display: block; font-weight: 600; }
.h-main span { font-size: 13px; color: var(--muted); }
.h-val { text-align: right; font-variant-numeric: tabular-nums; }
.h-val b { display: block; font-weight: 600; }
.h-val span { font-size: 13px; }
.pos { color: var(--moss); } .neg { color: var(--red); }
.mini-spark { width: 70px; height: 28px; flex-shrink: 0; }
.mkt-list li { cursor: pointer; }
.mkt-list li.sel { background: rgba(143,201,106,.14); }

.act-list li { display: flex; align-items: center; gap: 14px; padding: 12px 4px; }
.act-list li + li { border-top: 1px solid var(--line); }
.act-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--paper); font-weight: 700; color: var(--forest); flex-shrink: 0; }
.act-ic.cb { background: var(--glow); }
.act-list .h-main span { font-family: var(--mono); font-size: 11px; }
.act-list li.new { animation: flash 1.4s var(--ease); }
@keyframes flash { from { background: rgba(143,201,106,.3); } }

/* trade */
.grid-trade { display: grid; grid-template-columns: 1fr 440px; gap: 18px; align-items: start; }
.swap { position: sticky; top: 24px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px; background: var(--paper); margin-bottom: 16px; }
.seg-b { padding: 10px; border-radius: 11px; font-weight: 500; color: var(--muted); transition: background .2s, color .2s; }
.seg-b.active { background: #fff; color: var(--forest); box-shadow: 0 2px 8px rgba(14,26,18,.08); }
.field { display: block; padding: 16px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); }
.f-lab { font-size: 13px; color: var(--muted); }
.f-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.f-row input { width: 100%; border: 0; background: transparent; font: inherit; font-size: 34px; font-weight: 600; letter-spacing: -0.03em; outline: none; color: var(--ink); }
.f-row b { font-size: 34px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.f-unit { font-family: var(--mono); font-size: 13px; padding: 7px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); white-space: nowrap; }
.presets { display: flex; gap: 6px; margin-top: 10px; }
.presets button { padding: 6px 12px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: 12px; font-family: var(--mono); }
.presets button:hover { border-color: var(--moss); }
.swap-arrow { width: 38px; height: 38px; margin: -10px auto; position: relative; z-index: 1; display: grid; place-items: center; border-radius: 12px; background: var(--forest); color: var(--glow); border: 4px solid #fff; }
.field.out { margin-bottom: 16px; }
.impact { padding: 4px 2px; }
.imp-row { display: flex; justify-content: space-between; font-size: 14px; }
.imp-bar { position: relative; height: 8px; border-radius: 99px; background: var(--paper-2); margin: 8px 0; overflow: hidden; }
.imp-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 5%; border-radius: 99px; background: linear-gradient(90deg, var(--leaf), var(--moss)); transition: width .4s var(--ease), background .3s; }
.imp-bar i.over { background: linear-gradient(90deg, #e2a07c, var(--red)); }
.imp-limit { position: absolute; left: 66%; top: -2px; bottom: -2px; width: 2px; background: var(--red); }
.cb-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; margin: 14px 0 16px; border-radius: 16px; background: var(--forest); color: #dfeadb; font-size: 14px; }
.cb-row b { color: var(--glow); font-size: 18px; }
.fine { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* rewards */
.grid-rewards { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "claim tiers" "ep tiers"; gap: 18px; }
.claim-panel { grid-area: claim; background: radial-gradient(120% 100% at 100% 0%, #24472c, var(--forest) 60%); color: #eef5e8; border: 0; }
.claim-panel .muted { color: #a9bfa5; }
.claim-amt { font-size: 64px; font-weight: 600; letter-spacing: -0.04em; margin: 6px 0 18px; font-variant-numeric: tabular-nums; }
.claim-amt small { font-size: 16px; color: var(--leaf); margin-left: 8px; }
.vest { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
.vest-row { display: flex; justify-content: space-between; color: #c9dcc4; }
.vest-row.small { color: #8fa78b; margin-top: 6px; }
.tiers-panel { grid-area: tiers; }
.tiers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tiers li { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); }
.tiers li span { font-weight: 600; }
.tiers li b { font-size: 20px; color: var(--forest); }
.tiers li em { font-family: var(--mono); font-style: normal; font-size: 12px; color: var(--muted); }
.tiers li.done { background: var(--paper); }
.tiers li.cur { background: var(--forest); color: #eef5e8; border-color: transparent; }
.tiers li.cur b { color: var(--glow); } .tiers li.cur em { color: #a9bfa5; }
.epochs { grid-area: ep; }
.ep-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; padding: 12px 2px; }
.ep-list li + li { border-top: 1px solid var(--line); }
.ep-list b { color: var(--moss); }
.ep-list em { font-family: var(--mono); font-style: normal; font-size: 12px; color: var(--muted); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 30px; z-index: 90; transform: translate(-50%, 30px); opacity: 0; padding: 14px 20px; border-radius: 16px; background: var(--forest); color: #eef5e8; box-shadow: 0 20px 40px rgba(14,26,18,.3); font-size: 14px; display: flex; gap: 10px; align-items: center; transition: opacity .35s var(--ease), transform .35s var(--ease); pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast b { color: var(--glow); }

.tabbar { display: none; }

/* responsive */
@media (max-width: 1100px) {
  .grid-home { grid-template-columns: 1fr 1fr; grid-template-areas: "bal bal" "card tier" "hold hold" "act act"; }
  .grid-trade { grid-template-columns: 1fr; }
  .swap { position: static; order: -1; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 20px 16px 110px; }
  .demo { display: none; }
  .grid-home { grid-template-columns: 1fr; grid-template-areas: "bal" "card" "tier" "hold" "act"; }
  .grid-rewards { grid-template-columns: 1fr; grid-template-areas: "claim" "tiers" "ep"; }
  .bal { font-size: 44px; }
  .q { font-size: 12px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 80; padding: 8px; border-radius: 22px; background: rgba(20,40,26,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 16px 40px rgba(0,0,0,.25); }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; border-radius: 14px; font-size: 11px; color: #a9bfa5; }
  .tab.active { background: rgba(143,201,106,.16); color: var(--glow); }
  .gate h1 { font-size: 40px; }
  .gate-card { padding: 34px 26px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } .rise { opacity: 1; transform: none; } }
