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

body {
  background: #0a0a1a;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  font-family: 'Inter', sans-serif;
  color: #fff;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

/* ===== Intro Overlay ===== */
#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 50%, #0a1a2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1s ease, visibility 1s ease;
}

#intro-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-content {
  text-align: center;
  animation: fadeInUp 1.5s ease;
}

.intro-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  background: linear-gradient(135deg, #a78bfa, #818cf8, #6366f1, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.intro-subtitle {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1rem, 2vw, 1.4rem);
  color: #a5b4fc;
  margin-bottom: 3rem;
  font-weight: 300;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

#start-btn {
  font-family: 'Space Grotesk', sans-serif;
  padding: 16px 48px;
  font-size: 1.1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
  letter-spacing: 0.5px;
}

#start-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 50px rgba(99, 102, 241, 0.6);
}

/* ===== Glass Canvas ===== */
#glass-canvas {
  position: fixed;
  inset: 0;
  z-index: 10;
  cursor: crosshair;
}

/* ===== Pioneers Layer ===== */
#pioneers-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 24px;
  padding: 60px 40px;
  background: linear-gradient(135deg, #0f0326 0%, #1a0533 30%, #0d1b3e 60%, #0a0a1a 100%);
}

.pioneer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: scale(0.8) translateY(20px);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pioneer-card.revealed {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.pioneer-card.revealed:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  transform: scale(1.05);
}

.pioneer-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5));
}

.pioneer-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 700;
  color: #e0d4ff;
  margin-bottom: 6px;
}

.pioneer-card p {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(0.8rem, 1.2vw, 1rem);
  color: #a5b4fc;
  font-weight: 400;
}

.pioneer-card .year {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #c4b5fd;
}

/* ===== Crack Instruction ===== */
#crack-instruction {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

#crack-instruction.visible {
  opacity: 1;
}

#crack-instruction span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  color: #c4b5fd;
  background: rgba(15, 3, 38, 0.8);
  padding: 12px 28px;
  border-radius: 30px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  backdrop-filter: blur(10px);
  animation: pulse 2s ease infinite;
}

/* ===== Glass Health Bar ===== */
#glass-health {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  width: 300px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#glass-health.visible {
  opacity: 1;
}

#glass-health-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa);
  border-radius: 10px;
  transition: width 0.3s ease;
}

#glass-health-text {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  color: #a5b4fc;
  white-space: nowrap;
}

/* ===== Final Message ===== */
#final-message {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  opacity: 0;
  visibility: hidden;
  transition: all 1.5s ease;
  background: radial-gradient(ellipse at center, rgba(15, 3, 38, 0.95) 0%, rgba(10, 10, 26, 0.97) 100%);
}

#final-message.visible {
  opacity: 1;
  visibility: visible;
  overflow-y: auto;
}

#final-message h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  background: linear-gradient(135deg, #e0d4ff, #a78bfa, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  animation: fadeInUp 1s ease 0.5s both;
}

#final-message h3 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 700;
  color: #c4b5fd;
  margin-bottom: 1.5rem;
  animation: fadeInUp 1s ease 1s both;
}

.final-sub {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(0.9rem, 1.5vw, 1.15rem);
  color: #94a3b8;
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 3rem;
  animation: fadeInUp 1s ease 1.5s both;
}

.stats-row {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInUp 1s ease 2s both;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 30px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(139, 92, 246, 0.2);
  min-width: 180px;
}

.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: #a78bfa;
}

.stat-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 6px;
  text-align: center;
}

/* ===== Final Pioneers Row ===== */
.final-pioneers {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 2.5rem;
  animation: fadeInUp 1s ease 1.8s both;
}

.final-pioneer {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  color: #c4b5fd;
  padding: 8px 18px;
  border-radius: 30px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.final-pioneer span {
  margin-right: 4px;
}

/* ===== Restart Button ===== */
#restart-btn {
  margin-top: 2rem;
  font-family: 'Space Grotesk', sans-serif;
  padding: 12px 36px;
  font-size: 0.95rem;
  font-weight: 600;
  background: transparent;
  color: #a5b4fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: fadeInUp 1s ease 2.5s both;
}

#restart-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.5);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  #pioneers-layer {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 40px 20px;
    gap: 16px;
  }

  .stats-row {
    gap: 16px;
  }

  .stat {
    min-width: 140px;
    padding: 16px 20px;
  }
}

@media (max-width: 480px) {
  #pioneers-layer {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    gap: 12px;
  }
}
