:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: #111827;
  background: #f3f4f6;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
}

button, input { font: inherit; }

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(920px, 100%);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: clamp(22px, 4vw, 42px);
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.08);
}

.eyebrow {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 44px);
  letter-spacing: -0.04em;
}

.subtitle {
  margin: 10px 0 0;
  color: #6b7280;
  line-height: 1.6;
}

.score {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 78px;
  height: 54px;
  border-radius: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  font-weight: 800;
}

.question {
  margin-top: 34px;
  padding: 24px;
  border-radius: 20px;
  background: #111827;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.question-label {
  color: #9ca3af;
  font-size: 14px;
  font-weight: 700;
}

.key-name {
  font-size: clamp(26px, 5vw, 42px);
  letter-spacing: -0.04em;
}

.quiz-form { margin-top: 28px; }

.degree-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.degree {
  min-width: 0;
}

.degree label {
  display: block;
  text-align: center;
  margin-bottom: 8px;
  font-size: 13px;
  color: #6b7280;
  font-weight: 800;
}

.degree input {
  width: 100%;
  min-width: 0;
  height: 58px;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  outline: none;
  transition: .16s ease;
}

.degree input:focus {
  border-color: #111827;
  box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.08);
}

.degree input.correct {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #166534;
}

.degree input.wrong {
  border-color: #dc2626;
  background: #fef2f2;
  color: #991b1b;
}

.answer {
  min-height: 18px;
  margin-top: 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #dc2626;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.actions button {
  min-height: 50px;
  border-radius: 14px;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
}

.primary-btn {
  flex: 1;
  border: 0;
  background: #111827;
  color: #ffffff;
}

.secondary-btn {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
}

.result {
  min-height: 28px;
  margin-top: 20px;
  font-weight: 800;
  line-height: 1.5;
}

.result.success { color: #15803d; }
.result.partial { color: #b45309; }

.helper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 13px;
}

.helper code {
  padding: 4px 7px;
  border-radius: 7px;
  background: #f3f4f6;
  color: #374151;
}

@media (max-width: 760px) {
  .header { flex-direction: column; }
  .score { align-self: flex-end; margin-top: -58px; }
  .question { align-items: flex-start; flex-direction: column; }
  .degree-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 480px) {
  .app-shell { padding: 12px; }
  .card { border-radius: 18px; padding: 20px; }
  .degree-grid { grid-template-columns: repeat(2, 1fr); }
  .actions { flex-direction: column; }
  .secondary-btn { width: 100%; }
}


.degree input.revealed {
  border-color: #6b7280;
  background: #f9fafb;
  color: #111827;
}

.secondary-btn.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}
