:root {
  --table: #e2e0d8;
  --ink: #1d1a17;
  --muted: #6d655b;
  --paper: #f3e9d2;          /* parchment */
  --edge: #b8b5a8;           /* stone */
  --red: #a4442a;            /* red ochre */
  --azurite: #2f5d9b;
  --silver: #6c7276;         /* pewter, to read on the light table and parchment */
  --gold: #b8922a;           /* lead-tin yellow: Ariadne's thread alone */
  --card-ink: #231a12;       /* the face is parchment in both themes */
  --blackletter: "UnifrakturMaguntia", "Texturina", var(--serif);
  --textura: "Texturina", var(--serif);
  /* Roman numerals, wherever they stand alone: in the bold capitals of LLULL's and Bazody's marks, plain and broad, so
     that no numeral is read as a letter (a blackletter I is a J) */
  --numerals: var(--bazody-face);
  --hue: 20;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light dark;
}
/* Dark as the device prefers, unless light is chosen; or dark as chosen. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --table: #131412;
    --ink: #ece6da;
    --muted: #979a92;
    --paper: #e9dcbd;
    --edge: #6f736b;
    --red: #b4502f;
    --silver: #aeb3b6;
  }
}
:root[data-theme="dark"] {
  --table: #131412;
  --ink: #ece6da;
  --muted: #979a92;
  --paper: #e9dcbd;
  --edge: #6f736b;
  --red: #b4502f;
  --silver: #aeb3b6;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--table); color: var(--ink); }
body { font-family: var(--serif); -webkit-font-smoothing: antialiased; }

.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom);
}

/* Controls small and out of the card's way. */
.controls {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 8px 0 4px;
  font-size: 13px;
}
.controls select, .controls input, .controls button {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: 6px;
  padding: 3px 6px;
}
.controls .seed { width: 5.5em; }
.remote { font-size: 10px; color: var(--muted); }
.remote.on { color: #3f8f4f; }

/* The table below the bar: the card, and the deck views laid over it. */
.table { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.stage {
  position: relative; z-index: 0; /* its card's 3D turn kept beneath the deck views */
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.card-frame {
  height: 100%;
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.card {
  position: relative;
  /* as tall as the window allows, less the bar and caption, and the strip of marks where the card is alone */
  width: min(100%, calc((100dvh - 166px - var(--strip-room, 0px)) * 5 / 7));
  aspect-ratio: 5 / 7;
  perspective: 1400px;
}
.inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.card.down .inner { transform: rotateY(180deg); }
/* The side turned away is hidden half-way through the turn, not by backface-visibility,
   which in WebKit shows the face's layers through and spoils taps. */
.face, .back { transition: visibility 0s linear 0.27s; }
.card.down .face, .card:not(.down) .back { visibility: hidden; }
.face, .back {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.12);
}
.face {
  background: var(--paper);
  color: var(--card-ink);
  border: none;
  /* clear of the two large indices */
  padding: 25% 8% 23%;
  display: flex;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(120, 90, 40, 0.18), 0 1px 2px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.12);
}
.face .index { color: var(--suit, var(--card-ink)); }
.red .face .index { color: var(--red); }

.face .text, .machine-body { position: relative; z-index: 1; }
.face .index, .face .lang, .face .address { z-index: 2; }

/* The back: a woodblock diaper, the same until a New Fire. */
.back {
  transform: rotateY(180deg);
  overflow: hidden;
  background: #efe3c4;
}
.back svg { width: 100%; height: 100%; display: block; }

.index {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-family: var(--blackletter);
  font-size: 21px;
}
/* Rank over suit, in the four corners of the lace, as on the Medium Aevum cards. */
.index { gap: 1px; font-size: 40px; }
.index .sign, .index .sign svg { width: 30px; height: 30px; display: block; }
.index.maya-index { gap: 5px; }
.index .maya svg { width: 30px; height: auto; display: block; }
.index.top-left { top: 2.6%; left: 4%; }
/* The card's address, in the top right corner where the rank and suit would stand: its author's place among the
   authors in Roman numerals in the marks' bold capitals (--numerals), a little under the rank's size, and under it, in the suit's 30px box, the
   labyrinth a little smaller, set as far below as the suit is below the rank. A tap on the one opens the author's labyrinths, on the
   other this labyrinth's map. */
.face .address {
  position: absolute; top: 2.6%; right: 4%; z-index: 2;
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
}
.face .address button {
  font-family: var(--numerals); font-weight: 700; line-height: 1; color: var(--suit, var(--card-ink));
  background: none; border: none; padding: 0; cursor: pointer; white-space: nowrap; text-align: right;
}
.face .address .author-numeral { font-size: 36px; line-height: 40px; height: 40px; letter-spacing: 0; }
.face .address .labyrinth { font-size: 26px; line-height: 30px; height: 30px; }
.red .face .address button { color: var(--red); }
.index.bottom-right { bottom: 2.6%; right: 4%; transform: rotate(180deg); }

/* The card's languages, top centre between the corners: small capitals set like a rubric, the one being read in the
   suit's ink and underlined, the others faint; a tap reads the card in that one. */
.lang {
  position: absolute; top: 3.4%; left: 50%; transform: translateX(-50%);
  display: flex; align-items: baseline; gap: 6px;
  font: 14px/1 var(--serif); font-variant: small-caps; letter-spacing: 0.1em;
}
.lang .tongue {
  padding: 4px 6px 5px; cursor: pointer; color: var(--card-ink); opacity: 0.45;
  border-bottom: 1px solid transparent;
}
.lang .tongue.on { opacity: 1; color: var(--suit, var(--card-ink)); border-bottom-color: currentColor; }
.red .lang .tongue.on { color: var(--red); }
.lang .tongue:hover { opacity: 0.8; }

.text {
  margin: auto 0;
  max-height: 100%;
  overflow: auto;
  scrollbar-width: none;
  white-space: pre-line;
  font-family: var(--serif);
  font-size: clamp(12px, 2.1dvh, 15.5px);
  line-height: 1.42;
  hyphens: auto;
  -webkit-hyphens: auto;
  text-wrap: pretty;
}
.verse .text { white-space: pre-wrap; font-size: clamp(11.5px, 1.95dvh, 14.5px); }
/* A rubricated initial, as a scribe would open a passage. */
.face .text::first-letter {
  font-family: var(--blackletter);
  color: var(--red);
  float: left;
  font-size: 3.1em;
  line-height: 0.82;
  padding: 0.04em 0.08em 0 0;
}

/* The anagram face: dark grey in both themes, with the face's inks lightened to read on it. */
.face.anagram {
  --card-ink: #ece3cf;
  --suit: #ece3cf;
  --red: #e2826a;
  --azurite: #a4bde8;
  --edge: color-mix(in srgb, #ece3cf 30%, transparent);
  background: #2a2927;
  color: var(--card-ink);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 1px 2px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.12);
}
.red .face.anagram { --suit: var(--red); }
/* The palimpsest: the author's own words under the anagram, faded to the ground as scraped ink is and turned to run
   down the page across the anagram's lines, within the text's own margins; seen, not read (Table.scraped). */
.face.anagram .scraped {
  position: absolute; inset: 21% 8% 21%; z-index: 0; overflow: hidden;
  writing-mode: vertical-rl; white-space: pre-line;
  font: 19px/1.9 var(--serif); color: color-mix(in srgb, #c9a77a 15%, transparent);
  filter: blur(0.25px); pointer-events: none; user-select: none; -webkit-user-select: none;
}
.face.anagram .scraped:dir(rtl), .face.anagram .scraped[dir="rtl"] { writing-mode: vertical-lr; }
.face.anagram .index.joker-index.bottom-right { color: var(--card-ink); }

.caption {
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
  max-width: 34em;
}
.caption small { font-size: 11px; }
/* under the card, one line's height in the layout whatever it says, so that the card never moves: a Joker's longer
   caption runs on into the room below, the card where every other card lies */
.card-frame > .caption { height: calc(13px * 1.35); overflow: visible; flex: none; }

.message { font-size: 18px; color: var(--muted); text-align: center; }
.fire { background: #050403; border-radius: 14px; color: #c9b9a4; }
.fire .message { color: #e8d8c0; font-size: 26px; letter-spacing: 0.06em; }
.fire small { font-size: 13px; letter-spacing: 0; color: #9c8a74; }

.joker .face { border: none; }
.joker .index { color: var(--red); }

/* The deck: what this deck has dealt so far, face up. */
.deck {
  position: absolute;
  inset: 0 -12px; /* over the app's side margins too */
  z-index: 5;
  background: var(--table);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
}
.deck.hidden { display: none; }
/* the deck view takes its own gestures: swipes and pinches, not the page's zoom */
.deck { touch-action: none; }
.deck.atlas-view { touch-action: pan-y; justify-content: flex-start; padding-top: 8px; }
.deck-hint { font: italic 12px var(--serif); color: var(--muted); text-align: center; }

/* Going from deck to deck, and into one from the atlas. */
.maze.from-right { animation: from-right 0.28s ease-out; }
.maze.from-left { animation: from-left 0.28s ease-out; }
.maze.zoom-in { animation: zoom-in 0.3s ease-out; }
.atlas { animation: zoom-out 0.3s ease-out; }
@keyframes from-right { from { transform: translateX(28%); opacity: 0; } }
@keyframes from-left { from { transform: translateX(-28%); opacity: 0; } }
@keyframes zoom-in { from { transform: scale(0.3); opacity: 0; } }
@keyframes zoom-out { from { transform: scale(2.2); opacity: 0; } }
/* a cursor moved by the arrows redraws the map without its opening */
.atlas.moved { animation: none; }
@media (prefers-reduced-motion: reduce) { .maze, .atlas { animation: none !important; } }

/* The atlas: the author's decks as one labyrinth, six tiles a row, joined without gaps. */
.atlas {
  width: min(100%, 560px); flex: 1; min-height: 0; overflow-y: auto;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 0;
  align-content: start; padding: 6px 4px 12px; scrollbar-width: none;
}
.atlas::-webkit-scrollbar { display: none; }
.atlas .tile {
  position: relative; aspect-ratio: 6 / 9; padding: 0; border: none; border-radius: 0;
  background: var(--author, var(--paper)); cursor: pointer;
}
.atlas .tile:hover { background: color-mix(in srgb, var(--wall, var(--silver)) 14%, var(--author, var(--paper))); }
.atlas .tile.here { box-shadow: inset 0 0 0 2px var(--red); }
.atlas .tile-plan, .atlas .tile-plan svg { width: 100%; height: 100%; display: block; }
.atlas .tile-label {
  position: absolute; left: 2px; bottom: 2px;
  font: 700 9px var(--numerals); letter-spacing: 0; color: var(--wall, var(--muted)); opacity: 0.8; pointer-events: none;
}
/* Every author's labyrinths as the ouroboros: one ring of the authors' runs, each a heading and rows of six tiles, the
   first author after the last, scrolled either way without end. Only the rows about the window are on the page, each
   placed by how many headings and rows stand above it, at the heights the ring is given. The numerals go to each run. */
.deck.grid-view { touch-action: pan-y; justify-content: flex-start; padding-top: 8px; }
.numeral-strip {
  display: flex; gap: 2px; width: min(100%, 900px); overflow-x: auto; scrollbar-width: none; flex: none;
  border-top: 1px solid color-mix(in srgb, var(--edge) 60%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--edge) 60%, transparent);
}
.numeral-strip::-webkit-scrollbar { display: none; }
.strip-numeral {
  flex: none; font: 700 11px var(--numerals); letter-spacing: 0; color: var(--muted);
  background: none; border: none; border-bottom: 2px solid var(--author); padding: 6px 5px 3px; cursor: pointer;
  /* a black or chalk author's line kept visible on either table */
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 22%, transparent);
}
.strip-numeral:hover { color: var(--ink); }
.strip-numeral.dealing { color: var(--red); }
.library {
  width: min(100%, 560px); flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none;
  overflow-anchor: none; animation: zoom-out 0.3s ease-out;
}
.library .ring { position: relative; --head: 30px; --row: 120px; }
.ring > .run-head, .ring > .run-row { position: absolute; left: 0; right: 0; box-sizing: border-box; }
.ring > .run-head { height: var(--head); padding: 0 0 4px; align-items: flex-end; }
.ring > .run-row { height: var(--row); }
.library::-webkit-scrollbar { display: none; }
.run-head {
  display: flex; align-items: baseline; gap: 5px; width: 100%; padding: 12px 0 5px;
  background: none; border: none; cursor: pointer; text-align: left; font: 13px var(--serif); color: var(--ink);
  scroll-margin-top: 4px;
}
.run-head .swatch { align-self: center; }
.run-head .numeral { font: 700 10.5px var(--numerals); letter-spacing: 0; color: var(--muted); }
.run-head .run-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-head .run-count { font: 700 10px var(--numerals); letter-spacing: 0; color: var(--muted); }
.run-head.dealing .run-name, .run-head.dealing .numeral { color: var(--red); }
.run-head:hover .run-name { text-decoration: underline dotted; text-underline-offset: 3px; }
.run-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; }
.library .mini {
  height: 100%; padding: 0; border: none; border-radius: 0; cursor: pointer;
  background: var(--author); grid-row: 1;
}
.library .mini.here { box-shadow: inset 0 0 0 2px var(--red); position: relative; z-index: 1; }
.library .mini .tile-plan, .library .mini svg { width: 100%; height: 100%; display: block; }
/* the key runs down its columns, in the order of the numerals */
.key { columns: 3 104px; column-gap: 4px; padding: 0 2px; width: min(100%, 900px); }
.key .key-name { width: 100%; break-inside: avoid; justify-content: flex-end; }
/* right-set, each entry kept together: swatch, numeral, name */
.key .key-name .numeral { width: auto; }
.key-row { display: flex; flex-direction: column; gap: 3px; }
.key-name {
  display: flex; align-items: baseline; gap: 4px; background: none; border: none; padding: 2px 0; cursor: pointer;
  font: 12.5px var(--serif); color: var(--ink); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.key-name .numeral { width: 26px; flex: none; text-align: right; font: 700 10px var(--numerals); letter-spacing: 0; color: var(--muted); }
.key-name .swatch { align-self: center; }
.key-name.dealing, .key-name.dealing .numeral { color: var(--red); }
.key-name.focused { text-decoration: underline; text-underline-offset: 3px; }
.key-name:hover { color: var(--silver); }
.swatch {
  width: 10px; height: 13px; border-radius: 2px; flex: none;
  background: var(--author); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 28%, transparent);
}
.key-works { display: flex; flex-wrap: wrap; gap: 2px 10px; padding-left: 22px; }
.key-work {
  background: none; border: none; padding: 0; cursor: pointer; text-align: left;
  font: italic 12.5px var(--serif); color: var(--muted);
}
.key-work:hover { color: var(--ink); text-decoration: underline dotted; }
/* Every author's decks as a wheel: names on the rim, decks in a ring, works in spirals. */
.deck.library-view { touch-action: none; justify-content: flex-start; padding-top: 8px; }
.wheel-frame {
  width: min(100%, 86dvh - 120px, 760px); aspect-ratio: 1; overflow: hidden; border-radius: 50%;
  background: var(--paper); box-shadow: 0 0 0 1px var(--edge); animation: zoom-out 0.3s ease-out; flex: none;
}
.wheel-zoom { display: block; width: 100%; height: 100%; transition: transform 0.6s cubic-bezier(0.3, 0.7, 0.2, 1); }
.wheel-zoom svg { width: 100%; height: 100%; display: block; }
/* The wheel as a volvelle of rings: authors within, their works about them, their labyrinths at the rim, each arc in
   the author's colour; the author at the top, and their works' titles, read in the centre and along the arcs. */
.wheel .rim { fill: var(--paper); stroke: var(--edge); stroke-width: 1; }
.wheel .author-arc, .wheel .work-arc, .wheel .deck-arc { stroke: color-mix(in srgb, var(--card-ink) 55%, transparent); stroke-width: 0.5; cursor: pointer; }
.wheel .author-arc.turned { stroke: var(--card-ink); stroke-width: 1.4; }
.wheel .deck-arc { opacity: 0.9; }
.wheel .deck-arc:hover, .wheel .work-arc:hover, .wheel .author-arc:hover { opacity: 0.8; }
.wheel .deck-arc.here { fill: var(--red) !important; opacity: 1; }
.wheel .arc-numeral { font: 700 10px var(--numerals); letter-spacing: 0; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.wheel .arc-work { font: italic 8px "EB Garamond", var(--serif); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.wheel .hub { fill: var(--paper); stroke: var(--card-ink); stroke-width: 1; cursor: pointer; }
.wheel .hub-numeral { font: 700 10px var(--numerals); letter-spacing: 0; fill: var(--muted); text-anchor: middle; cursor: pointer; }
.wheel .hub-name { font: 13px var(--blackletter); fill: var(--card-ink); text-anchor: middle; cursor: pointer; }
.wheel .hub-line { font: 7.5px var(--serif); fill: var(--muted); text-anchor: middle; cursor: pointer; }
.wheel .rings { transform-origin: 0 0; animation: turn-in 0.5s cubic-bezier(0.3, 0.7, 0.2, 1); }
@keyframes turn-in { from { transform: rotate(-24deg); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .wheel .rings { animation: none; } }
.maze .cell.marked { box-shadow: inset 0 0 0 2px var(--silver); }
.atlas .tile-seen {
  position: absolute; right: 2px; top: 2px; font: 9px var(--serif); color: var(--paper);
  background: var(--card-ink); border-radius: 6px; padding: 0 3px; opacity: 0.75;
}
.deck-title { font: 15px var(--serif); font-variant: small-caps; letter-spacing: 0.08em; color: var(--muted); }
.deck-head { display: flex; align-items: center; gap: 14px; }
.deck-head .step {
  font: 24px var(--serif); color: var(--silver); background: none;
  border: none; border-radius: 0; padding: 0 10px;
}

/* The deck as a labyrinth: cards along one winding path, walls where it does not run. */
.maze {
  display: grid;
  width: min(100%, 420px, calc((100dvh - 170px) * 6 / 9 * 0.9));
  aspect-ratio: 6 / 9;
  background: var(--paper);
  border-radius: 6px;
  padding: 4px;
}
.maze .cell {
  --w: 2.5px;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border: var(--w) solid transparent;
  background: transparent;
  color: var(--suit, var(--card-ink));
  font: 13px var(--blackletter);
  cursor: pointer;
}
.maze .cell.wall-t { border-top-color: var(--card-ink); }
.maze .cell.wall-b { border-bottom-color: var(--card-ink); }
.maze .cell.wall-l { border-left-color: var(--card-ink); }
.maze .cell.wall-r { border-right-color: var(--card-ink); }
.maze .cell.down::after {
  content: ""; width: 58%; height: 70%; border-radius: 2px;
  background: repeating-linear-gradient(45deg, #a4442a 0 2px, #efe3c4 2px 5px);
  opacity: 0.55;
}
.maze .cell.up { background: color-mix(in srgb, var(--suit) 8%, transparent); }
.maze .cell.here { box-shadow: inset 0 0 0 2px var(--red); }
.maze .cell.gate { color: var(--silver); font: 18px var(--serif); cursor: default; }
.maze .cell.gate.way { cursor: pointer; }
.maze .cell-rank { line-height: 1; font-size: 15px; }
.maze .cell-sign svg { width: 13px; height: 13px; display: block; }

/* The maps' ways out, as the sheets' choices: small capitals in silver, between middots. */
.deck-foot { display: flex; align-items: baseline; gap: 0; }
.close {
  font: 15px var(--serif); font-variant: small-caps; letter-spacing: 0.08em; text-transform: lowercase;
  background: none; color: var(--silver); border: none; padding: 6px 4px; cursor: pointer;
}
.close:hover { color: var(--ink); text-decoration: underline dotted; text-underline-offset: 4px; }
.close + .close::before { content: "·"; color: var(--muted); margin-right: 12px; margin-left: 8px; text-decoration: none; display: inline-block; }

/* The Jokers: machines that transform the narrative's order, all set alike and laid from the top, so that nothing
   moves as the machine turns: the title and how the machine transforms; the machine in a window of one size and shape on
   every Joker and every turn, parts of the card's width (the card is a container, `cqw`), a wheel as high as it and
   the Engine's frame as wide; what it reads, on a payline
   between two diamonds; where its turn leads, on a ruled ticket; and a line of its source. The wheels (Llull's circle,
   Ovid's changes) have a marker over them, as a wheel of fortune has its clapper. */
.machine-card { container-type: inline-size; }
.machine-card .face { padding: 15% 9% 21%; }
.machine-body {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1.6cqw;
  width: 100%; min-height: 0; text-align: center;
}
.machine-title { font-family: var(--textura); font-weight: 600; font-size: 20px; letter-spacing: 0.02em; line-height: 1.1; }
.machine-principle { font: italic 12px/1.3 var(--serif); color: var(--muted); margin-top: -1.6cqw; }
.machine {
  position: relative; flex: none; width: 64cqw; height: 40cqw; margin-top: 1.2cqw;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.machine svg { width: 100%; height: 100%; display: block; }
.machine-circle .machine::before, .machine-metamorphosis .machine::before {
  content: ""; position: absolute; top: -1.4cqw; left: 50%; translate: -50% 0; z-index: 1;
  border-left: 1.6cqw solid transparent; border-right: 1.6cqw solid transparent; border-top: 2.6cqw solid var(--red);
}
/* the payline: what the machine reads, between two diamonds, two lines' room whatever it reads */
.machine-reading {
  margin: 0; width: 100%; min-height: calc(2 * 1.35em); display: flex; align-items: center; justify-content: center;
  gap: 2cqw; font-size: 12.5px; line-height: 1.35; font-style: italic;
}
.machine-reading::before, .machine-reading::after { content: "◆"; flex: none; font: normal 8px/1 var(--serif); color: var(--red); }
.machine-reading .verse-la { text-align: center; }
/* the ticket: where the turn leads, the author and work on one line, a hand pointing; under it the card's address, each part
   a way in */
.destination {
  display: flex; flex-direction: column; align-items: center; gap: 1px; width: 84%;
  padding: 5px 12px 4px; border: 1px solid color-mix(in srgb, var(--red) 55%, transparent); border-radius: 3px;
  outline: 1px solid color-mix(in srgb, var(--red) 30%, transparent); outline-offset: 2px;
  background: color-mix(in srgb, var(--red) 4%, transparent);
}
.destination button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
.dest-go { display: flex; align-items: baseline; gap: 7px; justify-content: center; max-width: 100%; min-width: 0; white-space: nowrap; }
.dest-arrow { color: var(--red); font-size: 17px; }
.dest-name { flex: none; font: 17px/1.1 var(--blackletter); color: var(--red); }
.dest-work { font: italic 13px var(--serif); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dest-go:hover .dest-name, .dest-go:hover .dest-work { text-decoration: underline dotted; text-underline-offset: 3px; }
.dest-address { display: flex; align-items: baseline; gap: 6px; font: 700 12px var(--numerals); letter-spacing: 0; color: var(--muted); }
.destination .dest-address button { padding: 1px 3px; }
.destination .dest-address button:hover { color: var(--card-ink); text-decoration: underline dotted; text-underline-offset: 3px; }
.machine-verse .quote-link { text-align: center; font-size: 12px; line-height: 1.4; }
.volvelle .ring { fill: none; stroke: var(--card-ink); stroke-width: 1.2; }
.volvelle .ring0 { fill: color-mix(in srgb, var(--red) 8%, transparent); }
.volvelle text { font: 600 17px var(--serif); fill: var(--card-ink); text-anchor: middle; dominant-baseline: central; }
.volvelle text.on { fill: var(--red); }
.volvelle .pointer { stroke: var(--red); stroke-width: 2; }
.volvelle .pin { fill: var(--red); }
.machine-verse { text-align: center; display: flex; flex-direction: column; gap: 1px; }
.verse-ar { font: 15px/1.5 "Amiri", "Geeza Pro", "Noto Naskh Arabic", serif; color: var(--red); }
.verse-en { font-size: 12px; font-style: italic; }
.engine .frame { fill: none; stroke: var(--card-ink); stroke-width: 2; }
.engine .block { fill: var(--paper); stroke: var(--edge); }
.engine .block.lit { fill: color-mix(in srgb, var(--red) 18%, var(--paper)); stroke: var(--red); }
.engine text { font: 10px var(--serif); fill: var(--card-ink); text-anchor: middle; dominant-baseline: central; }
.engine .handle { fill: var(--muted); }

/* Words that lead to other chunks, in any author and language. */
.link { text-decoration: underline dotted color-mix(in srgb, var(--card-ink) 28%, transparent); text-underline-offset: 3px; cursor: pointer; }
/* A figure the Popol Vuh names, shown in ancient Maya art: a tap opens its sheet. */
.being {
  text-decoration: underline solid color-mix(in srgb, var(--silver) 70%, transparent); text-decoration-thickness: 1.5px;
  text-underline-offset: 3px; cursor: pointer;
}
.link:hover { text-decoration-color: var(--red); }
.text::-webkit-scrollbar { display: none; }


/* The caption's title and sections, each a way in. */
.caption .nav-link {
  font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer;
  text-decoration: underline dotted color-mix(in srgb, var(--muted) 60%, transparent); text-underline-offset: 3px;
}
.caption .nav-link:hover { color: var(--ink); }

/* The top bar: the author in blackletter over the deal; the menu opens from it. */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 6px 4px; max-width: 460px; width: 100%; margin: 0 auto; }
.brand { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; flex: 1 1 auto; background: none; border: none; color: var(--ink); padding: 0; cursor: pointer; }
/* An author's name, or a work's, struck through where the words shown are an anagram of theirs: on the anagram's
   byline, and in anagram mode on the bar. */
.struck { text-decoration: line-through; text-decoration-color: currentColor; text-decoration-thickness: 1px; }
.brand-author { font-family: var(--blackletter); font-size: 24px; line-height: 1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mode { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; align-items: center; gap: 4px; flex: none; }
.tool { font: 16px/18px var(--serif); color: var(--ink); background: none; border: 1px solid var(--edge); border-radius: 7px; padding: 3px 5px; }

/* The card's own context, bottom left, offsetting the rank and suit. */
.face .context, .machine-card .face .context {
  position: absolute; left: 6%; bottom: 3.2%; max-width: 62%; z-index: 2;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  font-size: 11px; line-height: 1.25; color: color-mix(in srgb, var(--card-ink) 60%, transparent);
}
.face .context .nav-link {
  font: inherit; color: inherit; background: none; border: none; padding: 0; text-align: left; cursor: pointer;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.face .context .ctx-author { font-family: var(--blackletter); font-size: 15px; color: var(--suit, var(--card-ink)); }
.face .context .ctx-work { font-style: italic; }
.face .context .ctx-section { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.face .context .nav-link:hover { color: var(--card-ink); text-decoration: underline dotted; }

/* Sheets over the table, set like the cards: parchment with the face's inset shading, a title as on the Jokers with
   what it is of under it, labels in small capitals, sections between hairlines. Choices are set like the card's
   languages, faint until chosen, then in red and underlined; actions point with a red hand. */
/* A sheet lies under the bar (--bar-h, its foot, as Stage.barFoot measures it), which stays above it and in reach:
   the bar's controls work while a sheet is open, and the one that opened it closes it */
.bar { position: relative; z-index: 21; background: var(--table); }
.sheet { position: fixed; inset: var(--bar-h, 0px) 0 0 0; z-index: 20; background: color-mix(in srgb, #000 55%, transparent); display: flex; align-items: flex-end; justify-content: center; }
.sheet.hidden { display: none; }
.sheet-card {
  --muted: #6d655b;
  --rule: color-mix(in srgb, var(--card-ink) 14%, transparent);
  width: min(100%, 460px); max-height: 84dvh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--card-ink); border-radius: 14px 14px 0 0; padding: 18px 20px 20px;
  box-shadow: inset 0 0 40px rgba(120, 90, 40, 0.18), 0 -6px 30px rgba(0, 0, 0, 0.3);
  animation: sheet-up 0.22s ease-out;
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--edge); }
.sheet-titles { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
/* the way back, over a sheet's title: the sheets it was opened from */
.sheet-trail { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin-bottom: 2px; }
.trail-step { font: 12.5px var(--serif); color: var(--red); background: none; border: none; padding: 0; cursor: pointer; }
.trail-step:hover { text-decoration: underline dotted; text-underline-offset: 3px; }
.trail-sep { font: 12px var(--serif); color: var(--muted); }
.trail-sep:last-child { display: none; }
.sheet-title { font: 600 21px/1.15 var(--textura); letter-spacing: 0.02em; }
.sheet-sub { font: italic 12.5px/1.3 var(--serif); color: var(--muted); }
.close-x { font: 300 26px/0.8 var(--serif); background: none; border: none; color: var(--muted); cursor: pointer; padding: 2px 0 0 8px; }
.close-x:hover { color: var(--red); }
.sheet-body { overflow: auto; display: flex; flex-direction: column; scrollbar-width: none; }
.sheet-body::-webkit-scrollbar { display: none; }
.row-label { font: 12px/1 var(--serif); font-variant: small-caps; letter-spacing: 0.14em; color: var(--muted); text-transform: lowercase; }
.sheet-section { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.sheet-row { display: flex; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.sheet-row .row-label { width: 64px; flex: none; }
.choices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; flex: 1; }
.choice {
  font: 15px/1.2 var(--serif); font-variant: small-caps; letter-spacing: 0.06em; color: var(--card-ink);
  background: none; border: none; border-bottom: 1px solid transparent; padding: 3px 0 2px; cursor: pointer; opacity: 0.55;
}
.choice:hover { opacity: 0.85; }
.choice.on { opacity: 1; color: var(--red); border-bottom-color: currentColor; }
/* The menu, hung from the top the window's width: the authors in a grid on the left, the deal and the table in a column
   beside them; one over the other on a phone */
.sheet.top { align-items: flex-start; }
.sheet.top .sheet-card {
  width: 100%; max-width: none; max-height: calc(100dvh - var(--bar-h, 0px) - 12px); border-radius: 0 0 14px 14px;
  padding: 14px max(20px, env(safe-area-inset-right)) 18px max(20px, env(safe-area-inset-left));
  animation: sheet-down 0.22s ease-out;
}
@keyframes sheet-down { from { transform: translateY(-24px); opacity: 0; } }
.menu-columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 0 32px; max-width: 1100px; width: 100%; margin: 0 auto; }
.sheet.top .sheet-head, .sheet.top .sheet-note, .device-grid, .sheet-list, .sheet.top .gallery, .sheet.top .search { max-width: 1100px; width: 100%; margin-left: auto; margin-right: auto; }
/* a sheet's lines from the top, the window's width: down as many columns as fit, so a contents reads in order */
.sheet-list { columns: 3 300px; column-gap: 32px; }
.sheet-list > .sheet-item { width: 100%; break-inside: avoid; }
/* each line one line: its first words, the rest an ellipsis, the whole in its title */
.sheet-list > .sheet-item { padding: 6px 0; min-width: 0; }
.sheet-list .item-name, .sheet-list .item-names { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-list .item-meta { flex: none; }
.sheet-item:focus-visible { outline: none; background: color-mix(in srgb, var(--red) 10%, transparent); }
/* On this device, the window's width: the authors in as many columns as fit */
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); column-gap: 28px; }
.menu-columns > .sheet-section { border-bottom: none; }
.menu-settings { display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 700px) { .menu-columns { grid-template-columns: minmax(0, 1fr); } .menu-columns > .sheet-section { border-bottom: 1px solid var(--rule); } }
.sheet.top .author-choices { columns: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 14px; }
.menu-tool { margin-right: 4px; }
.tool.hidden { display: none; }
/* the authors by numeral, in columns: the numeral right-set before the name, as an address */
.author-choices { columns: 2 132px; column-gap: 10px; }
.author-choices .author-choice { width: 100%; break-inside: avoid; }
.author-choice { display: flex; align-items: baseline; gap: 8px; font-variant: normal; letter-spacing: 0; text-align: left; padding: 4px 0; border-bottom: none; opacity: 0.8; }
.author-choice .numeral { width: 5.4em; flex: none; text-align: right; font: 700 11px var(--numerals); letter-spacing: 0; color: var(--muted); }
.author-choice.on { opacity: 1; }
.author-choice.on .choice-name { border-bottom: 1px solid currentColor; }
.author-choice.on .numeral { color: var(--red); }
.action {
  font: 14px/1.2 var(--serif); color: var(--red); background: none; border: none; padding: 3px 0; cursor: pointer; text-align: left;
}
.action:hover { text-decoration: underline dotted; text-underline-offset: 3px; }
.action.quiet { color: var(--muted); font-style: italic; }
/* On this device: a row an author, their numeral and name to keep or not, their size, and how their download stands */
.sheet-note { font: italic 13px/1.4 var(--serif); color: var(--muted); padding: 10px 0 6px; border-bottom: 1px solid var(--rule); }
.device-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 4px 0; border-bottom: 1px solid var(--rule); }
.device-row .author-choice { flex: 1 1 140px; }
.device-size { font: 12px var(--serif); font-variant-numeric: oldstyle-nums tabular-nums; color: var(--muted); width: 4.5em; text-align: right; }
.device-state { font: italic 12.5px var(--serif); color: var(--muted); flex: 1 1 100%; padding-left: 42px; }
.device-state:empty { display: none; }
.device-row .action { font-size: 13px; padding-left: 42px; }
.device-row .action + .action { padding-left: 0; }
/* the first visit's offer: a slip at the foot of the table, to keep the author read on the device */
.offer {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 15;
  width: min(calc(100% - 32px), 460px); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
  background: var(--paper); color: var(--card-ink); border-radius: 12px; padding: 12px 16px;
  box-shadow: inset 0 0 30px rgba(120, 90, 40, 0.16), 0 6px 24px rgba(0, 0, 0, 0.35); animation: sheet-up 0.22s ease-out;
}
.offer.hidden { display: none; }
.offer-state { font: italic 13px var(--serif); color: var(--muted); }
/* the downloads under way: a red line along the top of the window, as far as they have come */
.downloads { position: fixed; left: 0; right: 0; top: env(safe-area-inset-top, 0); height: 2px; z-index: 12; background: color-mix(in srgb, var(--red) 18%, transparent); }
.downloads.hidden { display: none; }
/* a derived corpus's authors being dug out: a grey line under the downloads' */
.digging { position: fixed; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 2px); height: 2px; z-index: 12; background: color-mix(in srgb, var(--muted) 25%, transparent); }
.digging.hidden { display: none; }
.digging .downloads-done { background: var(--muted); }
.downloads-done { height: 100%; background: var(--red); transition: width 0.4s ease-out; }
/* in the menu, an author on their way to the device */
.author-choice.coming { opacity: 0.45; }
.author-choice .choice-note { font: italic 11px var(--serif); color: var(--muted); margin-left: auto; }
.author-choice .choice-note:empty { display: none; }
.offer-text { font: 14px/1.35 var(--serif); flex: 1 1 100%; }
.offer .close-x { margin-left: auto; }
.sheet-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; padding-top: 14px; }
.sheet .seed {
  font: 15px var(--serif); font-variant-numeric: oldstyle-nums; letter-spacing: 0.04em; width: 6.5em; padding: 2px 0;
  border: none; border-bottom: 1px solid var(--edge); background: none; color: var(--card-ink); border-radius: 0;
}
.sheet .seed:focus { outline: none; border-bottom-color: var(--red); }
.sheet-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px; text-align: left;
  font: 15px var(--serif); color: var(--card-ink); background: none; border: none;
  border-bottom: 1px solid var(--rule); padding: 10px 0; cursor: pointer;
}
.sheet-item:hover .item-name { color: var(--red); }
.sheet-item.on .item-name { color: var(--red); }
.sheet-item.depth-1 { padding-left: 18px; font-size: 14px; }
.sheet-item.depth-2 { padding-left: 34px; font-size: 13px; }
.item-name.action { padding: 0; }
.item-meta { font: 12px var(--serif); font-variant: small-caps; letter-spacing: 0.06em; color: var(--muted); white-space: nowrap; }
/* Figures as plates: each print on the sheet's own parchment, its white paper taken up into it */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px 14px; padding: 14px 0 4px; }
.gallery-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0; border: none; background: none; cursor: pointer;
  color: var(--card-ink);
}
.plate {
  width: 100%; padding: 6px; background: var(--paper); border: 1px solid var(--edge);
  box-shadow: inset 0 0 18px rgba(120, 90, 40, 0.16);
}
.plate img { display: block; width: 100%; mix-blend-mode: multiply; }
.gallery-item .plate img { aspect-ratio: 4 / 5; object-fit: cover; }
.plate-title { font: 13px/1.25 var(--serif); font-variant: small-caps; letter-spacing: 0.06em; text-align: center; }
.gallery-item:hover .plate-title { color: var(--red); }
.gallery-item:hover .plate { border-color: var(--red); }
.figure-plate { margin-top: 14px; }
.figure-image { max-height: 48dvh; object-fit: contain; }
.figure-caption { font: 15px/1.45 var(--serif); margin: 12px 0 6px; }
.figure-credit { font: 11.5px var(--serif); font-variant: small-caps; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 2px; }
.figure-credit a { color: inherit; }

/* The Jokers in the bar: a tap goes anywhere in the labyrinth. */

/* The Jokers' corners: a jester's cap, red above and black below. */
.index.joker-index.top-left { color: var(--red); }
.index.joker-index.bottom-right { color: #1c1712; }
.index.joker-index .jester, .index.joker-index .jester svg { width: 46px; height: 32px; display: block; }
/* JOKER down the side under the cap, in the ranks' blackletter, a letter a line */
.index.joker-index { gap: 4px; }
.joker-word { font: 11px/1 var(--blackletter); writing-mode: vertical-rl; text-orientation: upright; letter-spacing: 0.05em; }

.quote-link {
  font: inherit; color: inherit; text-align: left; background: none; border: none; padding: 0; cursor: pointer;
  text-decoration: underline dotted color-mix(in srgb, var(--card-ink) 30%, transparent); text-underline-offset: 3px;
}
.quote-link:hover { color: var(--card-ink); }

/* the bar's icons: one geometric line in the ink, as the mark is */
.tool.icon-tool { padding: 3px; line-height: 0; color: var(--ink); }
.icon-tool .icon svg { width: 18px; height: 18px; display: block; }
.share-tool .copied { display: inline-block; font: 11px/18px var(--serif); padding: 0 2px; }
.tool.on { background: color-mix(in srgb, var(--silver) 22%, transparent); border-color: var(--silver); }


/* Metamorphosis: Ovid's letters on the outer ring, their new body on the inner. */
.metamorphosis text { font: 600 8px var(--serif); }
.metamorphosis text.left { fill: var(--muted); }
.metamorphosis text.new { fill: var(--red); font: 600 9px "EB Garamond", var(--serif); }
.metamorphosis .change { fill: none; stroke: var(--card-ink); stroke-width: 0.45; opacity: 0.45; }
.verse-la { font: italic 13px/1.4 var(--serif); color: var(--red); }

/* The cards' text can be selected and copied. */
.face .text, .machine-verse, .machine-reading {
  user-select: text; -webkit-user-select: text; -webkit-touch-callout: default; cursor: text;
}
.face .text ::selection, .machine-body ::selection { background: color-mix(in srgb, var(--silver) 45%, transparent); }

/* Arabic: right to left, in Amiri, without an initial, which would break the joined script. */
.face .text:lang(ar) { font-family: "Amiri", "Geeza Pro", "Noto Naskh Arabic", serif; font-size: 1.12em; line-height: 1.75; }
.face .text:lang(ja) { font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK JP", "Noto Serif JP", serif; }
.face .text:lang(ar)::first-letter { font: inherit; color: inherit; float: none; padding: 0; line-height: inherit; }
/* In its place, the first word rubricated whole, as Arabic scribes opened a passage: red, the text's size, heavier. */
.face .text:lang(ar) .opening, .face .text:lang(ar) .opening * { color: var(--red); font-weight: 700; }

.machine-verse .quote-link.verse-ar { color: var(--red); text-align: center; width: 100%; font: 15px/1.5 "Amiri", "Geeza Pro", "Noto Naskh Arabic", serif; }

/* The author's names: in the card's language, and in the others, each a way in. */
.face .context .ctx-names { display: flex; align-items: baseline; gap: 8px; max-width: 100%; }
/* on an anagram, the byline: after the author's name, struck through, the anagram's sign and "ANAGRAM" */
/* ANAGRAM in the bold capitals of the card's numerals at its top right */
.face .context .ctx-after { font: 700 11px/1 var(--numerals); letter-spacing: 0.06em; white-space: nowrap; }
.face .context .ctx-other-name { font: 13px var(--serif); color: color-mix(in srgb, var(--card-ink) 55%, transparent); }
.face .context .ctx-other-name:lang(ar) { font-family: "Amiri", "Geeza Pro", serif; font-size: 14px; }

/* The hunt for the Minotaur: the labyrinth in the dark, cells and walls showing once found; the hunter, Θ; Ariadne's
   golden thread laid over, the cut thread fainter; the Minotaur's bellowing as horns lit one to five. */
.maze-frame { position: relative; width: min(100%, 420px, calc((100dvh - 230px) * 6 / 9 * 0.9)); }
.maze-frame .maze { width: 100%; }
.maze.hunting { background: #1b1814; }
.maze.hunting .cell { cursor: default; }
.maze.hunting .cell:not(.fog) { background: var(--paper); }
.maze.hunting .cell.fog { background: transparent; }
.maze.hunting .cell.fog.wall-t { border-top-color: color-mix(in srgb, var(--silver) 55%, transparent); }
.maze.hunting .cell.fog.wall-b { border-bottom-color: color-mix(in srgb, var(--silver) 55%, transparent); }
.maze.hunting .cell.fog.wall-l { border-left-color: color-mix(in srgb, var(--silver) 55%, transparent); }
.maze.hunting .cell.fog.wall-r { border-right-color: color-mix(in srgb, var(--silver) 55%, transparent); }
.maze.hunting button.cell { cursor: pointer; }
.maze.hunting .cell.gate { color: var(--silver); }
.maze.hunting .cell.theseus { box-shadow: inset 0 0 0 2px var(--red); }
.maze.hunting .cell.asterion { background: color-mix(in srgb, var(--red) 16%, var(--paper)); }
.maze.hunting .hunter { font: 600 15px var(--serif); color: var(--red); line-height: 1; }
.thread-layer { position: absolute; inset: 4px; pointer-events: none; }
.thread-layer svg { width: 100%; height: 100%; display: block; }
.thread polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.thread .tied { stroke: var(--gold); stroke-width: 2.5; opacity: 0.85; }
.thread .lost { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: 0.45; }
.hunt-head { flex-direction: column; gap: 4px; }
.hunt-sound { display: flex; align-items: baseline; gap: 8px; font: 13px var(--serif); color: var(--muted); }
.hunt-label { font-variant: small-caps; letter-spacing: 0.08em; }
.horns { display: inline-flex; gap: 2px; }
.horn { color: color-mix(in srgb, var(--muted) 40%, transparent); font-size: 12px; }
.horn.on { color: var(--red); }
.hunt-word { font-style: italic; }
.hunt-tally { font: 12px var(--serif); font-variant: small-caps; letter-spacing: 0.06em; color: var(--muted); }
/* the sail in the bar: black until changed */
.tool.sail-tool { padding: 2px 4px; line-height: 0; }
.sail-icon svg { width: 18px; height: 18px; display: block; }
.sail-icon .canvas { fill: #0d0b09; stroke: currentColor; stroke-width: 0.8; }
.sail-tool.white .sail-icon .canvas { fill: #f6f1e4; }
/* the riddle, and the homecoming */
.riddle-anagram { font: italic 15px/1.5 var(--serif); margin: 14px 0 8px; }
.riddle-ask { font: 12px var(--serif); font-variant: small-caps; letter-spacing: 0.1em; color: var(--muted); margin: 6px 0; }
.riddle-choice .item-name { font-size: 14px; line-height: 1.35; }
.ending-text { font: 16px/1.5 var(--serif); margin: 14px 0 10px; }
.ending-tally { font: 12px var(--serif); font-variant: small-caps; letter-spacing: 0.06em; color: var(--muted); }
.sheet-card.ending.black-sail { background: color-mix(in srgb, #000 22%, var(--paper)); }

/* LLULL's mark: in the ink with its name, white on black or black on white, before the author in the bar, at the
   menu's foot, and turning slowly while the cards are shuffled. */
.logo { flex: none; color: var(--silver); line-height: 0; opacity: 0.85; }
.logo svg { width: 22px; height: 22px; display: block; }
.topbar { position: relative; }
/* LLULL's name in the strip */
.wordmark-name { font-size: 22px; }
.colophon {
  display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 12px;
  border-top: 1px solid var(--rule); color: var(--muted);
}
.colophon .logo { color: var(--card-ink); opacity: 1; }
.colophon-mark { display: flex; align-items: center; gap: 6px; }
.colophon .logo svg { width: 16px; height: 16px; }
.colophon > div { display: flex; flex-direction: column; gap: 1px; }
.colophon-name { font-size: 17px; color: var(--card-ink); }
.colophon-line {
  font: 12px var(--serif); font-variant-caps: all-small-caps; letter-spacing: 0.1em; display: inline-flex; align-items: baseline;
}
.colophon-rule { margin: 0 0.6em; color: var(--red); }
.message.shuffling { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.logo.turning svg { width: 34px; height: 34px; animation: turning 6s linear infinite; }
@keyframes turning { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .logo.turning svg { animation: none; } }

/* Bazody's mark, which makes LLULL: wide-spaced capitals, the A in red. */
/* in Century Gothic Bold where the reader has it (a licensed font, not served here); else the nearest geometric sans */
:root { --bazody-face: "Century Gothic", CenturyGothic, "URW Gothic", "URW Gothic L", Futura, "Avenir Next", sans-serif; }
.bazody {
  display: inline-flex; align-items: baseline; letter-spacing: 0.22em; color: inherit;
  font: 700 1em/1 var(--bazody-face);
}
/* the A: the face's own bold capital, red */
.bazody-a { color: var(--red); }
.colophon-by { margin-top: 3px; font: 11px var(--serif); display: inline-flex; align-items: baseline; gap: 6px; }
.colophon-by .bazody { font-size: 17px; color: var(--card-ink); }
/* BAZODY's byline under its mark, in small capitals as on its page */
.colophon-house { font: 11px/1.2 var(--serif); font-variant-caps: all-small-caps; letter-spacing: 0.14em; color: var(--muted); }

/* The marks in a narrow strip over the bar, LLULL's at the left and Bazody's at the right, which the card leaves room
   for (--strip-room). */
.app { --strip-room: 40px; }
.strip {
  flex: none; height: 40px; display: flex; align-items: center; justify-content: space-between;
  padding: 3px 4px 0; border-bottom: 1px solid color-mix(in srgb, var(--edge) 45%, transparent);
}
.strip-llull { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.strip-llull .logo { color: inherit; opacity: 1; }
.strip-llull .logo svg { width: 20px; height: 20px; }
.strip-llull .wordmark-name { font-size: 22px; }
.strip-bazody { color: var(--ink); font-size: 22px; text-decoration: none; }
a.colophon-by { text-decoration: none; color: inherit; }

/* LLULL's name: Century Gothic's bold capitals, as Bazody's are, where the reader has it, else the nearest geometric sans */
/* its weight, face and line set apart, not by the `font` shorthand, which would reset the size each place gives it */
.llull-name {
  display: inline-flex; align-items: baseline; font-weight: 700; font-family: var(--bazody-face); line-height: 1;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.llull-name .backwards { display: inline-block; transform: scaleX(-1); }
/* the backward Ls drawn in towards the U, which their turned feet otherwise hold off, for balance */
.llull-name .backwards:nth-child(3) { margin-left: -0.08em; }
/* the U, the pivot the name turns on, in red */
.llull-name .llull-u { color: var(--red); }

/* The card on a phone held sideways, too short a window for the card: the card keeps the width it has held
   upright and its text the size it has there, and the page scrolls to read it (a swipe up or down still goes through
   time where the page is at its end; see Gestures.edge). The marks stay in their strip over the bar, as upright. */
@media (orientation: landscape) and (pointer: coarse) and (max-height: 500px) {
  .app { height: auto; min-height: 100dvh; }
  .table, .stage { flex: none; }
  .stage { touch-action: pan-y; padding-bottom: 16px; }
  .card { width: min(100%, 460px); }
  .text { font-size: 15.5px; }
  .verse .text { font-size: 14.5px; }
  /* So too the labyrinths, the hunt, the atlas and the wheel: as wide as upright, the page scrolling to them. The view
     takes the card's place in the page rather than lying over it, and a swipe up or down scrolls it; across, a swipe
     still steps from labyrinth to labyrinth, and the hunt keeps every way for walking. The ouroboros, which scrolls
     its own ring of authors, stays over the card, as wide already. */
  .table:has(> .deck:not(.hidden, .grid-view)) > .stage { display: none; }
  .deck:not(.grid-view) { position: static; margin: 0 -12px; touch-action: pan-y; padding-bottom: 20px; }
  .deck .maze, .maze-frame { width: min(100%, 420px); flex: none; }
  .maze.hunting { touch-action: none; }
  .atlas { flex: none; overflow: visible; }
  .wheel-frame { width: min(100%, 560px); }
}

/* The games and their rules */
.game { gap: 6px; }
.game-name { font: 600 17px var(--textura); letter-spacing: 0.02em; }
.game-what { margin: 0; font: italic 14px/1.4 var(--serif); color: var(--muted); }
.game-rules { margin: 2px 0 2px; padding-left: 1.3em; display: flex; flex-direction: column; gap: 5px; font: 14px/1.45 var(--serif); }
.game-rules li::marker { color: var(--muted); font-size: 12px; }
.game .action { align-self: flex-start; }
.hunt-word.heard-louder { color: var(--red); font-style: normal; font-weight: 600; }
.hunt-word.heard-quieter { opacity: 0.7; }
/* the ship at the gate, its sail black until changed */
.maze.hunting .cell.ship { cursor: pointer; color: var(--card-ink); }
.ship-icon { line-height: 0; }
.ship-icon svg { width: 22px; height: 22px; display: block; }
.ship-icon .canvas { fill: #0d0b09; stroke: currentColor; stroke-width: 0.8; }
.ship-icon.white .canvas { fill: #f6f1e4; }
.maze.hunting .cell.ship .hunter { position: absolute; font-size: 11px; transform: translate(9px, -9px); }
.maze.hunting .cell.ship { position: relative; }
/* the Minotaur, by his name */
.minotaur { color: var(--red); line-height: 0; align-self: center; }
.minotaur svg { width: 18px; height: 18px; display: block; }
.riddle-title { display: flex; align-items: center; gap: 8px; }
.riddle-title .minotaur svg { width: 26px; height: 26px; }

/* Ruinae: Pound's red pencil through all but the line it keeps, still to be read; ruined cards as ash on the
   maps; and the fragments shored against the ruins, each on its own card. */
.face .text .struck { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 75%, transparent); text-decoration-thickness: 1.5px; opacity: 0.55; }
.face .text .kept-line { opacity: 1; }
.maze .cell.ash { background: repeating-linear-gradient(135deg, #6a655e 0 2px, #4e4a44 2px 4px); opacity: 0.75; cursor: pointer; }
.maze .cell.ash::after { content: none; }
.card.shored .face { display: flex; align-items: center; justify-content: center; padding: 14% 12%; background: color-mix(in srgb, var(--paper) 82%, #6a655e); }
.shored-body { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.shored-line { margin: 0; font: italic 20px/1.5 var(--serif); color: var(--card-ink); }
.shored-line:lang(sa) { font: 20px/1.6 "Noto Serif Devanagari", "Kohinoor Devanagari", serif; font-style: normal; }
.shored-from { font: 15px var(--blackletter); color: var(--red); }

/* A work's titles in the works sheet: the one in the language read, its others beneath */
.item-names { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.item-other { font: italic 12.5px var(--serif); color: var(--muted); }

/* Ruinae: a card whose author is not yet dug out, rubble till they are */
.card.rubble .face { background-image: repeating-linear-gradient(135deg, rgba(95, 91, 85, 0.10) 0 3px, transparent 3px 7px); }
.rubble-text { display: flex; flex: 1; align-self: stretch; width: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: var(--muted); font-style: italic; }
.rubble-text p { margin: 0; font-size: 1.15em; }
.maze .cell.arriving { opacity: 0.45; }

/* A word an analysis notes, as the rarest in its author's work */
.text .noted { text-decoration: underline wavy var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* The search's sheet: a line to type in, then the cards found, by author, the words found marked in the ink's red */
.search { display: flex; flex-direction: column; gap: 12px; }
.search-line {
  width: 100%; box-sizing: border-box; padding: 8px 10px; font: 16px var(--serif); color: var(--card-ink);
  background: none; border: 1px solid var(--edge); border-radius: 6px;
}
.search-line:focus { outline: 2px solid color-mix(in srgb, var(--red) 55%, transparent); outline-offset: 1px; }
.search-note { font: italic 13px var(--serif); color: var(--muted); }
.search-results { display: flex; flex-direction: column; gap: 14px; }
.search-author { display: flex; flex-direction: column; gap: 4px; }
.search-name { font: 600 13px var(--serif); font-variant: small-caps; letter-spacing: 0.04em; color: var(--card-ink); }
.search-more { font-weight: 400; color: var(--muted); }
.search-card {
  text-align: left; padding: 6px 8px; font: 13.5px/1.45 var(--serif); color: var(--card-ink); cursor: pointer;
  background: none; border: none; border-left: 2px solid var(--rule);
}
.search-card:hover { border-left-color: var(--red); }
.search-card mark { background: none; color: var(--red); font-weight: 600; }

/* the numerals in a deck view's heading, among its small capitals */
.deck-title .numeral { font: 700 15px var(--numerals); letter-spacing: 0; font-variant: normal; }

/* An anagram's sign, the ring of letters turning about LLULL's diamond: small before an anagram's byline, and on the
   bar's toggle of anagram mode, its diamond filled red while the mode is on. */
.face .context .ctx-after { display: inline-flex; align-items: center; gap: 4px; }
.ctx-icon svg { width: 13px; height: 13px; display: block; color: var(--red); }
.anagram-tool.on { border-color: var(--red); }
.anagram-tool.on svg path:last-child { fill: var(--red); }

/* The Absence, dealt where a fourth Joker was: no card, only the outline of the place one would lie. */
.card.void { border-radius: 14px; background: none; border: 1.5px dashed color-mix(in srgb, var(--edge) 80%, transparent); box-shadow: none; }
/* Whose LLULL is: one small line at the foot of every screen, out of the card's way, and in the colophon */
.copyright {
  flex: none; padding: 2px 0 4px; text-align: center; font: 10px/1.4 var(--serif); color: var(--muted);
  letter-spacing: 0.02em; user-select: none;
  /* over a deck view that runs past the table, as the wheel's key can */
  position: relative; z-index: 6; background: var(--table);
}
.colophon-copyright { display: block; margin-top: 4px; font: 10px var(--serif); color: var(--muted); }
.colophon-copyright a { color: inherit; }

/* A text under a licence: its mark beside the author's name, small, a link to the licence */
.ctx-licence {
  font: 700 9px/1 var(--bazody-face); letter-spacing: 0.06em; color: inherit; opacity: 0.6; text-decoration: none;
  border: 1px solid currentColor; border-radius: 3px; padding: 2px 4px;
  align-self: center; white-space: nowrap;
}
.ctx-licence:hover { opacity: 1; }
/* where an author's texts come from, under their works */
.sheet-credit { margin: 14px 4px 4px; font: 12px/1.5 var(--serif); color: var(--muted); }
.credit-head { font-variant: small-caps; letter-spacing: 0.06em; margin-bottom: 4px; }
.credit-notice { white-space: pre-wrap; }
.credit-licences { margin-top: 6px; }
.credit-licences a { color: inherit; }

/* An author not on the device, on the maps: greyed, still there to be read from the network or kept */
.wheel .seat.away { filter: grayscale(1); opacity: 0.35; }
.wheel .seat.away .deck-arc.here { opacity: 1; }
.key-name.away, .strip-numeral.away, .run-head.away { opacity: 0.45; }
.key-name.away .swatch, .run-head.away .swatch, .strip-numeral.away { filter: grayscale(1); }
.run-row.away { filter: grayscale(1); opacity: 0.4; }

/* When something failed: a notice over everything, what failed and the ways on (index.html, Stumble.scala) */
#stumbled {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100;
  width: min(520px, calc(100% - 32px)); padding: 12px 16px; border-radius: 10px; background: var(--paper); color: var(--card-ink);
  border: 1px solid var(--red); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); font: 15px/1.4 var(--serif);
}
#stumbled p { margin: 0; }
#stumbled .stumbled-what { overflow-wrap: anywhere; }
#stumbled .stumbled-ways { margin-top: 8px; display: flex; gap: 14px; }
#stumbled button { font: inherit; color: var(--red); background: none; border: none; padding: 0; cursor: pointer; }
.stumbled { padding: 24px; text-align: center; font: italic 14px var(--serif); color: var(--muted); }

/* A favourite: the heart on the card, after its names; red once it is one */
.ctx-favour {
  font: 16px/1 var(--serif); color: inherit; opacity: 0.55; background: none; border: none; padding: 0 2px;
  cursor: pointer; align-self: center;
}
.ctx-favour:hover { opacity: 1; }
.ctx-favour.on { color: var(--red); opacity: 1; }
/* the list of favourites: each a way to its card, and a way to let it go */
.favourites .favourite { display: flex; align-items: stretch; gap: 6px; }
.favourites .favourite .sheet-item {
  flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
}
.favourites .item-names { width: 100%; }
.favourites .item-name { display: block; white-space: normal; }
.favourites .item-other { display: block; white-space: normal; }
.favourites .item-meta { text-align: left; white-space: normal; }
.favourite-remove { flex: none; background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 0 6px; }
.favourite-remove:hover { color: var(--red); }
.sheet-note { padding: 10px 4px; font: italic 14px/1.5 var(--serif); color: var(--muted); }

/* Bazody's mark small in the copyright line: its capitals as tall as the line's, its trailing space taken back */
a.copyright-owner { color: inherit; text-decoration: none; }
a.copyright-owner:hover .bazody { color: var(--ink); }
.copyright-line .bazody { font-size: 0.88em; letter-spacing: 0.18em; margin-right: -0.18em; }

/* Install as an app, in the bar while the browser offers it: in red, as it is the one thing to do once */
.tool.install-tool { color: var(--red); border-color: color-mix(in srgb, var(--red) 60%, transparent); }

/* The bar's tools in line with the author's name; where the screen is too narrow for them all, the deck views, the
   link and light or dark go under the more button, dropped over the card from under the bar rather than pushing it
   down, and put away by a tap anywhere else (.tools-away, under them, over all the rest). */
.tools-more { display: contents; }
.more-tool, .tools-away { display: none; }
@media (max-width: 520px) {
  .more-tool { display: inline-block; }
  .tools-more.open {
    display: flex; gap: 6px; position: absolute; top: 100%; right: 6px; z-index: 3; padding: 6px;
    background: var(--table); border: 1px solid var(--edge); border-top: none; border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  }
  .tools-more:not(.open) { display: none; }
  .tools-away:not(.hidden) { display: block; position: fixed; inset: 0; z-index: 2; }
}

/* The Joker, a wildcard: standing in for a card, the card itself under the Joker's caps. Its address top right is a
   card's own. Behind the text, faint, the plate of the machine that drew it: Llull's first figure of the Ars magna, Swift's Engine as the 1726
   plate draws it, Daedalus's Labyrinth for Ovid, as the coins of Knossos strike it; multiplied into the parchment, and on an anagram's dark face
   inverted into it. */
.standin .watermark {
  position: absolute; inset: 22% 10% 20%; z-index: 0; pointer-events: none;
  background: center / contain no-repeat; opacity: 0.13; mix-blend-mode: multiply;
}
.standin.machine-circle .watermark { background-image: url("images/jokers/circle.webp"); }
.standin.machine-engine .watermark { background-image: url("images/jokers/engine.webp"); opacity: 0.11; }
.standin.machine-metamorphosis .watermark { background-image: url("images/jokers/metamorphosis.svg"); opacity: 0.12; }
.standin .face.anagram .watermark { filter: invert(1); mix-blend-mode: screen; opacity: 0.12; }
.caption .caption-link { font: inherit; color: inherit; text-decoration: underline dotted; background: none; border: none; padding: 0; cursor: pointer; }

/* the Absence: a portal, the outline of a card and nothing in it; a tap goes through */
.card.void.portal { display: block; width: 100%; padding: 0; cursor: pointer; background: none; font: inherit; }
.card.void.portal:hover { border-color: color-mix(in srgb, var(--edge) 100%, transparent); }
