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

body {
  font-family: 'Space Grotesk', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease;
}

body.light-mode {
  --bg-primary: #f8f5f2;
  --bg-secondary: rgba(255, 255, 255, 0.9);
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
}

.app-container {
  min-height: 100vh;
  position: relative;
  color: #ffffff;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.app-container.dark {
  --bg-primary: #0d0d1a;
  --bg-secondary: rgba(30, 30, 50, 0.8);
  --text-primary: #ffffff;
  --text-secondary: #a0a0c0;
}

.app-container.light {
  color: #1a1a2e;
}

.gradient-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1f3d 25%, #3d2a4d 50%, #4a3555 75%, #5a4060 100%);
  z-index: -2;
}

.app-container.light .gradient-bg {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 50%, #ee9ca7 100%);
}

.gradient-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(255, 107, 157, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(0, 212, 170, 0.1) 0%, transparent 40%);
  animation: pulse 8s ease-in-out infinite alternate;
}

@keyframes pulse {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 20px;
  z-index: 100;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Start Screen */
.start-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-section {
  text-align: center;
  position: relative;
  padding: 40px 20px;
}

.hero-title {
  margin-bottom: 20px;
}

.title-main {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  display: block;
  animation: slideUp 0.8s ease-out;
}

.title-accent {
  font-size: clamp(2.8rem, 9vw, 4.5rem);
  font-weight: 700;
  background: linear-gradient(135deg, #FF6B9D, #00D4AA, #D97757);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: slideUp 0.8s ease-out 0.2s backwards, gradient 4s ease infinite;
}

@keyframes gradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

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

.hero-subtitle {
  font-size: clamp(1rem, 3vw, 1.3rem);
  opacity: 0.8;
  margin-bottom: 40px;
  animation: slideUp 0.8s ease-out 0.4s backwards;
}

.floating-icons {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: hidden;
}

.float-icon {
  position: absolute;
  font-size: 2rem;
  opacity: 0.6;
  animation: float 6s ease-in-out infinite;
}

.icon-1 { top: 10%; left: 10%; animation-delay: 0s; }
.icon-2 { top: 15%; right: 15%; animation-delay: 1.5s; }
.icon-3 { bottom: 20%; left: 15%; animation-delay: 3s; }
.icon-4 { bottom: 15%; right: 10%; animation-delay: 4.5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 40px;
  font-size: 1.2rem;
  font-weight: 600;
  font-family: inherit;
  color: white;
  background: linear-gradient(135deg, #FF6B9D, #D97757);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: slideUp 0.8s ease-out 0.6s backwards;
  box-shadow: 0 10px 30px rgba(255, 107, 157, 0.3);
}

.start-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(255, 107, 157, 0.4);
}

.btn-arrow {
  transition: transform 0.3s ease;
}

.start-btn:hover .btn-arrow {
  transform: translateX(5px);
}

/* Quiz Screen */
.quiz-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  padding-top: 40px;
}

.progress-container {
  margin-bottom: 30px;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.progress-label {
  font-weight: 600;
}

.progress-percent {
  font-family: 'JetBrains Mono', monospace;
  color: #00D4AA;
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF6B9D, #00D4AA);
  border-radius: 10px;
  transition: width 0.5s ease;
}

.question-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 40px 30px;
  text-align: center;
  transition: all 0.3s ease;
}

.question-card.entering {
  animation: cardEnter 0.4s ease-out;
}

.question-card.exiting {
  animation: cardExit 0.3s ease-in forwards;
}

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

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

.question-emoji {
  font-size: 3rem;
  margin-bottom: 20px;
  animation: bounce 2s ease-in-out infinite;
}

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

.question-text {
  font-size: clamp(1.3rem, 4vw, 1.6rem);
  font-weight: 600;
  margin-bottom: 30px;
  line-height: 1.4;
}

.answers-grid {
  display: grid;
  gap: 12px;
}

.answer-btn {
  padding: 16px 24px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 500;
  color: inherit;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.answer-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 107, 157, 0.5);
  transform: translateX(5px);
}

.answer-btn.selected {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.3), rgba(0, 212, 170, 0.3));
  border-color: #FF6B9D;
  transform: scale(0.98);
}

/* Loading Screen */
.loading-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #FF6B9D;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.1rem;
  font-family: 'JetBrains Mono', monospace;
  opacity: 0.8;
  animation: fadeInOut 0.8s ease-in-out;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Results Screen */
.results-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.result-reveal {
  text-align: center;
  animation: revealPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes revealPop {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.result-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin: 0 auto 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: avatarGlow 2s ease-in-out infinite alternate;
}

@keyframes avatarGlow {
  0% { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); }
  100% { box-shadow: 0 10px 60px rgba(255, 107, 157, 0.4); }
}

.result-title {
  font-size: 1.2rem;
  opacity: 0.8;
  margin-bottom: 8px;
}

.result-name {
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.result-tagline {
  font-size: 1.1rem;
  opacity: 0.7;
  margin-bottom: 20px;
}

.compat-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.2), rgba(0, 212, 170, 0.2));
  border: 2px solid rgba(255, 107, 157, 0.5);
  border-radius: 20px;
  padding: 15px 30px;
  margin-bottom: 25px;
}

.compat-percent {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  background: linear-gradient(135deg, #FF6B9D, #00D4AA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.compat-label {
  font-size: 0.9rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.result-description {
  font-size: 1.1rem;
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 25px;
  text-align: center;
}

.traits-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 35px;
}

.trait-badge {
  padding: 8px 16px;
  border: 2px solid;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.comparison-section,
.radar-section {
  width: 100%;
  margin-bottom: 30px;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}

.comparison-grid {
  display: grid;
  gap: 12px;
}

.comparison-card {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  border-radius: 16px;
  transition: all 0.3s ease;
}

.comparison-card.winner {
  background: rgba(255, 255, 255, 0.1);
}

.comp-avatar {
  font-size: 1.8rem;
}

.comp-name {
  font-weight: 600;
}

.comp-bar {
  height: 8px;
  border-radius: 10px;
  grid-column: 2;
}

.comp-percent {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.radar-chart {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  display: block;
}

.radar-polygon {
  transition: all 0.3s ease;
}

.radar-label {
  font-family: 'JetBrains Mono', monospace;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 300px;
}

.share-btn,
.retake-btn {
  padding: 16px 30px;
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
}

.share-btn {
  background: linear-gradient(135deg, #1DA1F2, #0077B5);
  color: white;
  border: none;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(29, 161, 242, 0.3);
}

.retake-btn {
  background: transparent;
  color: inherit;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.retake-btn:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 30px 20px;
  font-size: 0.9rem;
  opacity: 0.7;
}

.app-footer a {
  color: #FF6B9D;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.app-footer a:hover {
  opacity: 0.8;
}

.easter-egg-trigger {
  cursor: pointer;
  transition: transform 0.3s ease;
  display: inline-block;
}

.easter-egg-trigger:hover {
  transform: scale(1.2);
}

.easter-egg-text {
  margin-top: 10px;
  font-style: italic;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Light mode overrides */
.app-container.light .question-card,
.app-container.light .comparison-card {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.1);
}

.app-container.light .answer-btn {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.15);
}

.app-container.light .answer-btn:hover {
  background: rgba(255, 255, 255, 0.95);
}

.app-container.light .progress-bar {
  background: rgba(0, 0, 0, 0.1);
}

.app-container.light .retake-btn {
  border-color: rgba(0, 0, 0, 0.2);
}

@media (max-width: 480px) {
  .app-container {
    padding: 15px;
  }
  
  .question-card {
    padding: 30px 20px;
  }
  
  .answer-btn {
    padding: 14px 18px;
  }
  
  .result-avatar {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
  }
  
  .comparison-card {
    grid-template-columns: 35px 1fr auto;
    padding: 12px;
  }
}