:root {
  --bg: #070b14;
  --bg-2: #0c1424;
  --card: #101a2c;
  --line: rgba(94, 234, 212, 0.18);
  --text: #eef6ff;
  --muted: #8aa0b8;
  --cyan: #5eead4;
  --cyan-dim: rgba(94, 234, 212, 0.12);
  --gold: #f5c14a;
  --danger: #fb7185;
  --ok: #34d399;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
body.intro-lock { overflow: hidden; }

.intro {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px 8vh;
  background: #02050c;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
.intro.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.intro-fx {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 40% at 50% 18%, rgba(94,234,212,.16), transparent 70%),
    radial-gradient(ellipse 50% 30% at 50% 80%, rgba(245,193,74,.12), transparent 70%),
    linear-gradient(rgba(94,234,212,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94,234,212,.06) 1px, transparent 1px);
  background-size: auto, auto, 40px 40px, 40px 40px;
  mask-image: linear-gradient(to top, black 20%, transparent 90%);
}
.intro-copy {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: auto;
  padding-top: 14vh;
}
.intro-copy .line {
  margin: 0 0 14px;
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.9s ease forwards;
}
.l1 { font-size: clamp(22px, 4vw, 36px); color: var(--muted); animation-delay: 0.3s; }
.l2 {
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 800;
  color: var(--text);
  text-shadow: 0 0 28px rgba(94,234,212,.35);
  animation-delay: 1.1s;
}
.l3 {
  font-size: clamp(16px, 2.6vw, 22px);
  letter-spacing: 0.28em;
  color: var(--gold);
  animation-delay: 1.9s;
}
@keyframes rise { to { opacity: 1; transform: none; } }

.crowd {
  position: relative;
  z-index: 2;
  height: 220px;
  width: min(720px, 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}
.crowd .p {
  position: relative;
  width: 46px;
  border-radius: 22px 22px 8px 8px;
  background: linear-gradient(180deg, #1b2a40 0%, #0a1220 100%);
  box-shadow: 0 0 18px rgba(94,234,212,.12);
  opacity: 0;
  animation: stand 0.8s ease forwards;
}
.crowd .p:before {
  content: "";
  position: absolute;
  left: 50%;
  top: -22px;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border-radius: 50%;
  background: #152033;
  box-shadow: 0 0 10px rgba(94,234,212,.45);
}
.crowd .p:after {
  content: "";
  position: absolute;
  left: 50%;
  top: -14px;
  width: 16px;
  height: 4px;
  margin-left: -8px;
  border-radius: 2px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
.p1 { height: 108px; animation-delay: 1.4s; }
.p2 { height: 132px; animation-delay: 1.55s; }
.p3 { height: 150px; animation-delay: 1.7s; }
.p4 { height: 168px; width: 54px; animation-delay: 1.85s; }
.p5 { height: 186px; width: 58px; animation-delay: 2s; }
.p6 { height: 168px; width: 54px; animation-delay: 2.1s; }
.p7 { height: 148px; animation-delay: 2.2s; }
.p8 { height: 128px; animation-delay: 2.3s; }
.p9 { height: 110px; animation-delay: 2.4s; }
@keyframes stand { to { opacity: 1; transform: translateY(0); } }

.intro-actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  opacity: 0;
  animation: rise 0.8s ease 2.6s forwards;
}
.intro-go {
  height: 48px;
  padding: 0 28px;
  border: 1px solid var(--cyan);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(94,234,212,.18), rgba(245,193,74,.12));
  color: var(--cyan);
  font-weight: 800;
  letter-spacing: 0.18em;
}
.intro-go:hover { background: var(--cyan); color: #042018; }
html, body {
  margin: 0;
  min-height: 100%;
  background: #02050c;
  color: var(--text);
  font: 15px/1.55 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff, transparent),
    radial-gradient(1px 1px at 28% 72%, #9be7ff, transparent),
    radial-gradient(1.5px 1.5px at 44% 24%, #fff, transparent),
    radial-gradient(1px 1px at 63% 81%, #ffe08a, transparent),
    radial-gradient(1px 1px at 78% 14%, #7af7ff, transparent),
    radial-gradient(1.5px 1.5px at 86% 56%, #fff, transparent),
    radial-gradient(1px 1px at 8% 88%, #b8fff4, transparent),
    radial-gradient(1px 1px at 52% 48%, #fff, transparent);
  opacity: 0.7;
}
.bg-aurora {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 50% 35% at 18% 8%, rgba(34, 211, 238, 0.22), transparent 70%),
    radial-gradient(ellipse 45% 30% at 88% 12%, rgba(99, 102, 241, 0.18), transparent 70%),
    radial-gradient(ellipse 40% 28% at 70% 90%, rgba(245, 193, 74, 0.1), transparent 70%);
  animation: aurora 18s ease-in-out infinite alternate;
}
.bg-grid {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -35%;
  height: 75%;
  background-image:
    linear-gradient(rgba(94, 234, 212, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 234, 212, 0.16) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(500px) rotateX(62deg);
  transform-origin: center top;
  mask-image: linear-gradient(to top, black 10%, transparent 85%);
  animation: gridmove 16s linear infinite;
}
.bg-hex {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='84' height='48'><path d='M21 0 L63 0 L84 24 L63 48 L21 48 L0 24 Z' fill='none' stroke='%235eead4' stroke-width='0.7'/></svg>");
  background-size: 84px 48px;
  mask-image: radial-gradient(ellipse at 50% 40%, black 20%, transparent 72%);
}
.bg-beam {
  position: absolute;
  top: -20%;
  left: 42%;
  width: 2px;
  height: 140%;
  background: linear-gradient(to bottom, transparent, rgba(94,234,212,.55), transparent);
  filter: blur(1px);
  animation: beam 9s ease-in-out infinite;
}
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
}
.o1 { width: 280px; height: 280px; left: -60px; top: 20%; background: #0ea5a8; animation: float 12s ease-in-out infinite; }
.o2 { width: 220px; height: 220px; right: -40px; top: 8%; background: #4f46e5; animation: float 15s ease-in-out infinite reverse; }
.o3 { width: 180px; height: 180px; right: 18%; bottom: 6%; background: #ca8a04; animation: float 11s ease-in-out infinite; }

@keyframes aurora { to { transform: translate3d(2%, 3%, 0) scale(1.05); } }
@keyframes gridmove { to { background-position: 0 56px; } }
@keyframes beam { 0%,100% { transform: translateX(0); opacity: .25; } 50% { transform: translateX(80px); opacity: .7; } }
@keyframes float { 50% { transform: translateY(-24px); } }

@media (prefers-reduced-motion: reduce) {
  .bg-aurora, .bg-grid, .bg-beam, .bg-orb { animation: none; }
}
button, input {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; }
a { color: var(--cyan); text-decoration: none; }

.page {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 48px;
}
.board {
  margin-top: 18px;
}
.board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.board-head h3 { margin: 0; font-size: 18px; }
.board table { width: 100%; }
.board th:nth-child(1),
.board td:nth-child(1) { width: 64px; }
.board th:nth-child(3),
.board td:nth-child(3) { width: 100px; text-align: right; }
.rank {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #182338;
  font-weight: 700;
  font-size: 12px;
}
.rank.r1 { background: #f5c14a; color: #1a1403; }
.rank.r2 { background: #94a3b8; color: #0b1220; }
.rank.r3 { background: #b45309; color: #fff7ed; }
.agent-cell { word-break: break-all; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}
.mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(245, 193, 74, 0.45);
  background: #0b0914;
  flex-shrink: 0;
}
.mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: 0;
}
.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn {
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
}
.btn:hover { border-color: var(--cyan); }
.btn.primary {
  background: var(--cyan);
  color: #042018;
  border-color: transparent;
  font-weight: 700;
}
a.btn.x-link, a.x-link {
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  font-size: 16px;
}
a.btn.x-link:hover, a.x-link:hover {
  color: var(--cyan);
}
.lang {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(2, 8, 18, 0.45);
}
.lang button {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.lang button.on {
  background: var(--cyan);
  color: #042018;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 18px;
}
@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
}

.card {
  background: linear-gradient(180deg, rgba(16, 26, 44, 0.96), rgba(10, 16, 28, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-size: 12px;
  margin-bottom: 8px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
}
.card h2 {
  margin: 0 0 14px;
  font-size: 28px;
  letter-spacing: 0;
}
.card h2 em {
  font-style: normal;
  color: var(--cyan);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}
.bar {
  height: 10px;
  border-radius: 99px;
  background: #182338;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  width: 3%;
  background: linear-gradient(90deg, var(--gold), var(--cyan));
}
.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.identity {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  margin: 22px 0;
}
@media (max-width: 640px) {
  .identity { grid-template-columns: 1fr; }
}
.badge {
  min-height: 210px;
  border-radius: 18px;
  border: 1px solid rgba(245, 193, 74, 0.45);
  background:
    radial-gradient(circle at 50% 35%, rgba(245, 193, 74, 0.18), transparent 58%),
    #0b1220;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 16px;
}
.hex {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  display: grid;
  place-items: center;
  color: var(--gold);
  font-weight: 800;
  box-shadow: 0 0 24px rgba(94, 234, 212, 0.2);
}
.badge strong { font-size: 14px; }
.badge span { color: var(--muted); font-size: 12px; word-break: break-all; }

.ident h3 { margin: 0 0 6px; font-size: 16px; }
.ident p { margin: 0 0 12px; color: var(--muted); font-size: 13px; word-break: break-all; }
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}
.status.on i { background: var(--ok); }
.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.kv div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
.kv small { color: var(--muted); font-size: 11px; }
.kv b { display: block; margin-top: 4px; color: var(--cyan); }

.controls {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
}
.step button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.step b {
  min-width: 36px;
  text-align: center;
  font-size: 20px;
}
.pays { display: flex; gap: 8px; }
.pays button {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 8px;
  height: 36px;
  padding: 0 12px;
}
.pays button.on {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(245, 193, 74, 0.08);
}
.quote {
  background: var(--bg-2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.quote div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--muted);
}
.quote strong { color: var(--text); }
.mint {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, #2dd4bf, #22d3ee);
  color: #042018;
  font-weight: 800;
  font-size: 15px;
}

.side h3 {
  margin: 0 0 12px;
  font-size: 16px;
}
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.tabs button {
  flex: 1;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
}
.tabs button.on {
  background: var(--cyan-dim);
  border-color: var(--cyan);
  color: var(--cyan);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 9px 6px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
tr.now td { color: var(--gold); }
.empty {
  color: var(--muted);
  text-align: center;
  padding: 28px 8px;
  line-height: 1.7;
}
.rules {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}
.rules div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}
.rules span { color: var(--muted); }
.rules b { color: var(--text); word-break: break-all; text-align: right; }
.addr {
  font-family: Consolas, monospace;
  font-size: 12px;
}

.foot {
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,.55);
  display: none;
  place-items: center;
  padding: 16px;
}
.modal.show { display: grid; }
#refShow {
  color: var(--cyan);
  cursor: pointer;
  min-width: 8em;
  text-align: right;
}
#refShow.invite-empty {
  color: var(--muted);
  border-bottom: 1px dashed var(--line);
  font-weight: 500;
}
.dialog {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.dialog h3 { margin: 0 0 8px; }
.dialog p { margin: 0; color: var(--muted); font-size: 13px; }
.dialog input {
  width: 100%;
  margin: 12px 0;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 0 12px;
}
.dialog .row { margin: 0; }
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.qr-box img {
  width: 220px;
  height: 220px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}
.qr-box .pair {
  text-align: center;
}
.qr-box .pair small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
}
.qr-box .pair strong {
  font-size: 28px;
  letter-spacing: 0.28em;
  color: var(--gold);
}
