:root {
  --bg: #0d0d0f;
  --card: #17171a;
  --soft: rgba(255, 255, 255, .055);
  --soft2: rgba(255, 255, 255, .1);
  --ink: #f5f5f6;
  --mute: #8d8d96;
  --green: #0fae6e;
  --red: #e2372c;
  --r: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; }
body { min-height: 100vh; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Lexend, system-ui, "Segoe UI", sans-serif;
  font-size: 15px;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; border: 0; background: none; outline: none; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px 400px at 85% -5%, rgba(15, 174, 110, .16), transparent 70%),
    radial-gradient(520px 420px at 105% 95%, rgba(226, 55, 44, .13), transparent 70%);
  animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(-30px, 20px, 0) scale(1.08); } }

/* sidebar */
.side {
  position: fixed; left: 0; top: 0; width: 250px; height: 100vh; z-index: 2;
  padding: 28px 18px; display: flex; flex-direction: column; gap: 34px;
}
.logo { display: flex; align-items: baseline; gap: 2px; padding-left: 10px; }
.logo-b {
  font-family: "Playfair Display", Georgia, serif; font-weight: 900;
  font-size: 58px; line-height: .8; letter-spacing: -2px;
  transition: transform .5s var(--ease);
}
.logo:hover .logo-b { transform: rotate(-6deg) scale(1.06); }
.logo-t { font-weight: 600; font-size: 22px; color: var(--mute); }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px; border-radius: 999px;
  color: var(--mute); font-weight: 600;
  transition: background .25s, color .25s, transform .25s var(--ease);
}
.nav a:hover { color: var(--ink); transform: translateX(3px); }
.nav a.on { background: var(--soft); color: var(--ink); }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-note { margin-top: auto; padding-left: 12px; font-size: 11.5px; line-height: 1.6; color: #5d5d66; }

/* main */
.main { position: relative; z-index: 1; margin-left: 250px; padding: 34px 40px 130px; max-width: 1180px; }
.view { animation: rise .5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.hello { color: var(--mute); margin-bottom: 4px; }
h1 { font-size: clamp(30px, 4.2vw, 44px); font-weight: 800; letter-spacing: -1.2px; }
h2 { font-size: 21px; font-weight: 800; letter-spacing: -.4px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }

.card {
  background: var(--card); border-radius: var(--r); padding: 26px;
  animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms);
}
.grid { display: grid; gap: 18px; align-items: start; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }

/* countdown */
.count { display: flex; align-items: center; gap: 18px; background: var(--card); padding: 14px 24px; border-radius: 999px; }
.count small { font-size: 10.5px; font-weight: 800; letter-spacing: .8px; color: var(--mute); line-height: 1.3; }
.count b { font-size: 25px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 1px; }

/* pills, chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 17px; border-radius: 999px; background: var(--soft);
  color: var(--mute); font-weight: 600; font-size: 14px;
  transition: background .2s, color .2s, transform .2s var(--ease);
}
.chip:hover { transform: translateY(-2px); color: var(--ink); }
.chip.on { background: var(--ink); color: var(--bg); }
.label { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--mute); text-transform: uppercase; margin: 20px 0 10px; }
.label:first-child { margin-top: 0; }

.step { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 999px; padding: 5px; }
.step button { width: 36px; height: 36px; border-radius: 50%; background: var(--soft2); font-size: 19px; transition: transform .15s; }
.step button:active { transform: scale(.88); }
.step b { min-width: 34px; text-align: center; font-size: 17px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 26px; border-radius: 999px; background: var(--ink); color: var(--bg);
  font-weight: 800; transition: transform .2s var(--ease), opacity .2s;
}
.btn:hover { transform: translateY(-2px) scale(1.02); }
.btn:active { transform: scale(.97); }
.btn.wide { width: 100%; }
.btn.ghost { background: var(--soft); color: var(--ink); }

/* stats */
.stat { position: relative; overflow: hidden; min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; }
.stat b { font-size: 46px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; }
.stat span { font-weight: 600; opacity: .9; margin-top: 6px; }
.stat.buy { background: var(--green); }
.stat.sell { background: var(--red); }
.stat::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px;
  border-radius: 50%; background: rgba(0, 0, 0, .13); transition: transform .6s var(--ease);
}
.stat:hover::after { transform: scale(1.35); }

/* market rows */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: grid; align-items: center; gap: 12px;
  padding: 12px 14px 12px 20px; border-radius: 999px; background: var(--soft);
  animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms);
  transition: background .2s, transform .2s var(--ease);
}
.row:hover { background: var(--soft2); transform: translateX(3px); }
.row.mk { grid-template-columns: 58px 1fr auto; cursor: pointer; }
.row.ls { grid-template-columns: 54px 44px 1fr auto; }
.row .t { font-weight: 800; font-variant-numeric: tabular-nums; }
.row .n { color: var(--mute); font-weight: 600; }
.row .p { font-weight: 800; }
.row .p.free { color: var(--green); }
.bar { height: 8px; border-radius: 99px; background: var(--red); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 99px; transition: width .9s var(--ease); }
.bar.empty { background: var(--soft2); }
.tag { padding: 7px 13px; border-radius: 999px; background: var(--soft2); font-weight: 800; font-size: 13px; white-space: nowrap; }
.tag.up { color: var(--green); }
.tag.down { color: var(--red); }

/* book */
.book h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.buy .dot, .dot.buy { background: var(--green); }
.sell .dot, .dot.sell { background: var(--red); }
.book h2 em { margin-left: auto; font-style: normal; font-size: 13px; color: var(--mute); font-weight: 600; }
.wa {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 999px;
  font-weight: 800; font-size: 13px; white-space: nowrap; transition: transform .2s var(--ease), filter .2s;
}
.wa:hover { transform: scale(1.05); }
.buy .wa { background: var(--green); }
.sell .wa { background: var(--red); }
.wa.lock { background: var(--soft2); color: var(--mute); }
.wa.mine { background: var(--soft2); color: var(--ink); }
.wa svg { width: 14px; height: 14px; }
.empty { color: var(--mute); padding: 26px 6px; text-align: center; }

.quote { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.quote .big { font-size: 46px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; }
.quote .meter { flex: 1; min-width: 200px; }
.quote .legend { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--mute); margin-top: 9px; }

/* forms */
.field {
  display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: 999px;
  padding: 0 22px; height: 56px; transition: background .2s, box-shadow .2s;
}
.field:focus-within { background: var(--soft2); box-shadow: 0 0 0 2px var(--ink); }
.field input { flex: 1; min-width: 0; height: 100%; }
.field input::placeholder { color: #666670; }
.field span { color: var(--mute); font-weight: 600; }
.form { display: flex; flex-direction: column; gap: 12px; max-width: 440px; }
.hint { color: var(--mute); font-size: 13px; line-height: 1.6; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--soft); border-radius: 999px; padding: 5px; }
.seg button { padding: 12px; border-radius: 999px; font-weight: 800; color: var(--mute); transition: background .25s, color .25s; }
.seg button.on { background: var(--ink); color: var(--bg); }
.seg button.on.buy { background: var(--green); color: #fff; }
.seg button.on.sell { background: var(--red); color: #fff; }

/* fab */
.fab {
  position: fixed; left: calc(50% + 125px); bottom: 28px; transform: translateX(-50%); z-index: 7;
  width: 66px; height: 66px; border-radius: 50%; background: var(--ink); color: var(--bg);
  display: grid; place-items: center; box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  transition: transform .3s var(--ease);
  animation: pop .6s var(--ease) .3s both;
}
.fab:hover { transform: translateX(-50%) scale(1.1) rotate(90deg); }
@keyframes pop { from { transform: translateX(-50%) scale(0); } }

/* sheet */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 18px;
  background: rgba(0, 0, 0, .62); backdrop-filter: blur(8px); animation: fade .25s both;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: min(480px, 100%); max-height: 92vh; overflow: auto; background: var(--card);
  border-radius: 34px; padding: 28px; animation: up .45s var(--ease) both;
}
@keyframes up { from { opacity: 0; transform: translateY(40px) scale(.96); } }
.sheet .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.x { width: 40px; height: 40px; border-radius: 50%; background: var(--soft); font-size: 18px; transition: transform .3s var(--ease); }
.x:hover { transform: rotate(90deg); }
.sugg { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; color: var(--mute); font-size: 13.5px; }
.sugg button { font-weight: 800; color: var(--ink); background: var(--soft); padding: 8px 14px; border-radius: 999px; }

.toast {
  position: fixed; left: 50%; bottom: 110px; z-index: 20; transform: translate(-50%, 30px);
  background: var(--ink); color: var(--bg); font-weight: 800; padding: 13px 22px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s var(--ease); white-space: nowrap;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  body { display: block; }
  .side {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; height: auto; z-index: 6;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(13, 13, 15, .9); backdrop-filter: blur(14px);
  }
  .logo, .side-note { display: none; }
  .nav { flex-direction: row; justify-content: space-between; }
  .nav a { flex: 1; flex-direction: column; gap: 4px; padding: 9px 4px; font-size: 11px; border-radius: 20px; }
  .nav a:hover { transform: none; }
  .nav a:nth-child(2) { margin-right: 38px; }
  .nav a:nth-child(3) { margin-left: 38px; }
  .main { margin-left: 0; padding: 22px 16px 150px; }
  .mlogo { display: flex !important; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .g3.keep { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .g3.keep .stat { min-height: 110px; padding: 18px; }
  .g3.keep .stat b { font-size: 32px; }
  .g3.keep .stat span { font-size: 12px; }
  .fab { left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); width: 62px; height: 62px; }
  .card { padding: 20px; }
  .count { width: 100%; justify-content: space-between; }
}
.mlogo { display: none; align-items: baseline; margin-bottom: 18px; }
.mlogo .logo-b { font-size: 44px; }
.mlogo .logo-t { font-size: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* retouches */
.row.ls { grid-template-columns: 54px 62px 1fr auto; }
.row .n { display: inline-flex; align-items: center; gap: 5px; }
.row .n svg { width: 15px; height: 15px; }
.stat.time b { font-size: clamp(24px, 2.9vw, 38px); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.stat.time span { color: var(--mute); }
.side-note a, .foot a { color: var(--ink); font-weight: 600; transition: opacity .2s; }
.side-note a:hover, .foot a:hover { opacity: .7; }
.heart { color: var(--red); display: inline-block; animation: beat 1.4s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.3); } 30% { transform: scale(1); } 45% { transform: scale(1.2); } }
.foot { display: none; text-align: center; color: var(--mute); font-size: 12.5px; margin-top: 30px; }

.auth {
  max-width: 360px; margin: 0 auto; min-height: calc(100vh - 260px);
  display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 22px; text-align: center;
}
.auth .logo-b { font-size: 84px; }
.auth .form { max-width: none; }
.auth .field { background: var(--card); }
.auth .hint { font-size: 12.5px; }

@media (max-width: 900px) {
  .foot { display: block; }
  .g3.keep { grid-template-columns: 1fr 1fr; }
  .g3.keep .stat.time { grid-column: 1 / -1; min-height: 96px; }
  .g3.keep .stat.time b { font-size: 30px; }
}

/* live backend */
.still .card, .still .row { animation: none; }
.g3 { align-items: stretch; }
.btn.danger { background: var(--red); color: #fff; }
.btn .g { font-family: Georgia, serif; font-weight: 900; font-size: 19px; line-height: 1; }
.seg button.off { opacity: .3; pointer-events: none; }
.link { color: var(--mute); font-weight: 600; font-size: 13px; padding: 6px; transition: color .2s; }
.link:hover { color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }

@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.row.fire { position: relative; animation: flame 5s ease-out forwards; }
.row.fire.in, .still .row.fire.in { animation: slideIn .7s var(--ease) both, flame 5s ease-out forwards; }
.row.fire::before {
  content: ''; position: absolute; inset: -2px; border-radius: inherit; padding: 2.5px; pointer-events: none;
  background: conic-gradient(from var(--a), #ff2d00, #ffb300, #ff6a00, #e2372c, #ffd000, #ff2d00);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 1.1s linear infinite, burnout 5s ease-out forwards;
}
@keyframes spin { to { --a: 360deg; } }
@keyframes burnout { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-60px) scale(.94); } }
@keyframes flame {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 106, 0, 0); }
  10%, 30%, 50%, 70% { box-shadow: 0 0 26px rgba(255, 106, 0, .55), 0 -6px 34px rgba(255, 45, 0, .35); }
  20%, 40%, 60% { box-shadow: 0 0 14px rgba(255, 179, 0, .4), 0 -3px 20px rgba(255, 45, 0, .25); }
}

/* toast: top centre of the content area, easy to read */
.toast {
  top: 22px; bottom: auto; left: calc(50% + 125px); transform: translate(-50%, -40px) scale(.9);
  font-size: 15.5px; padding: 15px 26px 15px 22px; display: flex; align-items: center; gap: 11px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .6);
}
.toast::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--green); flex: none; }
.toast.on { transform: translate(-50%, 0) scale(1); }

.field select {
  appearance: none; -webkit-appearance: none; background: var(--soft2); color: var(--ink); font: inherit; font-weight: 800;
  border: 0; outline: none; border-radius: 999px; padding: 9px 14px; margin-left: -10px; cursor: pointer;
}
.field select option { background: var(--card); color: var(--ink); }

.stat.love { justify-content: flex-end; transition: transform .3s var(--ease); }
.stat.love:hover { transform: translateY(-3px); }
.stat.love span { color: var(--mute); margin: 0 0 4px; }
.stat.love b { font-size: clamp(20px, 2.3vw, 28px); letter-spacing: -.5px; }
.stat.love .heart { font-style: normal; }

@media (max-width: 900px) {
  .toast { left: 50%; top: 14px; max-width: calc(100vw - 28px); white-space: normal; }
  .g3.keep .stat.love { grid-column: 1 / -1; min-height: 96px; }
  .g3.keep .stat.love b { font-size: 24px; }
}

/* link hint on the signature card */
.stat.love .go {
  position: absolute; top: 18px; right: 18px; z-index: 1; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; background: var(--soft2); color: var(--ink);
  transition: transform .3s var(--ease), background .3s, color .3s;
}
.stat.love:hover .go { transform: translate(3px, -3px) scale(1.08); background: var(--ink); color: var(--bg); }
.stat.love::after { display: none; }

@media (max-width: 900px) { .nav a span { white-space: nowrap; font-size: 10.5px; } }
