/* ============================================================
   Ecosystem Web3 Airdrop Portal — Dark Glassmorphism Theme
   Pure custom CSS · zero dependencies · mobile-first (iOS Safari)
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  --bg-0: #0A0B0E;
  --bg-1: #12141D;
  --cyan: #00F2FE;
  --violet: #4FACFE;
  --green: #2EE6A8;
  --gold: #FFC53D;
  --text: #F2F5FA;
  --muted: rgba(235, 240, 250, 0.55);
  --faint: rgba(235, 240, 250, 0.32);
  --stroke: rgba(255, 255, 255, 0.12);
  --hairline: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.045);
  --radius: 16px;
  --grad: linear-gradient(135deg, var(--cyan), var(--violet));
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(120% 55% at 50% -8%, rgba(79, 172, 254, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; }
b, strong { font-weight: 700; }

/* ---------- Ambient background layers ---------- */
.orbs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; will-change: transform; }
.orb-cyan {
  width: 340px; height: 340px; top: -120px; left: -110px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.16) 0%, rgba(0, 242, 254, 0) 70%);
  animation: drift 16s ease-in-out infinite alternate;
}
.orb-violet {
  width: 440px; height: 440px; bottom: -180px; right: -160px;
  background: radial-gradient(circle, rgba(79, 172, 254, 0.14) 0%, rgba(79, 172, 254, 0) 70%);
  animation: drift 20s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(28px, 22px, 0) scale(1.12); }
}
.dotgrid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1.4px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 65%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 65%);
}

/* ---------- Page shell ---------- */
.page {
  position: relative; z-index: 1;
  width: 100%; max-width: 460px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 20px calc(env(safe-area-inset-bottom, 0px) + 22px);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; flex-direction: column;
}

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 24px; height: 24px; display: block; }
.brand-name { font-size: 11px; font-weight: 800; letter-spacing: 0.22em; color: var(--muted); }
.live-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 999px;
  border: 0.5px solid rgba(46, 230, 168, 0.35);
  background: rgba(46, 230, 168, 0.07);
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.14em; color: var(--green);
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px var(--green);
  animation: dotBlink 1.6s ease-in-out infinite;
}
@keyframes dotBlink { 50% { opacity: 0.35; transform: scale(0.8); } }

/* ---------- Glass card ---------- */
.glass {
  position: relative;
  margin-top: 18px;
  padding: 26px 20px 24px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  border: 0.5px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
@supports not ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .glass { background: rgba(18, 20, 29, 0.92); }
}

/* ---------- Screen transitions ---------- */
.screen { animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
.hidden { display: none !important; }

/* ---------- Shared bits ---------- */
.step-chip {
  display: inline-block;
  padding: 5px 11px; border-radius: 999px;
  border: 0.5px solid rgba(0, 242, 254, 0.28);
  background: rgba(0, 242, 254, 0.06);
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.2em; color: rgba(0, 242, 254, 0.85);
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.noscript-box {
  margin-top: 18px; padding: 14px; border-radius: 12px;
  border: 0.5px solid var(--stroke); background: rgba(18, 20, 29, 0.9);
  font-size: 13px; text-align: center; color: var(--muted);
}

/* ---------- Step 1 · Network selection ---------- */
.portal-header {
  margin-top: 16px;
  font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--muted);
}
.title {
  margin-top: 8px;
  font-size: 27px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em;
}
.title em { font-style: normal; }
.subtitle { margin-top: 10px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }

.tags { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.tag {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; text-align: left; cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  touch-action: manipulation;
}
.tag:hover { border-color: rgba(0, 242, 254, 0.45); background: rgba(0, 242, 254, 0.05); }
.tag:active { transform: scale(0.975); }
.tag-icon {
  flex: none; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: rgba(0, 242, 254, 0.08);
  border: 0.5px solid rgba(0, 242, 254, 0.22);
}
.tag-icon svg { width: 20px; height: 20px; display: block; }
.tag-label { flex: 1; min-width: 0; }
.tag-label strong { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.tag-label em { display: block; margin-top: 2px; font-style: normal; font-size: 11.5px; color: var(--muted); }
.tag-arrow {
  flex: none; width: 16px; height: 16px;
  color: rgba(255, 255, 255, 0.35);
  transition: transform 0.18s ease, color 0.18s ease;
}
.tag:hover .tag-arrow { transform: translateX(3px); color: var(--cyan); }

.safety-note {
  margin-top: 14px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 11px; color: var(--faint);
}
.safety-note svg { width: 13px; height: 13px; flex: none; color: var(--green); }

.trust-row {
  margin-top: 18px; padding-top: 16px;
  border-top: 0.5px solid var(--hairline);
  display: flex;
}
.trust-row > div { flex: 1; text-align: center; }
.trust-row > div + div { border-left: 0.5px solid var(--hairline); }
.trust-row b {
  display: block; font-size: 17px; font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.trust-row span {
  display: block; margin-top: 3px;
  font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Step 2 · Live scanning ---------- */
.scan-body { will-change: transform; }
.scan-title { margin-top: 14px; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }

.radar-wrap { position: relative; width: 220px; height: 220px; margin: 18px auto 4px; }
.radar { width: 100%; height: 100%; display: block; }
.radar-progress { filter: drop-shadow(0 0 6px rgba(0, 242, 254, 0.55)); }
.radar-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
#scan-pct {
  font-size: 42px; font-weight: 800; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.radar-label {
  margin-top: 2px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.3em;
  color: var(--muted);
}
.scan-status { margin-top: 12px; text-align: center; font-size: 13px; color: var(--muted); }
.dots { display: inline-flex; margin-left: 2px; }
.dots i {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--cyan); margin-left: 4px; align-self: center;
  animation: dotBlink 1.2s ease-in-out infinite;
}
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }

/* Terminal log */
.terminal {
  margin-top: 14px; height: 158px;
  overflow-y: auto;
  padding: 12px;
  border-radius: 12px;
  background: rgba(5, 6, 10, 0.55);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 11px; line-height: 1.75;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22px);
  mask-image: linear-gradient(180deg, transparent 0, #000 22px);
  scrollbar-width: none;
}
.terminal::-webkit-scrollbar { display: none; }
.log {
  color: rgba(235, 240, 250, 0.82);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  animation: logIn 0.25s ease both;
}
@keyframes logIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.log-t { color: rgba(0, 242, 254, 0.55); margin-right: 8px; }
.log-dim { color: rgba(235, 240, 250, 0.45); }
.log-ok { color: var(--green); }
.log-gold {
  color: var(--gold); font-weight: 700;
  text-shadow: 0 0 12px rgba(255, 197, 61, 0.35);
}
.log-cursor {
  display: inline-block; width: 7px; height: 12px; margin-top: 6px;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.6);
  animation: caret 1s steps(2, start) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* HIGH VALUE TIER detected — card shake (translateX only) */
.is-shaking { animation: shakeX 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
@keyframes shakeX {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

/* ---------- Step 3 · Result & CTA ---------- */
.result-inner { text-align: center; }
.badge-eligible {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 7px 14px; border-radius: 999px;
  border: 0.5px solid rgba(46, 230, 168, 0.4);
  background: rgba(46, 230, 168, 0.08);
  color: var(--green);
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.16em;
  animation: glowPulse 2.4s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(46, 230, 168, 0.18), inset 0 0 10px rgba(46, 230, 168, 0.06); }
  50%      { box-shadow: 0 0 30px rgba(46, 230, 168, 0.42), inset 0 0 16px rgba(46, 230, 168, 0.10); }
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 10px var(--green);
  animation: dotBlink 1.6s ease-in-out infinite;
}
.result-label {
  margin-top: 18px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
}
.amount {
  margin-top: 6px;
  font-size: 42px; font-weight: 800; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  filter: drop-shadow(0 6px 24px rgba(0, 242, 254, 0.25));
}
.amount-token { font-size: 18px; font-weight: 800; margin-left: 8px; letter-spacing: 0; }

.meta {
  margin-top: 20px; overflow: hidden; text-align: left;
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.meta-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; font-size: 12.5px;
}
.meta-row + .meta-row { border-top: 0.5px solid rgba(255, 255, 255, 0.07); }
.meta-row .k {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
.meta-row .v { font-weight: 700; }
.v-cyan { color: var(--cyan); }
.v-gold { color: var(--gold); }
.v-green { color: var(--green); }

.cta {
  display: flex; align-items: center; justify-content: center;
  margin-top: 20px; height: 54px; border-radius: 14px;
  background: var(--grad);
  color: #051018;
  font-size: 15px; font-weight: 800; letter-spacing: 0.08em;
  text-decoration: none;
  transition: transform 0.18s ease, filter 0.18s ease;
  animation: ctaPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  touch-action: manipulation;
}
.cta:hover { filter: brightness(1.06); }
.cta:active { transform: scale(0.97); }
@keyframes ctaPulse {
  0%   { box-shadow: 0 10px 30px rgba(0, 200, 254, 0.30), 0 0 0 0 rgba(0, 242, 254, 0.45); }
  70%  { box-shadow: 0 10px 30px rgba(0, 200, 254, 0.30), 0 0 0 16px rgba(0, 242, 254, 0); }
  100% { box-shadow: 0 10px 30px rgba(0, 200, 254, 0.30), 0 0 0 0 rgba(0, 242, 254, 0); }
}
.cta.is-loading { animation: none; opacity: 0.85; }

.urgency {
  margin-top: 14px; text-align: center;
  font-size: 12px; color: var(--muted);
}
.urgency b { color: var(--gold); font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */
.foot { margin-top: auto; padding-top: 22px; text-align: center; }
.foot p { font-size: 10.5px; line-height: 1.6; color: var(--faint); }

/* ---------- Desktop tweak ---------- */
@media (min-width: 520px) {
  .page { padding-top: 40px; }
}

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