@font-face {
  font-family: "Jost";
  src: url("/fonts/jost-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f1ebdd;
  --ink: #141414;
  --red: #d7261e;
  --blue: #1f4fa3;
  --yellow: #f4b81c;
  --muted: #5d584e;
  --line: 3px solid var(--ink);
  --font: "Jost", "Futura", "Century Gothic", "Avenir Next", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.4;
}

h1, h2, p, ul, ol { margin: 0; }
ul { list-style: none; padding: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---------- shapes ---------- */

.shape, .mark { display: inline-block; flex: none; }
.circle { background: var(--blue); border-radius: 50%; }
.square { background: var(--red); }
.triangle { background: var(--yellow); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.mark { width: 0.8em; height: 0.8em; vertical-align: -0.05em; }

/* ---------- header ---------- */

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 16px;
  border-bottom: var(--line);
}
.logo { display: flex; align-items: flex-end; gap: 4px; }
.logo .shape { width: 22px; height: 22px; }
.top h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.streak { font-weight: 700; font-size: 16px; white-space: nowrap; }
.icon-btn {
  width: 40px; height: 40px;
  border: var(--line); border-radius: 50%;
  background: var(--paper);
  font-weight: 800; font-size: 20px; line-height: 1;
}
.icon-btn:hover { background: var(--yellow); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none; }
.icon-btn svg { display: block; }
.icon-btn .speaker { fill: var(--ink); }
.icon-btn .wave, .icon-btn .cross { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.icon-btn .cross { display: none; stroke: var(--red); stroke-width: 2.5; }
.icon-btn.muted .wave { display: none; }
.icon-btn.muted .cross { display: block; }

/* ---------- links between games ---------- */

.games {
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  border-bottom: var(--line);
}
.games a {
  flex: 1;
  padding: 9px 16px;
  color: var(--ink);
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  text-align: center; text-decoration: none;
}
.games a + a { border-left: var(--line); }
.games a:hover { background: var(--yellow); }
.games a[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* ---------- layout ---------- */

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px 48px;
}
.meta {
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted);
}
.prompt { margin-top: 4px; font-size: 19px; font-weight: 500; text-wrap: balance; }

/* ---------- board ---------- */

.board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
  border: var(--line);
}
.col { min-width: 0; min-height: 150px; }
.col + .col { border-left: var(--line); }
.col h2 {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-bottom: var(--line);
  color: #fff;
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.col-yes h2 { background: var(--blue); }
.col-no h2 { background: var(--red); }
.col h2 .mark { background: #fff; }
.col ul { padding: 6px 10px 10px; }
.col li {
  display: flex; align-items: baseline; gap: 8px;
  padding: 5px 0;
  font-size: 21px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  overflow-wrap: anywhere;
}
.col li + li { border-top: 1px solid rgba(20, 20, 20, 0.18); }
.col li.fresh { animation: drop 0.28s ease-out; }
.tag {
  margin-left: auto;
  padding: 1px 6px;
  border: 2px solid var(--ink);
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
}
@keyframes drop {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ---------- score meter ---------- */

.meter-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.meter { display: flex; gap: 4px; flex: 1; }
.pip { flex: 1; height: 14px; border: 2px solid var(--ink); }
.pip.used { background: var(--ink); }
.pip.penalty { background: var(--yellow); }
.meter-label { font-size: 15px; font-weight: 700; white-space: nowrap; }

/* ---------- buttons and form ---------- */

.btn {
  min-height: 52px;
  padding: 0 22px;
  border: var(--line);
  border-radius: 0;
  font-size: 17px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover:not(:disabled) { background: var(--blue); border-color: var(--blue); }
.btn-yellow { background: var(--yellow); }
.btn-yellow:hover:not(:disabled) { background: var(--ink); color: var(--yellow); }
.btn-wide { display: block; width: 100%; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

#play, #proof, #result { margin-top: 18px; }
.test-form { display: flex; }
.test-form input {
  flex: 1; min-width: 0;
  height: 52px;
  padding: 0 14px;
  border: var(--line); border-right: 0; border-radius: 0;
  background: #fff;
  font-size: 21px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.test-form input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; color: #8d877b; }
.test-form input:focus { outline: none; background: #fffbe6; }
.test-form.shake { animation: shake 0.3s; }
@keyframes shake {
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.note { min-height: 1.4em; margin: 6px 0 10px; font-size: 16px; font-weight: 500; color: var(--red); }

/* ---------- proof round ---------- */

.section-title {
  font-size: 26px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.proof-help { margin-top: 2px; color: var(--muted); font-size: 16px; }
.proof-list { margin: 12px 0 14px; border: var(--line); }
.proof-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 12px;
}
.proof-list li + li { border-top: var(--line); }
.proof-word {
  flex: 1; min-width: 0;
  font-size: 21px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  overflow-wrap: anywhere;
}
.pick {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 84px; min-height: 44px;
  padding: 0 10px;
  border: var(--line); border-radius: 0;
  background: var(--paper);
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.pick-yes[aria-pressed="true"] { background: var(--blue); color: #fff; }
.pick-no[aria-pressed="true"] { background: var(--red); color: #fff; }
.pick[aria-pressed="true"] .mark { background: #fff; }

/* ---------- Wrongly: the passage ---------- */

.passage {
  margin-top: 16px;
  padding: 16px;
  border: var(--line);
  background: #fff;
  font-size: 20px;
  line-height: 2;
}
.fact {
  display: inline;
  margin: 0;
  padding: 2px 3px;
  border: 0;
  border-bottom: 3px solid var(--ink);
  border-radius: 0;
  background: #fbf3d3;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.fact:hover:not(:disabled) { background: var(--yellow); }
.fact:disabled { cursor: default; color: inherit; }
/* Game over and never tapped: a true fact, shown as ordinary text. */
.fact:disabled:not(.hit):not(.miss):not(.missed) { background: none; border-bottom-color: transparent; font-weight: inherit; padding: 0; }
.fact.miss { background: none; border-bottom: 3px solid var(--red); color: var(--muted); }
.fact.hit { background: var(--blue); border-bottom-color: var(--blue); color: #fff; }
.fact.missed { background: var(--red); border-bottom-color: var(--red); color: #fff; }
.fact s { opacity: 0.75; font-weight: 400; }
.fact.fresh { animation: drop 0.28s ease-out; }

.pip.hit { background: var(--blue); }
.pip.miss { background: var(--red); }
.status-line { margin-top: 8px; font-size: 17px; font-weight: 600; }

.corrections { margin: 4px 0 12px; }
.corrections li {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
  padding: 7px 0;
  font-size: 20px;
}
.corrections li + li { border-top: 1px solid rgba(20, 20, 20, 0.18); }
.corrections s { color: var(--muted); }
.corrections strong { font-weight: 700; }
.corrections .arrow { color: var(--muted); }

/* ---------- result ---------- */

.banner {
  padding: 14px 16px;
  border: var(--line);
  color: #fff;
  font-size: 28px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.banner.won { background: var(--blue); }
.banner.lost { background: var(--red); }
.rule-label {
  margin-top: 16px;
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted);
}
.rule-text { font-size: 32px; font-weight: 800; line-height: 1.15; text-wrap: balance; }
.result-score { margin: 10px 0 16px; font-size: 19px; font-weight: 500; }
.share-preview {
  margin: 10px 0 0;
  padding: 12px;
  border: 2px dashed var(--ink);
  font-family: var(--font);
  font-size: 17px;
  white-space: pre-wrap;
}
.stats { margin-top: 14px; font-size: 17px; }
.next { margin-top: 6px; font-size: 17px; color: var(--muted); }
.next strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- help dialog, toast, dev tools ---------- */

dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 22px;
  border: var(--line);
  border-top: 14px solid var(--yellow);
  background: var(--paper);
  color: var(--ink);
}
dialog::backdrop { background: rgba(20, 20, 20, 0.6); }
dialog h2 {
  font-size: 26px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
}
dialog ol { margin: 12px 0; padding-left: 22px; }
dialog li { margin-bottom: 8px; }
dialog .small { margin-bottom: 16px; font-size: 16px; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border: var(--line);
  background: var(--ink); color: var(--paper);
  font-weight: 600; text-align: center;
  z-index: 10;
}

.dev { margin-top: 28px; padding-top: 12px; border-top: 1px dashed var(--muted); font-size: 14px; color: var(--muted); }
.dev button { border: 0; padding: 0 0 0 8px; background: none; color: var(--blue); text-decoration: underline; font-size: 14px; }

@media (max-width: 400px) {
  .top { gap: 8px; }
  .top h1 { font-size: 22px; letter-spacing: 0.1em; }
  .logo .shape { width: 17px; height: 17px; }
  .streak { font-size: 13px; }
  .icon-btn { width: 36px; height: 36px; font-size: 18px; }
  .passage { padding: 12px; font-size: 18px; }
  .col li, .proof-word, .test-form input { font-size: 18px; }
  .pick { min-width: 0; padding: 0 12px; }
  .pick .pick-text { display: none; }
  .rule-text { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}
