:root {
  --bg: #0a0015;
  --primary: #8a4fff;
  --text: #fff;
  --secondary: rgba(31, 27, 46, 0.9);
  --success: #4caf50;
  --error: #f44336;
  --warning: #ff9800;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: radial-gradient(ellipse at center, #1a0033 0%, #0a0015 70%, #000000 100%);
  color: var(--text);
  overflow-x: hidden;
  position: relative;
}

/* Fundo de Estrelas */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(ellipse at center, 
    rgba(26, 0, 51, 0.8) 0%, 
    rgba(10, 0, 21, 0.9) 40%,
    rgba(0, 0, 0, 1) 100%);
}

#starCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Adiciona brilho nas bordas para efeito galáctico */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(138, 79, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(76, 175, 80, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(244, 67, 54, 0.06) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: rgba(31, 27, 46, 0.8);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(138, 79, 255, 0.2);
  border-bottom: 1px solid rgba(138, 79, 255, 0.1);
}

.logo {
  font-weight: bold;
  font-size: 1.8rem;
  color: var(--primary);
  text-shadow: 0 0 20px var(--primary);
  animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
  from { text-shadow: 0 0 20px var(--primary); }
  to { text-shadow: 0 0 30px var(--primary), 0 0 40px rgba(138, 79, 255, 0.5); }
}

.btn-secondary {
  background: rgba(138, 79, 255, 0.1);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: var(--primary);
  color: var(--bg);
  box-shadow: 0 0 20px rgba(138, 79, 255, 0.5);
  transform: translateY(-2px);
}

.btn-secondary.ready {
  background: rgba(76, 175, 80, 0.2);
  border-color: var(--success);
  color: var(--success);
  animation: pulse 2s infinite;
}

.btn-secondary.ready:hover {
  background: var(--success);
  color: white;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.main {
  padding: 2rem;
  max-width: 1000px;
  margin: auto;
  position: relative;
  z-index: 1;
}

.intro h1 {
  font-size: 2.4rem;
  color: var(--primary);
  text-shadow: 0 0 20px var(--primary);
  margin-bottom: 0.5rem;
  animation: titleGlow 4s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  from { text-shadow: 0 0 20px var(--primary); }
  to { text-shadow: 0 0 30px var(--primary), 0 0 50px rgba(138, 79, 255, 0.3); }
}

.intro p {
  max-width: 600px;
  color: #bbb;
  font-size: 1.1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.quiz {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.question {
  background: rgba(31, 27, 46, 0.8);
  backdrop-filter: blur(15px);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(138, 79, 255, 0.1);
  transition: transform 0.3s ease, background-color 0.3s ease;
  position: relative;
  border: 1px solid rgba(138, 79, 255, 0.1);
}

.question:hover:not(.completed) {
  transform: scale(1.02) translateY(-5px);
  box-shadow: 0 15px 40px rgba(138, 79, 255, 0.2);
  border-color: rgba(138, 79, 255, 0.3);
}

.question.completed {
  background: rgba(76, 175, 80, 0.1);
  border: 2px solid rgba(76, 175, 80, 0.5);
  backdrop-filter: blur(15px);
}

.question.completed::before {
  content: "✓ COMPLETADO";
  position: absolute;
  top: -10px;
  right: 10px;
  background: var(--success);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

.question.completed p {
  color: #a8d4a8;
}

.button-container {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
}

button.acertou,
button.errou {
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

button.acertou {
  background-color: var(--success);
  color: white;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

button.errou {
  background-color: var(--error);
  color: white;
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

button.acertou:disabled,
button.errou:disabled {
  background-color: rgba(51, 51, 51, 0.5);
  color: #666;
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

button.acertou:hover:not(:disabled),
button.errou:hover:not(:disabled) {
  transform: scale(1.05) translateY(-2px);
}

button.acertou:hover:not(:disabled) {
  box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

button.errou:hover:not(:disabled) {
  box-shadow: 0 8px 25px rgba(244, 67, 54, 0.4);
}

.grafico {
  margin-top: 3rem;
  background: rgba(31, 27, 46, 0.8);
  backdrop-filter: blur(15px);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(138, 79, 255, 0.1);
  border: 1px solid rgba(138, 79, 255, 0.1);
}

.ranking-erros {
  margin-top: 3rem;
  background: rgba(31, 27, 46, 0.8);
  backdrop-filter: blur(15px);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(244, 67, 54, 0.1);
  border-left: 4px solid var(--error);
  border: 1px solid rgba(244, 67, 54, 0.2);
}

.ranking-erros h2 {
  margin-top: 0;
  color: var(--error);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-shadow: 0 0 15px rgba(244, 67, 54, 0.5);
}

.ranking-description {
  color: #bbb;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.ranking-empty {
  text-align: center;
  padding: 2rem;
  color: #888;
}

.ranking-empty i {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1rem;
  display: block;
  text-shadow: 0 0 20px var(--primary);
  animation: float 3s ease-in-out infinite;
}

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

.ranking-empty p {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(244, 67, 54, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  border-left: 4px solid transparent;
  transition: all 0.3s ease;
  border: 1px solid rgba(244, 67, 54, 0.1);
}

.ranking-item:hover {
  transform: translateX(5px) translateY(-2px);
  background: rgba(244, 67, 54, 0.1);
  box-shadow: 0 8px 25px rgba(244, 67, 54, 0.2);
}

.ranking-position {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  margin-right: 1rem;
  font-weight: bold;
}

.ranking-position i {
  font-size: 1.5rem;
  margin-bottom: 0.2rem;
}

.ranking-content {
  flex: 1;
}

.ranking-nivel {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: bold;
  margin-bottom: 0.3rem;
}

.ranking-pergunta {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.ranking-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
}

.ranking-erros {
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-weight: bold;
}

.ranking-erros.alta {
  background: var(--error);
  color: white;
  box-shadow: 0 0 15px rgba(244, 67, 54, 0.5);
}

.ranking-erros.media {
  background: var(--warning);
  color: white;
  box-shadow: 0 0 15px rgba(255, 152, 0, 0.5);
}

.ranking-erros.baixa {
  background: rgba(138, 79, 255, 0.2);
  color: var(--primary);
  box-shadow: 0 0 15px rgba(138, 79, 255, 0.3);
}

.ranking-data {
  color: #888;
}

.ranking-prioridade {
  font-size: 1.5rem;
  margin-left: 1rem;
}

.ranking-prioridade.alta {
  animation: pulse-fire 2s infinite;
}

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

@media (max-width: 768px) {
  .ranking-item {
    flex-direction: column;
    text-align: center;
  }
  
  .ranking-position {
    margin-bottom: 0.5rem;
    margin-right: 0;
  }
  
  .ranking-stats {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .ranking-prioridade {
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

.historico {
  margin-top: 3rem;
  background: rgba(31, 27, 46, 0.8);
  backdrop-filter: blur(15px);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(138, 79, 255, 0.1);
  border: 1px solid rgba(138, 79, 255, 0.1);
}

.historico h2 {
  margin-top: 0;
  color: var(--primary);
  text-shadow: 0 0 15px rgba(138, 79, 255, 0.5);
}

.historico ul {
  list-style: none;
  padding: 0;
  max-height: 300px;
  overflow-y: auto;
}

.historico li {
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(51, 51, 51, 0.5);
  color: #ccc;
  background: rgba(138, 79, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  transition: all 0.3s ease;
  border: 1px solid rgba(138, 79, 255, 0.1);
}

.historico li:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(138, 79, 255, 0.2);
}

.historico li:last-child {
  border-bottom: none;
}

.footer {
  text-align: center;
  padding: 1.5rem;
  background: rgba(17, 17, 17, 0.9);
  backdrop-filter: blur(15px);
  margin-top: 4rem;
  color: #aaa;
  border-top: 1px solid rgba(138, 79, 255, 0.2);
  position: relative;
  z-index: 1;
}

.footer .socials {
  margin-top: 0.5rem;
}

.footer a {
  color: var(--primary);
  margin: 0 0.8rem;
  font-size: 1.4rem;
  transition: all 0.3s ease;
}

.footer a:hover {
  color: var(--text);
  text-shadow: 0 0 15px var(--primary);
  transform: translateY(-2px);
}