/* The site: home, catalog, game pages, about. Colours, sizes and motion come from tokens.css (contract C2 section 8);
   every var() carries a fallback so the page reads even before the tokens load. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body.site {
	margin: 0;
	background-color: var(--c-bg);
	background-image: var(--img-page);
	background-size: var(--page-size);
	background-position: var(--page-pos);
	background-repeat: var(--page-repeat, no-repeat);
	color: var(--c-on-felt);
	font-family: var(--font-text, Georgia, serif);
	font-size: 1.125rem;
	line-height: 1.5;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}
body.site main { flex: 1 0 auto; }
a { color: var(--c-on-page-accent); text-underline-offset: 3px; }
a:hover { color: var(--c-focus); }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: 2px; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--c-parchment); color: var(--c-ink); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
h1, h2, h3 { font-family: var(--font-display, Georgia, serif); text-transform: var(--heading-case); font-weight: 400; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); }
h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); margin-top: 1.4em; }
h3 { font-size: 1.3rem; margin-top: 1.2em; }
p { margin: 0 0 .8em; }
.lead { font-size: 1.25rem; color: var(--c-on-felt-soft); }
.soft, .hint { color: var(--c-on-felt-soft); }
.hint { font-size: .95rem; margin: .4em 0 0; }

/* buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap, 44px); padding: 8px 22px; font: inherit; font-size: 1.1rem; color: var(--c-on-felt); background: transparent; border: 2px solid var(--c-gold); border-radius: var(--radius-m, 10px); cursor: pointer; text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--c-gold-a15); }
/* the main button: the colours of the skin, or its picture when it has one (the values are set by shared/skin-frame.js) */
.btn-primary { color: var(--btn-prim-color); background: var(--btn-prim-bg); background-clip: var(--btn-prim-clip); border-color: var(--btn-prim-bc); border-width: var(--btn-prim-bw); border-radius: var(--btn-prim-radius); border-image: var(--img-button) var(--button-slice) fill / var(--button-edge) stretch; font-weight: 700; box-shadow: var(--btn-shadow, none); text-transform: var(--btn-case, none); }
.btn-primary:hover:not(:disabled) { background: var(--btn-prim-bg-hover); background-clip: var(--btn-prim-clip); color: var(--btn-prim-color); }
.btn-small { min-height: var(--tap, 44px); padding: 4px 16px; font-size: 1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .95rem; color: var(--c-on-felt-soft); }
select { min-height: var(--tap, 44px); font: inherit; font-size: 1.1rem; padding: 4px 12px; color: var(--c-ink); background: var(--c-parchment); border: 2px solid var(--c-gold-soft); border-radius: var(--radius-s, 4px); max-width: 100%; }

/* the start buttons (the home page and the game page) */
.start-actions { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: flex-start; }
.start-col { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.start-col .btn { min-width: 220px; }
.levels { border: 0; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.levels legend { display: block; width: 100%; padding: 0; font-size: .95rem; color: var(--c-on-felt-soft); }
.levels label { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap, 44px); cursor: pointer; }
.levels input { width: 20px; height: 20px; accent-color: var(--c-alt-edge, var(--c-gold)); }
.start-msg { min-height: 1.5em; margin: 12px 0 0; color: var(--c-focus); }

/* the catalog */
.catalog { display: grid; gap: 8px; }
.family h2 { border-bottom: 1px solid var(--c-gold-soft); padding-bottom: 4px; }
.cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
.game-card { background: var(--c-parchment); color: var(--c-ink); border-radius: var(--radius-m, 10px); padding: 14px 16px; box-shadow: 0 2px 8px var(--c-shadow); }
.game-card h3 { margin-top: 0; margin-bottom: .2em; }
.game-card a { color: var(--c-accent); }
.game-card .subtitle { margin: 0; color: var(--c-ink-soft); font-style: italic; }
.game-card .tag { margin: .3em 0 .6em; }
.game-card .soft { color: var(--c-ink-soft); }
.seat-rows { list-style: none; margin: 0; padding: 0; }
.seat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 0; border-top: 1px solid var(--c-ink-a15); }
.seat-n { min-width: 6.5em; }
.badge { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: .9rem; border: 1px solid currentColor; }
.badge-ok { color: var(--c-ok-text); background: var(--c-ok-bg); }
.badge-wait { color: var(--c-wait-text); background: var(--c-wait-bg); }
.missing { font-size: .92rem; color: var(--c-ink-soft); flex-basis: 100%; }
.game-card .btn { color: var(--c-ink); border-color: var(--c-wood); }
.game-card .btn:hover:not(:disabled) { background: var(--c-wood-a12); }
.more { margin: .6em 0 0; font-size: .95rem; }

/* a game page and about: parchment panels */
.crumbs { padding-top: 14px; font-size: .95rem; }
.game-head { padding-top: 8px; }
.subtitle { font-style: italic; color: var(--c-on-felt-soft); margin: 0 0 .4em; }
.status-line { margin: .4em 0 1em; padding-left: 12px; border-left: 4px solid var(--c-gold-soft); }
.status-line[data-status="plays"] { border-left-color: var(--c-ok); }
.seats-field { max-width: 160px; margin-bottom: 12px; }
.game #start { background: var(--c-felt); padding: 16px; border-radius: var(--radius-m, 10px); margin-bottom: 20px; }
.short, .full, .sources, .passport, .about section { background: var(--c-parchment); color: var(--c-ink); border-radius: var(--radius-m, 10px); padding: 8px 18px 14px; margin: 18px 0; }
.about section h2:first-child { margin-top: .4em; }
.short h2, .full h2, .sources h2, .passport h2 { margin-top: .5em; }
.short .soft, .full .soft, .sources .soft, .passport .soft { color: var(--c-ink-soft); }
.short a, .full a, .sources a, .passport a, .about a { color: var(--c-accent); }
.short-lines { padding-left: 1.4em; margin: 0 0 .6em; }
.short-lines li { margin-bottom: .8em; }
.line-text { display: block; }
.mark, .src { font-size: .9rem; color: var(--c-ink-soft); }
.mark { display: block; margin-top: 2px; }
.src { margin: .1em 0 .2em; }
.sign { display: inline-block; width: 1.1em; }
.m-book .sign { color: var(--c-ok-text); }
.m-read .sign { color: var(--c-read-text); }
.m-ours .sign { color: var(--c-accent); }
.to-full { font-size: .95rem; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 0; }
.facts div { display: flex; gap: 8px; }
.facts dt { color: var(--c-on-felt-soft); }
.facts dt::after { content: ":"; }
.facts dd { margin: 0; }
.legend { color: var(--c-ink-soft); font-size: 1rem; }
.rules-sec h3 { border-bottom: 1px solid var(--c-ink-a25); padding-bottom: 2px; }
.rule { margin: 0 0 .9em; }
.rule-text { margin: 0; }
.alt, .inh { margin: .1em 0 .1em; font-size: .95rem; color: var(--c-ink-soft); }
.about-en { color: var(--c-ink-soft); }
.sources ul { padding-left: 1.2em; }
.sources li { margin-bottom: .4em; }
.cite { font-style: italic; }
.plain { padding-left: 1.2em; }
.marks dt { font-weight: 600; margin-top: .6em; }
.marks dd { margin: 0 0 .3em 0; }

@media (min-width: 720px) {
	.cards { grid-template-columns: repeat(2, 1fr); }
	.short, .full, .sources, .passport, .about section { padding-left: 28px; padding-right: 28px; }
}
@media (min-width: 1100px) {
	.cards { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
	.btn { transition: background var(--motion-fast, 120ms); }
}

/* text pages (/restoration, /lab) */
.text-page section:first-child h2:first-child { margin-top: .4em; }
.text-page li { margin-bottom: .5em; }
/* a drop capital: a look turns it on with the token --dropcap "on" (shared/skin-frame.js); with the default values below the letter is plain.
   Not in the first section (an opening quotation mark would become the big letter), not in «The role of AI» (the big letter would split the abbreviation),
   not before a list (the letter would hang into the first item). A browser without :has() drops the whole rule: plain letters. */
:is(.about, .text-page, .game) section:not(:first-child):not(#ai) > h2 + p:not(:has(+ :is(ul, ol, dl)))::first-letter { float: var(--dropcap-float); font-size: var(--dropcap-size); line-height: var(--dropcap-lh); padding: var(--dropcap-pad); color: var(--dropcap-color); font-weight: var(--dropcap-weight); font-family: var(--dropcap-font); }
.text-page p, .text-page li { overflow-wrap: anywhere; }

/* The frame rule: text never lies straight on the picture or the pattern of the page. The column of a site page stands on a flat
   plate of the page colour of the skin; the pattern stays at the margins. On a narrow screen the plate is the whole width. */
body.site main.wrap { background-color: var(--c-bg); padding-bottom: 24px; box-shadow: 0 0 28px var(--c-shadow); }
body.site main.home > section:not(.hero) { max-width: 1080px; margin-left: auto; margin-right: auto; background-color: var(--c-bg); box-shadow: 0 0 28px var(--c-shadow); }
@media (min-width: 720px) {
	body.site main.wrap, body.site main.home > section:not(.hero) > .wrap { padding-left: 28px; padding-right: 28px; }
}
