* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  min-height: 100vh;
  padding: 20px;
  color: #000000;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: white;
  padding: 35px 30px;
  text-align: center;
}

.header h1 {
  font-size: 2.3em;
  margin-bottom: 10px;
  font-weight: 700;
}

.header p {
  font-size: 1.1em;
  opacity: 0.95;
}

#mainContent {
  padding: 35px 30px 40px;
}

/* Start screen */
.start-btn {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: white;
  border: none;
  padding: 18px 45px;
  border-radius: 15px;
  font-size: 1.2em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.start-btn:hover {
  background: linear-gradient(135deg, #059669, #10b981);
  transform: scale(1.05);
}

.nav-btn {
  background: #1e3a8a;
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.nav-btn:hover:not(:disabled) {
  background: #1e40af;
  transform: translateY(-1px);
}

.nav-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.finish-btn {
  background: linear-gradient(135deg, #10b981, #34d399);
}

/* Layout quiz */
.quiz-container {
  width: 100%;
}

.layout {
  display: grid;
  grid-template-columns: 2.2fr 0.9fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* Timer & progress */
.timer {
  text-align: center;
  font-size: 1.4em;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 12px;
}

.progress-bar {
  background: #f1f5f9;
  height: 14px;
  border-radius: 7px;
  margin-bottom: 18px;
  overflow: hidden;
}

.progress {
  background: linear-gradient(90deg, #10b981, #34d399);
  height: 100%;
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 7px;
}

/* Question */
.question-meta {
  background: #f0f9ff;
  padding: 12px 15px;
  border-radius: 10px;
  margin-bottom: 15px;
  font-size: 0.95em;
  color: #374151;
}

.question {
  font-size: 1.4em;
  font-weight: 600;
  margin-bottom: 22px;
  line-height: 1.6;
  color: #1f2937;
}

.options {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.option {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 1.05em;
  color: #374151;
}

.option:hover {
  background: #dbeafe;
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.option.selected {
  background: #3b82f6;
  color: white;
  border-color: #1e40af;
}

/* Navigation buttons line */
.navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* Review nav panel */
.question-nav {
  background: #f8fafc;
  border-radius: 12px;
  padding: 15px;
  max-height: 520px;
  overflow: auto;
}

.question-nav h3 {
  margin-bottom: 10px;
  color: #1e3a8a;
}

.question-nav button {
  width: 40px;
  height: 40px;
  margin: 3px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  cursor: pointer;
  font-size: 0.9em;
}

.question-nav button.unanswered {
  background: #fee2e2;
  border-color: #ef4444;
}

.question-nav button.answered {
  background: #bbf7d0;
  border-color: #16a34a;
}

.question-nav button.current {
  background: #3b82f6;
  color: #ffffff;
}

/* Result screen */
.results {
  text-align: center;
}

.score-circle {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: conic-gradient(#10b981 0deg var(--score-deg),
                             #f3f4f6 var(--score-deg) 360deg);
  margin: 18px auto 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.score-circle::before {
  content: "";
  width: 175px;
  height: 175px;
  background: white;
  border-radius: 50%;
  z-index: 2;
}

.score-text {
  position: absolute;
  font-size: 2.7em;
  font-weight: 800;
  color: #1f2937;
  z-index: 3;
}

.final-score {
  font-size: 3.4em;
  font-weight: 800;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 15px;
}

.message {
  font-size: 1.25em;
  margin: 18px 0 10px;
  padding: 18px;
  border-radius: 12px;
  font-weight: 600;
}

.message.excellent {
  background: #dcfce7;
  color: #166534;
  border: 2px solid #bbf7d0;
}

.message.good {
  background: #fef3c7;
  color: #92400e;
  border: 2px solid #fed7aa;
}

.message.average {
  background: #dbeafe;
  color: #1e40af;
  border: 2px solid #bfdbfe;
}

.message.needs-work {
  background: #fee2e2;
  color: #991b1b;
  border: 2px solid #fecaca;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin: 18px 0 25px;
}

.stat-card {
  background: #f8fafc;
  padding: 18px;
  border-radius: 12px;
  text-align: center;
}

.stat-value {
  font-size: 2em;
  font-weight: 800;
}

.stat-label {
  color: #6b7280;
  margin-top: 5px;
  font-size: 0.95em;
}

/* Review table */
.review-wrapper {
  max-height: 360px;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
}

.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

.review-table th,
.review-table td {
  border: 1px solid #e5e7eb;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.review-table th {
  background: #f3f4f6;
  position: sticky;
  top: 0;
}

.correct-text {
  color: #16a34a;
  font-weight: 600;
}

.wrong-text {
  color: #dc2626;
  font-weight: 600;
}