:root {
  --bg: #f3f1ec;
  --bg-deep: #e9e5dc;
  --card: #fffdfa;
  --ink: #1e2428;
  --muted: #626a70;
  --line: #ded9cf;
  --line-strong: #c9c2b5;
  --accent: #2f5d62;
  --accent-dark: #24494d;
  --accent-soft: #e3efee;
  --brick: #7c3430;
  --ok: #2b7a4f;
  --ok-soft: #e2f2e8;
  --bad: #b0443c;
  --bad-soft: #f7e6e3;
  --shadow: 0 14px 40px rgba(45, 38, 26, 0.08);
  --radius: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  color: var(--ink);
  line-height: 1.7;
  background:
    radial-gradient(circle at 50% -10%, rgba(47, 93, 98, 0.10), transparent 42%),
    var(--bg);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }

.banner {
  background: var(--brick);
  color: #fff8f2;
  text-align: center;
  padding: 11px 18px;
  font-size: 14.5px;
  line-height: 1.65;
  letter-spacing: 0.015em;
}
.banner strong { margin-right: 0.35em; font-weight: 700; }

.hero, main, .site-foot {
  width: min(900px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.hero {
  padding: 44px 0 22px;
  text-align: center;
}
.kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.22em;
}
h1 {
  display: inline;
  margin: 0;
  font-size: clamp(32px, 6vw, 50px);
  line-height: 1.2;
  letter-spacing: 0.04em;
  font-weight: 750;
}
.subtitle {
  display: inline;
  margin: 0 0 0 0.28em;
  color: var(--muted);
  font-size: clamp(16px, 3vw, 21px);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.lede {
  max-width: 36em;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 15.5px;
}

main { padding: 16px 0 40px; }
.screen { animation: fade-in 180ms ease-out; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  * { scroll-behavior: auto !important; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.intro-card {
  max-width: 640px;
  margin: 0 auto;
  padding: 30px 30px 26px;
}
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0 0 24px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.facts div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 14px 8px 12px;
  background: #fbf9f4;
}
.facts strong {
  color: var(--accent-dark);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 750;
}
.facts span { color: var(--muted); font-size: 13px; }

.rules {
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.rules li {
  position: relative;
  padding-left: 22px;
  color: #333b40;
  font-size: 15px;
}
.rules li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.68em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 140ms, border-color 140ms, color 140ms, transform 80ms;
  touch-action: manipulation;
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-dark); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible {
  outline: 3px solid rgba(47, 93, 98, 0.35);
  outline-offset: 2px;
}
.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover:not(:disabled) {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}
.btn.big {
  width: 100%;
  min-height: 50px;
  font-size: 16.5px;
}
.fine {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.quiz-top {
  max-width: 720px;
  margin: 0 auto 12px;
}
.quiz-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
#q-counter {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.muted { color: var(--muted); font-size: 13.5px; }
.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-deep);
  overflow: hidden;
}
#progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3d757a, var(--accent));
  transition: width 220ms ease;
}
@media (prefers-reduced-motion: reduce) {
  #progress-bar { transition: none; }
}

.question-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 26px 20px;
}
.q-prompt {
  margin: 0 0 16px;
  text-align: center;
  font-size: 16px;
  font-weight: 650;
}
.stem-wrap {
  width: min(340px, 100%);
  margin: 0 auto 20px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.stem-wrap img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.answer-label {
  margin: 0 0 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

.answer-board {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
}
.answer-board > img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.hotspots {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
}
.hotspot {
  position: relative;
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 120ms, box-shadow 120ms;
}
.hotspot:hover { background: rgba(47, 93, 98, 0.08); }
.hotspot:focus-visible {
  outline: 3px solid #2f6f8f;
  outline-offset: -3px;
  z-index: 3;
}
.hotspot.is-selected {
  background: rgba(47, 93, 98, 0.18);
  box-shadow: inset 0 0 0 3px var(--accent);
  z-index: 2;
}
.tag {
  position: absolute;
  top: 7px;
  left: 8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transition: opacity 120ms;
  pointer-events: none;
}
.hotspot:hover .tag,
.hotspot:focus-visible .tag,
.hotspot.is-selected .tag { opacity: 1; }
.hotspot.is-selected .tag {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.review-board .hotspots { pointer-events: none; }
.review-cell { position: relative; }
.review-cell .tag { opacity: 1; }
.review-cell.is-correct {
  background: rgba(43, 122, 79, 0.20);
  box-shadow: inset 0 0 0 3px var(--ok);
  z-index: 2;
}
.review-cell.is-wrong {
  background: rgba(176, 68, 60, 0.16);
  box-shadow: inset 0 0 0 3px var(--bad);
  z-index: 2;
}
.review-cell.is-correct .tag {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.review-cell.is-wrong .tag {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}

.select-hint {
  min-height: 1.7em;
  margin: 10px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}
.select-hint.is-ready {
  color: var(--accent-dark);
  font-weight: 650;
}

.quiz-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 720px;
  margin: 16px auto 0;
}
.quiz-actions .btn { min-width: 120px; }

.result-card {
  max-width: 620px;
  margin: 0 auto;
  padding: 38px 30px 32px;
  text-align: center;
}
.result-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
}
#score-text {
  margin: 8px 0 14px;
  font-size: clamp(34px, 7vw, 52px);
  line-height: 1.2;
  color: var(--accent-dark);
  font-weight: 750;
}
.result-note {
  max-width: 30em;
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
}
.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.review {
  margin-top: 34px;
  scroll-margin-top: 16px;
}
.review-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.review-title h3 {
  margin: 0;
  font-size: 20px;
}
.review-title p { margin: 0; }
.review-list {
  display: grid;
  gap: 14px;
}
.review-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
}
.review-item.is-correct { border-left: 5px solid var(--ok); }
.review-item.is-wrong { border-left: 5px solid var(--bad); }
.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.review-head h4 {
  margin: 0;
  font-size: 15.5px;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.review-body {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.review-body .stem-wrap {
  width: 100%;
  margin: 0;
  padding: 4px;
}
.review-board { max-width: none; }
.review-answer-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.site-foot {
  border-top: 1px solid var(--line);
  padding: 24px 0 34px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}
.site-foot p { margin: 0 0 8px; }
.site-foot strong { color: var(--ink); }
.foot-note { color: var(--brick); font-weight: 600; }

@media (max-width: 640px) {
  .banner { padding: 10px 14px; font-size: 13px; }
  .hero { padding: 30px 0 16px; }
  .intro-card { padding: 22px 18px 20px; }
  .question-card { padding: 18px 14px 16px; }
  .review-body { grid-template-columns: 1fr; gap: 10px; }
  .review-body .stem-wrap { width: min(240px, 70%); margin: 0 auto; }
  .site-foot { font-size: 12px; }
}

@media (max-width: 400px) {
  .facts strong { font-size: 24px; }
  .btn { padding: 10px 18px; }
  .quiz-actions .btn { min-width: 0; flex: 1; }
  .tag { width: 19px; height: 19px; top: 4px; left: 5px; font-size: 10px; }
}
