/* The home page: first screen, how to call a friend, the games of the book, what this is.
   Colours, cloth and buttons are the skin's (tokens.css, the classes btn / btn-primary): nothing here is made for one skin. */

/* ---- first screen: the cloth of the skin, the fan, the question, the entrances ---- */
.hero {
	--cw: clamp(40px, min(7.2vw, calc((100svh - var(--fan-off, 511px)) / 3.2)), 104px); /* the fan shrinks on a low window: the entrances stay on the first screen */
	position: relative;
	overflow-x: clip;
	padding: 20px 0 22px;
	text-align: center;
	border-bottom: 2px solid var(--c-gold-soft);
	background-color: var(--c-felt);
	background-image: var(--img-ornament), var(--img-ornament-tr), var(--img-ornament-bl), var(--img-ornament-br),
		var(--img-glow),
		var(--img-hero), radial-gradient(ellipse at 50% 45%, var(--c-felt) 0%, var(--c-felt) 45%, var(--c-felt-2) 100%);
	background-position: left var(--ornament-at-x, 0) top var(--ornament-at-y, 0), right var(--ornament-at-x, 0) top var(--ornament-at-y, 0),
		left var(--ornament-at-x, 0) bottom var(--ornament-at-y, 0), right var(--ornament-at-x, 0) bottom var(--ornament-at-y, 0), 0% 0%, 0% 0%, 0% 0%;
	background-size: var(--ornament-size, auto), var(--ornament-size, auto), var(--ornament-size, auto), var(--ornament-size, auto), auto, var(--hero-size, auto), auto;
	background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, var(--hero-repeat, repeat), no-repeat;
}
.fan {
	position: relative;
	height: calc(var(--cw) * 3.2);
	max-width: 100%;
	overflow: hidden;
	margin: 0 auto;
	pointer-events: none;
}
.fan-card {
	position: absolute;
	top: 6px;
	left: 50%;
	width: var(--cw);
	height: auto;
	aspect-ratio: 90 / 189;
	margin-left: calc(var(--cw) / -2);
	border-radius: var(--radius-card, 7px);
	box-shadow: 0 8px 16px var(--c-shadow);
	background: var(--c-parchment);
	transform-origin: 50% calc(var(--cw) * 12.5);
	transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * 4.4deg));
}
/* a plate of the cloth colour under the letters: a patterned cloth (tiles, carpet) does not run through them.
   It has an edge of its own, a thin double line of the skin's gold with round corners: it reads as a plaque, not as a cloth that did not load */
.hero-body { width: calc(100% - 24px); max-width: 1040px; margin-left: auto; margin-right: auto; padding: 14px 24px 14px; background-color: var(--c-hero-plate);
	color: var(--c-hero-text); --c-on-felt: var(--c-hero-text); --c-on-felt-soft: var(--c-hero-text-soft); /* the text on the plate follows the plate (a light plate on a light cloth, intarsia) */
	border: 1px solid var(--c-gold-soft); border-radius: 12px;
	box-shadow: inset 0 0 0 4px var(--c-hero-plate), inset 0 0 0 5px var(--c-gold-soft), 0 8px 22px var(--c-shadow); }
.hero h1 { font-size: clamp(1.6rem, 4vw, 3.1rem); margin: 0 0 .15em; }
.hero .lead { font-size: clamp(1rem, 1.8vw, 1.45rem); margin: 0 0 .9em; }
.count { border: 0; padding: 0; margin: 0 0 6px; }
.count-q { font-weight: 700; font-size: clamp(1.15rem, 2.2vw, 1.9rem); margin: 0 0 8px; }
.chips { display: flex; justify-content: center; gap: clamp(8px, 1.6vw, 18px); min-height: clamp(44px, 5.4vw, 56px); } /* the room of the circles is held before the server's list comes */
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
	display: inline-flex; align-items: center; justify-content: center;
	width: clamp(44px, 5.4vw, 56px); height: clamp(44px, 5.4vw, 56px);
	border-radius: 50%; border: 2px solid var(--c-alt-edge); color: var(--c-alt-text);
	background: var(--c-alt-bg); font-size: 1.3rem; font-weight: 700;
}
.chip input:checked + span { background: var(--c-sel-bg); color: var(--c-sel-text); }
.chip input:focus-visible + span { outline: 3px solid var(--c-focus); outline-offset: 3px; }
.chip:hover input:not(:checked) + span { background: var(--c-gold-a15); }
.pick-wrap { position: relative; }
.pick-line { margin: 6px auto 10px; max-width: 46em; color: var(--c-on-felt-soft); font-size: clamp(.9rem, 1.4vw, 1.1rem); line-height: 1.35; min-height: 1.35em; }
/* the level row is shown only after the site settings said which levels stay; until then it holds its room */
.hero .levels:not([data-ready]) { visibility: hidden; }
.pick-game.is-chosen { color: var(--c-on-felt); font-weight: 700; }
.linkish { font: inherit; font-weight: 700; color: var(--c-on-page-accent); background: none; border: 0; padding: 0 2px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 0; }
.linkish:hover { color: var(--c-focus); }
.hero .linkish { color: var(--c-on-felt); }
/* a grid of two columns and two rows (the buttons, then what stands under each): the two buttons are as tall as the taller one, also when a skin gives the main one a picture edge */
.hero .start-actions { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; grid-auto-flow: column; justify-content: center; align-items: start; gap: 4px 24px; }
.hero .start-col { display: contents; }
.hero .start-col .btn { align-self: stretch; justify-self: center; }
.hero .start-col .hint, .hero .start-col .levels { justify-self: center; text-align: center; }
/* the two entrances are one family of equal size: the main one filled, the other dark with the gold edge. The device is shared; colours are the skin's */
.hero .start-col .btn { width: min(320px, 78vw); min-height: 56px; padding: 8px 18px; font-size: 1.3rem; font-weight: 700; border-style: solid; border-width: var(--btn-prim-bw, 2px); border-radius: var(--btn-prim-radius, var(--radius-m, 10px)); line-height: 1.15; text-transform: var(--btn-case, none); }
/* the second button has the border BOX of the main one (the same border widths, also when a skin gives the main one a picture edge: 18px and more), so the two are equal in height in every skin and size; its gold edge is drawn inside that box */
.hero .start-col .btn:not(.btn-primary) { border-style: solid; border-color: transparent; border-width: var(--btn-prim-bw, 2px); outline: 2px solid var(--c-alt-edge); outline-offset: -2px; background: var(--c-alt-bg); color: var(--c-alt-text); border-radius: var(--alt-radius); }
.hero .start-col .btn:not(.btn-primary):focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; }
.hero .hint { margin: 0; font-size: .9rem; }
.hero .levels { justify-content: center; margin: 0; gap: 0 12px; }
.hero .levels legend { width: auto; float: left; margin-right: 10px; line-height: 44px; font-size: .9rem; }
.hero .levels label { min-height: 40px; font-size: .95rem; }
.hero .start-msg { min-height: 1.3em; margin: 4px 0 0; }
.below { display: none; font-size: .95rem; color: var(--c-on-felt-soft); }
.below::before { content: "\2193\00a0\00a0"; }

/* the list «сменить»: a small sheet over the page, with a row for each game of the chosen number */
.swap { position: absolute; z-index: 20; left: 50%; top: 100%; transform: translateX(-50%); width: min(620px, calc(100vw - 24px)); max-height: min(60svh, 420px); overflow: auto;
	text-align: left; background: var(--c-parchment); color: var(--c-ink); border: 2px solid var(--c-gold); border-radius: var(--radius-m, 10px); box-shadow: 0 10px 28px var(--c-shadow); padding: 10px 12px 12px; }
.swap-h { margin: 0 0 6px; font-weight: 700; }
.swap-list { list-style: none; margin: 0 0 8px; padding: 0; }
.swap-item { display: flex; align-items: flex-start; gap: 10px; border-top: 1px solid var(--c-ink-a15); padding: 6px 0; }
.swap-row { flex: 1 1 auto; display: grid; grid-template-columns: 24px 1fr; column-gap: 8px; align-items: start; cursor: pointer; min-height: 44px; }
.swap-row input { grid-row: 1 / 3; margin: 4px 0 0; width: 20px; height: 20px; accent-color: var(--c-accent); }
.swap-name { font-weight: 700; }
.swap-tag { grid-column: 2; font-size: .92rem; color: var(--c-ink-soft); }
.swap-rules { flex: 0 0 auto; align-self: center; color: var(--c-accent); font-size: .95rem; }
.swap .btn { color: var(--c-ink); border-color: var(--c-wood); min-height: 40px; }

/* ---- the sections under the first screen ---- */
.mytables[hidden] { display: none; }
.mt-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.mt-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; align-items: center; background: var(--c-parchment); color: var(--c-ink); border: 1px solid var(--c-gold-soft); border-radius: var(--radius-m, 10px); padding: 10px 14px; }
.mt-name { font-weight: 700; font-size: 1.1rem; line-height: 1.2; }
.mt-meta { grid-column: 1; color: var(--c-ink-soft); font-size: .95rem; }
.mt-back { grid-column: 2; grid-row: 1 / 3; white-space: nowrap; padding: 6px 14px; min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.mt-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; }
.mt-note { margin: 0; color: var(--c-on-felt-soft); font-size: .95rem; }
.mytables .linkish { color: var(--c-on-page-accent); }
@media (max-width: 719px) {
	.mt-item { grid-template-columns: 1fr; }
	.mt-back { grid-column: 1; grid-row: auto; justify-content: center; margin-top: 6px; }
}
.mytables, .call, .books, .what { padding: 40px 0 44px; border-top: 2px solid var(--c-gold-soft); }
.mytables h2, .call h2, .books h2, .what h2 { font-size: clamp(1.7rem, 3.2vw, 2.7rem); margin: 0 0 .3em; }
.call-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
.call-lead, .books-lead { color: var(--c-on-felt-soft); margin: 0 0 20px; }
.call-steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 12px; max-width: 600px; }
.call-steps li { display: flex; align-items: center; gap: 16px; background: var(--c-parchment); color: var(--c-ink); border: 1px solid var(--c-gold-soft); border-radius: var(--radius-m, 10px); padding: 12px 16px; }
.num { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--c-gold); color: var(--c-ink); border: 2px solid var(--c-ink); font-weight: 700; font-size: 1.25rem; }
.step-t { display: flex; flex-direction: column; line-height: 1.25; }
.step-t strong { font-size: 1.2rem; }
.step-t span { font-size: .95rem; color: var(--c-ink-soft); }
.call-go { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.call-go .btn-primary { min-width: 240px; min-height: 52px; font-size: 1.2rem; }
.call-go .start-msg { flex-basis: 100%; margin: 0; min-height: 1.3em; }
.devices { margin: 0; }
.devices-pic { aspect-ratio: 16 / 10; } /* devices on the page itself, no frame (the picture has a transparent ground) */
.devices-pic img { display: block; width: 100%; height: 100%; object-fit: contain; }
.devices figcaption { margin-top: 8px; text-align: center; font-weight: 700; color: var(--c-on-page-accent); }

.books-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.books-all { font-weight: 700; white-space: nowrap; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 14px; }
.tile { display: flex; gap: 14px; align-items: center; background: var(--c-parchment); color: var(--c-ink); border: 1px solid var(--c-gold-soft); border-radius: var(--radius-m, 10px); padding: 12px; box-shadow: 0 2px 8px var(--c-shadow); }
.tile-art { flex: 0 0 auto; width: 56px; aspect-ratio: 90 / 189; border-radius: 4px; overflow: hidden; background: var(--c-parchment-2); }
.tile-pic { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.tile-body { flex: 1 1 auto; min-width: 0; }
.tile-name { text-transform: none; margin: 0; font-family: var(--font-text, Georgia, serif); font-weight: 700; font-size: 1.15rem; line-height: 1.2; }
:root[data-skin="noch"] main.home > section.call { background-color: #1d0e08; }
.tile-name a { color: var(--c-ink); text-decoration: none; font-weight: 700; }
.tile-name a:hover { text-decoration: underline; }
.tile-players { margin: 2px 0 8px; color: var(--c-ink-soft); font-size: .95rem; }
.tile-go { display: flex; gap: 8px; }
.btn-tile { flex: 1 1 0; min-width: 0; padding: 4px 8px; font-size: 1rem; white-space: nowrap; color: var(--c-ink); border: 2px solid var(--c-ink); background: transparent; } /* the edge is the ink of the skin: visible on the parchment of every skin (checked for all eight) */
.tile .btn-tile:not(.is-main) { border-color: var(--c-ink); }
.btn-tile.is-main { background: var(--c-gold); color: var(--c-ink); border-color: var(--c-gold); font-weight: 700; }
.tile .btn-tile.is-main:hover:not(:disabled) { background: var(--c-focus); color: var(--c-ink); }
.tile .btn:hover:not(:disabled) { color: var(--c-ink); }
.books .start-msg { margin-top: 12px; }

.what-grid { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: center; }
.what p { margin: 0 0 .4em; color: var(--c-on-felt-soft); }
.what-links { margin-top: 1em !important; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.what-links a { font-weight: 700; }
.what-cards { display: flex; gap: 8px; min-width: 0; justify-content: flex-start; }
.what-card { width: min(64px, 14vw); height: auto; aspect-ratio: 90 / 189; border-radius: 5px; box-shadow: 0 4px 10px var(--c-shadow); background: var(--c-parchment); }

@media (min-width: 720px) {
	.tiles { grid-template-columns: repeat(2, 1fr); }
	.tile { flex-direction: column; align-items: stretch; padding: 14px; }
	.tile-art { width: 100%; aspect-ratio: 264 / 140; }
	.tile-pic { object-position: 50% 14%; }
	.tile-name { font-size: 1.3rem; }
	.what-cards { justify-content: flex-end; }
	.what-card { width: 82px; }
}
@media (min-width: 900px) {
	.call-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 40px; }
	.what-grid { grid-template-columns: 1.3fr 1fr; }
}
@media (min-width: 1024px) {
	.tiles { grid-template-columns: repeat(4, 1fr); gap: 18px; }
}
@media (max-width: 719px) {
	.hero { --cw: clamp(40px, 15vw, 64px); padding-top: 14px; padding-bottom: 14px; }
	.fan { height: calc(var(--cw) * 2.6); }
	.fan-card { transform-origin: 50% calc(var(--cw) * 8); transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * 7deg)); }
	.fan-card[data-edge="0"], .fan-card[data-edge="1"] { display: none; }
	.hero h1 { font-size: 1.55rem; }
	.pick-line { min-height: 2.7em; } /* the line may take two lines on a phone: its room is held before the games come */
	.hero .start-actions { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; gap: 4px; }
	.hero .start-col .btn { justify-self: stretch; width: 100%; }
	.hero .start-col .btn:nth-of-type(1) { margin-top: 0; }
	.hero .start-col:nth-child(2) .btn { margin-top: 8px; }
	.hero .start-col .btn { min-height: 48px; }
	.hero .lead { margin-bottom: .6em; }
	.below { display: inline-block; margin-top: 2px; }
	.mytables, .call, .books, .what { padding: 28px 0 32px; }
}

/* a wide screen: the blocks run wide as on the plan, the type is larger */
@media (min-width: 1100px) {
	body.site main.home > section:not(.hero) { max-width: 1440px; }
	body.site main.home > section:not(.hero) > .wrap { max-width: none; padding-left: clamp(28px, 7vw, 100px); padding-right: clamp(28px, 7vw, 100px); }
	.hero-body { max-width: 1240px; }
	.hero .lead { font-size: 1.5rem; }
	.mytables h2, .call h2, .books h2, .what h2 { font-size: clamp(2.4rem, 3.4vw, 3.1rem); }
	.call-lead, .books-lead, .what p { font-size: 1.2rem; }
	.call-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 56px; }
	.call-steps { max-width: 640px; gap: 16px; }
	.call-steps li { padding: 16px 20px; }
	.step-t strong { font-size: 1.5rem; }
	.step-t span { font-size: 1.1rem; }
	.num { width: 52px; height: 52px; font-size: 1.5rem; }
	.call-go .btn-primary { min-height: 60px; font-size: 1.35rem; }
	.devices figcaption { font-size: 1.3rem; }
	.tile-name { font-size: 1.45rem; }
	.tile-players { font-size: 1.05rem; }
	.btn-tile { font-size: 1.1rem; min-height: 48px; }
	.books-all { font-size: 1.3rem; }
	.what-card { width: 110px; }
}

/* a phone: the order of the plan: the title and the line, the two devices, the three steps, the button */
@media (max-width: 899px) {
	.call-grid { display: flex; flex-direction: column; gap: 0; }
	.call-text { display: contents; }
	.call h2 { order: 1; }
	.call-lead { order: 2; margin-bottom: 14px; }
	.devices { order: 3; margin-bottom: 20px; }
	.call-steps { order: 4; max-width: none; }
	.call-go { order: 5; }
	.call-go .btn-primary { flex: 1 1 100%; min-height: 52px; }
}

/* a low window (the owner's 1536x695, a laptop 1366x768): the fan keeps the first place; the room is taken from the gaps and the sizes of the title and the line, not from the fan and not from the buttons */
@media (min-width: 720px) and (max-height: 899px) {
	.hero { --fan-off: 424px; padding: 8px 0 8px; }
	.hero-body { padding: 10px 24px 10px; }
	.hero h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin: 0 0 .1em; }
	.hero .lead { font-size: 1.15rem; margin: 0 0 .4em; }
	.count-q { font-size: 1.35rem; margin: 0 0 4px; }
	.chips { min-height: 48px; }
	.chip span { width: 48px; height: 48px; font-size: 1.2rem; }
	.pick-line { margin: 4px auto 8px; font-size: 1rem; }
	.hero .hint { font-size: .85rem; }
	.hero .levels legend { line-height: 36px; }
	.hero .levels label { min-height: 36px; }
	.hero .start-msg { min-height: 0; margin: 0; }
}

/* a phone: the first screen stays whole also when a skin gives the main button a picture edge (76 px high) */
@media (max-width: 719px) {
	.hero { padding-top: 8px; padding-bottom: 8px; }
	.hero-body { width: calc(100% - 16px); padding: 8px 12px 6px; border-radius: 10px; box-shadow: 0 6px 16px var(--c-shadow); } /* a single line on a phone: the room of the first screen stays as it was */
	.hero .levels legend { line-height: 36px; }
	.hero .levels label { min-height: 36px; }
	.hero .start-msg { min-height: 0; margin: 0; }
}

/* ---- a landing (an advertisement's first screen): the mark is html[data-land], set by the server in the first frame and by the page script ---- */
.land { display: none; }
html[data-land="bot"] #land-bot, html[data-land="friend"] #land-friend { display: block; }
html[data-land] #home-h1, html[data-land] .hero-body > .lead, html[data-land] .count, html[data-land] .pick-wrap, html[data-land] .start, html[data-land] .below { display: none; }
.land-h1 { font-size: clamp(1.6rem, 4vw, 3.1rem); margin: 0 0 .25em; }
.land .land-lead { max-width: 34em; margin: 0 auto .9em; }
.land .land-go { display: block; width: min(360px, 100%); min-height: 60px; margin: 0 auto; padding: 8px 18px; font-size: 1.35rem; font-weight: 700; line-height: 1.15; border-style: solid; border-width: var(--btn-prim-bw, 2px); border-radius: var(--btn-prim-radius, var(--radius-m, 10px)); text-transform: var(--btn-case, none); }
.land-alt { margin: 12px 0 0; font-size: 1rem; line-height: 1.5; color: var(--c-on-felt-soft); }
.land-alt a { color: var(--c-on-felt); font-weight: 700; text-underline-offset: 3px; display: inline-block; padding: 8px 4px; }
.land-alt .linkish { padding: 8px 4px; }
.land .start-msg { min-height: 1.3em; margin: 2px 0 0; }
@media (max-width: 719px) {
	html[data-land] .hero { --cw: clamp(32px, 11vw, 48px); }
	.land-h1 { font-size: 1.45rem; }
	.land .land-lead { margin-bottom: .6em; }
	.land .land-go { width: 100%; min-height: 52px; }
	.land-alt { margin-top: 6px; }
	/* a narrow screen: the two quiet links stand one under the other (a long first one left the dot hanging at the end of its line) */
	.land-alt > span[aria-hidden] { display: none; }
	.land-alt > a, .land-alt > .linkish { display: block; margin: 0 auto; }
}
@media (min-width: 720px) and (max-height: 899px) {
	html[data-land] .hero { --fan-off: 470px; }
	.land .land-lead { font-size: 1.15rem; margin-bottom: .6em; }
	.land .land-go { min-height: 56px; }
	.land-alt { margin-top: 6px; }
}
