/* Shared by every written page: About, Player data, Sense of time, Tips and
   Privacy. The game page keeps its own inline styles; its written section below
   the card uses the same ink colours, so the two read as one site. */

:root {
  --ink: #16161A;
  --ink-soft: #55555E;
  --axis-ink: #6B6A66;   /* axis tick labels: 5.3:1 on white, so small text stays legible */
  --line: #E6E6E8;
  --page: #FFFFFF;
  --card: #0B0B0C;       /* the game card, reused for the play button */
  --accent: #D8FF3E;

  /* Charts. Two categorical slots, validated on white (CVD ΔE 24.7). */
  --series-1: #2A78D6;
  --series-2: #EB6834;
  --grid: #ECEBE6;
  --axis: #C3C2B7;
  --ref: #6B6A66;        /* reference lines: darker than the grid so they read as a marker */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

.site-head {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.brand {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.875rem;
  font-size: 0.875rem;
}
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------- prose */

main {
  max-width: 34rem;
  margin: 0 auto;
  padding: 2.25rem 1rem 4rem;
}
h1 { margin: 0 0 0.75rem; font-size: 1.875rem; line-height: 1.2; font-weight: 650; letter-spacing: -0.02em; }
h2 { margin: 2.75rem 0 0.75rem; font-size: 1.25rem; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
h3 { margin: 1.75rem 0 0.375rem; font-size: 1rem; font-weight: 600; }
p, li { color: var(--ink-soft); }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin-bottom: 0.5rem; }
b, strong { color: var(--ink); font-weight: 600; }
a { color: var(--ink); }
.lede { font-size: 1.0625rem; color: var(--ink); }
.meta, .updated { font-size: 0.875rem; color: var(--ink-soft); }
.num { font-variant-numeric: tabular-nums; }
.source { font-size: 0.875rem; }
.refs li { font-size: 0.875rem; }

/* Echoes the game card: black pill, white label, the accent dot. */
.play-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  padding: 0.75rem 1.125rem;
  background: var(--card);
  color: #FFFFFF;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}
.play-cta:hover { background: #26262A; }
.play-cta::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  margin: 0.5rem 0 1rem;
  border-collapse: collapse;
  font-size: 0.875rem;
}
table.data th, table.data td {
  padding: 0.4rem 0.75rem 0.4rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
table.data th:last-child, table.data td:last-child { padding-right: 0; }
table.data th { color: var(--ink); font-weight: 600; }
table.data td { color: var(--ink-soft); }
table.data .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------------ footer */

.site-foot {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-bottom: 0.75rem;
}
.site-foot a { color: var(--ink-soft); }
.site-foot a:hover { color: var(--ink); }
.site-foot p { margin: 0; font-size: 0.8125rem; }

/* ------------------------------------------------------------------ charts */

.chart { margin: 2rem 0 2.25rem; }
.chart figcaption { display: grid; gap: 0.125rem; margin-bottom: 1rem; }
.chart figcaption b { font-size: 0.9375rem; }
.chart figcaption span { font-size: 0.8125rem; color: var(--ink-soft); }

.plot {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
}
.yaxis { position: relative; grid-column: 1; grid-row: 1; }
.yaxis span, .xaxis span, .haxis .htrack > span {
  position: absolute;
  font-size: 0.6875rem;
  line-height: 1;
  color: var(--axis-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.yaxis span { right: 0.5rem; transform: translateY(50%); }
.area {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  height: 11rem;
  border-bottom: 1px solid var(--axis);
}
.area.short { height: 8.5rem; }
.xaxis { position: relative; grid-column: 2; grid-row: 2; height: 1.5rem; }
.xaxis span { top: 0.4rem; transform: translateX(-50%); }

.grid { position: absolute; left: 0; right: 0; border-top: 1px solid var(--grid); }
/* Reference lines are solid hairlines, one step darker than the grid. */
.href { position: absolute; left: 0; right: 0; border-top: 1px solid var(--ref); z-index: 1; pointer-events: none; }
.ref { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--ref); z-index: 1; pointer-events: none; }
.ref em {
  position: absolute;
  top: 0;
  font-style: normal;
  font-size: 0.6875rem;
  line-height: 1;
  color: var(--ink-soft);
  white-space: nowrap;
}
.ref em.left { right: 0.375rem; }
.ref em.right { left: 0.375rem; }

/* Columns. The slot is the hit target and spans the full height, so a short
   bar is as easy to hover as a tall one. */
.cols { position: absolute; inset: 0; display: flex; align-items: stretch; }
.slot { position: relative; flex: 1 1 0; display: flex; justify-content: center; align-items: flex-end; outline: none; }
.col {
  position: relative;
  display: block;
  width: min(24px, 60%);
  height: var(--h);
  background: var(--series-1);
  border-radius: 4px 4px 0 0;
}
.cols.thin .col { width: calc(100% - 2px); border-radius: 2px 2px 0 0; }
.slot.is-hot .col, .slot:focus-visible .col { background: #4C8FE0; }
.slot:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); border-radius: 4px; }
.cap {
  position: absolute;
  bottom: calc(100% + 0.3rem);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Lines. The polyline stretches with the plot; non-scaling-stroke keeps it at
   2px whatever the aspect. Dots are HTML so they stay round. */
.line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.line polyline {
  fill: none;
  stroke: var(--series-1);
  stroke-width: 2px;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.pts { position: absolute; inset: 0; }
.pt { position: absolute; top: 0; bottom: 0; outline: none; }
.pt::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 1px solid var(--ref);
  opacity: 0;
}
.pt.is-hot::before, .pt:focus-visible::before { opacity: 1; }
.dot {
  position: absolute;
  left: 50%;
  bottom: var(--y);
  width: 12px;   /* 8px mark plus its 2px surface ring */
  height: 12px;
  transform: translate(-50%, 50%);
  border-radius: 50%;
  background: var(--series-1);
  border: 2px solid var(--page);
}
.pt.is-hot .dot, .pt:focus-visible .dot { width: 14px; height: 14px; }
.pt-label {
  position: absolute;
  left: 50%;
  bottom: calc(var(--y) + 0.6rem);
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pt-label.end { left: auto; right: 0; transform: none; }
.multiples { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.panel-title { margin: 0 0 0.5rem; font-size: 0.8125rem; font-weight: 600; color: var(--ink); }
@media (max-width: 30rem) {
  .multiples { grid-template-columns: 1fr; gap: 1.25rem; }
}

/* Horizontal bars. Rows touch, so the per-row reference marks join into one
   continuous line. */
.hbars { display: grid; }
.hrow {
  display: grid;
  grid-template-columns: minmax(6.5rem, 34%) minmax(0, 1fr);
  align-items: center;
  column-gap: 0.75rem;
}
.hlabel { font-size: 0.8125rem; color: var(--ink-soft); line-height: 1.25; padding: 0.35rem 0; }
.htrack { position: relative; align-self: stretch; min-height: 2.25rem; }
.htrack::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--ref-at);
  border-left: 1px solid var(--ref);
  pointer-events: none;
  z-index: 1;
}
.hbar {
  position: absolute;
  left: 0;
  top: 50%;
  width: var(--w);
  height: 16px;
  transform: translateY(-50%);
  background: var(--series-1);
  border-radius: 0 4px 4px 0;
  outline: none;
}
.hbar::before { content: ""; position: absolute; inset: -8px 0; }  /* a hit area taller than the mark */
.hbar.is-hot, .hbar:focus-visible { background: #4C8FE0; }
.hbar:focus-visible { box-shadow: 0 0 0 2px var(--page), 0 0 0 4px var(--ink); }
.hval {
  position: absolute;
  top: 50%;
  left: calc(var(--w) + 0.2rem);
  transform: translateY(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
  padding: 0 0.2rem;
  background: var(--page);  /* a surface gap where the label crosses the reference line */
}
/* Inside the bar end, for bars that run close to the reference at 100%. */
.hval.in { left: auto; right: calc(100% - var(--w) + 0.2rem); color: #FFFFFF; background: none; }
.haxis .htrack { min-height: 1.25rem; border-top: 1px solid var(--axis); }
.haxis .htrack::after { display: none; }
.haxis .htrack > span { top: 0.4rem; transform: translateX(-50%); }
.haxis .htrack > span:first-child { transform: none; }
.haxis .htrack > span:last-child { transform: translateX(-100%); }

/* The readout. Dark on the white page; value first, label second. */
.chart-tip {
  position: fixed;
  z-index: 20;
  display: grid;
  gap: 0.125rem;
  max-width: 15rem;
  padding: 0.4rem 0.55rem;
  background: var(--card);
  color: #FFFFFF;
  border-radius: 6px;
  font-size: 0.75rem;
  line-height: 1.3;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.chart-tip[hidden] { display: none; }
.chart-tip strong { color: #FFFFFF; font-size: 0.8125rem; font-weight: 600; }
.chart-tip span { color: rgba(255, 255, 255, 0.72); }

.table-view { margin-top: 0.75rem; }
.table-view summary {
  width: max-content;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.table-view summary:hover { color: var(--ink); }

@media (forced-colors: active) {
  .col, .hbar, .dot { background: CanvasText; }
  .line polyline { stroke: CanvasText; }
}
