/* MiaoEx: dark exchange theme in Miaoushi colours */
@font-face { font-family: "Luckiest Guy"; src: url("/assets/LuckiestGuy-Regular.ttf") format("truetype"); font-display: swap; }
:root {
  --bg: #0F0B1C; --bg-2: #161126; --card: #1E1733; --card-2: #281F44; --line: #33295A;
  --fg: #FFF6EC; --muted: #A79BC2; --coral: #FF7A59; --coral-2: #FF9B7F; --gold: #FFC24B;
  --green: #2ED18A; --red: #FF5A6A; --radius: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 "Nunito", system-ui, -apple-system, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--coral-2); }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* header */
.hdr { position: sticky; top: 0; z-index: 20; background: rgba(15,11,28,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.hdr .wrap { display: flex; align-items: center; gap: 18px; height: 62px; }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--fg); font: 400 1.45rem/1 "Luckiest Guy", system-ui; letter-spacing: .02em; }
.logo img { width: 34px; height: 34px; }
.logo em { font-style: normal; color: var(--coral); }
.hdr nav { display: none; gap: 20px; }
.hdr nav a { color: var(--muted); text-decoration: none; font-weight: 800; font-size: .95rem; }
.hdr nav a:hover, .hdr nav a[aria-current] { color: var(--fg); }
.hdr .sp { flex: 1; }
.hdr .acts { display: flex; gap: 8px; align-items: center; }
@media (min-width: 820px) { .hdr nav { display: flex; } }
.who { color: var(--muted); font-weight: 700; font-size: .85rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) { .who { display: none; } }

/* buttons + forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 18px; font-family: inherit; font-weight: 800; font-size: .95rem; line-height: 1; text-decoration: none; cursor: pointer; color: var(--fg); background: var(--card-2); transition: filter .15s ease, transform .1s ease; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--coral); color: #1A1029; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.sm { padding: 8px 13px; font-size: .88rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: wait; }
label { display: grid; gap: 6px; font-weight: 800; font-size: .9rem; color: var(--muted); }
input { width: 100%; background: var(--bg-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px; color: var(--fg); font-family: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2; outline: none; }
input:focus { border-color: var(--coral); }
.code-in { text-align: center; font-size: 1.6rem; letter-spacing: .5em; font-weight: 900; }

/* auth card */
main { flex: 1; }
.auth { display: grid; place-items: center; padding: 40px 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px; width: min(440px, 100%); display: grid; gap: 16px; }
.card h1 { margin: 0; font-size: 1.6rem; }
.card p.sub { margin: -8px 0 0; color: var(--muted); }
.msg { border-radius: 12px; padding: 11px 14px; font-weight: 700; font-size: .92rem; }
.msg.err { background: rgba(255,90,106,.12); color: #FFB3BB; border: 1px solid rgba(255,90,106,.35); }
.msg.ok { background: rgba(46,209,138,.12); color: #9DF0C9; border: 1px solid rgba(46,209,138,.35); }
.alt { text-align: center; color: var(--muted); font-size: .92rem; }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); font-weight: 800; cursor: pointer; padding: 6px; }
.safe { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); font-size: .82rem; font-weight: 700; }

/* home */
.hero { padding: 54px 0 34px; background: radial-gradient(60% 70% at 85% 0%, rgba(255,122,89,.2), transparent 60%); }
.hero .wrap { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.1fr .9fr; } }
.hero h1 { font: 400 clamp(2.4rem, 8vw, 4rem)/1.02 "Luckiest Guy", system-ui; margin: 0; letter-spacing: .01em; }
.hero h1 span { color: var(--coral); }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 52ch; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; }
.ticker { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 20px; display: grid; gap: 14px; }
.pair { display: flex; align-items: center; gap: 12px; }
.pair img { width: 46px; height: 46px; }
.pair b { font-size: 1.25rem; }
.pair small { display: block; color: var(--muted); font-weight: 700; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-weight: 900; font-size: .78rem; background: rgba(255,194,75,.14); color: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats div { background: var(--bg-2); border-radius: 12px; padding: 10px; }
.stats span { display: block; color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.stats b { font-size: 1.05rem; }
.feats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); padding: 30px 0 50px; }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.feat .i { font-size: 1.6rem; }
.feat h3 { margin: 8px 0 4px; font-size: 1.1rem; }
.feat p { margin: 0; color: var(--muted); font-size: .95rem; }

/* account */
.page { padding: 28px 0 50px; display: grid; gap: 18px; }
.page h1 { margin: 0; font-size: 1.7rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.panel h2 { margin: 0 0 12px; font-size: 1.15rem; }
.total { font-size: 2rem; font-weight: 900; }
.total small { font-size: 1rem; color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); font-weight: 700; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.coin { display: flex; align-items: center; gap: 10px; }
.coin img, .coin .dot { width: 30px; height: 30px; border-radius: 50%; }
.coin .dot { display: grid; place-items: center; background: #26A17B; color: #fff; font-weight: 900; font-size: .8rem; }
.coin small { display: block; color: var(--muted); font-weight: 700; font-size: .8rem; }
.row-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.soon { color: var(--muted); font-size: .9rem; }
.grid2 { display: grid; gap: 18px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 2fr 1fr; } }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list li { background: var(--bg-2); border-radius: 12px; padding: 10px 12px; font-size: .88rem; color: var(--muted); word-break: break-word; }
.list li b { color: var(--fg); }

/* footer */
.ftr { border-top: 1px solid var(--line); padding: 22px 0 calc(22px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: .85rem; }
.ftr .wrap { display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; }
.ftr a { color: var(--muted); }
