:root {
  --void: #01040d;
  --deep: #06101f;
  --navy: #0b1a33;
  --gold: #f0b429;
  --gold-soft: #ffd27a;
  --amber: #e89a1a;
  --cyan: #5ec8ff;
  --cyan-deep: #2aa8e8;
  --ice: #e8f6ff;
  --ink: #f4f0e6;
  --muted: rgba(232, 240, 255, 0.55);
  --line: rgba(240, 180, 41, 0.28);
  --glow-gold: 0 0 24px rgba(240, 180, 41, 0.45);
  --font-display: "Lalezar", "Vazirmatn", system-ui, sans-serif;
  --font-body: "Vazirmatn", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  overflow: hidden;
}

body {
  position: relative;
  isolation: isolate;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cosmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% 35%, #122748 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 20% 80%, #1a0f2e 0%, transparent 50%),
    radial-gradient(ellipse 50% 45% at 85% 15%, #0a2040 0%, transparent 45%),
    linear-gradient(180deg, #020814 0%, #01040d 55%, #020610 100%);
  pointer-events: none;
}

.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  mix-blend-mode: screen;
  animation: drift 28s ease-in-out infinite alternate;
}

.nebula-a {
  width: min(70vw, 720px);
  height: min(50vw, 520px);
  top: 8%;
  left: 18%;
  background: radial-gradient(circle, rgba(46, 120, 200, 0.55), transparent 70%);
}

.nebula-b {
  width: min(55vw, 560px);
  height: min(40vw, 420px);
  right: 5%;
  bottom: 18%;
  background: radial-gradient(circle, rgba(180, 90, 40, 0.35), transparent 70%);
  animation-delay: -8s;
  animation-duration: 34s;
}

.nebula-c {
  width: min(40vw, 420px);
  height: min(35vw, 360px);
  left: 8%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(40, 160, 200, 0.28), transparent 70%);
  animation-delay: -16s;
  animation-duration: 40s;
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.72) 100%);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

#sky,
#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#sky {
  z-index: 1;
}

#map {
  z-index: 2;
}

.brand {
  position: fixed;
  top: clamp(1.2rem, 3vw, 2.4rem);
  right: clamp(1.2rem, 4vw, 3rem);
  z-index: 10;
  text-align: right;
  max-width: min(28vw, 260px);
  pointer-events: none;
  animation: rise-in 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.6vw, 3.35rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--gold-soft);
  text-shadow:
    0 0 18px rgba(240, 180, 41, 0.55),
    0 0 48px rgba(240, 180, 41, 0.25),
    0 2px 20px rgba(0, 0, 0, 0.65);
}

.brand-sub {
  margin: 0.55rem 0 0;
  font-size: clamp(0.78rem, 1.4vw, 0.95rem);
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.stats {
  position: fixed;
  top: clamp(1.2rem, 3vw, 2.4rem);
  left: clamp(1.2rem, 4vw, 3rem);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  pointer-events: none;
  animation: rise-in 1.4s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stats span {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--cyan);
  text-shadow: 0 0 20px rgba(94, 200, 255, 0.45);
  line-height: 1;
}

.stats small {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.stage {
  position: fixed;
  inset-inline: 0;
  bottom: clamp(1.4rem, 4vh, 2.8rem);
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 0 1rem;
  pointer-events: none;
  animation: rise-in 1.2s 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.name-form {
  width: min(100%, 460px);
  pointer-events: auto;
  text-align: center;
}

.name-shell {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid rgba(240, 180, 41, 0.28);
  background: linear-gradient(
    180deg,
    rgba(8, 18, 36, 0.72) 0%,
    rgba(4, 10, 22, 0.88) 100%
  );
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 18px 50px rgba(0, 0, 0, 0.45),
    var(--glow-gold);
  overflow: hidden;
}

.name-glow {
  position: absolute;
  inset: -40% -20%;
  background: radial-gradient(
    circle at 30% 50%,
    rgba(240, 180, 41, 0.12),
    transparent 45%
  );
  pointer-events: none;
  animation: sheen 6s ease-in-out infinite;
}

.name-shell input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  padding: 1rem 1.15rem;
  text-align: right;
  position: relative;
  z-index: 1;
}

.name-shell input::placeholder {
  color: rgba(232, 240, 255, 0.35);
}

.name-shell input:focus {
  outline: none;
}

.name-shell:focus-within {
  border-color: rgba(240, 180, 41, 0.55);
  box-shadow:
    0 0 0 1px rgba(240, 180, 41, 0.2) inset,
    0 18px 50px rgba(0, 0, 0, 0.45),
    0 0 36px rgba(240, 180, 41, 0.35);
}

.ignite {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  border-inline-start: 1px solid rgba(240, 180, 41, 0.22);
  background: linear-gradient(180deg, #f0b429 0%, #c98310 100%);
  color: #1a1204;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0 1.15rem;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.ignite:hover {
  filter: brightness(1.08);
}

.ignite:active {
  transform: translateY(1px);
}

.ignite svg {
  flex-shrink: 0;
}

.hint {
  margin: 0.7rem 0 0;
  font-size: 0.75rem;
  color: rgba(232, 240, 255, 0.38);
  font-weight: 300;
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%) scale(0.96);
  z-index: 20;
  padding: 0.7rem 1.2rem;
  border: 1px solid rgba(94, 200, 255, 0.35);
  background: rgba(6, 16, 32, 0.85);
  color: var(--cyan);
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  box-shadow: 0 0 30px rgba(94, 200, 255, 0.2);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.foot {
  position: fixed;
  bottom: 0.55rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: rgba(232, 240, 255, 0.22);
  pointer-events: none;
  display: none;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(3%, -4%, 0) scale(1.08);
  }
}

@keyframes sheen {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.7;
  }
  50% {
    transform: translateX(12%);
    opacity: 1;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .brand {
    max-width: min(42vw, 160px);
    top: 1rem;
    right: 1rem;
  }

  .brand-sub {
    display: none;
  }

  .stats {
    top: auto;
    bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px));
    left: 1rem;
  }

  .name-shell {
    flex-direction: column;
  }

  .ignite {
    justify-content: center;
    border-inline-start: 0;
    border-top: 1px solid rgba(240, 180, 41, 0.22);
    padding: 0.85rem 1rem;
  }

  .stage {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
}

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