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

:root {
  --neon-pink: #ff006e;
  --neon-cyan: #00d4ff;
  --neon-purple: #a855f7;
  --bg-dark: #0a0a0f;
  --bg-card: rgba(20, 20, 30, 0.8);
  --glass-border: rgba(255, 255, 255, 0.1);
}

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

.app-container {
  min-height: 100vh;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(255, 0, 110, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 212, 255, 0.05) 0%, transparent 70%),
    var(--bg-dark);
  position: relative;
}

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

.floating-snippet {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: rgba(168, 85, 247, 0.2);
  animation: float-up 20s linear infinite;
  bottom: -50px;
}

@keyframes float-up {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-100vh) rotate(360deg);
    opacity: 0;
  }
}

.header {
  text-align: center;
  padding: 3rem 1rem 2rem;
  position: relative;
  z-index: 1;
}

.title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pulse-glow 2s ease-in-out infinite;
  text-shadow: 0 0 40px rgba(255, 0, 110, 0.3);
}

@keyframes pulse-glow {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.2);
  }
}

.tagline {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.5rem;
  font-weight: 300;
}

.main-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
  position: relative;
  z-index: 1;
}

.meter-container {
  cursor: pointer;
  margin-bottom: 2rem;
  transition: transform 0.2s;
}

.meter-container:hover {
  transform: scale(1.02);
}

.meter-container:active {
  transform: scale(0.98);
}

.meter-outer {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 2rem;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  box-shadow: 
    0 0 60px rgba(168, 85, 247, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.meter-inner {
  text-align: center;
}

.meter-svg {
  width: 100%;
  max-width: 300px;
  height: auto;
}

.meter-arc {
  transition: stroke-dasharray 0.5s ease-out;
}

.needle-group {
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.needle {
  filter: drop-shadow(0 0 10px currentColor);
}

.needle-center {
  filter: drop-shadow(0 0 8px currentColor);
}

.meter-value {
  font-size: 3.5rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 1rem;
  text-shadow: 0 0 30px currentColor;
  transition: color 0.3s;
}

.meter-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.level-emoji {
  font-size: 1.5rem;
}

.level-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.quiz-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.quiz-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  transition: all 0.3s;
}

.quiz-card.answered {
  opacity: 0.7;
  transform: scale(0.98);
}

.quiz-question {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

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

@media (max-width: 400px) {
  .quiz-answers {
    grid-template-columns: 1fr;
  }
}

.quiz-answer {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-answer:hover:not(:disabled) {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--neon-purple);
  transform: translateY(-2px);
}

.quiz-answer:active:not(:disabled) {
  transform: translateY(0);
}

.quiz-answer.selected {
  background: linear-gradient(135deg, rgba(255, 0, 110, 0.3), rgba(168, 85, 247, 0.3));
  border-color: var(--neon-pink);
  box-shadow: 0 0 20px rgba(255, 0, 110, 0.3);
}

.quiz-answer:disabled {
  cursor: not-allowed;
}

.results-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.share-button {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  border: none;
  border-radius: 50px;
  padding: 1rem 2rem;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 30px rgba(255, 0, 110, 0.4);
}

.share-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 40px rgba(255, 0, 110, 0.5);
}

.reset-button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  padding: 0.75rem 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.reset-button:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.help-button {
  background: rgba(255, 0, 0, 0.2);
  border: 1px solid rgba(255, 0, 0, 0.5);
  border-radius: 50px;
  padding: 0.75rem 1.5rem;
  color: #ff6b6b;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  animation: shake 0.5s infinite;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.stats-container {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  margin-bottom: 2rem;
}

.stats-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--neon-cyan);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--neon-pink);
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.25rem;
}

.achievements-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.achievements-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.achievement {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.achievement.unlocked {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.5);
}

.achievement.locked {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.5;
  filter: grayscale(1);
}

.achievement-icon {
  font-size: 1rem;
}

.achievement-name {
  font-weight: 500;
}

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

.confetti-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  border-radius: 2px;
  animation: confetti-fall 3s ease-out forwards;
}

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

.overload-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: flash 0.1s infinite;
}

@keyframes flash {
  0%, 100% { background: rgba(255, 0, 110, 0.3); }
  50% { background: rgba(168, 85, 247, 0.3); }
}

.overload-text {
  font-size: clamp(1.5rem, 6vw, 3rem);
  font-weight: 800;
  color: white;
  text-shadow: 0 0 50px var(--neon-pink);
  animation: scale-pulse 0.3s infinite;
}

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

.overload-emoji {
  font-size: 3rem;
  margin-top: 1rem;
  animation: spin 0.5s linear infinite;
}

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

.footer {
  text-align: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

.footer-link {
  color: var(--neon-pink);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}

.footer-link:hover {
  text-shadow: 0 0 20px var(--neon-pink);
}

.footer-warning {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.75rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  font-style: italic;
}