*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #e0f2fe, #eef2ff);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-page {
  width: 100%;
  padding: 16px;
}

.quiz-card {
  max-width: 760px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  padding: 22px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* START SCREEN */

.start-screen {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.start-screen h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0f172a;
}

.subtitle {
  font-size: 0.95rem;
  color: #64748b;
}

.name-label {
  margin-top: 12px;
  font-weight: 600;
  color: #0f172a;
}

.name-input {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  font-size: 0.95rem;
  width: 100%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.name-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.hint-text {
  font-size: 0.85rem;
  color: #64748b;
}

.start-btn {
  margin-top: 10px;
}

/* QUIZ */

.quiz-header {
  text-align: center;
}

.quiz-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.quiz-progress {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-text {
  font-size: 0.9rem;
  color: #475569;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0ea5e9, #22c55e);
  transition: width 0.25s ease-out;
}

.quiz-main {
  margin-top: 8px;
}

.question-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 12px;
  min-height: 52px;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  width: 100%;
  text-align: left;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  padding: 10px 14px;
  font-size: 0.96rem;
  cursor: pointer;
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.08s ease, box-shadow 0.08s ease,
    background-color 0.12s ease, border-color 0.12s ease;
}

.option-label {
  font-weight: 600;
  color: #64748b;
  min-width: 22px;
}

.option-text {
  color: #0f172a;
}

.option-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  border-color: #cbd5f5;
}

.option-btn.selected {
  background: #eff6ff;
  border-color: #2563eb;
}

.option-btn.correct {
  background: #ecfdf3;
  border-color: #22c55e;
}

.option-btn.wrong {
  background: #fef2f2;
  border-color: #ef4444;
}

/* FOOTER */

.quiz-footer {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.status-text {
  font-size: 0.9rem;
  color: #475569;
}

.score-preview {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
}

.button-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.nav-btn {
  border-radius: 999px;
  padding: 9px 16px;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nav-btn.primary {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}

.nav-btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.nav-btn.secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.nav-btn.ghost {
  background: transparent;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  width: 100%;
}

.nav-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

/* RESULT + HIGHSCORE */

.result-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-section h2 {
  font-size: 1.3rem;
  color: #0f172a;
}

#result-text {
  font-size: 0.95rem;
  color: #111827;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
  font-size: 0.9rem;
}

.score-table th,
.score-table td {
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  text-align: left;
}

.score-table th {
  background: #eff6ff;
  font-weight: 600;
}

.score-table tbody tr:nth-child(every) {
  background: #f9fafb;
}

.restart-btn {
  margin-top: 6px;
}

/* Status warna */

.quiz-complete {
  font-weight: 700;
}

.quiz-complete.good {
  color: #16a34a;
}

.quiz-complete.ok {
  color: #f97316;
}

.quiz-complete.bad {
  color: #ef4444;
}

/* Responsive */

@media (max-width: 600px) {
  .quiz-card {
    padding: 16px;
  }

  .question-text {
    font-size: 1rem;
  }

  .nav-btn {
    flex: 1;
  }

  .score-table {
    font-size: 0.8rem;
  }
}
