/* Estilos gerais */
:root {
  --primary-color: #3498db;
  --secondary-color: #e74c3c;
  --accent-color: #f1c40f;
  --dark-color: #2c3e50;
  --light-color: #ecf0f1;
  --success-color: #2ecc71;
  --error-color: #e74c3c;
  --font-main: 'Nunito', sans-serif;
  --font-title: 'Bangers', cursive;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--light-color);
  background-image: url('../img/math-bg.png');
  background-size: cover;
  color: var(--dark-color);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Estilos de texto */
h1, h2, h3 {
  font-family: var(--font-title);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
}

h1 {
  font-size: 3.5rem;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 20px;
}

h2 {
  font-size: 2.5rem;
  color: var(--secondary-color);
  margin-bottom: 15px;
}

h3 {
  font-size: 1.8rem;
  color: var(--dark-color);
  margin-bottom: 10px;
}

p {
  margin-bottom: 15px;
  font-size: 1.1rem;
}

/* Botões */
.btn {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: var(--font-title);
  font-size: 1.2rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
  text-decoration: none;
  text-align: center;
  margin: 10px;
  min-width: 150px;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background-color: var(--primary-color);
}

.btn-secondary {
  background-color: var(--secondary-color);
}

.btn-accent {
  background-color: var(--accent-color);
  color: var(--dark-color);
}

.btn-large {
  padding: 15px 30px;
  font-size: 1.5rem;
}

.btn-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Telas do jogo */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 20px;
  animation: fadeIn 0.5s ease;
}

.screen.active {
  display: flex;
}

/* Tela inicial */
#start-screen {
  text-align: center;
}

.game-title {
  font-size: 4rem;
  color: var(--primary-color);
  text-shadow: 3px 3px 0 var(--secondary-color), 
               6px 6px 0 rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  animation: pulse 2s infinite;
}

.game-description {
  max-width: 600px;
  margin: 0 auto 30px;
  font-size: 1.2rem;
}

/* Seleção de herói */
#hero-selection-screen {
  text-align: center;
}

.heroes-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 30px 0;
}

.hero-card {
  width: 220px;
  background-color: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.hero-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.hero-card.selected {
  border: 4px solid var(--accent-color);
  transform: translateY(-10px) scale(1.05);
}

.hero-image {
  width: 150px;
  height: 150px;
  margin: 0 auto 15px;
  border-radius: 50%;
  background-color: var(--light-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--primary-color);
}

.hero-name {
  font-family: var(--font-title);
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--dark-color);
}

.hero-power {
  font-size: 0.9rem;
  color: var(--secondary-color);
  font-style: italic;
}

/* Tela de jogo */
#game-screen {
  width: 100%;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.hero-info {
  display: flex;
  align-items: center;
}

.hero-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--primary-color);
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
}

.hero-stats {
  display: flex;
  flex-direction: column;
}

.score-container {
  display: flex;
  align-items: center;
  font-family: var(--font-title);
  font-size: 1.5rem;
}

.score-value {
  color: var(--accent-color);
  margin-left: 10px;
}

.level-indicator {
  background-color: var(--primary-color);
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-weight: bold;
}

.question-container {
  background-color: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.question-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 10px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.question-context {
  font-style: italic;
  color: var(--secondary-color);
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.question-text {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 25px;
}

.options-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.option {
  background-color: var(--light-color);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.option:hover {
  background-color: rgba(52, 152, 219, 0.1);
  transform: translateY(-3px);
}

.option.selected {
  background-color: var(--primary-color);
  color: white;
}

.option.correct {
  background-color: var(--success-color);
  color: white;
  border-color: var(--success-color);
}

.option.incorrect {
  background-color: var(--error-color);
  color: white;
  border-color: var(--error-color);
}

.feedback-container {
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
  display: none;
}

.feedback-container.visible {
  display: block;
  animation: slideUp 0.5s ease;
}

.feedback-title {
  font-family: var(--font-title);
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.feedback-title.correct {
  color: var(--success-color);
}

.feedback-title.incorrect {
  color: var(--error-color);
}

.feedback-explanation {
  font-size: 1.1rem;
  margin-bottom: 15px;
}

.action-buttons {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* Tela de resultado */
#result-screen {
  text-align: center;
}

.result-title {
  font-size: 3rem;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.final-score {
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 30px;
  font-family: var(--font-title);
}

.result-message {
  font-size: 1.3rem;
  max-width: 600px;
  margin: 0 auto 30px;
}

.medals-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.medal {
  width: 100px;
  height: 100px;
  background-color: var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--dark-color);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  opacity: 0.3;
  transition: all 0.3s ease;
}

.medal.earned {
  opacity: 1;
  animation: bounce 0.5s ease;
}

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

/* Efeitos especiais */
.power-effect {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  display: none;
}

.power-effect.active {
  display: block;
}

.math-symbol {
  position: absolute;
  font-size: 2rem;
  color: var(--accent-color);
  animation: floatSymbol 3s linear forwards;
  text-shadow: 0 0 10px rgba(241, 196, 15, 0.7);
}

@keyframes floatSymbol {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--x, 100px), var(--y, -100px)) rotate(var(--r, 360deg));
  }
}

/* Responsividade */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  .game-title {
    font-size: 3rem;
  }
  
  .heroes-container {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-card {
    width: 80%;
    max-width: 280px;
  }
  
  .game-header {
    flex-direction: column;
    gap: 10px;
  }
  
  .options-container {
    grid-template-columns: 1fr;
  }
  
  .btn {
    width: 100%;
    margin: 5px 0;
  }
  
  .action-buttons {
    flex-direction: column;
  }
}

/* Acessibilidade */
.btn:focus, .option:focus, .hero-card:focus {
  outline: 3px solid var(--accent-color);
  outline-offset: 3px;
}

/* Efeitos de transição entre telas */
.screen-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.screen-transition.active {
  opacity: 1;
  pointer-events: all;
}

.screen-transition-content {
  font-family: var(--font-title);
  font-size: 3rem;
  color: white;
  text-align: center;
}
