/* 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);
}
