:root {
  --bg: #0b0d12;
  --bg2: #0f1219;
  --panel: #131722;
  --panel2: #171c29;
  --line: #232a3a;
  --line2: #2c3550;
  --text: #eef1f7;
  --muted: #8b93a7;
  --faint: #5c6478;
  --accent: #c8f04f;
  --accent2: #7ce0b0;
  --gold: #e8c46a;
  --danger: #ff6b6b;
  --radius: 14px;
  font-size: 16px;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(200, 240, 79, 0.07), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(124, 224, 176, 0.05), transparent 60%),
    radial-gradient(1000px 700px at 50% 110%, rgba(90, 120, 255, 0.06), transparent 60%),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input {
  font-family: inherit;
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ---------- header ---------- */
.chain-tabs {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.ctab {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  transition: background 0.15s, color 0.15s;
}

.ctab.on {
  background: var(--accent);
  color: #10130a;
}

.chain-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.chain-bar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 8px var(--accent2);
}

.chain-bar code {
  font-family: ui-monospace, monospace;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
}

.chain-sep {
  color: var(--faint);
}

.top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.brand-mark {
  color: var(--accent);
  font-size: 1.3rem;
}

.brand-tag {
  color: var(--faint);
  font-size: 0.75rem;
  padding-left: 34px;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ghost-btn {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 10px;
  transition: color 0.15s, background 0.15s;
}

.ghost-btn:hover {
  color: var(--text);
  background: var(--panel);
}

.connect-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #10130a;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 12px;
  transition: transform 0.12s, filter 0.15s;
}

.connect-btn:disabled {
  cursor: progress;
  filter: saturate(0.6);
}

.connect-btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.connect-btn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10130a;
  opacity: 0.5;
}

.connect-btn.connected .dot {
  background: #0a7d32;
  box-shadow: 0 0 0 3px rgba(10, 125, 50, 0.25);
  opacity: 1;
}

/* ---------- hero ---------- */
.hero {
  padding: 44px 0 28px;
}

.hero h1 {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.grad {
  background: linear-gradient(92deg, var(--accent) 10%, var(--accent2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub {
  color: var(--muted);
  max-width: 560px;
  margin-top: 14px;
  font-size: 1rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line2), transparent);
}

.stat-v {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 1.45rem;
}

.stat-k {
  color: var(--faint);
  font-size: 0.78rem;
  margin-top: 2px;
}

/* ---------- pool ---------- */
.pool-section {
  margin-top: 26px;
}

.pool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pool-head-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.primary.sm {
  padding: 9px 16px;
  font-size: 0.85rem;
  border-radius: 10px;
}

.rarity-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.rtab {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.rtab .pct {
  color: var(--faint);
  font-size: 0.72rem;
}

.rtab:hover {
  border-color: var(--line2);
  color: var(--text);
}

.rtab.on {
  background: var(--panel2);
  border-color: var(--accent);
  color: var(--text);
}

.rtab.on .pct {
  color: var(--accent);
}

.pool-count {
  color: var(--faint);
  font-size: 0.82rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--faint);
  padding: 60px 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, border-color 0.15s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--line2);
}

.card-img {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg2);
  display: grid;
  place-items: center;
}

.card-img img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  border-radius: 10px;
}

.card-rar {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(10, 12, 18, 0.75);
  border: 1px solid var(--line);
  backdrop-filter: blur(4px);
}

.card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-addr {
  color: var(--faint);
  font-size: 0.72rem;
  font-family: ui-monospace, monospace;
}

.card-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-top: auto;
}

.card-row .k {
  color: var(--faint);
}

.card-row .v {
  font-weight: 600;
}

.card-btn {
  background: var(--panel2);
  border: 1px solid var(--line2);
  color: var(--text);
  border-radius: 10px;
  padding: 9px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.15s, border-color 0.15s;
}

.card-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #10130a;
}

/* ---------- board ---------- */
.board-section {
  margin-top: 44px;
}

.board-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.board-head h2 {
  font-family: "Syne", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.board-sub {
  color: var(--faint);
  font-size: 0.8rem;
}

.board {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brow {
  display: grid;
  grid-template-columns: 40px 1fr 110px 110px 130px;
  gap: 10px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.85rem;
}

.brow.head {
  background: transparent;
  border: none;
  color: var(--faint);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 16px;
}

.brow .rank {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  color: var(--faint);
}

.brow:first-of-type .rank {
  color: var(--gold);
}

.brow .addr {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--muted);
}

.brow .num {
  text-align: right;
  font-weight: 600;
}

/* ---------- live feed ---------- */
.live-section {
  margin-top: 30px;
}

.live-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.live-head h2 {
  font-family: "Syne", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.6);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255, 107, 107, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
  }
}

.live-count {
  color: var(--faint);
  font-size: 0.78rem;
  margin-left: auto;
}

.feed {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.feed-row {
  display: grid;
  grid-template-columns: 26px 110px 1fr 70px 74px;
  gap: 10px;
  align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}

.feed-row:last-child {
  border-bottom: none;
}

.feed-row.fresh {
  animation: feedIn 0.5s ease;
}

@keyframes feedIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
    background: rgba(200, 240, 79, 0.08);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    background: transparent;
  }
}

.feed-ico {
  font-size: 0.9rem;
  text-align: center;
}

.feed-ico.draw {
  color: var(--accent);
}
.feed-ico.crown {
  color: var(--gold);
}
.feed-ico.deposit {
  color: var(--accent2);
}
.feed-ico.withdraw {
  color: var(--muted);
}

.feed-actor {
  font-family: ui-monospace, monospace;
  font-size: 0.76rem;
  color: var(--muted);
}

.feed-text {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-text b {
  font-weight: 600;
}

.feed-val {
  text-align: right;
  font-weight: 600;
  color: var(--text);
}

.feed-ago {
  text-align: right;
  color: var(--faint);
  font-size: 0.72rem;
}

a.card-img {
  text-decoration: none;
}

a.card-name {
  text-decoration: none;
}

a.card-name:hover {
  color: var(--accent);
}

.ghost-btn.big {
  font-size: 0.9rem;
  padding: 12px 16px;
  border: 1px solid var(--line2);
}

/* ---------- nft detail page ---------- */
.nft-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px 60px;
}

.nft-grid {
  display: grid;
  grid-template-columns: minmax(300px, 460px) 1fr;
  gap: 34px;
  align-items: start;
}

.nft-image-wrap {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.nft-image-wrap img {
  width: 92%;
  height: 92%;
  object-fit: contain;
}

.nft-rarity {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(10, 12, 18, 0.8);
  border: 1px solid var(--line);
}

.nft-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nft-breadcrumb {
  color: var(--faint);
  font-size: 0.82rem;
  display: flex;
  gap: 8px;
  align-items: center;
}

.nft-breadcrumb a {
  color: var(--muted);
}

.nft-breadcrumb a:hover {
  color: var(--accent);
}

.nft-info h1 {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1.15;
}

.nft-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.nft-meta {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 16px;
}

.nft-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}

.nft-meta-row:last-child {
  border-bottom: none;
}

.nft-meta-row .k {
  color: var(--faint);
}

.nft-meta-row .v {
  font-weight: 500;
}

.nft-meta-row .v.mono {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}

a.nft-meta-row,
.nft-meta-row a.v {
  color: var(--text);
  text-decoration: none;
}

.nft-meta-row a.v:hover {
  color: var(--accent);
}

.nft-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nft-actions .primary {
  flex: 1;
  min-width: 220px;
}

.nft-fineprint {
  color: var(--faint);
  font-size: 0.75rem;
  line-height: 1.6;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.nft-fineprint b {
  color: var(--muted);
}

@media (max-width: 860px) {
  .nft-grid {
    grid-template-columns: 1fr;
  }
  .feed-row {
    grid-template-columns: 22px 90px 1fr 60px;
  }
  .feed-ago {
    display: none;
  }
}

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--line);
  margin-top: 56px;
  padding: 22px 0;
}

.foot-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 0.78rem;
}

.foot-addr {
  font-family: ui-monospace, monospace;
}

/* ---------- modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 11, 0.72);
  backdrop-filter: blur(6px);
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
}

.modal-head h3 {
  font-family: "Syne", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.modal .x {
  background: none;
  border: none;
  color: var(--faint);
  font-size: 1.4rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
}

.modal .x:hover {
  color: var(--text);
  background: var(--panel2);
}

.modal-body {
  padding: 16px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.muted {
  color: var(--muted);
  font-size: 0.82rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 0.75rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field input {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.field input:focus {
  border-color: var(--accent);
}

.amt-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.amt-row input {
  flex: 1;
}

.amt-suffix {
  color: var(--faint);
  font-weight: 600;
}

.fee-note {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
}

.fee-note div {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.fee-note b {
  color: var(--text);
  font-weight: 600;
}

.primary {
  background: var(--accent);
  color: #10130a;
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.12s, filter 0.15s;
}

.primary:disabled {
  filter: saturate(0.5) brightness(0.85);
  cursor: not-allowed;
}

.primary:not(:disabled):hover {
  transform: translateY(-1px);
}

.step-msg {
  font-size: 0.8rem;
  min-height: 1.2em;
  color: var(--muted);
}

.step-msg.err {
  color: var(--danger);
}

.step-msg.ok {
  color: var(--accent2);
}

/* spin modal */
.spin-preview {
  position: relative;
  height: 120px;
  display: grid;
  place-items: center;
}

.spin-orb {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.28), transparent 40%),
    conic-gradient(from 200deg, var(--accent), var(--accent2), #5a8dff, var(--accent));
  animation: orb 6s linear infinite;
}

.spin-ring {
  position: absolute;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 1px dashed var(--line2);
  animation: orb 14s linear infinite reverse;
}

@keyframes orb {
  to {
    transform: rotate(360deg);
  }
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

.qty {
  display: flex;
  gap: 5px;
}

.qty button {
  width: 36px;
  height: 34px;
  border-radius: 9px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  transition: all 0.12s;
}

.qty button.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #10130a;
}

/* toast */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--panel2);
  border: 1px solid var(--line2);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 18px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 90;
  max-width: min(560px, 90vw);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast a {
  color: var(--accent);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .brow {
    grid-template-columns: 30px 1fr 90px;
  }
  .brow .num.hide-sm,
  .brow.head .hide-sm {
    display: none;
  }
  .brand-tag {
    display: none;
  }
}
