/* The game against the AI (play.html) and the landing page (start.html).
   Looks: Terminal (default, green phosphor), Parchment (dark old paper, hand-made in CSS), Countryside (light paper).
   Rules of the house: one focus per screen, little text, no glows, glass or marquees; anything clickable looks like
   a button; things move instead of jumping. */
:root {
	--bg: #03100a;
	--bg2: #06180d;
	--panel: #082011;
	--panel-hi: #0c2b17;
	--line: #1e5c33;
	--line-soft: #123a20;
	--grid: rgb(65 255 122 / 0.05);
	--g: #41ff7a;
	--g-hi: #b8ffcf;
	--g-dim: #2c9f53;
	--ink: #02130a;
	--text: #c8f6d4;
	--muted: #79b48b;
	--faint: #447a55;
	--amber: #ffb547;
	--amber-dim: #6b4a17;
	--red: #ff6a52;
	--cyan: #6cd8ff;
	--head: VT323, monospace;
	--body: 'Space Mono', monospace;
	/* one set of corners for everything; a card keeps a real card's corner (3 mm on 63 mm = 4.75 % of its width) */
	--r-xs: 6px;
	--r-sm: 9px;
	--r: 12px;
	--r-lg: 16px;
	--r-xl: 22px;
	--r-pill: 999px;
	--card-r: 4.75% / 3.4%;
	--shadow: 0 10px 30px rgb(0 0 0 / 0.55);
	--ease: cubic-bezier(0.2, 0.8, 0.2, 1);
	--side: 360px;
}
* {
	box-sizing: border-box;
}
html,
body {
	margin: 0;
	height: 100%;
}
body {
	background: radial-gradient(ellipse at 50% 40%, var(--bg2), var(--bg) 75%);
	color: var(--text);
	font: 15px/1.45 var(--body);
	-webkit-font-smoothing: antialiased;
	color-scheme: dark;
	overflow: hidden;
}
body.theme-terminal::after {
	/* faint scanlines on the screen; cards and dialogs sit above them */
	content: '';
	position: fixed;
	inset: 0;
	pointer-events: none;
	background: repeating-linear-gradient(0deg, rgb(0 0 0 / 0.14) 0 1px, transparent 1px 3px);
	z-index: 50;
}
[hidden] {
	display: none !important;
}
button,
select,
input,
textarea,
.button {
	font: inherit;
	color: inherit;
}
button,
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	cursor: pointer;
	background: var(--panel-hi);
	border: 1px solid var(--line);
	border-radius: var(--r);
	padding: 7px 14px;
	text-decoration: none;
	line-height: 1.2;
	min-width: 0;
	transition: background 0.15s, border-color 0.15s, color 0.15s, translate 0.15s;
}
button:hover,
.button:hover {
	border-color: var(--g-dim);
	background: var(--panel);
}
button:active,
.button:active {
	translate: 0 1px;
}
button:focus-visible,
.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--g-hi);
	outline-offset: 2px;
}
button:disabled {
	opacity: 0.45;
	cursor: default;
	translate: none;
}
button.primary,
.button.primary {
	background: var(--g);
	color: var(--ink);
	border-color: var(--g);
	font-weight: 700;
}
button.primary:hover:not(:disabled),
.button.primary:hover {
	background: var(--g-hi);
	border-color: var(--g-hi);
}
button.ghost {
	background: transparent;
}
button.big {
	font: 30px/1 var(--head);
	letter-spacing: 0.03em;
	padding: 12px 30px;
}
button.icon {
	width: 40px;
	height: 40px;
	padding: 0;
	border-radius: 50%;
	font-size: 22px;
	line-height: 1;
}
button svg,
.button svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex: none;
}
select,
input,
textarea {
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--r);
	padding: 7px 10px;
	min-width: 0;
}
small {
	display: block;
	font-size: 11px;
	letter-spacing: 0.08em;
	color: var(--muted);
}
.muted {
	color: var(--muted);
}
.small {
	font-size: 12px;
}
kbd {
	margin-left: 4px;
	padding: 1px 5px;
	border: 1px solid currentColor;
	border-radius: var(--r-xs);
	font: 11px/1 var(--body);
	opacity: 0.55;
}
.pip {
	display: inline-grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	font: 700 11px/1 var(--body);
	font-style: normal;
	color: #111;
	border: 1px solid rgb(0 0 0 / 0.35);
}
.mW { background: #f4ecd2; }
.mU { background: #7cc3f0; }
.mB { background: #9b8f99; }
.mR { background: #f08a6a; }
.mG { background: #7fd08a; }
.mC { background: #c9c3bb; }
.pips {
	display: inline-flex;
	gap: 4px;
}
.sym {
	display: inline-block;
	min-width: 18px;
	padding: 0 4px;
	border-radius: var(--r);
	border: 1px solid var(--line);
	background: var(--panel-hi);
	font: 700 11px/16px var(--body);
	font-style: normal;
	text-align: center;
	color: var(--g-hi);
}

/* ================= the lobby ================= */
.lobby {
	height: 100vh;
	overflow: auto;
	padding: 0 24px 40px;
}
.lb-top {
	position: sticky;
	top: 0;
	z-index: 58;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 16px;
	max-width: 1240px;
	margin: 0 auto;
	padding: 16px 0 12px;
	background: linear-gradient(var(--bg) 70%, transparent);
}
.lb-top .back {
	justify-self: start;
	color: var(--muted);
	text-decoration: none;
	padding: 6px 12px;
	border: 1px solid var(--line-soft);
	border-radius: var(--r-xl);
}
.lb-top .back {
	white-space: nowrap;
}
.lb-top .back::before {
	content: '‹ ';
}
.lb-top .back:hover {
	color: var(--text);
	border-color: var(--line);
}
.lb-top .icon {
	justify-self: end;
}
.steps {
	display: flex;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.steps li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 14px 5px 6px;
	border-radius: var(--r-xl);
	color: var(--faint);
	white-space: nowrap;
	transition: color 0.3s, background 0.3s;
}
.steps li i {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 1px solid currentColor;
	font: 700 12px/1 var(--body);
	font-style: normal;
}
.steps li.on {
	color: var(--ink);
	background: var(--g);
}
.steps li.done {
	color: var(--g-dim);
}
.step {
	max-width: 1240px;
	margin: 0 auto;
	animation: rise 0.45s var(--ease);
}
@keyframes rise {
	from { opacity: 0; translate: 0 18px; }
}
.slots {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	gap: 18px;
	align-items: start;
	margin-top: 8px;
}
.vs {
	align-self: center;
	font: 44px/1 var(--head);
	color: var(--faint);
	letter-spacing: 0.1em;
}
.seat {
	display: grid;
	grid-template-columns: minmax(150px, 0.82fr) minmax(0, 1.18fr);
	grid-template-rows: auto auto auto auto 1fr;
	grid-template-areas: 'head head' 'hero deck' 'hero cmdr' 'hero cam' 'hero ready';
	align-items: start;
	gap: 12px 16px;
	padding: 18px;
	border: 1px solid var(--line-soft);
	border-radius: var(--r-lg);
	background: var(--panel);
	transition: border-color 0.3s;
	min-width: 0;
}
.seat.is-ready {
	border-color: var(--g-dim);
}
.seat.ai {
	--accent: var(--amber);
}
.seat header {
	display: grid;
	gap: 4px;
}
.seat .pname {
	font: 34px/1.05 var(--head);
	color: var(--accent, var(--g));
	background: none;
	border: 0;
	border-bottom: 1px dashed var(--line);
	border-radius: 0;
	padding: 0 0 2px;
	width: 100%;
}
.seat b.pname {
	border: 0;
}
.seat header { grid-area: head; }
.seat .cmdr-big { grid-area: hero; }
.seat .deckpick { grid-area: deck; }
.seat .cmdr { grid-area: cmdr; }
.seat .cam,
.seat .sees { grid-area: cam; }
.seat .ready { grid-area: ready; align-self: end; }
.cmdr-big {
	display: flex;
	justify-content: center;
	position: relative;
}
.cmdr-big img {
	width: 100%;
	max-height: 56vh;
	aspect-ratio: 63 / 88;
	object-fit: cover;
	border-radius: var(--card-r);
	box-shadow: var(--shadow);
	animation: rise 0.5s var(--ease);
}
.cmdr-big:has(img + img) img {
	width: 78%;
}
.cmdr-big img + img {
	margin-left: -56%;
	rotate: 5deg;
	translate: 0 12px;
}
.cmdr-big.empty {
	align-items: center;
	aspect-ratio: 63 / 88;
	border: 2px dashed var(--line-soft);
	border-radius: var(--r-lg);
	color: var(--faint);
}
.deckpick {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr) auto;
	gap: 14px;
	justify-content: stretch;
	text-align: left;
	padding: 8px 14px 8px 8px;
	border-radius: var(--r);
}
.deckpick .art {
	width: 64px;
	height: 64px;
	border-radius: var(--r);
	overflow: hidden;
	background: var(--bg);
	display: grid;
	place-items: center;
}
.deckpick .art img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 22%;
	transform: scale(1.9);
	transform-origin: 50% 20%;
}
.deckpick .art img.crop {
	transform: none;
	object-position: 50% 30%;
}
.deckpick .noart {
	font-size: 10px;
	color: var(--faint);
	text-align: center;
	padding: 4px;
}
.deckpick .dinfo {
	display: grid;
	gap: 2px;
	min-width: 0;
}
.deckpick b {
	font: 24px/1.05 var(--head);
	overflow-wrap: anywhere;
}
.deckpick em {
	font-style: normal;
	padding: 6px 12px;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	font-size: 13px;
	white-space: nowrap;
}
.deckpick:hover em {
	background: var(--g);
	color: var(--ink);
	border-color: var(--g);
}
.cmdr {
	display: grid;
	gap: 6px;
}
.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.chip {
	padding: 3px 10px 3px 3px;
	border-radius: var(--r-xl);
	font-size: 13px;
	max-width: 100%;
}
.chip img {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	object-fit: cover;
	object-position: 50% 18%;
}
.chip span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.chip.on {
	background: var(--g);
	color: var(--ink);
	border-color: var(--g);
}
.own {
	display: flex;
	gap: 6px;
}
.own input {
	flex: 1;
}
.cam {
	display: grid;
	gap: 6px;
}
.cam-slot {
	aspect-ratio: 16 / 10;
	max-height: 26vh;
	width: 100%;
	border-radius: var(--r);
	background: var(--bg);
	border: 1px solid var(--line-soft);
}
.cam p {
	margin: 0;
	font-size: 12px;
}
.sees {
	margin: 0;
	padding: 10px 12px;
	border-left: 3px solid var(--accent, var(--g));
	background: var(--bg);
	font-size: 14px;
}
.ready {
	justify-self: stretch;
	padding: 12px;
	font: 26px/1 var(--head);
	letter-spacing: 0.04em;
	border-width: 2px;
}
.ready.on {
	background: var(--g);
	color: var(--ink);
	border-color: var(--g);
}
.ready.on::before {
	content: '✓ ';
}
.ready.static {
	display: grid;
	place-items: center;
	border-radius: var(--r);
	border: 2px solid var(--line);
	background: transparent;
	color: var(--accent, var(--g));
	cursor: default;
}
.seat.ai .ready.on.static {
	background: transparent;
	color: var(--amber);
	border-color: var(--amber-dim);
}
.lb-go {
	position: sticky;
	bottom: 0;
	z-index: 58;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin-top: 18px;
	padding: 14px 0 6px;
	background: linear-gradient(transparent, var(--bg) 35%);
}
.lb-go .primary {
	margin-left: auto;
}
.switch {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
}
.switch input {
	appearance: none;
	width: 46px;
	height: 26px;
	border-radius: var(--r-lg);
	background: var(--line-soft);
	border: 1px solid var(--line);
	position: relative;
	cursor: pointer;
	transition: background 0.2s;
	flex: none;
	padding: 0;
}
.switch input::after {
	content: '';
	position: absolute;
	left: 3px;
	top: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--text);
	transition: translate 0.2s var(--ease);
}
.switch input:checked {
	background: var(--g-dim);
}
.switch input:checked::after {
	translate: 20px 0;
	background: var(--g-hi);
}
.switch b {
	font-weight: 400;
}
/* step 2: the dice for who starts */
#stRoll,
#stHand {
	display: grid;
	justify-items: center;
	gap: 18px;
	padding-top: 6vh;
	text-align: center;
}
#stRoll h2,
#stHand h2 {
	margin: 0;
	font: 64px/1 var(--head);
	color: var(--g);
}
.lead {
	max-width: 60ch;
	margin: 0;
	color: var(--muted);
	font-size: 16px;
}
.rolls {
	display: flex;
	align-items: center;
	gap: 40px;
	margin: 20px 0 6px;
}
.roller {
	display: grid;
	justify-items: center;
	gap: 12px;
	transition: scale 0.4s var(--ease), opacity 0.4s;
}
.roller small {
	font-size: 15px;
	color: var(--text);
}
.roller.ai .die {
	background: var(--amber);
}
.rolls:has(.won) .roller:not(.won) {
	opacity: 0.45;
	scale: 0.9;
}
.roller.won {
	scale: 1.06;
}
.verdict {
	min-height: 1.5em;
	margin: 0;
	font: 30px/1.2 var(--head);
	color: var(--g-hi);
}
.btns {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}
/* step 3: the opening hand */
.fan {
	position: relative;
	height: 270px;
	width: min(640px, 92vw);
	margin: 12px 0;
}
.hb {
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 132px;
	aspect-ratio: 63 / 88;
	margin-left: -66px;
	border-radius: var(--r-sm);
	background: url(/img/back.jpg) center / cover;
	box-shadow: 0 8px 20px rgb(0 0 0 / 0.55);
	transform-origin: 50% 300%;
	rotate: calc((var(--k) - 3) * 6.5deg);
	animation: dealt 0.5s var(--ease) both;
	animation-delay: calc(var(--k) * 70ms);
	transition: translate 0.4s var(--ease), filter 0.4s;
}
.hb.bottom {
	translate: 0 46px;
	filter: brightness(0.45) saturate(0.4);
}
.fan.again .hb {
	animation-name: dealt-again;
}
@keyframes dealt {
	from { opacity: 0; translate: 0 -160px; rotate: 0deg; }
}
@keyframes dealt-again {
	from { opacity: 0; translate: 0 -120px; rotate: 0deg; }
}
.opp {
	margin: 0;
	color: var(--amber);
}

/* ================= sheets and dialogs ================= */
.sheet {
	position: fixed;
	inset: 0;
	z-index: 70;
	display: grid;
	place-items: center;
	background: rgb(1 8 4 / 0.82);
	animation: fade 0.2s ease-out;
}
@keyframes fade {
	from { opacity: 0; }
}
.dialog {
	position: relative;
	display: grid;
	gap: 14px;
	width: min(560px, calc(100vw - 32px));
	max-height: calc(100vh - 32px);
	overflow: auto;
	padding: 26px 26px 22px;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: var(--panel);
	box-shadow: var(--shadow);
	animation: pop 0.28s var(--ease);
}
@keyframes pop {
	from { opacity: 0; scale: 0.96; translate: 0 10px; }
}
.dialog h2 {
	margin: 0;
	font: 46px/1 var(--head);
	color: var(--g);
}
.dialog h3 {
	margin: 0;
	font: 32px/1 var(--head);
	color: var(--g);
}
.dialog .close {
	position: absolute;
	right: 14px;
	top: 14px;
}
.dialog .btns {
	justify-content: flex-end;
}
.dialog textarea {
	width: 100%;
	resize: vertical;
	font: 15px/1.5 var(--body);
}

/* the deck picker: the decks as small tiles in a grid, newest year first, the one in focus large on the side */
.pk {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr);
	gap: 16px;
	width: 100vw;
	height: 100vh;
	padding: 18px 24px 20px;
	background: var(--bg);
}
.pk-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}
.pk-top h2 {
	margin: 0 auto 0 0;
	font: 44px/1 var(--head);
	color: var(--g);
}
.pk-top input[type='search'] {
	width: min(310px, 100%);
	padding: 9px 14px;
	border-radius: var(--r-xl);
}
.pk-top select {
	border-radius: var(--r-xl);
	padding: 9px 14px;
	max-width: 190px;
}
.pk-colors {
	display: flex;
	gap: 6px;
}
.pk-colors .pip {
	width: 32px;
	height: 32px;
	padding: 0;
	font-size: 13px;
	opacity: 0.45;
	border-width: 2px;
	transition: opacity 0.15s, translate 0.15s;
}
.pk-colors .pip:hover {
	opacity: 0.8;
}
.pk-colors .pip.on {
	opacity: 1;
	border-color: var(--text);
	translate: 0 -2px;
}
.pk-n {
	color: var(--muted);
	font-size: 12px;
	white-space: nowrap;
}
.pk-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) clamp(250px, 25vw, 360px);
	gap: 24px;
	min-height: 0;
}
.pk-grid {
	min-height: 0;
	overflow: auto;
	padding: 0 8px 28px 2px;
	scrollbar-gutter: stable;
}
.pk-year + .pk-year {
	margin-top: 22px;
}
/* the year stays at the top while its decks scroll under it */
.pk-year h3 {
	position: sticky;
	top: 0;
	z-index: 2;
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin: 0 0 10px;
	padding: 6px 2px 8px;
	background: var(--bg);
	border-bottom: 1px solid var(--line-soft);
	border-radius: var(--r-xs);
	font: 400 30px/1 var(--head);
	color: var(--g);
}
.pk-year h3 small {
	font-size: 12px;
	color: var(--muted);
}
.pk-none {
	color: var(--muted);
	font: 30px/1.1 var(--head);
	padding: 40px 0;
	text-align: center;
}
.pk-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
}
.pk-tile {
	display: grid;
	align-content: start;
	justify-items: start;
	gap: 6px;
	padding: 6px 6px 10px;
	border: 1px solid var(--line-soft);
	border-radius: var(--r);
	background: var(--panel);
	text-align: left;
	color: inherit;
	scroll-margin: 56px 0 12px; /* brought into view below the sticky year */
	transition: translate 0.2s var(--ease), border-color 0.2s, background-color 0.2s;
}
.pk-tile:hover {
	translate: 0 -3px;
	border-color: var(--line);
	background: var(--panel-hi);
}
/* the chosen deck: a green frame and its name brighter */
.pk-tile.on {
	border-color: var(--g);
	outline: 2px solid var(--g);
	outline-offset: -1px;
	background: var(--panel-hi);
}
.pk-art {
	display: flex;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--r-sm);
	background: var(--bg2);
}
.pk-art img {
	flex: 1 1 0;
	min-width: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: scale 0.4s var(--ease);
}
.pk-art.two img + img {
	border-left: 2px solid var(--panel);
}
/* a whole card where there is no art crop: its picture's part fills the window */
.pk-art img.card {
	object-position: 50% 23%;
	scale: 1.45;
}
.pk-tile:hover .pk-art img {
	scale: 1.05;
}
.pk-tile:hover .pk-art img.card {
	scale: 1.52;
}
.pk-art .noart {
	display: grid;
	place-items: center;
	width: 100%;
	font: 56px/1 var(--head);
	font-style: normal;
	color: var(--faint);
}
.pk-tile b {
	font: 400 20px/1.05 var(--head);
	color: var(--text);
	overflow-wrap: anywhere;
}
.pk-tile.on b {
	color: var(--g-hi);
}
.pk-tile small {
	font-size: 11px;
	letter-spacing: 0.04em;
	color: var(--muted);
}
.pk-tile .pips,
.pk-about .pips {
	display: flex;
	gap: 3px;
}
.pk-tile .pip {
	width: 15px;
	height: 15px;
	font-size: 0;
	border-width: 1px;
}
/* the tiles come in once, a few at a time, as the picker opens */
.pk-grid.enter .pk-tile {
	animation: pk-in 0.45s var(--ease) both;
	animation-delay: calc(var(--i) * 16ms);
}
/* the side: the deck in focus as a large card, its name, a line about it, the buttons */
.pk-side {
	display: grid;
	grid-template-rows: minmax(0, 1fr) auto auto;
	gap: 14px;
	min-height: 0;
}
.pk-big {
	display: flex;
	justify-content: center;
	align-items: flex-end;
	gap: 8px;
	min-height: 0;
}
.pk-big img {
	height: 100%;
	max-height: 520px;
	max-width: 100%;
	aspect-ratio: 63 / 88;
	object-fit: contain;
	border-radius: var(--card-r);
	box-shadow: var(--shadow);
	animation: pk-pop 0.28s var(--ease);
}
.pk-big.two img {
	max-width: calc(50% - 4px);
	height: auto;
}
@keyframes pk-pop {
	from { opacity: 0; scale: 0.96; }
}
.pk-about {
	display: grid;
	gap: 5px;
	min-width: 0;
}
.pk-about b {
	font: 400 32px/1.05 var(--head);
	color: var(--g-hi);
	overflow-wrap: anywhere;
}
.pk-about .pip {
	width: 20px;
	height: 20px;
	font-size: 0;
}
.pk-about small {
	color: var(--muted);
	font-size: 12px;
}
.pk-about p {
	margin: 2px 0 0;
	font-size: 14px;
	line-height: 1.45;
}
.pk-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.pk-actions .ghost {
	flex: 1 1 auto;
}
.pk-actions .primary {
	flex: 1 1 100%;
	font: 28px/1 var(--head);
	padding: 12px 24px;
}
/* step 2: the deck's commanders side by side, the chosen one framed and ticked */
.pk-cmdr {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	gap: 18px;
	min-height: 0;
	padding-top: 8px;
}
.pk-cmdr header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
}
.pk-cmdr .back::before {
	content: '‹ ';
}
.pk-cmdr h3 {
	margin: 0;
	font: 400 34px/1.05 var(--head);
	color: var(--g-hi);
}
.pk-two {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-content: center;
	gap: clamp(14px, 3vw, 40px);
	min-height: 0;
	overflow: auto;
}
.pk-c {
	display: grid;
	justify-items: center;
	align-content: start;
	gap: 8px;
	padding: 12px;
	border: 2px solid transparent;
	border-radius: var(--r-xl);
	background: none;
	animation: pk-in 0.45s var(--ease) both;
	animation-delay: calc(var(--k) * 90ms);
	transition: translate 0.2s var(--ease), border-color 0.2s, background-color 0.2s;
}
.pk-c:hover {
	translate: 0 -3px;
	background: var(--panel);
}
.pk-c.on {
	border-color: var(--g);
	background: var(--panel);
}
.pk-c .cards {
	position: relative;
	display: flex;
	gap: 8px;
}
.pk-c img {
	height: min(38vh, 330px);
	aspect-ratio: 63 / 88;
	border-radius: var(--card-r);
	box-shadow: var(--shadow);
	object-fit: cover;
}
.pk-c .cards:has(img + img) img {
	height: min(30vh, 250px);
}
.pk-c .tick {
	position: absolute;
	right: -10px;
	top: -10px;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border: 3px solid var(--ink);
	border-radius: 50%;
	background: var(--g);
	color: var(--ink);
	font: 700 20px/1 var(--body);
	font-style: normal;
	opacity: 0;
	scale: 0.6;
	transition: opacity 0.2s, scale 0.25s var(--ease);
}
.pk-c.on .tick {
	opacity: 1;
	scale: 1;
}
.pk-c b {
	font: 400 26px/1.05 var(--head);
	color: var(--text);
	text-align: center;
	max-width: 32ch;
}
.pk-c.on b {
	color: var(--g-hi);
}
.pk-c small {
	color: var(--muted);
}
.pk-cfoot {
	display: flex;
	justify-content: center;
}
.pk-cfoot .primary {
	font: 28px/1 var(--head);
	padding: 12px 40px;
}
@keyframes pk-in {
	from { opacity: 0; translate: 0 30px; }
}
/* narrow windows: the side becomes a bar under the grid (small card, name, buttons), the tiles get smaller */
@media (max-width: 900px) {
	.pk {
		padding: 12px;
		gap: 10px;
	}
	.pk-body {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: minmax(0, 1fr) auto;
		gap: 10px;
	}
	.pk-tiles {
		grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
		gap: 8px;
	}
	.pk-tile b {
		font-size: 17px;
	}
	/* the title and the close button on one line, the search, set, colours and count on the next */
	.pk-top .close {
		order: -1;
		margin-left: auto;
	}
	.pk-top h2 {
		order: -2;
		flex: 1 1 calc(100% - 64px);
	}
	.pk-top input[type='search'] {
		flex: 1 1 160px;
		width: auto;
	}
	.pk-top select {
		max-width: 170px;
	}
	.pk-side {
		grid-template-columns: auto minmax(0, 1fr);
		grid-template-areas: 'big about' 'big actions';
		align-items: center;
		gap: 6px 12px;
		padding: 10px;
		border: 1px solid var(--line);
		border-radius: var(--r-lg);
		background: var(--panel);
	}
	.pk-big {
		grid-area: big;
	}
	.pk-about {
		grid-area: about;
		grid-template-columns: auto auto minmax(0, 1fr);
		align-items: center;
		gap: 4px 10px;
	}
	.pk-about b {
		grid-column: 1 / -1;
		font-size: 24px;
	}
	.pk-big img {
		height: 104px;
	}
	.pk-big.two img {
		height: 104px;
		max-width: none;
	}
	.pk-about p {
		display: none;
	}
	.pk-actions {
		grid-area: actions;
	}
	.pk-actions .ghost {
		flex: 0 1 auto;
		padding: 8px 12px;
	}
	.pk-actions .primary {
		flex: 1 1 150px;
		font-size: 22px;
		padding: 9px 16px;
	}
	.pk-c img {
		height: min(34vh, 260px);
	}
}
@media (max-width: 600px) {
	.pk-two {
		flex-direction: column;
		flex-wrap: nowrap;
		justify-content: start;
		align-items: center;
	}
}

/* ================= cover flow ================= */
.cf {
	position: relative;
	height: 100%;
	min-height: 200px;
	overflow: hidden;
	perspective: 1300px;
	cursor: grab;
	outline: none;
	touch-action: pan-y;
	user-select: none;
}
.cf:active {
	cursor: grabbing;
}
.cf-stage {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
}
.cf-item {
	position: absolute;
	left: 50%;
	top: var(--cy, 50%);
	width: var(--cw);
	aspect-ratio: 63 / 88;
	transition: transform 0.55s var(--ease), opacity 0.3s;
	will-change: transform;
}
.cf-stage.live .cf-item {
	transition: none;
}
.cf-item img,
.cf-item .tk {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: var(--card-r);
	box-shadow: 0 14px 30px rgb(0 0 0 / 0.6);
	pointer-events: none;
}
.cf-item:not(.on) img {
	filter: brightness(0.62);
}
.cf-item .tk {
	display: grid;
	place-items: center;
	padding: 12px;
	text-align: center;
	background: repeating-linear-gradient(45deg, var(--panel) 0 8px, var(--panel-hi) 8px 16px);
	font: 30px/1 var(--head);
	color: var(--g-hi);
	border: 1px solid var(--line);
}
.cf-item.on {
	cursor: pointer;
}
/* choosing cards: every card in the row can be clicked */
.cf-pick .cf-item {
	cursor: pointer;
}
/* a chosen card: a green ring around it and the tick in its corner, bright even on the side of the row */
.cf-item:has(> .picked) img,
.cf-item:has(> .picked) .tk {
	outline: 4px solid var(--g);
	outline-offset: 3px;
	filter: none;
}
.picked {
	position: absolute;
	right: -10px;
	top: -10px;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--g);
	color: var(--ink);
	font: 700 24px/1 var(--body);
	font-style: normal;
	border: 3px solid var(--ink);
}
.fl {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	width: 100vw;
	height: 100vh;
	padding: 18px 24px 24px;
}
.fl header {
	display: flex;
	align-items: center;
	gap: 16px;
}
/* the words and buttons grow with a tall window, like the cards do (a big screen read from a distance) */
.fl h2 {
	margin: 0;
	font: clamp(32px, 4.2vh, 60px)/1 var(--head);
	color: var(--g);
}
.fl header p {
	margin: 0;
	font-size: 13px;
}
.fl header > * {
	min-width: 0;
	overflow-wrap: anywhere;
}
.fl header .close {
	flex: none;
	margin-left: auto;
}
.fl-host {
	min-height: 0;
}
.fl-empty {
	display: grid;
	place-items: center;
	height: 100%;
	color: var(--muted);
	font: clamp(30px, 3.6vh, 52px)/1.1 var(--head);
	text-align: center;
}
.fl-info {
	display: grid;
	justify-items: center;
	gap: 4px;
	text-align: center;
}
.fl-info b {
	font: clamp(30px, 3.8vh, 56px)/1 var(--head);
	color: var(--g-hi);
}
.fl-info small {
	font-size: clamp(11px, 1.25vh, 18px);
}
.fl-info .btns {
	margin-top: 6px;
	gap: 12px;
}
/* Detail, Choose, Confirm and a card's abilities: big, easy to read and hit */
.fl-info .btns button {
	padding: 0.3em 1.1em;
	font: clamp(24px, 2.7vh, 40px)/1.1 var(--head);
	letter-spacing: 0.02em;
	border-radius: var(--r-lg);
}
.fl-info button.on {
	background: var(--g-dim);
	color: var(--ink);
}

/* ================= the game: the table between two bars, the side panel on the right ================= */
#game {
	position: fixed;
	inset: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--side);
}
#board {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	min-width: 0;
	min-height: 0;
}
.bar {
	position: relative;
	z-index: 55;
	display: flex;
	align-items: stretch;
	gap: 14px;
	padding: 6px 14px;
	background: var(--panel);
	min-width: 0;
}
.bar.top {
	border-bottom: 1px solid var(--line);
	align-items: center;
}
.bar.bottom {
	border-top: 1px solid var(--line);
}
/* the players' HUDs */
.hud {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: none;
	min-width: 0;
}
.hud.ai {
	--accent: var(--amber);
}
.hud.me {
	--accent: var(--g);
}
.hud .who {
	min-width: 0;
	max-width: 200px;
	margin-right: 4px;
}
.hud .who b {
	display: block;
	font: 28px/1 var(--head);
	color: var(--accent);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.life {
	position: relative;
	display: grid;
	justify-items: center;
	gap: 0;
	min-width: 88px;
	padding: 3px 14px 5px;
	border: 2px solid var(--accent);
	border-radius: var(--r);
	background: var(--bg);
	color: inherit;
}
.life small {
	font-size: 12px;
}
.life b {
	font: 52px/0.9 var(--head);
	color: var(--accent);
}
.life.can {
	outline: 2px dashed var(--g-hi);
	outline-offset: 3px;
	cursor: crosshair;
}
.life.hit {
	animation: shake 0.45s;
	border-color: var(--red);
}
.life.heal {
	border-color: var(--g-hi);
}
.stats {
	display: flex;
	gap: 7px;
	min-width: 0;
}
.stat {
	display: grid;
	justify-items: center;
	align-content: center;
	min-width: 68px;
	padding: 4px 10px;
	border: 1px solid var(--line-soft);
	border-radius: var(--r);
	background: var(--bg);
}
.stat small {
	font-size: 12px;
	letter-spacing: 0.05em;
	white-space: nowrap;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}
.stat b {
	font: 31px/1 var(--head);
}
.stat b i {
	font-style: normal;
	color: var(--faint);
	font-size: 0.7em;
}
.stat.hand {
	position: relative;
}
.backs {
	display: flex;
	gap: 1px;
	position: absolute;
	left: 50%;
	top: -6px;
	translate: -50% -100%;
	pointer-events: none;
}
.backs i {
	width: 8px;
	height: 12px;
	border-radius: 2px;
	border: 1px solid var(--amber-dim);
	background: repeating-linear-gradient(45deg, var(--panel-hi) 0 2px, var(--amber-dim) 2px 4px);
}
.backs.drew i:last-child {
	animation: drew 0.7s var(--ease);
}
@keyframes drew {
	from { translate: 0 -20px; opacity: 0; rotate: -20deg; }
}
.fixbtn {
	padding: 6px 12px;
	font-size: 14px;
	border-style: dashed;
	white-space: nowrap;
	color: var(--muted);
}
.fixbtn::before {
	content: '✎';
	font-size: 16px;
}
.float {
	position: absolute;
	right: 4px;
	top: -8px;
	font: 46px/1 var(--head);
	font-style: normal;
	pointer-events: none;
	animation: floatup 1.4s ease-out forwards;
	z-index: 3;
}
.float.down { color: var(--red); }
.float.up { color: var(--g-hi); }
@keyframes floatup {
	from { opacity: 1; translate: 0 10px; }
	to { opacity: 0; translate: 0 -40px; }
}
@keyframes shake {
	20%, 60% { translate: -5px 0; }
	40%, 80% { translate: 5px 0; }
}
/* the turn track */
.track {
	display: flex;
	align-items: center;
	gap: 3px;
	margin: 0 0 0 auto;
	padding: 0;
	list-style: none;
	font-size: 12px;
	color: var(--faint);
	min-width: 0;
	flex-wrap: wrap;
	justify-content: flex-end;
}
.track li {
	padding: 4px 9px;
	font: 13.5px/1.3 var(--body);
	border-radius: var(--r-lg);
	border: 1px solid var(--line-soft);
	white-space: nowrap;
	cursor: help;
}
.track li.done {
	color: var(--muted);
	border-color: var(--line);
}
.track li.on {
	color: var(--ink);
	background: var(--tc);
	border-color: var(--tc);
	font-weight: 700;
}
.track.me { --tc: var(--g); }
.track.ai { --tc: var(--amber); }
.track li.turn {
	border: 0;
	padding: 0 8px 0 0;
	font: 26px/1.1 var(--head);
	color: var(--tc);
	cursor: default;
}
.track li.on.fresh {
	animation: phase-in 0.6s var(--ease);
}
@keyframes phase-in {
	40% { scale: 1.14; }
}
/* the dock: what the game says, and the main button */
.dock {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
}
.voice {
	flex: 1;
	display: flex;
	gap: 12px;
	align-items: center;
	min-width: 0;
}
.voice img {
	height: 80px;
	border-radius: var(--r-sm);
	cursor: zoom-in;
	position: relative;
	z-index: 51;
}
.voice p {
	margin: 0;
	font-size: 18px;
	line-height: 1.35;
}
.voice .why {
	margin-top: 2px;
	font-size: 14.5px;
	color: var(--muted);
}
.voice.ai small {
	color: var(--amber);
}
.voice.note,
.voice.bad {
	padding-left: 10px;
	border-left: 3px solid var(--amber);
	animation: notein 0.35s var(--ease);
}
.voice.bad {
	border-color: var(--red);
}
.voice.bad small {
	color: var(--red);
}
@keyframes notein {
	from { opacity: 0; translate: 0 12px; }
}
.act {
	display: grid;
	justify-items: end;
	gap: 6px;
	max-width: 54%;
	min-width: 0;
}
/* the game waits for you: a frame around the action with a word on its edge (no layout change, so the table stays put),
   its edge slowly brightening and dimming; after a while without input the main button nudges (play.js yoursTick) */
#dock .act {
	position: relative;
}
#dock.yours .act::before {
	content: '';
	position: absolute;
	inset: -6px -8px;
	border: 2px solid var(--g-dim);
	border-radius: var(--r-lg);
	pointer-events: none;
	animation: yours 1.6s ease-in-out infinite alternate;
}
#dock.yours .act::after {
	content: attr(data-yours);
	position: absolute;
	left: 4px;
	top: -14px;
	padding: 0 6px;
	background: var(--panel);
	font: 700 11px/16px var(--body);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--g);
	pointer-events: none;
	white-space: nowrap;
}
@keyframes yours {
	from { border-color: var(--g-dim); }
	to { border-color: var(--g); }
}
#dock.nudge .act .primary {
	animation: nudge 0.85s var(--ease) 2;
}
@keyframes nudge {
	45% { scale: 1.06; }
}
/* reduced animations: the frame stands still and bright; the nudge is a brighter frame instead of a movement */
html.reduced #dock.yours .act::before {
	animation: none;
	border-color: var(--g);
}
html.reduced #dock.nudge .act::before {
	border-color: var(--g-hi);
	border-width: 3px;
}
html.reduced #dock.nudge .act::after {
	color: var(--g-hi);
}
.act .ask {
	margin: 0;
	text-align: right;
	color: var(--g-hi);
	font-size: 16px;
}
.act .btns {
	justify-content: flex-end;
}
.act .primary {
	font: 32px/1 var(--head);
	padding: 12px 28px;
	letter-spacing: 0.03em;
	position: relative;
	overflow: hidden;
	isolation: isolate;
}
/* the phase timer: the spent time darkens the button from the right, under its text, so the bright part is the time
   left (a thin strip got lost in the scanlines) */
.act .primary.timed::after {
	content: '';
	position: absolute;
	inset: 0 0 0 100%;
	z-index: -1;
	background: rgb(0 0 0 / 0.42);
	border-left: 3px solid var(--ink);
	animation: timer var(--left) linear forwards;
	animation-delay: var(--gone);
}
@keyframes timer {
	from { left: 100%; }
	to { left: 0; }
}
.act .opts {
	display: grid;
	gap: 6px;
	width: 100%;
}
.act .opt {
	justify-content: flex-start;
	text-align: left;
	font-size: 14px;
	border-width: 2px;
}
.act .opt.on {
	border-color: var(--g);
	box-shadow: inset 4px 0 0 var(--g);
}
.nums {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	justify-content: flex-end;
}
.nums button {
	min-width: 40px;
	font: 22px/1 var(--head);
}

/* ================= the freeform table ================= */
.table {
	position: relative;
	overflow: hidden;
	min-height: 0;
	cursor: grab;
	touch-action: none;
	--vs: 0.5;
	background-color: var(--bg);
	background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: calc(60px * var(--vs)) calc(60px * var(--vs));
	background-position: var(--vx, 0) var(--vy, 0);
}
.table.panning {
	cursor: grabbing;
}
.world {
	position: absolute;
	left: 0;
	top: 0;
	transform-origin: 0 0;
	will-change: transform;
}
.world.glide {
	transition: transform 0.5s var(--ease);
}
.it {
	position: absolute;
	left: 0;
	top: 0;
	transition: transform 0.55s var(--ease), opacity 0.3s;
}
.it.out {
	opacity: 0;
}
.it.dragging {
	transition: none;
	z-index: 999 !important;
	cursor: grabbing;
}
.it.dragging .face {
	box-shadow: 0 30px 50px rgb(0 0 0 / 0.6);
}
.it.area {
	border: 1px solid var(--line-soft);
	border-radius: 26px;
	pointer-events: none;
}
.it.area.ai {
	background: rgb(255 181 71 / 0.035);
	border-color: rgb(255 181 71 / 0.16);
}
.it.area.me {
	background: rgb(65 255 122 / 0.03);
}
.it.area span {
	position: absolute;
	right: 26px;
	font: 30px/1 var(--head);
	letter-spacing: 0.08em;
	color: var(--faint);
	text-transform: uppercase;
}
.it.area.ai span {
	top: 14px;
	color: rgb(255 181 71 / 0.4);
}
.it.area.me span {
	bottom: 14px;
}
.it.midline {
	pointer-events: none;
	background: repeating-linear-gradient(90deg, var(--line) 0 14px, transparent 14px 26px);
}
.it.label {
	pointer-events: none;
	font: 20px/1 var(--head);
	letter-spacing: 0.08em;
	color: var(--muted);
	text-transform: uppercase;
	white-space: nowrap;
}
.it.label b {
	color: var(--text);
	font-weight: 400;
}
.it.hint {
	pointer-events: none;
	display: grid;
	place-items: center;
	padding: 24px;
	border: 2px dashed var(--line-soft);
	border-radius: var(--r-xl);
	text-align: center;
	color: var(--faint);
	font-size: 20px;
}
.it.hint p {
	margin: 0;
	max-width: 22ch;
}
/* a card on the table */
.it.card,
.it.zone {
	cursor: pointer;
}
.face {
	position: absolute;
	inset: 0;
	border-radius: var(--r);
	overflow: hidden;
	background: var(--panel-hi);
	box-shadow: 0 3px 10px rgb(0 0 0 / 0.55);
	transition: filter 0.3s, box-shadow 0.2s, transform 0.5s var(--ease), opacity 0.4s;
}
.face img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	user-select: none;
	pointer-events: none;
	transition: filter 0.4s;
}
.face .tk {
	display: grid;
	place-content: center;
	gap: 6px;
	height: 100%;
	padding: 14px;
	text-align: center;
	background: repeating-linear-gradient(45deg, var(--panel) 0 10px, var(--panel-hi) 10px 20px);
	border: 2px solid var(--line);
	border-radius: var(--r);
}
.face .tk b {
	font: 34px/1 var(--head);
	color: var(--g-hi);
	font-weight: 400;
}
.face .tk small {
	font-size: 12px;
}
.it.card:hover .face,
.it.zone:hover .face {
	outline: 3px solid var(--g-hi);
	outline-offset: 2px;
}
.it.card.tapped .face img {
	filter: brightness(0.72);
}
/* readable from far away: the name and the badges keep their size when the table is zoomed out */
.badge-scale,
.face .pt,
.face .dmg,
.face .ctr,
.face .cm,
.face .gear {
	scale: clamp(1, calc(0.5 / var(--vs)), 2.4);
}
.face .nm {
	position: absolute;
	inset: 0 0 auto;
	padding: 4px 8px;
	font-size: calc(13px * clamp(1, calc(0.45 / var(--vs)), 2.6));
	line-height: 1.25;
	background: rgb(2 12 6 / 0.85);
	color: var(--g-hi);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	opacity: 0;
	transition: opacity 0.25s;
}
.table.far .face .nm {
	opacity: 1;
}
.it.land .face .nm {
	display: none;
}
.face b,
.face i {
	position: absolute;
	font-style: normal;
	border-radius: var(--r-sm);
	padding: 0 7px;
	font-size: 15px;
	line-height: 24px;
	font-weight: 700;
	z-index: 2;
}
.face .pt {
	right: 6px;
	bottom: 6px;
	font: 34px/1 var(--head);
	padding: 2px 8px;
	background: var(--ink);
	color: var(--g-hi);
	border: 1px solid var(--g-dim);
	transform-origin: 100% 100%;
}
.face .pt.up {
	background: var(--g);
	color: var(--ink);
}
.face .dmg {
	left: 6px;
	bottom: 6px;
	background: var(--red);
	color: #000;
	transform-origin: 0 100%;
}
.face .dmg::before {
	content: '−';
}
.face .ctr {
	right: 6px;
	top: 38px;
	background: var(--cyan);
	color: #000;
	transform-origin: 100% 0;
}
.face .cm {
	left: 6px;
	top: 38px;
	width: 30px;
	height: 26px;
	padding: 3px;
	background: var(--amber);
	transform-origin: 0 0;
}
.face .cm svg {
	width: 100%;
	height: 100%;
	fill: #000;
}
.face .gear {
	right: 6px;
	top: 68px;
	background: var(--g);
	color: var(--ink);
	transform-origin: 100% 0;
}
.it.card.can .face {
	outline: 3px dashed var(--g-hi);
	outline-offset: 5px;
	cursor: crosshair;
}
.it.card.att .face {
	outline: 4px solid var(--red);
	outline-offset: 3px;
}
.it.card.blk .face {
	outline: 4px solid var(--cyan);
	outline-offset: 3px;
}
.it.card.sel .face {
	outline: 4px solid var(--g-hi);
	outline-offset: 3px;
	transform: translateY(-12px);
}
.tag {
	position: absolute;
	left: 50%;
	bottom: -14px;
	translate: -50% 0;
	z-index: 3;
	max-width: 120%;
	padding: 2px 10px;
	border-radius: var(--r-sm);
	font: 700 14px/20px var(--body);
	font-style: normal;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: #000;
	scale: clamp(1, calc(0.5 / var(--vs)), 2.2);
	transform-origin: 50% 0;
}
.tag.att { background: var(--red); }
.tag.blk { background: var(--cyan); }
.tag.on { background: var(--g-dim); color: var(--ink); }
.it .float {
	right: 50%;
	top: 30%;
	translate: 50% 0;
	font-size: 70px;
	text-shadow: 0 3px 0 #000;
	animation: floatcard 0.95s ease-out forwards;
}
@keyframes floatcard {
	from { opacity: 0; translate: 50% 20px; scale: 0.6; }
	25% { opacity: 1; translate: 50% 0; scale: 1.1; }
	to { opacity: 0; translate: 50% -70px; scale: 1; }
}
/* summoning sickness: the creature dozes (a little faded, z z Z rising) until its first turn with you */
.it.card.sick .face img {
	filter: saturate(0.5) brightness(0.84);
}
.zzz {
	position: absolute;
	right: 14%;
	top: 24%;
	z-index: 3;
	width: 50px;
	height: 80px;
	pointer-events: none;
}
.zzz em {
	position: absolute;
	bottom: 0;
	left: 0;
	font: 30px/1 var(--head);
	font-style: normal;
	color: var(--cyan);
	text-shadow: 0 2px 0 #000;
	opacity: 0;
	animation: zz 2.7s ease-in infinite;
}
.zzz em:nth-child(2) { animation-delay: 0.9s; font-size: 36px; }
.zzz em:nth-child(3) { animation-delay: 1.8s; font-size: 44px; }
@keyframes zz {
	0% { opacity: 0; translate: 0 0; scale: 0.6; }
	20% { opacity: 1; }
	100% { opacity: 0; translate: 22px -60px; scale: 1.15; rotate: 12deg; }
}
/* arriving: it drops onto the table, lands with a little bounce, and a ring spreads on the felt */
.it.card.new .face {
	animation: arrive 0.75s var(--ease) both;
}
.it.card.new.land .face {
	animation: arrive-land 0.5s var(--ease) both;
}
.it.card.new::after,
.it.card.pulse::after {
	content: '';
	position: absolute;
	inset: -10px;
	border: 3px solid var(--accent, var(--g));
	border-radius: var(--r-xl);
	pointer-events: none;
	animation: ripple 0.8s ease-out 0.35s both;
}
.it.card.ai {
	--accent: var(--amber);
}
.it.card.pulse::after {
	animation-delay: 0s;
	border-style: dashed;
}
@keyframes arrive {
	0% { opacity: 0; transform: translateY(-150px) scale(1.4) rotate(-8deg); }
	55% { opacity: 1; transform: translateY(8px) scale(0.97) rotate(1deg); }
	75% { transform: translateY(-4px) scale(1.01); }
	100% { transform: none; }
}
@keyframes arrive-land {
	from { opacity: 0; transform: translateY(-40px); }
}
@keyframes ripple {
	from { opacity: 0.9; scale: 0.94; }
	to { opacity: 0; scale: 1.25; }
}
/* hits: the card shakes, a red flash, the damage floats up */
.it.card.hit .face {
	animation: shake 0.45s;
}
.it.card.hit .face::after {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--red);
	mix-blend-mode: multiply;
	animation: flash 0.75s ease-out forwards;
	z-index: 1;
}
@keyframes flash {
	from { opacity: 0.85; }
	to { opacity: 0; }
}
/* +1/+1 counters: the card swells */
.it.card.grow .face {
	animation: grow 0.7s var(--ease);
	outline: 4px solid var(--cyan);
	outline-offset: 3px;
}
@keyframes grow {
	40% { transform: scale(1.12); }
}
/* waking up: a hop when the summoning sickness is gone */
.it.card.wake .face {
	animation: wake 0.8s var(--ease);
}
@keyframes wake {
	30% { transform: translateY(-18px) scale(1.04); filter: brightness(1.4); }
	60% { transform: translateY(4px); }
}
/* combat: on the damage the attackers strike across the line */
body.clash .it.card.att.me .face {
	animation: strike-up 0.6s ease-in-out;
}
body.clash .it.card.att.ai .face {
	animation: strike-down 0.6s ease-in-out;
}
body.clash .it.card.att.free.me .face {
	animation: strike-far-up 0.7s ease-in-out;
}
body.clash .it.card.att.free.ai .face {
	animation: strike-far-down 0.7s ease-in-out;
}
@keyframes strike-far-up {
	50% { transform: translateY(-190px) scale(1.08) rotate(-2deg); }
}
@keyframes strike-far-down {
	50% { transform: translateY(190px) scale(1.08) rotate(2deg); }
}
@keyframes strike-up {
	55% { transform: translateY(-70px) scale(1.06); }
}
@keyframes strike-down {
	55% { transform: translateY(70px) scale(1.06); }
}
/* leaving: it glides to where it went and fades; a sacrifice burns away */
.it.card.leaving {
	opacity: 0;
	pointer-events: none;
	transition: transform 0.8s cubic-bezier(0.5, 0, 0.7, 0.4), opacity 0.85s ease-in;
}
.it.card.leaving .face {
	transform: scale(0.75);
	filter: grayscale(1) brightness(0.6);
}
.it.card.leaving.sac .face {
	filter: sepia(1) saturate(4) hue-rotate(-30deg) brightness(0.5);
	transform: scale(0.6) rotate(-10deg);
}
.it.card.leaving.fade .face {
	transform: scale(0.9);
}
/* the zones: library, graveyard, exile, command zone */
.it.zone .face.back img {
	filter: brightness(0.9);
}
.it.zone .face.empty {
	background: transparent;
	border: 3px dashed var(--line-soft);
	box-shadow: none;
}
.zl {
	--k: clamp(1, calc(0.5 / var(--vs)), 1.8);
	position: absolute;
	left: 50%;
	width: calc((100% + 16px) / var(--k));
	translate: -50% 0;
	top: calc(100% + 10px);
	text-align: center;
	font: 700 15px/1.2 var(--body);
	letter-spacing: 0.1em;
	color: var(--muted);
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
	scale: var(--k);
	transform-origin: 50% 0;
}
.it.zone.ai .zl {
	top: auto;
	bottom: calc(100% + 10px);
	transform-origin: 50% 100%;
}
.count {
	position: absolute;
	right: -12px;
	top: -12px;
	z-index: 3;
	min-width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	padding: 0 8px;
	border-radius: var(--r-xl);
	background: var(--ink);
	border: 2px solid var(--line);
	font: 30px/1 var(--head);
	color: var(--text);
	scale: clamp(1, calc(0.5 / var(--vs)), 2);
}
.ribbon {
	position: absolute;
	left: -6px;
	right: -6px;
	bottom: 26%;
	z-index: 3;
	padding: 6px 4px;
	text-align: center;
	font: 26px/1 var(--head);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	background: var(--amber);
	color: #000;
	border-radius: var(--r-xs);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.it.zone.cz.me .ribbon {
	background: var(--g);
}
.tax {
	position: absolute;
	left: 8px;
	top: 8px;
	z-index: 3;
	padding: 4px 10px;
	border-radius: var(--r-sm);
	background: var(--ink);
	border: 1px solid var(--amber);
	color: var(--amber);
	font: 24px/1 var(--head);
	scale: clamp(1, calc(0.5 / var(--vs)), 2);
	transform-origin: 0 0;
}
.it.zone.cz.away .face img {
	filter: grayscale(0.85) brightness(0.45);
}
.it.zone.cz.away .ribbon {
	background: var(--line);
	color: var(--text);
}
/* the zoom buttons and the guide float over the table */
.zoombar {
	position: absolute;
	right: 14px;
	bottom: 14px;
	z-index: 56;
	display: flex;
	gap: 4px;
	padding: 4px;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: var(--panel);
}
.zoombar button {
	min-width: 38px;
	height: 34px;
	padding: 0 10px;
	font-size: 15px;
	border-color: transparent;
	background: transparent;
	white-space: nowrap;
}
.zoombar button:hover {
	border-color: var(--line);
}
.zoombar .fitbtn.on {
	background: var(--g);
	color: var(--ink);
}
.guide {
	position: absolute;
	left: 14px;
	bottom: 14px;
	z-index: 56;
	display: grid;
	gap: 6px;
	width: min(520px, calc(100% - 300px));
	max-height: 46%;
	overflow: auto;
	padding: 12px 16px;
	border: 1px solid var(--g-dim);
	border-left-width: 4px;
	border-radius: var(--r);
	background: var(--panel);
	box-shadow: var(--shadow);
	animation: notein 0.35s var(--ease);
}
.guide small {
	color: var(--g);
}
.guide p {
	margin: 0;
	font-size: 15px;
}
.guide ul {
	margin: 0;
	padding-left: 18px;
	color: var(--g-hi);
	font-size: 14px;
}

/* ================= the side panel ================= */
#aside {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px;
	min-height: 0;
	min-width: 0;
	background: var(--panel);
	border-left: 1px solid var(--line);
	position: relative;
	z-index: 56;
}
#camSlotGame {
	aspect-ratio: auto;
	height: 30vh;
	min-height: 180px;
	flex: none;
}
#camHost {
	position: fixed;
	z-index: 57;
	visibility: hidden;
	border-radius: var(--r);
	overflow: hidden;
	border: 1px solid var(--line);
	background: var(--bg);
	transition: left 0.45s var(--ease), top 0.45s var(--ease), width 0.45s var(--ease), height 0.45s var(--ease);
}
#camHost iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}
.scan {
	flex-direction: column;
	gap: 2px;
	padding: 10px 10px 8px;
	background: var(--g);
	color: var(--ink);
	border: 0;
	font: 34px/1 var(--head);
	letter-spacing: 0.05em;
}
.scan small {
	color: var(--ink);
	opacity: 0.7;
}
.scan:hover {
	background: var(--g-hi) !important;
}
#byName {
	font-size: 13px;
}
#status {
	margin: 0;
	min-height: 1.4em;
	font-size: 13px;
	color: var(--g-hi);
}
#status.bad {
	color: var(--amber);
}
/* what the scanner read, waiting for Play */
.scan-result {
	display: flex;
	gap: 10px;
	padding: 8px;
	border: 1px solid var(--g);
	border-radius: var(--r);
	background: var(--panel-hi);
	animation: notein 0.3s var(--ease);
}
.scan-result img {
	width: 104px;
	align-self: flex-start;
	border-radius: var(--r-sm);
	cursor: zoom-in;
	position: relative;
	z-index: 51;
}
.scan-result > div {
	flex: 1;
	min-width: 0;
}
.scan-result b {
	display: block;
	font: 26px/1 var(--head);
	color: var(--g);
	margin: 2px 0 6px;
	overflow-wrap: anywhere;
}
.scan-result .no {
	margin: 0 0 6px;
	font-size: 12px;
	color: var(--red);
}
.scan-result .acts {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}
.scan-result .acts button {
	font-size: 13px;
	padding: 5px 9px;
}
.scan-result .acts .primary {
	flex: 1 1 100%;
	font: 38px/1 var(--head);
	padding: 12px 10px;
	letter-spacing: 0.04em;
}
.scan-result .acts .primary:not(:disabled) {
	animation: ready 1.6s ease-in-out infinite;
}
@keyframes ready {
	50% { background: var(--g-hi); }
}
.primary.holding {
	animation: none !important;
	background: var(--g-hi);
}
.clock {
	width: 34px;
	height: 34px;
	rotate: -90deg;
}
.clock circle {
	fill: none;
	stroke: currentColor;
	stroke-width: 4;
	stroke-dasharray: 94.25;
	stroke-dashoffset: 94.25;
	animation: clock 3s linear forwards;
}
@keyframes clock {
	to { stroke-dashoffset: 0; }
}
.scan-result .alts {
	margin: 6px 0 0;
	font-size: 12px;
	color: var(--muted);
}
.scan-result .alts button {
	font-size: 11px;
	padding: 2px 7px;
	margin: 2px 3px 0 0;
}
/* the tabs: chat with the opponent, the history */
/* one-row switches (Chat / History, who the chat writes to, Full / Reduced): one track, and one flat thumb that glides
   under the chosen item (play-util.js measures it into --tx and --tw); the chosen text is brighter, the others muted */
.slider {
	position: relative;
	display: flex;
	gap: 2px;
	padding: 3px;
	border: 1px solid var(--line-soft);
	border-radius: var(--r-pill);
	background: var(--bg);
	isolation: isolate;
}
.slider::before {
	content: '';
	position: absolute;
	z-index: 0;
	top: 3px;
	bottom: 3px;
	left: 0;
	width: var(--tw, 0);
	transform: translateX(var(--tx, 0));
	border: 1px solid var(--line);
	border-radius: var(--r-pill);
	background: var(--panel-hi);
	transition: transform 0.3s var(--ease), width 0.3s var(--ease);
}
.slider:not(.ready)::before {
	transition: none;
}
.slider > button,
.slider > button:hover,
.slider > button.on {
	position: relative;
	z-index: 1;
	border: 0;
	border-radius: var(--r-pill);
	background: transparent;
	box-shadow: none;
}
.slider > button {
	color: var(--muted);
	transition: color 0.2s;
}
.slider > button:hover {
	color: var(--text);
}
.slider > button.on {
	color: var(--g-hi);
}
/* the tabs: the chat, the history */
.tabs > button {
	flex: 1 1 0;
	font-size: 13px;
	padding: 6px;
}
.tabs .dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--amber);
}
.pane {
	flex: 1;
	min-height: 120px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.chat {
	flex: 1;
	min-height: 0;
	overflow: auto;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding-right: 4px;
}
.chat-empty {
	margin: auto 0;
	color: var(--faint);
	font-size: 13px;
	text-align: center;
	padding: 10px;
}
.msg {
	display: flex;
	gap: 8px;
	align-items: flex-end;
	max-width: 92%;
	animation: notein 0.25s var(--ease);
}
.msg p {
	margin: 0;
	padding: 7px 11px;
	border-radius: var(--r-lg) var(--r-lg) var(--r-lg) var(--r-xs);
	background: var(--panel-hi);
	border: 1px solid var(--line-soft);
	font-size: 13px;
	line-height: 1.45;
}
.msg small {
	margin-top: 3px;
	letter-spacing: 0;
	font-size: 11px;
}
.msg.ai p {
	border-color: var(--amber-dim);
}
.msg.me {
	align-self: flex-end;
}
.msg.me p {
	background: var(--g-dim);
	color: var(--ink);
	border-color: var(--g-dim);
	border-radius: var(--r-lg) var(--r-lg) var(--r-xs) var(--r-lg);
}
.msg.wait p {
	color: var(--muted);
}
.msg img {
	width: 34px;
	border-radius: 3px;
	cursor: zoom-in;
	position: relative;
	z-index: 51;
}
.chatf {
	display: flex;
	gap: 6px;
}
.chatf input {
	flex: 1;
	font-size: 13px;
}
.chatf button {
	font-size: 13px;
	padding: 6px 12px;
}
#log {
	flex: 1;
	min-height: 0;
	overflow: auto;
	margin: 0;
	padding-left: 18px;
	font-size: 12px;
	color: var(--faint);
}
#log li {
	margin-bottom: 4px;
}
#log li:nth-child(-n + 3) {
	color: var(--muted);
}
#log li:first-child {
	color: var(--text);
}
#log li.has {
	cursor: help;
}
#log li:hover {
	color: var(--g-hi);
}
#log li.fix {
	list-style: '✎ ';
	color: var(--amber);
}
/* Menu, dice, concede, full screen, Settings: a second line when a narrow panel or a long language has no room */
.tools {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}
.tools button {
	padding: 6px 8px;
	font-size: 13px;
}
.tools .grow {
	flex: 1 0 auto;
}

/* ================= the card menu, correction, detail ================= */
#menu {
	position: fixed;
	z-index: 75;
	width: min(380px, calc(100vw - 20px));
	max-height: calc(100vh - 20px);
	overflow: auto;
	padding: 10px;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: var(--panel);
	box-shadow: var(--shadow);
	animation: pop 0.18s var(--ease);
	transform-origin: 0 0;
}
#menu header {
	padding: 4px 6px 8px;
	border-bottom: 1px solid var(--line-soft);
}
#menu header b {
	font: 26px/1.05 var(--head);
	color: var(--g);
	font-weight: 400;
}
.mlist {
	display: grid;
	gap: 4px;
	padding: 8px 0;
}
.mnone {
	margin: 4px 6px;
	color: var(--faint);
	font-size: 13px;
}
.mi {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	justify-content: stretch;
	text-align: left;
	gap: 4px 10px;
	padding: 8px 10px;
	font-size: 13px;
	line-height: 1.35;
}
.mi .cost {
	display: inline-flex;
	gap: 2px;
	flex-wrap: wrap;
	max-width: 120px;
}
.mi small {
	grid-column: 1 / -1;
	color: var(--amber);
	letter-spacing: 0;
}
.mi.off {
	opacity: 0.55;
	cursor: not-allowed;
}
.mi.plain {
	display: flex;
	justify-content: center;
}
#menu footer {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	padding-top: 8px;
	border-top: 1px solid var(--line-soft);
}
.fixd .fwho {
	display: flex;
	gap: 12px;
	align-items: center;
}
.fixd .fwho img {
	width: 64px;
	border-radius: var(--r-sm);
}
.fixd .fwho b {
	font: 28px/1 var(--head);
}
.frow {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.frow.col {
	display: grid;
	justify-content: stretch;
	gap: 6px;
}
.stepper {
	display: flex;
	align-items: center;
	gap: 6px;
}
.stepper button {
	width: 38px;
	height: 38px;
	padding: 0;
	font-size: 20px;
	border-radius: 50%;
}
.stepper b {
	min-width: 48px;
	text-align: center;
	font: 30px/1 var(--head);
}
.tgl.on,
.seg button.on {
	background: var(--g);
	color: var(--ink);
	border-color: var(--g);
}
.seg {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.seg button {
	flex: 1 1 auto;
	white-space: nowrap;
}
#pop .detail {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 26px;
	width: min(1120px, 94vw);
	max-height: 92vh;
	padding: 20px;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow);
	animation: pop 0.25s var(--ease);
}
#pop .detail > img {
	height: min(80vh, 640px);
	border-radius: var(--card-r);
	box-shadow: var(--shadow);
	position: relative;
	z-index: 51;
}
#pop .detail > .tk {
	width: 300px;
	display: grid;
	place-items: center;
	font: 40px/1 var(--head);
	color: var(--g-hi);
	border: 1px solid var(--line);
	border-radius: var(--r-xl);
}
#pop .dt {
	min-height: 0;
	overflow: auto;
	padding-right: 6px;
}
#pop .dt h3 {
	margin: 0 0 4px;
	font: 46px/1 var(--head);
	color: var(--g);
}
#pop .meta {
	margin: 0 0 10px;
	color: var(--muted);
}
#pop .state {
	margin-bottom: 10px;
	padding: 6px 10px;
	border-left: 3px solid var(--g);
	background: var(--bg);
}
#pop .sum {
	font-size: 18px;
	line-height: 1.5;
}
#pop h4 {
	margin: 16px 0 5px;
	font: 22px/1 var(--head);
	color: var(--g-hi);
	letter-spacing: 0.04em;
}
#pop ul {
	margin: 0;
	padding-left: 18px;
}
#pop ul b,
#pop dt {
	color: var(--g);
}
#pop dl {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 5px 14px;
	margin: 0;
}
#pop dd {
	margin: 0;
}
#pop .oracle {
	font-size: 14px;
	color: var(--muted);
}
#pop .abl {
	display: grid;
	gap: 5px;
}
#pop .chat {
	display: grid;
	gap: 4px;
	max-height: 260px;
	overflow: auto;
}
#pop .chat:empty {
	display: none;
}
#pop .chat .q {
	justify-self: end;
	margin: 6px 0 0;
	padding: 4px 10px;
	border-radius: var(--r) var(--r) 2px var(--r);
	background: var(--g-dim);
	color: var(--ink);
	font-size: 14px;
}
#pop .chat .a {
	margin: 0;
	padding: 6px 10px;
	border-left: 2px solid var(--g);
	font-size: 15px;
	line-height: 1.5;
}
#pop .chat .a.wait {
	color: var(--muted);
}
#pop .quick {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin: 6px 0;
}
#pop .quick button {
	font-size: 12px;
	padding: 4px 10px;
	border-radius: var(--r-lg);
}
#pop .askf {
	display: flex;
	gap: 6px;
}
#pop .askf input {
	flex: 1;
}
#pop .acts {
	position: sticky;
	bottom: 0;
	display: flex;
	justify-content: flex-end;
	gap: 6px;
	margin-top: 12px;
	padding: 10px 0 2px;
	background: var(--panel);
}
/* the end of a game */
.dialog.over {
	text-align: center;
	justify-items: center;
}
.dialog.over h2 {
	font-size: 110px;
}
.dialog.over.lost h2 {
	color: var(--amber);
}
.dialog.over .btns {
	justify-content: center;
}
/* support, report, about */
.dialog.donate,
.dialog.about {
	justify-items: center;
	text-align: center;
}
.qr {
	display: block;
	padding: 0;
	border-radius: var(--r);
	overflow: hidden;
	line-height: 0;
	transition: translate 0.15s;
}
.qr:hover {
	translate: 0 -2px;
}
.qr canvas {
	display: block;
	image-rendering: pixelated;
}
/* Buy Me a Coffee is the one big button; PayPal and feedback sit smaller under it */
.dialog.donate .coffee {
	font: 30px/1 var(--head);
	letter-spacing: 0.03em;
	padding: 12px 30px;
}
.dialog.donate .more {
	margin-top: -4px;
}
.dialog.donate .more > * {
	padding: 6px 14px;
	font-size: 13px;
}
/* hearts rising over everything when someone opens the support screen (play-extra.js hearts()) */
.hearts {
	position: fixed;
	inset: 0;
	z-index: 96;
	pointer-events: none;
	overflow: hidden;
}
.hearts i {
	position: absolute;
	line-height: 0;
	will-change: transform, opacity;
}
.hearts svg {
	display: block;
}
/* BETA next to the name: seen, not shouting */
.beta {
	display: inline-block;
	padding: 4px 8px 3px;
	border: 1px solid var(--g-dim);
	border-radius: var(--r-pill);
	font: 700 11px/1 var(--body);
	letter-spacing: 0.16em;
	color: var(--g-dim);
	vertical-align: middle;
}
.fcp {
	margin: 0;
	padding: 12px 14px;
	border: 1px solid var(--line-soft);
	border-radius: var(--r);
	background: var(--bg);
	font-size: 13px;
	line-height: 1.5;
}
.fcp:empty,
[data-i18n='about.fcpLocal']:empty {
	display: none;
}
.rep-msg {
	margin: 0;
	min-height: 1.2em;
	font-size: 13px;
	color: var(--amber);
}
.rep-msg a {
	color: var(--g-hi);
}

/* ================= dice, spells, turn banner, history preview, hover, flash ================= */
#dice {
	position: fixed;
	inset: 0;
	z-index: 90;
	display: grid;
	place-content: center;
	justify-items: center;
	gap: 22px;
	background: rgb(2 10 5 / 0.72);
	cursor: pointer;
}
.die {
	width: 170px;
	height: 170px;
	display: grid;
	place-items: center;
	background: var(--g);
	color: var(--ink);
	border-radius: 28px;
	box-shadow: 0 14px 40px rgb(0 0 0 / 0.6), inset 0 -10px 0 rgb(0 0 0 / 0.18);
}
.die b {
	font: 100px/1 var(--head);
}
.die.d20 {
	border-radius: 0;
	clip-path: polygon(50% 0, 94% 25%, 94% 75%, 50% 100%, 6% 75%, 6% 25%);
	box-shadow: none;
}
.die.rolling {
	animation: tumble 1s cubic-bezier(0.25, 0.7, 0.35, 1) both;
}
.die.landed {
	animation: land 0.35s var(--ease);
}
@keyframes tumble {
	0% { transform: translate(-260px, -200px) rotate(-720deg) scale(0.35); }
	55% { transform: translate(30px, 12px) rotate(30deg) scale(1.1); }
	78% { transform: translate(-8px, -3px) rotate(-10deg) scale(0.96); }
	100% { transform: none; }
}
@keyframes land {
	50% { transform: scale(1.12); }
}
.die .pips {
	display: grid;
	grid-template: repeat(3, 1fr) / repeat(3, 1fr);
	width: 118px;
	height: 118px;
}
.die .pips i {
	width: 26px;
	height: 26px;
	place-self: center;
	border-radius: 50%;
	background: var(--ink);
}
#dice p {
	margin: 0;
	text-align: center;
	font: 40px/1 var(--head);
	color: var(--g-hi);
}
#dice p b {
	font-size: 64px;
	color: var(--g);
}
#spell {
	position: fixed;
	inset: 0;
	z-index: 60;
	display: grid;
	place-items: center;
	pointer-events: none;
}
#spell img,
#spell .tk {
	height: min(60vh, 540px);
	border-radius: var(--r-xl);
	box-shadow: 0 20px 60px rgb(0 0 0 / 0.75);
	animation: spell 1.6s ease-in-out forwards;
}
@keyframes spell {
	0% { opacity: 0; scale: 0.5; translate: 0 50px; rotate: -6deg; }
	22% { opacity: 1; scale: 1; translate: 0 0; rotate: 0deg; }
	62% { opacity: 1; scale: 1; translate: 0 0; }
	100% { opacity: 0.2; scale: 0.1; translate: var(--dx) var(--dy); rotate: 14deg; }
}
#banner {
	position: fixed;
	left: 0;
	right: var(--side);
	top: 50%;
	z-index: 65;
	translate: 0 -50%;
	display: grid;
	justify-items: center;
	padding: 18px 0 14px;
	pointer-events: none;
	background: linear-gradient(90deg, transparent, var(--panel) 20%, var(--panel) 80%, transparent);
	border-block: 1px solid var(--bc);
	animation: sweep 1.7s ease-in-out forwards;
}
#banner.me { --bc: var(--g); }
#banner.ai { --bc: var(--amber); }
#banner b {
	font: 84px/1 var(--head);
	letter-spacing: 0.12em;
	color: var(--bc);
	font-weight: 400;
}
@keyframes sweep {
	0% { opacity: 0; clip-path: inset(0 100% 0 0); }
	22% { opacity: 1; clip-path: inset(0 0 0 0); }
	75% { opacity: 1; clip-path: inset(0 0 0 0); }
	100% { opacity: 0; clip-path: inset(0 0 0 100%); }
}
#peek {
	position: fixed;
	right: calc(var(--side) + 12px);
	z-index: 72;
	width: 340px;
	padding: 12px;
	border: 1px solid var(--g-dim);
	border-radius: var(--r);
	background: var(--panel);
	box-shadow: var(--shadow);
	pointer-events: none;
	animation: peekin 0.22s var(--ease);
}
@keyframes peekin {
	from { opacity: 0; translate: 16px 0; }
}
#peek p {
	margin: 10px 0 0;
	font-size: 14px;
}
#peek .stage {
	position: relative;
	display: flex;
	justify-content: center;
	min-height: 120px;
	padding: 6px 0 4px;
}
#peek .stage img {
	width: 150px;
	border-radius: var(--r-sm);
	margin-right: -46px;
	box-shadow: 0 6px 16px rgb(0 0 0 / 0.6);
}
#peek .stage img:last-of-type { margin-right: 0; }
#peek .stage > * { animation: 2.2s ease-in-out infinite; }
#peek .k-hit img { animation-name: r-hit; }
#peek .k-die img { animation-name: r-die; }
#peek .k-sac img { animation-name: r-sac; }
#peek .k-spell img { animation-name: r-spell; }
#peek .k-attack img { animation-name: r-attack; }
#peek .k-grow img { animation-name: r-grow; }
#peek .k-arrive img { animation-name: r-arrive; }
#peek .k-draw .back { animation-name: r-draw; }
#peek .k-dice .dice6 { animation-name: r-dice; }
#peek .stage em {
	position: absolute;
	top: 30%;
	font: 46px/1 var(--head);
	font-style: normal;
	text-shadow: 0 2px 0 #000;
	animation-name: r-num;
}
#peek .stage em.down { color: var(--red); }
#peek .stage em.up { color: var(--g-hi); }
#peek .back {
	width: 90px;
	height: 126px;
	border-radius: var(--r-sm);
	background: url(/img/back.jpg) center / cover;
}
#peek .dice6 {
	width: 90px;
	height: 90px;
	display: grid;
	place-items: center;
	border-radius: var(--r-lg);
	background: var(--g);
	color: var(--ink);
	font: 60px/1 var(--head);
	font-style: normal;
}
@keyframes r-hit {
	0%, 30%, 100% { translate: 0 0; filter: none; }
	36%, 48% { translate: -7px 0; filter: sepia(1) saturate(5) hue-rotate(-40deg); }
	42%, 54% { translate: 7px 0; }
	60% { translate: 0 0; filter: none; }
}
@keyframes r-die {
	0%, 15% { opacity: 1; filter: none; translate: 0 0; scale: 1; }
	45% { filter: brightness(1.6) saturate(0); }
	75%, 100% { opacity: 0; filter: grayscale(1) brightness(0.3); translate: 30px 50px; scale: 0.5; rotate: 12deg; }
}
@keyframes r-sac {
	0%, 15% { opacity: 1; filter: none; scale: 1; }
	45% { filter: sepia(1) saturate(4) hue-rotate(-30deg) brightness(1.2); scale: 1.06; }
	75%, 100% { opacity: 0; scale: 0.4; rotate: -14deg; filter: brightness(0.2); }
}
@keyframes r-spell {
	0% { opacity: 0; scale: 0.4; rotate: -20deg; }
	30%, 70% { opacity: 1; scale: 1.05; rotate: 0deg; }
	100% { opacity: 0; scale: 0.2; rotate: 25deg; translate: 60px 60px; }
}
@keyframes r-attack {
	0%, 20%, 100% { translate: 0 0; scale: 1; }
	45% { translate: 0 -34px; scale: 1.08; }
	55% { translate: 0 -40px; }
}
@keyframes r-grow {
	0%, 25%, 100% { scale: 1; outline: 0 solid transparent; }
	45% { scale: 1.15; outline: 3px solid var(--cyan); }
}
@keyframes r-arrive {
	0% { opacity: 0; translate: 0 -70px; scale: 1.35; rotate: -8deg; }
	35% { opacity: 1; translate: 0 4px; scale: 0.97; rotate: 0deg; }
	45%, 100% { translate: 0 0; scale: 1; }
}
@keyframes r-draw {
	0% { opacity: 0; translate: 0 50px; }
	35%, 80% { opacity: 1; translate: 0 0; }
	100% { opacity: 0; translate: 0 -30px; }
}
@keyframes r-dice {
	0% { rotate: -360deg; scale: 0.3; }
	40%, 100% { rotate: 0deg; scale: 1; }
}
@keyframes r-num {
	0%, 30% { opacity: 0; translate: 0 10px; }
	45% { opacity: 1; translate: 0 0; }
	85%, 100% { opacity: 0; translate: 0 -30px; }
}
#hover {
	position: fixed;
	z-index: 85;
	pointer-events: none;
	animation: peekin 0.18s var(--ease);
}
#hover img {
	height: 100%;
	border-radius: var(--card-r);
	box-shadow: 0 16px 50px rgb(0 0 0 / 0.75);
}
/* the flash: a white panel at the top edge, right under the webcam, so the rest of the game stays visible */
#flash {
	position: fixed;
	top: 0;
	left: 50%;
	translate: -50% 0;
	width: min(64vw, 900px);
	height: 42vh;
	z-index: 100;
	display: grid;
	place-items: center;
	background: #fff;
	border-radius: 0 0 28px 28px;
}
#flash span {
	font: 28px/1 var(--head);
	color: #999;
}

/* ================= the settings drawer ================= */
.drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 78;
	width: min(400px, 100vw);
	overflow: auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px 18px 22px;
	background: var(--panel);
	border-left: 1px solid var(--line);
	box-shadow: -12px 0 40px rgb(0 0 0 / 0.55);
	animation: drawer 0.25s var(--ease);
}
@keyframes drawer {
	from { translate: 40px 0; opacity: 0; }
}
.drawer header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.drawer h3 {
	margin: 0;
	font: 30px/1 var(--head);
	color: var(--g);
}
.drawer h4 {
	margin: 10px 0 0;
	font-size: 11px;
	letter-spacing: 0.1em;
	color: var(--muted);
	text-transform: uppercase;
}
.drawer .row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
	gap: 10px;
	align-items: center;
	font-size: 14px;
}
.drawer .check {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: 13px;
	line-height: 1.4;
	cursor: pointer;
}
.drawer .check input {
	margin-top: 2px;
	accent-color: var(--g);
	flex: none;
}
.drawer-foot {
	display: grid;
	gap: 6px;
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid var(--line-soft);
}
.mic {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 70px;
	gap: 6px;
	align-items: center;
}
.mic select {
	font-size: 12px;
	padding: 4px 6px;
}
#micLevel {
	height: 8px;
	border-radius: var(--r-xs);
	background: linear-gradient(90deg, var(--g) calc(var(--lv, 0) * 100%), var(--line-soft) 0);
}

/* layers: the scanlines stay over the background but under cards, dialogs above everything */
.world {
	z-index: 51;
}
#lobby .cmdr-big img,
#lobby .deckpick .art img,
#lobby .chip img {
	position: relative;
	z-index: 51;
}
#picker,
#flow {
	z-index: 72;
	background: radial-gradient(ellipse at 50% 40%, var(--bg2), var(--bg) 80%);
}
#fix,
#pop,
#modal {
	z-index: 76;
}
#extra {
	z-index: 95;
}

/* ================= narrow windows ================= */
@media (max-width: 1100px) {
	.track li:not(.on):not(.turn) {
		display: none;
	}
	.hud .who {
		max-width: 120px;
	}
}
@media (max-width: 900px) {
	body {
		overflow: auto;
	}
	:root {
		--side: 100vw;
	}
	#game {
		position: static;
		display: flex;
		flex-direction: column;
	}
	#board {
		height: 86vh;
	}
	#aside {
		border-left: 0;
		border-top: 1px solid var(--line);
	}
	.pane {
		min-height: 260px;
	}
	.bar {
		flex-wrap: wrap;
		gap: 8px;
		padding: 6px 8px;
	}
	.bar.bottom {
		flex-direction: column-reverse;
		flex-wrap: nowrap;
	}
	.bar.bottom .hud {
		flex: none;
	}
	.hud,
	.stats {
		flex-wrap: wrap;
	}
	.hud {
		min-width: 0;
	}
	.bar.top .hud {
		flex: 1 1 100%;
	}
	.bar.top .track {
		flex: 1 1 100%;
		justify-content: flex-start;
		margin: 0;
	}
	.hud .who {
		max-width: none;
		flex: 1 1 100%;
	}
	.life {
		min-width: 72px;
		padding: 2px 10px 4px;
	}
	.life b {
		font-size: 40px;
	}
	.stat {
		min-width: 56px;
		padding: 3px 7px;
	}
	.stat b {
		font-size: 25px;
	}
	.zoombar {
		right: 8px;
		bottom: 8px;
	}
	.zoombar button {
		min-width: 30px;
		height: 30px;
		padding: 0 8px;
		font-size: 13px;
	}
	.dock {
		flex-wrap: wrap;
	}
	.act {
		max-width: none;
		justify-items: stretch;
		width: 100%;
	}
	.act .btns {
		justify-content: stretch;
	}
	.act .btns button {
		flex: 1;
	}
	.voice img {
		height: 58px;
	}
	.guide {
		width: calc(100% - 28px);
		bottom: 64px;
	}
	#banner {
		right: 0;
	}
	#peek {
		display: none;
	}
	.slots {
		grid-template-columns: 1fr;
	}
	.seat {
		grid-template-columns: 1fr;
		grid-template-areas: 'head' 'hero' 'deck' 'cmdr' 'cam' 'ready';
	}
	.cmdr-big img {
		width: min(240px, 70vw);
	}
	.vs {
		justify-self: center;
	}
	.lb-top {
		grid-template-columns: auto 1fr auto;
	}
	.steps li span {
		display: none;
	}
	.steps {
		min-width: 0;
	}
	.steps li {
		padding: 5px;
	}
	/* the step's name may take two lines on a phone ("Main de départ") instead of pushing past the edge */
	.steps li.on {
		min-width: 0;
		white-space: normal;
		line-height: 1.1;
	}
	.steps li.on span {
		display: inline;
	}
	.fl {
		padding: 14px 16px 18px;
	}
	.fl h2 {
		font-size: 32px;
	}
	.lb-go > * {
		flex: 1 1 100%;
		margin-left: 0;
	}
	.pk-top h2 {
		font-size: 32px;
	}
	#pop .detail {
		grid-template-columns: 1fr;
		overflow: auto;
	}
	#pop .detail > img {
		width: min(320px, 80vw);
		height: auto;
		justify-self: center;
	}
	.rolls {
		gap: 18px;
	}
	.die {
		width: 120px;
		height: 120px;
	}
	.die b {
		font-size: 70px;
	}
	#stRoll h2,
	#stHand h2 {
		font-size: 46px;
	}
	.dialog.over h2 {
		font-size: clamp(44px, 15vw, 76px);
		overflow-wrap: anywhere;
	}
}

/* ================= Parchment: dark old paper with grain and stains, gold ink rules, a compass in the corner ================= */
@font-face {
	font-family: 'Uncial Antiqua';
	src: url(/fonts/uncial-antiqua-400.woff2) format('woff2');
	font-display: swap;
}
body.theme-parchment,
body.theme-countryside {
	--head: 'Uncial Antiqua', Cinzel, serif;
	--body: 'EB Garamond', Georgia, serif;
	font-size: 16px;
}
body.theme-parchment {
	--bg: #1f170f;
	--bg2: #3a2d1f;
	--panel: #241b11;
	--panel-hi: #33271a;
	--line: #8a6d3b;
	--line-soft: #4f3f2a;
	--grid: transparent;
	--g: #d9b872;
	--g-hi: #f1dfb0;
	--g-dim: #9c7f4a;
	--ink: #1a120a;
	--text: #efe3c6;
	--muted: #bba57f;
	--faint: #8f7b5a;
	--amber: #d0603a;
	--amber-dim: #6e2e1a;
	--red: #d24a32;
	--cyan: #a9c6cc;
	--paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .28 0 0 0 0 .17 0 0 0 .42 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	--paper-stain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006' numOctaves='4' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .07 0 0 0 0 .03 0 0 0 .55 -.12'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)'/%3E%3C/svg%3E");
	--compass: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-100 -100 200 200' fill='none' stroke='%23c9a45a' stroke-width='1.2'%3E%3Ccircle r='92'/%3E%3Ccircle r='86' stroke-width='.6'/%3E%3Ccircle r='40' stroke-width='.8'/%3E%3Cpath d='M0-96L10-10 96 0 10 10 0 96-10 10-96 0-10-10Z'/%3E%3Cpath d='M0-60L6-6 60 0 6 6 0 60-6 6-60 0-6-6Z' transform='rotate(45)' stroke-width='.8'/%3E%3Cpath d='M0-96L10-10 0 0Z' fill='%23c9a45a' fill-opacity='.5'/%3E%3C/svg%3E");
	background: radial-gradient(ellipse at 50% 42%, rgb(126 100 64 / 0.32), transparent 62%), radial-gradient(ellipse at 50% 50%, transparent 55%, rgb(10 6 2 / 0.75) 100%), var(--paper-stain), var(--paper-grain), linear-gradient(160deg, #3f3222, #2b2117 55%, #211910);
}
body.theme-parchment::before {
	content: '';
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: var(--compass) right 3% bottom 6% / 210px no-repeat, var(--compass) left 2% top 8% / 120px no-repeat;
	opacity: 0.16;
}
body.theme-parchment .table {
	background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgb(10 6 2 / 0.55) 100%), var(--paper-stain), var(--paper-grain), linear-gradient(160deg, #3f3222, #2b2117 55%, #211910);
}
body.theme-parchment .bar,
body.theme-parchment #aside,
body.theme-parchment .seat,
body.theme-parchment .dialog,
body.theme-parchment #menu,
body.theme-parchment .drawer {
	background: linear-gradient(rgb(28 21 13 / 0.94), rgb(28 21 13 / 0.94)), var(--paper-grain);
}
body.theme-parchment .bar.top,
body.theme-parchment .bar.bottom {
	box-shadow: inset 0 3px 0 rgb(0 0 0 / 0.3), inset 0 4px 0 rgb(201 164 90 / 0.18);
}
body.theme-parchment button.primary,
body.theme-parchment .button.primary,
body.theme-parchment .scan {
	background: linear-gradient(#e2c27e, #b88d43);
	color: #1a120a;
	border-color: #6b5023;
}
body.theme-parchment button.primary:hover:not(:disabled),
body.theme-parchment .scan:hover {
	background: linear-gradient(#f1d79a, #c99d50) !important;
}
body.theme-parchment .face .pt,
body.theme-countryside .face .pt {
	font-family: 'EB Garamond', serif;
	font-weight: 600;
	font-size: 30px;
}
body.theme-parchment .life b,
body.theme-parchment .stat b,
body.theme-countryside .life b,
body.theme-countryside .stat b {
	font-family: 'EB Garamond', serif;
	font-weight: 600;
}
body.theme-parchment .it.area.ai,
body.theme-parchment .it.area.me {
	background: rgb(20 14 8 / 0.25);
	border-color: rgb(138 109 59 / 0.35);
}

/* ================= Countryside: warm light paper, green ink ================= */
body.theme-countryside {
	--bg: #f1e8cf;
	--bg2: #e9dfc4;
	--panel: #f8f1de;
	--panel-hi: #ecdfbd;
	--line: #9a8559;
	--line-soft: #cdbd92;
	--grid: rgb(79 125 53 / 0.08);
	--g: #4f7d35;
	--g-hi: #2f5a1e;
	--g-dim: #7da35f;
	--ink: #fbf5e4;
	--text: #2d2617;
	--muted: #6b5c3e;
	--faint: #9a8a68;
	--amber: #9c4a24;
	--amber-dim: #d9b48a;
	--red: #b23a22;
	--cyan: #3c7fa0;
	color-scheme: light;
	background: radial-gradient(ellipse at 50% 40%, #f4ecd6, #ddcfa8 70%, #b9a777);
}
body.theme-countryside .table {
	background-color: #eadfc0;
}
body.theme-countryside .face .nm {
	background: rgb(30 24 12 / 0.82);
	color: #f8f1de;
}
body.theme-countryside .face .pt {
	background: #2d2617;
	color: #f8f1de;
}
body.theme-countryside .face .pt.up {
	background: var(--g);
	color: #fbf5e4;
}
body.theme-countryside .life,
body.theme-countryside .stat,
body.theme-countryside select,
body.theme-countryside input,
body.theme-countryside textarea {
	background: #fffaf0;
}
body.theme-countryside .sheet {
	background: rgb(60 48 24 / 0.7);
}
body.theme-countryside .it.area.ai {
	background: rgb(156 74 36 / 0.05);
	border-color: rgb(156 74 36 / 0.22);
}
body.theme-countryside .it.area.ai span {
	color: rgb(156 74 36 / 0.45);
}
.chip.more {
	padding: 3px 12px;
	font-weight: 700;
	border-style: dashed;
}

/* the bars follow the board's own width: when the HUD and the dock (or the turn track) don't fit side by side,
   each gets its own row instead of squeezing the other */
#board {
	container: board / inline-size;
}
.track {
	flex: 0 0 auto;
}
.act .primary {
	white-space: nowrap;
}
@container board (max-width: 900px) {
	.bar {
		flex-wrap: wrap;
		row-gap: 6px;
	}
	.bar .hud {
		flex: 1 1 100%;
		min-width: 0;
	}
	.bar.top .track {
		flex: 1 1 100%;
		justify-content: flex-start;
		margin: 0;
	}
	.dock {
		flex: 1 1 100%;
	}
	.act {
		max-width: 62%;
	}
}
/* long deck names (hundreds of precons) take two lines instead of being cut */
.hud .who {
	max-width: 250px;
}
/* the label over the name, a size up from the rest of the app (like the numbers): read from across the table */
.hud .who small {
	font-size: 12.5px;
}
.hud .who b {
	white-space: normal;
	text-overflow: clip;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	line-height: 1.05;
}
.hud .who b.long {
	font-size: 22px;
}
/* by content, not by a width guess: the turn track and the dock move to their own row when they don't fit next to
   the HUD (long languages, long deck names) */
.bar {
	flex-wrap: wrap;
	row-gap: 6px;
}
.dock {
	flex: 1 1 440px;
	min-width: 0;
}
.track {
	flex: 0 0 auto;
	margin-left: auto;
}
@media (max-width: 900px) {
	.bar.bottom .dock {
		flex: none;
	}
}
/* a stat keeps its label whole; when the row is short the stats wrap instead of squeezing */
.stats {
	flex-wrap: wrap;
	row-gap: 4px;
}
.stat {
	flex: none;
}
.stat small {
	overflow: visible;
	text-overflow: clip;
}

/* ================= corners: every card image with a real card's corner, every panel rounded ================= */
.face,
.face .tk,
.voice img,
.scan-result img,
.msg img,
.fixd .fwho img,
#peek .stage img,
#peek .back,
#spell img,
#spell .tk,
.hb,
.cf-item img,
.cf-item .tk,
#hover img,
#pop .detail > img,
.cmdr-big img {
	border-radius: var(--card-r);
}
/* the d20: a hexagon with rounded points (a mask instead of a sharp clip) */
.die.d20 {
	border-radius: 0;
	clip-path: none;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 4 L92 27 L92 73 L50 96 L8 73 L8 27 Z' fill='black' stroke='black' stroke-width='8' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 4 L92 27 L92 73 L50 96 L8 73 L8 27 Z' fill='black' stroke='black' stroke-width='8' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
#flash {
	top: 10px;
	border-radius: var(--r-xl);
}
/* the game as two framed panels: the table with its bars, and the side panel */
#game {
	gap: 8px;
	padding: 8px;
	background: var(--bg);
}
#board {
	border: 1px solid var(--line);
	border-radius: var(--r-xl);
	overflow: hidden;
}
#aside {
	border: 1px solid var(--line);
	border-radius: var(--r-xl);
}
.drawer {
	top: 10px;
	right: 10px;
	bottom: 10px;
	border: 1px solid var(--line);
	border-radius: var(--r-xl);
}
#camHost,
.cam-slot {
	border-radius: var(--r);
}
.tag {
	border-radius: var(--r-pill);
}
.count {
	border-radius: var(--r-pill);
}
.lb-top .back,
.steps li,
.track li,
.chip,
.deckpick em,
.pk-top input[type='search'],
.pk-top select,
.tabs button,
.fixbtn {
	border-radius: var(--r-pill);
}
.seat .pname {
	border-radius: var(--r-xs) var(--r-xs) 0 0;
}
@media (max-width: 900px) {
	#game {
		padding: 6px;
		gap: 6px;
	}
}

/* ================= animations, the detailed pass (transforms and opacity only, no glows) ================= */
/* the turn track: one highlight slides from phase to phase */
.trackwrap {
	position: relative;
	flex: 0 0 auto;
	margin-left: auto;
	min-width: 0;
}
.trackwrap .track {
	position: relative;
	z-index: 1;
	margin: 0;
	flex: none;
}
.hl {
	position: absolute;
	left: 0;
	top: 0;
	border-radius: var(--r-pill);
	background: var(--g);
	pointer-events: none;
	transition: transform 0.45s var(--ease), width 0.45s var(--ease), height 0.3s var(--ease);
}
.hl.ai {
	background: var(--amber);
}
.track li.on {
	background: transparent;
	border-color: transparent;
}
@container board (max-width: 900px) {
	.bar.top .trackwrap {
		flex: 1 1 100%;
		margin: 0;
	}
}
@media (max-width: 900px) {
	.bar.top .trackwrap {
		flex: 1 1 100%;
		margin: 0;
	}
}
/* a card arrives: it comes face down from above, flips over in the air, its shadow shrinks as it lands and settles */
.it.card {
	perspective: 1100px;
}
.it.card.new .face,
.it.card.new.land .face {
	animation: arrive-flip 0.9s var(--ease) both;
}
.it.card.new .face::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 5;
	border-radius: inherit;
	background: url(/img/back.jpg) center / cover;
	pointer-events: none;
	animation: back-show 0.9s linear both;
}
@keyframes arrive-flip {
	0% { opacity: 0; transform: translateY(-170px) rotateY(180deg) scale(1.35); box-shadow: 0 70px 60px rgb(0 0 0 / 0.4); }
	14% { opacity: 1; }
	50% { transform: translateY(-50px) rotateY(90deg) scale(1.16); }
	76% { transform: translateY(7px) rotateY(0deg) scale(0.97); box-shadow: 0 4px 10px rgb(0 0 0 / 0.6); }
	89% { transform: translateY(-3px) scale(1.01); }
	100% { transform: none; box-shadow: 0 3px 10px rgb(0 0 0 / 0.55); }
}
@keyframes back-show {
	0%, 48% { opacity: 1; }
	52%, 100% { opacity: 0; }
}
/* tapping and untapping: the card lifts while it turns */
.it.card.turning .face {
	animation: lift 0.5s var(--ease);
}
@keyframes lift {
	45% { transform: translateY(-12px) scale(1.06); box-shadow: 0 20px 26px rgb(0 0 0 / 0.5); }
}
/* combat: a swing on the strike, shards fly off what is hit, the damage number spins away */
@keyframes strike-up {
	55% { transform: translateY(-70px) scale(1.06) rotate(-3deg); }
}
@keyframes strike-down {
	55% { transform: translateY(70px) scale(1.06) rotate(3deg); }
}
.shards {
	position: absolute;
	left: 50%;
	top: 45%;
	z-index: 6;
	pointer-events: none;
}
.shards i {
	position: absolute;
	left: -7px;
	top: -3px;
	width: 16px;
	height: 6px;
	border-radius: 2px;
	background: var(--red);
	animation: shard 0.75s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
.shards i:nth-child(even) {
	background: var(--text);
	width: 10px;
}
.shards i:nth-child(1) { --a: 0deg; }
.shards i:nth-child(2) { --a: 45deg; }
.shards i:nth-child(3) { --a: 90deg; }
.shards i:nth-child(4) { --a: 135deg; }
.shards i:nth-child(5) { --a: 180deg; }
.shards i:nth-child(6) { --a: 225deg; }
.shards i:nth-child(7) { --a: 270deg; }
.shards i:nth-child(8) { --a: 315deg; }
@keyframes shard {
	from { transform: rotate(var(--a)) translateX(12px) scale(1); opacity: 1; }
	to { transform: rotate(calc(var(--a) + 40deg)) translateX(120px) scale(0.3); opacity: 0; }
}
.it .float.down {
	animation: dmgfly 1s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
@keyframes dmgfly {
	0% { opacity: 0; transform: translate(0, 20px) scale(0.5); }
	18% { opacity: 1; transform: translate(0, -10px) scale(1.3); }
	100% { opacity: 0; transform: translate(70px, -120px) rotate(20deg) scale(0.85); }
}
/* counters pop in */
.it.card.grow .ctr {
	animation: pop-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes pop-in {
	from { transform: scale(0) rotate(-25deg); }
}
/* leaving: the card arcs to where it went (the item glides, the face hops); a sacrifice burns, exile spins away */
.it.card.leaving {
	opacity: 1;
	pointer-events: none;
	transition: transform 0.9s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}
.it.card.leaving .face {
	filter: none;
	transform: none;
	animation: fly-arc 0.9s ease-in-out forwards;
}
.it.card.leaving .face img {
	filter: grayscale(0.6) brightness(0.8);
	transition: filter 0.5s;
}
.it.card.leaving.sac .face {
	animation-name: fly-burn;
}
.it.card.leaving.exiled .face {
	animation-name: fly-exile;
}
.it.card.leaving.fade .face {
	animation: token-fade 0.6s ease forwards;
}
@keyframes fly-arc {
	0% { transform: none; opacity: 1; }
	45% { transform: translateY(-160px) rotate(-10deg) scale(0.9); opacity: 1; }
	85% { opacity: 0.9; }
	100% { transform: rotate(14deg) scale(0.5); opacity: 0; }
}
@keyframes fly-burn {
	0% { transform: none; filter: none; opacity: 1; }
	30% { transform: translateY(-40px) scale(1.04); filter: sepia(1) saturate(4) hue-rotate(-30deg) brightness(1.2); }
	100% { transform: translateY(-20px) rotate(-14deg) scale(0.35); filter: sepia(1) saturate(3) brightness(0.2); opacity: 0; }
}
@keyframes fly-exile {
	0% { transform: none; opacity: 1; }
	50% { transform: translateY(-120px) rotateY(180deg) scale(0.8); opacity: 0.8; }
	100% { transform: rotateY(360deg) scale(0.45); opacity: 0; }
}
@keyframes token-fade {
	to { transform: scale(0.7) translateY(-20px); opacity: 0; }
}
/* the stack: the spell waits big in the middle while a line runs round it (resolving), then it arcs to the graveyard */
#spell .stackcard {
	position: relative;
	height: min(60vh, 540px);
	aspect-ratio: 63 / 88;
	animation: stack 2s ease-in-out forwards;
}
#spell .stackcard img,
#spell .stackcard .tk {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	animation: none;
	border-radius: var(--card-r);
	box-shadow: 0 20px 60px rgb(0 0 0 / 0.75);
	font: 40px/1 var(--head);
	color: var(--g-hi);
	background: var(--panel-hi);
}
#spell .ring {
	position: absolute;
	inset: -12px;
	width: calc(100% + 24px);
	height: calc(100% + 24px);
	overflow: visible;
}
#spell .ring rect {
	fill: none;
	stroke: var(--g);
	stroke-width: 4;
	stroke-linecap: round;
	vector-effect: non-scaling-stroke;
	stroke-dasharray: 100;
	stroke-dashoffset: 100;
	animation: resolve 0.95s 0.4s linear forwards;
}
#spell.ai .ring rect {
	stroke: var(--amber);
}
@keyframes resolve {
	to { stroke-dashoffset: 0; }
}
@keyframes stack {
	0% { opacity: 0; scale: 0.5; translate: 0 60px; rotate: -6deg; }
	16% { opacity: 1; scale: 1; translate: 0 0; rotate: 0deg; }
	70% { opacity: 1; scale: 1; translate: 0 0; rotate: 0deg; }
	84% { translate: calc(var(--dx) * 0.5) calc(var(--dy) * 0.5 - 150px); scale: 0.45; rotate: 8deg; }
	100% { opacity: 0.1; scale: 0.12; translate: var(--dx) var(--dy); rotate: 16deg; }
}
/* the life total: an odometer */
.odo {
	display: inline-flex;
	height: 1em;
	line-height: 1;
	overflow: hidden;
}
.odo .dg {
	display: block;
	height: 1em;
	overflow: hidden;
}
.odo .strip {
	display: flex;
	flex-direction: column;
	transition: transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1);
	transition-delay: calc(var(--k) * 80ms);
}
.odo .strip i {
	display: block;
	height: 1em;
	font-style: normal;
	text-align: center;
}
.odo.neg::before {
	content: '−';
}
.life b.odo {
	line-height: 1;
	height: 1em;
	margin: 2px 0 1px;
}
/* the mulligan: the seven go back, the deck is riffled, a new seven are dealt */
.fan.shuffle .hb {
	animation: riffle 1.05s var(--ease) both;
	animation-delay: calc(var(--k) * 22ms);
}
@keyframes riffle {
	30% { rotate: 0deg; translate: 0 -30px; filter: none; }
	50% { rotate: calc(var(--s) * 9deg); translate: calc(var(--s) * 84px) -30px; }
	72% { rotate: 0deg; translate: 0 -30px; }
	100% { rotate: 0deg; translate: 0 -30px; opacity: 0; }
}
/* dice: the d6 is a cube that tumbles in 3D, the d20 a hexagon spinning through space; both bounce on a floor */
#dice .arena,
.rolls {
	perspective: 900px;
}
#dice .arena {
	position: relative;
	display: grid;
	place-items: center;
	width: 280px;
	height: 260px;
}
.bounce {
	transform-style: preserve-3d;
	animation: dice-bounce 1.3s cubic-bezier(0.3, 0.7, 0.4, 1) both;
}
@keyframes dice-bounce {
	0% { transform: translate(-280px, -230px); }
	42% { transform: translate(18px, 0); }
	58% { transform: translate(10px, -46px); }
	74% { transform: translate(4px, 0); }
	86% { transform: translate(2px, -12px); }
	100% { transform: none; }
}
.cube {
	position: relative;
	width: 150px;
	height: 150px;
	transform-style: preserve-3d;
}
.cf6 {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	background: var(--g);
	border-radius: var(--r-xl);
	box-shadow: inset 0 0 0 2px rgb(0 0 0 / 0.15), inset 0 -10px 0 rgb(0 0 0 / 0.12);
	backface-visibility: hidden;
}
.cf6 .pips {
	width: 104px;
	height: 104px;
}
.cf6.f1 { transform: translateZ(75px); }
.cf6.f2 { transform: rotateY(90deg) translateZ(75px); }
.cf6.f3 { transform: rotateX(90deg) translateZ(75px); }
.cf6.f4 { transform: rotateX(-90deg) translateZ(75px); }
.cf6.f5 { transform: rotateY(-90deg) translateZ(75px); }
.cf6.f6 { transform: rotateY(180deg) translateZ(75px); }
.floor {
	position: absolute;
	bottom: 18px;
	left: 50%;
	width: 150px;
	height: 20px;
	margin-left: -75px;
	border-radius: 50%;
	background: rgb(0 0 0 / 0.5);
	filter: blur(7px);
	animation: floor 1.3s cubic-bezier(0.3, 0.7, 0.4, 1) both;
}
@keyframes floor {
	0% { transform: scale(0.3); opacity: 0.2; }
	42% { transform: scale(1); opacity: 1; }
	58% { transform: scale(0.75); opacity: 0.6; }
	74%, 100% { transform: scale(1); opacity: 1; }
}
.die.rolling {
	animation: tumble3d 1s cubic-bezier(0.25, 0.7, 0.35, 1) both;
}
@keyframes tumble3d {
	0% { transform: translate(-240px, -200px) rotateX(540deg) rotateY(360deg) rotateZ(-220deg) scale(0.4); }
	55% { transform: translate(24px, 10px) rotateX(30deg) rotateY(-20deg) rotateZ(10deg) scale(1.08); }
	78% { transform: translate(-6px, -3px) rotateX(-8deg) rotateY(6deg) scale(0.97); }
	100% { transform: none; }
}
/* whose turn: a rounded plate over the table, it pops in and drifts away */
#banner {
	left: calc((100vw - var(--side)) / 2);
	right: auto;
	translate: -50% -50%;
	padding: 22px 70px 16px;
	border: 2px solid var(--bc);
	border-radius: var(--r-xl);
	background: var(--panel);
	box-shadow: var(--shadow);
	animation: plate 1.7s var(--ease) forwards;
}
@keyframes plate {
	0% { opacity: 0; scale: 0.7; translate: -50% -50%; }
	18% { opacity: 1; scale: 1.05; translate: -50% -50%; }
	28% { scale: 1; }
	78% { opacity: 1; scale: 1; translate: -50% -50%; }
	100% { opacity: 0; scale: 0.96; translate: -50% -62%; }
}
@media (max-width: 900px) {
	#banner {
		left: 50%;
		padding: 16px 30px 12px;
	}
	#banner b {
		font-size: 54px;
	}
}
/* the cover flow fans in from the card in focus outwards */
.cf-item {
	animation: cf-in 0.55s var(--ease) both;
	animation-delay: calc(var(--d, 0) * 45ms);
}
@keyframes cf-in {
	from { opacity: 0; translate: 0 60px; }
}

/* ---- multiplayer: the room, the seats with live video, the deck check and the shuffle, the video tiles ---- */
.mp .slots {
	display: block;
}
.mono {
	font-family: var(--body);
	letter-spacing: 0.18em;
}
/* create a game, or join one with a code */
.mp-room {
	display: grid;
	gap: 22px;
	max-width: 900px;
	margin: 4vh auto 0;
}
.mp-name {
	display: grid;
	gap: 4px;
	max-width: 420px;
}
.mp-name input {
	font: 34px/1.1 var(--head);
	color: var(--g);
	background: none;
	border: 0;
	border-bottom: 1px dashed var(--line);
	padding: 0 0 2px;
}
.mp-ways {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 18px;
}
.mp-way {
	display: grid;
	align-content: start;
	gap: 12px;
	padding: 22px;
	border: 1px solid var(--line-soft);
	border-radius: var(--r-lg);
	background: var(--panel);
}
.mp-way h2 {
	margin: 0;
	font: 40px/1 var(--head);
	color: var(--g);
	font-weight: 400;
}
.mp-way p {
	margin: 0;
	color: var(--muted);
}
.mp-way .primary,
.mp-join {
	justify-self: start;
}
.mp-join {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}
.mp-join input {
	width: 7.5ch;
	padding: 6px 12px;
	font: 32px/1 var(--body);
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--g-hi);
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--r);
}
.mp-err {
	margin: 0;
	padding: 10px 14px;
	border: 1px solid var(--amber-dim);
	border-radius: var(--r);
	color: var(--amber);
}
/* the room code, its QR, the link */
.mp-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 18px;
	margin: 8px 0 18px;
	padding: 14px 18px;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: var(--panel);
	animation: rise 0.45s var(--ease);
}
.mp-code {
	display: grid;
	gap: 2px;
}
.mp-code b {
	font: 700 46px/1 var(--body);
	letter-spacing: 0.2em;
	color: var(--g);
}
#mpQr {
	border-radius: var(--r-sm);
	flex: none;
}
.mp-share {
	display: grid;
	gap: 8px;
	flex: 1 1 260px;
}
.mp-share p {
	margin: 0;
}
.mp-seats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
	gap: 18px;
	align-items: start;
}
.mp-cell {
	min-width: 0;
}
.mp .seat {
	grid-template-rows: auto auto auto auto 1fr;
	grid-template-areas: 'head head' 'cam cam' 'hero deck' 'hero cmdr' 'hero ready';
	animation: rise 0.45s var(--ease);
}
.mp .seat.them {
	--accent: var(--amber);
}
.mp .seat header {
	grid-template-columns: 1fr auto;
	align-items: end;
}
.mp .seat header small {
	grid-column: 1 / -1;
}
.cmdr-name {
	margin: 0;
	font-size: 14px;
}
.seat.empty {
	display: grid;
	grid-template-areas: none;
	grid-template-columns: 1fr;
	min-height: 360px;
	border-style: dashed;
	background: transparent;
}
.wait-seat {
	display: grid;
	place-items: center;
	align-content: center;
	gap: 12px;
	text-align: center;
	color: var(--muted);
}
.wait-seat p {
	margin: 0;
}
.wait-seat b {
	font: 700 34px/1 var(--body);
	color: var(--g);
}
.spin {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 3px solid var(--line-soft);
	border-top-color: var(--g);
	animation: spin 1s linear infinite;
}
@keyframes spin {
	to { rotate: 1turn; }
}
/* connection: green, amber while it tries again, red when gone */
.conn {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--g);
	flex: none;
	align-self: center;
}
.conn.wait {
	background: var(--amber);
	animation: blink 1s steps(2, jump-none) infinite;
}
.conn.off {
	background: var(--red);
}
@keyframes blink {
	50% { opacity: 0.25; }
}
/* video: another player's camera; the frame turns green while they talk */
.vslot {
	position: relative;
	display: grid;
	place-items: center;
	aspect-ratio: 16 / 10;
	width: 100%;
	overflow: hidden;
	border-radius: var(--r);
	background: var(--bg);
	border: 1px solid var(--line-soft);
	transition: border-color 0.15s, box-shadow 0.15s;
}
.vslot video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}
.vslot.has-video .novid {
	display: none;
}
.novid {
	padding: 0 12px;
	text-align: center;
	color: var(--faint);
	font-size: 13px;
}
.vslot.talking {
	border-color: var(--g);
	box-shadow: inset 0 0 0 2px var(--g);
}
.mp .seat .cam-slot,
.mp .seat .vslot {
	max-height: 30vh;
}
.av {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 32px;
}
.av small {
	color: var(--muted);
}
.lvl {
	position: relative;
	flex: 1 1 60px;
	max-width: 160px;
	height: 6px;
	border-radius: var(--r-pill);
	background: var(--line-soft);
	overflow: hidden;
}
.lvl::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: var(--g);
	transform-origin: left;
	scale: var(--lvl, 0) 1;
	transition: scale 0.1s linear;
}
.micbtn {
	width: 38px;
	height: 32px;
	padding: 0;
	flex: none;
}
.micbtn svg,
.vtile svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}
.micbtn .slash {
	opacity: 0;
}
.micbtn.off {
	color: var(--red);
	border-color: var(--red);
}
.micbtn.off .slash {
	opacity: 1;
}
.ptt {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--muted);
	cursor: pointer;
	white-space: nowrap;
}
/* the deck check and the shuffle: your camera and task on the left, the others' video large on the right */
#stRitual {
	padding-top: 8px;
}
.rit {
	display: grid;
	grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.4fr);
	gap: 18px;
	align-items: start;
}
.rit-me {
	display: grid;
	gap: 14px;
}
.cam-slot.big {
	max-height: none;
	aspect-ratio: 4 / 3;
}
.rit-task {
	display: grid;
	gap: 12px;
	padding: 18px;
	border: 1px solid var(--line-soft);
	border-radius: var(--r-lg);
	background: var(--panel);
	animation: rise 0.4s var(--ease);
}
.rit-task h2 {
	margin: 0;
	font: 40px/1 var(--head);
	color: var(--g);
	font-weight: 400;
}
.rit-task .lead {
	font-size: 15px;
}
.rit-task progress {
	width: 100%;
	height: 10px;
	appearance: none;
	border: 0;
	border-radius: var(--r-pill);
	background: var(--line-soft);
	overflow: hidden;
}
.rit-task progress::-webkit-progress-bar {
	background: var(--line-soft);
	border-radius: var(--r-pill);
}
.rit-task progress::-webkit-progress-value {
	background: var(--g);
	border-radius: var(--r-pill);
	transition: width 0.3s var(--ease);
}
.rit-prog,
.rit-res {
	margin: 0;
	font-size: 15px;
}
.rit-res {
	padding: 8px 12px;
	border-radius: var(--r);
	border: 1px solid var(--g-dim);
	color: var(--g);
}
.rit-res.bad {
	border-color: var(--amber-dim);
	color: var(--amber);
}
.rit-them {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
	gap: 14px;
}
.rit-p {
	display: grid;
	gap: 8px;
	min-width: 0;
}
.vslot.big {
	aspect-ratio: 4 / 3;
}
.rit-p footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
}
.rit-p footer b {
	font: 30px/1 var(--head);
	color: var(--amber);
	font-weight: 400;
}
.rit-st {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.st {
	padding: 4px 10px;
	border-radius: var(--r-pill);
	border: 1px solid var(--line);
	font-size: 13px;
	color: var(--muted);
	animation: pop-in 0.3s var(--ease);
}
.st.ok {
	border-color: var(--g-dim);
	color: var(--g);
}
.st.bad {
	border-color: var(--amber-dim);
	color: var(--amber);
}
/* "I've shuffled" fills up while you shuffle */
.shuffle-btn {
	position: relative;
	overflow: hidden;
}
.shuffle-btn span {
	position: relative;
}
.shuffle-btn .fill {
	position: absolute;
	inset: 0;
	background: rgb(255 255 255 / 0.3);
	transform-origin: left;
	scale: 0 1;
	animation: fill var(--d, 6s) linear var(--at, 0s) both;
}
.shuffle-btn:not(:disabled) .fill {
	display: none;
}
.shuffle-btn:disabled {
	opacity: 0.7;
}
@keyframes fill {
	to { scale: 1 1; }
}
#stHand .opp .ok {
	color: var(--g);
}
/* the other players' video over the table: drag to move, the corner to resize, double-click or ⤢ to enlarge */
#vtiles {
	position: fixed;
	inset: 0;
	z-index: 64;
	pointer-events: none;
	transition: background 0.3s;
}
#vtiles.dim {
	background: rgb(0 0 0 / 0.6);
	pointer-events: auto;
}
.vtile {
	position: absolute;
	display: grid;
	gap: 6px;
	padding: 6px;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: var(--panel);
	box-shadow: var(--shadow);
	pointer-events: auto;
	cursor: grab;
	touch-action: none;
	user-select: none;
	transition: left 0.4s var(--ease), top 0.4s var(--ease), width 0.4s var(--ease), border-color 0.15s;
	animation: pop-in 0.35s var(--ease);
}
.vtile.moving {
	cursor: grabbing;
	transition: none;
}
.vtile.big {
	cursor: default;
	z-index: 2;
}
.vtile header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 2px 0 6px;
	min-width: 0;
}
.vtile header b {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font: 22px/1 var(--head);
	color: var(--amber);
	font-weight: 400;
}
.vtile .icon {
	padding: 4px;
	border-radius: var(--r-sm);
}
.vtile .vslot {
	aspect-ratio: 16 / 9;
}
.vtile.talking {
	border-color: var(--g);
}
.vtile .grip {
	position: absolute;
	right: 2px;
	bottom: 2px;
	width: 18px;
	height: 18px;
	border-radius: 0 0 var(--r-lg) 0;
	cursor: nwse-resize;
	background: linear-gradient(135deg, transparent 50%, var(--line) 50% 60%, transparent 60% 70%, var(--line) 70% 80%, transparent 80%);
}
.vtile.big .grip {
	display: none;
}
/* the connection line at the top */
#mpBanner {
	position: fixed;
	top: 12px;
	left: 50%;
	translate: -50% 0;
	z-index: 70;
	display: grid;
	gap: 4px;
	max-width: min(92vw, 640px);
	padding: 10px 18px;
	border: 1px solid var(--amber-dim);
	border-radius: var(--r-lg);
	background: var(--panel);
	color: var(--amber);
	box-shadow: var(--shadow);
	animation: pop-in 0.3s var(--ease);
}
#mpBanner p {
	margin: 0;
}
/* the dock while another player decides */
.act .ask.waitfor {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--amber);
}
.waitfor .spin {
	width: 18px;
	height: 18px;
	border-width: 2px;
	border-top-color: var(--amber);
	flex: none;
}
/* who the chat writes to */
.chatto {
	display: inline-flex;
	align-self: flex-start;
	max-width: 100%;
	margin-bottom: 6px;
}
.chatto > button {
	display: block;
	flex: 0 1 auto;
	min-width: 0;
	padding: 3px 12px;
	font-size: 12px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
/* the volume in the game's settings: the look's green on a plain track */
#sfxVol,
#placeVol,
#musicVol {
	width: 100%;
	accent-color: var(--g);
}
#sfxVol:disabled,
#placeVol:disabled,
#musicVol:disabled {
	opacity: 0.4;
}
#animSel > button,
#sfxStyle > button {
	flex: 1 1 0;
	padding: 5px 14px;
	font-size: 13px;
	white-space: nowrap;
}
.msg .from {
	display: block;
	font-size: 11px;
	color: var(--amber);
}
.msg.them p {
	border-color: var(--amber-dim);
}
.msg.rules p {
	border-color: var(--cyan);
}
.msg.rules .from {
	color: var(--cyan);
}
/* four steps and a Leave button: the steps keep only the current label when the top gets narrow */
@media (max-width: 1240px) {
	.mp .lb-top {
		grid-template-columns: auto 1fr auto;
	}
	.mp .steps {
		justify-self: center;
	}
	.mp .steps li:not(.on) span {
		display: none;
	}
	.mp .steps li:not(.on) {
		padding: 5px;
	}
}
/* phones: Leave and the settings on one row, the steps below them */
@media (max-width: 600px) {
	.mp .lb-top {
		grid-template-columns: 1fr auto;
		grid-template-areas: 'back gear' 'steps steps';
		row-gap: 8px;
	}
	.mp .lb-top .back {
		grid-area: back;
	}
	.mp .lb-top .steps {
		grid-area: steps;
	}
	.mp .lb-top .icon {
		grid-area: gear;
	}
}
@media (max-width: 760px) {
	.rit {
		grid-template-columns: 1fr;
	}
	.mp .seat {
		grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1.3fr);
	}
	.mp-code b {
		font-size: 36px;
	}
}

/* reduced animations: things still change, but by short fades instead of motion */
html.reduced *,
html.reduced *::before,
html.reduced *::after {
	animation-duration: 1ms !important;
	animation-delay: 0s !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.12s !important;
	transition-delay: 0s !important;
}
.cf6 .pips {
	display: grid;
	grid-template: repeat(3, 1fr) / repeat(3, 1fr);
}
.cf6 .pips i {
	width: 24px;
	height: 24px;
	place-self: center;
	border-radius: 50%;
	background: var(--ink);
}
.sees {
	border-radius: var(--r-xs) var(--r-sm) var(--r-sm) var(--r-xs);
}
