:root {
  color-scheme: light;
  --ink: #263238;
  --muted: #667085;
  --paper: #fffdf7;
  --line: #dde7df;
  --mint: #d8f6e4;
  --green: #2f9e67;
  --green-dark: #16794b;
  --sun: #ffd166;
  --coral: #ff8a7a;
  --sky: #d7ecff;
  --blue: #3277c8;
  --shadow: 0 16px 36px rgba(38, 50, 56, 0.12);
  font-family: Inter, ui-rounded, "Nunito", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 209, 102, 0.45), transparent 22rem),
    radial-gradient(circle at 92% 18%, rgba(215, 236, 255, 0.9), transparent 20rem),
    linear-gradient(180deg, #f7fff9 0%, #fffaf0 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero {
  min-height: 86vh;
  display: grid;
  place-items: center;
}

.name-card,
.quiz-panel {
  width: min(620px, 100%);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.name-card {
  text-align: center;
}

.mascot {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  color: var(--green-dark);
  background: var(--mint);
  border: 3px solid #a7dfbd;
  font-weight: 900;
  font-size: 38px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
}

h2 {
  line-height: 1.15;
}

.lead {
  color: var(--muted);
  font-size: 1.1rem;
}

.name-input {
  width: 100%;
  min-height: 56px;
  margin: 12px 0;
  padding: 0 18px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: white;
  outline: none;
}

.name-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 158, 103, 0.16);
}

.form-error {
  min-height: 22px;
  color: #b42318;
}

.btn {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
  background: white;
  border: 2px solid var(--line);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(38, 50, 56, 0.1);
}

.btn.primary {
  color: white;
  background: var(--green);
  border-color: var(--green-dark);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.68);
}

.btn.disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.wide {
  width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--green-dark);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.subtle {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

.levels {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.sets {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.level-card,
.set-card,
.review-card {
  background: rgba(255, 253, 247, 0.9);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 10px 22px rgba(38, 50, 56, 0.08);
}

.level-card:nth-child(2n) {
  background: rgba(215, 236, 255, 0.72);
}

.level-card:nth-child(3n) {
  background: rgba(255, 209, 102, 0.32);
}

.level-badge,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--sky);
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 900;
}

.status.done {
  background: var(--mint);
  color: var(--green-dark);
}

.status.wrong {
  background: #ffe3df;
  color: #b42318;
}

.meter {
  height: 12px;
  margin: 16px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f0;
}

.meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--sun));
}

.section-actions,
.quiz-actions,
.quiz-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.quiz-top-actions {
  width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.set-row,
.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.set-card.done {
  color: #4b5563;
  background: #eef1f3;
  border-color: #c8d0d6;
  box-shadow: none;
}

.set-card.done .btn.primary {
  background: #6b7280;
  border-color: #4b5563;
}

.set-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
}

.score {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 0.9rem;
}

.score.high {
  color: #05603a;
  background: #d1fadf;
}

.score.mid {
  color: #93370d;
  background: #fef0c7;
}

.score.low {
  color: #b42318;
  background: #fee4e2;
}

.score.empty {
  color: var(--muted);
  background: #f4f7fb;
}

.quiz-panel {
  width: min(760px, 100%);
  margin: 0 auto;
}

.options {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-weight: 800;
}

.option.selected {
  border-color: var(--green);
  background: var(--mint);
}

.review-list {
  display: grid;
  gap: 14px;
}

.review-card.correct {
  border-color: #a7dfbd;
}

.review-card.wrong {
  border-color: #ffb4a9;
}

.explanation {
  margin-bottom: 0;
  padding: 14px;
  border-radius: 8px;
  background: #f4f7fb;
}

@media (max-width: 700px) {
  .topbar,
  .set-row,
  .question-meta {
    display: grid;
  }

  .name-card,
  .quiz-panel {
    padding: 22px;
  }
}
