/* Bygone design system. One of everything: one accent (sealing-wax red), one radius family, two button looks,
   one card recipe, a 4-8-12-16-24-32-48-64 spacing scale. Light paper by default, a near-black grade when the device asks,
   and either one when the player picks it with the header switch (data-theme on <html>, set before paint by index.html). */
:root {
  color-scheme: light dark;
  --bg: #f6f1e7; --surface: #fffdf8; --ink: #1d1a17; --muted: #5e574d; --line: rgb(29 26 23 / .14); --tint: #efe3d3;
  --accent: #8a2c1c; --on-accent: #fff; --accent-ink: #8a2c1c; /* accent fills; accent-ink is the accent as text or marks on the ground */
  --sea: #dce8ee; --land: #e4d9c3; --state: #f4ecd9; --border: #8d826b;
  /* One colour per game, from old pigments: terracotta, lapis, olive, ochre, plum, teal. --on-g is the text that sits on one as a fill. */
  --c-footsteps: #a8481b; --c-realms: #2f5597; --c-links: #4b6b22; --c-epoch: #865c00; --c-flags: #7d3270; --c-pinpoint: #11696b; --c-likeness: #9b2f57; --c-monuments: #6f4e37; --c-dossier: #433f8f; --on-g: #fff;
  /* States on a map: six soft fills taken in turn, like a political atlas. */
  --m1: #efd8c6; --m2: #dde6c9; --m3: #d4e0ef; --m4: #ead8e6; --m5: #f2e6bf; --m6: #d1e8e1;
  /* Links groups by level, easiest first: teal, sand, terracotta, plum (from this palette, not the yellow-to-purple of other grouping games). */
  --l1: #cde6e1; --l2: #efdeb0; --l3: #f2cdb8; --l4: #e8c9e1;
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px;
  --nav: 64px; --wrap: 1080px; --gut: 32px;
  --ease: cubic-bezier(.2, .8, .2, 1); --enter: cubic-bezier(.22, 1, .36, 1);
  --display: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
}
/* The dark grade, twice over: once for a device set to dark with no choice made, once for a player who chose it. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0a0a0a; --surface: #151515; --ink: #efefef; --muted: #a5a29c; --line: rgb(239 239 239 / .16); --tint: #201416;
    --accent: #b11226; --accent-ink: #ff8391;
    --sea: #0b1318; --land: #1b1c1f; --state: #26272b; --border: #6f7178;
    --c-footsteps: #f2a477; --c-realms: #93b3f0; --c-links: #a8cc74; --c-epoch: #e9c25e; --c-flags: #e39ad3; --c-pinpoint: #6fd0c8; --c-likeness: #f29bbd; --c-monuments: #d9b48f; --c-dossier: #b4b0f2; --on-g: #111;
    --m1: #4a352b; --m2: #36422c; --m3: #2c3b4f; --m4: #45333f; --m5: #474027; --m6: #284239;
    --l1: #1f4843; --l2: #594513; --l3: #6b3418; --l4: #5b2a52;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0a0a0a; --surface: #151515; --ink: #efefef; --muted: #a5a29c; --line: rgb(239 239 239 / .16); --tint: #201416;
    --accent: #b11226; --accent-ink: #ff8391;
    --sea: #0b1318; --land: #1b1c1f; --state: #26272b; --border: #6f7178;
    --c-footsteps: #f2a477; --c-realms: #93b3f0; --c-links: #a8cc74; --c-epoch: #e9c25e; --c-flags: #e39ad3; --c-pinpoint: #6fd0c8; --c-likeness: #f29bbd; --c-monuments: #d9b48f; --c-dossier: #b4b0f2; --on-g: #111;
    --m1: #4a352b; --m2: #36422c; --m3: #2c3b4f; --m4: #45333f; --m5: #474027; --m6: #284239;
    --l1: #1f4843; --l2: #594513; --l3: #6b3418; --l4: #5b2a52;
}
:root[data-theme='light'] { color-scheme: light; }
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--nav) + 24px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
.wrap, main { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gut)); margin: 0 auto; padding: 0 var(--gut); }
main { padding-top: calc(var(--nav) + 32px); padding-bottom: 64px; min-height: 80vh; }
main:focus { outline: none; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(30px, 2.4vw + 20px, 44px); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 16px; }
h1 small { font: 500 13px/1.4 system-ui, sans-serif; letter-spacing: 0; color: var(--muted); }
h2 { font-size: 22px; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
p { margin: 8px 0; }
a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: text-decoration-color 150ms var(--ease); }
a:hover { text-decoration-thickness: 2px; }
.dim { color: var(--muted); font-size: 14px; }
.lede { font-size: 18px; max-width: 62ch; margin-top: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.glyph { width: 24px; height: 24px; fill: currentColor; flex: none; }
summary { cursor: pointer; padding: 8px 0; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
section { margin: 24px 0; }

/* Header: fixed, opaque, one hairline, the same at every scroll depth. On a phone the three tabs move to the thumb. */
header { position: fixed; inset: 0 0 auto; z-index: 10; height: var(--nav); background: var(--bg); border-bottom: 1px solid var(--line); }
header .wrap { height: 100%; display: flex; align-items: center; gap: 12px; }
.skip { position: absolute; left: var(--gut); top: -80px; z-index: 11; padding: 10px 16px; border-radius: var(--r-sm); background: var(--ink); color: var(--bg); }
.skip:focus { top: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 400 22px/1 var(--display); letter-spacing: -.01em; color: var(--ink); text-decoration: none; min-height: 44px; }
.brand svg { width: 26px; height: 26px; color: var(--accent-ink); }
#streak { font-weight: 600; font-size: 14px; color: var(--accent-ink); }
header nav { display: flex; height: 100%; margin-left: auto; }
header nav a { display: grid; place-items: center; padding: 0 16px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; border-bottom: 2px solid transparent; transition: color 150ms var(--ease); }
header nav a:hover { color: var(--ink); }
header nav a[aria-current] { color: var(--ink); border-bottom-color: var(--accent-ink); }
footer { border-top: 1px solid var(--line); padding: 16px 0 32px; font-size: 14px; color: var(--muted); }
footer p { max-width: 80ch; }

/* Buttons: 44px, a filled accent for the one main action in view, an outline for everything else. They step up on hover and press down. */
button, .btn { font: 500 16px/1 system-ui, sans-serif; min-height: 44px; padding: 0 24px; border-radius: var(--r-sm); border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: transform 150ms var(--ease), background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease); }
.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button:disabled { opacity: .4; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):hover, .btn:hover { transform: translateY(-1px); background: var(--ink); color: var(--bg); }
  .primary:not(:disabled):hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); color: var(--on-accent); }
  .card:hover { transform: translateY(-2px); border-color: var(--ink); }
  .tile:not([aria-pressed='true']):hover { background: var(--tint); color: var(--ink); }
}
button:not(:disabled):active, .btn:active, .card:active { transform: translateY(1px) scale(.985); transition-duration: 90ms; }
.chip { min-height: 36px; padding: 0 12px; font-size: 14px; border-color: var(--line); }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
input { font: inherit; flex: 1 1 180px; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); }
.msg { min-height: 1.5em; font-weight: 600; color: var(--accent-ink); }
.panel { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.badge { display: inline-block; margin: 0 0 12px; padding: 4px 12px; border-radius: 99px; background: var(--tint); font-size: 13px; font-weight: 500; }
.trio, .pips span { display: inline-flex; gap: 6px; }
.trio i, .pips i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent-ink); }
.trio i.on, .pips i.on { background: var(--accent-ink); }
.pips { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.pips i { width: 10px; height: 10px; border-color: var(--ink); }
.pips i.on { background: var(--ink); }

/* First visit: one screen that says what this is and shows today's real puzzle, an outline to name. */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; min-height: calc(100svh - var(--nav) - 96px); margin: 0; }
.hero h1 { display: block; font-size: clamp(40px, 5.2vw, 76px); line-height: 1; letter-spacing: -.03em; margin-bottom: 24px; }
.hero .fact { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 16px; }
.hero .row { margin-top: 32px; gap: 12px; }
.hero .thumb { aspect-ratio: 4 / 3; border-radius: var(--r-lg); padding: 8%; }
.hero > * > * { animation: enter 700ms var(--enter) both; }
.hero > * > :nth-child(2) { animation-delay: 90ms; }
.hero > * > :nth-child(3) { animation-delay: 180ms; }
.hero > * > :nth-child(4) { animation-delay: 270ms; }
.hero > :last-child > * { animation-delay: 200ms; }
@keyframes enter { from { opacity: 0; transform: translateY(14px); } }

/* Today: the puzzles lead; streak, rank and the archive sit beside them on a wide screen and under them on a phone. */
.today { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px 48px; align-items: start; }
.today aside > :first-child, .today .main > :first-child { margin-top: 0; }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; } /* two across beside the sidebar, three on a wide screen */
.card { display: grid; gap: 12px; padding: 12px 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink); text-decoration: none; transition: transform 150ms var(--ease), border-color 150ms var(--ease); }
.thumb { display: block; width: 100%; aspect-ratio: 16 / 11; padding: 6%; background: var(--sea); border-radius: var(--r-md); overflow: hidden; }
.thumb .polity { stroke-width: 3; }
.thumb .dot { fill: var(--accent-ink); stroke: var(--surface); stroke-width: 8; }
.thumb .cell { fill: var(--surface); stroke: var(--border); stroke-width: 1; }
.card.done .thumb .cell { fill: var(--accent-ink); stroke: none; }
.card.done .thumb .cell:nth-child(n + 5) { opacity: .75; }
.card.done .thumb .cell:nth-child(n + 9) { opacity: .5; }
.card.done .thumb .cell:nth-child(n + 13) { opacity: .28; }
.card.done .thumb .shape { fill: var(--accent-ink); }
.card .what { display: grid; padding: 0 4px; }
.card strong { font: 400 24px/1.15 var(--display); letter-spacing: -.01em; }
.card .what span { color: var(--muted); font-size: 14px; }
.card .state { display: flex; align-items: baseline; gap: 8px; padding: 0 4px; min-height: 32px; }
.card .state b { font: 400 30px/1 var(--display); }
.card .state small { color: var(--muted); font-size: 13px; }
.card .go { font: 500 14px/1 system-ui, sans-serif; padding: 9px 16px; border-radius: 99px; border: 1px solid var(--line); }
.card.next { border-color: var(--accent-ink); }
.card.next .go { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.summary { position: relative; text-align: center; }
.summary h2, .summary .row { justify-content: center; }
.big { font: 400 64px/1 var(--display); letter-spacing: -.03em; margin: 8px 0 16px; }
.big small { font-size: 20px; color: var(--muted); letter-spacing: 0; }
.teaser { margin: 24px auto 0; padding-top: 16px; border-top: 1px solid var(--line); max-width: 52ch; }
/* The wax seal stamped on a finished day. */
.seal { position: absolute; top: -16px; right: 24px; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 400 18px var(--display); box-shadow: 0 0 0 3px var(--accent), inset 0 0 0 2px var(--on-accent); transform: rotate(-12deg); animation: stamp 500ms var(--enter) both 200ms; }
@keyframes stamp { from { transform: rotate(-30deg) scale(2); opacity: 0; } }
.streak { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 16px; background: var(--tint); border-color: transparent; }
.streak p { margin: 0; }
.num { font: 400 56px/1 var(--display); letter-spacing: -.03em; grid-row: span 2; }
.streak:not(.lit) .num { opacity: .4; }
.rank { margin: 0; }
progress { display: block; width: 100%; height: 8px; margin-top: 12px; accent-color: var(--accent); }
.archive { list-style: none; padding: 0; margin: 8px 0 0; }
.archive li { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 14px; }
.archive li > span { flex: 1 0 100%; } /* the date sits above its row of games, so the row holds however many games there are */
.archive a { position: relative; display: grid; place-items: center; flex: 1 1 0; min-width: 32px; max-width: 44px; height: 48px; color: var(--ink); border-radius: var(--r-sm); }
.archive a.done { opacity: .6; }
.archive a b { position: absolute; right: 2px; bottom: 4px; font-size: 13px; color: var(--accent-ink); }

/* Chronicle: a spine with one entry per story; solved entries get a filled marker. */
.narrow { max-width: 720px; margin: 0 auto; }
.timeline { list-style: none; margin: 24px 0; padding: 0 0 0 24px; border-left: 1px solid var(--border); }
.timeline li { position: relative; margin: 0 0 12px; padding: 4px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.timeline li::before { content: ''; position: absolute; left: -31px; top: 24px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--border); }
.timeline li.sealed::before { background: var(--accent-ink); border-color: var(--accent-ink); }
.timeline summary { display: flex; align-items: center; gap: 12px; min-height: 56px; list-style: none; }
.timeline summary::-webkit-details-marker { display: none; }
.timeline .what { display: grid; flex: 1; }
.timeline small { color: var(--muted); font-size: 13px; }
.timeline strong { font: 400 20px/1.2 var(--display); }
.tag { font-size: 13px; font-weight: 500; color: var(--muted); }
.sealed .tag { color: var(--accent-ink); }

/* Stats */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin: 24px 0; }
.cols .panel { margin: 0; }
.figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.figures dt { font-size: 13px; font-weight: 500; color: var(--muted); }
.figures dd { margin: 0; font: 400 32px/1.1 var(--display); }
.bars div { display: grid; grid-template-columns: 1.2em 1fr 2em; align-items: center; gap: 8px; margin: 4px 0; font-size: 14px; }
.bars i { height: 16px; min-width: 3px; border-radius: 4px; background: var(--accent-ink); }
.bars b { font-weight: 400; color: var(--muted); }

/* A round: the map stays put on a wide screen while clues, guesses and the result run beside it. */
.round { display: grid; gap: 16px 48px; }
.round.single { max-width: 600px; margin: 0 auto; }
@media (min-width: 900px) {
  .round:not(.single) { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .stage { position: sticky; top: calc(var(--nav) + 24px); }
}
.side > :first-child { margin-top: 0; }
.help { margin-bottom: 16px; color: var(--muted); }
.map { display: block; width: 100%; height: auto; max-height: 68vh; background: var(--sea); border: 1px solid var(--line); border-radius: var(--r-lg); }
.land { fill: var(--land); }
.polity { fill: var(--state); fill-rule: evenodd; stroke: var(--border); stroke-width: 1.5; stroke-linejoin: round; }
.coast { fill: none; stroke: var(--muted); stroke-width: 1.5; opacity: .6; }
.shape { fill: var(--ink); fill-rule: evenodd; }
.shape.found { fill: var(--accent-ink); }
.capital { fill: var(--bg); stroke: var(--ink); stroke-width: 5; }
.pin circle, .pin rect { fill: var(--accent-ink); stroke: var(--bg); stroke-width: 3; }
.pin text, .lbl { font: 600 38px system-ui, sans-serif; fill: var(--ink); stroke: var(--bg); stroke-width: 6px; paint-order: stroke; }
.lbl { font-weight: 400; font-size: 32px; }
.lbl.answer { font-weight: 700; font-size: 36px; }
.route { fill: none; stroke: var(--accent-ink); stroke-width: 4; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: route 4s ease-in-out forwards; }
@keyframes route { to { stroke-dashoffset: 0; } }
.marks, .clues, .log { margin: 0 0 12px; padding: 0; list-style: none; }
.marks li, .clues li, .log li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.result { display: flex; align-items: center; gap: 16px; font-size: 18px; }
.pts { flex: none; min-width: 72px; padding: 12px; border-radius: var(--r-md); background: var(--accent); color: var(--on-accent); font: 400 28px/1 var(--display); text-align: center; }
.story { margin: 16px 0; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.story h2 { display: block; font-size: 26px; }
.filed { font-size: 14px; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 8px 0; }
.tile { min-height: 72px; padding: 0 1px; font-size: 14px; font-weight: 500; line-height: 1.15; text-align: center; overflow-wrap: anywhere; hyphens: auto; background: var(--surface); border-color: var(--line); border-radius: var(--r-md); }
.tile[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
/* Level bands are four strengths of the one accent colour; the numeral carries the level, not the colour. */
.band { display: grid; gap: 2px; padding: 12px 16px; margin: 6px 0; border-radius: var(--r-md); font-size: 14px; color: var(--ink); }
.band strong { font-size: 16px; }
.band.l1 { background: var(--l1); }
.band.l2 { background: var(--l2); }
.band.l3 { background: var(--l3); }
.band.l4 { background: var(--l4); }

@media (max-width: 899px) {
  .today { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; align-content: center; }
}
@media (max-width: 640px) {
  :root { --nav: 56px; --gut: 16px; }
  main { padding-top: calc(var(--nav) + 24px); padding-bottom: 32px; }
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  #streak { margin-left: auto; }
  /* The tabs become a bar at the foot, where a thumb reaches them. */
  header nav { position: fixed; inset: auto 0 0; height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); margin: 0; background: var(--bg); border-top: 1px solid var(--line); }
  header nav a { flex: 1; min-width: 0; padding: 0 2px; font-size: 14px; border-bottom: 0; border-top: 2px solid transparent; } /* five tabs share 320 px and up */
  header nav a[aria-current] { border-top-color: var(--accent-ink); }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .card { grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 4px 16px; padding: 12px; }
  .card .thumb { grid-row: span 2; aspect-ratio: 1; }
  .card .what { align-self: end; padding: 0; }
  .card .state { align-self: start; padding: 0; }
  .hero { min-height: calc(100svh - var(--nav) - 56px - 72px); }
  .hero .row > * { flex: 1 1 100%; }
  .round .row:not(.dim) > button { flex: 1 1 auto; } /* controls share the row instead of wrapping raggedly */
  .panel { padding: 16px; }
  .big { font-size: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .route { animation: none; stroke-dashoffset: 0; }
  .shake, .seal, .hero > * > * { animation: none; }
  button, .btn, .card, a, header nav a { transition: none; }
}

/* Plain content pages (game guides, comparison, past answers) and the home page's footer questions. */
.js .boot { display: none; } /* the crawler-readable introduction; the app draws the same words itself */
.article { max-width: calc(760px + 2 * var(--gut)); }
.article h1 { display: block; }
.article h2 { display: block; margin: 32px 0 8px; }
.article li { margin: 8px 0; }
.article .btn { margin-top: 24px; }
table { width: 100%; border-collapse: collapse; margin: 24px 0; }
th, td { text-align: left; vertical-align: top; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); font-weight: 400; }
thead th { font-size: 13px; font-weight: 500; color: var(--muted); }
tbody th { font-weight: 600; }
.faq { max-width: 80ch; margin: 0 0 24px; }
.faq dt { font-weight: 600; color: var(--ink); margin-top: 12px; }
.faq dd { margin: 4px 0 0; }
footer h2 { color: var(--ink); }

/* Epoch: the year being guessed, set large, over a slider with a nudge button at each end. Kept after the phone rules so the nudge buttons stay small there. */
.year { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 24px 0 8px; }
.year output { font: 400 40px/1 var(--display); letter-spacing: -.01em; }
input[type='range'] { padding: 0; border: 0; background: none; accent-color: var(--accent); }
.round .row.slider { flex-wrap: nowrap; margin-bottom: 16px; }
.round .row.slider > button { flex: none; padding: 0 12px; }
.round .row.slider > input { flex: 1 1 0; min-width: 0; }
.log .chip { margin-left: 8px; }

/* Many Flags: six tiles in a numbered column. A tile is a toggle button like a Links tile; one in its right place is filled and no longer a button. */
.flags { list-style: none; display: grid; gap: 4px; margin: 16px 0; padding: 0; counter-reset: flag; }
.flags li { display: flex; align-items: center; gap: 8px; counter-increment: flag; }
.flags li::before { content: counter(flag); flex: none; width: 16px; color: var(--muted); font-size: 13px; text-align: center; }
.flags li > * { flex: 1; display: block; min-height: 52px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); font: 500 16px/1.2 system-ui, sans-serif; text-align: left; overflow-wrap: anywhere; }
.flags button[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.flags .ok > * { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.flags b { float: right; }
.flags small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 400; }
@media (hover: hover) and (pointer: fine) { .flags button:not([aria-pressed='true']):hover { background: var(--tint); color: var(--ink); } }

/* Pinpoint: the map is the control, so it shows a crosshair while a pin can be placed. The arrow buttons stay square on a phone. */
.pick .map { cursor: crosshair; touch-action: manipulation; }
.link { stroke: var(--accent-ink); stroke-width: 3; stroke-dasharray: 10 8; }
.event { font: 400 28px/1.15 var(--display); letter-spacing: -.01em; margin: 16px 0; }
.event small { display: block; margin-bottom: 4px; color: var(--muted); font: 500 13px/1 system-ui, sans-serif; letter-spacing: 0; }
.round .row.nudge > button { flex: none; padding: 0 12px; }
.round .row.nudge > button[data-nudge] { width: 44px; padding: 0; }

/* Stats calendar: a month of days. Filled counted for the streak, tinted had a puzzle or two, dashed was archive only. */
.cal-head { display: flex; align-items: center; gap: 8px; }
.cal-head h2 { flex: 1; margin: 0; }
.cal-head button { width: 44px; padding: 0; }
.cal { width: 100%; max-width: 480px; margin: 16px 0 8px; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.cal th { padding: 0; font-size: 13px; font-weight: 500; color: var(--muted); text-align: center; }
.cal td { height: 44px; padding: 0; text-align: center; font-size: 14px; color: var(--muted); background: var(--tint); border: 1px solid transparent; border-radius: var(--r-sm); }
.cal td:empty { background: none; }
.cal [data-day='some'], .cal-key [data-day='some'] { background: color-mix(in srgb, var(--accent) 35%, var(--surface)); color: var(--ink); }
.cal [data-day='streak'], .cal-key [data-day='streak'] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.cal [data-day='late'], .cal-key [data-day='late'] { border: 1px dashed var(--muted); background: none; }
.cal-key { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.cal-key i { display: inline-block; width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; border-radius: 4px; border: 1px solid transparent; }
.cal [aria-current='date'] { box-shadow: inset 0 0 0 2px var(--ink); }

/* Friends: a group's table for today, and the stacked forms to start or join one. */
.stack { display: grid; gap: 16px; }
.stack label { display: grid; gap: 4px; font-weight: 500; }
.group h2 { margin-top: 0; }
.board { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 14px; }
.board th, .board td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: center; font-weight: 400; }
.board th[scope='row'], .board thead th:first-child { text-align: left; overflow-wrap: anywhere; }
.board thead th { color: var(--muted); }
.board .glyph { width: 18px; height: 18px; }
.board .me th, .board .me td { font-weight: 600; }
.board small { color: var(--muted); font-weight: 400; }
.among { margin: 0; color: var(--muted); }
.among:empty { display: none; }

/* Daily reminder on Today, and the Chronicle's ages. */
select { font: inherit; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); }
.remind h2 { margin-top: 0; }
.ages { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 16px 0 24px; }
.age { display: grid; justify-items: start; gap: 4px; min-height: 0; padding: 12px; text-align: left; border-color: var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); }
.age[aria-pressed='true'] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.age strong { font: 400 20px/1.1 var(--display); }
.age span, .age small { color: var(--muted); font-size: 13px; }
.age progress { margin: 4px 0 0; height: 6px; }
@media (hover: hover) and (pointer: fine) { .age:not(:disabled):hover { background: var(--tint); color: var(--ink); } }

/* The theme switch in the header: a 44px icon button with no frame. */
.theme { width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); }
.theme svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (hover: hover) and (pointer: fine) { .theme:not(:disabled):hover { background: var(--tint); color: var(--ink); transform: none; } }
@media (max-width: 640px) { .theme { margin-left: auto; } } /* the tabs move to the foot of the screen; the switch keeps the top bar's right edge */

/* Motion. #app gets .enter for the first drawing after a navigation and .fresh for the drawing after a move (js/app.js), for about a
   second; nothing here runs on any other redraw. Individual translate and scale are used so nothing fights an element's own transform.
   All of it is skipped when the device asks for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  /* Arriving on a screen: its blocks rise in one after another, then its lists. */
  .enter > * { animation: rise 420ms var(--enter) both; }
  .enter > *:nth-child(2) { animation-delay: 50ms; }
  .enter > *:nth-child(3) { animation-delay: 100ms; }
  .enter > *:nth-child(4) { animation-delay: 150ms; }
  .enter > *:nth-child(5) { animation-delay: 200ms; }
  .enter .card { animation: rise 480ms var(--enter) both; }
  .enter .card:nth-child(2) { animation-delay: 130ms; }
  .enter .card:nth-child(3) { animation-delay: 180ms; }
  .enter .card:nth-child(4) { animation-delay: 230ms; }
  .enter .card:nth-child(5) { animation-delay: 280ms; }
  .enter .card:nth-child(6) { animation-delay: 330ms; }
  .enter .timeline > li { animation: rise 420ms var(--enter) both; }
  .enter .timeline > li:nth-child(2) { animation-delay: 155ms; }
  .enter .timeline > li:nth-child(3) { animation-delay: 190ms; }
  .enter .timeline > li:nth-child(4) { animation-delay: 225ms; }
  .enter .timeline > li:nth-child(5) { animation-delay: 260ms; }
  .enter .timeline > li:nth-child(6) { animation-delay: 295ms; }
  .enter .timeline > li:nth-child(7) { animation-delay: 330ms; }
  .enter .timeline > li:nth-child(8) { animation-delay: 365ms; }
  .enter .timeline > li:nth-child(9) { animation-delay: 400ms; }
  .enter .timeline > li:nth-child(10) { animation-delay: 435ms; }
  .enter .age { animation: rise 420ms var(--enter) both 80ms; }
  .enter .bars i { animation: grow 700ms var(--enter) both 200ms; transform-origin: left; }
  .enter .cal [data-day] { animation: pop 420ms var(--enter) both 250ms; }
  .enter .board tbody tr { animation: rise 380ms var(--enter) both 150ms; }

  /* After a move: the new guess slides in, new clues and the round's ending rise, the score lands. */
  .fresh .log > li:last-child { animation: slide 380ms var(--enter) both; }
  .fresh .clues > li:last-child { animation: rise 380ms var(--enter) both; }
  .fresh .ending > *, .fresh .ending .story { animation: rise 520ms var(--enter) both 120ms; }
  .fresh .ending > *:nth-child(2) { animation-delay: 210ms; }
  .fresh .ending > *:nth-child(3) { animation-delay: 300ms; }
  .fresh .ending > *:nth-child(4) { animation-delay: 390ms; }
  .fresh .result .pts, .enter .result .pts { animation: pop 520ms var(--enter) both 150ms; }
  .fresh .band.new { animation: band 560ms var(--enter) both; }
  .fresh .flags .new > * { animation: pop 460ms var(--enter) both; }
  .fresh .flags .new:nth-child(2) > * { animation-delay: 60ms; }
  .fresh .flags .new:nth-child(3) > * { animation-delay: 120ms; }
  .fresh .flags .new:nth-child(4) > * { animation-delay: 180ms; }
  .fresh .flags .new:nth-child(5) > * { animation-delay: 240ms; }
  .fresh .flags .new:nth-child(6) > * { animation-delay: 300ms; }
  .flags .moved > * { animation: settle 280ms var(--enter); }
  .fresh .map .link { animation: fade 500ms ease-out both 150ms; }
  .fresh .map .link ~ .pin { animation: pop 460ms var(--enter) both 250ms; transform-box: fill-box; transform-origin: center; }

  /* Small things: the streak chip jumps when it goes up, the theme icon turns in, the day's seal already stamps. */
  #streak.bump { animation: bump 700ms var(--enter); }
  .theme svg { animation: turn 450ms var(--enter); }

  /* The theme switch spreads the new theme out in a circle from the button (View Transitions; elsewhere it just changes). */
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
  ::view-transition-new(root) { animation: reveal 600ms var(--enter); }
}
@keyframes rise { from { opacity: 0; translate: 0 14px; } }
@keyframes slide { from { opacity: 0; translate: -14px 0; } }
@keyframes pop { from { opacity: 0; scale: .8; } 60% { scale: 1.06; } }
@keyframes band { from { opacity: 0; scale: .94; } 60% { scale: 1.02; } }
@keyframes settle { from { scale: .95; } }
@keyframes grow { from { scale: 0 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes bump { 35% { scale: 1.35; } }
@keyframes turn { from { opacity: 0; rotate: -90deg; scale: .6; } }
@keyframes reveal { from { clip-path: circle(0 at var(--tx, 50%) var(--ty, 0)); } to { clip-path: circle(150vmax at var(--tx, 50%) var(--ty, 0)); } }

/* Colour. Each game has one colour (--c-* on :root, both themes) and anything tagged data-game takes it as --g: Today's cards and
   progress dots, the archive, the game's own screen (#app), Chronicle entries, Stats panels, group columns, its guide page.
   The red accent stays the brand and the main button. Every pairing was checked to 4.5:1 for text in both themes. */
[data-game='footsteps'] { --g: var(--c-footsteps); }
[data-game='realms'] { --g: var(--c-realms); }
[data-game='links'] { --g: var(--c-links); }
[data-game='epoch'] { --g: var(--c-epoch); }
[data-game='flags'] { --g: var(--c-flags); }
[data-game='pinpoint'] { --g: var(--c-pinpoint); }
[data-game='likeness'] { --g: var(--c-likeness); }
[data-game='monuments'] { --g: var(--c-monuments); }
[data-game='dossier'] { --g: var(--c-dossier); }
#app[data-game] > h1 .glyph, [data-game] > h2 .glyph, .timeline [data-game] .glyph, .archive a[data-game], .board th[data-game], .article[data-game] h1 { color: var(--g); }

/* Today: a tinted picture, the title and the marks in the game's colour; the progress dots are the six colours. */
.card[data-game] .thumb { background: color-mix(in srgb, var(--g) 12%, var(--surface)); }
.card[data-game] .what strong, .card[data-game].done .state b { color: var(--g); }
.card[data-game] .thumb .dot, .card[data-game] .thumb .shape, .card[data-game].done .thumb .cell { fill: var(--g); }
.card[data-game] .go { border-color: color-mix(in srgb, var(--g) 45%, var(--line)); }
.card[data-game='pinpoint'] .thumb .cell, .card[data-game='likeness'] .thumb .cell, .card[data-game='monuments'] .thumb .cell { fill: none; stroke: var(--g); stroke-width: 3; }
.trio i[data-game] { border-color: var(--g); }
.trio i[data-game].on { background: var(--g); }

/* A game's own screen. */
#app[data-game] .pts { background: var(--g); color: var(--on-g); }
#app[data-game] .story { border-top: 4px solid var(--g); }
#app[data-game] .pips i.on { background: var(--g); border-color: var(--g); }
#app[data-game] input[type='range'] { accent-color: var(--g); }
#app[data-game] .route, #app[data-game] .link { stroke: var(--g); }
#app[data-game] .pin circle, #app[data-game] .shape.found { fill: var(--g); }
#app[data-game] .flags .ok > * { background: var(--g); border-color: var(--g); color: var(--on-g); }
#app[data-game] .map { border-color: color-mix(in srgb, var(--g) 35%, var(--line)); }
[data-game] .bars i { background: var(--g); }

/* Maps: states take six soft fills in turn, like a political atlas, so neighbours read apart. */
.polity:nth-of-type(6n + 1) { fill: var(--m1); }
.polity:nth-of-type(6n + 2) { fill: var(--m2); }
.polity:nth-of-type(6n + 3) { fill: var(--m3); }
.polity:nth-of-type(6n + 4) { fill: var(--m4); }
.polity:nth-of-type(6n + 5) { fill: var(--m5); }
.polity:nth-of-type(6n + 6) { fill: var(--m6); }

/* The page: a faint warm glow of ochre and lapis at the top, and the six game colours as a thin stripe under the header. */
body { background: radial-gradient(1000px 520px at 0 -120px, color-mix(in srgb, var(--c-epoch) 11%, transparent), transparent 70%),
  radial-gradient(1000px 520px at 100% -120px, color-mix(in srgb, var(--c-realms) 10%, transparent), transparent 70%), var(--bg) fixed; }
header::after { content: ''; position: absolute; inset: auto 0 -1px; height: 3px;
  background: linear-gradient(90deg, var(--c-footsteps) 0 11.11%, var(--c-realms) 0 22.22%, var(--c-links) 0 33.33%, var(--c-epoch) 0 44.44%, var(--c-flags) 0 55.56%, var(--c-pinpoint) 0 66.67%, var(--c-likeness) 0 77.78%, var(--c-monuments) 0 88.89%, var(--c-dossier) 0); }

/* The first-play walkthrough (tour() in js/ui.js): a popover in the game's colour, and a spotlight that dims the page around its target. */
.tour { position: absolute; z-index: 30; width: min(320px, calc(100vw - 32px)); padding: 16px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-top: 4px solid var(--g, var(--accent)); border-radius: var(--r-md); box-shadow: 0 16px 40px rgb(0 0 0 / .22); }
.tour p { margin: 4px 0 12px; }
.tour .tour-step { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.tour .row { margin: 0; }
.tour .row button { min-height: 40px; padding: 0 16px; }
.tour-target { position: relative; z-index: 25; outline: 3px solid var(--g, var(--accent)); outline-offset: 4px; border-radius: var(--r-sm); box-shadow: 0 0 0 100vmax rgb(0 0 0 / .32); }
#app[data-game] .tour-target { outline-color: var(--g); }
.help .chip { margin-top: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .tour { animation: pop 320ms var(--enter) both; }
  .tour-target { transition: outline-offset 200ms var(--ease); }
}

/* The day strip beside a game's title (strip() in js/ui.js): the six puzzles in their colours, filled when done, ringed for this one. */
.titlebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; margin-bottom: 16px; }
.titlebar h1 { margin: 0; }
.strip { display: flex; gap: 2px; }
.strip a { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; }
.strip i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--g); }
.strip .begun i { background: color-mix(in srgb, var(--g) 35%, transparent); }
.strip .done i { background: var(--g); }
.strip [aria-current] i { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--g); }

/* While a day loads: the coming screen's shape in its game's colours (placeholder() in js/app.js). */
.ph { background: color-mix(in srgb, var(--g, var(--muted)) 14%, var(--surface)); border-radius: var(--r-md); }
.map-ph { aspect-ratio: 16 / 10; border-radius: var(--r-lg); }
.ph.line { height: 14px; margin: 14px 0; }
.ph.line.short { width: 60%; }
.ph.block { height: 44px; width: 50%; margin-top: 28px; }

/* The full-screen map (fullMap() in js/app.js). On a phone it is two and a half screens wide and pans with a finger. */
.mapwrap { position: relative; }
.full { position: absolute; top: 8px; right: 8px; gap: 6px; min-height: 36px; padding: 0 9px; background: var(--surface); border-color: var(--line); color: var(--ink); }
.full svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.full span { display: none; }
.map-full, .map-full body { overflow: hidden; }
.map-full .stage { z-index: 50; } /* the sticky map column is its own stacking layer: lift it above the fixed header */
.map-full .mapwrap { position: fixed; inset: 0; z-index: 50; overflow: auto; background: var(--sea); overscroll-behavior: contain; }
.map-full .mapwrap .map { width: 100vw; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
.map-full .full { position: fixed; top: 12px; right: 12px; z-index: 51; min-height: 44px; padding: 0 14px; box-shadow: 0 4px 16px rgb(0 0 0 / .2); }
.map-full .full span { display: inline; }
@media (max-width: 640px) { .map-full .mapwrap .map { width: 250vw; height: auto; min-height: 100dvh; } }

/* Settings (a native <dialog>): a centred card, a sheet from the bottom on phones. */
.sheet { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 16px 24px 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px rgb(0 0 0 / .3); }
.sheet::backdrop { background: rgb(0 0 0 / .45); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet fieldset { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; padding: 0; border: 0; }
.sheet legend { margin-bottom: 8px; padding: 0; font-weight: 600; }
.opt { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; }
.opt:has(input:checked) { border-color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-ink); }
.opt input { flex: none; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); } /* not the text-field look every input gets */
.sheet h3 { margin: 20px 0 4px; font: 600 16px/1.3 system-ui, sans-serif; }
.sheet section, .sheet .stack { margin: 16px 0; }
@media (max-width: 640px) { .sheet { width: 100vw; max-width: none; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; } }

@media (prefers-reduced-motion: no-preference) {
  .ph { animation: breathe 1.1s ease-in-out infinite alternate; }
  .strip a:hover i { scale: 1.2; transition: scale 150ms var(--ease); }
  .sheet[open] { animation: rise 260ms var(--enter); }
  .sheet[open]::backdrop { animation: fade 200ms ease-out; }
}
@keyframes breathe { to { opacity: .5; } }
/* "Reduce motion" chosen in Settings: the same as the device asking for it. */
.calm *, .calm *::before, .calm *::after, .calm *::backdrop { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* Guess feedback. Many Flags: which way a tile had to go at the last check. */
.flags button .hint { float: right; margin-left: 8px; color: var(--g, var(--accent-ink)); font-size: 18px; line-height: 1; font-weight: 700; }
/* Pinpoint: the first pin, small and hollow, and the dashed ring of its distance around it. */
.ring { fill: color-mix(in srgb, var(--g, var(--accent-ink)) 10%, transparent); stroke: var(--g, var(--accent-ink)); stroke-width: 2.5px; stroke-dasharray: 8 6; vector-effect: non-scaling-stroke; } /* the same width on screen at any zoom */
.pin.first circle { fill: var(--surface); stroke: var(--g, var(--accent-ink)); stroke-width: 4; }
.second { padding: 12px 16px; border-radius: var(--r-md); background: color-mix(in srgb, var(--g, var(--accent)) 12%, var(--surface)); }
/* Epoch: your year against the map's stretch, on a line from 1000 BCE to 2000. */
.when { display: block; width: 100%; height: auto; margin: 8px 0 4px; }
.when .axis { stroke: var(--line); stroke-width: 4; stroke-linecap: round; }
.when .span { fill: var(--g, var(--accent)); }
.when .miss { stroke: var(--ink); stroke-width: 3; stroke-dasharray: 8 7; }
.when circle.you { fill: var(--ink); stroke: var(--surface); stroke-width: 4; }
.when text { font: 500 34px system-ui, sans-serif; fill: var(--muted); }
.when text.you { fill: var(--ink); font-weight: 600; }
/* Shortcuts in How to play, only where there is a keyboard and a mouse. */
.keys { display: none; }
@media (hover: hover) and (pointer: fine) { .keys { display: block; } }
.keys kbd { display: inline-block; min-width: 22px; margin: 0 2px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); font: 600 13px system-ui, sans-serif; text-align: center; }
@media (prefers-reduced-motion: no-preference) {
  .fresh .when .span { animation: grow 600ms var(--enter) both 100ms; transform-box: fill-box; transform-origin: center; }
  .fresh .when circle.you { animation: pop 420ms var(--enter) both 350ms; transform-box: fill-box; transform-origin: center; }
  .fresh .when .miss { animation: fade 400ms ease-out both 600ms; }
  .fresh .ring { animation: fade 500ms ease-out both 150ms; }
  .fresh .flags .hint { animation: pop 380ms var(--enter) both 200ms; }
}

/* Today: how long a round takes, and tomorrow's teaser once the day counts. */
.card .time { color: var(--muted); font-size: 13px; }
.tomorrow { margin-top: 16px; }
.tomorrow .teaser { margin: 0; padding: 0; border: 0; max-width: none; }

/* The home-screen offer: the iPhone share icon drawn inline, at text size. */
.install h2 { margin-top: 0; }
.ios-share { width: 1.2em; height: 1.2em; vertical-align: -.25em; fill: none; stroke: var(--accent-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Chronicle: the search box, and the small map in an opened story. */
.find { margin: 16px 0 4px; }
.find input { width: 100%; }
.where { display: block; width: 100%; max-width: 360px; height: auto; margin: 12px 0 4px; background: var(--sea); border-radius: var(--r-md); }
.where circle { fill: var(--g, var(--accent-ink)); stroke: var(--surface); stroke-width: 6; }
.where .halo { fill: none; stroke: var(--g, var(--accent-ink)); stroke-width: 4; opacity: .5; }
@media (prefers-reduced-motion: no-preference) { .where { animation: rise 360ms var(--enter) both; } .where .halo { animation: ping 1.6s ease-out 2 both 200ms; transform-box: fill-box; transform-origin: center; } }
@keyframes ping { from { scale: .4; opacity: .9; } to { scale: 1.4; opacity: 0; } }

/* Story pictures (public domain or CC0, from Wikimedia Commons): beside the story on a wide screen, above it on a phone. */
.portrait { float: right; width: 168px; margin: 0 0 12px 20px; }
.portrait img { display: block; width: 100%; height: auto; border-radius: var(--r-md); background: var(--tint); box-shadow: 0 6px 18px rgb(0 0 0 / .14); }
.portrait figcaption { margin-top: 6px; font-size: 13px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.portrait figcaption a { color: inherit; }
.story::after, .timeline details::after { content: ''; display: block; clear: both; }
@media (max-width: 640px) { .portrait { float: none; width: min(240px, 70%); margin: 0 0 12px; } }
@media (prefers-reduced-motion: no-preference) { .fresh .portrait img { animation: pop 520ms var(--enter) both 250ms; } }

/* Calendar (On this day): the month grid beside the reading on a wide screen, above it on a phone. */
.otd { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px 48px; align-items: start; }
.otd-pick { position: sticky; top: calc(var(--nav) + 24px); }
.otd-read > section:first-child { margin-top: 0; }
.otd-cal td { background: none; }
.otd-cal a { display: grid; place-items: center; height: 40px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; background: var(--tint); }
.otd-cal a.now { box-shadow: inset 0 0 0 2px var(--ink); }
.otd-cal a[aria-current] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .otd-cal a:hover { background: color-mix(in srgb, var(--accent) 25%, var(--surface)); } }
.otd-list { list-style: none; margin: 8px 0; padding: 0; }
.otd-list li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.otd-list li:first-child { border-top: 0; }
.otd-list .yr { display: grid; align-content: start; }
.otd-list .yr b { font: 400 24px/1.1 var(--display); color: var(--accent-ink); }
.otd-list .yr small { color: var(--muted); font-size: 13px; }
.otd-list a { white-space: nowrap; }
.otd-picks { border-top: 4px solid var(--accent); }
.otd-today { margin-top: 16px; }
.otd-today h2 { margin-top: 0; }
@media (max-width: 899px) { .otd { grid-template-columns: minmax(0, 1fr); } .otd-pick { position: static; } }
@media (max-width: 640px) { .otd-list li { grid-template-columns: minmax(0, 1fr); } .otd-list .yr { display: flex; gap: 8px; align-items: baseline; } }
@media (prefers-reduced-motion: no-preference) { .enter .otd-list li:nth-child(-n + 12) { animation: rise 380ms var(--enter) both 120ms; } }

/* Likeness: the portrait in a frame in the game's colour. The blur is set inline and drops with each wrong guess; the image is drawn
   a little larger than its frame so the blurred edges never show. */
/* Never taller than about half the screen, so on a phone the guess box stays in view: --r is the picture's width over its height. */
.likeness .frame, .monuments .frame { margin: 0 auto; width: min(100%, 360px, calc(40vh * var(--r))); overflow: hidden; border: 3px solid var(--g); border-radius: 12px; background: var(--surface); }
.likeness .frame img, .monuments .frame img { display: block; width: 100%; height: 100%; object-fit: cover; scale: 1.08; transition: filter 600ms ease-out; }
.calm .likeness .frame img, .calm .monuments .frame img { transition: none; }
@media (prefers-reduced-motion: reduce) { .likeness .frame img, .monuments .frame img { transition: none; } }
.monuments .frame img { transition: scale 700ms ease-out; }

/* Dossier: one row per guess, its four facts as cards graded in two colours with a mark (✓ right, ≈ close), never colour alone. */
.dossier .grid { overflow-x: auto; margin-top: 12px; }
.dossier table { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: 14px; }
.dossier th { text-align: left; font-weight: 500; color: var(--muted); }
.dossier tbody th { color: var(--ink); max-width: 9em; }
.dossier td { padding: 8px; border-radius: var(--r-sm); background: var(--tint); vertical-align: top; }
.dossier td.g2 { background: var(--c-links); color: var(--on-g); }
.dossier td.g1 { background: var(--c-epoch); color: var(--on-g); }
.dossier tr.won th { color: var(--g); }
@media (max-width: 480px) { .dossier table { font-size: 13px; border-spacing: 3px; } .dossier td { padding: 6px; } }
