/* Math Arena Styles */
body {
  background: url('../assets/bg1.jpg') center/cover fixed;
}
body::after {
  content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(26,26,46,0.85); z-index: -1;
}

.game-container {
  max-width: 600px; margin: 0 auto; padding: 60px 16px 20px;
  min-height: 100vh;
}

/* Menu screen */
.menu-screen { text-align: center; padding-top: 40px; }
.menu-screen h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  background: linear-gradient(180deg, var(--poke-yellow), var(--poke-red));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.menu-screen .menu-pokemon { font-size: 5rem; margin: 20px 0; }
.difficulty-btns { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.topic-select { margin: 20px 0; }
.topic-select label { display: block; margin-bottom: 8px; color: var(--poke-yellow); font-weight: 700; }
.topic-select select {
  width: 100%; padding: 12px; border-radius: 12px;
  background: #2a2a4a; color: white; border: 2px solid var(--poke-yellow);
  font-family: 'Nunito'; font-size: 1rem;
}

/* Battle screen */
.battle-screen { display: none; }
.battle-field {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 20px; gap: 10px;
}
.pokemon-panel {
  flex: 1; text-align: center;
}
.pokemon-sprite {
  font-size: 4rem; margin: 8px 0;
  transition: all 0.3s;
}
.pokemon-sprite.hit { animation: shake 0.4s; filter: brightness(2); }
.pokemon-sprite.attack { animation: attackAnim 0.4s; }
@keyframes attackAnim {
  0% { transform: translateX(0); }
  30% { transform: translateX(30px) scale(1.2); }
  100% { transform: translateX(0); }
}
@keyframes attackAnimEnemy {
  0% { transform: translateX(0); }
  30% { transform: translateX(-30px) scale(1.2); }
  100% { transform: translateX(0); }
}
.pokemon-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem; color: var(--poke-yellow); margin-bottom: 6px;
}
.hp-text { font-size: 0.75rem; color: #aaa; margin-top: 4px; }
.vs-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.5rem; color: var(--poke-red);
  align-self: center; animation: glow 1.5s infinite;
}

/* Question area */
.question-area {
  background: linear-gradient(145deg, #2a2a4a, #1e1e3a);
  border: 3px solid var(--poke-yellow);
  border-radius: 16px; padding: 20px; margin: 16px 0;
  text-align: center;
}
.question-label {
  font-size: 0.8rem; color: var(--poke-yellow);
  font-family: 'Press Start 2P', monospace; margin-bottom: 8px;
}
.question-text {
  font-size: clamp(1.2rem, 5vw, 1.8rem);
  font-weight: 900; margin: 10px 0;
}
.answer-input {
  width: 100%; max-width: 200px; padding: 12px;
  font-size: 1.5rem; text-align: center;
  background: #1a1a2e; color: white;
  border: 3px solid var(--poke-blue); border-radius: 12px;
  font-family: 'Nunito'; font-weight: 900;
  outline: none;
}
.answer-input:focus { border-color: var(--poke-yellow); box-shadow: 0 0 15px rgba(255,203,5,0.3); }

.answer-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px;
}
.answer-option {
  padding: 14px; border-radius: 12px; font-size: 1.2rem; font-weight: 900;
  background: #2a2a4a; border: 3px solid var(--poke-blue);
  color: white; cursor: pointer; transition: all 0.2s;
  font-family: 'Nunito';
}
.answer-option:hover { border-color: var(--poke-yellow); transform: scale(1.05); }
.answer-option.correct { background: var(--poke-green); border-color: #fff; }
.answer-option.wrong { background: var(--poke-red); border-color: #fff; }

/* Stats bar */
.stats-bar {
  display: flex; justify-content: space-around;
  background: rgba(0,0,0,0.3); border-radius: 12px;
  padding: 10px; margin-bottom: 16px;
  font-family: 'Press Start 2P', monospace; font-size: 0.6rem;
}
.stat-item { text-align: center; }
.stat-value { color: var(--poke-yellow); font-size: 0.9rem; margin-top: 4px; }

/* Feedback */
.feedback {
  text-align: center; padding: 10px; border-radius: 10px;
  font-weight: 900; font-size: 1.1rem; margin: 8px 0;
  min-height: 44px; display: flex; align-items: center; justify-content: center;
}
.feedback.correct { background: rgba(76,175,80,0.2); color: #8BC34A; }
.feedback.wrong { background: rgba(227,53,13,0.2); color: #FF5722; }

/* Catch screen */
.catch-screen {
  display: none; text-align: center; padding-top: 40px;
}

.catch-pokemon {
  font-size: 6rem;
  margin: 20px 0;
  animation: bounce 1s infinite;
  filter: drop-shadow(4px 4px 8px rgba(0,0,0,0.7));
}

.catch-screen h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.2rem;
  color: var(--poke-yellow);
  margin-bottom: 10px;
}

.pokeball-select {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.pokeball-option {
  padding: 16px 12px;
  font-size: 0.85rem;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.catch-feedback {
  min-height: 80px;
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff;
  padding: 16px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Result screen */
.result-screen {
  display: none; text-align: center; padding-top: 60px;
}
.result-screen h2 {
  font-family: 'Press Start 2P', monospace; font-size: 1.5rem;
  color: var(--poke-yellow); margin-bottom: 20px;
}
.result-screen .result-pokemon { font-size: 5rem; margin: 20px 0; }
.result-stats { margin: 20px 0; }
.result-stats p { font-size: 1.1rem; margin: 8px 0; color: #ccc; }
.result-stats .highlight { color: var(--poke-yellow); font-weight: 900; font-size: 1.5rem; }

/* Level up animation */
.level-up-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.8); z-index: 200;
  flex-direction: column; align-items: center; justify-content: center;
}
.level-up-overlay.show { display: flex; }
.level-up-text {
  font-family: 'Press Start 2P', monospace; font-size: 2rem;
  color: var(--poke-yellow); animation: bounce 0.5s ease infinite;
}
