:root {
  --bg: #000000;
  --bg-elevated: #0a0a0a;
  --ink: #f2f2f2;
  --muted: #8a8a8a;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #ffffff;
  --accent-soft: #d4d4d4;
  --danger: #ff6b6b;
  --panel: #0d0d0d;
  --input: #111111;
  --radius: 14px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.glow {
  display: none;
}

.top,
main,
.user-bar {
  position: relative;
  z-index: 1;
}

.user-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 0.65rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  animation: rise 0.55s ease both;
}

.user-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #141414;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-soft);
  letter-spacing: 0.02em;
}

.user-meta {
  min-width: 0;
}

.user-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55vw;
}

.user-handle {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.user-wallet {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: var(--accent-soft);
}

.mono {
  font-family: var(--mono);
}

.user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #111;
}

.badge.ok {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.badge.warn {
  border-color: rgba(255, 107, 107, 0.45);
  color: var(--danger);
}

.badge.dim {
  color: var(--muted);
}

.top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 0.65rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  animation: rise 0.7s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.brand {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #1a1a1a;
  border: 1px solid var(--line);
  box-shadow: none;
  position: relative;
}

.mark::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 6px;
  border-right-color: transparent;
  transform: rotate(45deg);
}

.brand-name {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}

.brand-sub {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.formula-line {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elevated);
}

.formula-line .eq,
.formula-line .op {
  color: var(--accent);
}

main,
.calc-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.5rem 0.65rem 3rem;
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 1rem;
  align-items: start;
  animation: rise 0.85s 0.08s ease both;
}

@media (max-width: 900px) {
  main,
  .calc-main {
    grid-template-columns: 1fr;
    padding: 0.35rem 0.45rem 2.5rem;
  }
}

.panel,
.results {
  background: var(--panel);
  border: none;
  border-radius: 12px;
  box-shadow: none;
}

.panel {
  padding: 0.15rem 0.85rem 1rem;
  width: 100%;
}

.block {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.block:last-of-type {
  border-bottom: none;
}

.block.highlight {
  background: rgba(255, 255, 255, 0.03);
  margin: 0 -1.1rem;
  padding-left: 1.1rem;
  padding-right: 1.1rem;
  border-bottom: none;
  border-top: 1px solid var(--line);
}

.block h2 {
  margin: 0 0 0.2rem;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.hint {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--mono);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .row {
    grid-template-columns: 1fr;
  }
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

label.check {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.45rem;
  color: var(--ink);
  font-size: 0.85rem;
}

input[type="number"],
select {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: 500 0.92rem var(--mono);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  color-scheme: dark;
}

input[type="number"]:focus,
select:focus {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

select option {
  background: #111;
  color: #fff;
}

input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #ffffff;
}

.actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.65rem;
  padding: 1rem 0 0.35rem;
}

button {
  border: none;
  cursor: pointer;
  font: 600 0.92rem var(--font);
  border-radius: 10px;
  padding: 0.7rem 1.1rem;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

button:active {
  transform: translateY(1px);
}

#btn-calc {
  background: #ffffff;
  color: #000000;
  flex: 1 1 0;
  min-width: 0;
  max-width: 12rem;
  text-align: center;
}

#btn-calc:hover {
  background: #e8e8e8;
}

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  flex: 1 1 0;
  min-width: 0;
  max-width: 12rem;
  text-align: center;
}

.ghost:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.jump-top {
  position: fixed;
  right: 1rem;
  bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #ffffff;
  color: #000000;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
}

.jump-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.jump-top:hover {
  background: #e8e8e8;
}

.results {
  padding: 1.15rem;
  position: sticky;
  top: 1rem;
}

.result-hero {
  text-align: center;
  padding: 1.1rem 0.5rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.result-hero .value {
  margin: 0.15rem 0;
  font-family: var(--mono);
  font-size: clamp(2.4rem, 6vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
  animation: none;
}

.result-hero .value.flash {
  animation: pop 0.45s ease;
}

@keyframes pop {
  0% { transform: scale(0.96); opacity: 0.5; }
  60% { transform: scale(1.03); }
  100% { transform: none; opacity: 1; }
}

.label {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.cap {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.result-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}

.result-pair .value.sm {
  margin: 0.2rem 0 0;
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-soft);
}

.status {
  min-height: 1.2rem;
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  color: var(--danger);
}

.table-wrap {
  margin-top: 0.75rem;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

th,
td {
  text-align: left;
  padding: 0.45rem 0.25rem;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-soft);
}

td:first-child {
  font-family: var(--font);
  color: var(--ink);
}

td.empty {
  text-align: center;
  color: var(--muted);
  font-family: var(--font);
  padding: 1.2rem 0.5rem;
}

.footnote {
  margin: 0.9rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.5;
}

.loading #btn-calc {
  opacity: 0.75;
  pointer-events: none;
}

/* —— Home + swipe stats —— */
.view {
  position: relative;
  z-index: 1;
}

.view-home {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.75rem 0.55rem 2.5rem;
  animation: rise 0.5s ease both;
}

.home-cta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  margin: 0.85rem 0 1.15rem;
}

.btn-calc-primary {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 0.95rem 1.2rem;
  font: 700 1.05rem var(--font);
  letter-spacing: -0.01em;
  color: #fff;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.35);
  cursor: pointer;
}

.btn-calc-primary:active {
  transform: translateY(1px);
  filter: brightness(0.96);
}

.home-cta-hint {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}


.stats-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.55rem 0 0.75rem;
  padding: 0 0.15rem;
}

.stats-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.swipe-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.stats-wrap {
  margin: 0 -0.15rem;
}

.stats-track {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 0.35rem 0.85rem;
  touch-action: pan-x;
  scrollbar-width: none;
}

.stats-track::-webkit-scrollbar {
  display: none;
}

.stat-card {
  flex: 0 0 min(90vw, 360px);
  scroll-snap-align: center;
  border: none;
  border-radius: 22px;
  padding: 1.25rem 1.15rem 1.35rem;
  min-height: min(72vh, 520px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  color: #f6f7fb;
}

.stat-card .stat-kicker {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.92;
  color: inherit;
}

.stat-title {
  margin: 0 0 0.45rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-body {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  opacity: 0.88;
}

.stat-label {
  margin: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.75;
  color: inherit;
}

.stat-big {
  margin: 0.2rem 0 0;
  font-family: var(--mono);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-mid {
  margin: 0.2rem 0 0;
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 700;
}

.stat-sub,
.stat-caption {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  opacity: 0.78;
  line-height: 1.4;
  color: inherit;
}

.stat-empty {
  margin: auto 0 0;
  padding: 1rem 0.25rem;
  font-size: 0.92rem;
  line-height: 1.45;
  opacity: 0.9;
}

.stat-hero-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.35rem;
}

.stat-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.stat-pair.mt {
  margin-top: 0.65rem;
}

.stat-tile {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 14px;
  padding: 0.85rem 0.75rem;
  backdrop-filter: blur(6px);
}

.meter {
  margin-top: auto;
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.85);
}

.meter-label {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  opacity: 0.8;
}

.theme-blue { background: linear-gradient(160deg, #1d4ed8 0%, #2563eb 45%, #0f172a 100%); }
.theme-violet { background: linear-gradient(160deg, #6d28d9 0%, #7c3aed 48%, #1e1035 100%); }
.theme-orange { background: linear-gradient(160deg, #c2410c 0%, #ea580c 48%, #29140a 100%); }
.theme-teal { background: linear-gradient(160deg, #0f766e 0%, #14b8a6 48%, #0b1f1d 100%); }
.theme-rose { background: linear-gradient(160deg, #be123c 0%, #e11d48 48%, #2a0b14 100%); }
.theme-amber { background: linear-gradient(160deg, #b45309 0%, #f59e0b 48%, #27180a 100%); color: #fff8eb; }
.theme-indigo { background: linear-gradient(160deg, #3730a3 0%, #4f46e5 48%, #12122b 100%); }
.theme-lime { background: linear-gradient(160deg, #3f6212 0%, #65a30d 48%, #15200a 100%); }
.theme-cyan { background: linear-gradient(160deg, #0e7490 0%, #06b6d4 48%, #0a1c22 100%); }
.theme-fuchsia { background: linear-gradient(160deg, #a21caf 0%, #d946ef 48%, #261025 100%); }
.theme-sky { background: linear-gradient(160deg, #0369a1 0%, #0ea5e9 48%, #0b1d2a 100%); }

.stats-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.15rem 0 0.5rem;
}

.stats-dots .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

.stats-dots .dot.on {
  background: #3b82f6;
  transform: scale(1.2);
}

/* Calculator page chrome */
.calc-nav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.7rem 0.55rem 0.35rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
}

.calc-nav h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.btn-back {
  justify-self: start;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font: 600 0.85rem var(--font);
  cursor: pointer;
}

.btn-back:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.nav-spacer {
  width: 1px;
}

body[data-page="home"] #btn-top {
  display: none;
}

/* Bottom menu bar */
body {
  padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
}

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.15rem;
  padding: 0.4rem 0.35rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 3.15rem;
  padding: 0.3rem 0.2rem;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #8a8a8a;
  cursor: pointer;
  font: 600 0.68rem var(--font);
  letter-spacing: 0.01em;
}

.nav-item .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
}

.nav-item .nav-label {
  line-height: 1;
}

.nav-item.active {
  color: #fff;
  background: rgba(37, 99, 235, 0.16);
}

.nav-item.active .nav-icon {
  color: #4ea1ff;
}

.nav-item:active {
  transform: scale(0.97);
}

.view-home {
  padding-bottom: 1rem;
}

.calc-main {
  padding-bottom: 1.5rem;
}

/* —— Earnings / Stats page —— */
.view-stats {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.75rem 0.55rem 2rem;
  animation: rise 0.45s ease both;
}

.earn-page {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.earn-hero {
  border-radius: 22px;
  padding: 1.25rem 1.15rem 1.15rem;
  background: linear-gradient(155deg, #1d4ed8 0%, #2563eb 40%, #1e1b4b 100%);
  color: #fff;
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.3);
}

.earn-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.9;
}

.earn-total {
  margin: 0.35rem 0 0;
  font-family: var(--mono);
  font-size: clamp(2.4rem, 10vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.earn-unit {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  opacity: 0.8;
}

.earn-today-box {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.65rem;
}

.earn-today-box > div {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 14px;
  padding: 0.75rem 0.8rem;
}

.earn-label {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.75;
}

.earn-today {
  margin: 0.25rem 0 0;
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 700;
}

.earn-meta-val {
  margin: 0.25rem 0 0;
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 700;
}

.earn-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.2rem 0.1rem 0;
}

.earn-list-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.earn-list-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.earn-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.earn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border-radius: 16px;
  background: #111;
  border: none;
}

.earn-row-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.earn-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  color: #fff;
}

.earn-avatar.is-group {
  background: linear-gradient(145deg, #7c3aed, #4f46e5);
}

.earn-avatar.is-user {
  background: linear-gradient(145deg, #ea580c, #db2777);
}

.earn-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 48vw;
}

.earn-kind {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.earn-row-right {
  text-align: right;
  flex-shrink: 0;
}

.earn-amt {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.98rem;
  font-weight: 700;
}

.earn-amt-today {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: #7dd3fc;
  font-family: var(--mono);
}

.earn-empty {
  padding: 1.4rem 1rem;
  text-align: center;
  color: var(--muted);
  background: #111;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.earn-footnote {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
  padding: 0 0.15rem;
}

body[data-page="stats"] #btn-top.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* —— Profile page —— */
.view-profile {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.75rem 0.55rem 2rem;
  animation: rise 0.45s ease both;
}

.profile-page {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1rem;
  border-radius: 22px;
  background: linear-gradient(155deg, #4c1d95 0%, #6d28d9 42%, #0f172a 100%);
  box-shadow: 0 14px 36px rgba(109, 40, 217, 0.28);
}

.profile-avatar-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.2);
  position: relative;
  flex-shrink: 0;
}

.profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
}

.profile-hero-text {
  min-width: 0;
}

.profile-display {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.profile-username {
  margin: 0.2rem 0 0.45rem;
  font-size: 0.9rem;
  opacity: 0.88;
  color: #e9d5ff;
}

.profile-verify {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.profile-verify.ok {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(134, 239, 172, 0.45);
}

.profile-verify.warn {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(252, 165, 165, 0.45);
}

.profile-verify.dim {
  opacity: 0.9;
}

.profile-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.15rem 0.1rem 0;
}

.profile-section-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.profile-section-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.profile-row {
  background: #111;
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
}

.profile-row.is-copy {
  cursor: pointer;
}

.profile-row.is-copy:active,
.profile-row.copied {
  background: #1a1a1a;
}

.profile-row-label {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-row-value {
  margin: 0.28rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  word-break: break-all;
  font-family: var(--mono);
  line-height: 1.35;
}

.profile-extra-label {
  margin: 0.55rem 0 0.15rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.profile-footnote {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
  padding: 0 0.1rem;
}
