Files
wizwar6e/packages/web/src/Help.svelte
T

720 lines
33 KiB
Svelte
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script lang="ts">
// The reference desk: how to play, the rules and FAQ as one searchable
// body, the card library with proper entries, the house rulings, the
// story of the table, and the tally. Every section and card has a link
// a player can send; the desk remembers where the reader was.
import { family as kin } from "./family.svelte";
import { cardDef } from "@wizwar/engine";
import { tick } from "svelte";
import Card from "./Card.svelte";
import { HOW_TO_PLAY } from "./rules";
import { RULEBOOK_COPYRIGHT } from "./rulebook";
import { helpState, type HelpTab } from "./help-state";
import {
REFERENCE, SOURCE_LABELS, searchReference, renderInline, type RefSection,
CARD_POOL, searchCards, mentionedCards, sightOf, typeLabel, setLabel,
HOUSE_RULINGS, rulingsFor, searchRulings,
type RefSource,
} from "./reference";
let {
onclose,
initialTab = null,
initialAnchor = null,
initialCard = null,
stats = null,
onstats,
onnavigate,
}: {
onclose: () => void;
/** A tab to open on; null reopens where the reader left off. */
initialTab?: HelpTab | null;
/** A section to scroll to on the tab. */
initialAnchor?: string | null;
/** A card entry to open. */
initialCard?: string | null;
stats?: Record<string, number | string | null> | null;
onstats?: () => void;
/** The address bar follows the reader, so the link is always a copy away. */
onnavigate?: (tab: HelpTab, anchor: string | null, card: string | null) => void;
} = $props();
// svelte-ignore state_referenced_locally -- the opening tab is a one-time value
let tab = $state<HelpTab>(initialCard ? "cards" : (initialTab ?? helpState.tab));
let rulesSearch = $state(helpState.rulesSearch);
let rulingsSearch = $state(helpState.rulingsSearch);
let cardText = $state(helpState.cards.text);
let cardSet = $state(helpState.cards.set);
let cardType = $state(helpState.cards.type);
let cardSight = $state(helpState.cards.sight);
// svelte-ignore state_referenced_locally -- the opening card is a one-time value
let entry = $state<string | null>(initialCard);
let entryOpener: HTMLElement | null = null;
let bodyEl = $state<HTMLElement | null>(null);
let copied = $state<string | null>(null);
const refResults = $derived(searchReference(rulesSearch));
const rulingResults = $derived(searchRulings(rulingsSearch));
const cardResults = $derived(searchCards({ text: cardText, set: cardSet, type: cardType, sight: cardSight }));
const entryDef = $derived(entry ? cardDef(entry) : null);
const entryRulings = $derived(entry ? rulingsFor(entry) : []);
const entryMentions = $derived(entry ? mentionedCards(entry) : []);
const refBySource = $derived(
(["summary", "rulebook", "expansion", "faq"] as RefSource[])
.map((source) => ({ source, sections: REFERENCE.filter((s) => s.source === source) })),
);
$effect(() => { helpState.tab = tab; });
$effect(() => { helpState.rulesSearch = rulesSearch; });
$effect(() => { helpState.rulingsSearch = rulingsSearch; });
$effect(() => { helpState.cards = { text: cardText, set: cardSet, type: cardType, sight: cardSight }; });
$effect(() => { onnavigate?.(tab, null, entry); });
function saveScroll() {
if (bodyEl) helpState.scroll[tab] = bodyEl.scrollTop;
}
async function goTab(t: HelpTab) {
if (t === tab) return;
saveScroll();
tab = t;
if (t === "tally") onstats?.();
await tick();
if (bodyEl) bodyEl.scrollTop = helpState.scroll[t] ?? 0;
}
async function jumpTo(anchor: string) {
await tick();
const el = bodyEl?.querySelector(`#${CSS.escape(anchor)}`);
el?.scrollIntoView({ block: "start" });
onnavigate?.(tab, anchor, null);
}
function linkFor(t: HelpTab, anchor: string | null, card: string | null): string {
const q = card ? `card=${card}` : `help=${t}${anchor ? `/${anchor}` : ""}`;
return `${location.origin}/?${q}`;
}
function copyLink(t: HelpTab, anchor: string | null, card: string | null) {
const key = card ?? `${t}/${anchor ?? ""}`;
navigator.clipboard?.writeText(linkFor(t, anchor, card)).catch(() => {});
onnavigate?.(t, anchor, card);
copied = key;
setTimeout(() => { if (copied === key) copied = null; }, 1500);
}
function openEntry(id: string, opener?: EventTarget | null) {
entryOpener = (opener instanceof HTMLElement ? opener : document.activeElement) as HTMLElement | null;
entry = id;
}
function closeEntry() {
entry = null;
entryOpener?.focus();
entryOpener = null;
}
function close() {
saveScroll();
onclose();
}
/** Escape closes the foremost layer only: the card entry before the desk. */
function onkeydown(e: KeyboardEvent) {
if (e.key !== "Escape") return;
if (entry) { closeEntry(); return; }
close();
}
function n(v: unknown): string {
return Number(v ?? 0).toLocaleString();
}
function hours(mins: number): string {
return mins < 90 ? `${n(mins)} minutes` : `${n(Math.round(mins / 6) / 10)} hours`;
}
$effect(() => {
if (initialAnchor) void jumpTo(initialAnchor);
else if (bodyEl) bodyEl.scrollTop = helpState.scroll[tab] ?? 0;
});
/** The other games of Kestrel's Hall, for the about page. */
const family = $derived(kin.games);
const hall = $derived(kin.hall);
</script>
{#snippet section(s: RefSection, withSource: boolean)}
<h3 id={s.id} class="linked">
{s.title}
{#if withSource}<span class="source">{SOURCE_LABELS[s.source]}</span>{/if}
<button class="link-btn" onclick={() => copyLink("rules", s.id, null)} title="copy a link to this section">
{copied === `rules/${s.id}` ? "copied" : "🔗"}</button>
</h3>
{#each s.paragraphs as p, i (i)}<p>{@html renderInline(p)}</p>{/each}
{/snippet}
<svelte:window {onkeydown} />
{#if entryDef}
<div class="layer-scrim" role="presentation" onclick={closeEntry}>
<div class="entry" role="dialog" aria-modal="true" aria-label="{entryDef.name}, card entry" tabindex="-1"
onclick={(e) => e.stopPropagation()} onkeydown={() => {}}>
<header class="entry-head">
<span class="entry-title">{entryDef.name}</span>
<button class="link-btn" onclick={() => copyLink("cards", null, entryDef!.id)} title="copy a link to this card">
{copied === entryDef.id ? "link copied" : "🔗 link"}</button>
<button class="close" onclick={closeEntry} aria-label="close card entry">×</button>
</header>
<div class="entry-body">
<div class="entry-card">
<Card card={{ instanceId: `entry-${entryDef.id}`, cardId: entryDef.id }} />
</div>
<div class="entry-text reading">
<p class="entry-meta">
{typeLabel(entryDef)} · {sightOf(entryDef)} · {setLabel(entryDef)}
</p>
<h3>As printed</h3>
<p class="printed">{entryDef.text ?? (entryDef.cardType === "number" ? `A NUMBER card worth ${entryDef.value}. Add it to your movement, or use it to set a spell's duration or power.` : "")}</p>
{#if entryDef.faqRulings.length > 0}
<h3>Official FAQ</h3>
{#each entryDef.faqRulings as q, i (i)}<p>{q}</p>{/each}
<p class="colophon">Tom Jolly's own rulings (wizwar.com, September 2002). The cards overrule the rules, and the designer overrules the table.</p>
{/if}
{#if entryRulings.length > 0}
<h3>At this table</h3>
{#each entryRulings as r (r.id)}
{#each r.body as p, i (i)}<p>{p}</p>{/each}
<p class="colophon"><button class="inline-link" onclick={() => { closeEntry(); void goTab("rulings"); void jumpTo(`ruling-${r.id}`); }}>{r.title}, in the house rulings</button></p>
{/each}
{/if}
{#if entryMentions.length > 0}
<h3>Mentions</h3>
<p class="chips">
{#each entryMentions as m (m.id)}
<button class="chip" onclick={(e) => openEntry(m.id, e.currentTarget)}>{m.name}</button>
{/each}
</p>
{/if}
</div>
</div>
</div>
</div>
{/if}
<div class="scrim" role="presentation" onclick={close}>
<div class="booklet" role="dialog" aria-modal="true" aria-label="help" tabindex="-1"
onclick={(e) => e.stopPropagation()} onkeydown={() => {}}>
<header class="booklet-head">
<span class="booklet-title">Wiz-War</span>
<nav class="tabs" aria-label="help sections">
<button class:current={tab === "play"} onclick={() => goTab("play")}>How to play</button>
<button class:current={tab === "rules"} onclick={() => goTab("rules")}>Rules</button>
<button class:current={tab === "cards"} onclick={() => goTab("cards")}>Card library</button>
<button class:current={tab === "rulings"} onclick={() => goTab("rulings")}>House rulings</button>
<button class:current={tab === "about"} onclick={() => goTab("about")}>About</button>
<button class:current={tab === "tally"} onclick={() => goTab("tally")}>The tally</button>
</nav>
<button class="close" onclick={close} aria-label="close help">×</button>
</header>
<div class="booklet-body" bind:this={bodyEl}>
{#if tab === "tally"}
<div class="reading">
<h3>How much love the maze is getting</h3>
{#if stats}
<div class="stories">
<div class="story"><span class="big">{n(stats.gamesFinished)}</span><span>games fought to a finish</span></div>
<div class="story"><span class="big">{n(stats.winsByTreasure)}</span><span>won by carrying treasure home</span></div>
<div class="story"><span class="big">{n(stats.winsByLastStanding)}</span><span>won as the last wizard standing</span></div>
<div class="story"><span class="big">{hours(Number(stats.minutesAtTable))}</span><span>spent at the table</span></div>
</div>
<h3>The ledgers in detail</h3>
<dl class="tally-list">
<dt>{n(stats.gamesCreated)}</dt><dd>games chronicled, {n(stats.gamesStarted)} of them begun</dd>
<dt>{n(stats.wizardsSeated)}</dt><dd>distinct wizard names have taken a seat</dd>
<dt>{n(stats.commandsPlayed)}</dt><dd>spells, steps, and punches recorded</dd>
<dt>{n(stats.longestGameCommands)}</dt><dd>actions in the longest game yet played</dd>
<dt>{n(stats.fullestTable)}</dt><dd>wizards at the fullest table</dd>
<dt>{n(stats.hotseatGames)}</dt><dd>games played on one device, passed around</dd>
<dt>{n(stats.automatonGames ?? 0)}</dt><dd>games fought against the clockwork</dd>
</dl>
<p class="colophon">
{#if stats.firstGameAt}The first game was dealt {new Date(String(stats.firstGameAt)).toLocaleDateString(undefined, { year: "numeric", month: "long", day: "numeric" })}.{/if}
Wizards are counted by name, so one player under two names counts as two wizards.
Table time is estimated from the clock between moves, so a game left open overnight counts only the minutes it was actually played.
Games on one device send only their counts, and their names and moves stay on the device.
</p>
{:else}
<p>Counting the ledgers…</p>
{/if}
</div>
{:else if tab === "about"}
<div class="reading about">
<h3>Why it exists</h3>
<p>
In the early nineties, a group of friends played this exact edition
for countless hours of slammed doors, ambushes around corners,
goat charges and laughter. That box is long out of
print, and its cardboard is worn soft at the edges. This digital
table was built from that very copy: every card was photographed and
transcribed word for word, every board layout verified wall by wall,
and the tokens on this screen are the actual hand-inked art from
those counter sheets. It is a faithful reproduction of the game as
it was played at that table, made so the same friends, and their
friends, can keep playing it.
</p>
<h3>What this is</h3>
<p>
Wiz-War is a game of magical combat in a stone labyrinth: two to six
wizards prowl a maze, hurling fireballs, walking through walls,
summoning trolls, and stealing each other's treasure. It was created
by <strong>Tom Jolly</strong> in 1983 and first published under his
own Jolly Games label. The edition reproduced here is the
<strong>sixth edition</strong>, published by Chessex in 1993, together
with its one expansion, which brings monsters and magic wands.
</p>
<h3>Whose game it is</h3>
<p>
Wiz-War is Tom Jolly's design, and the rights to it now rest with
<strong>Steve Jackson Games</strong>, who publish the current
edition. This project is an unofficial, non-commercial fan work,
made with love and admiration for the original. Nothing here is
endorsed by or affiliated with Tom Jolly, Chessex, or Steve Jackson
Games. If this game delights you, honor it the right way:
<a href="https://www.sjgames.com/wiz-war/" target="_blank" rel="noreferrer">buy
the edition currently in print</a>, and deal seven cards to
somebody at a real table.
</p>
<h3>Behind the curtain</h3>
<p>The workshops where this table's pieces are made are open to visitors.</p>
<div class="gallery">
<a class="tile" href="/?tokens">
<img src="/tokens/alter-ego.png" alt="" />
<span class="tile-name">The token workshop</span>
<span class="tile-note">every token in both arts, beside the wall textures and spell sprites</span>
</a>
<a class="tile" href="/?fx">
<img src="/fx3d/fireball.png" alt="" />
<span class="tile-name">The flourish workshop</span>
<span class="tile-note">each board effect, played on demand</span>
</a>
<a class="tile" href="/?fpv">
<img src="/hero.jpg" alt="" />
<span class="tile-name">The first-person workshop</span>
<span class="tile-note">the maze through a wizard's own eyes</span>
</a>
</div>
<p class="colophon"><a href="/?fpv&demo=1">Watch the demo</a>, in which two clockwork wizards play a stretch and the reel replays it.</p>
<h3>What the table remembers</h3>
<p>
An online game is written to this table's ledger move by move, table
talk included, and kept. A finished game can be replayed from above
or through a wizard's own eyes, and any turn can be shared by link.
A shared replay shows that turn's moves as an onlooker would have
seen them, and never anyone's hand. A game passed around one device
stays on that device, and only its counts reach the tally. Play under
whatever name you like, and know that what you say and do at an
online table is part of its record.
</p>
<p>
Your seat at an online game is kept in this browser. To carry it to
another device, choose <em>transfer seat</em> at the table and claim
the phrase there. If a browser loses it, write to the keeper for a
link that brings it back.
</p>
<h3>Send word</h3>
<p>
Feedback, bug reports and faint praise are all welcome. Ravens fly to
<a href="mailto:eric@ericwagoner.com">eric@ericwagoner.com</a>,
<a href="https://bsky.app/profile/kestrelsnest.social" target="_blank" rel="noreferrer">@kestrelsnest.social</a> on Bluesky,
or <a href="https://toots.kestrelsnest.social/@eric" target="_blank" rel="noreferrer">@eric@toots.kestrelsnest.social</a> on Mastodon.
The keeper of this table roosts at
<a href="https://kestrelsnest.social" target="_blank" rel="noreferrer">kestrelsnest.social</a>.
</p>
{#if family.length}
<h3>More games in {#if hall}<a href={hall}>Kestrel's Hall</a>{:else}Kestrel's Hall{/if}</h3>
<ul class="family">
{#each family as g (g.slug)}
<li><a href={g.url}>{g.name}</a>: {g.pitch} <span class="family-note">{g.players} players; {g.origin}.</span></li>
{/each}
</ul>
{/if}
<p class="hosting">
The games of Kestrel's Hall are free and will stay free. They run on small servers that cost a few dollars a month, and anyone who wants to chip in toward the hosting can do so at
<a href="https://ko-fi.com/kestrelsnest" target="_blank" rel="noreferrer">ko-fi.com/kestrelsnest</a>. Chipping in unlocks nothing, and nothing is held back without it.
</p>
<p class="colophon">
Wiz-War © Tom Jolly. Sixth edition published by Chessex, 1993.
</p>
</div>
{:else if tab === "play"}
<div class="reading">
{#each HOW_TO_PLAY as section (section.title)}
<h3 id="play-{section.title.toLowerCase().replace(/[^a-z0-9]+/g, '-')}">{section.title}</h3>
{#each section.body as p, i (i)}<p>{p}</p>{/each}
{/each}
</div>
{:else if tab === "rulings"}
<div class="reading">
<p class="colophon">
For players who know the box, here is how this table resolves, card
by card, what the cardboard leaves to the players. If the table rules
against your memory of the rules, the 🐞 report button pins the
moment for review, and the reply lands in your lobby.
</p>
<div class="search-row">
<input bind:value={rulingsSearch} placeholder="search the rulings by card or topic…" aria-label="search house rulings" />
</div>
{#if rulingsSearch.trim()}
<p class="count">{rulingResults.length === 0 ? `Nothing here mentions "${rulingsSearch.trim()}".` : `${rulingResults.length} of ${HOUSE_RULINGS.length} rulings`}</p>
{/if}
{#each rulingResults as r (r.id)}
<h3 id="ruling-{r.id}" class="linked">
{r.title}
<button class="link-btn" onclick={() => copyLink("rulings", `ruling-${r.id}`, null)} title="copy a link to this ruling">
{copied === `rulings/ruling-${r.id}` ? "copied" : "🔗"}</button>
</h3>
{#each r.body as p, i (i)}<p>{p}</p>{/each}
<p class="chips">
{#each r.cards as id (id)}
<button class="chip" onclick={(e) => openEntry(id, e.currentTarget)}>{cardDef(id).name}</button>
{/each}
</p>
{/each}
{#if !rulingsSearch.trim()}
<h3 id="ruling-the-table">The table itself</h3>
<p>The clockwork wizards, the automatons, play from the same redacted
view a human seat gets and by the same rules the engine enforces on
everyone. Their tier changes how many cards they draw and how many
tricks they know.</p>
<p>A turn need not be taken at once. Games wait on the lobby ledger
for days while the browser holds your seat. A replay of any game can be
watched from above or through a wizard's eyes and shared by link.</p>
{/if}
</div>
{:else if tab === "rules"}
<div class="reading">
<div class="search-row">
<input bind:value={rulesSearch} placeholder="search the rules, the rulebook, the expansion, and the FAQ…" aria-label="search the rules" />
</div>
{#if rulesSearch.trim()}
<p class="count">{refResults.length === 0 ? `Nothing in the rules mentions "${rulesSearch.trim()}".` : `${refResults.length} of ${REFERENCE.length} sections`}</p>
{#each refResults as s (s.id)}
{@render section(s, true)}
{/each}
{:else}
<nav class="contents" aria-label="contents">
{#each refBySource as group (group.source)}
<div class="contents-group">
<span class="contents-head">{SOURCE_LABELS[group.source]}</span>
{#each group.sections as s (s.id)}
<button class="contents-link" onclick={() => jumpTo(s.id)}>{s.title}</button>
{/each}
</div>
{/each}
</nav>
{#each refBySource as group (group.source)}
<h2 class="divider" id="source-{group.source}">{SOURCE_LABELS[group.source]}</h2>
{#if group.source === "summary"}
<p class="colophon">Sixth edition rules, condensed from the original rulebook. © 1985 Jolly Games. This digital adaptation is a fan project.</p>
{:else if group.source === "rulebook"}
<p class="colophon">The full text, word for word, for settling table disputes. {RULEBOOK_COPYRIGHT} Notes marked <span class="ed-note">(6E: …)</span> are this table's, on where the sixth edition differs.</p>
{:else if group.source === "faq"}
<p class="colophon">Tom Jolly's own answers (wizwar.com, September 2002), verbatim. Rulings occasionally reference other editions. Card-specific rulings are on the cards themselves, in the library.</p>
{/if}
{#each group.sections as s (s.id)}
{@render section(s, false)}
{/each}
{/each}
{/if}
</div>
{:else}
<div class="search-row">
<input bind:value={cardText} placeholder="search {CARD_POOL.length} cards by name or text…" aria-label="search cards" />
</div>
<div class="filters">
<label>set
<select bind:value={cardSet}>
<option value="all">all</option>
<option value="basic">base deck</option>
<option value="expansion1">expansion</option>
</select>
</label>
<label>type
<select bind:value={cardType}>
<option value="all">all</option>
<option value="attack">attack</option>
<option value="neutral">neutral</option>
<option value="counteraction">counteraction</option>
<option value="number">number</option>
<option value="object">object</option>
<option value="trap">trap</option>
</select>
</label>
<label>target
<select bind:value={cardSight}>
<option value="all">any</option>
<option value="los">line of sight</option>
<option value="adjacent">adjacent</option>
<option value="none">no target</option>
</select>
</label>
<span class="count">{cardResults.length === 0 ? "No cards found." : `${cardResults.length} card${cardResults.length === 1 ? "" : "s"}`}</span>
</div>
{#if cardResults.length === 0}
<p class="colophon">No card matches {cardText.trim() ? `"${cardText.trim()}"` : "those filters"}. Try fewer words, or widen the filters.</p>
{/if}
<div class="card-grid">
{#each cardResults as def (def.id)}
<div class="card-slot">
<Card
card={{ instanceId: `lib-${def.id}`, cardId: def.id }}
onclick={() => openEntry(def.id)}
onfaq={() => openEntry(def.id)}
/>
<span class="card-meta">
×{def.quantity}{def.alsoIn?.length ? ` (+${def.alsoIn[0]!.quantity} exp)` : ""}
· {def.set === "basic" ? "base" : "exp 1"}
</span>
</div>
{/each}
</div>
{/if}
</div>
</div>
</div>
<style>
.scrim {
position: fixed;
inset: 0;
background: rgba(10, 12, 16, 0.72);
display: grid;
place-items: center;
z-index: 40;
padding: 2rem 1rem;
}
.booklet {
background: #efe8d4;
color: #43331f;
width: min(58rem, 100%);
max-height: calc(100vh - 4rem);
border-radius: 6px;
border: 1px solid #b3a687;
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
display: flex;
flex-direction: column;
overflow: hidden;
}
.booklet-head {
display: flex;
align-items: center;
gap: 1rem;
padding: 0.7rem 1rem;
border-bottom: 2px solid #43331f;
flex-wrap: wrap;
}
.booklet-title {
font-family: "Oswald", sans-serif;
font-weight: 700;
font-size: 1.15rem;
text-transform: uppercase;
letter-spacing: 0.04em;
}
.tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tabs button {
font-family: "Oswald", sans-serif;
font-size: 0.72rem;
letter-spacing: 0.1em;
text-transform: uppercase;
background: none;
border: 1.5px solid transparent;
border-radius: 3px;
color: #6b5a41;
padding: 0.3rem 0.6rem;
cursor: pointer;
}
.tabs button.current {
border-color: #43331f;
color: #43331f;
background: #e4dbc2;
}
.close {
margin-left: auto;
background: none;
border: none;
font-size: 1.4rem;
color: #6b5a41;
cursor: pointer;
line-height: 1;
}
.close:hover { color: #b3372b; }
/* A narrow screen wraps the tabs to their own rows under the title and the close. */
@media (max-width: 640px) {
.booklet-head { gap: 0.5rem 1rem; }
.tabs { order: 3; flex-basis: 100%; }
.close { order: 2; }
}
.booklet-body {
overflow-y: auto;
padding: 1rem 1.4rem 1.4rem;
font-family: "Archivo Narrow", sans-serif;
font-size: 0.98rem;
line-height: 1.5;
}
/* Long reading gets a book's column: narrower, a touch larger. */
.reading { max-width: 44rem; margin: 0 auto; font-size: 1.04rem; line-height: 1.55; }
.divider {
font-family: "Oswald", sans-serif;
font-size: 1rem;
letter-spacing: 0.1em;
text-transform: uppercase;
border-top: 3px double #43331f;
padding-top: 0.8rem;
margin: 1.6rem 0 0.2rem;
}
.booklet-body h3, .entry-text h3 {
font-family: "Oswald", sans-serif;
font-size: 0.85rem;
letter-spacing: 0.12em;
text-transform: uppercase;
border-bottom: 1px solid #b3a687;
padding-bottom: 0.15rem;
margin: 1.2rem 0 0.4rem;
}
.reading > h3:first-child, .entry-text > h3:first-child { margin-top: 0; }
h3.linked { display: flex; align-items: baseline; gap: 0.5rem; scroll-margin-top: 0.5rem; }
.source { font-size: 0.65rem; letter-spacing: 0.08em; color: #8a7a5e; border: 1px solid #c9bd9f; border-radius: 3px; padding: 0 0.3rem; text-transform: none; }
.link-btn {
margin-left: auto;
background: none;
border: 1px solid transparent;
border-radius: 3px;
color: #8a7a5e;
font-family: "Oswald", sans-serif;
font-size: 0.62rem;
letter-spacing: 0.08em;
text-transform: uppercase;
cursor: pointer;
padding: 0.1rem 0.35rem;
opacity: 0.6;
}
h3:hover .link-btn, .link-btn:focus-visible, .entry-head .link-btn { opacity: 1; }
.link-btn:hover { border-color: #b3a687; color: #43331f; }
.booklet-body p { margin: 0.35rem 0; }
.colophon { font-style: italic; color: #6b5a41; font-size: 0.88rem; }
.count { font-family: "Courier Prime", monospace; font-size: 0.8rem; color: #6b5a41; }
.booklet-body a, .inline-link { color: #8a4a1f; text-decoration: underline; text-decoration-style: dotted; }
.booklet-body a:hover, .inline-link:hover { color: #43331f; }
.inline-link { background: none; border: none; padding: 0; font: inherit; cursor: pointer; }
.booklet-body :global(.ed-note) {
font-style: italic;
color: #5e4d33;
background: rgba(179, 166, 135, 0.22);
border-left: 2px solid #b3a687;
padding: 0 0.3rem;
}
.contents { columns: 2; column-gap: 2rem; margin: 0.6rem 0 0.4rem; font-size: 0.92rem; }
.contents-group { break-inside: avoid; margin-bottom: 0.7rem; }
.contents-head { display: block; font-family: "Oswald", sans-serif; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: #8a7a5e; margin-bottom: 0.15rem; }
.contents-link { display: block; background: none; border: none; padding: 0.05rem 0; font: inherit; color: #8a4a1f; cursor: pointer; text-align: left; }
.contents-link:hover { color: #43331f; text-decoration: underline; }
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.chip {
font-family: "Oswald", sans-serif;
font-size: 0.68rem;
letter-spacing: 0.08em;
text-transform: uppercase;
background: #e4dbc2;
border: 1px solid #b3a687;
border-radius: 3px;
color: #43331f;
padding: 0.15rem 0.45rem;
cursor: pointer;
}
.chip:hover { background: #d8cdae; }
.stories { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.8rem; margin: 0.6rem 0 1rem; }
.story { display: flex; flex-direction: column; align-items: center; text-align: center; background: #e4dbc2; border: 1px solid #b3a687; border-radius: 4px; padding: 0.6rem 0.5rem; font-size: 0.9rem; }
.big { font-family: "Oswald", sans-serif; font-weight: 700; font-size: 1.7rem; color: #b3372b; line-height: 1.1; }
.tally-list { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.8rem; margin: 0.6rem 0 1rem; }
.tally-list dt {
font-family: "Oswald", sans-serif; font-weight: 700; font-size: 1.05rem;
color: #b3372b; text-align: right; white-space: nowrap;
}
.tally-list dd { margin: 0; align-self: center; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.8rem; margin: 0.6rem 0; }
.tile { display: flex; flex-direction: column; gap: 0.25rem; background: #e4dbc2; border: 1px solid #b3a687; border-radius: 4px; padding: 0.5rem; text-decoration: none; color: inherit; }
.tile:hover { background: #d8cdae; }
.tile img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 3px; border: 1px solid #b3a687; background: #2a2622; }
.tile-name { font-family: "Oswald", sans-serif; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.tile-note { font-size: 0.85rem; color: #6b5a41; }
.search-row { margin-bottom: 0.8rem; }
.search-row input {
width: 100%;
box-sizing: border-box;
background: #f6f0df;
border: 1px solid #b3a687;
border-radius: 4px;
padding: 0.5rem 0.7rem;
font-family: inherit;
font-size: 0.95rem;
color: #43331f;
}
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin: -0.3rem 0 0.8rem; font-family: "Oswald", sans-serif; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: #6b5a41; }
.filters select { font-family: "Archivo Narrow", sans-serif; font-size: 0.9rem; text-transform: none; letter-spacing: 0; margin-left: 0.3rem; background: #f6f0df; border: 1px solid #b3a687; border-radius: 3px; color: #43331f; padding: 0.15rem 0.3rem; }
.filters .count { margin-left: auto; text-transform: none; letter-spacing: 0; }
.card-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(8.4rem, 1fr));
gap: 0.8rem;
justify-items: center;
}
.card-slot { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.card-slot :global(.card:hover) { transform: translateY(-0.2rem); }
.card-meta {
font-family: "Courier Prime", monospace;
font-size: 0.68rem;
color: #6b5a41;
}
/* The card entry: the familiar card beside reading-size text. */
.layer-scrim {
position: fixed;
inset: 0;
background: rgba(10, 12, 16, 0.55);
display: grid;
place-items: center;
z-index: 55;
padding: 1.5rem 1rem;
}
.entry {
background: #efe8d4;
color: #43331f;
width: min(46rem, 100%);
max-height: calc(100vh - 3rem);
border-radius: 6px;
border: 1px solid #b3a687;
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7);
display: flex;
flex-direction: column;
overflow: hidden;
}
.entry-head { display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem 1rem; border-bottom: 2px solid #43331f; }
.entry-title { font-family: "Oswald", sans-serif; font-weight: 700; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.04em; }
.entry-head .link-btn { margin-left: 0; }
.entry-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.2rem; padding: 1rem 1.2rem 1.2rem; overflow-y: auto; font-family: "Archivo Narrow", sans-serif; }
.entry-card { align-self: start; position: sticky; top: 0; }
.entry-card :global(.card) { transform: scale(1.35); transform-origin: top left; margin: 0 2.9rem 4rem 0; cursor: default; }
.entry-card :global(.card:hover) { transform: scale(1.35); box-shadow: 0 3px 8px rgba(10, 8, 4, 0.45); }
.entry-text { min-width: 0; }
.entry-text p { margin: 0.35rem 0; }
.entry-meta { font-family: "Courier Prime", monospace; font-size: 0.8rem; color: #6b5a41; margin: 0 0 0.4rem; }
.printed { font-size: 1.05rem; }
@media (max-width: 640px) {
.entry-body { grid-template-columns: 1fr; }
.entry-card { position: static; display: flex; justify-content: center; }
.entry-card :global(.card) { transform: none; margin: 0; }
.entry-card :global(.card:hover) { transform: none; }
.contents { columns: 1; }
}
.family { margin: 0.4rem 0 0.8rem 1.2rem; padding: 0; }
.family li + li { margin-top: 0.3rem; }
.family-note { color: #7b6a51; }
</style>