/* The demo archive (/demos/): plain CSS on the theme variables of app.css, loaded by its pages only, so it needs
   no Tailwind build. */

.demos {
	--demo-danger: #e5674f;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.demos-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

/* The links of the page body are light and underlined; a link that is a button keeps the colours of the button. */
.demos a.button {
	text-decoration: none;
}

.demos a.button-primary,
.demos a.button-primary:hover {
	color: var(--color-primary-foreground);
}

.demos a.button-muted {
	color: var(--color-foreground);
}

.demos a.button-muted:hover {
	color: var(--color-white);
}

.demos-filter .button-muted {
	background: var(--color-card);
}

.demos-filter .button-muted:hover {
	background: var(--color-accent);
}

.demos-title {
	margin: 0;
	font-size: 26px;
	font-weight: 800;
	line-height: 1.25;
	color: var(--color-white);
}

.demos-subtitle {
	margin: 0;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.3;
	color: var(--color-white);
}

.demos-label {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	color: var(--color-foreground);
}

.demos-hint {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--color-muted-foreground);
}

/* Secondary words inside a line keep its size and only fade, so that links and text of one line match. */
.demos-muted {
	color: var(--color-muted-foreground);
}

.demos-note {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin: 0;
	padding: 0.75rem 1rem;
	border-radius: 14px;
	background: var(--color-muted);
	font-size: 14px;
}

.demos-note.is-hidden {
	color: var(--color-primary);
}

.demos-note .icon {
	flex-shrink: 0;
	margin-top: 0.15rem;
}

.demos-block {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.demos-block p {
	margin: 0;
}

/* The filter is rows of groups, two fields a row, one on a phone: the column count goes by the width of the form, as
   the column of the content is narrower on a desktop than on a tablet. */
.demos-filter {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin: 0;
	padding: 1rem;
	border-radius: 16px;
	background: var(--color-muted);
	container-type: inline-size;
}

.demos-filter-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.625rem 0.75rem;
}

@container (min-width: 18rem) {
	.demos-filter-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.demos-groups {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.demos-group {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.demos-group legend {
	margin-bottom: 0.375rem;
	padding: 0;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--color-foreground);
}

.demos-filter-more summary {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 14px;
	font-weight: 600;
	color: var(--color-foreground);
	cursor: pointer;
	list-style: none;
}

.demos-filter-more summary::-webkit-details-marker {
	display: none;
}

.demos-filter-more summary .icon {
	transform: rotate(-90deg);
	transition: transform 0.15s;
}

.demos-filter-more[open] summary {
	margin-bottom: 1rem;
}

.demos-filter-more[open] summary .icon {
	transform: none;
}

.demos-field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--color-muted-foreground);
}

.demos-field .input {
	width: 100%;
	min-width: 0;
	padding-inline: 0.75rem;
}

.demos-filter .input,
.demo-manage .input {
	background: var(--color-card);
}

/* Chrome draws the arrow of a native select against the right edge whatever the padding: the select gets an arrow
   of its own, inset like the text. */
.demos-field select.input {
	appearance: none;
	padding-right: 2.25rem;
	background: var(--color-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ecefe4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.875rem center / 1rem;
	text-overflow: ellipsis;
}

.demos-buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.demos-buttons form,
.demos-block > form {
	margin: 0;
}

.demos-inline {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.5rem;
	margin: 0;
}

.demos-inline .demos-field {
	flex: 1 1 16rem;
}

.demos-delete {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
}

.demos-delete label {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 14px;
	cursor: pointer;
}

/* The tables turn into cards by the width of the column they are in, not of the window: beside both sidebars the
   column is narrower on a desktop than on a tablet. */
.demos-scroll {
	overflow-x: auto;
	container-type: inline-size;
}

.demos-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.demos-table th,
.demos-table td {
	padding: 0.5rem;
	border-bottom: 1px solid var(--color-border);
	text-align: left;
	vertical-align: top;
	white-space: nowrap;
}

.demos-table th {
	font-weight: 600;
	color: var(--color-muted-foreground);
}

.demos-table a {
	color: var(--color-foreground);
	text-decoration: none;
}

.demos-table a:hover {
	color: var(--color-primary);
}

.demos-table .demos-wide {
	width: 100%;
	white-space: normal;
	overflow-wrap: anywhere;
}

.demos-row-title {
	font-weight: 600;
}

/* The server under the date may go on two lines at its spaces when the column is short of room. */
.demos-sub {
	color: var(--color-muted-foreground);
	white-space: normal;
}

.demos-table .demos-sub a {
	color: var(--color-muted-foreground);
}

.demos-table .demos-more {
	color: var(--color-muted-foreground);
}

.demos-nowrap {
	white-space: nowrap;
}

.demos-break {
	overflow-wrap: anywhere;
}

.demos-badge {
	display: inline-block;
	padding: 0 0.375rem;
	border-radius: 6px;
	background: var(--color-secondary);
	font-size: 11.5px;
	font-weight: 700;
	color: var(--color-secondary-foreground);
	white-space: nowrap;
}

.demos-badge.is-hidden {
	color: var(--color-primary);
}

/* The summary of a demo: the figures one looks for first as tiles, then the other facts as a list. */
.demo-summary {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 1rem;
	border-radius: 16px;
	background: var(--color-muted);
	container-type: inline-size;
}

.demo-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@container (min-width: 30rem) {
	.demo-stats {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.demo-stats li {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	min-width: 0;
	padding: 0.625rem 0.75rem;
	border-radius: 12px;
	background: var(--color-card);
}

.demo-stat-value {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--color-white);
	overflow-wrap: anywhere;
}

.demo-stat-value a {
	color: inherit;
}

.demo-stat-label {
	font-size: 12.5px;
	color: var(--color-muted-foreground);
}

.demo-props {
	display: flex;
	flex-direction: column;
	margin: 0;
	font-size: 14px;
}

.demo-props > div {
	display: grid;
	grid-template-columns: 8.5rem minmax(0, 1fr);
	gap: 0.75rem;
	padding: 0.5rem 0.25rem;
	border-top: 1px solid var(--color-border);
}

.demo-props > div:first-child {
	border-top: 0;
}

.demo-props dt {
	color: var(--color-muted-foreground);
}

.demo-props dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.demo-props-sub {
	display: block;
	color: var(--color-muted-foreground);
}

@container (max-width: 24rem) {
	.demo-props > div {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.125rem;
	}
}

.demo-match {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 0.875rem 1rem;
	border-radius: 14px;
	background: var(--color-muted);
	font-size: 14px;
}

.demo-match > .icon {
	flex-shrink: 0;
	margin-top: 0.2rem;
	color: var(--color-muted-foreground);
}

.demo-match.is-linked > .icon {
	color: var(--color-success);
}

.demo-match > div {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}

.demo-match-title {
	font-size: 16px;
	font-weight: 700;
}

.demos-candidates,
.demos-recordings {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.demos-candidates form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin: 0;
	padding: 0.5rem 0.5rem 0.5rem 1rem;
	border-radius: 12px;
	background: var(--color-muted);
	font-size: 14px;
}

.demos-recordings li {
	padding: 0.5rem 0.875rem;
	border-radius: 12px;
	background: var(--color-muted);
	font-size: 14px;
}

.demos-recordings li.is-current {
	box-shadow: inset 3px 0 0 var(--color-primary);
	font-weight: 600;
}

.demos-players tr.is-bot td,
.demos-players tr.is-bot a {
	color: var(--color-muted-foreground);
}

.demos-players td {
	vertical-align: middle;
}

.demos-players .demos-steam,
.demos-players .demos-steam a {
	color: var(--color-muted-foreground);
}

/* The forms that change a demo stay folded under "Manage": a section each, the deleting one marked as dangerous. */
.demo-manage {
	border-radius: 16px;
	background: var(--color-muted);
}

.demo-manage summary {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.875rem 1rem;
	font-size: 16px;
	font-weight: 700;
	color: var(--color-white);
	cursor: pointer;
	list-style: none;
}

.demo-manage summary::-webkit-details-marker {
	display: none;
}

.demo-manage summary .icon {
	transform: rotate(-90deg);
	transition: transform 0.15s;
}

.demo-manage[open] summary .icon {
	transform: none;
}

.demo-manage-body {
	display: flex;
	flex-direction: column;
	padding: 0 1rem 0.5rem;
}

.demo-manage-row {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.5rem;
	padding: 1rem 0;
	border-top: 1px solid var(--color-border);
}

.demo-manage-row > .demos-inline {
	align-self: stretch;
}

.demo-manage-row form {
	margin: 0;
}

.demo-manage-row.is-danger .demos-label {
	color: var(--demo-danger);
}

.demo-danger {
	border: 1px solid var(--demo-danger);
	background: transparent;
	color: var(--demo-danger);
}

.demo-danger:hover {
	background: var(--demo-danger);
	color: var(--color-white);
}

/* In a narrow column a demo of the list is a card: its date and server on top, the other cells under it with their
   names. */
@container (max-width: 36rem) {
	.demos-list thead {
		display: none;
	}

	.demos-list,
	.demos-list tbody,
	.demos-list tr,
	.demos-list td {
		display: block;
	}

	.demos-list tr {
		padding: 0.625rem 0;
		border-bottom: 1px solid var(--color-border);
	}

	.demos-list td {
		padding: 0.125rem 0;
		border: 0;
		white-space: normal;
	}

	.demos-list td[data-label] {
		display: flex;
		gap: 0.5rem;
	}

	.demos-list td[data-label]::before {
		content: attr(data-label);
		flex: 0 0 7.5rem;
		color: var(--color-muted-foreground);
		white-space: nowrap;
	}
}

/* A player gets a line of their own with the SteamID under the name, so that long nicknames do not break. */
@container (max-width: 30rem) {
	.demos-players thead {
		display: none;
	}

	.demos-players,
	.demos-players tbody,
	.demos-players tr,
	.demos-players td {
		display: block;
	}

	.demos-players tr {
		padding: 0.5rem 0;
		border-bottom: 1px solid var(--color-border);
	}

	.demos-players td {
		padding: 0;
		border: 0;
	}

	.demos-players td.demos-steam.is-empty {
		display: none;
	}
}

/* The upload page: the file field is a dashed drop area, but files may be dropped anywhere onto the window. */
.demo-dropzone {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	padding: 1rem;
	border: 2px dashed var(--color-border);
	border-radius: 14px;
}

.demo-dropzone .demos-hint {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin: 0;
}

.demo-dropzone .demos-hint .icon {
	flex-shrink: 0;
	margin-top: 0.2rem;
}

.demo-queue {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.demo-queue p {
	margin: 0;
}

.demo-queue-summary {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.demo-queue-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.demo-queue-item {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	padding: 0.75rem 1rem;
	border-left: 3px solid transparent;
	border-radius: 14px;
	background: var(--color-muted);
	font-size: 14px;
}

.demo-queue-head {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
}

.demo-queue-name {
	min-width: 0;
	overflow-wrap: anywhere;
	font-weight: 600;
	color: var(--color-foreground);
}

.demo-queue-head .demos-muted {
	flex-shrink: 0;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.demo-queue-cancel {
	flex-shrink: 0;
	margin-left: auto;
	padding: 0 0.375rem;
	border-radius: 8px;
	font-size: 20px;
	line-height: 1;
	color: var(--color-muted-foreground);
	cursor: pointer;
}

.demo-queue-cancel:hover,
.demo-queue-cancel:focus-visible {
	color: var(--color-foreground);
	background: var(--color-card);
}

.demo-queue-status {
	color: var(--color-muted-foreground);
	font-variant-numeric: tabular-nums;
}

.demo-queue-status a {
	color: var(--color-primary);
}

.demo-queue-item.is-active {
	border-left-color: var(--color-primary);
}

.demo-queue-item.is-done {
	border-left-color: var(--color-success);
}

.demo-queue-item.is-done .demo-queue-status {
	color: var(--color-success);
}

.demo-queue-item.is-failed {
	border-left-color: var(--demo-danger);
}

.demo-queue-item.is-failed .demo-queue-status {
	color: var(--demo-danger);
}

.demo-queue-item.is-cancelled {
	opacity: 0.6;
}

.demo-queue-item progress {
	width: 100%;
	height: 0.375rem;
	border: 0;
	border-radius: 999px;
	overflow: hidden;
	background: var(--color-card);
	appearance: none;
}

.demo-queue-item progress::-webkit-progress-bar {
	background: var(--color-card);
}

.demo-queue-item progress::-webkit-progress-value {
	background: var(--color-primary);
	transition: width 0.2s;
}

.demo-queue-item progress::-moz-progress-bar {
	background: var(--color-primary);
}

/* Files dragged over the window: the whole window takes them. The overlay lets the drag events through. */
.demo-drop {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: grid;
	place-items: center;
	padding: 1.5rem;
	background: rgb(20 22 17 / 0.82);
	pointer-events: none;
}

.demo-drop p {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0;
	padding: 2rem 2.5rem;
	border: 2px dashed var(--color-primary);
	border-radius: 20px;
	background: var(--color-card);
	font-size: 20px;
	font-weight: 600;
	color: var(--color-foreground);
}

.demo-drop .icon {
	font-size: 28px;
	color: var(--color-primary);
}

/* The player of a demo page: a modal window with the picture in the middle, a block of tool buttons above it
   and the transport under it. The engine draws into a sandboxed frame, everything around it belongs to the
   page. */

html:has(.demo-modal[open]) {
	overflow: hidden;
}

.demo-modal {
	--demo-danger: #e5674f;
	/* the heights of the bar above the picture and of both bars: the picture gets the rest of the window and
	   sets its width by it */
	--demo-bar: 3.625rem;
	--demo-bars: 6.875rem;
	width: min(100vw - 1.5rem, max(20rem, (100dvh - 1.5rem - var(--demo-bars)) * 16 / 9));
	max-width: none;
	max-height: calc(100dvh - 1.5rem);
	margin: auto;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--color-border);
	border-radius: 1rem;
	background: var(--color-sidebar);
	color: var(--color-foreground);
	box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 0.5);
}

.demo-modal[open] {
	display: flex;
}

.demo-modal::backdrop {
	background: rgb(15 17 12 / 0.86);
}

.demo-modal [hidden] {
	display: none;
}

.demo-window {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
	overflow-y: auto;
	container-type: inline-size;
	background: var(--color-sidebar);
	outline: none;
}

.demo-bar {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.5rem 0.5rem 0.5rem 1rem;
}

.demo-bar-title {
	display: flex;
	flex: 1 1 auto;
	align-items: baseline;
	gap: 0.625rem;
	min-width: 0;
	margin: 0;
	font-size: 15px;
	font-weight: 700;
}

.demo-bar-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.demo-bar-kind {
	flex: none;
	font-size: 12px;
	color: var(--color-muted-foreground);
}

.demo-tools {
	display: flex;
	flex: none;
	align-items: center;
	gap: 0.125rem;
	padding: 0.1875rem;
	border-radius: 0.75rem;
	background: var(--color-background);
}

.demo-tools-rule {
	width: 1px;
	height: 1.25rem;
	margin: 0 0.25rem;
	background: var(--color-border);
}

.demo-tool {
	display: inline-grid;
	flex: none;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 0;
	border-radius: 0.5625rem;
	background: transparent;
	color: var(--color-soft);
	font-size: 18px;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
}

.demo-tool:hover {
	background: var(--color-accent);
	color: var(--color-white);
}

.demo-tool[aria-expanded="true"] {
	background: var(--color-secondary);
	color: var(--color-primary);
}

.demo-tool:disabled {
	background: transparent;
	color: var(--color-soft);
	opacity: 0.4;
	cursor: default;
}

.demo-tool span {
	display: grid;
}

/* While a video is made the button is a red stop with the length of the video in it. */
.demo-record.is-on {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	width: auto;
	padding: 0 0.625rem 0 0.5rem;
	background: var(--demo-danger);
	color: var(--color-white);
}

.demo-record.is-on:hover {
	background: color-mix(in oklab, var(--demo-danger) 82%, #000);
}

.demo-record-time {
	font-size: 13px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.demo-screen {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #000;
}

.demo-frame,
.demo-shield,
.demo-overlay {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.demo-frame {
	border: 0;
}

.demo-shield {
	cursor: pointer;
}

.demo-overlay {
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 1rem;
	background: rgb(0 0 0 / 0.82);
	color: var(--color-white);
	text-align: center;
}

.demo-overlay p {
	margin: 0;
	max-width: 36rem;
}

.demo-overlay.is-error p {
	color: var(--demo-danger);
}

.demo-overlay .demo-overlay-note {
	font-size: 13px;
	color: var(--color-muted-foreground);
}

.demo-overlay progress {
	width: min(20rem, 80%);
	height: 0.3125rem;
	overflow: hidden;
	border: 0;
	border-radius: 1rem;
	background: rgb(255 255 255 / 0.16);
	appearance: none;
}

.demo-overlay progress::-webkit-progress-bar {
	background: transparent;
}

.demo-overlay progress::-webkit-progress-value {
	border-radius: 1rem;
	background: var(--color-primary);
}

.demo-overlay progress::-moz-progress-bar {
	border-radius: 1rem;
	background: var(--color-primary);
}

/* nothing to measure yet: a stretch of the bar runs along it */
.demo-overlay progress:indeterminate {
	background: rgb(255 255 255 / 0.16) linear-gradient(90deg, transparent, var(--color-primary), transparent) 50% 0 / 40% 100% no-repeat;
}

.demo-overlay progress:indeterminate::-moz-progress-bar {
	background: transparent;
}

@media (prefers-reduced-motion: no-preference) {
	.demo-overlay progress:indeterminate {
		animation: demo-progress-run 1.1s linear infinite;
	}
}

@keyframes demo-progress-run {
	from {
		background-position: -67% 0;
	}

	to {
		background-position: 167% 0;
	}
}

.demo-overlay a.button {
	color: var(--color-foreground);
	text-decoration: none;
}

/* While the demo is run to another moment the engine draws nothing: its last picture stays, dimmed. */
.demo-overlay.is-winding {
	background: rgb(0 0 0 / 0.55);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	backdrop-filter: blur(6px);
	cursor: progress;
}

@media (prefers-reduced-motion: no-preference) {
	.demo-overlay.is-winding {
		animation: demo-wind-in 0.12s ease-out;
	}
}

@keyframes demo-wind-in {
	from {
		opacity: 0;
	}
}

/* The settings lie over a corner of the picture, so that what they change is seen at once. */
.demo-panel {
	position: absolute;
	top: calc(var(--demo-bar) + 0.5rem);
	right: 0.5rem;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 0.875rem;
	width: min(20rem, 100% - 1rem);
	max-height: calc(100% - var(--demo-bars) - 1rem);
	padding: 0.625rem 0.875rem 0.875rem;
	overflow-y: auto;
	border: 1px solid var(--color-border);
	border-radius: 0.875rem;
	background: color-mix(in oklab, var(--color-sidebar) 94%, transparent);
	box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 0.45);
	backdrop-filter: blur(10px);
}

@media (prefers-reduced-motion: no-preference) {
	.demo-panel {
		animation: demo-panel-in 0.16s ease-out;
	}
}

@keyframes demo-panel-in {
	from {
		opacity: 0;
		transform: translateY(-0.375rem);
	}
}

.demo-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.demo-panel-head h2 {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.75rem;
}

.demo-panel-head .demo-tool {
	width: 1.75rem;
	height: 1.75rem;
	margin-right: -0.25rem;
	font-size: 16px;
}

.demo-option {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.demo-option legend,
.demo-option-head {
	margin-bottom: 0.375rem;
	padding: 0;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--color-muted-foreground);
}

.demo-option-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.125rem;
}

.demo-option-head output {
	color: var(--color-foreground);
	font-variant-numeric: tabular-nums;
}

.demo-segments {
	display: flex;
	gap: 2px;
	padding: 2px;
	border-radius: 0.625rem;
	background: var(--color-background);
}

.demo-segments label {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
}

.demo-segments input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.demo-segments span {
	display: block;
	padding: 0.375rem 0.5rem;
	border-radius: 0.5rem;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	white-space: nowrap;
	color: var(--color-muted-foreground);
	transition: background-color 0.15s, color 0.15s;
}

.demo-segments label:hover span {
	color: var(--color-foreground);
}

.demo-segments input:checked + span {
	background: var(--color-secondary);
	color: var(--color-primary);
}

.demo-segments input:focus-visible + span {
	outline: 2px solid var(--color-ring);
	outline-offset: 1px;
}

.demo-checks {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem 0.75rem;
}

.demo-checks label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
	font-size: 13.5px;
	white-space: nowrap;
	cursor: pointer;
}

.demo-checks .is-wide {
	grid-column: 1 / -1;
}

.demo-checks input {
	flex: none;
	width: 1rem;
	height: 1rem;
	margin: 0;
	accent-color: var(--color-primary);
}

/* The size of the picture: a list of the usual ones and two fields for a size of one's own. */
.demo-option .demo-select {
	height: 2rem;
	padding-left: 0;
}

.demo-option .demo-select select {
	flex: 1 1 auto;
	min-width: 0;
	max-width: none;
	padding: 0 0.5rem;
}

.demo-size {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	margin-top: 0.375rem;
	font-size: 13.5px;
	color: var(--color-muted-foreground);
}

.demo-number {
	flex: 1 1 0;
	min-width: 0;
	height: 2rem;
	padding: 0 0.5rem;
	border: 0;
	border-radius: 0.5625rem;
	background: var(--color-background);
	color: var(--color-foreground);
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.demo-apply {
	flex: none;
	height: 2rem;
	padding: 0 0.75rem;
	border: 0;
	border-radius: 0.5625rem;
	background: var(--color-secondary);
	color: var(--color-primary);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
}

.demo-apply:hover {
	color: var(--color-foreground);
}

.demo-number:focus-visible,
.demo-apply:focus-visible {
	outline: 2px solid var(--color-ring);
	outline-offset: 1px;
}

.demo-option :disabled {
	opacity: 0.5;
	cursor: default;
}

.demo-reset {
	align-self: flex-start;
	padding: 0;
	border: 0;
	background: none;
	color: var(--color-muted-foreground);
	font: inherit;
	font-size: 12.5px;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.demo-reset:hover {
	color: var(--color-foreground);
}

/* The viewer's own game folder: what it is for or how it is doing, the folder itself and what to do with it. */
.demo-local .demo-option-head output {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.demo-local .demo-option-note {
	margin-top: 0;
	line-height: 1.4;
}

.demo-local .demo-option-note.is-problem {
	color: var(--demo-danger);
}

.demo-local-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.875rem;
	margin: 0.5rem 0;
}

.demo-local > .demo-reset {
	margin-top: 0.25rem;
}

/* A word of the player over the lower corner of the picture: a video is ready, or did not come out. */
.demo-note {
	position: absolute;
	bottom: calc(var(--demo-bars) - var(--demo-bar) + 0.5rem);
	left: 0.5rem;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	max-width: calc(100% - 1rem);
	padding: 0.375rem 0.375rem 0.375rem 0.875rem;
	border: 1px solid var(--color-border);
	border-radius: 0.75rem;
	background: color-mix(in oklab, var(--color-sidebar) 94%, transparent);
	box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 0.45);
	backdrop-filter: blur(10px);
	font-size: 13.5px;
}

.demo-note span {
	min-width: 0;
	overflow-wrap: anywhere;
}

.demo-note a,
.demo-note-act {
	flex: none;
	color: var(--color-primary);
	font-weight: 600;
	white-space: nowrap;
}

.demo-note-act {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.demo-note .demo-tool {
	width: 1.75rem;
	height: 1.75rem;
	font-size: 16px;
}

/* What a video is recorded as is chosen in a panel under the button of the video, and the video begins from
   there. A format the browser does not record stays in sight, dimmed, with a word about it. */
.demo-record-setup {
	width: min(17rem, 100% - 1rem);
}

.demo-segments input:disabled {
	opacity: 0;
	cursor: default;
}

.demo-segments input:disabled + span,
.demo-segments label:hover input:disabled + span {
	color: var(--color-muted-foreground);
	opacity: 0.4;
}

.demo-option-note {
	margin: 0.375rem 0 0;
	font-size: 12.5px;
	color: var(--color-muted-foreground);
}

.demo-record-size {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--color-muted-foreground);
}

.demo-record-size output {
	margin-left: auto;
	color: var(--color-foreground);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.demo-record-size .demo-reset {
	align-self: auto;
	font-weight: 500;
}

.demo-record-start {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	height: 2.25rem;
	padding: 0 0.875rem;
	border: 0;
	border-radius: 0.5625rem;
	background: var(--demo-danger);
	color: var(--color-white);
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s;
}

.demo-record-start::before {
	width: 0.625rem;
	height: 0.625rem;
	border-radius: 50%;
	background: currentColor;
	content: "";
}

.demo-record-start:hover {
	background: color-mix(in oklab, var(--demo-danger) 82%, #000);
}

.demo-record-start:focus-visible {
	outline: 2px solid var(--color-foreground);
	outline-offset: 2px;
}

/* The moments and the kills of the demo lie over the same corner as the settings: a list, each line of it a
   jump to its second. The head of the panel stays, the list scrolls. */
.demo-moments {
	gap: 0.625rem;
	width: min(26rem, 100% - 1rem);
	overflow: hidden;
}

.demo-segments b {
	margin-left: 0.125rem;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	opacity: 0.7;
}

.demo-moments .demo-select {
	height: 2rem;
}

.demo-moments .demo-select select {
	flex: 1 1 auto;
	min-width: 0;
	max-width: none;
}

.demo-events {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	margin: 0 -0.5rem -0.375rem;
	padding: 0;
	overflow-y: auto;
	list-style: none;
	scrollbar-width: thin;
	scrollbar-color: var(--color-border) transparent;
}

.demo-event {
	display: grid;
	grid-template-columns: 2.75rem minmax(0, 1fr) 4.25rem minmax(0, 1fr);
	align-items: baseline;
	gap: 0 0.5rem;
	width: 100%;
	padding: 0.3125rem 0.5rem;
	border: 0;
	border-radius: 0.5rem;
	background: transparent;
	color: var(--color-foreground);
	font: inherit;
	font-size: 13px;
	text-align: left;
	cursor: pointer;
}

.demo-event:hover {
	background: var(--color-accent);
}

.demo-event:focus-visible {
	outline: 2px solid var(--color-ring);
	outline-offset: -2px;
}

.demo-event[aria-current="true"] {
	background: var(--color-secondary);
}

.demo-event time {
	font-size: 12.5px;
	font-variant-numeric: tabular-nums;
	color: var(--color-muted-foreground);
}

.demo-event[aria-current="true"] time {
	color: var(--color-primary);
}

.demo-event span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.demo-event-who,
.demo-event-what {
	font-weight: 600;
}

.demo-event-how {
	font-size: 11.5px;
	text-align: center;
	color: var(--color-muted-foreground);
}

.demo-event-whom {
	color: var(--color-soft);
}

.demo-event.is-self .demo-event-who {
	font-weight: 500;
	color: var(--color-soft);
}

.demo-event.is-moment {
	grid-template-columns: 2.75rem minmax(0, 1fr);
}

.demo-event-note {
	grid-column: 2;
	font-size: 12.5px;
	color: var(--color-muted-foreground);
}

.demo-events-none {
	margin: 0;
	padding: 0.25rem 0;
	font-size: 13px;
	color: var(--color-muted-foreground);
}

/* One slider for the position, the volume and the field of view: a thin track filled up to the thumb. The
   script keeps --fill in step with the value. */
.demo-range {
	--fill: 0%;
	width: 100%;
	height: 1.25rem;
	margin: 0;
	background: transparent;
	cursor: pointer;
	appearance: none;
}

.demo-range::-webkit-slider-runnable-track {
	height: 0.25rem;
	border-radius: 1rem;
	background: linear-gradient(to right, var(--color-primary) var(--fill), var(--color-secondary) var(--fill));
}

.demo-range::-moz-range-track {
	height: 0.25rem;
	border-radius: 1rem;
	background: var(--color-secondary);
}

.demo-range::-moz-range-progress {
	height: 0.25rem;
	border-radius: 1rem;
	background: var(--color-primary);
}

.demo-range::-webkit-slider-thumb {
	width: 0.875rem;
	height: 0.875rem;
	margin-top: -0.3125rem;
	border: 0;
	border-radius: 50%;
	background: var(--color-primary);
	appearance: none;
}

.demo-range::-moz-range-thumb {
	width: 0.875rem;
	height: 0.875rem;
	border: 0;
	border-radius: 50%;
	background: var(--color-primary);
}

.demo-range:focus-visible {
	outline: none;
}

.demo-range:focus-visible::-webkit-slider-thumb {
	outline: 2px solid var(--color-foreground);
	outline-offset: 2px;
}

.demo-range:focus-visible::-moz-range-thumb {
	outline: 2px solid var(--color-foreground);
	outline-offset: 2px;
}

.demo-controls {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem 0.5rem 0.5rem;
}

.demo-time {
	flex: none;
	margin: 0;
	font-size: 13.5px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.demo-time-total {
	font-weight: 500;
	color: var(--color-muted-foreground);
}

.demo-seek {
	display: flex;
	flex: 1 1 8rem;
	min-width: 6rem;
	margin: 0 0.25rem;
}

.demo-volume {
	display: flex;
	flex: none;
	width: 5rem;
}

.demo-select {
	display: flex;
	flex: none;
	align-items: center;
	height: 2.25rem;
	padding-left: 0.625rem;
	border-radius: 0.5625rem;
	background: var(--color-background);
	color: var(--color-soft);
	font-size: 16px;
}

.demo-select select {
	max-width: 11rem;
	height: 100%;
	padding: 0 0.375rem;
	border: 0;
	border-radius: inherit;
	background: transparent;
	color: var(--color-foreground);
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
}

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

/* The help is a window of its own over the player. */
.demo-sheet {
	width: min(30rem, 100vw - 2rem);
	max-height: calc(100dvh - 2rem);
	margin: auto;
	padding: 0.875rem 1.25rem 1.25rem;
	overflow-y: auto;
	border: 1px solid var(--color-border);
	border-radius: 1rem;
	background: var(--color-card);
	color: var(--color-foreground);
	box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 0.5);
}

.demo-sheet::backdrop {
	background: rgb(15 17 12 / 0.6);
}

.demo-keys {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: 0.5rem 1rem;
	margin: 0.75rem 0 0;
	font-size: 14px;
}

.demo-keys > div {
	display: contents;
}

.demo-keys dt {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	white-space: nowrap;
	color: var(--color-muted-foreground);
}

.demo-keys dd {
	align-self: center;
	margin: 0;
}

.demo-keys kbd {
	display: inline-grid;
	place-items: center;
	min-width: 1.625rem;
	height: 1.625rem;
	padding: 0 0.375rem;
	border: 1px solid var(--color-border);
	border-bottom-width: 2px;
	border-radius: 0.375rem;
	background: var(--color-background);
	color: var(--color-foreground);
	font-family: var(--font-mono);
	font-size: 12.5px;
	font-weight: 500;
}

.demo-sheet-note {
	margin: 1rem 0 0;
	padding-top: 0.875rem;
	border-top: 1px solid var(--color-border);
	font-size: 13px;
	color: var(--color-muted-foreground);
}

.demo-window:fullscreen .demo-screen {
	aspect-ratio: auto;
}

@container (max-width: 40rem) {
	.demo-controls {
		flex-wrap: wrap;
		padding-top: 0.25rem;
	}

	.demo-seek {
		order: -1;
		flex-basis: 100%;
		margin: 0 0.5rem;
	}

	.demo-time {
		margin-right: auto;
	}

	.demo-volume,
	.demo-bar-kind {
		display: none;
	}

	/* no room over the picture: the settings go under the transport and the window scrolls */
	.demo-screen {
		flex: none;
	}

	.demo-panel {
		position: static;
		flex: none;
		width: auto;
		max-height: none;
		margin: 0 0.5rem 0.5rem;
		overflow: visible;
		box-shadow: none;
		animation: none;
	}

	.demo-events {
		flex: none;
		max-height: 22rem;
	}

	.demo-note {
		position: static;
		flex: none;
		max-width: none;
		margin: 0 0.5rem 0.5rem;
		box-shadow: none;
	}
}
