:root {
  --green: #2d8f4e;
  --green-dark: #1f6b38;
  --green-soft: #e8f7ee;
  --yellow: #ffe566;
  --orange: #ff9f43;
  --sky: #5dade2;
  --pink: #ff6b9d;
  --bg: #fff8e7;
  --card: #ffffff;
  --text: #1a2e1f;
  --muted: #5a6b5e;
  --ok: #1e7a3a;
  --ok-bg: #d4f5df;
  --bad: #b3261e;
  --bad-bg: #ffe0de;
  --radius: 16px;
  --shadow: 0 4px 16px rgba(45, 143, 78, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 10% 10%, #ffe56655 0, transparent 40%),
    radial-gradient(circle at 90% 0%, #5dade233 0, transparent 35%),
    var(--bg);
  color: var(--text);
  min-height: 100%;
  -webkit-tap-highlight-color: transparent;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.header {
  text-align: center;
  margin-bottom: 16px;
}

.header h1 {
  margin: 0;
  font-size: clamp(1.45rem, 5vw, 1.85rem);
  color: var(--green-dark);
  line-height: 1.2;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
  border: 2px solid #d8efdf;
}

.bug-emoji {
  font-size: 2.2rem;
  text-align: center;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}

.lead {
  font-size: 1.05rem;
  line-height: 1.45;
  margin: 0 0 12px;
}

.tips {
  margin: 0 0 20px;
  padding-left: 1.2em;
  color: var(--muted);
  line-height: 1.5;
}

.hidden { display: none !important; }

.progress-bar-wrap {
  height: 10px;
  background: #e0ecd3;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), #7ed957);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.q-type {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--yellow);
  color: #5a4500;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.q-text {
  margin: 0 0 16px;
  font-size: 1.2rem;
  line-height: 1.35;
  font-weight: 700;
}

.q-text u {
  text-decoration-color: var(--pink);
  text-decoration-thickness: 2px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  min-height: 52px;
  border-radius: 14px;
  border: 2px solid #cfe8d6;
  background: #f7fdf9;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.35;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-user-select: none;
  user-select: none;
}

.option:active:not(:disabled) {
  transform: scale(0.98);
}

.option:hover:not(:disabled),
.option:focus-visible:not(:disabled) {
  border-color: var(--green);
  background: var(--green-soft);
  outline: none;
}

.option.selected {
  border-color: var(--sky);
  background: #e8f4fc;
}

.option.correct {
  border-color: var(--ok);
  background: var(--ok-bg);
}

.option.incorrect {
  border-color: var(--bad);
  background: var(--bad-bg);
}

.option:disabled {
  cursor: default;
  opacity: 1;
}

.option input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--green);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 14px 22px;
  min-height: 52px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  flex: 1 1 auto;
}

.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 3px 0 var(--green-dark);
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--green-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 2px solid #c5d5c9;
  flex: 0 1 auto;
}

.feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 1.02rem;
  line-height: 1.4;
}

.feedback.ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 2px solid #8fd6a5;
}

.feedback.bad {
  background: var(--bad-bg);
  color: #7a1c16;
  border: 2px solid #f0a8a3;
}

.feedback strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.1rem;
}

.final-score {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--green-dark);
  text-align: center;
  margin: 8px 0;
}

.encourage {
  text-align: center;
  font-size: 1.1rem;
  margin: 0 0 18px;
  color: var(--muted);
}

.missed-wrap h3 {
  margin: 0 0 10px;
  color: var(--green-dark);
}

.missed-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.missed-list li {
  background: #fff6f5;
  border: 1px solid #f0c4c0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.missed-list .q-miss {
  font-weight: 700;
  margin-bottom: 4px;
}

.missed-list .a-miss {
  color: var(--ok);
}

#results-screen .btn {
  width: 100%;
}

@media (min-width: 480px) {
  .app { padding: 24px 20px 56px; }
  .card { padding: 24px; }
}
