:root {
  --bg: #f0f4f8;
  --card: #ffffff;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --correct: #16a34a;
  --correct-bg: #dcfce7;
  --incorrect: #dc2626;
  --incorrect-bg: #fee2e2;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --radius: 14px;
}

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.quiz-card {
  background: var(--card);
  width: 100%;
  max-width: 540px;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  padding: 2rem;
}

.screen {
  text-align: center;
}

.hidden {
  display: none !important;
}

h1 {
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--muted);
  margin-bottom: 2rem;
}

/* Loading */
.loading {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* Header */
.quiz-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.score {
  font-weight: 600;
  color: var(--primary);
}

.question-text {
  font-size: 1.25rem;
  text-align: left;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

/* Answers */
.answers {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.answer-btn {
  width: 100%;
  text-align: left;
  padding: 0.9rem 1.1rem;
  font-size: 1rem;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.answer-btn:hover:not(:disabled) {
  border-color: var(--primary);
}

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

.answer-btn.correct {
  border-color: var(--correct);
  background: var(--correct-bg);
  color: var(--correct);
  font-weight: 600;
}

.answer-btn.incorrect {
  border-color: var(--incorrect);
  background: var(--incorrect-bg);
  color: var(--incorrect);
  font-weight: 600;
}

/* Explanation */
.explanation {
  text-align: left;
  background: #f1f5f9;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
}

/* Feedback */
.feedback-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.5rem;
}

.feedback {
  font-weight: 600;
  text-align: left;
}

.feedback.correct {
  color: var(--correct);
}

.feedback.incorrect {
  color: var(--incorrect);
}

/* Buttons */
.btn {
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1.6rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

/* Summary */
.final-score {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin: 1rem 0 0.5rem;
}

.final-message {
  color: var(--muted);
  margin-bottom: 2rem;
}

/* Back to portfolio link */
.back-link {
  text-align: center;
  margin-top: 1.5rem;
}

.back-link a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link a:hover {
  color: var(--primary);
}
