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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 32px;
}

.app-title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #1a1a1a;
}

.app-subtitle {
  font-size: 0.95rem;
  color: #888;
  margin-top: 4px;
}

/* Card */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 36px;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}

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

/* Topic selection */
.topic-intro {
  font-size: 1rem;
  color: #555;
  margin-bottom: 20px;
}

.topic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.topic-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 0.95rem;
  font-weight: 500;
  color: #1a1a1a;
}

.topic-btn:hover {
  border-color: #4a6cf7;
  background: #f0f3ff;
}

.topic-icon {
  font-size: 1.8rem;
}

/* Progress bar */
.progress-bar-wrap {
  background: #eee;
  border-radius: 99px;
  height: 6px;
  margin-bottom: 24px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: #4a6cf7;
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* Question */
.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: #888;
}

.score-display {
  font-weight: 600;
  color: #4a6cf7;
}

.question-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #aaa;
  margin-bottom: 8px;
}

.question-text {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 24px;
  min-height: 60px;
}

/* Answer buttons */
.answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.answer-btn {
  padding: 14px 18px;
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  color: #1a1a1a;
  line-height: 1.4;
}

.answer-btn:hover:not(:disabled) {
  border-color: #4a6cf7;
  background: #f0f3ff;
}

.answer-btn.correct {
  border-color: #22c55e;
  background: #f0fdf4;
  color: #15803d;
}

.answer-btn.wrong {
  border-color: #ef4444;
  background: #fef2f2;
  color: #b91c1c;
}

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

/* Feedback */
.feedback {
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 22px;
  text-align: center;
}

.feedback.correct { color: #16a34a; }
.feedback.wrong { color: #dc2626; }

/* Next button */
.btn-next {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  background: #4a6cf7;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-next:hover { background: #3558e8; }
.btn-next.hidden { display: none; }

/* Results screen */
.result-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 12px;
}

.result-title {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.result-score {
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
  color: #4a6cf7;
  margin: 16px 0 4px;
}

.result-label {
  text-align: center;
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.result-message {
  text-align: center;
  font-size: 1rem;
  color: #555;
  margin-bottom: 28px;
  line-height: 1.6;
}

.result-actions {
  display: flex;
  gap: 12px;
}

.btn-secondary {
  flex: 1;
  padding: 13px;
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: #555;
  transition: border-color 0.15s;
}

.btn-secondary:hover { border-color: #4a6cf7; color: #4a6cf7; }

.btn-primary {
  flex: 1;
  padding: 13px;
  background: #4a6cf7;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover { background: #3558e8; }

@media (max-width: 480px) {
  .card { padding: 24px; }
  .topic-grid { grid-template-columns: 1fr; }
  .question-text { font-size: 1.1rem; }
}
