:root {
  --bg: #f7f6f2; --surface: #ffffff; --ink: #1d1d1b; --muted: #6b6a64; --line: #dedcd4;
  --accent: #2f5d8a; --accent-ink: #ffffff; --accent-soft: #e3ecf5;
  --class: #2f7a5b; --models: #a04a2f; --equal: #6b6a64;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615; --surface: #222220; --ink: #ecebe6; --muted: #a3a29b; --line: #3a3936;
    --accent: #7fb0e0; --accent-ink: #10202f; --accent-soft: #24313d;
    --class: #6cc29c; --models: #e08a6c; --equal: #8f8e87;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 900px; margin: 0 auto; padding: 24px 16px 64px; }
[hidden] { display: none !important; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0.2em 0 0.6em; }
h2 { font-size: 1.05rem; margin: 0 0 0.4em; }
code { font-size: 0.95em; background: var(--accent-soft); padding: 1px 6px; border-radius: 4px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem; color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.big { font-size: 1.6rem; font-weight: 650; min-width: 2.5ch; text-align: center; }
.steps { padding-left: 1.2em; }
.steps li { margin-bottom: 0.4em; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; margin: 16px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.card .meta { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
input[type=range] { flex: 1; min-width: 160px; }

button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 10px 18px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; padding: 12px 28px; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.vote { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.vote button { flex: 1; min-width: 140px; }
.vote button { min-width: 100px; }
.vote button[aria-pressed=true].v-humans { background: var(--class); border-color: var(--class); color: #fff; }
.vote button[aria-pressed=true].v-equal { background: var(--equal); border-color: var(--equal); color: #fff; }
.vote button[aria-pressed=true].v-ai { background: var(--models); border-color: var(--models); color: #fff; }

/* results */
.score-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.score-card .big { text-align: left; }
.fb-test summary { cursor: pointer; display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.fb-score { font-variant-numeric: tabular-nums; color: var(--muted); }
.fb-trial { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.fb-trial:first-of-type { margin-top: 10px; }
.fb-imgs { display: flex; gap: 4px; flex-wrap: wrap; }
.fb-imgs img { width: 72px; height: 72px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.fb-text { font-size: 0.95rem; min-width: 160px; }
.fb-text .ok { color: var(--class); font-weight: 600; }
.fb-text .bad { color: var(--models); font-weight: 600; }
.fb-text .fb-ai { font-weight: 400; margin-top: 2px; }
.fb-text .fb-ai.ok, .fb-text .fb-ai.bad { font-weight: 500; }

/* prediction step */
.predict { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 16px; }
.predict-q { margin: 0 0 12px; font-size: 1.05rem; }
.predict-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.predict-buttons button.choice { min-width: 180px; padding: 14px 20px; font-size: 1.05rem; font-weight: 600; }

.example { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-top: 8px; }
.example figure { margin: 0; }
.example img { max-height: 110px; max-width: 160px; border: 1px solid var(--line); background: #fff; }
.example figcaption { font-size: 0.7rem; color: var(--muted); }

.instruction { margin: 8px 0 12px; }
.big-instruction { font-size: 1.15rem; background: var(--surface); border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 4px; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }

/* Stimuli: never upscale beyond natural size (keeps what students see close to what the models got) */
.stimuli { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; align-items: flex-end; margin: 12px 0 20px; }
.stimuli figure { margin: 0; text-align: center; flex: 0 1 auto; max-width: 100%; }
.stimuli.has-target figure.target { flex-basis: 100%; }
.stimuli img { display: block; margin: 0 auto; max-width: 100%; height: auto; max-height: 46vh; background: #fff; border: 1px solid var(--line); }
.stimuli.n4 img:not(.target-img) { max-height: 32vh; }
.stimuli figcaption { font-weight: 600; font-size: 0.9rem; margin-top: 4px; }

#answer { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
#answer button.choice { min-width: 130px; padding: 14px 20px; font-size: 1.05rem; font-weight: 600; }
#answer input[type=text] { font: inherit; font-size: 1.1rem; padding: 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); flex: 1 1 240px; max-width: 420px; }
#answer .skip { color: var(--muted); }
