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

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

:root {
  --bg-dark: #0a0a0f;
  --bg-card: rgba(20, 20, 35, 0.9);
  --violet-glow: #8b5cf6;
  --pink-glow: #ec4899;
  --cyan-glow: #22d3ee;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

.font-silkscreen {
  font-family: 'Silkscreen', cursive;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header-container {
  position: relative;
  padding: 2rem 1rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.15) 0%, transparent 100%);
}

.sparkle-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.sparkle {
  position: absolute;
  color: #fbbf24;
  font-size: 1.2rem;
  animation: sparkle 2s ease-in-out infinite;
  opacity: 0;
}

@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(180deg); }
}

.main-title {
  font-family: 'Silkscreen', cursive;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #ec4899, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 60px rgba(139, 92, 246, 0.5);
  margin-bottom: 0.5rem;
}

.tagline {
  color: #c4b5fd;
  font-size: 1rem;
  font-weight: 300;
}

.main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1rem;
}

/* Start Screen */
.start-screen {
  max-width: 500px;
  width: 100%;
}

.last-result-badge {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.3));
  border: 1px solid rgba(139, 92, 246, 0.5);
  border-radius: 9999px;
  padding: 0.75rem 1.5rem;
  text-align: center;
  color: #e9d5ff;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(139, 92, 246, 0.5); }
  50% { border-color: rgba(236, 72, 153, 0.8); }
}

.start-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.start-btn {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  border: none;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 40px rgba(139, 92, 246, 0.4);
}

.start-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 50px rgba(139, 92, 246, 0.6);
}

/* Progress Bar */
.pixel-progress-container {
  position: relative;
  height: 20px;
  background: #1a1a2e;
  border: 3px solid #2d2d4a;
  border-radius: 4px;
  overflow: hidden;
  image-rendering: pixelated;
}

.pixel-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #22d3ee, #8b5cf6, #ec4899);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.pixel-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.pixel-progress-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shine 2s infinite;
}

@keyframes shine {
  0% { left: -100%; }
  100% { left: 200%; }
}

/* Quiz Container */
.quiz-container {
  max-width: 600px;
  width: 100%;
}

/* Question Card */
.question-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.slide-in {
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-out {
  animation: slideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-50px); }
}

/* Answer Buttons */
.answer-btn {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: white;
  background: rgba(45, 45, 80, 0.8);
  border: 2px solid transparent;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.answer-btn-0 {
  border-color: rgba(34, 211, 238, 0.4);
}

.answer-btn-0:hover {
  background: rgba(34, 211, 238, 0.2);
  border-color: #22d3ee;
  transform: translateX(8px);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.3);
}

.answer-btn-1 {
  border-color: rgba(139, 92, 246, 0.4);
}

.answer-btn-1:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: #8b5cf6;
  transform: translateX(8px);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.answer-btn-2 {
  border-color: rgba(236, 72, 153, 0.4);
}

.answer-btn-2:hover {
  background: rgba(236, 72, 153, 0.2);
  border-color: #ec4899;
  transform: translateX(8px);
  box-shadow: 0 0 30px rgba(236, 72, 153, 0.3);
}

.answer-btn.selected {
  transform: scale(0.98);
  opacity: 0.7;
}

/* Result Container */
.result-container {
  max-width: 500px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-card {
  width: 100%;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: resultPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes resultPop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.result-icon {
  font-size: 4rem;
  text-align: center;
  margin-bottom: 1rem;
  animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.advice-box {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 1rem;
  padding: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Buttons */
.share-btn {
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #22d3ee, #8b5cf6);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 40px rgba(34, 211, 238, 0.4);
}

.share-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 50px rgba(34, 211, 238, 0.6);
}

.retake-btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  color: #c4b5fd;
  background: transparent;
  border: 2px solid rgba(139, 92, 246, 0.5);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.retake-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: #8b5cf6;
}

.wildcard-btn {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  color: #fbbf24;
  background: transparent;
  border: 1px dashed rgba(251, 191, 36, 0.5);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.wildcard-btn:hover {
  background: rgba(251, 191, 36, 0.1);
  border-color: #fbbf24;
}

.wildcard-reveal {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 1rem;
  padding: 1rem;
  color: #fef3c7;
  text-align: center;
  font-weight: 500;
  animation: fadeIn 0.3s ease-out;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #7c3aed;
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-link {
  color: #a78bfa;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: #c4b5fd;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
  .header-container {
    padding: 1.5rem 1rem;
  }
  
  .main-title {
    font-size: 1.5rem;
  }
  
  .question-card, .start-card, .result-card {
    padding: 1.5rem;
  }
  
  .answer-btn {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
  }
  
  .result-icon {
    font-size: 3rem;
  }
}