:root {
  --bg: #030308;
  --bg-card: rgba(8, 12, 28, 0.65);
  --border: rgba(120, 160, 255, 0.12);
  --border-bright: rgba(77, 232, 255, 0.35);
  --text: #eef1fb;
  --muted: #7d88a8;
  --cyan: #4de8ff;
  --gold: #ffd166;
  --purple: #9b6dff;
  --orange: #ff8c42;
  --glow: rgba(77, 232, 255, 0.4);
  --font: "Space Grotesk", system-ui, sans-serif;
  --display: "Orbitron", var(--font);
  --header-h: 4.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Space background layers ─── */
#space-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.nebula {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
  opacity: 0.6;
}

.nebula-1 {
  background: radial-gradient(ellipse 80% 50% at 20% 10%, rgba(77, 232, 255, 0.12), transparent 60%);
  animation: nebula-drift 18s ease-in-out infinite alternate;
}

.nebula-2 {
  background: radial-gradient(ellipse 70% 45% at 85% 80%, rgba(155, 109, 255, 0.1), transparent 55%);
  animation: nebula-drift 22s ease-in-out infinite alternate-reverse;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(77, 232, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 232, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black, transparent);
}

@keyframes nebula-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(2%, 3%) scale(1.05); }
}

/* ─── Sticky header ─── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(3, 3, 8, 0.55);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.88rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 24px rgba(255, 209, 102, 0.35), 0 0 48px rgba(77, 232, 255, 0.15);
}

.nav-main {
  display: none;
  gap: 1.5rem;
  margin-right: auto;
}

.nav-main a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-main a:hover {
  color: var(--cyan);
}

.nav-links {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  margin-left: auto;
}

@media (min-width: 768px) {
  .nav-main {
    display: flex;
  }
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding-top: var(--header-h);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.25s, background 0.2s;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--border-bright);
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(77, 232, 255, 0.2), rgba(155, 109, 255, 0.25));
  border-color: rgba(77, 232, 255, 0.4);
}

.btn-glow:hover {
  box-shadow: 0 0 32px var(--glow), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.btn-ghost {
  padding: 0.55rem 0.65rem;
  background: transparent;
}

.btn-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* ─── Hero ─── */
.hero {
  padding: 3rem 0 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
  }
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.badge {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(77, 232, 255, 0.1);
  border: 1px solid rgba(77, 232, 255, 0.25);
  color: var(--cyan);
}

.badge-gold {
  background: rgba(255, 209, 102, 0.1);
  border-color: rgba(255, 209, 102, 0.3);
  color: var(--gold);
}

.badge-outline {
  background: transparent;
  color: var(--muted);
}

.hero-copy h1 {
  font-family: var(--display);
  font-size: clamp(2.6rem, 8vw, 4.8rem);
  font-weight: 800;
  line-height: 1;
  margin: 0 0 1rem;
  letter-spacing: 0.02em;
  text-shadow: 0 0 60px rgba(77, 232, 255, 0.25);
}

.hero-copy h1 span {
  display: block;
  background: linear-gradient(90deg, var(--cyan), var(--gold) 50%, var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 0.85em;
  margin-top: 0.15em;
}

.hero-lead {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.75rem;
}

.hero-sub {
  max-width: 32rem;
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 1.75rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.ca-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.15rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ca-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  width: 100%;
}

@media (min-width: 640px) {
  .ca-label {
    width: auto;
  }
}

.ca-value {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.78rem;
  word-break: break-all;
  flex: 1;
  min-width: 180px;
  color: rgba(238, 241, 251, 0.9);
}

.ca-copy-icon {
  background: rgba(77, 232, 255, 0.1);
  border: 1px solid rgba(77, 232, 255, 0.25);
  color: var(--cyan);
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

/* Hero visual — floating logo + planet */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.hero-logo-float {
  width: min(280px, 70vw);
  height: auto;
  border-radius: 50%;
  position: relative;
  z-index: 3;
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 0 40px rgba(77, 232, 255, 0.35)) drop-shadow(0 0 80px rgba(255, 209, 102, 0.2));
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(2deg); }
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(77, 232, 255, 0.15);
  animation: spin 30s linear infinite;
}

.orbit-ring-1 {
  width: 320px;
  height: 320px;
  border-color: rgba(77, 232, 255, 0.2);
}

.orbit-ring-2 {
  width: 400px;
  height: 400px;
  border-style: dashed;
  border-color: rgba(255, 209, 102, 0.12);
  animation-duration: 45s;
  animation-direction: reverse;
}

.hero-planet {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #4a5568, #1a1a2e 60%, #0d0d18);
  box-shadow:
    inset -12px -12px 24px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(77, 232, 255, 0.15);
  bottom: 5%;
  left: 5%;
  opacity: 0.7;
  animation: float 8s ease-in-out infinite reverse;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.stats-strip {
  margin-top: 0.5rem;
}

/* ─── Cards & panels ─── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.card {
  padding: 1.35rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.card-glow:hover {
  transform: translateY(-3px);
  border-color: rgba(77, 232, 255, 0.25);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 24px rgba(77, 232, 255, 0.06);
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.card p,
.card a {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.card a {
  color: var(--cyan);
  text-decoration: none;
}

.section-panel {
  padding: 2.5rem;
  margin: 2rem 0;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(8, 12, 28, 0.75), rgba(3, 3, 8, 0.5));
  backdrop-filter: blur(24px);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.section-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--cyan);
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 1.5rem;
}

.section-title span {
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ─── Steps ─── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.step {
  position: relative;
  padding: 1.75rem 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s;
}

.step-glow:hover {
  transform: translateY(-4px);
  border-color: rgba(155, 109, 255, 0.3);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--gold), transparent);
  opacity: 0.5;
}

.step-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.step-num {
  font-family: var(--display);
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
}

.step h3 {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* ─── Links grid ─── */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
}

.link-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 5rem;
  padding: 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color 0.2s, transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.link-icon {
  font-size: 1.35rem;
  opacity: 0.85;
}

.link-tile:hover {
  transform: translateY(-3px);
  border-color: var(--border-bright);
  background: rgba(77, 232, 255, 0.06);
  box-shadow: 0 8px 28px rgba(77, 232, 255, 0.08);
}

.link-tile.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ─── Chart ─── */
.chart-wrap {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  min-height: 420px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.3);
}

.chart-wrap iframe {
  width: 100%;
  height: 520px;
  border: 0;
}

/* ─── Live lottery ─── */
.live-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.live-header .section-title {
  margin: 0;
}

.live-meta {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

.live-error {
  padding: 0.85rem 1rem;
  margin: 0 0 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 100, 100, 0.35);
  background: rgba(255, 80, 80, 0.08);
  color: #ffb4b4;
  font-size: 0.875rem;
}

.live-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.card-feature {
  grid-column: span 1;
  background: linear-gradient(145deg, rgba(77, 232, 255, 0.1), rgba(155, 109, 255, 0.08));
  border-color: rgba(77, 232, 255, 0.25);
}

@media (min-width: 900px) {
  .card-feature {
    grid-column: span 2;
  }
}

.live-value {
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: 0;
  color: var(--cyan);
  letter-spacing: 0.04em;
  text-shadow: 0 0 30px rgba(77, 232, 255, 0.3);
}

.live-value-sm {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
}

.live-value.ready {
  color: var(--gold);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 20px rgba(255, 209, 102, 0.4); }
  50% { opacity: 0.7; }
}

.card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.card-link:hover {
  color: var(--cyan);
}

.card-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.draw-history-title {
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  color: var(--muted);
}

.draw-empty {
  margin: 0;
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px dashed rgba(77, 232, 255, 0.2);
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
}

.draw-history-list {
  display: grid;
  gap: 1rem;
}

.draw-card {
  padding: 1.35rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s;
}

.draw-card:hover {
  border-color: rgba(255, 209, 102, 0.25);
}

.draw-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.draw-label {
  display: block;
  font-family: var(--display);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
}

.draw-time {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.draw-tx {
  font-size: 0.82rem;
  color: var(--cyan);
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s;
}

.draw-tx:hover {
  border-color: var(--border-bright);
  background: rgba(77, 232, 255, 0.08);
}

.draw-pool-paid {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.draw-pool-paid strong {
  color: var(--text);
}

.winner-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.winner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.875rem;
}

.winner-wallet {
  font-family: ui-monospace, "SF Mono", monospace;
  color: var(--cyan);
  text-decoration: none;
}

.winner-wallet:hover {
  text-decoration: underline;
}

.winner-amt {
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

/* ─── Footer ─── */
footer {
  padding: 3rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.footer-logo {
  border-radius: 50%;
  margin-bottom: 0.75rem;
  opacity: 0.85;
  filter: drop-shadow(0 0 12px rgba(77, 232, 255, 0.2));
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  background: rgba(8, 12, 28, 0.95);
  border: 1px solid var(--border-bright);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 100;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
  .nebula {
    mix-blend-mode: normal;
    opacity: 0.45;
  }

  .site-header,
  .card,
  .section-panel,
  .ca-box {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .site-header {
    background: rgba(3, 3, 8, 0.92);
  }

  .card,
  .section-panel,
  .ca-box {
    background: rgba(8, 12, 28, 0.92);
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 4rem;
  }

  .header-inner {
    padding: 0 0.75rem;
    gap: 0.65rem;
  }

  .logo {
    font-size: 0.75rem;
    min-width: 0;
  }

  .logo-img {
    width: 2.25rem;
    height: 2.25rem;
  }

  .wrap {
    width: min(1200px, calc(100% - 1.25rem));
  }

  .hero {
    padding: 2rem 0 1.5rem;
  }

  .section-panel {
    padding: 1.5rem 1.15rem;
    margin: 1.25rem 0;
    border-radius: 18px;
  }

  .hero-visual {
    min-height: 200px;
  }

  .orbit-ring-1 { width: 220px; height: 220px; }
  .orbit-ring-2 { width: 260px; height: 260px; }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .nav-links .btn:not(.btn-primary) {
    display: none;
  }

  .nav-links .btn-primary {
    padding: 0.55rem 0.85rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .chart-wrap {
    min-height: 320px;
  }

  .chart-wrap iframe {
    height: 380px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
