:root {
	color-scheme: dark;
	--pr2-safe-top: env(safe-area-inset-top, 0px);
	--pr2-safe-right: env(safe-area-inset-right, 0px);
	--pr2-safe-bottom: env(safe-area-inset-bottom, 0px);
	--pr2-safe-left: env(safe-area-inset-left, 0px);
}

html,
body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #05070b;
	overscroll-behavior: none;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
}

#openfl-content,
#openfl-content canvas {
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-user-drag: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
}

body {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	box-sizing: border-box;
}

#openfl-content {
	width: 100%;
	height: 100%;
	background: #000;
}

body.pr2-fixed-stage {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--pr2-safe-top) var(--pr2-safe-right) var(--pr2-safe-bottom) var(--pr2-safe-left);
}

body.pr2-fixed-stage #openfl-content {
	flex: none;
	width: min(100%, 137.5dvh);
	height: min(100%, 72.7272727vw);
}

@media (orientation: portrait) {
	body.pr2-fixed-stage.pr2-mobile-race {
		align-items: flex-start;
	}
}

@media (orientation: landscape) and (max-width: 720px) {
	body.pr2-fixed-stage.pr2-mobile-race #openfl-content {
		width: min(100%, 137.5dvh, calc(100vw - 240px));
		height: min(100%, 72.7272727vw, calc(72.7272727vw - 174.5454545px));
	}
}

#pr2-mobile-controls {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: none;
	pointer-events: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
}

body.pr2-mobile-capable #pr2-mobile-controls {
	display: block;
}

body.pr2-mobile-capable.pr2-mobile-race #pr2-mobile-controls {
	opacity: 1;
	visibility: visible;
	transition:
		opacity 160ms ease-out,
		visibility 0s linear 0s;
}

body.pr2-mobile-capable:not(.pr2-mobile-race) #pr2-left-controls,
body.pr2-mobile-capable:not(.pr2-mobile-race) #pr2-use-button,
body.pr2-mobile-capable:not(.pr2-mobile-race) #pr2-jump-button,
body.pr2-mobile-capable:not(.pr2-mobile-race) #pr2-crouch-button {
	display: none !important;
}

body.pr2-mobile-capable.pr2-mobile-race.pr2-touch-controls-hidden #pr2-left-controls,
body.pr2-mobile-capable.pr2-mobile-race.pr2-touch-controls-hidden #pr2-use-button,
body.pr2-mobile-capable.pr2-mobile-race.pr2-touch-controls-hidden #pr2-jump-button,
body.pr2-mobile-capable.pr2-mobile-race.pr2-touch-controls-hidden #pr2-crouch-button {
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 160ms ease-out,
		visibility 0s linear 160ms;
}

.pr2-control-surface {
	position: fixed;
	pointer-events: auto;
	touch-action: none;
	-webkit-tap-highlight-color: transparent;
}

.pr2-action-button::before,
#pr2-control-settings::before {
	content: "";
	position: absolute;
	inset: -6px;
	border-radius: inherit;
	pointer-events: auto;
}

#pr2-control-settings::before {
	inset: -8px;
}

#pr2-mobile-controls.is-layout-ready #pr2-left-controls {
	transition:
		left 220ms cubic-bezier(0.22, 1, 0.36, 1),
		top 220ms cubic-bezier(0.22, 1, 0.36, 1),
		opacity 160ms ease-out,
		visibility 0s linear 0s;
}

.pr2-glass {
	background: rgba(235, 242, 255, 0.16);
	border: 1px solid rgba(255, 255, 255, 0.42);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.28),
		0 8px 28px rgba(0, 0, 0, 0.22);
	-webkit-backdrop-filter: blur(18px) saturate(145%);
	backdrop-filter: blur(18px) saturate(145%);
}

#pr2-left-controls {
	width: clamp(96px, 15vmin, 118px);
	height: clamp(96px, 15vmin, 118px);
	transform: translate(-50%, -50%);
}

#pr2-joystick {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	box-sizing: border-box;
}

#pr2-joystick::before,
#pr2-joystick::after {
	content: "";
	position: absolute;
	inset: 18%;
	border: 1px solid rgba(255, 255, 255, 0.11);
	border-radius: 50%;
}

#pr2-joystick-knob {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 43%;
	height: 43%;
	border: 1px solid rgba(255, 255, 255, 0.82);
	border-radius: 50%;
	transform: translate(-50%, -50%);
	background: rgba(245, 248, 255, 0.72);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.8),
		0 5px 16px rgba(0, 0, 0, 0.24);
	will-change: transform;
}

#pr2-dpad {
	position: absolute;
	inset: -4px;
	display: none;
}

#pr2-mobile-controls[data-control-mode="dpad"] #pr2-joystick {
	display: none;
}

#pr2-mobile-controls[data-control-mode="dpad"] #pr2-dpad {
	display: block;
}

#pr2-mobile-controls[data-control-mode="dpad"] #pr2-left-controls {
	width: clamp(132px, 21vmin, 156px);
	height: clamp(132px, 21vmin, 156px);
}

#pr2-mobile-controls[data-horizontal-only="true"] #pr2-left-controls {
	width: clamp(140px, 22vmin, 168px);
	height: clamp(72px, 11vmin, 84px);
}

#pr2-mobile-controls[data-horizontal-only="true"] #pr2-joystick {
	border-radius: 42px;
}

#pr2-mobile-controls[data-horizontal-only="true"] #pr2-joystick::before,
#pr2-mobile-controls[data-horizontal-only="true"] #pr2-joystick::after {
	inset: 18px 28%;
	border-radius: 24px;
}

#pr2-mobile-controls[data-horizontal-only="true"] #pr2-joystick-knob {
	width: 52px;
	height: 52px;
}

#pr2-mobile-controls[data-control-mode="dpad"][data-horizontal-only="true"] #pr2-left-controls {
	width: clamp(140px, 22vmin, 168px);
	height: clamp(64px, 10vmin, 76px);
}

@media (orientation: landscape) and (max-width: 720px) {
	#pr2-mobile-controls[data-control-mode="dpad"] #pr2-left-controls {
		width: 112px;
		height: 112px;
	}

	#pr2-mobile-controls[data-horizontal-only="true"] #pr2-left-controls,
	#pr2-mobile-controls[data-control-mode="dpad"][data-horizontal-only="true"] #pr2-left-controls {
		width: 136px;
		height: 64px;
	}

	#pr2-mobile-controls[data-horizontal-only="true"] #pr2-joystick-knob {
		width: 48px;
		height: 48px;
	}
}

.pr2-dpad-button {
	position: absolute;
	width: 40%;
	height: 40%;
	margin: 0;
	padding: 0;
	border-radius: 14px;
	color: rgba(255, 255, 255, 0.9);
	font: 600 clamp(21px, 3.8vmin, 26px)/1 -apple-system, BlinkMacSystemFont, sans-serif;
	appearance: none;
	-webkit-appearance: none;
	touch-action: none;
	pointer-events: none;
	transition:
		background-color 90ms ease-out,
		border-color 90ms ease-out,
		box-shadow 90ms ease-out,
		transform 90ms ease-out;
}

.pr2-dpad-button[data-direction="up"] { left: 30%; top: 0; }
.pr2-dpad-button[data-direction="left"] { left: 0; top: 30%; }
.pr2-dpad-button[data-direction="right"] { right: 0; top: 30%; }
.pr2-dpad-button[data-direction="down"] { left: 30%; bottom: 0; }

#pr2-mobile-controls[data-horizontal-only="true"] .pr2-dpad-button[data-direction="up"],
#pr2-mobile-controls[data-horizontal-only="true"] .pr2-dpad-button[data-direction="down"] {
	display: none;
}

#pr2-mobile-controls[data-horizontal-only="true"] .pr2-dpad-button[data-direction="left"],
#pr2-mobile-controls[data-horizontal-only="true"] .pr2-dpad-button[data-direction="right"] {
	top: 50%;
	width: 64px;
	height: 64px;
	transform: translateY(-50%);
}

#pr2-mobile-controls[data-horizontal-only="true"] .pr2-dpad-button[data-direction="left"] {
	left: 0;
}

#pr2-mobile-controls[data-horizontal-only="true"] .pr2-dpad-button[data-direction="right"] {
	right: 0;
}

@media (orientation: landscape) and (max-width: 720px) {
	#pr2-mobile-controls[data-horizontal-only="true"] .pr2-dpad-button[data-direction="left"],
	#pr2-mobile-controls[data-horizontal-only="true"] .pr2-dpad-button[data-direction="right"] {
		width: 56px;
		height: 56px;
	}
}

.pr2-dpad-button.is-pressed {
	background: rgba(236, 244, 255, 0.46);
	border-color: rgba(255, 255, 255, 0.72);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.38),
		0 3px 12px rgba(0, 0, 0, 0.18);
	transform: scale(0.95);
}

#pr2-mobile-controls[data-horizontal-only="true"] .pr2-dpad-button.is-pressed {
	transform: translateY(-50%) scale(0.95);
}

#pr2-use-button {
	width: clamp(70px, 11vmin, 85px);
	height: clamp(70px, 11vmin, 85px);
}

#pr2-jump-button {
	width: clamp(82px, 13vmin, 100px);
	height: clamp(82px, 13vmin, 100px);
}

#pr2-crouch-button {
	width: clamp(70px, 11vmin, 85px);
	height: clamp(70px, 11vmin, 85px);
}

#pr2-use-button,
#pr2-jump-button,
#pr2-crouch-button {
	transform: translate(-50%, -50%);
	border-radius: 50%;
	color: #fff;
	appearance: none;
	-webkit-appearance: none;
	transition:
		left 220ms cubic-bezier(0.22, 1, 0.36, 1),
		top 220ms cubic-bezier(0.22, 1, 0.36, 1),
		background-color 90ms ease-out,
		transform 90ms ease-out,
		opacity 160ms ease-out,
		visibility 0s linear 0s;
}

#pr2-jump-button,
#pr2-crouch-button {
	display: none;
}

#pr2-mobile-controls[data-show-jump="false"][data-show-crouch="false"] #pr2-use-button {
	width: clamp(82px, 13vmin, 100px);
	height: clamp(82px, 13vmin, 100px);
}

#pr2-mobile-controls[data-show-jump="false"][data-show-crouch="true"] #pr2-crouch-button {
	width: clamp(82px, 13vmin, 100px);
	height: clamp(82px, 13vmin, 100px);
}

@media (orientation: landscape) and (max-width: 720px) {
	#pr2-use-button {
		width: 62px;
		height: 62px;
	}

	#pr2-jump-button {
		width: 72px;
		height: 72px;
	}

	#pr2-crouch-button {
		width: 62px;
		height: 62px;
	}

	#pr2-mobile-controls[data-show-jump="false"][data-show-crouch="false"] #pr2-use-button {
		width: 72px;
		height: 72px;
	}

	#pr2-mobile-controls[data-show-jump="false"][data-show-crouch="true"] #pr2-crouch-button {
		width: 72px;
		height: 72px;
	}
}

#pr2-mobile-controls[data-show-jump="true"] #pr2-jump-button {
	display: block;
}

#pr2-mobile-controls[data-show-crouch="true"] #pr2-crouch-button {
	display: block;
}

.pr2-action-symbol {
	display: block;
	color: rgba(255, 255, 255, 0.94);
	font: 400 clamp(30px, 5.5vmin, 40px)/1 -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
	transform: translateY(-1px);
	text-shadow: 0 1px 7px rgba(255, 255, 255, 0.15);
}

#pr2-use-button.is-pressed,
#pr2-jump-button.is-pressed,
#pr2-crouch-button.is-pressed {
	background: rgba(241, 246, 255, 0.4);
	transform: translate(-50%, -50%) scale(0.94);
}

#pr2-control-settings {
	top: calc(var(--pr2-safe-top) + 9px);
	right: calc(var(--pr2-safe-right) + 9px);
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 22px;
	color: rgba(255, 255, 255, 0.9);
	font: 500 21px/42px -apple-system, BlinkMacSystemFont, sans-serif;
	appearance: none;
	-webkit-appearance: none;
	opacity: 0.4;
	transition:
		opacity 140ms ease-out,
		background-color 140ms ease-out;
}

#pr2-control-settings:active,
#pr2-control-settings.is-pressed,
#pr2-control-settings[aria-expanded="true"] {
	opacity: 1;
	background: rgba(235, 242, 255, 0.34);
}

#pr2-control-settings:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.8);
	outline-offset: 2px;
}

#pr2-control-panel {
	position: fixed;
	top: calc(var(--pr2-safe-top) + 60px);
	right: calc(var(--pr2-safe-right) + 9px);
	width: 250px;
	box-sizing: border-box;
	padding: 12px;
	border-radius: 18px;
	pointer-events: auto;
	display: none;
}

#pr2-control-panel.is-open {
	display: block;
}

@media (min-width: 740px) and (min-height: 550px) {
	#pr2-left-controls,
	#pr2-use-button,
	#pr2-jump-button,
	#pr2-crouch-button {
		opacity: 0.45;
	}

	#pr2-left-controls:active,
	#pr2-use-button.is-pressed,
	#pr2-jump-button.is-pressed,
	#pr2-crouch-button.is-pressed {
		opacity: 0.9;
	}

	#pr2-left-controls {
		width: clamp(170px, 21vmin, 210px);
		height: clamp(170px, 21vmin, 210px);
	}

	#pr2-mobile-controls[data-control-mode="dpad"] #pr2-left-controls {
		width: clamp(176px, 22vmin, 220px);
		height: clamp(176px, 22vmin, 220px);
	}

	#pr2-mobile-controls[data-horizontal-only="true"] #pr2-left-controls {
		width: clamp(190px, 24vmin, 232px);
		height: clamp(90px, 11vmin, 108px);
	}

	#pr2-mobile-controls[data-control-mode="dpad"][data-horizontal-only="true"] #pr2-left-controls {
		width: clamp(190px, 24vmin, 232px);
		height: clamp(82px, 10vmin, 100px);
	}

	#pr2-mobile-controls[data-horizontal-only="true"] #pr2-joystick-knob {
		width: 68px;
		height: 68px;
	}

	#pr2-mobile-controls[data-horizontal-only="true"] .pr2-dpad-button[data-direction="left"],
	#pr2-mobile-controls[data-horizontal-only="true"] .pr2-dpad-button[data-direction="right"] {
		width: 78px;
		height: 78px;
	}

	.pr2-dpad-button {
		font-size: 32px;
		border-radius: 18px;
	}

	#pr2-use-button,
	#pr2-crouch-button {
		width: clamp(95px, 11vmin, 112px);
		height: clamp(95px, 11vmin, 112px);
	}

	#pr2-jump-button,
	#pr2-mobile-controls[data-show-jump="false"][data-show-crouch="false"] #pr2-use-button,
	#pr2-mobile-controls[data-show-jump="false"][data-show-crouch="true"] #pr2-crouch-button {
		width: clamp(112px, 13vmin, 132px);
		height: clamp(112px, 13vmin, 132px);
	}

	.pr2-action-symbol {
		font-size: 48px;
	}

	#pr2-control-settings {
		top: calc(var(--pr2-safe-top) + 12px);
		right: calc(var(--pr2-safe-right) + 12px);
		width: 50px;
		height: 50px;
		border-radius: 25px;
		font-size: 24px;
		line-height: 48px;
	}

	#pr2-control-panel {
		top: calc(var(--pr2-safe-top) + 70px);
		right: calc(var(--pr2-safe-right) + 12px);
		width: 280px;
	}
}

.pr2-panel-title {
	margin: 0 0 9px;
	color: rgba(255, 255, 255, 0.76);
	font-size: 12px;
	font-weight: 650;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.pr2-mode-picker {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 5px;
	padding: 4px;
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.2);
}

.pr2-mode-button {
	min-height: 34px;
	padding: 0 8px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: rgba(255, 255, 255, 0.7);
	font: 600 13px/1 -apple-system, BlinkMacSystemFont, sans-serif;
	appearance: none;
	-webkit-appearance: none;
}

.pr2-mode-button.is-selected {
	background: rgba(255, 255, 255, 0.22);
	color: #fff;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}

.pr2-setting-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 38px;
	margin-top: 9px;
	padding: 0 2px;
	color: rgba(255, 255, 255, 0.82);
	font-size: 13px;
	font-weight: 550;
}

.pr2-setting-block {
	margin-top: 4px;
	padding-top: 1px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pr2-setting-block .pr2-setting-row {
	margin-top: 4px;
}

.pr2-setting-note {
	margin: -1px 50px 5px 2px;
	color: rgba(255, 255, 255, 0.5);
	font-size: 11px;
	line-height: 1.25;
}

.pr2-setting-block.is-disabled .pr2-setting-row {
	color: rgba(255, 255, 255, 0.38);
}

.pr2-switch {
	position: relative;
	width: 42px;
	height: 25px;
	padding: 0;
	border: 0;
	border-radius: 13px;
	background: rgba(255, 255, 255, 0.18);
	appearance: none;
	-webkit-appearance: none;
	transition: background-color 160ms ease-out;
}

.pr2-switch:disabled {
	opacity: 0.42;
}

.pr2-switch span {
	position: absolute;
	left: 2px;
	top: 2px;
	width: 21px;
	height: 21px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
	transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pr2-switch[aria-checked="true"] {
	background: #4cd964;
}

.pr2-switch[aria-checked="true"] span {
	transform: translateX(17px);
}

#pr2-controller-status {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-top: 11px;
	color: rgba(255, 255, 255, 0.62);
	font-size: 12px;
	line-height: 1.3;
}

#pr2-controller-dot {
	width: 7px;
	height: 7px;
	flex: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.32);
}

#pr2-controller-status.is-connected {
	color: rgba(255, 255, 255, 0.88);
}

#pr2-controller-status.is-connected #pr2-controller-dot {
	background: #53d769;
	box-shadow: 0 0 8px rgba(83, 215, 105, 0.7);
}

#pr2-controller-cursor {
	position: fixed;
	z-index: 2147482999;
	left: 0;
	top: 0;
	width: 28px;
	height: 28px;
	box-sizing: border-box;
	display: none;
	pointer-events: none;
	transform: translate(-50%, -50%);
	border: 1px solid rgba(255, 255, 255, 0.72);
	border-radius: 50%;
	background: rgba(228, 236, 248, 0.62);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.72),
		0 3px 12px rgba(0, 0, 0, 0.32);
	-webkit-backdrop-filter: blur(10px) saturate(140%);
	backdrop-filter: blur(10px) saturate(140%);
	transition:
		width 90ms ease-out,
		height 90ms ease-out,
		background-color 90ms ease-out;
	will-change: left, top;
}

body.pr2-controller-cursor-active:not(.pr2-mobile-race) #pr2-controller-cursor {
	display: block;
}

#pr2-controller-cursor.is-pressed {
	width: 22px;
	height: 22px;
	background: rgba(245, 248, 255, 0.86);
}

@font-face {
	font-family: "DejaVu Sans Bold Italic";
	src: url("assets/fonts/DejaVuSans-BoldOblique.ttf") format("truetype");
}

@font-face {
	font-family: "DejaVu Sans";
	src: url("assets/fonts/DejaVuSans.ttf") format("truetype");
}

@font-face {
	font-family: "Gwibble";
	src: url("assets/fonts/gwibble.ttf") format("truetype");
}

@font-face {
	font-family: "FontAwesome";
	src: url("assets/fonts/fontawesome.ttf") format("truetype");
}

@font-face {
	font-family: "Liberation Serif";
	src: url("assets/fonts/LiberationSerif-Regular.ttf") format("truetype");
}

@font-face {
	font-family: "DejaVu Sans Bold";
	src: url("assets/fonts/DejaVuSans-Bold.ttf") format("truetype");
}

@font-face {
	font-family: "Liberation Sans";
	src: url("assets/fonts/LiberationSans-Regular.ttf") format("truetype");
}

@font-face {
	font-family: "DejaVu Sans Italic";
	src: url("assets/fonts/DejaVuSans-Oblique.ttf") format("truetype");
}
