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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
}

#app {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

header {
  text-align: center;
  padding: 2rem 0 1rem;
}

header h1 {
  font-size: 2rem;
  color: #fff;
}

.subtitle {
  color: #888;
  margin-top: 0.25rem;
}

/* Screens */
.screen { display: none; }
.screen.active { display: block; }

/* Mode buttons */
.mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 2rem 0;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #e0e0e0;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s;
}

.mode-btn:hover {
  border-color: #c0392b;
}

.mode-btn strong {
  font-size: 1.1rem;
  color: #fff;
}

.mode-btn span {
  font-size: 0.85rem;
  color: #888;
  margin-top: 0.25rem;
}

/* HUD */
.game-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #333;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.hud-timer {
  font-size: 1.5rem;
  font-weight: bold;
  color: #e74c3c;
  min-width: 2.5rem;
  text-align: center;
}

.hud-lives { font-size: 1.2rem; }

/* Map */
#map-container {
  width: 100%;
  height: 350px;
  border-radius: 8px;
  overflow: hidden;
  margin: 1rem 0;
  background: #1a1a1a;
}

/* Question area */
#question-prompt {
  font-size: 1.1rem;
  padding: 0.5rem 0;
}

#answer-area {
  margin-top: 1rem;
}

#answer-area input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  outline: none;
}

#answer-area input[type="text"]:focus {
  border-color: #c0392b;
}

#answer-area .choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

#answer-area .choice-btn {
  padding: 0.75rem;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.15s;
}

#answer-area .choice-btn:hover {
  background: #2a2a2a;
}

#answer-area .choice-btn.correct {
  border-color: #27ae60;
  background: rgba(39, 174, 96, 0.15);
}

#answer-area .choice-btn.wrong {
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.15);
}

/* Streak banner */
#streak-banner {
  text-align: center;
  padding: 0.5rem;
  font-weight: bold;
  color: #f39c12;
  font-size: 1.1rem;
}

.hidden { display: none !important; }

/* Results */
#results h2 {
  text-align: center;
  margin: 1rem 0;
}

#final-score {
  text-align: center;
  font-size: 2.5rem;
  font-weight: bold;
  color: #f39c12;
  margin: 1rem 0;
}

#result-stats {
  text-align: center;
  color: #888;
  margin-bottom: 1.5rem;
}

.result-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.result-actions button {
  padding: 0.75rem 1.5rem;
  border: 1px solid #444;
  border-radius: 6px;
  background: #1a1a1a;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 0.95rem;
}

.result-actions button:hover {
  border-color: #c0392b;
}

/* Leaderboard */
#leaderboard-preview, #leaderboard-full {
  margin-top: 2rem;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid #222;
}

.leaderboard-table th {
  color: #888;
  font-weight: normal;
  text-transform: uppercase;
  font-size: 0.75rem;
}

/* Training detail */
#training-detail {
  margin-top: 1rem;
  padding: 1rem;
  background: #1a1a1a;
  border-radius: 8px;
}

#detail-map {
  height: 250px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1rem;
}

#detail-stops {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

#btn-next-training {
  padding: 0.75rem 1.5rem;
  border: 1px solid #444;
  border-radius: 6px;
  background: #1a1a1a;
  color: #e0e0e0;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 600px) {
  header h1 { font-size: 1.5rem; }
  #map-container { height: 250px; }
  .game-hud { font-size: 0.85rem; }
  #answer-area .choices { grid-template-columns: 1fr; }
}
