:root {
  --bg: #f3ede2;
  --ink: #1c1a17;
  --dim: #6b6255;
  --card: #fffdf8;
  --border: #d8cdb8;
  --accent: #b5482f;
  --accent2: #2f6b52;
  --right: #2f6b52;
  --wrong: #b5482f;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 64px;
}

.wrap {
  width: 100%;
  max-width: 920px;
}

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

h1 {
  font-size: 2.4rem;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

h1 .ai {
  color: var(--accent);
}

.tagline {
  color: var(--dim);
  font-size: 1.05rem;
  margin: 0;
}

.screen { display: none; }
.screen.active { display: block; }

/* ---- intro ---- */

#intro {
  text-align: center;
}

#intro p {
  color: var(--dim);
  line-height: 1.55;
  font-size: 1.05rem;
  max-width: 620px;
  margin: 0 auto 12px;
}

.rules {
  display: inline-block;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 22px;
  margin: 18px 0 26px;
  color: var(--dim);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---- buttons ---- */

button.primary {
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff9f2;
  border: none;
  border-radius: 8px;
  padding: 13px 30px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}
button.primary:hover { background: #973a25; }
button.primary:active { transform: scale(0.97); }
button.primary:disabled {
  opacity: 0.4;
  cursor: default;
}

button.ghost {
  font-family: inherit;
  font-size: 0.95rem;
  background: transparent;
  color: var(--dim);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 18px;
  cursor: pointer;
}
button.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---- quiz ---- */

.hud {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  font-size: 0.95rem;
  color: var(--dim);
}

.hud .score {
  font-weight: 600;
  color: var(--ink);
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 26px;
}
.progress-fill {
  height: 100%;
  background: var(--accent2);
  width: 0%;
  transition: width 0.3s ease;
}

.prompt {
  text-align: center;
  font-size: 1.15rem;
  margin: 0 0 20px;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 640px) {
  .pair { grid-template-columns: 1fr; }
}

.pick {
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s ease, transform 0.1s ease;
  display: block;
}
.pick:hover:not(:disabled) {
  border-color: var(--accent2);
  transform: translateY(-2px);
}
.pick:disabled { cursor: default; }

.pick img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  display: block;
  background: #eee;
}

.pick .label {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--dim);
}

.pick.correct { border-color: var(--right); }
.pick.correct .label { color: var(--right); }
.pick.incorrect { border-color: var(--wrong); }
.pick.incorrect .label { color: var(--wrong); }

.reveal {
  padding: 0 14px 14px;
  font-size: 0.82rem;
  color: var(--dim);
  line-height: 1.4;
  display: none;
}
.pick.revealed .reveal { display: block; }

.next-row {
  margin-top: 24px;
  text-align: center;
}

/* ---- results ---- */

#results {
  text-align: center;
}

.score-big {
  font-size: 4rem;
  font-weight: 700;
  margin: 6px 0 4px;
}
.score-big .of { font-size: 2rem; color: var(--dim); font-weight: 400; }

.verdict {
  font-size: 1.2rem;
  color: var(--accent);
  margin: 0 0 20px;
}

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

/* ---- credits ---- */

#credits {
  margin-top: 40px;
  font-size: 0.85rem;
  color: var(--dim);
}
#credits summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}
.credit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 20px;
  margin-top: 10px;
}
.credit-grid div { line-height: 1.5; }
.credit-grid a { color: var(--dim); }
.credit-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 5px;
}
.credit-tag.ai { background: #f3ded8; color: var(--accent); }
.credit-tag.human { background: #dbe8de; color: var(--accent2); }

footer.site {
  margin-top: 36px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--dim);
}
footer.site a { color: var(--dim); }
