/* CRC / MRC / CMRC DAPP — Design System
   Black-gold dark theme
   Palette: deep black + lustrous gold + light text
   Type: Noto Sans SC (UI) · JetBrains Mono (data) · Cinzel (display accent)
*/

:root {
  /* ── Backgrounds (deep black / dark grey) ── */
  --bg-deepest:  #0A0A0A;
  --bg-deep:     #111111;
  --bg-mid:      #1A1A1A;

  /* ── Golds (primary accent) ────────────────────────── */
  --gold-deep:   #8B7300;
  --gold:        #C4A000;
  --gold-light:  #D4AF37;
  --gold-pale:   #3D3200;
  --gold-glow:   #E8C84B;

  /* ── Text (light on dark) ──────────────────────────── */
  --bone:        #F0F0F0;
  --bone-soft:   #B0B0B0;
  --bone-mute:   #777777;
  --paper:       #0A0A0A;

  /* ── Functional ─────────────────────────────────────── */
  --danger:      #D94040;
  --warn:        #E8A000;

  /* ── Text aliases ────────────────────────────────────── */
  --ink:         #F0F0F0;
  --ink-mute:    #B0B0B0;
  --ink-faint:   #777777;
  --on-light:    #F0F0F0;
  --on-light-mute: #B0B0B0;

  /* ── Lines & shadows ────────────────────────────────── */
  --line:        rgba(212, 175, 55, 0.15);
  --line-soft:   rgba(255, 255, 255, 0.08);
  --line-gold:   rgba(196, 160, 0, 0.25);

  /* ── Type stacks ────────────────────────────────────── */
  --f-sans:  "Noto Sans SC", "PingFang SC", -apple-system, "Helvetica Neue", system-ui, sans-serif;
  --f-mono:  "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --f-disp:  "Cinzel", "Times New Roman", Georgia, serif;

  /* ── Radii ──────────────────────────────────────────── */
  --r-card: 16px;
  --r-tile: 12px;
  --r-pill: 999px;
}

/* ── Resets within frames ─────────────────────────────── */
.dapp { font-family: var(--f-sans); color: var(--ink); -webkit-font-smoothing: antialiased; }
.dapp *, .dapp *::before, .dapp *::after { box-sizing: border-box; }
.dapp button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; padding: 0; }
.mono { font-family: var(--f-mono); font-feature-settings: "tnum"; letter-spacing: -0.01em; }
.disp { font-family: var(--f-disp); letter-spacing: 0.04em; }

/* ── App background — Dark ────────────────────────────── */
.dapp-bg {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, #111111 0%, #0A0A0A 30%);
}

/* ── Hex motif ────────────────────────────────────────── */
.hex-mask {
  --hex: polygon(25% 6.7%, 75% 6.7%, 100% 50%, 75% 93.3%, 25% 93.3%, 0% 50%);
  clip-path: var(--hex);
}

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: #161616;
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: var(--r-card);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  position: relative; overflow: visible;
}
.card-gold {
  background: #161616;
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-left: 3px solid var(--gold);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.card-bone {
  background: var(--paper);
  color: var(--on-light);
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: var(--r-card);
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  height: 46px; padding: 0 18px;
  border-radius: var(--r-pill);
  font-weight: 600; font-size: 15px; letter-spacing: 0.02em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:active { transform: scale(0.97); }

.btn-gold {
  background: linear-gradient(180deg, #E8C84B, #C4A000);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}
.btn-green {
  background: linear-gradient(180deg, #E8C84B, #C4A000);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}
.btn-ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}
.btn-block { width: 100%; }

/* Small outline button (gold border + gold text) */
.btn-sm-gold {
  height: 28px; padding: 0 12px;
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold);
  cursor: pointer;
  transition: background .12s;
}
.btn-sm-gold:hover { background: rgba(196, 160, 0, 0.1); }
.btn-sm-gold:active { transform: scale(0.96); }

/* ── Pills / chips ────────────────────────────────────── */
.chip {
  height: 26px; padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  background: #1A1A1A;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--bone-mute);
  letter-spacing: 0.04em;
}
.chip-gold { background: rgba(196, 160, 0, 0.12); border-color: var(--line-gold); color: var(--gold-light); }
.chip-green { background: rgba(196, 160, 0, 0.12); border-color: var(--line-gold); color: var(--gold-light); }
.chip-mute { background: transparent; color: var(--ink-faint); border-color: rgba(255, 255, 255, 0.1); }

.dot { width: 6px; height: 6px; border-radius: 999px; display: inline-block; }
.dot-green { background: #4CAF50; box-shadow: 0 0 6px #4CAF50; }
.dot-gold { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.dot-grey { background: var(--ink-faint); }

/* ── Inputs ───────────────────────────────────────────── */
.field {
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
.field:focus-within { border-color: rgba(212, 175, 55, 0.5); }
.field input {
  background: none; border: 0; outline: 0;
  color: #F0F0F0; font-family: var(--f-mono);
  font-size: 22px; font-weight: 500;
  width: 100%; min-width: 0;
}
.field input::placeholder { color: var(--ink-faint); }
.field-label { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase; }

/* ── Section headers ──────────────────────────────────── */
.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: 0.2em;
  color: var(--gold); text-transform: uppercase;
}
.section-title { font-size: 20px; font-weight: 700; letter-spacing: 0.01em; }

/* ── Top Tabs (replaces bottom tab bar) ───────────────── */
.top-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0 16px;
}
.top-tab {
  padding: 12px 16px;
  color: #777;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  background: none;
  transition: color .15s, border-color .15s;
}
.top-tab.active {
  color: #D4AF37;
  border-bottom-color: #D4AF37;
  font-weight: 600;
}

/* ── Stat number style ────────────────────────────────── */
.stat-num {
  font-family: var(--f-mono);
  font-weight: 600; letter-spacing: -0.02em;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ── Misc ─────────────────────────────────────────────── */
.divider { height: 1px; background: rgba(212, 175, 55, 0.12); margin: 12px 0; }
.kv { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; }
.kv .k { color: var(--ink-mute); font-size: 13px; }
.kv .v { font-family: var(--f-mono); font-size: 14px; font-weight: 500; }

/* row hover */
.row { transition: background .12s; }
.row:hover { background: rgba(196, 160, 0, 0.08); }

/* hide scrollbar inside frames */
.scroll-hide::-webkit-scrollbar { display: none; }
.scroll-hide { scrollbar-width: none; }

/* ── Finance page: input fields ─────────────────────── */
.fin-input {
  width: 100%; height: 46px; padding: 0 14px;
  background: #1A1A1A; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; color: #F0F0F0; font-size: 14px;
  font-family: var(--f-sans); outline: none;
  transition: border-color .15s;
}
.fin-input:focus { border-color: rgba(212, 175, 55, 0.5); }
.fin-input::placeholder { color: #555; }

/* ── Finance page: data table ───────────────────────── */
.fin-table { width: 100%; border-collapse: collapse; }
.fin-table th {
  font-size: 12px; font-weight: 600; color: var(--gold-light);
  text-align: left; padding: 10px 8px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  letter-spacing: 0.04em;
}
.fin-table td {
  font-size: 12px; color: #999; padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.fin-table-empty {
  text-align: center; color: #555; padding: 40px 0; font-size: 13px;
}

/* ── Finance page: pagination ───────────────────────── */
.fin-pager {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 14px 0 6px;
}
.fin-pager-btn {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  background: #1A1A1A; border: 1px solid rgba(255,255,255,0.08);
  color: #777; cursor: pointer; transition: all .15s;
}
.fin-pager-btn.active {
  background: linear-gradient(180deg, #E8C84B, #C4A000);
  border-color: var(--gold); color: #FFF;
}
.fin-pager-btn:hover:not(.active) { border-color: rgba(212, 175, 55, 0.3); }

/* ── Finance page: coin toggle buttons ──────────────── */
.coin-toggle {
  flex: 1; height: 38px; border-radius: 10px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  cursor: pointer; transition: all .15s;
}
.coin-toggle.active {
  background: linear-gradient(180deg, #E8C84B, #C4A000);
  border: 1px solid var(--gold); color: #FFF;
}
.coin-toggle.inactive {
  background: #1A1A1A;
  border: 1px solid rgba(255,255,255,0.08); color: #777;
}
.coin-toggle.inactive:hover { border-color: rgba(212, 175, 55, 0.3); color: #B0B0B0; }

/* ── Finance page: MAX button ───────────────────────── */
.max-btn {
  padding: 6px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 700;
  color: var(--gold); background: rgba(196, 160, 0, 0.1);
  border: 1px solid rgba(196, 160, 0, 0.3);
  cursor: pointer; transition: all .15s; letter-spacing: 0.04em;
}
.max-btn:hover { background: rgba(196, 160, 0, 0.2); }

/* ── Finance page: asset card (My tab) ──────────────── */
.asset-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: #161616; border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: 14px; margin-bottom: 10px;
}
.asset-card .asset-info { flex: 1; }
.asset-card .asset-symbol {
  font-size: 15px; font-weight: 700; color: #F0F0F0;
}
.asset-card .asset-balance {
  font-family: var(--f-mono); font-size: 20px; font-weight: 600;
  color: #F0F0F0;
}

/* ── Finance page: node button cards ────────────────── */
.node-btn-card {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 56px; border-radius: 14px;
  font-size: 16px; font-weight: 700; color: #FFF;
  background: linear-gradient(135deg, #E8C84B, #C4A000);
  box-shadow: 0 4px 16px rgba(196, 160, 0, 0.25);
  margin-bottom: 10px; cursor: pointer;
  transition: transform .12s;
}
.node-btn-card:active { transform: scale(0.97); }

/* ── Finance page: sub-tabs (My Invitation / Earnings) */
.fin-subtabs {
  display: flex; gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 14px;
}
.fin-subtab {
  padding: 10px 18px; font-size: 13px;
  color: #777; border-bottom: 2px solid transparent;
  cursor: pointer; transition: all .15s;
}
.fin-subtab.active {
  color: var(--gold-light); border-bottom-color: var(--gold-light);
  font-weight: 600;
}

/* ── Select dropdown — Black-gold theme ─────────────── */
.dapp select {
  width: 100%; height: 44px;
  padding: 0 36px 0 14px;
  background-color: #1A1A1A;
  color: #F0F0F0;
  border: 1px solid rgba(232, 200, 75, 0.25);
  border-radius: 12px;
  font-size: 14px;
  font-family: var(--f-mono);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23D4AF37' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  transition: border-color .15s, box-shadow .15s;
}
.dapp select:focus {
  border-color: rgba(232, 200, 75, 0.6);
  box-shadow: 0 0 0 2px rgba(232, 200, 75, 0.1);
}
.dapp select option {
  background-color: #1A1A1A;
  color: #F0F0F0;
  padding: 10px 14px;
}
.dapp select option:checked {
  background: linear-gradient(0deg, #2a2200, #2a2200);
  color: #E8C84B;
}
.dapp select option:hover {
  background-color: #2a2200;
}
