:root {
  --bg: #faf9f7;
  --card: #ffffff;
  --text: #1c1c1e;
  --muted: #6b6b6f;
  --accent: #2f6f4f;
  --accent-text: #ffffff;
  --border: #e6e4df;
  --wrong: #b3432b;
  --wrong-bg: #fbeeeb;
  --right: #2f6f4f;
  --right-bg: #eaf3ee;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --card: #212327;
    --text: #f2f1ee;
    --muted: #9a9a9e;
    --accent: #4fa578;
    --accent-text: #10130f;
    --border: #33353a;
    --wrong: #e0806a;
    --wrong-bg: #2c1c18;
    --right: #4fa578;
    --right-bg: #17251d;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.5;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.topnav a {
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
}
.topnav a:first-child {
  font-weight: 700;
  margin-right: auto;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  min-height: 100vh;
}

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 18px; color: var(--muted); font-weight: 500; margin: 0 0 24px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 20px;
}

.progress {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.prompt {
  font-size: 20px;
  margin-bottom: 20px;
  white-space: pre-wrap;
}

input[type=text] {
  width: 100%;
  font-size: 18px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 12px;
}

textarea {
  width: 100%;
  font-size: 18px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 12px;
  min-height: 100px;
  font-family: inherit;
}

button, .btn {
  display: block;
  width: 100%;
  font-size: 18px;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  margin-top: 8px;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.option {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 18px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  margin-bottom: 10px;
  cursor: pointer;
}
.option:active { background: var(--accent); color: var(--accent-text); }

.feedback-box {
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.feedback-box.right { background: var(--right-bg); color: var(--right); }
.feedback-box.wrong { background: var(--wrong-bg); color: var(--wrong); }
.feedback-box .explanation { color: var(--text); margin-top: 8px; font-size: 16px; }

.error { color: var(--wrong); margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 15px; }
.big-num { font-size: 48px; font-weight: 700; margin: 4px 0; }
