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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

/* Landing View */
.landing-card {
  text-align: center;
  margin-top: 40px;
}

.landing-card h1 {
  font-size: 28px;
  color: #c8102e;
  margin-bottom: 8px;
}

.subtitle {
  color: #555;
  margin-bottom: 32px;
  font-size: 16px;
}

#start-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 15px;
}

#start-form input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

#start-form input:focus {
  outline: none;
  border-color: #c8102e;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  width: 100%;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: #c8102e;
  color: #fff;
}

.btn-primary:hover {
  background: #a00d24;
}

.btn-secondary {
  background: #e8e8e8;
  color: #333;
}

.btn-secondary:hover {
  background: #d0d0d0;
}

/* Quiz Header */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-weight: 600;
  font-size: 14px;
  color: #555;
  margin-bottom: 4px;
}

/* Category Badge */
.category-badge {
  display: inline-block;
  background: #ffd520;
  color: #1a1a2e;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Question */
#question-text {
  font-size: 20px;
  line-height: 1.4;
  margin-bottom: 24px;
  color: #1a1a2e;
}

/* Options */
.option-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  margin-bottom: 10px;
  font-size: 16px;
  background: #f7f8fa;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  line-height: 1.4;
}

.option-btn:hover:not(:disabled) {
  border-color: #c8102e;
  background: #fff5f5;
}

.option-btn:disabled {
  cursor: default;
}

.option-btn.correct {
  border-color: #2e7d32;
  background: #e8f5e9;
  color: #1b5e20;
  font-weight: 600;
}

.option-btn.incorrect {
  border-color: #c62828;
  background: #ffebee;
  color: #b71c1c;
}

.option-btn .option-label {
  font-weight: 700;
  margin-right: 8px;
}

/* Result Overlay */
#result-overlay {
  margin-top: 16px;
}

#result-overlay.hidden {
  display: none;
}

.result-card {
  border-left: 4px solid #c8102e;
}

.result-card.correct-result {
  border-left-color: #2e7d32;
}

#result-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

#result-text {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

#result-text.correct {
  color: #2e7d32;
}

#result-text.incorrect {
  color: #c62828;
}

#explanation-text {
  background: #f7f8fa;
  padding: 16px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: #333;
  margin-bottom: 20px;
}

#next-btn {
  margin-top: 4px;
}

/* Results View */
#final-score {
  text-align: center;
  font-size: 48px;
  font-weight: 800;
  color: #c8102e;
  margin: 16px 0 8px;
}

#score-message {
  text-align: center;
  font-size: 16px;
  color: #555;
  margin-bottom: 8px;
}

#results-title {
  text-align: center;
}

/* Progress Chart */
#progress-chart {
  width: 100%;
  height: 200px;
  margin-bottom: 20px;
}

#stats-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-box {
  background: #f7f8fa;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: #c8102e;
}

.stat-label {
  font-size: 13px;
  color: #777;
  margin-top: 2px;
}

#back-btn {
  margin-top: 4px;
}

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
}
