@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800;900&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --bg-dark: #090712;
  --primary-coral: #EF6B56;
  --primary-orange: #E89D52;
  --primary-lime: #C5D035;
  --discord-purple: #5865F2;
  --discord-hover: #4752C4;
  --text-white: #ffffff;
  --text-muted: #cbd5e1;
  --font-main: 'Outfit', sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-main);
  color: var(--text-white);
}

/* Background Canvas */
#space-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Main Viewport Container */
.viewport-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 2;
  overflow: hidden;
}

/* Header Branding */
.brand-header {
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 10;
  opacity: 0.9;
  transition: opacity 0.5s ease;
}

.brand-header h1 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-lime) 45%, var(--primary-coral) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 25px rgba(239, 107, 86, 0.4);
}

/* Flying Cryptonica Logo Element */
.cryptonica-flyer {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  width: clamp(90px, 12vw, 150px);
  height: clamp(90px, 12vw, 150px);
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  filter: drop-shadow(0 0 30px rgba(239, 107, 86, 0.65));
  will-change: transform, left, top;
}

.cryptonica-flyer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Discord Target Element on Right Side */
.discord-target {
  position: absolute;
  top: 50%;
  right: 10%;
  transform: translateY(-50%) translateX(120px);
  opacity: 0;
  pointer-events: none;
  width: clamp(90px, 12vw, 150px);
  height: clamp(90px, 12vw, 150px);
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(88, 101, 242, 0.12);
  border: 2px dashed rgba(197, 208, 53, 0.6);
  box-shadow: 0 0 40px rgba(88, 101, 242, 0.25), inset 0 0 20px rgba(239, 107, 86, 0.2);
  animation: targetPulse 2.5s infinite ease-in-out;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.discord-target.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0px);
}

.discord-target:hover {
  transform: translateY(-50%) scale(1.08);
  border-color: rgba(197, 208, 53, 0.95);
  box-shadow: 0 0 60px rgba(239, 107, 86, 0.6), inset 0 0 30px rgba(88, 101, 242, 0.4);
}

.discord-target-icon {
  width: 55%;
  height: 55%;
  filter: drop-shadow(0 0 15px rgba(88, 101, 242, 0.8));
}

.target-ping {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(197, 208, 53, 0.8);
  animation: pingRing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes targetPulse {
  0%, 100% { transform: translateY(-50%) scale(1); box-shadow: 0 0 30px rgba(88, 101, 242, 0.3); }
  50% { transform: translateY(-50%) scale(1.04); box-shadow: 0 0 50px rgba(239, 107, 86, 0.5); }
}

@keyframes pingRing {
  75%, 100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Explosion Layer */
#impact-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 25;
  pointer-events: none;
}

/* Post Collision CTA Hero Card */
.post-collision-cta {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  visibility: hidden;
  z-index: 30;
  width: min(90%, 540px);
  padding: 3rem 2.5rem;
  background: rgba(12, 10, 22, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 28px;
  border: 1px solid rgba(239, 107, 86, 0.3);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85), 
              0 0 60px rgba(239, 107, 86, 0.25),
              inset 0 0 30px rgba(197, 208, 53, 0.15);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease, visibility 0.6s ease;
}

.post-collision-cta.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.cta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.2rem;
  border-radius: 99px;
  background: rgba(239, 107, 86, 0.15);
  border: 1px solid rgba(239, 107, 86, 0.5);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-lime);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cta-logo-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
}

.cta-logo-glow {
  position: absolute;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle, rgba(239, 107, 86, 0.6) 0%, rgba(197, 208, 53, 0.3) 50%, rgba(0,0,0,0) 70%);
  border-radius: 50%;
  filter: blur(16px);
  animation: ctaGlowPulse 3s ease-in-out infinite alternate;
}

@keyframes ctaGlowPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.25); opacity: 1; }
}

.cta-cryptonica-icon {
  width: 110px;
  height: 110px;
  z-index: 2;
  object-fit: contain;
  margin-left: -12px;
  filter: drop-shadow(0 0 25px rgba(239, 107, 86, 0.85));
  animation: ctaFloat 4s ease-in-out infinite alternate;
}

@keyframes ctaFloat {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-8px); }
}

.cta-title {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-lime) 50%, var(--primary-coral) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 0.25rem;
}

.cta-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 420px;
}

/* Discord CTA Join Button */
.discord-join-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
  padding: 1.15rem 2rem;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--discord-purple) 0%, #404EED 100%);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  box-shadow: 0 12px 35px rgba(88, 101, 242, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.discord-join-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.75s ease;
}

.discord-join-btn:hover::before {
  left: 100%;
}

.discord-join-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 45px rgba(88, 101, 242, 0.75), 0 0 25px rgba(239, 107, 86, 0.5);
  background: linear-gradient(135deg, #4752C4 0%, #5865F2 100%);
}

.discord-join-btn:active {
  transform: translateY(-1px) scale(0.99);
}

.btn-icon {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.fade-out {
  opacity: 0 !important;
  transform: scale(0.8) translateY(-50%) !important;
  pointer-events: none !important;
  transition: opacity 0.6s ease, transform 0.6s ease !important;
}

@media (max-width: 640px) {
  .post-collision-cta {
    padding: 2.25rem 1.5rem;
  }
  .cta-title {
    font-size: 1.6rem;
  }
  .discord-join-btn {
    padding: 1rem 1.5rem;
    font-size: 1.05rem;
  }
}
