/* EB Garamond, served from web/fonts/ (SIL Open Font License, web/fonts/OFL.txt), not from Google:
   no extra connections before the text settles, and no visitor data sent to Google. The browser
   fetches only the character sets a page uses; file names carry a hash of their contents. */
/* cyrillic-ext */
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/eb-garamond-italic-cyrillic-ext.ae656016.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/eb-garamond-italic-cyrillic.302382ae.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/eb-garamond-italic-greek-ext.0ca9b96d.woff2) format("woff2");
  unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/eb-garamond-italic-greek.dabe76ac.woff2) format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/eb-garamond-italic-vietnamese.15e23beb.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/eb-garamond-italic-latin-ext.c0a00625.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/eb-garamond-italic-latin.8ff68a81.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(../fonts/eb-garamond-upright-cyrillic-ext.0e9b9ceb.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(../fonts/eb-garamond-upright-cyrillic.5ef11dae.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(../fonts/eb-garamond-upright-greek-ext.5017d295.woff2) format("woff2");
  unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(../fonts/eb-garamond-upright-greek.55a3e905.woff2) format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(../fonts/eb-garamond-upright-vietnamese.4911e468.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(../fonts/eb-garamond-upright-latin-ext.dc4ff18a.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(../fonts/eb-garamond-upright-latin.fbc7eeae.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* coincidates */

:root {
  --bg: #ffffff;
  --ink: #1a1a1b;
  --muted: #787c7e;
  --faint: #b9bcbe;
  --line: #d3d6da;
  --wash: #f4f4f2;
  --green: #6aaa64;
  --yellow: #c9b458;
  --miss: #787c7e;
  --bridge: rgba(106, 170, 100, 0.26);
  --bridge-close: rgba(201, 180, 88, 0.32);
  --blue: #5b8fd0;
  --toast-bg: #1a1a1b;
  --toast-ink: #ffffff;
  --shadow: 0 4px 23px rgba(0, 0, 0, 0.14);
  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --row: 46px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #121213;
  --ink: #e6e6e4;
  --muted: #8b8f91;
  --faint: #4a4c4e;
  --line: #3a3a3c;
  --wash: #1c1c1d;
  --green: #538d4e;
  --yellow: #b59f3b;
  --miss: #5a5c5e;
  --bridge: rgba(83, 141, 78, 0.34);
  --bridge-close: rgba(181, 159, 59, 0.36);
  --blue: #4a78b3;
  --toast-bg: #e6e6e4;
  --toast-ink: #121213;
  --shadow: 0 4px 23px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100vh; min-height: 100dvh; }

button { font: inherit; color: inherit; }

a { color: inherit; }

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

.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 56px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.top-side { display: flex; gap: 4px; }
.top-side.right { justify-content: flex-end; }

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: 0.01em;
  text-decoration: none;
  line-height: 1;
  padding-bottom: 3px;
}

.icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.icon svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon svg .dot { fill: var(--ink); stroke: none; }
.icon:hover { background: var(--wash); }

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

main {
  max-width: 520px;
  margin: 0 auto;
  padding: 26px 16px 48px;
}

.meta {
  margin: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.prompt {
  margin: 10px 0 0;
  text-align: center;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.2;
  text-wrap: balance;
}
.prompt .arrow { color: var(--muted); font-family: var(--sans); font-weight: 300; margin: 0 0.3em; font-size: 0.8em; }

/* the puzzle's rule ("Only people who drowned"): a clear banner, not a footnote */
.rule {
  margin: 12px auto 0;
  width: fit-content;
  max-width: 100%;
  padding: 7px 14px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}
.rule[hidden] { display: none; }

.sub {
  margin: 6px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  min-height: 1.2em;
}
.sub b { color: var(--ink); font-weight: 600; }
.par-pick {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-bottom: 1.5px dashed var(--muted);
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding: 0 2px;
  cursor: pointer;
}
.par-pick:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.par-pick-wrap { cursor: pointer; white-space: nowrap; }
.sub .sep { color: var(--faint); }
/* the par picker on random pairings: a transparent select sits over "par N ▾" */
.level-pick { position: relative; display: inline-block; border-bottom: 1.5px dashed var(--muted); }
.level-pick select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.par-pick-wrap .caret { color: var(--ink); font-size: 15px; line-height: 1; margin-left: 3px; pointer-events: none; }
.seg-par label { flex: 1 1 0; min-width: 0; }
.seg-era label { flex: 1 1 30%; }
.seg-par label:first-of-type { flex-grow: 1.6; }

/* ------------------------------------------------------------ timeline */

.timeline {
  position: relative;
  margin: 26px 0 0;
  user-select: none;
  transition: height 0.35s ease;
}

.tl-grid {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed var(--line);
  transition: left 0.45s ease, opacity 0.3s ease;
}
.tl-grid span {
  position: absolute;
  bottom: -25px;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* the open gap's edge years, just above the regular axis labels */
.tl-edge {
  position: absolute;
  bottom: -9px;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: left 0.45s ease;
}
.tl-edge[data-align="start"] { transform: translateX(-2px); }
.tl-edge[data-align="end"] { transform: translateX(calc(-100% + 2px)); }

.tl-row {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--row);
  transition: top 0.4s ease, opacity 0.3s ease;
}

.tl-label {
  position: absolute;
  z-index: 3;
  top: 3px;
  font-size: 13px;
  line-height: 20px; /* room for descenders (g, y, p) inside the clipped box */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: left 0.45s ease, right 0.45s ease;
}
.tl-label .n { font-weight: 600; }
/* names link to Wikipedia: look like text, underline on hover */
a.wiki { color: inherit; text-decoration: none; }
a.wiki:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a.wiki:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 2px; }
.tl-row.end .tl-label .n { font-family: var(--serif); font-size: 15px; font-weight: 600; }
.tl-label .d { color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }

.tl-bar {
  position: absolute;
  z-index: 2;
  top: 28px;
  height: 10px;
  border-radius: 5px;
  background: var(--ink);
  transition: left 0.45s ease, width 0.45s ease, background-color 0.3s ease;
}
/* uncertain ends fade out: the solid part is the certain lifetime */
.tl-bar .fz { position: absolute; top: 0; bottom: 0; }
.tl-bar .fz.s { left: 0; border-radius: 5px 0 0 5px; background: linear-gradient(to right, var(--bg), transparent); opacity: 0.75; }
.tl-bar .fz.e { right: 0; border-radius: 0 5px 5px 0; background: linear-gradient(to left, var(--bg), transparent); opacity: 0.75; }

.tl-row.new .tl-bar { animation: grow 0.5s ease both; transform-origin: left center; }
@keyframes grow { from { transform: scaleX(0.2); opacity: 0; } to { transform: none; opacity: 1; } }

/* year endpoints are a single moment */
.tl-year {
  position: absolute;
  z-index: 2;
  top: 26px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  transform: rotate(45deg);
  background: var(--ink);
  border-radius: 2px;
  transition: left 0.45s ease;
}

/* an event lasting several years: a hollow bar, so it reads as a span of time, not a life */
.tl-event {
  position: absolute;
  z-index: 2;
  top: 28px;
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: repeating-linear-gradient(-45deg, var(--ink) 0 1.5px, transparent 1.5px 5px);
  transition: left 0.45s ease, width 0.45s ease;
}

.tl-bridge {
  position: absolute;
  z-index: 1;
  background: var(--bridge);
  border-radius: 3px;
  transition: left 0.45s ease, width 0.45s ease, top 0.4s ease, height 0.4s ease;
  animation: fade 0.5s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.tl-gap {
  position: absolute;
  height: var(--row);
  transition: left 0.45s ease, width 0.45s ease, top 0.4s ease;
}
.tl-gap::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 2px dashed var(--faint);
}
.tl-gap span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  padding: 0 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tl-row.detour .tl-bar { background: var(--yellow); }

.tl-row.island .tl-bar { background: var(--blue); }
/* people filled in after a give-up: outlined, so your own links stay distinct */
.tl-row.revealed .tl-bar { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }
.tl-row.revealed .tl-bar .fz { display: none; }
.tl-row.revealed .tl-label .n { color: var(--muted); }

.tl-row.ghost { opacity: 0.55; }
.tl-row.ghost .tl-bar { background: var(--muted); }

/* ------------------------------------------------------------ tiles */

.tiles {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 44px 0 0;
  min-height: 22px;
}
.tile {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  background: var(--miss);
  animation: pop 0.25s ease both;
}
.tile.green { background: var(--green); }
.tile.yellow { background: var(--yellow); }
.tile.blue { background: var(--blue); }
.tile.hint { background: none; font-size: 15px; line-height: 22px; text-align: center; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.08); } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------ entry */

.entry { margin-top: 18px; }

.combo { position: relative; }

.combo input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  outline: none;
  transition: border-color 0.15s ease;
}
.combo input:focus { border-color: var(--muted); }
.combo input::placeholder { color: var(--faint); }
.combo input.shake { animation: shake 0.4s ease; }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.suggestions {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
}
.suggestions li {
  padding: 8px 14px;
  cursor: pointer;
  line-height: 1.25;
}
.suggestions li[aria-selected="true"] { background: var(--wash); }
.suggestions .n { display: block; font-size: 16px; }
.suggestions .n mark { background: none; color: inherit; font-weight: 700; }
.suggestions .ds { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestions li.in { opacity: 0.45; }

.aux {
  margin: 12px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  min-height: 1.3em;
}
.aux .sep { margin: 0 8px; color: var(--faint); }
.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--faint);
  cursor: pointer;
  font-size: 14px;
}
.link:hover { color: var(--ink); }
.hint-text { display: block; margin-top: 8px; color: var(--ink); }

.after { margin-top: 26px; text-align: center; }
.example-line { margin: 0 0 20px; font-size: 15px; line-height: 1.5; }
.example-line .k { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.example-line a { text-decoration: none; border-bottom: 1px solid var(--line); }
.example-line a:hover { border-color: var(--ink); }
.example-line .arr { color: var(--muted); }
.after .count { font-size: 13px; color: var(--muted); margin-top: 12px; font-variant-numeric: tabular-nums; }

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

.primary, .secondary {
  height: 48px;
  padding: 0 26px;
  border-radius: 24px;
  border: 0;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.primary { background: var(--green); color: #fff; }
.primary:disabled { opacity: 0.4; cursor: default; }
.secondary { background: none; border: 1px solid var(--ink); color: var(--ink); }
.secondary:disabled { opacity: 0.4; cursor: default; }
.primary svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------ toasts */

.toasts {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  background: var(--toast-bg);
  color: var(--toast-ink);
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  line-height: 1.35;
  animation: toast-in 0.2s ease both;
}
.toast.out { animation: toast-out 0.3s ease both; }
.toast small { display: block; font-weight: 400; opacity: 0.8; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; } }

/* ------------------------------------------------------------ dialogs */

dialog {
  width: min(500px, calc(100vw - 24px));
  max-height: calc(100dvh - 40px);
  padding: 30px 26px 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow-y: auto;
}
dialog:focus { outline: none; }
dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
dialog[open] { animation: rise 0.2s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

dialog.side {
  margin: 0 auto 0 0;
  height: 100dvh;
  max-height: none;
  width: min(300px, 86vw);
  border-radius: 0;
  border-width: 0 1px 0 0;
  padding-top: 64px;
}
dialog.side[open] { animation: slide 0.2s ease both; }
@keyframes slide { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }

.close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  background: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.close:hover { color: var(--ink); }
.close:focus:not(:focus-visible) { outline: none; }

dialog h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
}
.small-caps {
  font-family: var(--sans) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  margin: 24px 0 12px !important;
}
dialog h3.small-caps { margin-top: 22px !important; }

.lede { font-size: 17px; margin: 0 0 16px; line-height: 1.45; }
.rules { padding-left: 20px; margin: 18px 0; line-height: 1.5; }
.rules li { margin-bottom: 4px; }
.fine { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 12px 0 0; }

.legend { display: flex; flex-direction: column; gap: 8px; font-size: 14px; margin: 18px 0; }
.legend span { display: flex; align-items: center; gap: 10px; }
.t { display: inline-block; width: 18px; height: 18px; border-radius: 3px; flex: none; }
.t-green { background: var(--green); }
.t-yellow { background: var(--yellow); }
.t-blue { background: var(--blue); }
.t-miss { background: var(--miss); }

.example { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px 30px; }
.example .timeline { margin: 0; }

/* stats */
.stat-row { display: flex; justify-content: center; gap: 6px; }
.stat { flex: 1; max-width: 90px; text-align: center; }
.stat b { display: block; font-size: 34px; font-weight: 400; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { font-size: 12px; line-height: 1.2; display: block; }

.dist { display: grid; grid-template-columns: auto 1fr; gap: 5px 8px; align-items: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.dist .k { text-align: right; min-width: 34px; }
.dist .v { display: flex; }
.dist .v span {
  background: var(--miss);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 2px 8px;
  min-width: 22px;
  text-align: right;
}
.dist .v span.on { background: var(--green); }

.result { text-align: center; }
.result h2 { margin-bottom: 4px; }
.result .score { font-size: 15px; color: var(--muted); margin: 0 0 18px; }
.result .score b { color: var(--ink); }

.chainlist { list-style: none; margin: 0 auto; padding: 0; text-align: left; max-width: 380px; }
.chainlist li.p { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; }
.chainlist .face {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--wash) center / cover no-repeat;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--muted);
}
.chainlist .who a { text-decoration: none; font-weight: 600; }
.chainlist .who a:hover { text-decoration: underline; }
.chainlist .who small { display: block; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.chainlist li.l {
  margin-left: 16px;
  padding: 3px 0 3px 27px;
  border-left: 2px solid var(--green);
  font-size: 12px;
  color: var(--muted);
}
.chainlist li.l.near { border-color: var(--yellow); }
.revealed-tag { font-style: normal; color: var(--muted); }

.pills { display: flex; justify-content: center; gap: 8px; margin: 0 0 20px; }
.pill { flex: 1; max-width: 120px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 4px; }
.pill b { display: block; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pill span { display: block; font-size: 12px; color: var(--muted); }
.chainlist li.y .face { border-radius: 3px; transform: rotate(45deg) scale(0.62); background: var(--ink); }
/* portrait credits (authors and licences from Wikimedia Commons), folded under the results */
.credits { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.credits summary { cursor: pointer; }
.credits ul { margin: 6px 0 0; padding: 0; list-style: none; }
.credits li { margin: 2px 0; }
.credits a { color: inherit; }

.best { margin-top: 16px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.best b { color: var(--ink); font-weight: 600; }

.result-foot { margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.share-preview {
  margin: 0;
  width: 100%;
  max-width: 380px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--wash);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  text-align: left;
  user-select: all;
}
.result-foot .count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.result-foot .count b { display: block; font-size: 26px; color: var(--ink); font-weight: 400; margin-top: 2px; }

/* menu */
.menu { display: flex; flex-direction: column; }
.menu a, .menu button {
  display: block;
  text-align: left;
  padding: 14px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  font-size: 18px;
  text-decoration: none;
  cursor: pointer;
}
.menu a:hover, .menu button:hover { color: var(--muted); }

/* forms */
.form { display: flex; flex-direction: column; gap: 18px; }
.seg { border: 0; padding: 0; margin: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.seg legend, .field > span { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: block; padding: 0; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block;
  text-align: center;
  padding: 10px 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  font-size: 15px;
}
.seg input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.seg input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.field { display: block; }
.field select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}
.field .combo input { height: 46px; font-size: 16px; }
.make-status { margin: 0; min-height: 1.4em; font-size: 15px; text-align: center; }
.make-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.also { margin: 10px 0 0; font-size: 14px; color: var(--muted); text-align: center; line-height: 1.5; }
.also a.wiki { color: var(--ink); }

/* why a hand-picked daily's two ends belong together, shown once it's over */
.note { margin: 0 auto 14px; max-width: 34em; font-family: var(--serif); font-size: 17px; font-style: italic; line-height: 1.4; text-align: center; }

/* puzzle lab (testing only) */
dialog.wide { width: min(780px, calc(100vw - 24px)); }
.lab-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field input[type="number"] {
  width: 100%; height: 46px; padding: 0 12px; font: inherit; font-size: 16px;
  color: var(--ink); background: var(--bg); border: 2px solid var(--line); border-radius: 4px;
}
.lab-out { margin: 20px 0 18px; font-size: 15px; line-height: 1.45; }
.lab-note { margin: 8px 0; color: var(--muted); }
.lab-warn { margin: 8px 0; padding: 8px 12px; border-radius: 6px; background: var(--bridge-close); }
.lab-head { display: flex; gap: 18px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.lab-par { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.lab-par b { font-family: var(--serif); font-size: 44px; line-height: 1; }
.lab-par span, .lab-k span { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.lab-facts p { margin: 2px 0; }
.lab-h { margin: 18px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.lab-chain { margin: 0; }
.lab-routes { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.lab-routes th, .lab-routes td { padding: 5px 8px 5px 0; text-align: left; border-bottom: 1px solid var(--line); }
.lab-routes th { font-size: 12px; font-weight: 700; color: var(--muted); }
.lab-routes td:nth-child(n+2), .lab-routes th:nth-child(n+2) { text-align: right; }
.lab-note.small { font-size: 13px; margin-top: 6px; }
.lab-step { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.lab-k { display: flex; flex-direction: column; }
.lab-names { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-block; padding: 2px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--wash); font-size: 14px; }
.linkish { border: 0; background: none; padding: 2px 4px; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 14px; }
.lab-ideas { display: flex; flex-direction: column; }
.lab-idea { display: grid; grid-template-columns: 58px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.lab-idea-par { font-size: 13px; }
button.small { height: 32px; padding: 0 14px; font-size: 14px; }
.lab-years { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lab-years input {
  width: 100%; height: 46px; padding: 0 12px; font: inherit; font-size: 16px;
  color: var(--ink); background: var(--bg); border: 2px solid var(--line); border-radius: 4px;
}
.lab-slider { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.lab-slider input { flex: 1; max-width: 280px; accent-color: var(--green); }
.lab-slider-v { font-size: 14px; color: var(--muted); }
.lab-trap-h { margin: 2px 0 4px; font-size: 13px; color: var(--muted); }
.menu-note { margin: 18px 0 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
@media (max-width: 560px) {
  .lab-form { grid-template-columns: 1fr; }
  .lab-head { align-items: flex-start; }
}

/* archive */
.archive { list-style: none; padding: 0; margin: 0; }
.archive a {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.archive a:hover { background: var(--wash); }
.archive .no { font-weight: 700; }
.archive .when { color: var(--muted); }
.archive .res { display: flex; gap: 3px; }
.archive .res i { width: 10px; height: 10px; border-radius: 2px; background: var(--miss); }
.archive .res i.green { background: var(--green); }
.archive .res i.yellow { background: var(--yellow); }
.archive .res i.blue { background: var(--blue); }
.archive .res em { font-style: normal; font-size: 13px; color: var(--muted); margin-left: 6px; }

.noscript { text-align: center; padding: 40px; }

@media (max-width: 420px) {
  .prompt { font-size: 24px; }
  .wordmark { font-size: 27px; }
  main { padding-top: 20px; }
  dialog { padding: 26px 18px 20px; }
}

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