:root {
  /* Day: warm parchment, brown ink. */
  --parch: #efe3c2;
  --parch-light: #f6edd3;
  --parch-dark: #d9c79a;
  --table: #b9a173;
  --ink: #3f2b1a;
  --ink-soft: #6f5236;
  --line: #3f2b1a;
  --wax: #8c2f2b;
  --gold: #b8892f;
  --shadow: rgba(60, 38, 14, 0.35);
  --font-display: "Cinzel", "Trajan Pro", Georgia, serif;
  /* Reading text: a screen-first serif. IM Fell is kept only for flavour (the keepers' quotes). */
  --font-body: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --font-flair: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --topbar-h: calc(56px + env(safe-area-inset-top, 0px));
  /* The side panel scales with the screen (about a third of it), and can be dragged wider. */
  --panel-w: clamp(420px, 32vw, 580px);
}

:root[data-theme="night"] {
  /* Night: a deep-navy chart room, with parchment-coloured text and gilt lines. */
  --parch: #15243d;
  --parch-light: #1c2e4b;
  --parch-dark: #0e1a2e;
  --table: #060b14;
  --ink: #efe6cb;
  --ink-soft: #b9ad90;
  --line: #a89968;
  --wax: #e0806f;
  --gold: #d8a94b;
  --shadow: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  /* No pull-to-refresh or rubber-banding while panning the map. */
  overscroll-behavior: none;
  background: var(--table);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--wax);
}

:focus-visible {
  outline: 2px solid var(--wax);
  outline-offset: 2px;
}
