:root {
  --paper: #faf6ec;
  --ink: #23201a;
  --muted: #6b6252;
  --brass: #9a6b1f;
  --brass-deep: #6f4c12;
  --line: #e2d7bd;
  --card: #fffdf6;
  --loss: #a33b2e;
  --gain: #2e6e46;
  --focus: #1a5fb4;
  --max: 42rem;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.075rem;
  line-height: 1.65;
  font-kerning: normal;
}
.topbar {
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}
.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
}
.langswitch a {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  margin-left: 0.8rem;
}
.langswitch a[aria-current="true"] { color: var(--ink); text-decoration: underline; }
main .wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1rem 4rem;
}
.kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--brass-deep);
  margin: 2rem 0 0.6rem;
}
h1.display {
  font-family: Fraunces, Georgia, serif;
  font-weight: 650;
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1.08;
  margin: 0 0 0.8rem;
  text-wrap: balance;
}
h1.display em { font-style: italic; color: var(--brass-deep); }
.deck { font-size: 1.15rem; margin: 0 0 1rem; }
.facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  padding: 0.7rem 0;
  margin: 0 0 0.6rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.privacy {
  font-size: 0.95rem;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 0.7rem 0.9rem;
}
.gamble {
  background: var(--card);
  border: 1.5px solid var(--ink);
  padding: 1rem 1rem 0.9rem;
  margin: 1rem 0;
}
.gamble h2 { font-size: 1.25rem; margin: 0 0 0.3rem; }
.gamble .odds { margin: 0 0 0.8rem; }
.gamble .odds strong.g { color: var(--gain); }
.gamble .odds strong.l { color: var(--loss); }
.btnrow { display: flex; gap: 0.7rem; flex-wrap: wrap; }
button {
  font: inherit;
  cursor: pointer;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  padding: 0.55rem 1.1rem;
  min-height: 44px;
}
button:hover { background: #f1e8d2; }
button:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
button.primary { background: var(--ink); color: var(--paper); }
button.primary:hover { background: #3a352c; }
button[disabled] { opacity: 0.45; cursor: default; }
.progress {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  color: var(--muted);
}
.result {
  border: 2px solid var(--ink);
  background: var(--card);
  padding: 1.1rem;
  margin: 1.5rem 0;
}
.result h2 { margin-top: 0; }
.badge {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  background: var(--ink);
  color: var(--paper);
  padding: 0.25rem 0.7rem;
  margin: 0.4rem 0;
}
.bars { margin: 1rem 0; }
.bar-row { display: grid; grid-template-columns: 9rem 1fr 3.2rem; gap: 0.6rem; align-items: center; margin: 0.35rem 0; font-size: 0.95rem; }
.bar-track { background: #eee4c9; height: 0.9rem; position: relative; }
.bar-fill { background: var(--brass); height: 100%; }
.bar-fill.you { background: var(--ink); }
figure.scale { margin: 1rem 0; border: 1px solid var(--line); background: var(--paper); padding: 0.6rem; }
figcaption { font-size: 0.9rem; color: var(--muted); }
h2.sec { font-family: Fraunces, Georgia, serif; font-size: 1.5rem; margin: 2.2rem 0 0.5rem; }
.method, .limits {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0.8rem 1rem;
  font-size: 0.98rem;
}
.sources { font-size: 0.95rem; }
.sources a { color: var(--brass-deep); }
footer.colophon { border-top: 2px solid var(--ink); margin-top: 3rem; padding-top: 1rem; font-size: 0.9rem; color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (max-width: 480px) {
  .bar-row { grid-template-columns: 6.5rem 1fr 2.8rem; }
}
