:root {
  --bg: #05060a;
  --bg-elevated: #0d0f18;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f2f4fa;
  --text-dim: #8b90a3;
  --accent: #9945ff;
  --accent-2: #14f195;
  --gradient: linear-gradient(135deg, #9945ff 0%, #14f195 100%);
  --danger: #ff5c72;
  --warn: #ffb84d;
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 15% 0%, rgba(153, 69, 255, 0.18), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(20, 241, 149, 0.12), transparent 40%);
  background-repeat: no-repeat;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ─────────────────────────────────────────────────────────── */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 12px rgba(20, 241, 149, 0.6);
}

.badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(20, 241, 149, 0.12);
  color: var(--accent-2);
  border: 1px solid rgba(20, 241, 149, 0.3);
  margin-left: 10px;
}
.badge-warn {
  background: rgba(255, 184, 77, 0.12);
  color: var(--warn);
  border-color: rgba(255, 184, 77, 0.3);
}

.rpc-status {
  display: none;
}
.rpc-status.visible {
  display: inline;
}

#wallet-connect {
  position: relative;
}

.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--gradient);
  color: #04140d;
}
.btn-block {
  width: 100%;
}

.wallet-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg-elevated);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  z-index: 20;
}
.wallet-menu.open {
  display: block;
}
.wallet-option {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.wallet-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ── Hero ───────────────────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 40px 0 32px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  margin: 0 0 12px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 560px;
  margin: 0 auto;
}

.countdown-wrap {
  margin-top: 28px;
}
.countdown-label {
  color: var(--text-dim);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.countdown {
  font-variant-numeric: tabular-nums;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ── Panels ─────────────────────────────────────────────────────────── */

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(6px);
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  margin: 24px 0;
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Progress panel */

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.stat-row .value {
  font-size: 22px;
  font-weight: 700;
}
.stat-row .label {
  color: var(--text-dim);
  font-size: 13px;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient);
  transition: width 0.6s ease;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
}

.tier-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tier-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  color: var(--text-dim);
}
.tier-name {
  font-weight: 700;
  color: var(--text);
}
.tier-rate {
  text-align: right;
  color: var(--text);
}
.tier-active {
  border-color: rgba(20, 241, 149, 0.4);
  background: rgba(20, 241, 149, 0.06);
}
.tier-active .tier-range,
.tier-active .tier-name {
  color: var(--accent-2);
}

/* Contribute panel */

.rate-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-dim);
}
#current-rate {
  color: var(--accent-2);
  font-weight: 700;
}

.amount-field {
  position: relative;
  margin-bottom: 12px;
}
.amount-field input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  padding: 14px 70px 14px 16px;
  font-family: inherit;
}
.amount-field input:focus {
  outline: none;
  border-color: var(--accent);
}
.amount-suffix {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-weight: 600;
}

.preset-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.preset-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.preset-btn:hover {
  border-color: var(--accent);
}

.estimate-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-dim);
}
#estimated-tokens {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.form-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin-top: 10px;
}
.tx-result {
  font-size: 13px;
  margin-top: 10px;
  color: var(--accent-2);
}

.limits {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
}

/* Treasury / feed */

.treasury-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 24px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.treasury-row a {
  font-family: "SFMono-Regular", Menlo, monospace;
  color: var(--text);
}
.copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.feed-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--panel-border);
  font-size: 13px;
}
.feed-row:last-child {
  border-bottom: none;
}
.feed-row a {
  color: var(--text);
  font-family: "SFMono-Regular", Menlo, monospace;
}
.feed-amount {
  color: var(--accent-2);
  font-weight: 600;
}
.feed-time {
  color: var(--text-dim) !important;
  font-family: inherit !important;
}
.feed-empty {
  color: var(--text-dim);
  padding: 12px 0;
  font-size: 13px;
}

section h2 {
  font-size: 18px;
  margin: 0 0 16px;
}

.notice {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
  border-top: 1px solid var(--panel-border);
  padding: 24px 0 40px;
}
.notice strong {
  color: var(--warn);
}

footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  padding: 20px 0 40px;
}
