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

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #fda085 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

body.dark-mode {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #1a1a2e 75%, #16213e 100%);
}

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

.app-container {
  min-height: 100vh;
  padding: 1rem;
  position: relative;
  overflow-x: hidden;
}

.dark-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 100;
  transition: transform 0.3s, background 0.3s;
}

.dark-toggle:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.3);
}

.app-header {
  text-align: center;
  padding: 2rem 1rem;
  position: relative;
  cursor: pointer;
}

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

.sparkle {
  position: absolute;
  font-size: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

.sparkle:nth-child(1) { left: 10%; top: 20%; }
.sparkle:nth-child(2) { right: 15%; top: 30%; }
.sparkle:nth-child(3) { left: 20%; bottom: 20%; }

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

.title {
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 900;
  color: white;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.main-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 1rem;
}

.quiz-section {
  animation: fadeIn 0.5s ease;
}

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

.question-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transform: translateX(100px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-card.visible {
  transform: translateX(0);
  opacity: 1;
}

.answer-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideUp 0.4s ease backwards;
}

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

.answer-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateX(10px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.answer-btn:active {
  transform: translateX(5px) scale(0.98);
}

.loading-state {
  text-align: center;
  padding: 4rem 2rem;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

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

.loading-text {
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
  animation: pulse 1.5s ease infinite;
}

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

.results-section {
  animation: fadeIn 0.5s ease;
}

.results-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

@media (min-width: 640px) {
  .results-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
}

.results-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: white;
}

.results-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.share-btn, .restart-btn {
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.share-btn {
  background: white;
  color: #764ba2;
}

.restart-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.share-btn:hover, .restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.platforms-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.platform-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 1.5rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.platform-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.platform-card.top-pick {
  background: linear-gradient(135deg, rgba(78, 205, 196, 0.3), rgba(102, 126, 234, 0.3));
  border-color: rgba(78, 205, 196, 0.5);
}

.top-badge {
  position: absolute;
  top: -1px;
  right: 20px;
  background: linear-gradient(135deg, #4ECDC4, #44A08D);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0 0 12px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.platform-icon {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.match-score {
  flex-shrink: 0;
}

.score-circle {
  width: 56px;
  height: 56px;
  position: relative;
}

.score-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-path {
  stroke-linecap: round;
  animation: drawScore 1s ease forwards;
}

@keyframes drawScore {
  from { stroke-dasharray: 0, 100; }
}

.score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.85rem;
  font-weight: 800;
  color: white;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.expanded-details {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  animation: expandIn 0.3s ease;
}

@keyframes expandIn {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 300px; }
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  color: white;
  font-weight: 600;
}

.compare-all-btn {
  width: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 0.5rem;
}

.compare-all-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-style: solid;
}

.back-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.back-btn:hover {
  opacity: 1;
}

.comparison-container {
  animation: fadeIn 0.4s ease;
}

.sort-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sort-btn {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid transparent;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
}

.sort-btn.active {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.sort-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.comparison-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comparison-row {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: center;
}

@media (min-width: 640px) {
  .comparison-row {
    grid-template-columns: 140px 1fr 60px;
  }
}

.comp-platform {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
}

.comp-bars {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bar-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  width: 36px;
  text-transform: uppercase;
}

.bar-bg {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-fill.speed { background: linear-gradient(90deg, #4ECDC4, #44A08D); }
.bar-fill.flex { background: linear-gradient(90deg, #667eea, #764ba2); }
.bar-fill.ai { background: linear-gradient(90deg, #f093fb, #f5576c); }

.comp-match {
  text-align: center;
}

.match-percent {
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
}

.app-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.app-footer a {
  color: white;
  text-decoration: none;
  font-weight: 700;
}

.app-footer a:hover {
  text-decoration: underline;
}

.footer-small {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  opacity: 0.6;
}

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  animation: confettiFall linear forwards;
}

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

.easter-egg {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  font-size: 1.25rem;
  z-index: 1000;
  animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
  0% { transform: translate(-50%, -50%) scale(0); }
  50% { transform: translate(-50%, -50%) scale(1.1); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* Dark mode overrides */
.dark-mode .platform-card {
  background: rgba(255, 255, 255, 0.08);
}

.dark-mode .platform-card.top-pick {
  background: linear-gradient(135deg, rgba(78, 205, 196, 0.2), rgba(102, 126, 234, 0.2));
}

.dark-mode .question-card {
  background: rgba(255, 255, 255, 0.08);
}

.dark-mode .answer-btn {
  background: rgba(255, 255, 255, 0.1);
}

.dark-mode .answer-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}