:root {
  --bg: #04060a;
  --panel: rgba(14, 18, 26, 0.82);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f6f8;
  --muted: rgba(244, 246, 248, 0.58);
  --lime: #b7f516;
  --lime-hi: #dbff77;
  --lime-lo: #79ca1c;
  --lime-deep: #168d52;
  --lime-ink: #073b21;
  --up: #6fe39b;
  --down: #ff6b7a;
  --t1: #b7f516;
  --t2: #4fd1ff;
  --t3: #ffb347;
}

* { box-sizing: border-box; margin: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: "Comfortaa", cursive;
  min-height: 100%;
}

body { overflow-x: hidden; }

button, input { font-family: inherit; color: inherit; }

[hidden] { display: none !important; }

/* fundo estrelado leve, a lembrar a cena final */
.stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 12%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 38% 64%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 58%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 84%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 62% 88%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 32%, #fff4 50%, transparent 51%),
    radial-gradient(900px 600px at 0% 20%, rgba(52, 110, 220, 0.28), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(183, 245, 22, 0.08), transparent 60%),
    var(--bg);
}

/* nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 32px;
  background: rgba(4, 6, 10, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-logo img { height: 44px; display: block; }
.tabs { display: flex; gap: 4px; margin: 0 auto; }
.tab {
  background: none;
  border: 0;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--lime-ink); background: var(--lime); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.chain-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(183, 245, 22, 0.35);
  color: var(--lime);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.btn-wallet {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-wallet:hover { border-color: var(--lime); }
.btn-wallet[data-connected="true"] { color: var(--lime); border-color: rgba(183, 245, 22, 0.5); }

.preview-bar {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 9px 16px;
  color: var(--lime-ink);
  background: var(--lime);
}

main { max-width: 1120px; margin: 0 auto; padding: 36px 24px 60px; }

/* hero */
.hero { text-align: center; margin: 12px auto 34px; max-width: 760px; }
.hero h1 {
  font-family: "Roboto Serif", serif;
  font-style: italic;
  font-weight: 200;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.12;
}
.hero h1 em {
  font-style: italic;
  background: linear-gradient(90deg, #3aa0ff, var(--lime), #ff8a3d, #ff3d8a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { margin-top: 16px; color: var(--muted); line-height: 1.8; font-size: 15px; }

/* tiers */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 26px; }
.tier-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.tier-card strong { font-size: 22px; }
.tier-card span:last-child { font-size: 12px; color: var(--muted); line-height: 1.6; }
.tier-tag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  color: #04060a;
}
[data-tier="1"] .tier-tag, .tier-badge[data-tier="1"] { background: var(--t1); }
[data-tier="2"] .tier-tag, .tier-badge[data-tier="2"] { background: var(--t2); }
[data-tier="3"] .tier-tag, .tier-badge[data-tier="3"] { background: var(--t3); }

/* lookup */
.lookup { display: flex; gap: 10px; }
.lookup input, #picker-search {
  flex: 1;
  min-width: 0;
  padding: 15px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 14px;
  outline: none;
}
.lookup input:focus, #picker-search:focus { border-color: var(--lime); }
.lookup-results { margin: 12px 0 22px; display: grid; gap: 8px; }
.lookup-results:empty { margin: 0 0 22px; }
.lookup-note { font-size: 13px; color: var(--muted); padding: 4px 2px; }

/* buttons */
.btn-lime {
  border: 0;
  border-radius: 12px;
  padding: 0 24px;
  height: 50px;
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 0 0 2px var(--lime-hi), inset 0 -4px 0 var(--lime-lo), 0 5px 0 var(--lime-deep);
  transition: transform 0.15s;
}
.btn-lime:hover:not(:disabled) { transform: translateY(-2px); }
.btn-lime:active:not(:disabled) { transform: translateY(3px); }
.btn-lime:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-big { width: 100%; margin-top: 22px; height: 56px; font-size: 15px; }
.btn-ghost {
  border: 1px solid var(--line);
  background: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--lime); color: var(--lime); }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

/* table */
.table-wrap { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel); }
.markets { width: 100%; border-collapse: collapse; font-size: 14px; }
.markets th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.markets td { padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.markets tr:last-child td { border-bottom: 0; }
.markets tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }

.coin { display: flex; align-items: center; gap: 12px; min-width: 0; }
.coin img, .coin .coin-fallback {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  background: #1b2230;
  object-fit: cover;
}
.coin .coin-fallback { display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--lime); }
.coin-name { display: flex; flex-direction: column; min-width: 0; }
.coin-name strong { font-size: 14px; }
.coin-name span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tier-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 6px;
  color: #04060a;
  white-space: nowrap;
}
.tier-badge[data-tier="0"] { background: rgba(255, 255, 255, 0.1); color: var(--muted); }

.footnote { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 14px; }

/* result card (lookup) */
.result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.result .coin { flex: 1; }
.result-stats { display: flex; gap: 18px; font-size: 12px; color: var(--muted); }
.result-stats b { color: var(--text); font-weight: 700; }

/* borrow */
.borrow-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 18px; align-items: start; }
.card { padding: 26px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.card h2 { font-family: "Roboto Serif", serif; font-style: italic; font-weight: 300; font-size: 30px; margin-bottom: 8px; }
.card h3 { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.field-label { display: block; font-size: 12px; color: var(--muted); margin: 20px 0 8px; letter-spacing: 0.04em; }
.coin-select {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  text-align: left;
  min-height: 60px;
}
.coin-select:hover { border-color: var(--lime); }
.coin-select-empty { color: var(--muted); font-size: 14px; }
.amount-row {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0 14px;
}
.amount-row:focus-within { border-color: var(--lime); }
.amount-row input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  font-size: 24px;
  padding: 14px 0;
}
.amount-sym { font-size: 13px; font-weight: 700; color: var(--muted); }
.sub-line { font-size: 12px; color: var(--muted); margin-top: 8px; }
input[type="range"] { width: 100%; accent-color: var(--lime); }

.summary dl { display: grid; gap: 14px; }
.summary dl div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.summary dt { color: var(--muted); }
.summary dd { font-weight: 700; text-align: right; }
.summary dd.big { font-size: 20px; color: var(--lime); }

/* lend / loans */
.soon { max-width: 620px; margin: 0 auto; text-align: center; }
.soon p { color: var(--muted); line-height: 1.8; margin-top: 8px; }
.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; text-align: left; }
.steps li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.steps span {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 700;
  font-size: 12px;
}

/* modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
}
.modal-box {
  width: 100%;
  max-width: 460px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  background: #0c1017;
  border: 1px solid var(--line);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-close { background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--muted); line-height: 1; }
.picker-list { overflow-y: auto; display: grid; gap: 4px; }
.picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.picker-item:hover { background: rgba(255, 255, 255, 0.06); }

.foot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 24px;
  font-size: 12px;
  color: var(--muted);
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--lime); }

@media (max-width: 900px) {
  .hide-md { display: none; }
  .borrow-grid { grid-template-columns: 1fr; }
  .result-stats { display: none; }
}
@media (max-width: 720px) {
  .nav { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  .nav-logo img { height: 36px; }
  .nav-right { margin-left: auto; }
  .chain-pill { display: none; }
  .tabs { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .tab { padding: 9px 12px; font-size: 13px; }
  main { padding: 26px 16px 50px; }
  .tiers { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .markets td, .markets th { padding: 12px 10px; }
  .lookup .btn-lime { padding: 0 16px; }
  .card { padding: 20px; }
}

/* carteira */
.wallet-wrap { position: relative; }
.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 230px;
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: 14px;
  background: #0c1017;
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 30;
}
.account-head { display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.account-name { font-size: 13px; font-weight: 700; }
.account-sol { font-size: 12px; color: var(--lime); }
.account-menu button, .account-menu a {
  background: none;
  border: 0;
  text-align: left;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.account-menu button:hover, .account-menu a:hover { background: rgba(255, 255, 255, 0.06); }
.account-menu .danger { color: var(--down); }

.wallet-list { display: grid; gap: 8px; }
.wallet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  font-weight: 700;
}
.wallet-item:hover { border-color: var(--lime); }
.wallet-item img, .wallet-dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: none;
}
.wallet-dot { display: grid; place-items: center; font-size: 14px; color: #04060a; }
.wallet-status { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.05em; }
.wallet-status.on { color: var(--lime); }
.wallet-error { font-size: 12px; color: var(--down); text-align: center; min-height: 1em; }

/* bags */
.bags-banner {
  width: 100%;
  margin-bottom: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(183, 245, 22, 0.4);
  background: rgba(183, 245, 22, 0.08);
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.bags-banner b { color: var(--lime); }
.bags { margin-top: 24px; }
.bags-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.bags-head h3 { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
#bags-total { font-size: 14px; font-weight: 700; color: var(--lime); }

.max-btn {
  border: 1px solid rgba(183, 245, 22, 0.5);
  background: none;
  color: var(--lime);
  border-radius: 8px;
  padding: 5px 9px;
  margin-right: 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.max-btn:hover { background: rgba(183, 245, 22, 0.12); }
.sub-line { display: flex; justify-content: space-between; gap: 10px; }
.held { font-size: 11px; color: var(--lime); white-space: nowrap; }
