/* ───────────────────────────────────────────────────────────────────────────
   RainDrop — re-skinned to the official Rain brand (rain.one)
   Brand: lime #E6FF00 on near-black, Helvetica, minimal + glossy.
   Assets in /brand/ are REAL, downloaded from rain.one.
   ─────────────────────────────────────────────────────────────────────────── */
:root {
  /* Rain palette (extracted from rain.one) */
  --bg-0: #000000;
  --bg-1: #0a0a0a;
  --bg-2: #121212;
  --lime: #e6ff00;       /* primary Rain accent */
  --lime-soft: #c2df13;  /* wordmark accent */
  --lime-deep: #b9d400;
  --blue: #3498ff;       /* secondary accent */
  --blue-deep: #1675e0;
  --orange: #fe5c32;
  --ink: #f5f5f5;
  --ink-soft: #b8b8b8;
  --ink-dim: #7a7a7a;
  --line: #202020;
  --line-soft: #2a2a2a;
  --card: rgba(18, 18, 18, 0.82);
  --card-border: rgba(230, 255, 0, 0.16);
  --danger: #ff6b6b;
  --ok: #99ff80;
  --radius: 20px;
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-0);
  color: var(--ink);
  font-family: 'Helvetica Neue', Helvetica, 'Heebo', system-ui, -apple-system, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[dir="ltr"] body { font-family: 'Helvetica Neue', Helvetica, 'Plus Jakarta Sans', system-ui, Arial, sans-serif; }

/* ── Animated coin-rain canvas (background) ── */
#rain-canvas {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none;
}
.bg-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 45% at 50% -8%, rgba(230, 255, 0, 0.10), transparent 70%),
    radial-gradient(45% 35% at 12% 88%, rgba(52, 152, 255, 0.06), transparent 70%),
    radial-gradient(40% 30% at 90% 80%, rgba(230, 255, 0, 0.05), transparent 70%);
}

/* ── Top bar ── */
.topbar {
  position: fixed; top: 0; inset-inline: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  pointer-events: none;
}
.brand-wordmark { display: inline-flex; align-items: center; pointer-events: auto; }
.brand-wordmark img { height: 22px; width: auto; display: block; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6)); }

.lang-toggle {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(18, 18, 18, 0.78);
  border: 1px solid var(--line-soft);
  color: var(--ink); font-size: 14px; font-weight: 600;
  cursor: pointer; backdrop-filter: blur(10px);
  transition: transform .15s ease, border-color .2s ease;
}
.lang-toggle:active { transform: scale(0.96); }
.lang-toggle:hover { border-color: rgba(230,255,0,0.4); }
.lang-flag { font-size: 15px; }

/* ── Layout ── */
.app {
  position: relative; z-index: 10;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 78px 18px 40px;
}

.card {
  width: 100%; max-width: 440px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(115%);
  padding: 36px 26px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(230,255,0,0.05), transparent 40%);
}

/* Screens */
.screen { display: none; animation: fadeUp .45s ease both; }
.screen.is-active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Rain mark (logo) ── */
.brand-mark {
  display: flex; justify-content: center; margin-bottom: 14px;
  animation: floaty 4s ease-in-out infinite;
}
.brand-mark img {
  width: 78px; height: 78px; display: block; border-radius: 18px;
  filter: drop-shadow(0 12px 28px rgba(230, 255, 0, 0.22));
}
@keyframes floaty {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-7px); }
}

/* ── Typography ── */
.title {
  font-size: 30px; font-weight: 800; margin: 4px 0 6px; letter-spacing: -0.6px;
  color: #fff;
}
.title .accent { color: var(--lime); }
.title-sm { font-size: 22px; font-weight: 700; margin: 18px 0 6px; color: #fff; }
.subtitle { font-size: 16px; color: var(--lime); font-weight: 600; margin: 0 0 14px; }
.lede { font-size: 15px; line-height: 1.6; color: var(--ink-soft); margin: 0 auto 22px; max-width: 360px; }

/* ── Form ── */
.field-label { display: block; text-align: start; font-size: 13px; font-weight: 600;
  color: var(--ink-soft); margin: 0 4px 7px; }
#name {
  width: 100%; padding: 15px 16px; font-size: 17px;
  border-radius: 13px; border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.55); color: var(--ink);
  outline: none; transition: border .2s ease, box-shadow .2s ease;
  font-family: inherit;
}
#name::placeholder { color: var(--ink-dim); }
#name:focus { border-color: var(--lime); box-shadow: 0 0 0 4px rgba(230, 255, 0, 0.16); }

.btn-primary {
  width: 100%; margin-top: 16px; padding: 16px;
  border: none; border-radius: 13px; cursor: pointer;
  font-size: 17px; font-weight: 800; font-family: inherit; color: #0a0a00;
  background: linear-gradient(135deg, var(--lime), var(--lime-deep));
  box-shadow: 0 14px 30px rgba(230, 255, 0, 0.28);
  position: relative; transition: transform .15s ease, filter .2s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-primary:active { transform: translateY(1px) scale(0.99); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary[disabled] { filter: saturate(0.6) brightness(0.85); cursor: wait; }
.btn-coin { width: 22px; height: 22px; display: block; }

.btn-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(10, 10, 0, 0.3); border-top-color: #0a0a00;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-msg {
  margin: 14px 0 0; padding: 11px 14px; border-radius: 12px;
  background: rgba(255, 107, 107, 0.12); border: 1px solid rgba(255, 107, 107, 0.35);
  color: var(--danger); font-size: 14px; font-weight: 500;
}
.fineprint { font-size: 12.5px; color: var(--ink-dim); margin: 18px 0 0; line-height: 1.5; }

/* ── Loader ── */
.loader-rings { position: relative; width: 90px; height: 90px; margin: 16px auto 4px; }
.loader-rings span {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid transparent; border-top-color: var(--lime);
  animation: spin 1.1s linear infinite;
}
.loader-rings span:nth-child(2) { inset: 12px; border-top-color: var(--lime-soft); animation-duration: 1.5s; }
.loader-rings span:nth-child(3) { inset: 24px; border-top-color: #fff; animation-duration: 1.9s; }

/* ── Success ── */
.success-coin {
  width: 92px; height: 92px; margin: 6px auto 8px; display: block;
  filter: drop-shadow(0 14px 30px rgba(230, 255, 0, 0.35));
  animation: coinReveal .7s cubic-bezier(.2,.8,.3,1.2) both;
}
@keyframes coinReveal {
  0%   { transform: scale(0) rotate(-180deg); opacity: 0; }
  70%  { transform: scale(1.18) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.success-badge { font-size: 56px; line-height: 1; margin-bottom: 6px; animation: pop .5s ease both; }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

.reward-pill {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 6px 0 22px; padding: 11px 22px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(230, 255, 0, 0.16), rgba(230, 255, 0, 0.05));
  border: 1px solid rgba(230, 255, 0, 0.4);
}
.reward-pill .reward-coin { width: 26px; height: 26px; display: block; }
.reward-amount { font-size: 30px; font-weight: 800; color: #fff; line-height: 1; }
.reward-symbol { font-size: 15px; font-weight: 800; color: var(--lime); letter-spacing: 1px; }

.info-block {
  text-align: start; margin: 0 0 14px; padding: 14px;
  background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line-soft);
  border-radius: 13px;
}
.info-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 9px;
}
.copy-btn {
  border: 1px solid rgba(230, 255, 0, 0.3); background: rgba(230, 255, 0, 0.1);
  color: var(--lime); font-size: 12px; font-weight: 700; font-family: inherit;
  padding: 5px 12px; border-radius: 999px; cursor: pointer; transition: all .15s ease;
  white-space: nowrap;
}
.copy-btn:active { transform: scale(0.94); }
.copy-btn.copied { background: rgba(153, 255, 128, 0.18); border-color: rgba(153, 255, 128, 0.5); color: var(--ok); }

.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
#address-value { display: block; word-break: break-all; font-size: 13px; color: var(--ink); line-height: 1.5; }

/* Seed grid */
.seed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; direction: ltr; }
.seed-word {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 8px; border-radius: 10px;
  background: rgba(20, 20, 20, 0.8); border: 1px solid var(--line-soft);
  font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--ink);
}
.seed-num { color: var(--ink-dim); font-size: 11px; min-width: 14px; text-align: right; }
.seed-warn { font-size: 12px; color: #ffd27a; margin: 11px 0 0; line-height: 1.5; }

.tx-link { display: block; word-break: break-all; font-size: 12.5px; color: var(--lime); text-decoration: none; }
.tx-link:hover { text-decoration: underline; }
.warn-block { background: rgba(255, 210, 122, 0.07); border-color: rgba(255, 210, 122, 0.28); }
.warn-block p { margin: 0; font-size: 13px; color: #ffd27a; }

/* MetaMask CTA */
.btn-metamask {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 18px 0 8px; padding: 14px; border-radius: 13px;
  text-decoration: none; font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #f6851b, #e2761b);
  box-shadow: 0 10px 24px rgba(226, 118, 27, 0.3);
  transition: transform .15s ease;
}
.btn-metamask:active { transform: scale(0.98); }
.mm-fox { font-size: 20px; }

.btn-ghost {
  width: 100%; margin-top: 14px; padding: 13px;
  border: 1px solid var(--line-soft); border-radius: 13px;
  background: transparent; color: var(--ink-soft);
  font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: all .15s ease;
}
.btn-ghost:active { transform: scale(0.99); }
.btn-ghost:hover { background: rgba(230, 255, 0, 0.06); border-color: rgba(230, 255, 0, 0.3); color: var(--ink); }

/* Footer */
.footer {
  position: relative; z-index: 10; text-align: center;
  padding: 16px; color: var(--ink-dim); font-size: 13px; font-weight: 500;
  display: flex; gap: 8px; justify-content: center; align-items: center;
}
.footer .foot-coin { width: 16px; height: 16px; display: inline-block; vertical-align: middle; }
.footer .dot { opacity: 0.5; }

/* Success-screen celebratory canvas overlay */
#success-canvas {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 45; pointer-events: none;
}

@media (max-width: 380px) {
  .card { padding: 30px 18px 24px; }
  .title { font-size: 26px; }
  .seed-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark, .success-coin { animation: none !important; }
}
