:root {
  --bg: #f1ece2;
  --surface: #fbf8f1;
  --surface-2: #f5efe4;
  --text: #2a2622;
  --muted: #8a8074;
  --border: #e3dac9;
  --accent: #2c6166;
  --accent-soft: #e0e9e8;
  --accent-ink: #23524f;
  --correct: #4d7a59;
  --correct-soft: #e5eee2;
  --wrong: #b35a3a;
  --wrong-soft: #f3e3d8;
  --shadow: 0 1px 2px rgba(70, 50, 30, .05), 0 6px 20px rgba(70, 50, 30, .06);
  --radius: 14px;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 96px;
}

/* ---------- Wordmark ---------- */
.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.wordmark .dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.wordmark h1 {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  margin: 0;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel { padding: 26px 24px; }

.field { margin-bottom: 20px; }
.field:last-of-type { margin-bottom: 0; }
.field > label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

/* count chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}
.chip:hover { border-color: var(--accent); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

select {
  width: 100%;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
  appearance: none;
}

/* buttons */
.primary {
  width: 100%;
  margin-top: 22px;
  padding: 13px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter .15s ease, transform .05s ease;
}
.primary:hover { filter: brightness(1.07); }
.primary:active { transform: translateY(1px); }

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s ease;
}
.ghost:hover { border-color: var(--accent); color: var(--accent-ink); }

.muted { color: var(--muted); }
.small { font-size: 0.82rem; margin: 14px 0 0; }
.hidden { display: none !important; }

/* ---------- Quiz ---------- */
.quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.score {
  font-size: 0.86rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.score b { color: var(--text); }

#cards { display: flex; flex-direction: column; gap: 16px; }

.qcard { padding: 22px 22px 20px; }
.qmeta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 4px 9px;
  border-radius: 999px;
}
.qnum { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.prompt {
  font-size: 1.05rem;
  font-weight: 560;
  line-height: 1.5;
  margin: 0 0 16px;
}

/* options */
.options { display: flex; flex-direction: column; gap: 9px; }
.option {
  text-align: left;
  font-family: inherit;
  font-size: 0.96rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all .14s ease;
  display: flex;
  gap: 11px;
  align-items: flex-start;
}
.option:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.option:disabled { cursor: default; }
.option .letter {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9rem;
}
.option.correct {
  background: var(--correct-soft);
  border-color: var(--correct);
  color: var(--text);
}
.option.correct .letter { color: var(--correct); }
.option.wrong {
  background: var(--wrong-soft);
  border-color: var(--wrong);
}
.option.wrong .letter { color: var(--wrong); }

/* reveal blocks */
.reveal { margin-top: 14px; }
.reveal-head {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--correct);
  margin-bottom: 6px;
}
.answers { margin: 0; padding-left: 4px; display: flex; flex-direction: column; gap: 8px; }
.answers li {
  list-style: none;
  background: var(--correct-soft);
  border: 1px solid var(--correct);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.93rem;
}
.explain {
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 11px 13px;
  font-size: 0.92rem;
  color: var(--text);
}

/* hint collapsible */
.hint {
  margin-top: 14px;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}
.hint-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.hint-btn:hover { color: var(--accent-ink); }
.hint-btn .chev { transition: transform .18s ease; display: inline-block; }
.hint-btn[aria-expanded="true"] .chev { transform: rotate(90deg); }
.hint-body {
  margin-top: 10px;
  display: none;
  font-size: 0.9rem;
  color: var(--muted);
}
.hint-body.open { display: block; }
.hint-body ol { margin: 6px 0 0; padding-left: 18px; }
.hint-body ol li { margin-bottom: 5px; }

.show-btn {
  margin-top: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent-ink);
  border-radius: 9px;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 550;
  cursor: pointer;
  transition: all .14s ease;
}
.show-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Pagina teoria ---------- */
.theory-intro {
  font-size: 0.9rem;
  color: var(--muted);
  margin: -10px 0 24px;
}
.area-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 34px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.area-title:first-of-type { margin-top: 6px; }
.theory-card { padding: 18px 22px; margin-bottom: 4px; }
.theory-num {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.theory-q {
  font-size: 0.98rem;
  font-weight: 550;
  color: var(--text);
  margin: 0 0 12px;
  line-height: 1.5;
}
.theory-body {
  font-size: 0.93rem;
  line-height: 1.72;
  color: #3c362f;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 12px 15px;
}
.theory-body p { margin: 0 0 8px; }
.theory-body p:last-child { margin-bottom: 0; }

@media (max-width: 520px) {
  .wrap { padding: 28px 16px 80px; }
  .qcard { padding: 18px 16px; }
  .theory-card { padding: 16px; }
  .prompt { font-size: 1.02rem; }
}
