html {
	overflow: hidden;
}

body {
	font-family: system-ui, sans-serif;
	display: flex;
	flex-direction: column;
	height: 100dvh;
	width: 100dvw;
	margin: 0;
	background: white;
	color: black;
}

.slide-stage {
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.slide-content {
	view-transition-name: slide-canvas;
	display: flex;
	flex-direction: column;
	justify-content: safe center;
	gap: 1rem;
	width: 100%;
	height: 100%;
	overflow-y: auto;
	padding: 3rem;
	font-size: 1.5rem;
	line-height: 1.35;
}

.slide-content > * {
	flex-shrink: 0;
}

.slide-content:focus {
	outline: none;
}

.slide-content h1 {
	font-size: 2.4rem;
	line-height: 1.15;
	margin: 0 0 0.25em;
}

.slide-content h2 {
	font-size: 1.8rem;
}

.slide-content h3 {
	font-size: 1.5rem;
}

.slide-content p {
	margin: 0;
}

.slide-content ul,
.slide-content ol {
	padding-inline-start: 1.5em;
	display: flex;
	flex-direction: column;
	gap: 0.4em;
}

.slide-content code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.9em;
	background: rgba(127, 127, 127, 0.15);
	padding: 0.1em 0.35em;
	border-radius: 0.3em;
}

.slide-content pre {
	background: rgba(0, 0, 0, 0.06);
	padding: 1rem;
	border-radius: 0.6rem;
	overflow-x: auto;
	font-size: 1.4rem;
	tab-size: 4;
}

.slide-content pre code {
	background: none;
	padding: 0;
}

.slide-content img {
	max-width: 100%;
	max-height: 70dvh;
	width: auto;
	border-radius: 0.5rem;
}

.slide-content blockquote {
	border-inline-start: 3px solid rgba(0, 0, 0, 0.25);
	padding-inline-start: 1em;
	margin: 0;
	opacity: 0.85;
}

.slide-content a {
	color: #0094ff;
}

.slide-content table {
	border-collapse: collapse;
}

.slide-content th,
.slide-content td {
	border: 1px solid rgba(0, 0, 0, 0.2);
	padding: 0.3em 0.6em;
}

.layout-center {
	text-align: center;
	align-items: center;
}

.layout-title {
	justify-content: center;
	text-align: center;
}

.layout-title h1 {
	font-size: 3.2rem;
}

.test-slide {
	padding: 0;
	gap: 0;
}

.test-pattern {
	flex: 1;
	align-self: stretch;
	min-height: 0;
	display: grid;
	grid-template-rows: 12% 4% 1fr 14%;
	background: #7b7b7b;
	overflow: hidden;
}

.test-bars-top {
	background: linear-gradient(90deg, #fff 0 12.5%, #ff0 12.5% 25%, #0ff 25% 37.5%, #0f0 37.5% 50%, #f0f 50% 62.5%, #f00 62.5% 75%, #00f 75% 87.5%, #111 87.5% 100%);
}

.test-castle {
	background: repeating-linear-gradient(90deg, #111 0 1.1%, #eee 1.1% 2.2%);
}

.test-field {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #7b7b7b;
	background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.85) 0 1px, transparent 1px 4vmin), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.85) 0 1px, transparent 1px 4vmin);
}

.test-corner {
	position: absolute;
	width: 13%;
	height: 16%;
	background: repeating-linear-gradient(90deg, #fff 0 1px, #111 1px 3px);
	border: 1px solid rgba(255, 255, 255, 0.5);
}

.test-corner-tl {
	top: 7%;
	left: 3%;
}

.test-corner-tr {
	top: 7%;
	right: 3%;
	background: repeating-linear-gradient(90deg, #fff 0 1px, #111 1px 2px);
}

.test-corner-bl {
	bottom: 7%;
	left: 3%;
	background: repeating-linear-gradient(90deg, #fff 0 1px, #111 1px 2px);
}

.test-corner-br {
	bottom: 7%;
	right: 3%;
}

.test-circle {
	position: relative;
	height: min(86%, 80vw);
	aspect-ratio: 1;
	border-radius: 50%;
	border: 0.45vmin solid #fff;
	background: #101010;
}

.test-cross {
	position: absolute;
	background: #fff;
}

.test-cross-h {
	left: 4%;
	right: 4%;
	top: 50%;
	height: 0.3vmin;
	transform: translateY(-50%);
}

.test-cross-v {
	top: 4%;
	bottom: 4%;
	left: 50%;
	width: 0.3vmin;
	transform: translateX(-50%);
}

.test-grating {
	position: absolute;
	width: 15%;
	height: 15%;
	background: repeating-linear-gradient(90deg, #eee 0 1px, #101010 1px 3px);
}

.test-grating-tl {
	top: 13%;
	left: 13%;
}

.test-grating-tr {
	top: 13%;
	right: 13%;
	background: repeating-linear-gradient(90deg, #eee 0 1px, #101010 1px 2px);
}

.test-grating-bl {
	bottom: 24%;
	left: 13%;
	background: repeating-linear-gradient(90deg, #eee 0 1px, #101010 1px 2px);
}

.test-grating-br {
	bottom: 24%;
	right: 13%;
}

.test-staircase {
	position: absolute;
	left: 50%;
	bottom: 9%;
	transform: translateX(-50%);
	display: flex;
	width: 34%;
	height: 9%;
	border: 1px solid #fff;
}

.test-staircase i {
	flex: 1;
	background: #101010;
}

.test-staircase i:nth-child(2) {
	background: #3a3a3a;
}

.test-staircase i:nth-child(3) {
	background: #6e6e6e;
}

.test-staircase i:nth-child(4) {
	background: #a2a2a2;
}

.test-staircase i:nth-child(5) {
	background: #d6d6d6;
}

.test-station {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	background: #101010;
	color: #fff;
	padding: 0 1rem;
}

.test-station-name {
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	text-align: center;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.test-station-hint {
	font-size: 0.75rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	opacity: 0.55;
	white-space: nowrap;
}

.notes {
	display: none;
	position: fixed;
	inset-inline: 1rem;
	inset-block-end: 4.25rem;
	max-height: 40dvh;
	overflow-y: auto;
	padding: 1rem 1.25rem;
	border-radius: 0.8rem;
	background: rgba(255, 255, 255, 0.92);
	color: #111;
	box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
	font-size: 1.1rem;
	line-height: 1.5;
	z-index: 5;
}

.notes h2 {
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.6;
	margin: 0 0 0.5rem;
}

body.notes-open .notes {
	display: block;
}

.controls {
	view-transition-name: slide-controls;
	position: fixed;
	inset-block-end: 0;
	display: flex;
	justify-content: space-between;
	width: 100%;
	z-index: 10;
	transition: all 0.5s;
	transition-timing-function: linear(
		0,
		0.013,
		0.049,
		0.104,
		0.174,
		0.254,
		0.34,
		0.43,
		0.521,
		0.61,
		0.696,
		0.776,
		0.849,
		0.915,
		0.974,
		1.023,
		1.065,
		1.098,
		1.124,
		1.143,
		1.155,
		1.162,
		1.163,
		1.16,
		1.153,
		1.144,
		1.132,
		1.118,
		1.104,
		1.089,
		1.075,
		1.06,
		1.046,
		1.034,
		1.022,
		1.011,
		1.002,
		0.994,
		0.988,
		0.983,
		0.979,
		0.976,
		0.974,
		0.974,
		0.973,
		0.974,
		0.975,
		0.977,
		0.979,
		0.981,
		0.984,
		0.986,
		0.988,
		0.991,
		0.993,
		0.995,
		0.997,
		0.999,
		1,
		1.001,
		1.002,
		1.003,
		1.004,
		1.004,
		1.004,
		1.004,
		1.004,
		1
	);

	.nav,
	.inline-start-controls,
	.inline-end-controls {
		display: flex;
		align-items: center;
		margin: 0.5rem;
		gap: 0.6rem;
		padding: 0.5rem;
		font-size: 0.9rem;
		border-radius: 0.8rem;
		background: rgba(255, 255, 255, 0.2);
		box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
		backdrop-filter: blur(6.8px);
		-webkit-backdrop-filter: blur(6.8px);
		border: 1px solid rgba(255, 255, 255, 0.3);

		a,
		button {
			text-decoration: none;
			padding: 0.25rem 0.75rem;
			border-radius: 0.5rem;
			font-weight: 500;
			font-size: 0.9rem;
			color: black;
			background: rgba(0, 148, 255, 0.2);
			border: 1px solid rgba(0, 148, 255, 0.3);
			cursor: pointer;

			&:hover {
				color: white;
				background: rgba(0, 148, 255, 0.6);
				backdrop-filter: blur(6.8px);
				-webkit-backdrop-filter: blur(6.8px);
			}
		}
	}

	&:not(:focus-within, :hover) {
		inset-block-end: -3rem;
	}
}

.inline-start-controls a,
.inline-start-controls button,
.inline-end-controls a,
.inline-end-controls button {
	padding: 0.3rem 0.45rem;
}

.inline-start-controls svg,
.inline-end-controls svg {
	display: block;
	width: 1.1em;
	height: 1.1em;
}

.tooltip {
	margin: 0;
	inset: auto;
	padding: 0.3rem 0.6rem;
	border: none;
	border-radius: 0.4rem;
	font-size: 0.85rem;
	color: white;
	background: rgba(20, 20, 20, 0.9);
	pointer-events: none;
}

.hidden {
	visibility: hidden;
}

.presenter-bar {
	display: none;
}

body.presenter-mode {
	gap: 0.5rem;
	padding: 0.5rem;
}

body.presenter-mode .presenter-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
	flex: none;
	width: 100%;
	padding: 0.25rem 0.5rem;
	font-size: 1rem;
	font-variant-numeric: tabular-nums;
}

.presenter-timer {
	font-weight: 600;
}

.presenter-timer.over-par {
	color: #c0392b;
}

.presenter-par {
	opacity: 0.65;
	font-variant-numeric: tabular-nums;
}

.par-time {
	margin: 0 0 0.5rem;
	font-variant-numeric: tabular-nums;
}

body.presenter-mode .par-time {
	display: none;
}

.deck-timer {
	font-weight: 600;
	opacity: 0.85;
}

.timer-label {
	font-size: 0.8rem;
	opacity: 0.6;
}

body.presenter-mode .presenter-clock {
	opacity: 0.7;
}

body.presenter-mode .presenter-bar button {
	font: inherit;
	font-size: 0.85rem;
	padding: 0.15rem 0.6rem;
	border-radius: 0.5rem;
	border: none;
	background: rgba(0, 0, 0, 0.06);
	cursor: pointer;
}

body.presenter-mode .presenter-bar button:hover {
	background: rgba(0, 0, 0, 0.12);
}

#presenter-close {
	margin-inline-start: auto;
}

body.presenter-mode .slide-content {
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	aspect-ratio: auto;
	padding: 1.5rem;
	font-size: 1.15rem;
}

.presenter-lower {
	display: contents;
}

body.presenter-mode .notes {
	display: block;
	position: static;
	flex: 1;
	min-width: 0;
	height: 100%;
	max-height: none;
	margin: 0;
	box-shadow: none;
}

body.presenter-mode .presenter-lower {
	display: flex;
	gap: 0.5rem;
	flex: none;
	width: 100%;
	height: 36dvh;
}

.next-preview {
	display: none;
}

body.presenter-mode .next-preview {
	display: flex;
	flex-direction: column;
	flex: 0 0 34%;
	min-width: 0;
	overflow: hidden;
	border-radius: 0.8rem;
	background: rgba(0, 0, 0, 0.06);
}

.next-preview h2 {
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.6;
	margin: 0;
	padding: 0.5rem 0.75rem 0.25rem;
}

.next-preview .preview-box {
	position: relative;
	flex: 1;
	overflow: hidden;
}

.next-preview iframe,
body.presenter-mode .slide-stage iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 1280px;
	height: 720px;
	max-width: none;
	border: 0;
	background: white;
	transform-origin: top left;
}

body.presenter-mode .slide-stage {
	position: relative;
	overflow: hidden;
}

.notes .no-notes {
	opacity: 0.6;
}

body.presenter-mode .controls {
	position: static;
	flex: none;
	width: 100%;
	justify-content: center;
}

body.presenter-mode .inline-start-controls,
body.presenter-mode .inline-end-controls {
	display: none;
}

body.presenter-mode .nav {
	background: none;
	box-shadow: none;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	border: none;
}

body.presenter-mode .nav a {
	padding: 0.5rem 1.5rem;
	font-size: 1rem;
}

.par-flag {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #c0392b;
}

.overview {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	border: none;
	overflow-y: auto;
	padding: 3rem;
	background: rgba(255, 255, 255, 0.97);
}

.overview::backdrop {
	background: rgba(0, 0, 0, 0.25);
}

.overview-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
	gap: 0.75rem;
	max-width: 60rem;
	margin: 0 auto;
}

.overview-grid a {
	display: flex;
	gap: 0.6rem;
	align-items: baseline;
	padding: 0.75rem 1rem;
	border-radius: 0.6rem;
	border: 1px solid rgba(0, 0, 0, 0.12);
	background: white;
	color: inherit;
	text-decoration: none;
}

.overview-grid a:hover,
.overview-grid a:focus {
	border-color: #0094ff;
}

.overview-grid a.current {
	outline: 2px solid #0094ff;
}

.overview-number {
	font-size: 0.85rem;
	font-variant-numeric: tabular-nums;
	opacity: 0.5;
}

.overview-title {
	font-size: 0.95rem;
	line-height: 1.3;
}

.help-dialog {
	max-width: 26rem;
	padding: 1.5rem 1.75rem;
	border: none;
	border-radius: 0.8rem;
	box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
	font-family: inherit;
}

.help-dialog::backdrop {
	background: rgba(0, 0, 0, 0.35);
}

.help-dialog h2 {
	margin: 0 0 1rem;
	font-size: 1.2rem;
}

.help-dialog dl {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.5rem 1rem;
	margin: 0 0 1.25rem;
}

.help-dialog dt {
	text-align: end;
}

.help-dialog dd {
	margin: 0;
	opacity: 0.8;
}

.help-dialog kbd {
	font-family: inherit;
	font-size: 0.85em;
	padding: 0.1rem 0.4rem;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-bottom-width: 2px;
	border-radius: 0.3rem;
	background: rgba(0, 0, 0, 0.04);
}

.help-dialog button {
	font: inherit;
	padding: 0.4rem 1rem;
	border: none;
	border-radius: 0.5rem;
	background: #0094ff;
	color: white;
	cursor: pointer;
}

.blackout {
	position: fixed;
	inset: 0;
	z-index: 30;
	background: #000;
}

.blackout[hidden] {
	display: none;
}

body.preview-mode .controls,
body.preview-mode .presenter-lower,
body.preview-mode .presenter-bar,
body.preview-mode .overview,
body.preview-mode .help-dialog,
body.preview-mode .blackout,
body.preview-mode .tooltip {
	display: none;
}
