* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #001726;
  background: linear-gradient(180deg, #fffefa 0%, #fff4ef 100%);
  min-height: 100vh;
}

.wrap {
  width: min(900px, 92vw);
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.topbar h1 {
  margin: 0;
  font-size: 1.8rem;
}

.topbar p {
  margin: 0.35rem 0 0;
}

.back-link {
  color: #001726;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: 0 12px 30px rgba(0, 23, 38, 0.08);
  margin-bottom: 1rem;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  background: linear-gradient(135deg, #ff835f, #ff9d58);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  color: #4a5962;
}

#questionText {
  margin: 0 0 1rem;
  line-height: 1.4;
}

.options {
  display: grid;
  gap: 0.65rem;
}

.option {
  border: 1px solid rgba(0, 23, 38, 0.14);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.option input[type="text"],
.option select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 23, 38, 0.2);
  font: inherit;
}

.actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.feedback {
  margin-top: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 23, 38, 0.12);
  padding: 0.8rem 0.9rem;
  background: #f8fbff;
}

.feedback.is-correct {
  border-color: rgba(40, 167, 69, 0.35);
  background: #f3fff6;
}

.feedback.is-wrong {
  border-color: rgba(220, 53, 69, 0.35);
  background: #fff4f6;
}

.feedback h3 {
  margin: 0 0 0.45rem;
}

.feedback p {
  margin: 0.35rem 0;
}

.result h2 {
  margin-top: 0;
}

#resultText {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

#reviewBlock h3 {
  margin: 0 0 0.5rem;
}

#reviewList {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
  }

  .actions,
  .btn {
    width: 100%;
  }

  .actions {
    justify-content: stretch;
  }
}
