/* ===== Global Styles ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
    'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(135deg, #e8dcc8 0%, #d4c4a8 50%, #c9b8a0 100%);
  min-height: 100vh;
}

#app {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* ===== Start Screen ===== */
.start-screen {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.start-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 40px;
  max-width: 500px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-title {
  font-size: 48px;
  text-align: center;
  margin: 0 0 10px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.game-subtitle {
  text-align: center;
  color: #666;
  font-size: 18px;
  margin: 0 0 30px 0;
}

.start-info {
  background: #f5f5f5;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
}

.start-info h2 {
  margin: 0 0 15px 0;
  font-size: 18px;
  color: #333;
}

.start-info ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.start-info li {
  padding: 8px 0;
  color: #555;
  line-height: 1.6;
}

.start-info li:before {
  content: "✓ ";
  color: #667eea;
  font-weight: bold;
  margin-right: 8px;
}

.start-button {
  width: 100%;
  padding: 15px;
  font-size: 18px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.start-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.start-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ===== Battle Screen ===== */
.battle {
  background: rgba(245, 240, 233, 0.98);
  border-radius: 15px;
  padding: 30px;
  max-width: 1000px;
  width: 100%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  border: 2px solid #d9cdb5;
}

/* ===== Battle Arena ===== */
.battle-arena {
  background: linear-gradient(180deg, #e8dcc8 0%, #d9cdb5 50%, #cdbfa3 100%);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15), inset 0 2px 0 rgba(255,255,255,0.5);
  border: 3px solid #a89880;
}

.arena-header {
  text-align: center;
  margin-bottom: 30px;
}

.arena-header h2 {
  margin: 0;
  color: #6b5d50;
  font-size: 24px;
}

.battle-field {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 30px;
  align-items: center;
}

.fighter {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fighter-image {
  margin-bottom: 15px;
}

.sprite-image {
  width: 180px;
  height: 180px;
  image-rendering: pixelated;
  object-fit: contain;
  border: 3px solid #8b7d6b;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.boss-image {
  outline: 4px solid rgba(255,80,80,0.12);
}

.player-image {
  outline: 4px solid rgba(120,220,200,0.12);
}

.fighter-info h3 {
  margin: 0 0 10px 0;
  color: #6b5d50;
  font-size: 18px;
}

.hp-bar {
  width: 220px;
  height: 22px;
  background: linear-gradient(90deg, #d9cdb5, #cdbfa3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 2px solid #a89880;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.08);
}

.hp-fill {
  height: 100%;
  transition: width 0.35s ease;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: white;
  font-weight: bold;
  font-size: 12px;
  padding-left: 8px;
  text-shadow: 0 1px 0 #000;
}

.player-hp {
  background: repeating-linear-gradient(90deg, #ff4d4d 0 6px, #ffb84d 6px 12px);
}

.boss-hp {
  background: repeating-linear-gradient(90deg, #ff3b3b 0 6px, #ff6b6b 6px 12px);
}

.hp-text {
  text-align: center;
  font-size: 14px;
  color: #8b7d6b;
  font-weight: bold;
}

.vs-divider {
  display: flex;
  justify-content: center;
  align-items: center;
}

.vs-text {
  font-size: 24px;
  font-weight: bold;
  color: #8b7d6b;
  background: rgba(232, 220, 200, 0.9);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 3px solid #a89880;
}

@media (max-width: 768px) {
  .battle-field {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .vs-divider {
    order: -1;
  }
}

/* ===== Moves Section ===== */
.moves-section {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #d9cdb5;
}

.moves-section h3 {
  margin: 0 0 15px 0;
  color: #6b5d50;
  font-size: 18px;
}

.moves-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.move-button {
  padding: 15px;
  border: 2px solid #d9cdb5;
  border-radius: 8px;
  background: #f5f0e9;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
  color: #6b5d50;
}

.move-button:hover:not(:disabled) {
  border-color: #667eea;
  background: #f0f4ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.move-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.move-name {
  font-size: 14px;
  color: #333;
  margin-bottom: 5px;
}

.move-power {
  font-size: 12px;
  color: #888;
}

/* ===== Question Prompt ===== */
.question-prompt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.question-prompt {
  background: white;
  border-radius: 15px;
  padding: 40px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-header {
  text-align: center;
  margin-bottom: 30px;
}

.question-header h3 {
  margin: 0 0 15px 0;
  color: #667eea;
  font-size: 20px;
}

.question-text {
  margin: 0;
  font-size: 18px;
  color: #333;
  font-weight: 500;
}

.options-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 30px;
}

.option-button {
  display: flex;
  align-items: center;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
}

.option-button:hover:not(:disabled) {
  border-color: #667eea;
  background: #f0f4ff;
  transform: translateX(5px);
}

.option-button.selected {
  border-color: #667eea;
  background: #e8edff;
  font-weight: bold;
}

.option-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.option-letter {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #667eea;
  color: white;
  font-weight: bold;
  margin-right: 12px;
  flex-shrink: 0;
}

.option-button.selected .option-letter {
  background: #764ba2;
}

.option-text {
  flex: 1;
  text-align: left;
}

.submit-button {
  width: 100%;
  padding: 15px;
  font-size: 18px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.submit-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Result Section ===== */
.result-section {
  margin-top: 30px;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
}

.result-message {
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.result-message.hit {
  background: #d4edda;
  border: 2px solid #28a745;
  color: #155724;
}

.result-message.miss {
  background: #f8d7da;
  border: 2px solid #dc3545;
  color: #721c24;
}

.result-message h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
}

.result-message p {
  margin: 8px 0;
}

.continue-button {
  padding: 12px 30px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.continue-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ===== Game Over Section ===== */
.game-over-section {
  margin-top: 30px;
  text-align: center;
}

.game-over-message {
  padding: 30px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.game-over-message.victory {
  background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
  border: 3px solid #28a745;
}

.game-over-message.defeat {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  border: 3px solid #dc3545;
}

.game-over-message h2 {
  margin: 0 0 10px 0;
  font-size: 32px;
}

.final-message {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.play-again-button {
  padding: 15px 40px;
  font-size: 18px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.play-again-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ===== Battle Log ===== */
.battle-log {
  margin-top: 30px;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.battle-log h4 {
  margin: 0 0 10px 0;
  color: #333;
}

.log-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-entry {
  padding: 8px;
  background: white;
  border-left: 3px solid #667eea;
  border-radius: 4px;
  font-size: 14px;
  color: #555;
}
