:root {
  --bg: #eef6f0;
  --card: #ffffff;
  --text: #1f2d24;
  --muted: #5f6f65;
  --primary: #2e8b57;
  --primary-dark: #236b43;
  --border: #d6e2da;
  --correct: #d4f4dd;
  --correct-border: #2e8b57;
  --wrong: #fbdada;
  --wrong-border: #c0392b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  /* Biology illustrations tiled over a calm green gradient */
  background-color: var(--bg);
  background-image:
    url("background.svg"),
    radial-gradient(circle at 15% 20%, #d9f0e1 0%, transparent 55%),
    radial-gradient(circle at 85% 80%, #cfe9d8 0%, transparent 55%),
    linear-gradient(160deg, #e8f5ec 0%, #d3ecdc 50%, #c4e3cf 100%);
  background-size: 480px 480px, auto, auto, auto;
  background-attachment: fixed;
}

.card {
  width: 100%;
  max-width: 640px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(63, 143, 99, 0.15);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(35, 107, 67, 0.12);
}

.hidden { display: none !important; }

h1 { margin-top: 0; text-align: center; }
h2 { font-size: 1.25rem; line-height: 1.4; margin: 24px 0 16px; }

.subtitle { text-align: center; color: var(--muted); }

#start-screen, #result-screen { text-align: center; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.secondary { background: #fff; color: var(--primary); border: 2px solid var(--primary); }
.btn.secondary:hover { background: var(--correct); }

.topics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.topic-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 12px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.topic-btn:hover { border-color: var(--primary); background: #f4fbf6; transform: translateY(-2px); }
.topic-btn .icon { font-size: 2rem; }

.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.top-bar {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

.progress {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.3s ease;
}

.options { list-style: none; padding: 0; margin: 0; }
.options li { margin-bottom: 10px; }

.option {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  font-size: 1rem;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.option:hover:not(:disabled) { border-color: var(--primary); }
.option:disabled { cursor: default; }
.option.correct { background: var(--correct); border-color: var(--correct-border); }
.option.wrong { background: var(--wrong); border-color: var(--wrong-border); }

.feedback { min-height: 1.5em; font-weight: 600; }
.feedback.good { color: var(--correct-border); }
.feedback.bad { color: var(--wrong-border); }

#next-btn { float: right; }

.final-score { font-size: 2.5rem; font-weight: 700; color: var(--primary); margin: 8px 0; }

#result-screen h3 { text-align: left; margin-top: 32px; }

.review { text-align: left; padding-left: 20px; }
.review li { margin-bottom: 12px; line-height: 1.4; }
.review .ok { color: var(--correct-border); }
.review .no { color: var(--wrong-border); }

@media (max-width: 480px) {
  .card { padding: 20px; }
}
