/* ─── Reset & Variables ───────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --bg: #0b0e1a;
  --surface: #111827;
  --surface2: #1c2333;
  --border: #1f2d42;
  --accent: #f0b90b; /* BSC gold */
  --accent2: #e8a800;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --text: #e2e8f0;
  --text-muted: #64748b;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
}
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--surface);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
/* ─── Typography ──────────────────────────────────────────────────────────── */
h1,
h2,
h3 {
  line-height: 1.2;
  font-weight: 700;
}
/* ─── Layout ──────────────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ─── Header ──────────────────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #f0b90b, #e8a800);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}
.logo span {
  color: var(--accent);
}
#headerActions {
  display: flex;
  align-items: center;
  gap: 12px;
}
#walletAddress {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: monospace;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(135deg, #f0b90b, #e09800);
  color: #000;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #ffd84d, #f0b90b);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(240, 185, 11, 0.35);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--red);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
}
.btn-ghost {
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 6px;
}
.btn-ghost:hover {
  color: var(--text);
}
#walletBtn {
  background: linear-gradient(135deg, #f0b90b, #e09800);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-weight: 600;
  font-size: 0.87rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 7px;
}
#walletBtn:hover {
  filter: brightness(1.1);
}
#walletBtn.wrong-network {
  background: var(--red) !important;
  color: #fff !important;
}

/* ─── Hero / CTA ──────────────────────────────────────────────────────────── */
#connectCta {
  min-height: calc(100vh - 68px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 24px;
  padding: 40px 20px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(240, 185, 11, 0.1);
  color: var(--accent);
  border: 1px solid rgba(240, 185, 11, 0.3);
  padding: 6px 16px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 600;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  background: linear-gradient(135deg, #fff 40%, #f0b90b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 480px;
}
.hero-features {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
}
.hero-features li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.hero-features li::before {
  content: "✓";
  color: var(--green);
  font-weight: 700;
}

/* ─── Stats Row ───────────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 32px 0 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 4px;
  color: var(--accent);
}

/* ─── Dashboard grid ──────────────────────────────────────────────────────── */
#dashboard {
  padding: 0 0 60px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: border-color var(--transition);
}
.card:hover {
  border-color: rgba(240, 185, 11, 0.25);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
}
.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  background: rgba(240, 185, 11, 0.12);
  color: var(--accent);
}

/* ─── User position card (full width) ────────────────────────────────────── */
.card-full {
  grid-column: 1 / -1;
}
.position-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.pos-item {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.pos-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pos-value {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 4px;
}
.pos-value.accent {
  color: var(--accent);
}
.pos-value.green {
  color: var(--green);
}
.lock-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.lock-icon {
  font-size: 1.3rem;
}
.lock-info {
  flex: 1;
}
.lock-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.lock-timer {
  font-size: 1rem;
  font-weight: 600;
}

/* ─── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge.locked {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}
.badge.unlocked {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
}

/* ─── Form elements ───────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.input-wrap {
  position: relative;
}
.form-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 90px 11px 14px;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.form-input::placeholder {
  color: var(--text-muted);
}
.form-input:focus {
  border-color: var(--accent);
}
.input-suffix {
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  pointer-events: none;
}
.input-max {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}
.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 5px;
}
.btn-full {
  width: 100%;
}

/* ─── Dot ─────────────────────────────────────────────────────────────────── */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot.connected {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

/* ─── Spinner ─────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  max-width: 360px;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success {
  border-color: rgba(34, 197, 94, 0.4);
}
.toast.error {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ─── Section titles ──────────────────────────────────────────────────────── */
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.section-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* ─── Emergency card ──────────────────────────────────────────────────────── */
.emergency-card {
  border-color: rgba(239, 68, 68, 0.25) !important;
}
.emergency-card .card-icon {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}
.emergency-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(239, 68, 68, 0.07);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

/* ─── Links ───────────────────────────────────────────────────────────────── */
.explorer-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.explorer-link:hover {
  color: var(--accent);
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}
footer a {
  color: var(--accent);
  text-decoration: none;
}
