/*
 * Scotland Yard Tracker. One stylesheet for the whole app: tokens, type, then the parts in the
 * order the pages use them. Fonts are self-hosted (SIL Open Font License, see assets/fonts).
 */

@font-face {
	font-family: 'Oswald';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('/assets/fonts/oswald/oswald-latin-ext-400-normal.woff2') format('woff2');
	unicode-range:
		U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
		U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
		U+A720-A7FF;
}
@font-face {
	font-family: 'Oswald';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('/assets/fonts/oswald/oswald-latin-400-normal.woff2') format('woff2');
	unicode-range:
		U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
		U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Oswald';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('/assets/fonts/oswald/oswald-latin-ext-700-normal.woff2') format('woff2');
	unicode-range:
		U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
		U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
		U+A720-A7FF;
}
@font-face {
	font-family: 'Oswald';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('/assets/fonts/oswald/oswald-latin-700-normal.woff2') format('woff2');
	unicode-range:
		U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
		U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Atkinson Hyperlegible';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('/assets/fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-ext-400-normal.woff2')
		format('woff2');
	unicode-range:
		U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
		U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
		U+A720-A7FF;
}
@font-face {
	font-family: 'Atkinson Hyperlegible';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('/assets/fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-400-normal.woff2')
		format('woff2');
	unicode-range:
		U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
		U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Atkinson Hyperlegible';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('/assets/fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-ext-700-normal.woff2')
		format('woff2');
	unicode-range:
		U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
		U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
		U+A720-A7FF;
}
@font-face {
	font-family: 'Atkinson Hyperlegible';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('/assets/fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-700-normal.woff2')
		format('woff2');
	unicode-range:
		U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
		U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
	color-scheme: light;

	/* Fog over the river: the page, the surfaces on it, and the ink they are printed in. */
	--fog: #e3e9ea;
	--paper: #f6f8f8;
	--ink: #12233a;
	--ink-soft: #3f4f63;
	--rule: #bfcbd1;
	/* The one loud color: what you tap to act, and where the game is right now. */
	--signal: #ffc928;
	--signal-ink: #12233a;
	--alert: #c2254c;
	--focus: #1b5fd0;
	/* The round in progress in a table, and the nearest piece in a round. */
	--now: rgb(255 201 40 / 0.3);
	--now-edge: transparent;
	--nearest: rgb(255 201 40 / 0.5);
	--nearest-ink: var(--ink);

	/* The tickets. A black ticket is black, like Mister X. */
	--taxi: #f2b400;
	--bus: #0b8a79;
	--underground: #d42f5a;
	--police: #4a5a6e;
	--police-ink: #fff;

	/* Mister X is the only thing on the page that is black. */
	--x: #000;
	--x-ink: #fff;
	--x-soft: #b9c1cc;
	/* The slab's edge: nothing on a light page; on a dark one, what keeps black apart from night. */
	--x-edge: #000;

	/* The detectives, in the order they sit down; each with the ink that reads on it. */
	--d0: #2a78d6;
	--d1: #eb6834;
	--d2: #1baf7a;
	--d3: #eda100;
	--d4: #e87ba4;
	--d5: #008300;
	--d0-ink: #fff;
	--d1-ink: #000;
	--d2-ink: #000;
	--d3-ink: #000;
	--d4-ink: #000;
	--d5-ink: #fff;

	--display: 'Oswald', 'Arial Narrow', 'Roboto Condensed', sans-serif;
	--body: 'Atkinson Hyperlegible', system-ui, sans-serif;

	--radius: 6px;
	--gap: 1rem;
}

@media (prefers-color-scheme: dark) {
	:root {
		color-scheme: dark;
		--fog: #0c1522;
		--paper: #16233a;
		--ink: #e9eef2;
		--ink-soft: #b1c0d0;
		--rule: #2e405b;
		--signal-ink: #12233a;
		--alert: #ff7d9c;
		--focus: #8ab8ff;
		/* Yellow under dark ink turns to mud: on a dark page the marks are edges and numerals. */
		--now: rgb(255 201 40 / 0.08);
		--now-edge: var(--signal);
		--nearest: rgb(255 201 40 / 0.14);
		--nearest-ink: var(--signal);
		--police: #647690;
		--police-ink: #fff;
		--x-soft: #9aa5b3;
		--x-edge: #52627e;
		--d0: #3987e5;
		--d1: #d95926;
		--d2: #199e70;
		--d3: #c98500;
		--d4: #d55181;
		--d5: #0ca30c;
		--d0-ink: #000;
		--d5-ink: #000;
	}
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	background: var(--fog);
	color: var(--ink);
	font: 400 1.0625rem/1.5 var(--body);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100dvh;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
fieldset {
	margin: 0;
	padding: 0;
}

ul,
ol {
	list-style: none;
}

h1,
h2,
h3,
h4 {
	font-family: var(--display);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0.005em;
}

h2 {
	font-size: 1.875rem;
}

h3 {
	font-size: 1.1875rem;
}

h4 {
	font-size: 1rem;
}

button,
input,
select {
	font: inherit;
	color: inherit;
}

fieldset {
	border: 0;
	min-width: 0;
}

legend {
	padding: 0;
	font-weight: 700;
}

:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}

.sy-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.sy-icon {
	width: 1.25em;
	height: 1.25em;
	flex: none;
}

.sy-hint,
.sy-muted {
	color: var(--ink-soft);
	font-size: 0.9375rem;
}

.sy-you {
	color: var(--ink-soft);
	font-weight: 400;
}

.sy-badge {
	display: inline-block;
	padding: 0.05rem 0.45rem;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
}

.sy-count {
	color: var(--ink-soft);
	font-family: var(--body);
	font-size: 0.9375rem;
	font-weight: 400;
}

/* Buttons and fields */

.sy-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 2.75rem;
	padding: 0.5rem 1.1rem;
	border: 2px solid var(--ink);
	border-radius: var(--radius);
	background: var(--paper);
	color: var(--ink);
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
}

.sy-button:hover:not(:disabled) {
	box-shadow: 3px 3px 0 var(--ink);
	translate: -1px -1px;
}

.sy-button:active:not(:disabled) {
	box-shadow: none;
	translate: 0 0;
}

.sy-button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.sy-button.sy-primary {
	background: var(--signal);
	border-color: #12233a;
	color: var(--signal-ink);
}

.sy-button.sy-quiet {
	border-color: var(--rule);
	background: transparent;
}

.sy-button.sy-quiet:hover:not(:disabled) {
	border-color: var(--ink);
	box-shadow: none;
	translate: 0 0;
}

.sy-button.sy-on-dark {
	border-color: var(--x-soft);
	background: transparent;
	color: var(--x-ink);
}

.sy-button.sy-on-dark:hover:not(:disabled) {
	border-color: var(--x-ink);
	box-shadow: none;
	translate: 0 0;
}

.sy-button.sy-large {
	min-height: 3.5rem;
	padding-inline: 1.75rem;
	font-size: 1.1875rem;
}

.sy-button[aria-pressed='true'] {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--paper);
}

.sy-icon-button {
	display: inline-grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 0;
	border-radius: var(--radius);
	background: transparent;
	color: var(--ink);
	cursor: pointer;
}

.sy-icon-button:hover {
	background: color-mix(in srgb, var(--ink) 10%, transparent);
}

.sy-link-button {
	padding: 0.25rem;
	border: 0;
	background: none;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
	cursor: pointer;
}

.sy-copy-done,
[data-copied='true'] > .sy-copy-label {
	display: none;
}

[data-copied='true'] > .sy-copy-done,
.sy-copy-label {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

input:not([type='checkbox'], [type='radio']),
select {
	width: 100%;
	min-height: 2.75rem;
	padding: 0.5rem 0.75rem;
	border: 2px solid var(--ink);
	border-radius: var(--radius);
	background: var(--paper);
}

input::placeholder {
	color: var(--ink-soft);
	opacity: 1;
}

/* A select drawn like the fields around it, with its own caret. */
select {
	appearance: none;
	padding-right: 2.25rem;
	background-image:
		linear-gradient(45deg, transparent 50%, currentColor 50%),
		linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position:
		right 1.05rem center,
		right 0.7rem center;
	background-size: 0.35rem 0.35rem;
	background-repeat: no-repeat;
}

input[type='checkbox'],
input[type='radio'] {
	width: 1.5rem;
	height: 1.5rem;
	margin: 0;
	accent-color: var(--ink);
	flex: none;
}

label {
	display: block;
	font-weight: 700;
}

label > input:not([type='checkbox'], [type='radio']) {
	margin-top: 0.35rem;
	font-weight: 400;
}

.sy-input-row {
	display: flex;
	gap: 0.5rem;
}

.sy-input-row > input,
.sy-input-row > select {
	flex: 1;
	min-width: 0;
}

/* Pawns and stations */

.sy-pawn {
	display: inline-grid;
	place-items: center;
	width: 1.625rem;
	height: 1.625rem;
	flex: none;
	border-radius: 50%;
	background: var(--pawn);
	color: var(--pawn-ink);
	font: 700 0.875rem/1 var(--display);
}

.sy-pawn[data-color='0'] {
	--pawn: var(--d0);
	--pawn-ink: var(--d0-ink);
}
.sy-pawn[data-color='1'] {
	--pawn: var(--d1);
	--pawn-ink: var(--d1-ink);
}
.sy-pawn[data-color='2'] {
	--pawn: var(--d2);
	--pawn-ink: var(--d2-ink);
}
.sy-pawn[data-color='3'] {
	--pawn: var(--d3);
	--pawn-ink: var(--d3-ink);
}
.sy-pawn[data-color='4'] {
	--pawn: var(--d4);
	--pawn-ink: var(--d4-ink);
}
.sy-pawn[data-color='5'] {
	--pawn: var(--d5);
	--pawn-ink: var(--d5-ink);
}

.sy-pawn-police {
	--pawn: var(--police);
	--pawn-ink: var(--police-ink);
	border-radius: 28%;
	font-size: 0.75rem;
}

.sy-pawn-x {
	--pawn: var(--x);
	--pawn-ink: var(--x-ink);
	box-shadow: 0 0 0 1.5px var(--x-ink);
}

.sy-station {
	display: inline-grid;
	place-items: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding-inline: 0.3rem;
	border: 2px solid currentColor;
	border-radius: 999px;
	font: 700 1.0625rem/1 var(--display);
	font-variant-numeric: tabular-nums;
	vertical-align: middle;
}

.sy-lines {
	display: flex;
	justify-content: center;
	gap: 3px;
	min-height: 0.5625rem;
}

.sy-line {
	display: inline-block;
	flex: none;
	width: 1.125rem;
	height: 0.5625rem;
	border-radius: 2px;
	background: var(--line);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 40%, transparent);
}

[data-ticket='taxi'] {
	--line: var(--taxi);
}
[data-ticket='bus'] {
	--line: var(--bus);
}
[data-ticket='underground'] {
	--line: var(--underground);
}
[data-ticket='black'] {
	--line: #000;
}
/* Black on a dark page would vanish: a ring in the ink's color keeps its edge. */
.sy-line[data-ticket='black'] {
	box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--ink) 65%, transparent);
}
/* A double move: two moves, two halves. */
.sy-line[data-ticket='double'] {
	background: linear-gradient(90deg, currentColor 42%, transparent 42% 58%, currentColor 58%);
	box-shadow: none;
}

/* A ticket that has run out, and, once a move is logged, the tickets it wasn't paid with. */
.sy-line[data-spent='true'],
.sy-station-button[aria-pressed='true'] .sy-line[data-paid='false'] {
	opacity: 0.25;
}

.sy-stations {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.sy-station-button {
	display: grid;
	gap: 0.3rem;
	justify-items: center;
	padding: 0.2rem;
	border: 0;
	border-radius: var(--radius);
	background: none;
	cursor: pointer;
}

.sy-station-button .sy-station {
	min-width: 3.5rem;
	height: 3.5rem;
	border-width: 3px;
	background: var(--paper);
	font-size: 1.5rem;
}

.sy-station-button:hover .sy-station {
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 70%, transparent);
}

.sy-station-button[aria-pressed='true'] .sy-station {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--paper);
	box-shadow: 0 0 0 4px var(--signal);
}

.sy-station-button[data-choosing='true'] .sy-station {
	box-shadow: 0 0 0 4px var(--signal);
}

.sy-station-button:disabled {
	cursor: not-allowed;
}

.sy-station-button:disabled .sy-station {
	border-style: dashed;
	box-shadow: none;
	opacity: 0.4;
}

/* Several tickets go to the station tapped: a sheet from the bottom edge asks which one. */
.sy-sheet {
	width: 100%;
	max-width: 100%;
	margin: auto 0 0;
	padding: 0;
	border: 0;
	border-top: 4px solid var(--ink);
	border-radius: 14px 14px 0 0;
	background: var(--paper);
	color: var(--ink);
	--focus: #1b5fd0;
}

.sy-sheet::backdrop {
	background: rgb(12 21 34 / 0.6);
}

.sy-sheet-body {
	display: grid;
	gap: 0.625rem;
	padding: 1.25rem 1rem calc(1rem + env(safe-area-inset-bottom));
}

@media (min-width: 40rem) {
	.sy-sheet {
		width: 24rem;
		margin: auto;
		border: 2px solid var(--ink);
		border-radius: var(--radius);
		box-shadow: 6px 6px 0 var(--ink);
	}
}

.sy-fare-to {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.25rem;
	font-size: 1.375rem;
}

.sy-fare {
	display: flex;
	align-items: center;
	gap: 0.875rem;
	width: 100%;
	min-height: 3.5rem;
	padding: 0.5rem 1rem;
	border: 2px solid var(--ink);
	border-radius: var(--radius);
	background: var(--paper);
	color: var(--ink);
	font-size: 1.1875rem;
	font-weight: 700;
	text-align: left;
	cursor: pointer;
}

/* The ticket itself, in its color. */
.sy-fare::before {
	content: '';
	flex: none;
	width: 2rem;
	height: 1.25rem;
	border-radius: 3px;
	background: var(--line);
	box-shadow: inset 0 0 0 1.5px color-mix(in srgb, currentColor 45%, transparent);
}

.sy-fare:hover {
	box-shadow: 3px 3px 0 var(--ink);
}

.sy-fare[aria-pressed='true'] {
	background: var(--ink);
	color: var(--paper);
}

.sy-fare-name {
	flex: 1;
	display: block;
}

.sy-fare-name::first-letter {
	text-transform: uppercase;
}

.sy-fare-left {
	font-size: 0.9375rem;
	font-weight: 400;
	opacity: 0.8;
}

/* How many of each ticket are left. */
.sy-tickets {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.25rem;
	font-size: 0.9375rem;
}

.sy-tickets li {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.sy-ticket-left {
	font: 700 1.125rem/1 var(--display);
	font-variant-numeric: tabular-nums;
}

.sy-tickets li[data-left='0'] {
	opacity: 0.5;
}

/* The line of rounds: one stop per round. */

.sy-round-line {
	display: flex;
	align-items: center;
	height: 2.25rem;
}

.sy-stop {
	position: relative;
	flex: 1;
	display: grid;
	place-items: center;
	height: 100%;
}

.sy-stop::before {
	content: '';
	position: absolute;
	inset: calc(50% - 2px) 0 auto;
	height: 4px;
	background: var(--rule);
}

.sy-stop:first-child::before {
	left: 50%;
}

.sy-stop:last-child::before {
	right: 50%;
}

.sy-stop[data-state='done']::before {
	background: var(--ink);
}

.sy-stop[data-state='current']::before {
	background: linear-gradient(90deg, var(--ink) 50%, var(--rule) 50%);
}

.sy-stop-number {
	position: relative;
	display: grid;
	place-items: center;
	width: 0.625rem;
	height: 0.625rem;
	border: 2px solid var(--rule);
	border-radius: 50%;
	background: var(--fog);
	color: transparent;
	font: 700 0 / 1 var(--display);
}

.sy-stop[data-state='done'] .sy-stop-number {
	border-color: var(--ink);
	background: var(--ink);
}

.sy-stop[data-state='current'] .sy-stop-number {
	width: 2rem;
	height: 2rem;
	border: 3px solid #12233a;
	background: var(--signal);
	color: var(--signal-ink);
	font-size: 1rem;
}

/* A double move is an interchange: a ring around the stop. */
.sy-stop[data-double='true'] .sy-stop-number {
	box-shadow:
		0 0 0 2px var(--fog),
		0 0 0 4px var(--ink);
}

/* The start page */

.sy-start {
	max-width: 46rem;
	margin-inline: auto;
	padding: clamp(1.5rem, 6vw, 4rem) 1.25rem 4rem;
	display: grid;
	gap: 2.5rem;
}

.sy-start-hero {
	display: grid;
	gap: 1.25rem;
	justify-items: start;
}

.sy-start-hero h1 {
	font-size: clamp(2.75rem, 11vw, 5.5rem);
	line-height: 0.95;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

.sy-start-line {
	width: 100%;
}

/* A picture of a game, not one in progress: its stop carries no number. */
.sy-start-line .sy-stop-number {
	color: transparent;
}

.sy-start-lead {
	max-width: 34rem;
	font-size: 1.1875rem;
}

.sy-start-pick {
	display: grid;
	gap: 0.5rem;
	max-width: 30rem;
}

@media (max-width: 40rem) {
	.sy-start-create {
		justify-self: stretch;
	}
}

.sy-kept-rooms {
	display: grid;
	gap: 0.75rem;
}

.sy-kept-rooms h2,
.sy-start-steps h2 {
	font-size: 1.1875rem;
}

.sy-kept-room {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
	padding-block: 0.75rem;
	border-top: 1px solid var(--rule);
}

.sy-kept-room-text {
	flex: 1 1 14rem;
	display: grid;
	min-width: 0;
}

.sy-kept-room-name {
	font-weight: 700;
	overflow-wrap: anywhere;
}

.sy-kept-room-meta {
	color: var(--ink-soft);
	font-size: 0.9375rem;
}

.sy-start-steps {
	counter-reset: step;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 1.5rem 2rem;
	padding-top: 2rem;
	border-top: 4px solid var(--ink);
}

.sy-start-steps li {
	counter-increment: step;
	display: grid;
	grid-template-columns: 2.25rem 1fr;
	column-gap: 0.75rem;
	align-items: start;
}

.sy-start-steps li::before {
	content: counter(step);
	grid-row: span 2;
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	border: 2px solid var(--ink);
	border-radius: 50%;
	font: 700 1.0625rem/1 var(--display);
}

.sy-start-steps p {
	color: var(--ink-soft);
	font-size: 0.9375rem;
}

/* The room */

.sy-room {
	max-width: 70rem;
	margin-inline: auto;
	padding: 0.75rem 1rem 4rem;
	display: grid;
	gap: 1.25rem;
}

.sy-room-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding-bottom: 0.5rem;
	border-bottom: 4px solid var(--ink);
}

.sy-room-title {
	display: grid;
	min-width: 0;
}

.sy-home {
	color: var(--ink-soft);
	font-size: 0.875rem;
	text-decoration: none;
}

.sy-home:hover {
	text-decoration: underline;
}

/* The name people read out to whoever joins: two lines before it is cut. */
.sy-room-name {
	display: -webkit-box;
	overflow: hidden;
	font-size: 1.375rem;
	overflow-wrap: anywhere;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

.sy-room-actions {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	flex: none;
}

.sy-profile-button {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	max-width: 11rem;
	min-height: 2.75rem;
	padding: 0.25rem 0.75rem;
	border: 2px solid var(--rule);
	border-radius: var(--radius);
	background: transparent;
	font-weight: 700;
	cursor: pointer;
}

.sy-profile-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sy-caret {
	width: 0.625rem;
	flex: none;
}

.sy-menu {
	position: fixed;
	inset: 4rem 1rem auto auto;
	width: min(18rem, calc(100vw - 2rem));
	margin: 0;
	padding: 1rem;
	border: 2px solid var(--ink);
	border-radius: var(--radius);
	background: var(--paper);
	color: var(--ink);
	box-shadow: 4px 4px 0 var(--ink);
}

.sy-menu:popover-open {
	display: grid;
	gap: 1rem;
}

.sy-room-status {
	padding-block: 2rem;
	font-size: 1.1875rem;
}

.sy-stranded {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
}

.sy-stranded p {
	flex-basis: 100%;
}

.sy-notices {
	display: grid;
	gap: 0.5rem;
}

.sy-notice {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.625rem 0.875rem;
	border-left: 4px solid var(--ink);
	background: var(--paper);
}

.sy-notice.sy-error {
	border-left-color: var(--alert);
}

.sy-room-layout {
	display: grid;
	gap: 2rem;
	align-items: start;
}

.sy-stage {
	min-width: 0;
}

/*
 * A wide page. In the lobby the people sit beside the seats. In a game the columns are the game's
 * own, and the people are a strip below it.
 */
@media (min-width: 60rem) {
	.sy-room[data-phase='lobby'] .sy-room-layout {
		grid-template-columns: minmax(0, 1fr) 17rem;
		gap: 3rem;
	}

	.sy-room:not([data-phase='lobby']) .sy-people ul {
		display: flex;
		flex-wrap: wrap;
		gap: 0.5rem 2.5rem;
		padding-top: 0.75rem;
		border-top: 1px solid var(--rule);
	}

	.sy-room:not([data-phase='lobby']) .sy-person {
		display: flex;
		gap: 0.5rem;
		padding-block: 0;
		border-top: 0;
	}

	.sy-round,
	.sy-result {
		grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
		column-gap: 3rem;
		align-items: start;
	}

	.sy-result-head,
	.sy-result .sy-log-section,
	.sy-result-actions {
		grid-column: 1 / -1;
	}

	/* The moves beside the tickets; everything else runs the page's width. */
	.sy-round > * {
		grid-column: 1 / -1;
	}

	.sy-round > .sy-round-main {
		grid-area: 4 / 1;
	}

	.sy-round > .sy-tickets-section {
		grid-area: 4 / 2;
	}

	.sy-round > .sy-log-section {
		grid-row: 5;
	}

	.sy-round > .sy-round-actions {
		grid-row: 6;
	}
}

/* Everyone in the room */

.sy-people {
	display: grid;
	gap: 0.5rem;
}

.sy-people h2 {
	font-size: 1.1875rem;
}

.sy-person {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.15rem 0.75rem;
	align-items: center;
	padding-block: 0.6rem;
	border-top: 1px solid var(--rule);
}

.sy-person[data-connected='false'] .sy-person-name {
	color: var(--ink-soft);
}

.sy-person-name {
	font-weight: 700;
	overflow-wrap: anywhere;
}

.sy-person-seats {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	justify-self: end;
}

.sy-person-watching {
	color: var(--ink-soft);
	font-size: 0.875rem;
}

.sy-person-badges {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	color: var(--ink-soft);
}

.sy-person-badges:empty {
	display: none;
}

/* The lobby */

.sy-lobby,
.sy-round,
.sy-result {
	display: grid;
	gap: 1.75rem;
}

/* Mister X's seat and panel: the black slab. */
.sy-x-seat,
.sy-x-panel {
	display: grid;
	gap: 1rem;
	padding: 1.25rem;
	border: 1px solid var(--x-edge);
	border-radius: var(--radius);
	background: var(--x);
	color: var(--x-ink);
	--focus: var(--signal);
}

.sy-x-seat-who {
	display: flex;
	align-items: center;
	gap: 0.875rem;
}

.sy-x-seat-who .sy-pawn {
	width: 3rem;
	height: 3rem;
	font-size: 1.625rem;
	box-shadow: 0 0 0 2px var(--x-ink);
}

.sy-x-seat h3 {
	font-size: 1.625rem;
}

.sy-x-seat-holder {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	color: var(--x-soft);
}

.sy-x-seat[data-taken='true'] .sy-x-seat-holder {
	color: var(--x-ink);
	font-weight: 700;
}

.sy-x-seat .sy-you {
	color: var(--x-soft);
}

.sy-x-seat-note,
.sy-x-private {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	color: var(--x-soft);
	font-size: 0.9375rem;
}

.sy-x-seat-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.sy-x-seat-actions:empty {
	display: none;
}

.sy-seats,
.sy-lobby-start,
.sy-invite {
	display: grid;
	gap: 0.75rem;
	justify-items: start;
}

.sy-detectives {
	width: 100%;
	border-bottom: 1px solid var(--rule);
}

.sy-detective {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-height: 3.5rem;
	padding-block: 0.4rem;
	border-top: 1px solid var(--rule);
}

.sy-detective .sy-pawn {
	width: 2rem;
	height: 2rem;
	font-size: 1.0625rem;
}

.sy-detective-text {
	flex: 1;
	display: grid;
	min-width: 0;
}

.sy-detective-name {
	font-weight: 700;
	overflow-wrap: break-word;
}

.sy-detective-owner {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	color: var(--ink-soft);
	font-size: 0.875rem;
}

.sy-rename {
	flex: 1;
	display: flex;
	gap: 0.5rem;
	min-width: 0;
}

.sy-add-detective {
	display: grid;
	gap: 0.4rem;
	justify-items: start;
}

/* The start stays at the foot of the screen while the seats scroll. */
.sy-lobby-start {
	position: sticky;
	bottom: 0;
	z-index: 2;
	padding-block: 1rem calc(1rem + env(safe-area-inset-bottom));
	border-top: 4px solid var(--ink);
	background: var(--fog);
}

@media (max-width: 59.99rem) {
	.sy-lobby-start {
		margin-inline: -1rem;
		padding-inline: 1rem;
	}

	.sy-start-game {
		justify-self: stretch;
	}
}

.sy-invite {
	grid-template-columns: 1fr;
	color: var(--ink-soft);
}

/* A round */

.sy-round-head {
	display: grid;
	gap: 0.75rem;
}

.sy-round-head h2 {
	font-size: 2.75rem;
	line-height: 1;
}

.sy-round-of {
	color: var(--ink-soft);
	font-size: 1.1875rem;
	font-weight: 400;
}

/*
 * What the round waits for stays at the top of the screen while the page scrolls: the one line
 * everyone at the table asks for.
 */
.sy-round-status {
	position: sticky;
	top: 0;
	z-index: 3;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 0.5rem;
	min-height: 2.75rem;
	margin-block: -1rem;
	padding-block: 0.5rem;
	background: var(--fog);
	color: var(--ink-soft);
}

@media (max-width: 59.99rem) {
	.sy-round-status {
		margin-inline: -1rem;
		padding-inline: 1rem;
	}
}

.sy-round-status strong {
	color: var(--ink);
}

.sy-round-status[data-yours='true'] span {
	padding: 0.05rem 0.5rem;
	border-radius: 4px;
	background: var(--signal);
	color: var(--signal-ink);
	font-weight: 700;
}

/* The round closing: a line of text over a bar that runs out. */
.sy-countdown {
	color: var(--ink);
	font-weight: 700;
}

.sy-countdown::before,
.sy-countdown::after {
	content: '';
	position: absolute;
	inset: auto 0 0;
	height: 6px;
	background: var(--rule);
}

.sy-countdown::after {
	background: var(--ink);
	transform-origin: left;
}

.sy-double-note {
	padding: 0.5rem 0.75rem;
	border: 2px solid var(--ink);
	border-radius: var(--radius);
}

.sy-watching {
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--ink);
	background: var(--paper);
}

.sy-round-main {
	display: grid;
	gap: 1.5rem;
	align-content: start;
	min-width: 0;
}

/* A move still to make is the heavy panel; one that is logged folds to a light one. */
.sy-move {
	display: grid;
	gap: 0.875rem;
	justify-items: start;
	padding-top: 1.25rem;
	border-top: 4px solid var(--ink);
}

.sy-move[data-moved='true'] {
	gap: 0.5rem;
	padding-top: 0.875rem;
	border-top: 1px solid var(--rule);
}

.sy-move-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	width: 100%;
}

.sy-move[data-moved='true'] h3 {
	font-size: 1.1875rem;
}

.sy-move[data-moved='true'] h3 .sy-pawn {
	width: 1.625rem;
	height: 1.625rem;
	font-size: 0.875rem;
}

.sy-to-move {
	flex: none;
	padding: 0.15rem 0.65rem;
	border-radius: 999px;
	background: var(--signal);
	color: var(--signal-ink);
	font-size: 0.875rem;
	font-weight: 700;
}

.sy-moved {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	width: 100%;
}

.sy-moved-text,
.sy-moved-ticket,
.sy-stays-list li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 0.5rem;
}

.sy-moved-ticket {
	color: var(--ink-soft);
}

.sy-stays-list {
	display: grid;
	gap: 0.5rem;
}

.sy-stays-name {
	font-weight: 700;
}

.sy-move h3,
.sy-x-panel h3 {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 1.5rem;
}

.sy-move h3 .sy-pawn {
	width: 2rem;
	height: 2rem;
	font-size: 1.0625rem;
}

.sy-route {
	display: grid;
	gap: 0.75rem;
}

.sy-route-from {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--ink-soft);
}

.sy-route-from .sy-station {
	color: var(--ink);
}

.sy-station-form {
	display: grid;
	gap: 0.35rem;
	width: min(100%, 20rem);
}

.sy-station-form input {
	font: 700 1.375rem/1 var(--display);
}

.sy-station-form select {
	flex: none;
	width: auto;
}

/* On the black slab, everything is drawn in white, and the picked station in the signal color. */
.sy-x-panel-head {
	display: grid;
	gap: 0.35rem;
}

.sy-x-panel .sy-route-from {
	color: var(--x-soft);
}

.sy-x-panel .sy-line[data-ticket='black'] {
	box-shadow: 0 0 0 1.5px var(--x-ink);
}

.sy-x-panel select {
	border-color: var(--x-ink);
	background: var(--x);
	color: var(--x-ink);
}

.sy-x-panel .sy-route-from .sy-station {
	color: var(--x-ink);
}

.sy-x-panel .sy-station-button .sy-station {
	background: var(--x);
	color: var(--x-ink);
}

.sy-x-panel .sy-station-button[aria-pressed='true'] .sy-station {
	background: var(--signal);
	border-color: var(--signal);
	color: var(--signal-ink);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 40%, transparent);
}

.sy-x-panel input:not([type='checkbox']) {
	border-color: var(--x-ink);
	background: var(--x);
	color: var(--x-ink);
}

.sy-x-panel input::placeholder {
	color: var(--x-soft);
}

.sy-x-panel input[type='checkbox'],
.sy-x-seat input[type='checkbox'] {
	accent-color: var(--signal);
}

.sy-double-toggle,
.sy-x-toggle {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding-top: 1rem;
	border-top: 1px solid #3a3a3a;
	font-weight: 400;
	cursor: pointer;
}

.sy-x-toggle {
	align-items: flex-start;
	color: var(--x-soft);
	font-size: 0.9375rem;
}

.sy-x-toggle strong {
	display: block;
	color: var(--x-ink);
	font-size: 1rem;
}

.sy-x-toggle input {
	margin-top: 0.2rem;
}

/* The cover over Mister X's panel: whether he has moved, and the way in. */
.sy-x-cover-state {
	font-weight: 700;
}

.sy-x-reveal,
.sy-x-cover-again {
	justify-self: start;
}

.sy-double-toggle[data-disabled='true'] {
	color: var(--x-soft);
	cursor: not-allowed;
}

.sy-x-distances {
	display: grid;
	gap: 0.5rem;
	padding-top: 1rem;
	border-top: 1px solid #3a3a3a;
}

.sy-x-distances h4 {
	color: var(--x-soft);
	font: 400 0.9375rem/1.4 var(--body);
}

.sy-x-distances ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
}

.sy-x-distances li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.sy-x-distance {
	font-weight: 700;
}

.sy-x-distances li[data-distance='0'] .sy-x-distance,
.sy-x-distances li[data-distance='1'] .sy-x-distance {
	color: var(--signal);
}

.sy-tickets-section,
.sy-log-section,
.sy-chart-section,
.sy-table-section {
	display: grid;
	gap: 0.75rem;
	min-width: 0;
}

.sy-pieces {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
}

/* A piece still to move is a dashed outline; one that has moved is filled in, with its tick. */
.sy-piece {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 2rem;
	padding: 0.15rem 0.6rem 0.15rem 0.25rem;
	border: 1.5px dashed var(--ink-soft);
	border-radius: 999px;
	color: var(--ink-soft);
	font-size: 0.9375rem;
}

.sy-piece .sy-pawn {
	width: 1.5rem;
	height: 1.5rem;
	font-size: 0.8125rem;
}

.sy-piece .sy-pawn-police {
	font-size: 0.6875rem;
}

.sy-piece .sy-icon {
	width: 1.1em;
	height: 1.1em;
}

.sy-piece-name {
	font-weight: 700;
}

.sy-piece-state {
	font-size: 0.875rem;
}

.sy-piece[data-moved='true'] {
	border-style: solid;
	border-color: var(--ink);
	background: var(--paper);
	color: var(--ink);
}

/* Yours, and still to move: the signal color says where to act. */
.sy-piece[data-mine='true'][data-moved='false'] {
	border-color: var(--ink);
	box-shadow: 0 0 0 3px var(--signal);
	color: var(--ink);
}

.sy-round-actions,
.sy-result-actions {
	display: grid;
	gap: 0.5rem;
	justify-items: start;
	padding-top: 1.5rem;
	border-top: 1px solid var(--rule);
}

/* The travel log and the table of distances */

/* A table cut off at the screen's edge fades there while it has more to scroll to. */
.sy-log-scroll[data-more='true'] {
	-webkit-mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent);
	mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent);
}

/* Positioned, so that text hidden for screen readers in a cell scrolls with it and can't widen the page. */
.sy-log-scroll {
	position: relative;
	max-width: 100%;
	overflow-x: auto;
	border-radius: var(--radius);
}

.sy-log,
.sy-ticket-table,
.sy-distances {
	border-collapse: separate;
	border-spacing: 0;
	font-variant-numeric: tabular-nums;
}

/* Every table is at least as wide as the page's column, so they share its edges. */
.sy-log,
.sy-distances {
	min-width: 100%;
}

.sy-log th,
.sy-log td,
.sy-ticket-table th,
.sy-ticket-table td,
.sy-distances th,
.sy-distances td {
	height: 2.5rem;
	padding: 0 0.5rem;
	border-bottom: 1px solid var(--rule);
	text-align: center;
	white-space: nowrap;
}

.sy-log thead th,
.sy-ticket-table thead th,
.sy-distances thead th {
	height: 2rem;
	color: var(--ink-soft);
	font-size: 0.875rem;
	font-weight: 400;
	vertical-align: bottom;
}

/* The round numbers are the key to the log: in the numerals' face, at their size. */
.sy-log thead th {
	font: 400 1rem/1 var(--display);
	padding-bottom: 0.3rem;
}

/* With room for it, the log is the whole sheet: a box for every round, those ahead still empty. */
.sy-log[data-whole='true'] {
	width: 100%;
}

.sy-log[data-whole='true'] .sy-log-cell {
	min-width: 2.125rem;
}

.sy-log thead th[data-ahead='true'] {
	opacity: 0.7;
}

/* The round in progress: its column starts under a mark in the signal color. */
.sy-log thead th[data-open='true'] {
	box-shadow: inset 0 -3px 0 var(--signal);
	color: var(--ink);
	font-weight: 700;
}

.sy-log thead th[data-double='true'] {
	color: var(--ink);
	font-weight: 700;
	text-decoration: underline double;
	text-underline-offset: 0.2em;
}

.sy-log tbody th,
.sy-ticket-table tbody th,
.sy-distances tbody th,
.sy-distances tfoot th {
	position: sticky;
	left: 0;
	z-index: 1;
	background: var(--fog);
	text-align: left;
}

.sy-log tbody th,
.sy-ticket-table tbody th {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding-inline: 0.25rem 0.75rem;
}

.sy-log-name {
	max-width: 7rem;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sy-log-cell {
	min-width: 2.5rem;
	font: 700 1.0625rem/1 var(--display);
}

.sy-log-cell[data-stays='true'] {
	color: var(--ink-soft);
	font-weight: 400;
}

.sy-log-cell[data-open='true'] {
	background: var(--now);
	box-shadow:
		inset 2px 0 0 var(--now-edge),
		inset -2px 0 0 var(--now-edge);
}

.sy-log-x th,
.sy-log-x td {
	border-bottom-color: var(--x);
	background: var(--x);
	box-shadow:
		inset 0 1px 0 var(--x-edge),
		inset 0 -1px 0 var(--x-edge);
	color: var(--x-ink);
}

.sy-log tbody .sy-log-x th,
.sy-ticket-table tbody .sy-log-x th {
	background: var(--x);
}

/* A station in the log, over the ticket that paid for the way there. */
.sy-log-entry {
	display: inline-grid;
	justify-items: center;
	gap: 3px;
}

.sy-log-entry .sy-line {
	width: 1.125rem;
	height: 0.3125rem;
}

.sy-log-x .sy-line[data-ticket='black'] {
	box-shadow: 0 0 0 1px var(--x-ink);
}

.sy-ticket-table thead th {
	padding-block: 0.3rem;
}

.sy-ticket-head {
	display: block;
	margin-top: 0.2rem;
	font: 400 0.9375rem/1.2 var(--display);
	letter-spacing: 0.01em;
}

/* Three columns for everyone, as wide as a phone and no wider. */
.sy-ticket-table {
	width: 100%;
	max-width: 26rem;
	table-layout: fixed;
}

.sy-ticket-table th:first-child {
	width: 40%;
}

.sy-ticket-table thead th {
	padding-inline: 0;
}

.sy-ticket-table th,
.sy-ticket-table td {
	padding-inline: 0.25rem;
}

.sy-ticket-table tbody th {
	display: table-cell;
	max-width: none;
}

.sy-row-head {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
}

.sy-ticket-table td {
	font: 700 1.0625rem/1 var(--display);
}

/* What only Mister X holds: a second line in his row. */
.sy-ticket-table .sy-x-extras td {
	height: auto;
	padding: 0 0.5rem 0.6rem 2.375rem;
	font: 400 0.9375rem/1.3 var(--body);
	text-align: left;
	white-space: normal;
}

.sy-x-extras .sy-tickets {
	gap: 0.35rem 1.75rem;
}

.sy-log-x:has(+ .sy-x-extras) th,
.sy-log-x:has(+ .sy-x-extras) td {
	height: 2.25rem;
	box-shadow: inset 0 1px 0 var(--x-edge);
}

.sy-ticket-table .sy-x-extras td {
	box-shadow: inset 0 -1px 0 var(--x-edge);
}

.sy-ticket-table td[data-left='0'] {
	font-weight: 400;
	opacity: 0.5;
}

.sy-log-x .sy-log-cell[data-open='true'] {
	background: var(--x);
	box-shadow: inset 0 -4px 0 var(--signal);
}

/* A logged move nobody else may read: the ticket it was paid with, face down on the log. */
.sy-seal {
	display: inline-block;
	width: 1.25rem;
	height: 0.8125rem;
	border-radius: 2px;
	background: var(--x-ink);
	vertical-align: middle;
}

.sy-seal[data-ticket='taxi'] {
	background: var(--taxi);
}
.sy-seal[data-ticket='bus'] {
	background: var(--bus);
}
.sy-seal[data-ticket='underground'] {
	background: var(--underground);
}
.sy-seal[data-ticket='black'] {
	background: #000;
	box-shadow: 0 0 0 1.5px var(--x-ink);
}

.sy-pending {
	display: inline-block;
	width: 0.75rem;
	height: 0.75rem;
	border: 2px dotted currentColor;
	border-radius: 50%;
	opacity: 0.6;
	vertical-align: middle;
}

.sy-distances thead th {
	padding-block: 0.4rem;
}

.sy-distances thead th > span:last-child {
	display: -webkit-box;
	max-width: 6.5rem;
	margin-inline: auto;
	overflow: hidden;
	color: var(--ink);
	font-weight: 700;
	line-height: 1.15;
	white-space: normal;
	overflow-wrap: break-word;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

/* The round and where Mister X stood stay in view while the pieces scroll by. */
.sy-distances tr > :first-child {
	position: sticky;
	left: 0;
	z-index: 1;
	width: 4.75rem;
	min-width: 4.75rem;
	max-width: 4.75rem;
	background: var(--fog);
}

.sy-distances .sy-distances-x {
	position: sticky;
	left: 4.75rem;
	z-index: 1;
	min-width: 4.75rem;
}

.sy-distances td {
	min-width: 3.5rem;
	font: 400 1.0625rem/1 var(--display);
}

.sy-distances .sy-distances-x {
	background: var(--x);
	border-bottom-color: var(--x);
	box-shadow:
		inset 1px 0 0 var(--x-edge),
		inset -1px 0 0 var(--x-edge);
	color: var(--x-ink);
	font-weight: 700;
}

.sy-distances thead .sy-distances-x > span:last-child {
	color: var(--x-ink);
}

.sy-distances td[data-nearest='true'] {
	background: var(--nearest);
	color: var(--nearest-ink);
	font-weight: 700;
}

.sy-distances td[data-caught='true'] {
	background: var(--signal);
	color: var(--signal-ink);
}

.sy-distances tfoot th,
.sy-distances tfoot td {
	height: 3.25rem;
	border-top: 3px solid var(--ink);
	border-bottom: 0;
}

.sy-distances tfoot strong {
	display: block;
	font-size: 1.375rem;
}

.sy-closest-round {
	color: var(--ink-soft);
	font: 400 0.8125rem/1.2 var(--body);
}

/* The result */

.sy-result-head {
	display: grid;
	gap: 0.5rem;
}

.sy-result-head h2 {
	color: var(--ink-soft);
	font-size: 1.1875rem;
}

.sy-verdict {
	max-width: 22ch;
	font: 700 clamp(2rem, 7vw, 3.25rem) / 1.05 var(--display);
	text-wrap: balance;
}

.sy-verdict.sy-waiting-log {
	max-width: 34rem;
	font: 400 1.1875rem/1.5 var(--body);
}

.sy-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.sy-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	min-height: 2.25rem;
	padding: 0.15rem 0.7rem 0.15rem 0.3rem;
	border: 2px solid transparent;
	border-radius: 999px;
	background: none;
	cursor: pointer;
}

.sy-legend-item:hover {
	border-color: var(--rule);
}

.sy-legend-item[aria-pressed='true'] {
	border-color: var(--ink);
	font-weight: 700;
}

.sy-chart {
	position: relative;
	padding: 0.5rem 0.25rem 0.25rem;
	border-radius: var(--radius);
	background: var(--paper);
}

.sy-chart svg {
	display: block;
	width: 100%;
	height: auto;
	touch-action: pan-y;
}

.sy-grid line {
	stroke: var(--rule);
	stroke-width: 1;
}

/* Zero is where a line ends that caught Mister X: the baseline stays quieter than that line. */
.sy-grid line[data-zero='true'] {
	stroke: var(--ink-soft);
}

.sy-axis text {
	fill: var(--ink-soft);
	font: 400 12px var(--body);
}

.sy-crosshair {
	stroke: var(--ink);
	stroke-width: 1;
}

.sy-series path {
	fill: none;
	stroke: var(--series);
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.sy-series-dot {
	fill: var(--series);
	stroke: var(--paper);
	stroke-width: 2;
}

.sy-series[data-color='0'] {
	--series: var(--d0);
	--series-ink: var(--d0-ink);
}
.sy-series[data-color='1'] {
	--series: var(--d1);
	--series-ink: var(--d1-ink);
}
.sy-series[data-color='2'] {
	--series: var(--d2);
	--series-ink: var(--d2-ink);
}
.sy-series[data-color='3'] {
	--series: var(--d3);
	--series-ink: var(--d3-ink);
}
.sy-series[data-color='4'] {
	--series: var(--d4);
	--series-ink: var(--d4-ink);
}
.sy-series[data-color='5'] {
	--series: var(--d5);
	--series-ink: var(--d5-ink);
}

/* Policemen wear no color: their lines are told apart by their dashes. */
.sy-series[data-kind='police'] {
	--series: var(--police);
	--series-ink: var(--police-ink);
}

/* Each line ends in its piece's pawn. */
.sy-series-end circle,
.sy-series-end rect {
	fill: var(--series);
	stroke: var(--paper);
	stroke-width: 1.5;
}

.sy-series-end text {
	fill: var(--series-ink);
	font: 700 11px var(--display);
}

.sy-series-end text[data-police='true'] {
	font-size: 9px;
}
.sy-series[data-kind='police'][data-color='0'] path {
	stroke-dasharray: 8 5;
}
.sy-series[data-kind='police'][data-color='1'] path {
	stroke-dasharray: 2 6;
}

.sy-series[data-faded='true'] {
	opacity: 0.18;
}

.sy-legend-value {
	min-width: 1.5rem;
	padding: 0.1rem 0.35rem;
	border-radius: 999px;
	background: var(--ink);
	color: var(--paper);
	font: 700 0.9375rem/1.2 var(--display);
	text-align: center;
}

.sy-chart-readout {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	min-height: 1.75rem;
	color: var(--ink-soft);
}

.sy-chart-readout strong {
	color: var(--ink);
}

/* Dialogs */

.sy-dialog {
	width: min(26rem, calc(100vw - 2rem));
	padding: 1.5rem;
	border: 2px solid var(--ink);
	border-radius: var(--radius);
	background: var(--paper);
	color: var(--ink);
	box-shadow: 6px 6px 0 var(--ink);
}

.sy-dialog::backdrop {
	background: rgb(12 21 34 / 0.6);
}

.sy-dialog[open],
.sy-name-prompt {
	display: grid;
	gap: 1.1rem;
}

.sy-dialog h2 {
	font-size: 1.5rem;
}

.sy-dialog fieldset {
	display: grid;
	gap: 0.5rem;
}

.sy-choice {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	min-height: 2.75rem;
	font-weight: 400;
}

.sy-dialog .sy-input-row {
	flex-wrap: wrap;
}

.sy-dialog .sy-input-row > select {
	flex: 1 1 10rem;
}

.sy-dialog-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem;
}

/* Skipping is possible, and out of the way of the button that saves. */
.sy-skip-name {
	margin-right: auto;
	min-height: 2.75rem;
	color: var(--ink-soft);
}

.sy-noscript {
	padding: 2rem;
}

@media (prefers-reduced-motion: no-preference) {
	.sy-button {
		transition:
			box-shadow 0.1s,
			translate 0.1s;
	}

	/* The round closing: the one thing on the page that moves by itself. */
	.sy-countdown::after {
		animation: sy-run-out 3s linear forwards;
	}
}

@keyframes sy-run-out {
	to {
		transform: scaleX(0);
	}
}
