/* Hearth: the firelit storybook skin. Loaded after hearth.css.
   The layout here works on its own; the carved frames, buttons, slots and field come from the
   interface sprites (hearth-ui.js) as CSS nine-slice borders, and apply only once the page has
   made them (body.skinned). */

:root {
  --mono: var(--serif);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --left-w: 300px;
  --right-w: 340px;
  --gap: 12px;
  --bar-h: 150px;
  --ink: #f1e7d0;
  --ink-soft: #e0d4ba;
  --quiet: #b2a68c;
  --gold: #f0c24c;
  --gold-soft: #f8e2a0;
  --line: rgba(240, 214, 160, 0.13);
  --line-strong: rgba(240, 214, 160, 0.26);
  --fill-top: rgba(50, 37, 30, 0.96);
  --fill: rgba(27, 21, 20, 0.95);
  --label: 600 10px/1.2 var(--serif);
}

html, body { font: 13px/1.45 var(--serif); color: var(--ink); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- headings: gold small capitals ---- */
h2 {
  font: 600 12px/1.2 var(--serif);
  letter-spacing: 0.14em;
  font-variant: small-caps;
  text-transform: none;
  color: var(--gold-soft);
}
h3 { font: 600 13.5px/1.2 var(--serif); color: var(--ink); letter-spacing: 0.01em; }
.quiet { color: var(--quiet); }
kbd {
  font: 600 10.5px/1 var(--serif);
  color: var(--ink);
  padding: 2px 5px 3px;
  border: 1px solid rgba(240, 214, 160, 0.28);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: rgba(240, 214, 160, 0.08);
}

/* ---- panels: dark wood fill; a carved frame once skinned ---- */
.panel {
  background: linear-gradient(180deg, var(--fill-top), var(--fill) 140px);
  border-color: var(--line-strong);
}
body.skinned .panel {
  border: 8px solid transparent;
  border-image: var(--frame-panel) 8 / 16px / 0 stretch;
  border-radius: 0;
  background-clip: padding-box;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  image-rendering: pixelated;
}
.panel::-webkit-scrollbar-thumb, .tab::-webkit-scrollbar-thumb { background: rgba(240, 194, 76, 0.22); border-radius: 0; }

/* ---- buttons: a bevelled wooden key ---- */
button { font: 600 12px/1.25 var(--serif); letter-spacing: 0.02em; color: var(--ink); }
button i[data-icon] { margin-right: 6px; vertical-align: -4px; }
button.icon i[data-icon], #pace button i[data-icon], .mode button i[data-icon] { margin: 0; }
body.skinned button {
  border: 4px solid transparent;
  border-image: var(--btn-0) 4 fill / 8px / 0 stretch;
  border-radius: 0;
  background: none;
  padding: 2px 8px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.65);
  image-rendering: pixelated;
}
body.skinned button:hover:not(:disabled) { border-image-source: var(--btn-1); background: none; color: #fff4dc; }
body.skinned button:active:not(:disabled) { border-image-source: var(--btn-2); padding-top: 3px; padding-bottom: 1px; }
body.skinned button.on, body.skinned button.primary { border-image-source: var(--btn-3); background: none; color: #2a1a08; text-shadow: 0 1px 0 rgba(255, 240, 200, 0.45); }
body.skinned button.on:hover:not(:disabled), body.skinned button.primary:hover:not(:disabled) { border-image-source: var(--btn-3); color: #1a1004; filter: brightness(1.08); }
body.skinned button:disabled { opacity: 0.42; filter: saturate(0.4); }
body.skinned button.link, body.skinned button.who, body.skinned .tabs button {
  border: 0; border-image: none; background: none; padding: 0 4px; text-shadow: none;
}
button.icon { padding: 2px 4px; line-height: 0; }
body.skinned button.icon { padding: 1px 2px; }

/* ---- the plaque: the valley at a glance, top left ---- */
#left { top: var(--gap); left: var(--gap); width: var(--left-w); max-height: calc(100vh - 2 * var(--gap)); padding: 10px 12px 12px; }
#left header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
#left header h1 { margin: 0; flex: 1; min-width: 0; line-height: 0; font-size: 22px; letter-spacing: 0.3em; }
body.logo h1 .word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1 .logo canvas { filter: drop-shadow(0 0 10px rgba(240, 160, 60, 0.35)); }
.hud-buttons { display: flex; gap: 3px; }
#soundToggle, #foldLeft { position: static; }
#soundToggle .when-on, #soundToggle.on .when-off { display: none; }
#soundToggle.on .when-on { display: inline-flex; }

.when { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; }
.when .sky { width: 24px; height: 24px; filter: drop-shadow(0 0 6px rgba(240, 200, 120, 0.35)); }
#when { margin: 0; display: flex; flex-direction: column; font: 13px/1.3 var(--serif); color: var(--ink-soft); }
#when b { font: 600 15px/1.2 var(--serif); color: var(--gold-soft); letter-spacing: 0.02em; }
#season { display: flex; align-items: center; gap: 6px; margin: 6px 0 10px; font: italic 12.5px/1.35 var(--serif); }
#season i { flex: none; }
#season.near { color: #b9d4ee; }
#season.winter { color: #e2eefa; }

#counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 0 0 10px; }
#counts > div {
  display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 3px; align-items: center;
  padding: 4px 4px 3px; text-align: left; overflow: hidden;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.12));
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.45), inset 0 -1px 0 rgba(240, 214, 160, 0.07);
  border-radius: 3px;
}
#counts dt { display: contents; font: 600 8.5px/1.2 var(--serif); letter-spacing: 0.04em; text-transform: uppercase; color: var(--quiet); }
#counts dt i { grid-row: 1; grid-column: 1; display: inline-flex !important; width: 24px; height: 24px; }
#counts dt span { grid-row: 2; grid-column: 1 / 3; text-align: center; white-space: nowrap; margin-top: 1px; }
#counts dd { grid-row: 1; grid-column: 2; margin: 0; text-align: center; font: 600 16px/1.05 var(--serif); color: var(--ink); font-variant-numeric: tabular-nums lining-nums; }

.pace-row { display: flex; gap: 6px; align-items: stretch; }
#pace { flex: 1; display: flex; flex-wrap: nowrap; min-width: 0; gap: 3px; margin: 0; }
#pace button { min-width: 0; }
.pace-row > #soundToggle, .pace-row > #musicToggle { flex: none; width: 30px; display: inline-flex; align-items: center; justify-content: center; padding-left: 0; padding-right: 0; }
#soundToggle { flex: none; padding-left: 4px; padding-right: 4px; }
#musicToggle { flex: none; position: static; padding-left: 6px; padding-right: 6px; opacity: 0.55; }
#musicToggle.on { opacity: 1; }
#musicToggle .note { font: 700 15px/1 var(--serif); color: #e8cf8a; }
#breakTime {
  left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 47;
  width: min(440px, calc(100vw - 24px)); padding: 18px 22px 18px; text-align: center;
  background: linear-gradient(180deg, rgba(40, 32, 30, 0.98), rgba(18, 16, 22, 0.98) 160px);
}
body.skinned #breakTime { background-clip: padding-box; }
#breakTime[hidden] { display: none; }
#breakTime > .quiet:first-child { margin: 0; font: var(--label); letter-spacing: 0.16em; text-transform: uppercase; }
#breakTime h2 { display: block; border: 0; padding: 0; margin: 4px 0 8px; font: 600 24px var(--serif); font-variant: normal; color: var(--gold); }
#breakTime h2::after { display: none; }
#breakText { font: italic 16px/1.55 var(--serif); color: #ece4d2; margin: 0 0 8px; }
#breakTime .group { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
#pace button { flex: 1; display: flex; align-items: center; justify-content: center; padding: 3px 0; letter-spacing: 0; }
#rate { margin: 4px 0 0; font-size: 11.5px; }
#left .card { margin: 10px 0 0; }

/* ---- cards: calling, signs, a moment, an echo ---- */
.card, #moment, #echo { --accent: var(--gold); }
#signs { --accent: var(--violet); }
#signs.disaster { --accent: #e0644c; }
#calling.done { --accent: var(--sage); }
#calling.failed { --accent: var(--rust); }
#echo { --accent: #b8c6f2; }
#moment.answered { --accent: #9fd88a; }
#moment.passed { --accent: #a8a4ae; }
#moment.missed { --accent: #e5604a; }
body.skinned .card, body.skinned #moment, body.skinned #echo, body.skinned #hover {
  border: 4px solid transparent;
  border-image: var(--frame-card) 4 / 8px / 0 stretch;
  border-radius: 0;
  background-clip: padding-box;
  image-rendering: pixelated;
}
body.skinned .card { background-color: rgba(0, 0, 0, 0.22); box-shadow: inset 3px 0 0 var(--accent); padding: 7px 9px 8px 12px; }
body.skinned #moment, body.skinned #echo { box-shadow: inset 3px 0 0 var(--accent), 0 12px 30px rgba(0, 0, 0, 0.55); padding: 9px 12px 10px 15px; }
#callingHead { font: var(--label); letter-spacing: 0.12em; }
#callingText { font: 13.5px/1.38 var(--serif); }
.meter { height: 6px; border-radius: 0; background: rgba(0, 0, 0, 0.4); box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.5); }
.meter span { border-radius: 0; background: linear-gradient(180deg, #f8d877, #c8902e); box-shadow: 0 0 6px rgba(240, 194, 76, 0.5); }
#moment .head h3, #echo .head h3 { font-size: 15.5px; }
#moment .head small, #echo .head small, #moment .buttons .note { font: italic 11px var(--serif); letter-spacing: 0; }
#moment .bar span { box-shadow: 0 0 6px rgba(240, 194, 76, 0.6); }

/* ---- the action bar: what the Teacher can do, at the foot of the land ---- */
#bar {
  left: calc((100vw - var(--right-w) - var(--gap)) / 2);
  transform: translateX(-50%);
  bottom: var(--gap);
  width: max-content;
  max-width: calc(100vw - var(--right-w) - 3 * var(--gap));
  padding: 6px 12px 7px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bar-top { width: 0; min-width: 100%; min-height: 1.35em; }
#told, #barHint { margin: 0; font: 12.5px/1.35 var(--serif); text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#told:not(:empty) + #barHint { display: none; }
#barHint b { color: var(--gold-soft); font-weight: 600; }
#told .heard { color: var(--ink); }

.bar-tell, .bar-show { display: flex; align-items: center; gap: 6px; }
.mode { display: flex; gap: 2px; margin: 0; flex: none; }
.mode[hidden] { display: none; }
.mode button { padding: 2px 3px; line-height: 0; }
#tellForm { flex: 1; display: flex; gap: 5px; min-width: 0; }
#tell { flex: 1; min-width: 120px; font: 14px/1.3 var(--serif); padding: 5px 9px; }
body.skinned #tell {
  border: 4px solid transparent;
  border-image: var(--frame-input) 4 fill / 8px / 0 stretch;
  border-radius: 0;
  background: none;
  padding: 3px 7px;
  image-rendering: pixelated;
}
#tell::placeholder { color: rgba(214, 198, 166, 0.45); font-style: italic; }
#tell:focus { border-color: transparent; box-shadow: 0 0 0 2px rgba(240, 194, 76, 0.28), 0 0 14px rgba(240, 194, 76, 0.18); }
#tellForm button { display: inline-flex; align-items: center; padding-left: 10px; padding-right: 12px; }
.chip { display: inline-flex; align-items: center; gap: 5px; margin: 0; font: 600 11.5px var(--serif); color: var(--quiet); white-space: nowrap; cursor: pointer; }
.chip[hidden] { display: none; }

#show { display: flex; gap: 3px; margin: 0; }
#show button, #acts button {
  width: 46px; height: 48px; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font: 600 9.5px/1 var(--serif); letter-spacing: 0.02em; text-transform: lowercase; color: var(--quiet);
}
#show button .item, #acts button .item { display: flex; align-items: center; justify-content: center; height: 26px; }
#show button::after, #show button.known::after { display: none; }
#show button.known { color: var(--gold-soft); }
body.skinned #show button, body.skinned #acts button {
  border: 6px solid transparent;
  border-image: var(--slot-0) 6 fill / 12px / 0 stretch;
  padding: 0;
}
body.skinned #show button.known { border-image-source: var(--slot-2); }
body.skinned #show button:hover:not(:disabled), body.skinned #acts button:hover:not(:disabled) { border-image-source: var(--slot-1); padding: 0; }
body.skinned #show button:active:not(:disabled), body.skinned #acts button:active:not(:disabled) { padding: 2px 0 0; }
body.skinned #show button:disabled, body.skinned #acts button:disabled { opacity: 0.55; filter: saturate(0.5) brightness(0.85); }
#show button .item canvas { filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6)); }
#show button.known .item canvas { filter: drop-shadow(0 0 4px rgba(240, 194, 76, 0.45)); }
#acts { display: flex; gap: 3px; padding-left: 8px; margin-left: 2px; border-left: 1px solid var(--line-strong); }
#acts > div[hidden] { display: none; }
#acts button { color: var(--ink-soft); }
#showWait { margin: 0; font: italic 11.5px/1.3 var(--serif); text-align: center; width: 0; min-width: 100%; }

/* ---- pop-ups: the menu and the phrase book ---- */
.pop { z-index: 30; animation: popIn 0.18s ease-out; }
.pop[hidden] { display: none; }
@keyframes popIn { from { opacity: 0; transform: translateY(6px) scale(0.985); } to { opacity: 1; transform: none; } }

/* ---- motion: panels and drawers arrive softly; hover changes ease; all of it still for those who ask for less motion ---- */
body.skinned button { transition: color 0.14s ease, filter 0.14s ease; }
.pop { animation-duration: 0.22s; animation-timing-function: cubic-bezier(.2, .8, .3, 1); }
#inspector:not([hidden]) { animation: panelIn 0.24s cubic-bezier(.2, .8, .3, 1); }
#artView:not([hidden]), #writingView:not([hidden]) { animation: panelIn 0.24s cubic-bezier(.2, .8, .3, 1); }
.tab:not([hidden]) { animation: fadein 0.2s ease-out; }
#breakTime:not([hidden]), #scenarioEnd:not([hidden]), #report:not([hidden]), #ending:not([hidden]), #guide:not([hidden]) { animation: centreIn 0.3s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes centreIn { from { opacity: 0; transform: translate(-50%, -46%) scale(0.97); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes drawerLeft { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes drawerRight { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) {
  body.show-left #left { animation: drawerLeft 0.24s cubic-bezier(.2, .8, .3, 1); }
  body.show-right #right { animation: drawerRight 0.24s cubic-bezier(.2, .8, .3, 1); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
#menu { top: var(--gap); left: calc(var(--left-w) + 2 * var(--gap)); width: 320px; padding: 12px 14px 14px; }
#menu h2 { margin: 0 0 8px; border: 0; padding: 0; }
#menu h3 { margin: 12px 0 5px; font: var(--label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--quiet); }
.menu-list { display: flex; flex-direction: column; gap: 4px; }
.menu-list button { display: flex; align-items: center; text-align: left; padding: 5px 9px; font-size: 13px; }
.menu-list button kbd { margin-left: auto; }
#menu .group { margin: 0; }
#menu .group button { flex: 1; }
#menu .keys { font-size: 11.5px; line-height: 2.1; margin: 0; }
#phrasebook {
  left: calc((100vw - var(--right-w) - var(--gap)) / 2);
  transform: translateX(-50%);
  bottom: calc(var(--bar-h) + 2 * var(--gap));
  width: min(460px, calc(100vw - var(--right-w) - 4 * var(--gap)));
  max-height: min(60vh, calc(100vh - var(--bar-h) - 4 * var(--gap)));
  overflow-y: auto;
  padding: 12px 14px;
}
#phrasebook h2 { margin: 0 0 2px; border: 0; padding: 0; }
#phrasebook .close, #menu .close { position: absolute; top: 6px; right: 6px; float: none; }
#phrasebook .hint { margin: 0 0 6px; }
#phrases { font: 13px/1.5 var(--serif); }
#phrases h4 { font: var(--label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-soft); margin: 10px 0 3px; }
#phrases .say { padding: 2px 6px; margin: 0 -6px; border-radius: 3px; }
#phrases .say:hover { background: rgba(240, 194, 76, 0.1); color: var(--gold-soft); }
#phrases .say small { font: italic 11px var(--serif); }

/* ---- the journal: what is happening now, and the story's tabs, on the right ---- */
#right { padding: 8px 10px 10px; }
#right #now {
  position: static; width: auto; padding: 0 0 8px; margin: 0 0 8px;
  background: none; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; box-shadow: none;
  backdrop-filter: none; transition: none; z-index: auto; flex: none;
}
body.inspecting #right #now { width: auto; display: block; }
#now header b { font: 600 12px var(--serif); letter-spacing: 0.14em; font-variant: small-caps; text-transform: none; color: var(--gold-soft); }
#nowWatching { font-style: italic; }
#storyCam, #houseLand { font-size: 11px; padding-top: 1px; padding-bottom: 1px; }
#nowList li { border-left: 0; border-radius: 3px; padding: 4px 4px 4px 16px; position: relative; }
#nowList li .ago { font: italic 10.5px var(--serif); }
#nowList li .go { font-size: 11px; padding-top: 0; padding-bottom: 0; }

.tabs { gap: 2px; margin: 0 0 8px; padding: 0 0 6px; border-bottom: 1px solid var(--line-strong); }
.tabs button { position: relative; padding: 5px 0 6px; font: 600 10px var(--serif); letter-spacing: 0.01em; white-space: nowrap; color: var(--quiet); border-radius: 3px; min-width: 0; }
.tabs button b { font-size: 9px; color: var(--gold-soft); margin-left: 1px; }
.tabs button:hover { color: var(--ink); background: rgba(240, 214, 160, 0.06); }
.tabs button.on, body.skinned .tabs button.on { color: var(--gold-soft); text-shadow: 0 0 8px rgba(240, 194, 76, 0.4); background: radial-gradient(ellipse at 50% 100%, rgba(240, 194, 76, 0.22), rgba(240, 194, 76, 0) 70%); border-color: transparent; }
.tabs button.on::after { content: ''; position: absolute; left: 50%; bottom: -10px; width: 7px; height: 7px; transform: translateX(-50%) rotate(45deg); background: var(--gold); box-shadow: 0 0 8px rgba(240, 194, 76, 0.8); }
.tabs button i[data-icon] canvas { filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6)); }
#foldRight { padding: 1px 2px; }
/* The story panel's close, at the end of its top row, like the valley panel's fold. */
#closeRight { flex: none; padding: 1px; }
#right #now header { gap: 4px; }
#right #now header #nowWatching { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#right #storyCam, #right #houseLand { flex: none; padding-left: 5px; padding-right: 5px; }
#right #storyCam i[data-icon], #right #houseLand i[data-icon] { margin-right: 3px; }
#right #nowFold { flex: none; padding-left: 4px; padding-right: 4px; }
/* Where the story panel is narrow, the Houses and Follow buttons are their pictures alone (each says what it is on hover). */
@media (min-width: 861px) and (max-width: 1240px) {
  #right #storyCam span, #right #houseLand span { display: none; }
  #right #storyCam i[data-icon], #right #houseLand i[data-icon] { margin: 0; }
}
body.skinned #foldRight, body:not(.skinned) #closeRight { display: none; }

/* A gem by each happening, coloured by its kind, in place of a stripe. */
#chronicle li, #nowList li { --kc: rgba(240, 214, 160, 0.28); }
#chronicle li { border-left: 0; padding: 7px 4px 8px 16px; margin: 0; position: relative; border-bottom: 1px solid rgba(240, 214, 160, 0.06); color: var(--ink-soft); }
#chronicle li::before, #nowList li::before {
  content: ''; position: absolute; left: 3px; top: 12px; width: 5px; height: 5px;
  transform: rotate(45deg); background: var(--kc); box-shadow: 0 0 6px var(--kc);
}
#nowList li::before { top: 50%; margin-top: -3px; }
#chronicle li small { font: 600 10px/1.2 var(--serif); letter-spacing: 0.12em; color: var(--quiet); margin-bottom: 2px; }
#chronicle li.night { --kc: #5d6fc4; }
#chronicle li.day, #chronicle li.k1, #nowList li.k1, #notices li.k1 { --kc: var(--gold); }
#chronicle li.k2, #nowList li.k2, #notices li.k2 { --kc: var(--rust); }
#chronicle li.k3, #nowList li.k3, #notices li.k3 { --kc: #7fa6d9; }
#chronicle li.k4, #nowList li.k4, #notices li.k4 { --kc: #f2d48a; }
#chronicle li.k5, #nowList li.k5, #notices li.k5 { --kc: var(--sage); }
#chronicle li.k6, #nowList li.k6, #notices li.k6 { --kc: #c9785a; }
#chronicle li.k7, #nowList li.k7, #notices li.k7 { --kc: #b98ad6; }
#chronicle li.k8, #nowList li.k8, #notices li.k8 { --kc: #9fb7a6; }
#chronicle li.k9, #nowList li.k9, #notices li.k9 { --kc: #a07fd0; }
#chronicle li.k10, #nowList li.k10, #notices li.k10 { --kc: #e0644c; }
#chronicle li.k11, #nowList li.k11, #notices li.k11 { --kc: #7fc4b8; }
#chronicle li.k12, #nowList li.k12, #notices li.k12 { --kc: #e0a060; }
#chronicle li.k13, #nowList li.k13, #notices li.k13 { --kc: #c9b48a; }
#chronicle li.k14, #nowList li.k14, #notices li.k14 { --kc: #a8c77a; }
#chronicle li.k15, #nowList li.k15, #notices li.k15 { --kc: #e0a96a; }
#voices li { border-left: 0; padding-left: 14px; position: relative; }
#voices li::before { content: '“'; position: absolute; left: 0; top: 2px; font: 600 18px/1 var(--serif); color: rgba(240, 194, 76, 0.45); }
#voices li small { font: 600 10px/1.2 var(--serif); letter-spacing: 0.1em; }

/* While a creature is looked at, a moment or an echo moves into the space beside it. */
@media (min-width: 1101px) {
  body.inspecting #moment, body.inspecting #echo {
    --free: calc(100vw - var(--left-w) - 272px - var(--right-w) - 5 * var(--gap));
    left: calc(var(--left-w) + 272px + 3 * var(--gap) + var(--free) / 2);
    width: min(440px, calc(var(--free) - 2 * var(--gap)));
  }
}

/* ---- panels that open over the land ---- */
#inspector { left: calc(var(--left-w) + 2 * var(--gap)); max-height: calc(100vh - var(--bar-h) - 3 * var(--gap)); }
#artView, #writingView { max-height: calc(100vh - var(--bar-h) - 3 * var(--gap)); }
#inspector h4, #houseList p b, #houseList .signs b, #phrases h4 { font: var(--label); letter-spacing: 0.12em; }
#inspector .head h2, #artView h2, #writingView h2 { font-variant: normal; letter-spacing: 0.01em; }
#hover { background: rgba(26, 20, 19, 0.96); padding: 5px 9px 6px; }
.close { line-height: 0; }

/* The big pages: the title, the ending, the report, the guide. */
#ending h2, #report h2, #guide h2 { font-variant: normal; letter-spacing: 0.01em; }
#guide h2 { display: block; margin: 0 0 12px; font: 600 21px/1.2 var(--serif); color: var(--gold); }
#guide p { color: var(--ink-soft); }
#ending h2::after, #report h2::after, #guide h2::after, #menu h2::after, #phrasebook h2::after {
  content: ''; display: block; width: 128px; height: 14px; margin: 6px 0 0;
  background: var(--rule, none) left center / 128px 14px no-repeat; image-rendering: pixelated;
}
#phrasebook h2::after, #menu h2::after { width: 96px; height: 10px; background-size: 96px 10px; margin-top: 4px; }
#ending h3, #report h3 { font: 600 12px var(--serif); letter-spacing: 0.14em; font-variant: small-caps; color: var(--gold-soft); }
body.skinned #title .card {
  border: 8px solid transparent;
  border-image: var(--frame-panel) 8 / 16px / 0 stretch;
  border-radius: 0;
  background-clip: padding-box;
  box-shadow: none;
  padding: 16px 22px 16px;
}
body.skinned #title .card { box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7); }
#title h1 { line-height: 0; margin: 6px 0 10px; }
body.logo #title h1 { padding-left: 0; }
#title h1 .logo { display: inline-flex; }
#title .tagline { font-size: 16.5px; }
#titleArt, #endingArt { border-color: rgba(0, 0, 0, 0.6); box-shadow: inset 0 0 0 1px rgba(240, 214, 160, 0.12); border-radius: 2px; }

/* Folded panels open again from small wooden tabs. */
.drawer span { font: 600 12px var(--serif); }

/* Watching the land alone: nothing but the land and the Teacher's words. */
body.watching #bar, body.watching .pop { display: none; }

/* ---- narrower screens ---- */
@media (max-width: 1240px) {
  :root { --right-w: 300px; }
  .tabs button > span { display: none; }
  .tabs button { padding: 6px 0 7px; }
}
@media (max-width: 1100px) {
  :root { --left-w: 292px; --right-w: 270px; }
  #left { padding-left: 10px; padding-right: 10px; }
  .hud-buttons { gap: 2px; }
  #show button, #acts button { width: 40px; height: 40px; }
  #show button > span:last-child, #acts button > span:last-child { display: none; }
  .chip { font-size: 0; gap: 0; }
}
@media (max-width: 860px) {
  :root { --right-w: 0px; }
  .drawer { gap: 6px; }
  #bar { left: 8px; right: 8px; bottom: 8px; transform: none; width: auto; max-width: none; padding: 5px 8px 6px; }
  .bar-show { overflow-x: auto; scrollbar-width: none; }
  #show { flex: none; }
  #barHint { -webkit-line-clamp: 1; }
  #tell { min-width: 60px; font-size: 13px; }
  #tellForm button { padding-left: 8px; padding-right: 8px; }
  #tellForm button i[data-icon] { display: none; }
  .bar-tell, .bar-show { gap: 4px; }
  .mode button { padding: 1px 2px; }
  #menu { left: 10px; right: 10px; top: 52px; width: auto; }
  #phrasebook { left: 8px; right: 8px; transform: none; width: auto; }
  #inspector:not([hidden]) { max-height: calc(100vh - var(--bar-h) - 70px); }
  body.show-left #left { left: 10px; }
  #left, #right { top: 58px; max-height: calc(100vh - var(--bar-h) - 78px); }
}

/* ---- the hunt: the prowler the valley fears most, in the plaque ---- */
#hunter { --accent: #c4503e; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; cursor: pointer; }
#hunter[hidden] { display: none; }
#hunterFace { width: 64px; height: 64px; image-rendering: pixelated; background: radial-gradient(circle at 50% 60%, rgba(196, 80, 62, 0.18), rgba(0, 0, 0, 0) 70%); border-radius: 3px; }
#hunterHead { display: flex; align-items: center; gap: 6px; font: var(--label); letter-spacing: 0.12em; text-transform: uppercase; color: #e58a74; }
#hunterName { font: italic 600 17px/1.2 var(--serif); color: #f6d6c8; margin: 1px 0 !important; }
#hunterText { font-size: 12px; color: var(--ink-soft); }
#hunterAlso { font-size: 11px; margin-top: 3px !important; }
#hunter:hover { filter: brightness(1.08); }
#hunter.hunting { --accent: #ff6a4a; animation: hunting 1.6s ease-in-out infinite; }
#hunter.hunting #hunterHead { color: #ff9a7a; }
#hunter.dread #hunterName { color: #ffb48a; text-shadow: 0 0 10px rgba(255, 120, 60, 0.45); }
#hunter.scarred #hunterFace { animation: scar 0.9s ease-out; }
@keyframes hunting { 0%, 100% { box-shadow: inset 3px 0 0 var(--accent); } 50% { box-shadow: inset 3px 0 0 var(--accent), 0 0 16px rgba(255, 90, 60, 0.35); } }
@keyframes scar { 0% { filter: brightness(2.2) saturate(0); } 100% { filter: none; } }

/* The way into the album, at the foot of the plaque. */
.album-link {
  display: flex; align-items: center; gap: 7px; width: 100%; margin: 10px 0 0; padding: 5px 8px;
  font: 600 12px var(--serif); color: var(--gold-soft); text-align: left;
}
.album-link span { flex: 1; }
.album-link b { font: 600 11px var(--serif); color: var(--quiet); font-variant-numeric: tabular-nums lining-nums; }
.album-link i[data-icon] { margin: 0; }

/* ---- the album: a book of parchment pages ---- */
#album {
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; padding: 12px 16px 16px; z-index: 45;
  animation: albumIn 0.22s ease-out;
}
#album[hidden] { display: none; }
@keyframes albumIn { from { transform: translate(-50%, -48%); } to { transform: translate(-50%, -50%); } }
#album .close { position: absolute; top: 6px; right: 6px; }
.album-head { display: flex; align-items: baseline; gap: 12px; margin: 0 40px 8px 0; flex-wrap: wrap; }
.album-head h2 { margin: 0; border: 0; padding: 0; font: 600 20px var(--serif); letter-spacing: 0.02em; font-variant: normal; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.album-head h2::after { display: none; }
.album-head p { margin: 0; font-size: 12px; }
.album-tabs { display: flex; gap: 3px; flex-wrap: wrap; margin: 0 0 8px; }
.album-tabs button { display: flex; align-items: baseline; gap: 6px; padding: 3px 9px; font-size: 12px; }
.album-tabs button b { font: 600 10.5px var(--serif); opacity: 0.8; font-variant-numeric: tabular-nums lining-nums; }
.album-tabs button.done b::after { content: ' \2726'; color: #c4503e; }
.album-page {
  position: relative; overflow-y: auto; min-height: 0; flex: 1 1 auto;
  padding: 12px 14px 14px; color: #3b2a1c;
  background: #efe3c6; border-radius: 2px;
  box-shadow: inset 0 0 40px rgba(120, 84, 40, 0.28), inset 0 0 0 1px rgba(90, 60, 30, 0.35);
}
body.skinned .album-page { border: 5px solid transparent; border-image: var(--frame-page) 5 fill / 10px / 0 stretch; background: none; box-shadow: none; image-rendering: pixelated; }
.album-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 0 0 10px; padding: 0 70px 6px 0; border-bottom: 1px solid rgba(90, 60, 30, 0.25); }
.album-page-head h3 { margin: 0; font: 600 17px var(--serif); color: #4a2f17; }
.album-page-head p { margin: 2px 0 0; font: italic 12.5px var(--serif); color: #6b5238; }
.album-page-head small { font: 600 12px var(--serif); color: #6b5238; white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.acard {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 128px; padding: 8px 6px 7px;
  text-align: center; color: #3b2a1c; text-shadow: none;
}
body.skinned .album-page .acard { border: 4px solid transparent; border-image: var(--card-0) 4 fill / 8px / 0 stretch; padding: 6px 4px 5px; text-shadow: none; }
body.skinned .album-page .acard.found { border-image-source: var(--card-1); }
body.skinned .album-page .acard:hover:not(:disabled) { border-image-source: var(--card-1); filter: brightness(1.04); background: none; color: #3b2a1c; }
body.skinned .album-page .acard:active:not(:disabled) { padding: 6px 4px 5px; }
.acard .art { display: flex; align-items: center; justify-content: center; height: 52px; }
.acard b { font: 600 12px/1.2 var(--serif); color: #3b2a1c; }
.acard small { font: italic 10.5px/1.25 var(--serif); color: #6b5238; }
.acard:not(.found) { cursor: default; }
.acard:not(.found) b { color: #8a7458; }
.acard.found.r2 .art { filter: drop-shadow(0 0 3px rgba(150, 150, 170, 0.55)); }
.acard.found.r3 .art { filter: drop-shadow(0 0 4px rgba(214, 160, 50, 0.75)); }
.acard.found.r3 b::after { content: ' \2726'; color: #b8862c; }
.acard.on { outline: 2px solid rgba(196, 80, 62, 0.6); outline-offset: 1px; }
.acard .pips { display: flex; gap: 3px; margin-top: 1px; }
.acard .pips i { width: 6px; height: 6px; transform: rotate(45deg); background: rgba(90, 60, 30, 0.22); }
.acard .pips i.on { background: #b8862c; }
.acard.gold { background: linear-gradient(160deg, rgba(255, 226, 140, 0.55), rgba(240, 194, 76, 0.18) 60%, rgba(255, 236, 170, 0.5)); }
.acard.gold .art { filter: drop-shadow(0 0 5px rgba(240, 180, 40, 0.9)); }
.acard.gold b { color: #6e4a10; }
#albumToast .art { gap: 2px; }
#albumToast.gold { box-shadow: 0 0 26px rgba(240, 194, 76, 0.75), 0 10px 26px rgba(0, 0, 0, 0.5); }
.album-page .seal { position: absolute; right: 14px; top: 6px; transform: rotate(-12deg); filter: drop-shadow(0 2px 2px rgba(60, 20, 10, 0.4)); }
.album-detail { display: flex; gap: 14px; align-items: center; margin: 12px 0 0; padding: 10px 12px; background: rgba(255, 250, 235, 0.55); border: 1px solid rgba(90, 60, 30, 0.3); border-radius: 3px; }
.album-detail b { display: block; font: 600 15px var(--serif); color: #4a2f17; }
.album-detail p { margin: 3px 0; font: 13.5px/1.45 var(--serif); color: #3b2a1c; }
.album-detail small { font: italic 11.5px var(--serif); color: #6b5238; }

/* A card newly found: a little note that rises in the corner of the land. */
#albumToast {
  position: fixed; z-index: 35; right: calc(var(--right-w) + 2 * var(--gap)); bottom: calc(var(--bar-h) + 2 * var(--gap));
  display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 9px; text-align: left;
  color: #3b2a1c; text-shadow: none; animation: toastIn 0.5s cubic-bezier(.2, 1.4, .4, 1);
  background: #efe3c6; border-radius: 3px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}
#albumToast[hidden] { display: none; }
body.skinned #albumToast { border: 4px solid transparent; border-image: var(--card-1) 4 fill / 8px / 0 stretch; background: none; }
body.skinned #albumToast:hover:not(:disabled) { border-image-source: var(--card-1); background: none; color: #3b2a1c; filter: brightness(1.05); }
#albumToast .words { display: flex; flex-direction: column; }
#albumToast small { font: 600 10px var(--serif); letter-spacing: 0.12em; text-transform: uppercase; color: #8a4a2c; }
#albumToast b { font: 600 14px var(--serif); color: #3b2a1c; }
#albumToast.r3 { box-shadow: 0 0 22px rgba(240, 194, 76, 0.55), 0 10px 26px rgba(0, 0, 0, 0.5); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }

/* The hunt and the album at the ending and in the record. */
.hunter-list { list-style: none; margin: 0; padding: 0; }
.hunter-list li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid rgba(240, 214, 160, 0.07); font: 13px/1.45 var(--serif); }
.hunter-list li canvas { flex: none; width: 32px; height: 32px; image-rendering: pixelated; }
.hunter-list li b { color: #f6d6c8; font-style: italic; }
.hunter-list li.slain b { color: var(--gold-soft); }
.hunter-list li small { display: block; color: var(--quiet); font-size: 11.5px; }
#inspector .gestures { display: flex; gap: 4px; margin-top: 2px; }
#inspector .gestures button { display: inline-flex; align-items: center; padding: 1px 8px; font-size: 11.5px; }
#inspector .gestures button i[data-icon], #inspector .gestures button canvas { margin-right: 5px; }
#inspector .trail { margin: 0; font: italic 12px/1.4 var(--serif); color: #f6c8d0; }
#inspector .flop-now { margin: 0; font: italic 12.5px/1.4 var(--serif); color: #f3c38a; }
#inspector .crowd-now { margin: 0; font: italic 12.5px/1.4 var(--serif); color: #f0d07a; }
#inspector .home { margin: 0; font: italic 12.5px/1.4 var(--serif); color: #d9c49a; }
#houseList .camp-line .fashion { font-style: italic; color: #d9c49a; }

/* ---- the apprentice: one young one who walks with you and teaches for you ---- */
#apprentice { --accent: #f0c24c; display: block; padding: 8px 10px 8px; transition: box-shadow 0.3s; }
#apprentice[hidden] { display: none; }
#apprentice.flash { box-shadow: inset 3px 0 0 var(--accent), 0 0 0 2px rgba(240, 194, 76, 0.7); }
#apprentice header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
#apprentice header b { font: 600 12px var(--serif); font-variant: small-caps; letter-spacing: 0.12em; color: #f6e2b0; }
#apprentice header small { margin-left: auto; font: italic 11px var(--serif); color: var(--gold-soft); }
#apprenticeBody p.what { margin: 0 0 6px; font: italic 12px/1.4 var(--serif); color: var(--ink-soft); }
#apprenticeBody .who { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; margin: 2px 0 6px; }
#apprenticeBody .who .slot { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 5px; background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 0 1px rgba(240, 194, 76, 0.3); }
#apprenticeBody .who .slot canvas { max-width: 28px; max-height: 28px; width: auto; height: auto; }
#apprenticeBody .who b { font: 600 13.5px var(--serif); color: var(--ink); }
#apprenticeBody .who small { font: 12px var(--serif); color: var(--quiet); }
#apprenticeBody .who .status { display: block; font: italic 11.5px var(--serif); color: var(--gold-soft); }
#apprenticeBody .acts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
#apprenticeBody .acts .look { font-size: 11px; }
#apprenticeBody .knows { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin: 0 0 6px; }
#apprenticeBody .knows small { font: italic 11.5px var(--serif); color: var(--quiet); margin-right: 2px; }
#apprenticeBody .knows canvas { max-width: 18px; max-height: 18px; width: auto; height: auto; image-rendering: pixelated; }
#apprenticeBody .wants { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font: italic 12.5px/1.35 var(--serif); color: #f2e2b8; }
#apprenticeBody .wants span { flex: 1; }
#apprenticeBody button.do { padding: 2px 10px; font: 600 11.5px var(--serif); color: #1c2416; background: #f0c24c; border: 1px solid #b88a2a; border-radius: 4px; border-image: none; cursor: pointer; white-space: nowrap; }
#apprenticeBody button.do:hover:not(:disabled) { background: #f8d877; }
#apprenticeBody button.do:disabled { opacity: 0.45; cursor: default; }
#apprenticeBody .send-head { display: block; margin: 2px 0 3px; font: italic 11.5px var(--serif); color: var(--quiet); }
#apprenticeBody .send { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
#apprenticeBody .send small { flex: 1; font: italic 11.5px var(--serif); color: var(--quiet); }
#apprenticeBody .send.camps { flex-direction: column; align-items: stretch; gap: 3px; }
#apprenticeBody .send.camps button { display: flex; align-items: center; gap: 6px; padding: 2px 8px; font: 12px var(--serif); text-align: left; }
#apprenticeBody .send.camps .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
#apprenticeBody .send.camps small { margin-left: auto; font: 11px var(--mono); color: var(--quiet); }
#apprenticeBody .foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 4px; }
#apprenticeBody .foot small { flex: 1; font: italic 11px var(--serif); color: var(--quiet); }
#apprenticeBody .release { font-size: 11px; color: var(--quiet); }
#apprenticeBody p.line { margin: 6px 0 0; font: 12px/1.4 var(--serif); }
#apprenticeBody p.line small { font: italic 11px var(--serif); color: var(--quiet); }
#apprenticeBody p.line .you { color: var(--gold-soft); }
#apprenticeBody p.line .sep { color: var(--quiet); }
#apprenticeBody p.line .gone { opacity: 0.6; }
#apprenticeBody p.line .now { font-weight: 600; text-decoration: underline; text-decoration-color: rgba(240, 194, 76, 0.6); text-underline-offset: 2px; }

/* ---- out in the mist: what was found, and the rumours of the rest ---- */
#finds { --accent: #b8c6d8; display: block; padding: 8px 10px 8px; }
#finds[hidden] { display: none; }
#finds header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
#finds header b { font: 600 12px var(--serif); font-variant: small-caps; letter-spacing: 0.12em; color: #dfe6ef; }
#finds header small { margin-left: auto; font: italic 11px var(--serif); color: #b8c6d8; }
#findsList { list-style: none; margin: 0; padding: 0; }
#findsList li { display: grid; grid-template-columns: 30px 1fr; gap: 2px 8px; padding: 6px 0; }
#findsList li + li { border-top: 1px solid var(--line); }
#findsList li.quiet { display: block; font: italic 12px var(--serif); color: var(--quiet); }
#findsList .slot { grid-row: span 2; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 5px; background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 0 1px rgba(184, 198, 216, 0.3); }
#findsList .slot canvas { max-width: 28px; max-height: 28px; width: auto; height: auto; }
#findsList .what .title { display: block; font: 12.5px/1.35 var(--serif); color: var(--ink); }
#findsList li.rumour .what .title { font-style: italic; color: #dfe6ef; }
#findsList .what small { display: block; margin-top: 1px; font: italic 11.5px/1.35 var(--serif); color: var(--quiet); }
#findsList .acts { grid-column: 2; display: flex; align-items: center; gap: 8px; margin-top: 3px; }
#findsList .acts .look { margin-left: auto; font-size: 11px; }
#findsList button.do { padding: 2px 10px; font: 600 11.5px var(--serif); color: #18202a; background: #b8c6d8; border: 1px solid #8796ab; border-radius: 4px; border-image: none; cursor: pointer; }
#findsList button.do:hover:not(:disabled) { background: #d4deea; }
#findsList button.do:disabled { opacity: 0.45; cursor: default; }
/* What is only spoken of: its shape in shadow, and a question. */
#findsList .slot.unseen { position: relative; }
#findsList .slot.unseen canvas { filter: brightness(0) opacity(0.55); }
#findsList .slot.unseen::after { content: '?'; position: absolute; right: 2px; bottom: 0; font: 700 12px var(--serif); color: #dfe6ef; text-shadow: 0 1px 2px #000; animation: wonder 2.6s ease-in-out infinite; }
@keyframes wonder { 50% { opacity: 0.45; transform: translateY(-1px); } }
/* Just found: a moment of gold. */
#findsList li.new { animation: foundGlow 2.4s ease-out 2; border-radius: 5px; }
#findsList li.new .slot { animation: foundSlot 2.4s ease-out 2; }
@keyframes foundSlot { 0% { box-shadow: inset 0 0 0 1px rgba(240, 194, 76, 0.9), 0 0 14px rgba(240, 194, 76, 0.6); } 100% { box-shadow: inset 0 0 0 1px rgba(184, 198, 216, 0.3); } }
@keyframes foundGlow { 0% { background: rgba(240, 194, 76, 0.32); } 100% { background: rgba(240, 194, 76, 0); } }
/* The apprentice: its picture breathes a little gold. */
#apprenticeBody .who .slot { animation: bond 3.2s ease-in-out infinite; }
@keyframes bond { 50% { box-shadow: inset 0 0 0 1px rgba(240, 194, 76, 0.65), 0 0 10px rgba(240, 194, 76, 0.35); } }
/* ---- gifts left for you: a little shelf of what those you helped left by your lantern ---- */
#keepsakes { --accent: #f0b8a0; display: block; padding: 8px 10px 8px; }
#keepsakes[hidden] { display: none; }
#keepsakes header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
#keepsakes header b { font: 600 12px var(--serif); font-variant: small-caps; letter-spacing: 0.12em; color: #f6dccf; }
#keepsakes header small { margin-left: auto; font: italic 11px var(--serif); color: #f0b8a0; }
#keepsakesShelf { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; border-radius: 6px; background: linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.32)); box-shadow: inset 0 -3px 0 rgba(120, 82, 48, 0.55); }
#keepsakesShelf:empty { display: none; }
#keepsakesShelf .slot { width: 30px; height: 30px; padding: 0; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 5px; background: rgba(255, 240, 220, 0.06); box-shadow: inset 0 0 0 1px rgba(240, 184, 160, 0.22); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
#keepsakesShelf .slot:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgba(240, 184, 160, 0.6); }
#keepsakesShelf .slot.chosen { background: rgba(240, 184, 160, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 214, 190, 0.85); }
#keepsakesShelf .slot canvas { max-width: 26px; max-height: 26px; width: auto; height: auto; }
#keepsakesShelf .slot.new { animation: giftSlot 2.2s ease-out 3; }
@keyframes giftSlot { 0% { box-shadow: inset 0 0 0 1px rgba(255, 224, 190, 1), 0 0 14px rgba(240, 170, 130, 0.75); transform: translateY(-2px); } 100% { box-shadow: inset 0 0 0 1px rgba(240, 184, 160, 0.22); transform: none; } }
#keepsakesLine { margin: 6px 0 0; font: 12.5px/1.4 var(--serif); color: var(--ink); }
#keepsakesLine:empty, #keepsakesNotes:empty { display: none; }
#keepsakesLine small { font: italic 11.5px var(--serif); color: var(--quiet); }
#keepsakesLine .look, #keepsakesNotes .look { font-size: 11px; }
#keepsakesNotes { margin: 4px 0 0; font: italic 11.5px/1.45 var(--serif); color: var(--quiet); }
#keepsakesNotes .coming { color: #f6dccf; }
#keepsakesNotes .putby { color: #d8c090; }
@media (prefers-reduced-motion: reduce) { #findsList .slot.unseen::after, #findsList li.new, #apprenticeBody .who .slot, #keepsakesShelf .slot.new { animation: none; } }

/* ---- things to do: the few acts most worth doing now ---- */
#todo { --accent: #9fd88a; display: block; padding: 8px 10px 8px; }
#todo header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
#todo header b { font: 600 12px var(--serif); font-variant: small-caps; letter-spacing: 0.12em; color: #cfe8b8; }
#todo header small { margin-left: auto; font: italic 11px var(--serif); color: #9fd88a; }
#todoList { list-style: none; margin: 0; padding: 0; }
#todoList li { display: grid; grid-template-columns: 30px 1fr; gap: 2px 8px; padding: 6px 0; }
#todoList li + li { border-top: 1px solid var(--line); }
#todoList li.quiet { display: block; font: italic 12px var(--serif); color: var(--quiet); }
#todoList .slot { grid-row: span 2; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 5px; background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 0 1px rgba(159, 216, 138, 0.25); }
#todoList .what .title { display: block; font: 12.5px/1.35 var(--serif); color: var(--ink); }
#todoList .what small { display: block; margin-top: 1px; font: italic 11.5px/1.35 var(--serif); color: var(--quiet); }
#todoList .acts { grid-column: 2; display: flex; align-items: center; gap: 8px; margin-top: 3px; }
#todoList .acts .when { font: italic 11px var(--serif); color: var(--quiet); }
#todoList .acts .look { margin-left: auto; font-size: 11px; }
#todo button.do, #nextDeed button.do { padding: 2px 10px; font: 600 11.5px var(--serif); color: #1c2416; background: #9fd88a; border: 1px solid #6fae5c; border-radius: 4px; border-image: none; cursor: pointer; }
#todo button.do:hover:not(:disabled), #nextDeed button.do:hover:not(:disabled) { background: #b9eaa6; }
#todo button.do:disabled, #nextDeed button.do:disabled { opacity: 0.45; cursor: default; }
#nextDeed { margin: 0 0 6px; font: 13px/1.4 var(--serif); color: var(--ink-soft); text-align: center; }
#nextDeed b { color: #cfe8b8; font-variant: small-caps; letter-spacing: 0.08em; }
#nextDeed[hidden] { display: none; }
#barHint.short .extra { display: none; }

/* ---- the land's menu: right-click, or press and hold, for what can be done there ---- */
#context { position: fixed; z-index: 45; width: 272px; max-height: calc(100vh - 16px); padding: 0 0 6px; overflow-x: hidden; overflow-y: auto; border-color: var(--line-strong); animation: popIn 0.16s cubic-bezier(.2, .8, .3, 1); }
#context[hidden] { display: none; }
#context .head { display: flex; align-items: center; gap: 9px; padding: 8px 10px 7px; background: linear-gradient(180deg, rgba(240, 194, 76, 0.18), rgba(240, 194, 76, 0.03)); border-bottom: 1px solid var(--line-strong); }
#context .head .pic { width: 42px; height: 40px; display: flex; align-items: center; justify-content: center; flex: none; border-radius: 6px; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 0 1px var(--line-strong); overflow: hidden; }
#context .head b { display: block; font: 600 13.5px/1.25 var(--serif); color: #f6e2b0; }
#context .head small { display: block; margin-top: 1px; font: italic 11.5px/1.3 var(--serif); color: var(--quiet); }
#context .group { padding: 4px 4px 0; }
#context .group + .group, #context .info + .group { border-top: 1px solid var(--line); margin-top: 4px; }
body.skinned #context .item, #context .item { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0; padding: 3px 8px 3px 4px; background: none; border: 0; border-image: none; border-radius: 5px; color: var(--ink); font: 13px var(--serif); text-align: left; cursor: pointer; }
#context .item .slot { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; flex: none; border-radius: 5px; background: rgba(0, 0, 0, 0.32); box-shadow: inset 0 0 0 1px rgba(240, 220, 170, 0.14); }
#context .item .label { flex: 1; }
#context .item small { color: var(--quiet); font: italic 11px var(--serif); white-space: nowrap; }
#context .item.more .label::after { content: ' \25B8'; color: var(--gold-soft); }
#context .item.more.open .label::after { content: ' \25BE'; }
#context .item:hover:not(:disabled), #context .item:focus-visible, #context .item.open { background: rgba(240, 194, 76, 0.15); color: #f6e2b0; outline: none; }
#context .item:hover:not(:disabled) .slot, #context .item.open .slot { box-shadow: inset 0 0 0 1px rgba(240, 194, 76, 0.65); }
#context .item:disabled { opacity: 0.45; cursor: default; }
#context .quiet-group .item { color: var(--quiet); font-size: 12px; }
#context .quiet-group .item .slot { width: 28px; height: 16px; background: none; box-shadow: none; }
#context .sub { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px 6px 6px 40px; }
#context .sub.wide { grid-template-columns: repeat(4, 1fr); }
#context .sub[hidden] { display: none; }
body.skinned #context .choice, #context .choice { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0; padding: 4px 2px 3px; border-radius: 5px; background: rgba(0, 0, 0, 0.26); border: 1px solid rgba(240, 220, 170, 0.12); border-image: none; color: var(--ink-soft); font: 10.5px var(--serif); cursor: pointer; }
#context .choice .pic { height: 28px; display: flex; align-items: center; justify-content: center; }
#context .choice:hover:not(:disabled) { border-color: rgba(240, 194, 76, 0.65); color: #f6e2b0; background: rgba(240, 194, 76, 0.13); }
#context .choice:disabled { opacity: 0.4; cursor: default; }
#context .here { padding: 5px 6px 2px; border-bottom: 1px solid var(--line); }
#context .here + .here { padding-top: 3px; }
#context .group + .here { border-top: 1px solid var(--line); margin-top: 4px; }
#context .here h4 { margin: 0 0 2px 4px; font: 600 10.5px var(--serif); font-variant: small-caps; letter-spacing: 0.12em; color: var(--gold-soft); opacity: 0.75; }
body.skinned #context .here .row, #context .here .row { display: flex; align-items: center; gap: 7px; width: 100%; margin: 0; padding: 2px 6px 2px 4px; background: none; border: 0; border-image: none; border-radius: 4px; color: var(--ink-soft); font: 12px/1.35 var(--serif); text-align: left; text-shadow: none; }
#context .here .row .ic { width: 20px; height: 20px; flex: none; display: flex; align-items: center; justify-content: center; }
#context .here .row .ic canvas { max-width: 20px; max-height: 20px; width: auto; height: auto; }
#context .here .row .tx { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#context .here .row small { flex: none; font: italic 10.5px var(--serif); color: var(--quiet); }
#context .here .row.goes { cursor: pointer; }
#context .here .row.goes small::after { content: ' \203A'; color: var(--gold-soft); font-style: normal; }
#context .here .row.goes:hover, #context .here .row.goes:focus-visible { background: rgba(240, 194, 76, 0.13); color: #f6e2b0; outline: none; }
#context .here .row.more-near { padding-left: 31px; font: italic 11px var(--serif); color: var(--quiet); }
#context .info { margin: 6px 10px 2px; font: italic 12px/1.35 var(--serif); color: #d9c49a; }

/* ---- planting: the Plant button opens a little choice above it ---- */
#plantGroup { position: relative; }
#plantPick { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 6px; z-index: 30; }
#plantPick[hidden] { display: none; }
#plantPick button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; padding: 4px 6px; font: 11px var(--serif); }
#plantPick button i[data-icon] { margin: 0; height: 30px; }

/* ---- notices: a little tray on the land, folded to a button with a count of what is new ---- */
#sideStack { position: fixed; top: var(--gap); right: calc(var(--right-w) + 2 * var(--gap)); z-index: 13; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; transition: right 0.25s; pointer-events: none; }
#sideStack > * { position: relative; pointer-events: auto; }
body.fold-right #sideStack { top: 52px; right: 10px; }
#notices { width: 280px; max-height: 48vh; display: flex; flex-direction: column; padding: 6px 8px 8px; }
body.watching #notices { display: none; }
#notices header { display: flex; align-items: center; gap: 6px; }
#noticesToggle { flex: 1; display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px; background: none; border: 0; cursor: pointer; font: 600 12px var(--serif); font-variant: small-caps; letter-spacing: 0.12em; color: var(--gold-soft); text-align: left; }
#noticesCount { margin-left: 6px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--ember); color: #1a1410; font: 700 11px/18px var(--mono); text-align: center; letter-spacing: 0; }
#noticesList { list-style: none; margin: 6px 0 0; padding: 0 2px 0 0; overflow-y: auto; }
#noticesList li { position: relative; padding: 5px 6px 5px 17px; border-radius: 4px; font: 12.5px/1.35 var(--serif); color: var(--ink-soft); }
#noticesList li + li { border-top: 1px solid var(--line); }
#noticesList li.goes { cursor: pointer; }
#noticesList li.goes:hover, #noticesList li.on { background: rgba(240, 214, 160, 0.09); color: var(--ink); }
#noticesList li .text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#noticesList li .ago { display: block; font: italic 10.5px var(--serif); color: var(--quiet); }
#noticesList li::before { content: ''; position: absolute; left: 6px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--kc, rgba(240, 214, 160, 0.28)); }
#notices.closed { width: auto; max-height: none; padding: 3px 6px; }
#notices.closed #noticesList, #notices.closed #noticesClose { display: none; }
@media (max-width: 860px) {
  /* On a small screen, at the top between the Valley and Story buttons, over the cards when open. */
  #sideStack, body.fold-right #sideStack { top: 10px; right: auto; left: 50%; transform: translateX(-50%); width: calc(100vw - 20px); align-items: center; z-index: 26; }
  #notices { width: min(300px, 100%); }
  #notices.closed { width: auto; }
}

/* ---- the cards tucked to the side: a short list under the notices; a click opens one at the top ---- */
#moment .head .tuck, #echo .head .tuck { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 22px; margin: -2px -4px 0 4px; padding: 0; border: 1px solid transparent; border-image: none; border-radius: 4px; background: none; color: var(--quiet); cursor: pointer; }
#moment .head .tuck:hover, #echo .head .tuck:hover { color: var(--ink); border-color: var(--line); background: rgba(255, 255, 255, 0.05); }
#cardRail { width: 204px; }
#cardRail[hidden] { display: none; }
#cardRail header { display: none; align-items: center; gap: 6px; padding: 0 2px 3px; }
#cardRail.side header { display: flex; }
#railHead { font: 600 10.5px var(--serif); font-variant: small-caps; letter-spacing: 0.12em; color: var(--quiet); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9); }
#railTop { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 0 5px; font: 10.5px var(--serif); letter-spacing: 0; color: var(--quiet); background: rgba(10, 8, 6, 0.55); border: 1px solid rgba(240, 220, 170, 0.14); border-image: none; border-radius: 3px; text-shadow: none; cursor: pointer; }
#railTop:hover { color: var(--ink); background: rgba(20, 16, 12, 0.8); }
#railTop[hidden] { display: none; }
#railList { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; max-height: 40vh; overflow-y: auto; }
#railList li { --cc: var(--gold); position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; align-items: center; gap: 0 6px; padding: 3px 6px 3px 7px; border-radius: 3px; background: rgba(12, 9, 7, 0.68); box-shadow: inset 2px 0 0 var(--cc), 0 2px 8px rgba(0, 0, 0, 0.35); cursor: pointer; opacity: 0.88; animation: chipIn 0.3s ease-out; transition: opacity 1.4s, background 0.15s; }
#railList li:hover, #railList li:focus-visible { opacity: 1; background: rgba(24, 19, 14, 0.9); outline: none; }
#railList li .ic { position: relative; display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; }
#railList li .ic canvas, #railList li .ic svg { max-width: 16px; max-height: 16px; width: auto; height: auto; }
#railList li .tx { font: 600 11.5px/1.35 var(--serif); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#railList li .note { font: italic 10.5px var(--serif); color: var(--quiet); white-space: nowrap; }
#railList li .x { padding: 0 2px; font: 13px/1 var(--serif); color: var(--quiet); background: none; border: 0; border-image: none; text-shadow: none; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
#railList li:hover .x, #railList li:focus-within .x { opacity: 1; }
#railList li .x:hover { color: var(--ink); }
#railList li .bar { grid-column: 1 / -1; height: 1px; margin-top: 3px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
#railList li .bar span { display: block; height: 100%; background: var(--cc); opacity: 0.8; transition: width 0.4s linear; }
#railList li.moment { --cc: #f0c24c; }
#railList li.moment .tx { color: #ecd8a8; }
#railList li.moment.answered { --cc: #9fd88a; }
#railList li.moment.passed { --cc: #a8a4ae; }
#railList li.moment.missed { --cc: #e5604a; }
#railList li.echo { --cc: #b8c6f2; }
#railList li.echo .tx { color: #d4dcf4; }
#railList li.word { --cc: rgba(246, 230, 184, 0.35); grid-template-columns: minmax(0, 1fr); cursor: default; opacity: 0.75; }
#railList li.word .ic { display: none; }
#railList li.word .tx { font: italic 11.5px/1.35 var(--serif); color: #e8dab4; }
#railList li.word.loss .tx { color: #e8b4a6; }
#railList li.word.house .tx, #railList li.word.omen .tx { color: #ddd0ec; }
#railList li.word.calling.done .tx { color: #bfe0b4; }
#railList li.word.going { opacity: 0; }
/* Unread: a small light on its picture until it is opened, after one soft brightening as it comes. */
#railList li.fresh { opacity: 1; animation: chipIn 0.3s ease-out, chipLift 1.6s ease-out 0.3s 1; }
#railList li.fresh .ic::after { content: ''; position: absolute; top: -2px; right: -3px; width: 5px; height: 5px; border-radius: 50%; background: var(--cc); box-shadow: 0 0 4px var(--cc); }
@keyframes chipIn { from { opacity: 0; transform: translateX(10px); } to { transform: none; } }
@keyframes chipLift { 30% { background: rgba(48, 38, 22, 0.92); } }
/* With the list or the notices open beside them, the cards at the top keep to the land that is left. */
@media (min-width: 861px) {
  body.has-rail { --side-w: 204px; }
  body.notices-open { --side-w: 280px; }
  body.has-rail #moment, body.notices-open #moment { left: calc((100vw + var(--left-w) - var(--right-w) - var(--side-w) - var(--gap)) / 2); width: clamp(280px, calc(100vw - var(--left-w) - var(--right-w) - var(--side-w) - 5 * var(--gap)), 440px); }
  body.has-rail #echo, body.notices-open #echo { left: calc((100vw + var(--left-w) - var(--right-w) - var(--side-w) - var(--gap)) / 2); width: clamp(280px, calc(100vw - var(--left-w) - var(--right-w) - var(--side-w) - 5 * var(--gap)), 460px); }
  body.watching.notices-open:not(.has-rail) #moment, body.watching.notices-open:not(.has-rail) #echo { left: 50%; }
}
@media (max-width: 860px) {
  /* A row of small chips under the notices; the cards at the top move down below it. */
  #cardRail { display: flex; align-items: center; gap: 4px; width: auto; max-width: 100%; }
  #cardRail.side header { padding: 0; }
  #railHead { display: none; }
  #railTop { padding: 3px 5px; }
  #railTop span { display: none; }
  #railList { flex-direction: row; max-height: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  #railList::-webkit-scrollbar { display: none; }
  #railList li { max-width: 150px; grid-template-columns: 16px minmax(0, auto); }
  #railList li .note, #railList li .bar, #railList li .x { display: none; }
  #railList li.word { max-width: 190px; grid-template-columns: minmax(0, auto); }
  body.has-rail #moment, body.has-rail #echo { top: 84px; }
  body.show-left #cardRail, body.show-right #cardRail { display: none; }
}
#inspector .pair-now { margin: 0; font: italic 12.5px/1.4 var(--serif); color: #f6c8d0; }
#inspector .wish-now { margin: 2px 0; font: italic 12.5px/1.4 var(--serif); color: #f3e3b8; }
#inspector .wish-now.fear { color: #b9c8de; }
#inspector .wish-now small { display: block; font-style: normal; color: #b8ab92; }
#wishes { --accent: #e8cf8a; display: block; padding-top: 8px; padding-bottom: 6px; }
#wishes[hidden] { display: none; }
#wishes .wishes-head { margin: 0 0 4px; font: var(--label); letter-spacing: 0.12em; text-transform: uppercase; color: #e8cf8a; }
#wishList { list-style: none; margin: 0; padding: 0; }
#wishList li { display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; align-items: center; margin: 4px 0; font-size: 12.5px; line-height: 1.35; }
#wishList li canvas { image-rendering: pixelated; }
#wishList li b { color: #f6e2b0; }
#wishList li.fear b { color: #c9d6ea; }
#wishList li small { display: block; color: #b8ab92; font-size: 11.5px; }
#inspector ul.ways { list-style: none; margin: 0 0 4px; padding: 0; }
#inspector ul.ways li { display: flex; align-items: flex-start; gap: 6px; margin: 2px 0; font-size: 12.5px; line-height: 1.35; }
#inspector ul.ways li canvas, #inspector ul.ways li i[data-icon] { flex: none; margin-top: 1px; }
#inspector ul.ways li small { color: #b8ab92; }
#inspector ul.ways li.fad small { color: #f3c38a; }
#inspector ul.ways li.custom small { color: #f0c24c; }
.house p.fads canvas, .house p.fads i[data-icon] { display: inline-block; vertical-align: -2px; margin: 0 3px 0 1px; }
.wonder-list { list-style: none; margin: 0; padding: 0; }
.wonder-list li { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; }
.wonder-list li canvas, .wonder-list li i[data-icon] { flex: none; }
.wonder-list li.s1 { opacity: 0.75; font-style: italic; }
.fad-list { list-style: none; margin: 0; padding: 0; }
.fad-list li { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; }
.fad-list li canvas, .fad-list li i[data-icon] { flex: none; }
.fad-list li.custom b { color: #b07a1c; }
.place-list { list-style: none; margin: 0; padding: 0; }
.place-list li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid rgba(240, 214, 160, 0.07); font: 13px/1.45 var(--serif); }
.place-list li canvas { flex: none; image-rendering: pixelated; margin-top: 2px; }
.place-list li b { color: var(--gold-soft); font-style: italic; }
.place-list li small { display: block; color: var(--quiet); font-size: 11.5px; }
.album-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.album-strip span { display: inline-flex; padding: 4px; background: #efe3c6; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(90, 60, 30, 0.4); }
.album-strip span.r3 { box-shadow: inset 0 0 0 1px rgba(90, 60, 30, 0.4), 0 0 8px rgba(240, 194, 76, 0.6); }
@media (max-width: 860px) {
  #albumToast { right: 8px; left: 8px; bottom: calc(var(--bar-h) + 16px); }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

/* ---- scenarios: the goal in the plaque, the list to choose from, and the verdict ---- */
.stars { letter-spacing: 0.08em; color: var(--gold); text-shadow: 0 0 8px rgba(240, 194, 76, 0.45); }
.stars span { color: rgba(240, 214, 160, 0.28); }
.stars span.on { color: var(--gold); text-shadow: 0 0 8px rgba(240, 194, 76, 0.55); }
#scenario { --accent: #9fc4e8; grid-template-columns: 32px 1fr; }
#scenario[hidden] { display: none; }
#scenario.won { --accent: var(--sage); }
#scenario.lost { --accent: var(--rust); }
#scenario .art { display: flex; align-items: flex-start; justify-content: center; padding-top: 2px; }
#scenarioHead { font: var(--label); letter-spacing: 0.12em; text-transform: uppercase; color: #b9d4ee; }
#scenarioGoal { font: 13.5px/1.38 var(--serif); color: #f2e8d2; margin: 3px 0 2px !important; }
#scenarioStars { font-size: 16px; margin: 0 0 2px !important; }
#scenarioProgress { font-size: 11.5px; color: var(--ink-soft); }
#scenarioMeter { margin-top: 5px; }
#scenarioMeter[hidden] { display: none; }
#scenarioMeter span { background: linear-gradient(180deg, #cfe3f6, #7fa6d9); box-shadow: 0 0 6px rgba(160, 200, 240, 0.5); }

/* ---- saved valleys: a few by hand, the last few by themselves ---- */
#saves {
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; padding: 12px 16px 16px; z-index: 45; animation: albumIn 0.22s ease-out;
}
#saves[hidden] { display: none; }
#saves .close { position: absolute; top: 6px; right: 6px; }
#saves > p.quiet { margin: 0 0 6px; font: italic 12.5px/1.4 var(--serif); }
#saveList { list-style: none; margin: 0 0 10px; padding: 0; overflow-y: auto; min-height: 0; }
#saveList li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 9px 6px; border-bottom: 1px solid var(--line); }
#saveList li.quiet { display: block; font: italic 13px var(--serif); color: var(--quiet); }
#saveList li.current { background: rgba(240, 194, 76, 0.07); }
#saveList .what b { font: 600 15px var(--serif); color: var(--gold-soft); }
#saveList .what .kind { margin-left: 8px; font: italic 11.5px var(--serif); color: var(--quiet); }
#saveList .what small { display: block; margin-top: 2px; font: 12px/1.35 var(--serif); color: var(--ink-soft); }
#saveList .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
#saveList .acts button { font-size: 11.5px; padding: 2px 8px; }
#saveList .acts button.danger { color: #f4c0b4; }
#saves .group { display: flex; gap: 8px; }
@media (max-width: 560px) { #saveList li { grid-template-columns: 1fr; } #saveList .acts { justify-content: flex-start; } }
#saveToast { position: fixed; left: 50%; bottom: 72px; transform: translate(-50%, 8px); z-index: 60; max-width: calc(100vw - 32px); padding: 7px 14px; border-radius: 6px; background: rgba(14, 10, 8, 0.9); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); color: #f2d48a; font: italic 13.5px var(--serif); opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s; }
#saveToast.show { opacity: 1; transform: translate(-50%, 0); }

#scenarios {
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; padding: 12px 16px 16px; z-index: 45;
}
#scenarios[hidden] { display: none; }
#scenarios .close { position: absolute; top: 6px; right: 6px; }
#scenarioList { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; }
#scenarioList li {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center;
  padding: 10px 6px; border-bottom: 1px solid var(--line);
}
#scenarioList li .art { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; background: radial-gradient(circle at 50% 55%, rgba(240, 194, 76, 0.16), rgba(0, 0, 0, 0) 70%); }
#scenarioList h3 { margin: 0; display: flex; align-items: baseline; gap: 10px; font: 600 16px var(--serif); color: var(--gold-soft); }
#scenarioList h3 .stars { font-size: 15px; }
#scenarioList p { margin: 3px 0 0; font: 13px/1.4 var(--serif); color: var(--ink-soft); }
#scenarioList p.goal { color: #f2e8d2; font-style: italic; }
#scenarioList small { display: block; margin-top: 3px; font: 11.5px/1.35 var(--serif); color: var(--quiet); }
#scenarioList li.three h3 { color: #ffe08a; }
#scenarioList li button { white-space: nowrap; }

#scenarioEnd {
  left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 46;
  width: min(480px, calc(100vw - 24px)); padding: 18px 22px 18px; text-align: center;
  background: linear-gradient(180deg, rgba(40, 32, 30, 0.98), rgba(18, 16, 22, 0.98) 160px);
}
body.skinned #scenarioEnd { background-clip: padding-box; }
#scenarioEnd[hidden] { display: none; }
#scenarioEndKind { margin: 0; font: var(--label); letter-spacing: 0.16em; text-transform: uppercase; }
#scenarioEnd h2 { display: block; border: 0; padding: 0; margin: 4px 0 6px; font: 600 24px var(--serif); font-variant: normal; letter-spacing: 0.01em; color: var(--gold); }
#scenarioEnd h2::after { display: none; }
.stars.big { font-size: 40px; margin: 4px 0 8px; letter-spacing: 0.12em; }
.stars.big span { display: inline-block; color: rgba(240, 214, 160, 0.25); text-shadow: none; }
.stars.big span.on { color: var(--gold); text-shadow: 0 0 14px rgba(240, 194, 76, 0.75); animation: starIn 0.5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes starIn { from { transform: scale(0.2) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
#scenarioEndText { font: 15px/1.5 var(--serif); color: #ece4d2; margin: 0 0 6px; }
#scenarioEndBest { font-size: 12px; margin: 0 0 12px; }
#scenarioEnd .group { justify-content: center; }
/* ---- the making tree: what they know, what is within reach, what each needs ---- */
.tree-button { flex: none; align-self: center; }
#tree {
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(820px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; padding: 12px 16px 14px; z-index: 44;
}
#tree[hidden] { display: none; }
#tree, #scenarios { animation: albumIn 0.22s ease-out; }
#tree .close { position: absolute; top: 6px; right: 6px; }
.tree-key { display: flex; gap: 14px; margin: 0 0 8px; font: 600 11px var(--serif); color: var(--quiet); }
.tree-key .k::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; border-radius: 2px; }
.tree-key .known::before { background: var(--gold); box-shadow: 0 0 6px rgba(240, 194, 76, 0.6); }
.tree-key .reach::before { border: 1px dashed #9fd88a; }
.tree-key .locked::before { background: rgba(240, 214, 160, 0.15); }
.tree-key .lost::before { background: #c4503e; }
#treeMap { overflow: auto; min-height: 0; flex: 1 1 auto; padding: 6px 4px 10px; }
.tree-inner { position: relative; margin: 0 auto; }
.tree-lines { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.tree-lines path { fill: none; stroke-width: 2; }
.tree-lines path.lit { stroke: rgba(240, 194, 76, 0.8); filter: drop-shadow(0 0 3px rgba(240, 194, 76, 0.5)); }
.tree-lines path.half { stroke: rgba(240, 194, 76, 0.45); stroke-dasharray: 5 4; }
.tree-lines path.dim { stroke: rgba(240, 214, 160, 0.16); stroke-dasharray: 3 5; }
.tnode {
  position: absolute; display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 6px; text-align: left;
  font: 600 13px var(--serif); text-transform: capitalize;
}
body.skinned .tnode { border: 6px solid transparent; border-image: var(--slot-0) 6 fill / 12px / 0 stretch; padding: 0 6px 0 2px; }
body.skinned .tnode.known { border-image-source: var(--slot-2); }
body.skinned .tnode:hover:not(:disabled) { border-image-source: var(--slot-1); padding: 0 6px 0 2px; }
body.skinned .tnode:active:not(:disabled) { padding: 0 6px 0 2px; }
.tnode .ticon { flex: none; display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; }
.tnode .tbody { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.tnode b { font: 600 13.5px var(--serif); color: var(--ink); }
.tnode.known b { color: var(--gold-soft); }
.tnode.locked { opacity: 0.62; }
.tnode.locked b, .tnode.lost b { color: var(--quiet); }
.tnode.reach { animation: reach 2.2s ease-in-out infinite; }
.tnode.reach b { color: #c6eab8; }
.tnode.lost { filter: sepia(0.4) saturate(1.4) hue-rotate(-20deg); }
.tnode.on { outline: 2px solid rgba(240, 194, 76, 0.75); outline-offset: 2px; }
@keyframes reach { 0%, 100% { box-shadow: 0 0 0 rgba(159, 216, 138, 0); } 50% { box-shadow: 0 0 14px rgba(159, 216, 138, 0.45); } }
.tbar { display: block; height: 4px; background: rgba(0, 0, 0, 0.4); }
.tbar i { display: block; height: 100%; background: linear-gradient(90deg, #d9a43c, var(--gold)); }
.tmats { display: flex; align-items: center; gap: 4px; text-transform: none; }
.tmats .mat { display: inline-flex; align-items: center; gap: 2px; }
.tmats .mat small { font: italic 10.5px var(--serif); color: var(--quiet); }
.tmats em { font: 600 11px var(--serif); color: var(--quiet); font-style: normal; }
#treeMap.compact .tmats .mat small { display: none; }
#treeMap.compact .tnode b { font-size: 12.5px; }
.tonly { position: absolute; right: 4px; top: -9px; padding: 0 5px; font: 600 9px var(--serif); letter-spacing: 0.06em; text-transform: uppercase; color: #f0b8a8; background: rgba(40, 18, 14, 0.95); border: 1px solid rgba(196, 80, 62, 0.6); border-radius: 2px; }
#treeDetail { flex: none; border-top: 1px solid var(--line-strong); padding-top: 8px; }
#treeDetail > p { margin: 0; font-size: 12.5px; }
.tdetail { display: flex; gap: 14px; align-items: flex-start; }
.tdetail .ticon { flex: none; display: flex; align-items: center; justify-content: center; width: 68px; height: 68px; background: radial-gradient(circle at 50% 55%, rgba(240, 194, 76, 0.16), rgba(0, 0, 0, 0) 70%); }
.tdetail h3 { margin: 0; font: 600 17px var(--serif); color: var(--gold-soft); text-transform: capitalize; }
.tdetail p { margin: 2px 0; font: 13px/1.4 var(--serif); color: var(--ink-soft); }
.tdetail p.how { font-style: italic; color: #f2e8d2; }
.tdetail p.status.known { color: var(--gold-soft); }
.tdetail p.status.reach { color: #c6eab8; }
.tdetail p.status.lost { color: #f0b8a8; }
.tdetail .group { align-items: center; margin-top: 6px; }

@media (max-width: 860px) {
  #scenarioList li { grid-template-columns: 52px 1fr; }
  #scenarioList li .art { width: 52px; height: 52px; }
  #scenarioList li button { grid-column: 1 / -1; justify-self: end; }
}

/* ---- other tongues: the frogs' Greek and the geese's Latin ---- */
#tongues { --accent: #b8d8a0; display: block; padding: 8px 10px 8px; }
#tongues[hidden] { display: none; }
#tongues header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
#tongues header b { font: 600 12px var(--serif); font-variant: small-caps; letter-spacing: 0.12em; color: #e2efd6; }
#tongues header small { margin-left: auto; font: italic 11px var(--serif); color: #b8d8a0; }
#tonguesList { list-style: none; margin: 0; padding: 0; }
#tonguesList li { display: grid; grid-template-columns: 30px 1fr; gap: 2px 8px; padding: 6px 0; }
#tonguesList li + li { border-top: 1px solid var(--line); }
#tonguesList .slot { grid-row: span 2; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 5px; background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 0 1px rgba(184, 216, 160, 0.3); }
#tonguesList .slot canvas { max-width: 28px; max-height: 28px; width: auto; height: auto; }
#tonguesList .slot.unseen canvas { filter: brightness(0) opacity(0.55); }
#tonguesList .what .title { display: flex; align-items: baseline; gap: 6px; font: 12.5px/1.35 var(--serif); color: var(--ink); }
#tonguesList .what .title b { font-weight: 600; }
#tonguesList .what .tongue { font: italic 11px var(--serif); color: #b8d8a0; }
#tonguesList .what .line { display: block; font: 12px/1.35 var(--serif); color: var(--ink-soft); }
#tonguesList .what small { display: block; margin-top: 1px; font: italic 11.5px/1.35 var(--serif); color: var(--quiet); }
#tonguesList .acts { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; }
#tonguesList .acts .look { margin-left: auto; font-size: 11px; }
#tonguesList button.do { padding: 2px 9px; font: 600 11.5px var(--serif); color: #18241a; background: #b8d8a0; border: 1px solid #87a873; border-radius: 4px; border-image: none; cursor: pointer; }
#tonguesList button.do.open { background: #e8d9a8; border-color: #b8a46c; }
#tonguesList button.do:hover:not(:disabled) { filter: brightness(1.08); }
#tonguesList button.do:disabled { opacity: 0.45; cursor: default; }
#findsList li.told .what .title { font-style: normal; color: #f6dc96; }

#tonguesPop {
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(780px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; padding: 12px 16px 16px; z-index: 45;
  animation: albumIn 0.22s ease-out;
}
#tonguesPop[hidden] { display: none; }
#tonguesPop .close { position: absolute; top: 6px; right: 6px; }
#tonguesTabs button { align-items: center; }
#tonguesTabs button canvas { width: 12px; height: 12px; }
.far-page { padding-bottom: 18px; }
.far-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; border-bottom: 1px solid rgba(90, 60, 30, 0.25); padding-bottom: 5px; margin-bottom: 6px; }
.far-head h3 { margin: 0; font: 600 17px var(--serif); color: #4a2f17; }
.far-head small { font: 600 12px var(--serif); color: #6b5238; white-space: nowrap; }
.far-help { margin: 0 0 6px; font: italic 12.5px/1.45 var(--serif); color: #5d4630; }
.far-roman { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px; font: 12.5px var(--serif); color: #4a2f17; cursor: pointer; }
.far-page h4 { margin: 12px 0 4px; font: 600 12px var(--serif); font-variant: small-caps; letter-spacing: 0.1em; color: #6b4a26; }
.far-result { margin: 4px 0 6px; padding: 5px 9px; font: 13px var(--serif); border-radius: 3px; }
.far-result.right { color: #2f4a1c; background: rgba(150, 200, 110, 0.3); }
.far-result.wrong { color: #6a2416; background: rgba(196, 80, 62, 0.18); }
.far-list { list-style: none; margin: 0; padding: 0; }
.far-list > li { padding: 7px 8px 8px; margin: 0 0 6px; background: rgba(255, 250, 235, 0.5); border: 1px solid rgba(90, 60, 30, 0.22); border-radius: 4px; }
.far-list > li.read { background: rgba(240, 248, 225, 0.55); }
.far-list .who { display: block; font: italic 11.5px var(--serif); color: #6b5238; margin-bottom: 3px; }
.far-list .who span { font-style: normal; font-weight: 600; color: #4a2f17; }
.far-list .who .look { font-size: 11px; color: #7a4b1c; }
.far-list .chips { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 3px 4px; }
.far-list .chip { display: inline-flex; flex-direction: column; align-items: center; min-width: 26px; padding: 2px 6px 1px; font: 17px/1.15 "Palatino Linotype", "Iowan Old Style", Palatino, "Gentium Plus", "Times New Roman", serif; color: #2c1d10; background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(90, 60, 30, 0.3); border-radius: 4px; border-image: none; text-shadow: none; cursor: pointer; }
.far-list .chip .w { font: inherit; color: #2c1d10; }
.far-list .chip:focus, .far-list .chip:hover, .far-list .chip:active { color: #2c1d10; outline: none; }
.far-list .chip:focus-visible { box-shadow: 0 0 0 2px rgba(176, 96, 48, 0.55); }
.far-list .chip .m { font: italic 11px/1.2 var(--serif); color: #8a6f50; margin-top: 1px; }
.far-list .chip.open .m { color: #b06030; font-weight: 600; font-style: normal; }
.far-list .chip.guess { border-style: dashed; border-color: #b08a50; }
.far-list .chip.guess .m { color: #8a5a1c; }
.far-list .chip.known { background: rgba(170, 214, 140, 0.35); border-color: rgba(70, 120, 50, 0.45); cursor: default; }
.far-list .chip.known .m { color: #3e6a26; font-style: normal; }
.far-list .chip:disabled { opacity: 1; }
.far-list .chip:hover:not(:disabled) { background: rgba(255, 244, 210, 0.95); }
.far-list .chip.name, .far-list .chip.cry { cursor: default; font-style: italic; background: transparent; border-color: transparent; padding-bottom: 14px; }
.far-list .mark { font: 17px "Palatino Linotype", Palatino, serif; color: #2c1d10; padding-bottom: 14px; margin-left: -3px; }
.far-list .english { margin: 5px 0 0; font: 13.5px/1.4 var(--serif); color: #2f4a1c; }
.far-list .english::before { content: "\2714\00a0"; color: #4a7a2c; }
.far-list .told { margin: 2px 0 0; font: italic 12px var(--serif); color: #8a5a1c; }
.far-list .acts { display: flex; justify-content: flex-end; margin-top: 4px; }
.far-list button.read { padding: 2px 12px; font: 600 12px var(--serif); color: #fff8e6; background: #6a8a3c; border: 1px solid #4a6a26; border-radius: 4px; border-image: none; cursor: pointer; text-shadow: none; }
.far-list button.read:disabled { background: #b8ad92; border-color: #a0947a; color: #f4ecd8; cursor: default; }
.far-words { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 10px; }
.far-words li { display: grid; grid-template-columns: auto 1fr; gap: 0 6px; padding: 3px 6px; border-radius: 3px; font: 12px var(--serif); color: #4a2f17; }
.far-words li[tabindex] { cursor: pointer; }
.far-words li[tabindex]:hover { background: rgba(255, 244, 210, 0.8); }
.far-words li b { font: 15px "Palatino Linotype", Palatino, "Times New Roman", serif; color: #2c1d10; }
.far-words li .forms { font: italic 12px "Palatino Linotype", Palatino, serif; color: #6b5238; align-self: center; }
.far-words li .meaning { grid-column: 1 / -1; color: #8a6f50; font-style: italic; }
.far-words li.known .meaning { color: #3e6a26; font-style: normal; }
.far-words li.guess .meaning { color: #8a5a1c; }
.far-words li small { grid-column: 1 / -1; color: #9a8466; font-size: 10.5px; }
.tongue-pick { position: absolute; z-index: 5; width: 280px; max-height: 300px; display: flex; flex-direction: column; gap: 5px; padding: 8px; background: #f6ecd4; color: #3b2a1c; border: 1px solid rgba(90, 60, 30, 0.5); border-radius: 5px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45); }
.tongue-pick[hidden] { display: none; }
.tongue-pick .pick-head { display: flex; align-items: baseline; gap: 8px; }
.tongue-pick .pick-head b { font: 17px "Palatino Linotype", Palatino, "Times New Roman", serif; }
.tongue-pick .pick-head small { font: italic 11px var(--serif); color: #6b5238; }
.tongue-pick input { width: 100%; box-sizing: border-box; padding: 4px 6px; font: 13px var(--serif); color: #2c1d10; background: #fffaf0; border: 1px solid rgba(90, 60, 30, 0.4); border-radius: 3px; }
.tongue-pick .pick-list { overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.tongue-pick .pick-group small { display: block; margin: 4px 0 2px; font: 600 10.5px var(--serif); font-variant: small-caps; letter-spacing: 0.08em; color: #8a6f50; }
.tongue-pick .pick-group div { display: flex; flex-wrap: wrap; gap: 3px; }
.tongue-pick .pick-group button { padding: 1px 7px; font: 12.5px var(--serif); color: #3b2a1c; background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(90, 60, 30, 0.25); border-radius: 3px; border-image: none; text-shadow: none; cursor: pointer; }
.tongue-pick .pick-group button:hover, .tongue-pick .pick-group button.on { background: #e8d39a; }
.tongue-pick .pick-foot { display: flex; justify-content: flex-end; gap: 12px; }
.tongue-pick .link { font: 12px var(--serif); color: #7a4b1c; background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 0; text-shadow: none; }
@media (max-width: 600px) {
  .far-list .chip { font-size: 15px; }
  .far-words { grid-template-columns: 1fr 1fr; }
  .tongue-pick { width: min(280px, calc(100vw - 48px)); }
}

/* ---- figures and statues, in the Art tab ---- */
#castings { margin-top: 12px; padding-top: 6px; border-top: 1px solid var(--line); }
#castings[hidden] { display: none; }
#castings h4 { margin: 4px 0 6px; font: 600 12px var(--serif); font-variant: small-caps; letter-spacing: 0.12em; color: #e8c06a; }
#castings .statue-row { display: grid; grid-template-columns: 44px 1fr; gap: 2px 8px; align-items: center; padding: 6px; margin-bottom: 6px; border-radius: 6px; background: linear-gradient(rgba(232, 192, 106, 0.08), rgba(0, 0, 0, 0.2)); box-shadow: inset 0 0 0 1px rgba(232, 192, 106, 0.25); }
#castings .statue-row .pic { display: flex; align-items: flex-end; justify-content: center; height: 64px; }
#castings .statue-row .pic canvas { max-height: 64px; width: auto; }
#castings .statue-row b { display: block; font: 600 12.5px/1.3 var(--serif); color: #f6e0a0; }
#castings .statue-row small { display: block; font: italic 11.5px/1.35 var(--serif); color: var(--quiet); }
#castings .statue-row .look { font-size: 11px; }
#castings .figure-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
#castings .figure-cell { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; border-radius: 5px; background: rgba(0, 0, 0, 0.25); box-shadow: inset 0 0 0 1px rgba(232, 192, 106, 0.18); }
#castings .figure-cell canvas { width: 32px; height: 32px; }
#castings .figure-cell figcaption { font: 10.5px/1.15 var(--serif); color: var(--ink-soft); text-align: center; overflow-wrap: anywhere; max-width: 100%; }
#castings .figure-cell.lost { opacity: 0.45; }

/* ---- tablets: the card, and the book of their tablets ---- */
#tablets { --accent: #e0bf8e; display: block; padding: 8px 10px 8px; }
#tablets[hidden] { display: none; }
#tablets header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
#tablets header b { font: 600 12px var(--serif); font-variant: small-caps; letter-spacing: 0.12em; color: #f0d9b0; }
#tablets header small { margin-left: auto; font: italic 11px var(--serif); color: #e0bf8e; }
#tabletsList { list-style: none; margin: 0; padding: 0; }
#tabletsList li { display: grid; grid-template-columns: 30px 1fr; gap: 2px 8px; align-items: center; padding: 5px 0; }
#tabletsList li + li { border-top: 1px solid var(--line); }
#tabletsList .slot { grid-row: span 2; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 5px; background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 0 1px rgba(224, 191, 142, 0.3); }
#tabletsList .slot canvas { max-width: 28px; max-height: 28px; width: auto; height: auto; }
#tabletsList .what .title { font: 600 12.5px/1.35 var(--serif); color: var(--ink); }
#tabletsList .what small { display: block; font: italic 11.5px/1.35 var(--serif); color: var(--quiet); }
#tabletsList .acts { grid-column: 2; display: flex; align-items: center; gap: 6px; }
#tabletsList .acts .look { margin-left: auto; }
#tabletsList .acts .look { font-size: 11px; }
#tabletsList button.do { padding: 2px 9px; font: 600 11.5px var(--serif); color: #2a1c10; background: #e0bf8e; border: 1px solid #b08a5a; border-radius: 4px; border-image: none; cursor: pointer; }
#tabletsList button.do:hover { filter: brightness(1.08); }
#tabletsPop {
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; padding: 12px 16px 16px; z-index: 45;
  animation: albumIn 0.22s ease-out;
}
#tabletsPop[hidden] { display: none; }
#tabletsPop .close { position: absolute; top: 6px; right: 6px; }
.tablet-list { list-style: none; margin: 0; padding: 0; }
.tablet-list > li { padding: 7px 8px 8px; margin: 0 0 8px; background: rgba(255, 250, 235, 0.5); border: 1px solid rgba(90, 60, 30, 0.22); border-radius: 4px; }
.tablet-list > li.read { background: rgba(240, 248, 225, 0.55); }
.tablet-list .who { display: block; font: italic 11.5px var(--serif); color: #6b5238; margin-bottom: 4px; }
.tablet-list .who span { font-style: normal; font-weight: 600; color: #4a2f17; }
.tablet-list .who .look { font-size: 11px; color: #7a4b1c; }
.tablet-list .tablet-clay { display: block; margin: 2px 0 6px; filter: drop-shadow(1px 2px 2px rgba(60, 40, 20, 0.35)); }
.tablet-list .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.tablet-list .chip { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; min-width: 40px; padding: 2px 6px 2px; color: #2c1d10; background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(90, 60, 30, 0.3); border-radius: 4px; border-image: none; text-shadow: none; cursor: pointer; font-size: 11px; }
.tablet-list .chip .m { font: italic 11px/1.2 var(--serif); color: #8a6f50; }
.tablet-list .chip.open .m { color: #b06030; font-weight: 600; font-style: normal; }
.tablet-list .chip.guess { border-style: dashed; border-color: #b08a50; }
.tablet-list .chip.guess .m { color: #8a5a1c; }
.tablet-list .chip.known { background: rgba(170, 214, 140, 0.35); border-color: rgba(70, 120, 50, 0.45); cursor: default; }
.tablet-list .chip.known .m { color: #3e6a26; font-style: normal; }
.tablet-list .chip:disabled { opacity: 1; }
.tablet-list .chip:hover:not(:disabled) { background: rgba(255, 244, 210, 0.95); }
.tablet-list .english { margin: 6px 0 0; font: 13.5px/1.4 var(--serif); color: #2f4a1c; }
.tablet-list .english::before { content: "\2714\00a0"; color: #4a7a2c; }
.tablet-list .acts { display: flex; justify-content: flex-end; margin-top: 4px; }
.tablet-list button.read { padding: 2px 12px; font: 600 12px var(--serif); color: #fff8e6; background: #6a8a3c; border: 1px solid #4a6a26; border-radius: 4px; border-image: none; cursor: pointer; text-shadow: none; }
.tablet-list button.read:disabled { background: #b8ad92; border-color: #a0947a; color: #f4ecd8; cursor: default; }
.tablet-list .remembered { margin-top: 5px; font: 12px/1.4 var(--serif); color: #5d4630; }
.tablet-list .remembered summary { cursor: pointer; font-style: italic; color: #7a4b1c; }
.tablet-list .remembered ul { margin: 3px 0 0; padding-left: 18px; }
.tablet-signs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 10px; }
.tablet-signs li { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 0 6px; padding: 3px 6px; border-radius: 3px; font: 12px var(--serif); color: #4a2f17; }
.tablet-signs li canvas { grid-row: span 2; }
.tablet-signs li[tabindex] { cursor: pointer; }
.tablet-signs li[tabindex]:hover { background: rgba(255, 244, 210, 0.8); }
.tablet-signs li .meaning { color: #8a6f50; font-style: italic; }
.tablet-signs li.known .meaning { color: #3e6a26; font-style: normal; }
.tablet-signs li.guess .meaning { color: #8a5a1c; }
.tablet-signs li small { color: #9a8466; font-size: 10.5px; }
.tablet-pick { max-height: 220px; }
.tablet-pick .pick-head { align-items: center; }
.tablet-pick .pick-group button:disabled { opacity: 0.4; cursor: default; }
.lesson-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lesson-list li { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; padding: 6px 8px; background: rgba(255, 250, 235, 0.5); border: 1px solid rgba(90, 60, 30, 0.22); border-radius: 4px; }
.lesson-list li .tablet-clay { filter: drop-shadow(1px 2px 2px rgba(60, 40, 20, 0.35)); }
.lesson-list li b { display: block; font: 600 13px/1.35 var(--serif); color: #4a2f17; }
.lesson-list li small { display: block; font: italic 11.5px/1.4 var(--serif); color: #6b5238; }
.lesson-list li small .look { font-size: 11px; color: #7a4b1c; }
@media (max-width: 600px) { .lesson-list li { grid-template-columns: 1fr; } }
.map-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.map-list > li { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 6px 14px; padding: 8px; background: rgba(255, 250, 235, 0.5); border: 1px solid rgba(90, 60, 30, 0.22); border-radius: 4px; }
.map-list > li.read { background: rgba(240, 248, 225, 0.55); }
.map-list .tablet-clay { filter: drop-shadow(1px 2px 2px rgba(60, 40, 20, 0.35)); }
.map-list b { display: block; font: 600 13.5px/1.35 var(--serif); color: #4a2f17; }
.map-list small { display: block; font: italic 11.5px/1.4 var(--serif); color: #6b5238; }
.map-list small .look { font-size: 11px; color: #7a4b1c; }
.map-list .map-shows { margin: 6px 0 0; font: 12.5px/1.45 var(--serif); color: #5d4630; }
.map-list .english { margin: 6px 0 0; font: 13px/1.4 var(--serif); color: #2f4a1c; }
.map-list .english::before { content: "\2714\00a0"; color: #4a7a2c; }
.map-list .acts { margin-top: 8px; }
.map-list button.read { padding: 2px 12px; font: 600 12px var(--serif); color: #fff8e6; background: #6a8a3c; border: 1px solid #4a6a26; border-radius: 4px; border-image: none; cursor: pointer; text-shadow: none; }
@media (max-width: 600px) { .map-list > li { grid-template-columns: 1fr; } }

/* ---- songs of the houses, in the Art tab, and sung in the voices list ---- */
#songbook { margin-top: 12px; padding-top: 6px; border-top: 1px solid var(--line); }
#songbook[hidden] { display: none; }
#songbook h4 { margin: 4px 0 6px; font: 600 12px var(--serif); font-variant: small-caps; letter-spacing: 0.12em; color: #e8c06a; }
#songbook .song { padding: 6px 8px; margin-bottom: 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.22); box-shadow: inset 0 0 0 1px rgba(232, 192, 106, 0.2); }
#songbook .song b { display: block; font: 600 12.5px/1.3 var(--serif); color: #f6e0a0; margin-bottom: 3px; }
#songbook .song ul { list-style: none; margin: 0 0 3px; padding: 0 0 0 10px; }
#songbook .song li { font: italic 12px/1.45 var(--serif); color: var(--ink-soft); }
#songbook .song li.you { color: #f6dc96; }
#songbook .song small { display: block; font: italic 11px/1.35 var(--serif); color: var(--quiet); }
#songbook .song .look { font-size: 11px; }
#voices li.sung span:last-child { font-style: italic; color: #f6e0a0; }

/* ---- the houses' cloth, in the Art tab ---- */
#cloths { margin-top: 12px; padding-top: 6px; border-top: 1px solid var(--line); }
#cloths[hidden] { display: none; }
#cloths h4 { margin: 4px 0 6px; font: 600 12px var(--serif); font-variant: small-caps; letter-spacing: 0.12em; color: #e8c06a; }
#cloths .swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
#cloths .swatch-cell { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
#cloths .swatch { width: 52px; height: 36px; border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.3); image-rendering: pixelated; }
#cloths figcaption { font: 10.5px/1.15 var(--serif); color: var(--ink-soft); text-align: center; }

/* ---- the houses' seals, pressed in clay, in the Art tab ---- */
#seals { margin-top: 12px; padding-top: 6px; border-top: 1px solid var(--line); }
#seals[hidden] { display: none; }
#seals h4 { margin: 4px 0 6px; font: 600 12px var(--serif); font-variant: small-caps; letter-spacing: 0.12em; color: #e8c06a; }
#seals .seal-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 6px; }
#seals .seal-cell { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
#seals .seal-clay { width: 54px; height: 54px; image-rendering: pixelated; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
#seals .seal-clay.you { filter: drop-shadow(0 0 4px rgba(255, 210, 122, 0.8)); }
#seals figcaption { font: 10.5px/1.15 var(--serif); color: var(--ink-soft); text-align: center; }

/* Letters for you: the clay beside the picture of a making, and what a letter says. */
#tabletsPage .letter-clay { display: flex; align-items: center; gap: 10px; }
#tabletsPage .letter-picture { display: inline-flex; padding: 4px; border-radius: 4px; background: rgba(201, 160, 106, 0.25); }
#tabletsPage .letter-text { font-style: italic; }
#tabletsTabs button.letters { font-style: italic; }

/* The valley's sky: a chart of its named stars. */
#skychart .sky-chart { width: 100%; max-width: 240px; image-rendering: pixelated; border-radius: 4px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45); }
#skychart .sky-list { margin: 6px 0 0; padding-left: 14px; }
#skychart .sky-list li { margin: 4px 0; display: flex; flex-direction: column; }
#skychart .sky-tale { font-style: italic; opacity: 0.85; }

/* The book of tales: what happened, and how it is told now. */
#talebook .tale-entry { margin: 6px 0 10px; }
#talebook .truth { margin: 2px 0 4px; font-style: italic; opacity: 0.85; }
#talebook ul { margin: 0; padding-left: 14px; }
#talebook li { margin: 3px 0; display: flex; flex-direction: column; }
#talebook li.drift-3, #talebook li.drift-4 { color: var(--accent, #e8c070); }
#talebook .told { opacity: 0.7; }

/* The valley's tapestry: panels in a row under a rod, unrolled sideways. */
#tapestry .tapestry-rod { height: 6px; margin: 4px 0 0; border-radius: 3px; background: linear-gradient(#b58450, #5a3a20); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
#tapestry .tapestry-strip { display: flex; gap: 2px; overflow-x: auto; padding: 0 2px 6px; scroll-snap-type: x proximity; }
#tapestry .tapestry-panel { margin: 0; flex: 0 0 auto; width: 92px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; scroll-snap-align: end; }
#tapestry .panel-cloth { width: 92px; height: 104px; image-rendering: pixelated; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45); }
#tapestry .tapestry-panel figcaption { font-size: 11px; line-height: 1.25; }
#tapestry .tapestry-panel.you figcaption { font-style: italic; }

/* The songbook: what a house plays its song on. */
#songbook .played-on { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 2px; }
#songbook .played-on .instrument { display: inline-flex; align-items: center; gap: 4px; }
