:root {
  --bg: #07070b;
  --bg-2: #0c0c12;
  --surface: rgba(22, 22, 30, 0.72);
  --surface-solid: #14141c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f8;
  --muted: #8b8b97;
  --muted-2: #5e5e6b;
  --accent: #c2f542;          /* electric green */
  --accent-dim: rgba(194, 245, 66, 0.14);
  --gold: #ffd25f;
  --silver: #cfd3da;
  --bronze: #e0985a;
  --danger: #ff6b6b;
  --radius: 18px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 50% -8%, rgba(194, 245, 66, 0.10), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(124, 92, 255, 0.10), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 64px 20px 30px;
  position: relative;
}
.brand {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1;
  background: linear-gradient(92deg, #ffffff 0%, #d9ffa6 45%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-flex;
  align-items: flex-start;
  gap: 14px;
}
.live {
  -webkit-text-fill-color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 8px;
  padding: 4px 9px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-dim);
  animation: pulse 1.8s ease-in-out infinite;
  text-transform: uppercase;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(194, 245, 66, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(194, 245, 66, 0); }
}
.tag {
  color: var(--muted);
  font-size: 16px;
  margin: 16px auto 28px;
  max-width: 460px;
}

/* ---------- Stats ---------- */
.stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.stat {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 30px;
  min-width: 140px;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(var(--accent), transparent);
}
.stat b {
  display: block;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  color: #fff;
}
.stat span { color: var(--muted); font-size: 12px; letter-spacing: 0.4px; }

/* ---------- Layout ---------- */
main { max-width: 820px; margin: 0 auto; padding: 34px 20px 80px; }

.bid-box, .board {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 26px;
  box-shadow: var(--shadow);
}
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.3px; }
.hint { color: var(--accent); font-size: 14px; margin: 0; font-weight: 600; }

/* ---------- Legal doc pages ---------- */
.doc-text { color: var(--muted); }
.doc-text h3 { margin: 22px 0 8px; font-size: 15px; color: var(--accent); letter-spacing: 0.3px; }
.doc-text p { margin: 0 0 10px; }
.doc-text a { color: var(--accent); text-decoration: none; }
.doc-text a:hover { text-decoration: underline; }

/* ---------- Form ---------- */
#bidForm { display: flex; flex-direction: column; gap: 12px; }
#bidForm input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
#bidForm input::placeholder { color: var(--muted-2); }
#bidForm input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 4px var(--accent-dim);
}
.amount-row { display: flex; align-items: stretch; gap: 12px; }
.amount-row .cur {
  display: flex; align-items: center; padding: 0 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 18px; font-weight: 700;
}
.amount-row #amount { flex: 1; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
#payBtn {
  background: linear-gradient(92deg, var(--accent), #8fe02a);
  color: #0a0a0a;
  border: none;
  border-radius: 12px;
  padding: 14px 26px;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s, box-shadow 0.18s, filter 0.18s;
  box-shadow: 0 10px 24px -10px rgba(194, 245, 66, 0.6);
}
#payBtn:hover { transform: translateY(-1px); filter: brightness(1.05); }
#payBtn:active { transform: translateY(0); }
#payBtn:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }
.err { color: var(--danger); font-size: 14px; min-height: 18px; margin: 4px 0 0; font-weight: 500; }

/* ---------- How it works (homepage) ---------- */
.how {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 26px;
  box-shadow: var(--shadow);
}
.how .steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin: 18px 0 16px;
}
.how .step {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.how .num {
  width: 34px; height: 34px; line-height: 34px; text-align: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #d9ffa6, var(--accent));
  color: #0a0a0a; font-weight: 900; margin-bottom: 12px;
}
.how .step h3 { margin: 0 0 6px; font-size: 15px; color: var(--text); }
.how .step p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.how-note {
  color: var(--muted); font-size: 13px; margin: 0;
  border-top: 1px solid var(--border); padding-top: 14px; line-height: 1.6;
}

/* ---------- Stats explainer ---------- */
.explain {
  max-width: 760px;
  margin: 0 auto 26px;
  padding: 20px 22px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.explain h2 { margin: 0 0 10px; font-size: 18px; }
.explain p { color: var(--muted); margin: 0 0 12px; line-height: 1.6; }
.explain .legend { margin: 0 0 12px; padding-left: 20px; color: var(--muted); line-height: 1.75; }
.explain .legend b { color: var(--text); }
.explain .note { margin-bottom: 0; font-size: 13px; }
.explain a { color: var(--accent); text-decoration: none; }
.explain a:hover { text-decoration: underline; }

/* ---------- Leaderboard ---------- */
.table .row {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
  border-radius: 12px;
  transition: background 0.16s, transform 0.16s, border-color 0.16s;
}
.table .row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-strong);
  transform: translateX(3px);
}
.table .row:last-child { border-bottom: none; }

.pos {
  font-weight: 900;
  font-size: 18px;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rank-1 .pos, .rank-2 .pos, .rank-3 .pos {
  width: 34px; height: 34px; line-height: 34px;
  border-radius: 50%;
  margin: 0 auto;
  color: #0a0a0a;
}
.rank-1 .pos { background: linear-gradient(145deg, #ffe39a, var(--gold)); box-shadow: 0 0 18px -4px var(--gold); }
.rank-2 .pos { background: linear-gradient(145deg, #eef1f6, var(--silver)); }
.rank-3 .pos { background: linear-gradient(145deg, #f0b483, var(--bronze)); }

.link {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  word-break: break-all;
  transition: color 0.16s;
}
.link:hover { color: var(--accent); }
.paid {
  color: var(--accent);
  font-weight: 800;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
.rank-1 { background: linear-gradient(90deg, rgba(255, 210, 95, 0.06), transparent); }
.empty {
  color: var(--muted);
  padding: 36px 0;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
}
footer {
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
  padding: 28px;
  border-top: 1px solid var(--border);
  letter-spacing: 0.3px;
}
footer .legal { margin-bottom: 10px; font-weight: 600; }
footer a { color: var(--muted-2); text-decoration: none; transition: color 0.16s; }
footer a:hover { color: var(--accent); }

/* ---------- Contact mail button ---------- */
.btn-mail {
  display: inline-block;
  background: linear-gradient(92deg, var(--accent), #8fe02a);
  color: #0a0a0a;
  border: none;
  border-radius: 12px;
  padding: 14px 26px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px -10px rgba(194, 245, 66, 0.6);
  transition: transform 0.12s, filter 0.18s;
}
.btn-mail:hover { transform: translateY(-1px); filter: brightness(1.05); color: #0a0a0a; }

/* ---------- Responsive ---------- */
@media (min-width: 620px) {
  .paid { text-align: right; }
}
@media (max-width: 520px) {
  .brand { font-size: 40px; }
  .stat { min-width: 110px; padding: 14px 18px; }
  .amount-row { flex-wrap: wrap; }
  .amount-row #amount { min-width: 0; }
  #payBtn { width: 100%; }
}
