:root {
  --bg: #0e1117;
  --bg-deep: #0b0f18;
  --fg: #e6e8eb;
  --muted: #9aa0a6;
  --accent: #d4af37;
  --accent-soft: #f3e7b3;
  --panel-strong: rgba(10, 15, 30, 0.68);
  --border-gold: rgba(212, 175, 55, 0.16);
  --border-gold-strong: rgba(212, 175, 55, 0.28);
  --shadow-gold: 0 10px 30px rgba(212, 175, 55, 0.08);
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--fg);
  line-height: 1.6;
  overflow-x: hidden;

  background:
    radial-gradient(circle at 12% 20%, rgba(255,255,255,0.95) 1.4px, transparent 2.6px),
    radial-gradient(circle at 28% 35%, rgba(255,255,255,0.55) 1px, transparent 2px),
    radial-gradient(circle at 45% 15%, rgba(255,255,255,0.8) 1.8px, transparent 3px),
    radial-gradient(circle at 62% 40%, rgba(255,255,255,0.42) 0.8px, transparent 1.8px),
    radial-gradient(circle at 78% 22%, rgba(255,255,255,0.75) 1.5px, transparent 2.8px),
    radial-gradient(circle at 88% 55%, rgba(255,255,255,0.5) 1px, transparent 2px),
    radial-gradient(circle at 18% 70%, rgba(255,255,255,0.6) 1.2px, transparent 2.4px),
    radial-gradient(circle at 72% 78%, rgba(255,255,255,0.85) 1.7px, transparent 3px),
    linear-gradient(to bottom, var(--bg-deep), var(--bg));

  background-size:
    260px 260px,
    360px 360px,
    480px 480px,
    320px 320px,
    420px 420px,
    560px 560px,
    460px 460px,
    620px 620px,
    100% 100%;

  animation:
    starRise 55s linear infinite,
    starTwinkle 4.8s ease-in-out infinite alternate;
}

@keyframes starRise {
  from {
    background-position:
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0,
      0 0;
  }

  to {
    background-position:
      0 -260px,
      0 -360px,
      0 -480px,
      0 -320px,
      0 -420px,
      0 -560px,
      0 -460px,
      0 -620px,
      0 0;
  }
}

@keyframes starTwinkle {
  from {
    filter: brightness(0.8);
  }

  to {
    filter: brightness(1.25);
  }
}

#starfield {
  display: none;
}

main {
  width: 100%;
}

section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
}

.section {
  position: relative;
}

.center {
  text-align: center;
}

/* Navigation */

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(3, 8, 20, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-gold);
}

.nav-brand {
  flex-shrink: 0;
}

.nav-brand a {
  text-decoration: none;
  color: var(--accent-soft);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.nav-links {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.nav-links a {
  position: relative;
  text-decoration: none;
  color: #e7eaf3;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--accent-soft);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  transition: width 0.25s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* Hero */

.hero {
  text-align: center;
  padding-top: 5rem;
  padding-bottom: 4.5rem;
}

/* Typography */

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin-top: 0;
}

h1 {
  font-size: 4rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2.4rem;
  margin-bottom: 1rem;
}

p {
  margin-top: 0;
}

.subtitle {
  color: var(--muted);
  font-size: 1.08rem;
  margin-bottom: 1rem;
}

.intro {
  max-width: 760px;
  margin: 1.25rem auto 0;
  color: #dfe4ea;
}

.note {
  color: var(--muted);
  margin-top: 1.2rem;
}

/* Buttons */

.button,
.button-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.08);
  color: #f7f2dc;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    border-color 0.2s ease;
}

.button:hover,
.button-like:hover {
  background: rgba(212, 175, 55, 0.14);
  border-color: rgba(212, 175, 55, 0.5);
  transform: translateY(-1px);
}

.button.secondary {
  background: transparent;
}

.button:disabled,
.mini-button:disabled {
  cursor: not-allowed;
  opacity: 1;
  color: #f7f2dc;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.08);
  background: rgba(212, 175, 55, 0.045);
  border-color: rgba(212, 175, 55, 0.16);
  filter: saturate(0.72);
  box-shadow: none;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

/* Stats */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.stat-card {
  background:
    linear-gradient(
      180deg,
      rgba(7, 16, 38, 0.88),
      rgba(5, 11, 26, 0.94)
    );
  border-radius: 22px;
  padding: 1.75rem 1rem;
  min-height: 132px;
  text-align: center;
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-gold);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold-strong);
}

.stat-number {
  font-size: 1.95rem;
  font-weight: 700;
  color: var(--accent-soft);
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.92rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* Dashboard panels */

.dashboard-box {
  background: var(--panel-strong);
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-gold);
}

/* Approval status panel */

.approval-box,
.rewards-box {
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
  padding: 1.2rem;
  border-radius: 18px;
  background:
    linear-gradient(
      180deg,
      rgba(7, 16, 38, 0.82),
      rgba(5, 11, 26, 0.92)
    );
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-gold);
}

.approval-title,
.rewards-title {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 1rem;
}

.approval-row,
.rewards-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.approval-row:last-child,
.rewards-row:last-child {
  border-bottom: none;
}

.approval-row span,
.rewards-row span {
  color: var(--muted);
}

.approval-row strong,
.rewards-row strong {
  color: #f7f2dc;
  text-align: right;
}

/* Inputs */

input {
  font: inherit;
}

input[type="number"] {
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.92);
  color: #111;
}

.input-with-button {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.input-with-button input {
  width: 220px;
  max-width: 100%;
}

.mini-button {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: bold;
}

.mini-button:hover {
  background: rgba(212, 175, 55, 0.12);
}

/* Slider */

.stake-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.slider-section {
  width: 100%;
  max-width: 520px;
}

#stake-slider {
  width: 100%;
  cursor: pointer;
  accent-color: var(--accent);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Images / diagrams */

.logo,
.diagram-image,
.image-card img,
.hero img,
section img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 28px;
  opacity: 0.92;
  mix-blend-mode: screen;
  filter:
    drop-shadow(0 0 22px rgba(212, 175, 55, 0.10))
    brightness(1.03);
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
  mask-composite: intersect;
}

.logo {
  width: min(280px, 70vw);
  max-height: 420px;
  margin: 0 auto 1.5rem;
}

.diagram-card,
.image-card {
  position: relative;
  margin: 2rem auto;
  border-radius: 28px;
  overflow: hidden;
  background: transparent;
  border: none;
  box-shadow: none;
}

.diagram-card::after,
.image-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(
      circle at center,
      transparent 52%,
      rgba(11, 15, 24, 0.72) 86%,
      var(--bg-deep) 100%
    );
}

.diagram-image,
.image-card img {
  max-height: 760px;
}

/* Macro chart */

.chart-panel {
  width: 100%;
  min-height: 430px;
  height: 430px;
  position: relative;
  padding: 20px;
  border-radius: 22px;
  background: rgba(10, 15, 30, 0.58);
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-gold);
  overflow: hidden;
}

#macroChart {
  width: 100% !important;
  height: 100% !important;
}

/* Toast notifications */

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 5000;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(8, 13, 28, 0.96);
  border: 1px solid var(--border-gold);
  color: var(--fg);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
  animation: toastIn 0.25s ease both;
}

.toast.success {
  border-color: rgba(80, 220, 140, 0.55);
}

.toast.error {
  border-color: rgba(255, 90, 90, 0.6);
}

.toast.info {
  border-color: var(--border-gold);
}

.toast-title {
  font-weight: 700;
  margin-bottom: 3px;
}

.toast-message {
  color: var(--muted);
  font-size: 0.92rem;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer */

footer {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  color: var(--muted);
  max-width: 900px;
  margin: 0 auto;
}

/* Claim rewards active glow */

.button.claim-ready {
  border-color: rgba(212, 175, 55, 0.9);

  background:
    linear-gradient(
      180deg,
      rgba(212, 175, 55, 0.18),
      rgba(212, 175, 55, 0.08)
    );

  box-shadow:
    0 0 18px rgba(212, 175, 55, 0.30),
    0 0 42px rgba(212, 175, 55, 0.16);

  animation: rewardPulse 2s ease-in-out infinite;
}

@keyframes rewardPulse {
  0% {
    box-shadow:
      0 0 12px rgba(212, 175, 55, 0.18),
      0 0 26px rgba(212, 175, 55, 0.08);
  }

  50% {
    box-shadow:
      0 0 22px rgba(212, 175, 55, 0.40),
      0 0 52px rgba(212, 175, 55, 0.22);
  }

  100% {
    box-shadow:
      0 0 12px rgba(212, 175, 55, 0.18),
      0 0 26px rgba(212, 175, 55, 0.08);
  }
}

/* Responsive */

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-panel {
    min-height: 380px;
    height: 380px;
  }
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    gap: 14px;
    padding: 16px 20px;
  }

  .nav-links {
    gap: 18px;
  }

  section {
    padding: 4rem 1.25rem;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2rem;
  }

  .diagram-image,
  .image-card img {
    max-height: 560px;
  }
}

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

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .input-with-button {
    align-items: stretch;
  }

  .input-with-button input {
    width: 100%;
  }

  .approval-row,
  .rewards-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .approval-row strong,
  .rewards-row strong {
    text-align: left;
  }

  .chart-panel {
    min-height: 320px;
    height: 320px;
    padding: 12px;
  }

  .toast-root {
    left: 14px;
    right: 14px;
  }

  .toast {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 2.5rem;
  }

  .diagram-card,
  .image-card,
  .diagram-image,
  .image-card img {
    border-radius: 18px;
  }
}
/* Testnet warning */

.testnet-warning {
  text-align: center;

  background:
    linear-gradient(
      180deg,
      rgba(55, 35, 5, 0.72),
      rgba(25, 16, 4, 0.88)
    );

  border: 1px solid rgba(212, 175, 55, 0.28);

  box-shadow:
    0 0 24px rgba(212, 175, 55, 0.08),
    inset 0 0 24px rgba(212, 175, 55, 0.04);
}

.testnet-warning h3 {
  margin-top: 0;
  margin-bottom: 0.9rem;

  color: var(--accent-soft);

  font-size: 1.25rem;
  letter-spacing: 0.04em;
}

.testnet-warning p {
  margin: 0.5rem 0;

  color: #d7dce5;

  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
/* Recent activity */

.activity-box {
  background:
    linear-gradient(
      180deg,
      rgba(7, 16, 38, 0.88),
      rgba(5, 11, 26, 0.94)
    );

  border: 1px solid var(--border-gold);

  border-radius: 24px;

  padding: 1.6rem;

  box-shadow: var(--shadow-gold);
}

.activity-title {
  font-size: 1.1rem;
  font-weight: 700;

  color: var(--accent-soft);

  margin-bottom: 1.2rem;

  letter-spacing: 0.04em;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-card {
  background:
    rgba(255, 255, 255, 0.03);

  border: 1px solid rgba(212, 175, 55, 0.12);

  border-radius: 18px;

  padding: 1rem 1.1rem;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.activity-card:hover {
  transform: translateY(-2px);

  border-color:
    rgba(212, 175, 55, 0.28);

  background:
    rgba(255, 255, 255, 0.05);
}

.activity-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;

  margin-bottom: 0.55rem;
}

.activity-type {
  font-weight: 700;
  color: var(--accent-soft);
}

.activity-time {
  font-size: 0.84rem;
  color: var(--muted);
}

.activity-amount {
  font-size: 1rem;
  font-weight: 600;

  color: #f4f6fb;

  margin-bottom: 0.7rem;
}

.activity-link a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.activity-link a:hover {
  text-decoration: underline;
}

.activity-empty {
  color: var(--muted);
  text-align: center;
  padding: 1.2rem 0;
}
/* RPC status badge */

#rpc-provider {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  color: var(--accent-soft);
  font-weight: 700;
}

#rpc-provider::before {
  content: "";
  width: 8px;
  height: 8px;

  border-radius: 999px;

  background: var(--accent);

  box-shadow:
    0 0 8px rgba(212, 175, 55, 0.65),
    0 0 18px rgba(212, 175, 55, 0.25);
}
/* Network styles */

.network-mainnet {
  color: #7ee787;
  font-weight: 700;
}

.network-testnet {
  color: #d4af37;
  font-weight: 700;
}

.network-l2 {
  color: #8ab4ff;
  font-weight: 700;
}

.network-unknown {
  color: #ff7b72;
  font-weight: 700;
}
/* Environment badge */

.environment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-top: 18px;
  padding: 10px 18px;

  border-radius: 999px;

  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  backdrop-filter: blur(10px);

  border: 1px solid rgba(255,255,255,0.08);

  box-shadow:
    0 0 18px rgba(0,0,0,0.28),
    0 0 35px rgba(212,175,55,0.06);
}

.environment-badge.testnet-mode {
  color: #f5d46b;

  background:
    linear-gradient(
      180deg,
      rgba(212,175,55,0.14),
      rgba(212,175,55,0.06)
    );

  border-color: rgba(212,175,55,0.32);
}

.environment-badge.mainnet-mode {
  color: #7ee787;

  background:
    linear-gradient(
      180deg,
      rgba(80,220,140,0.14),
      rgba(80,220,140,0.05)
    );

  border-color: rgba(80,220,140,0.32);
}
