:root {
  --bg: #0b1220;
  --bg-2: #101a2c;
  --card: #16233a;
  --text: #eef3fb;
  --muted: #8fa3c0;
  --accent: #2f9dff;
  --accent-2: #6fd0ff;
  --ok: #35c759;
  --err: #ff6b6b;
  --warn: #ffb340;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1100px 620px at 50% -12%, #1b3157 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 55%, #070d17 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
}

.screen {
  width: 100%;
  max-width: 460px;
  padding: 18px 22px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ---------- animated stage ---------- */

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 46vh;
  margin-top: 4px;
  display: grid;
  place-items: center;
}

.sky {
  position: absolute;
  inset: 0;
}

.star {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #cfe4ff;
  opacity: 0.25;
  animation: twinkle 4.8s ease-in-out infinite;
  animation-delay: var(--d);
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.15;
    transform: scale(0.8);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.35);
  }
}

.halo {
  position: absolute;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(47, 157, 255, 0.38) 0%,
    rgba(47, 157, 255, 0.1) 45%,
    transparent 70%
  );
  filter: blur(6px);
  animation: pulse 5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.94);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.orbit,
.flyer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.pin-wrap {
  position: relative;
  width: 58%;
  animation: float 6s ease-in-out infinite;
}

.pin {
  width: 100%;
  display: block;
  border-radius: 26px;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.55));
}

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

.plane {
  offset-path: path(
    "M40,190 C80,110 150,80 210,110 C255,132 268,180 240,205"
  );
  offset-rotate: auto;
  animation: fly 7s linear infinite;
  filter: drop-shadow(0 0 6px rgba(140, 200, 255, 0.85));
}

@keyframes fly {
  from {
    offset-distance: 0%;
  }
  to {
    offset-distance: 100%;
  }
}

/* Fallback for engines without offset-path support. */
@supports not (offset-path: path("M0,0 L1,1")) {
  .plane {
    animation: fly-fallback 7s ease-in-out infinite;
    transform-origin: center;
  }
  @keyframes fly-fallback {
    0% {
      transform: translate(40px, 190px);
    }
    50% {
      transform: translate(215px, 108px);
    }
    100% {
      transform: translate(240px, 205px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .star,
  .halo,
  .pin-wrap,
  .plane {
    animation: none;
  }
}

/* ---------- copy ---------- */

.title {
  margin: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.05;
}

.title-small {
  font-size: 20px;
  font-weight: 500;
  color: var(--muted);
}

.title-big {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: linear-gradient(92deg, #ffffff, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title-sub {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 1.6px;
}

.lede {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.fine {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #6f83a0;
  max-width: 320px;
}

.fine b {
  color: #9fb6d6;
  font-weight: 600;
}

/* ---------- result banner ---------- */

.result {
  width: 100%;
  margin-top: 14px;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  text-align: left;
  background: var(--card);
  border: 1px solid transparent;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.result.show {
  padding: 13px 15px;
  max-height: 260px;
}

.result.ok {
  border-color: rgba(53, 199, 89, 0.45);
  background: rgba(53, 199, 89, 0.1);
}

.result.err {
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.1);
}

.result.warn {
  border-color: rgba(255, 179, 64, 0.4);
  background: rgba(255, 179, 64, 0.1);
}

.result strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14.5px;
}

/* ---------- buttons ---------- */

.actions {
  width: 100%;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cta {
  position: relative;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 15px;
  font-size: 16px;
  font-weight: 700;
  color: #04101f;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 10px 26px rgba(47, 157, 255, 0.32);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.12s ease, opacity 0.2s ease;
}

.cta:active {
  transform: scale(0.98);
}

.cta[disabled] {
  opacity: 0.65;
  cursor: default;
}

.cta-secondary {
  color: var(--text);
  background: linear-gradient(180deg, #24344f, #1a273c);
  box-shadow: none;
  border: 1px solid rgba(120, 160, 210, 0.28);
}

.spinner {
  position: absolute;
  right: 18px;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(4, 16, 31, 0.25);
  border-top-color: #04101f;
  border-radius: 50%;
  opacity: 0;
  animation: spin 0.8s linear infinite;
}

.cta.loading .spinner {
  opacity: 1;
}

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

.foot {
  margin-top: 22px;
  font-size: 12.5px;
  color: #5d7291;
  letter-spacing: 0.3px;
}
