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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #6fa3dc;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

body { position: fixed; inset: 0; }

/* Static fallback: the reference itself, shown until WebGL is ready
   (and kept if WebGL is unavailable). */
#poster {
  position: fixed;
  inset: 0;
  background: #6fa3dc url("assets/poster.jpg") center / cover no-repeat;
  animation: drift 40s ease-in-out infinite alternate;
}

#heaven {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.2s ease;
}

body.ready #heaven { opacity: 1; }

/* Heavenly white-out that dissolves on load */
#veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 20%, #fffdf6 0%, #fbf6ea 60%, #f3eee4 100%);
  transition: opacity 2.8s cubic-bezier(.2,.6,.2,1);
}

body.ready #veil,
body.fallback #veil { opacity: 0; }

/* Contract address — tiny, translucent, top centre */
#ca {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 8px 14px;
  border: 0;
  background: none;
  cursor: pointer;
  font: 400 12px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 0 2px rgba(30, 70, 130, 0.55), 0 1px 10px rgba(30, 70, 130, 0.45), 0 0 22px rgba(60, 110, 180, 0.35);
  opacity: 0;
  transition: color .4s ease, opacity 2s ease 1.6s;
  white-space: nowrap;
}
body.ready #ca, body.fallback #ca { opacity: 1; }
#ca:hover, #ca:focus-visible { color: rgba(255, 255, 255, 0.92); outline: none; }
#ca .short { display: none; }
#ca .full, #ca .short { transition: opacity .3s ease; }
#ca .copied {
  position: absolute;
  left: 50%; top: 100%;
  transform: translate(-50%, -2px);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 0 2px rgba(30, 70, 130, 0.6), 0 1px 8px rgba(30, 70, 130, 0.45);
  opacity: 0;
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}
#ca.done .copied { opacity: 1; transform: translate(-50%, 2px); }

@media (max-width: 560px) {
  #ca { font-size: 11px; }
  #ca .full { display: none; }
  #ca .short { display: inline; }
}

@keyframes drift {
  from { transform: scale(1.03) translate3d(-0.4%, 0.3%, 0); }
  to   { transform: scale(1.05) translate3d(0.4%, -0.3%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  #poster { animation: none; }
  #veil, #heaven { transition-duration: 0.3s; }
}
