@font-face {
	font-family: "Montserrat";
	font-display: swap;
	font-weight: 600;
	src: url("fonts/montserrat-600.woff2") format("woff2");
}

@font-face {
	font-family: "Montserrat";
	font-display: swap;
	font-weight: 700;
	src: url("fonts/montserrat-700.woff2") format("woff2");
}

* {
	box-sizing: border-box;
}

html {
	font-size: calc(var(--scale, 1) * 10px);
}

body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	height: 100vh;
	margin: 0;
	padding: 1.4rem 1.6rem;
	overflow: hidden;
	font-family: "Montserrat", sans-serif;
	font-size: 1.6rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	background: rgba(0, 0, 0, 0);
	color: white;
	filter: drop-shadow(0 0 0.1rem black) drop-shadow(0 0 0.1rem black);
	transition-property: opacity;
	transition-timing-function: ease-out;
	transition-duration: calc(var(--fade, 300) * 1ms);
}

body.loading,
body:not([data-game-state="Playing"], .preview) {
	opacity: 0;
}

span {
	align-self: baseline;
}

span:empty {
	display: none;
}

.row {
	display: flex;
	gap: 1.6rem;
}

/* Map info */

#coverImg {
	width: 6.8rem;
	height: 6.8rem;
	margin-bottom: 0.2rem;
	border-radius: 0.6rem;
	flex-shrink: 0;
	filter: url(#gamma);
}

#mapInfo {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	gap: 0.35rem;
	margin-top: -0.4rem;
	overflow: hidden;
}

#mapInfo .row {
	gap: 0.9rem;
}

#mapInfo * {
	overflow: hidden;
	text-overflow: ellipsis;
}

#title {
	font-size: 2.4rem;
	font-weight: 700;
}

#subTitle,
#difficultyLabel {
	flex-shrink: 99999;
}

#mapper::before {
	content: "‹";
}

#mapper::after {
	content: "›";
}

#difficulty {
	font-size: 1.5rem;
}

#characteristicImg {
	width: 1.7rem;
	height: 1.7rem;
	flex-shrink: 0;
	align-self: center;
}

#difficultyLabel {
	font-size: 1.4rem;
}

#type,
#bsrKey {
	font-weight: 700;
	flex-shrink: 0;
}

#bsrKey {
	letter-spacing: 0.2rem;
}

#bsrKey::before {
	content: "!bsr ";
	letter-spacing: normal;
}

#type:not(:empty) + #bsrKey {
	display: none;
}

/* Song time */

#time {
	display: flex;
	flex-direction: column;
	width: 6.8rem;
	font-size: 1.35rem;
	text-align: right;
	line-height: 1.7;
	letter-spacing: -0.05em;
}

#timeBar {
	max-width: 100%;
	height: 0.2rem;
	margin-top: -0.2rem;
	background: currentColor;
	border-radius: 0.6rem;
}

#time,
#accuracy,
#mistakes {
	font-feature-settings: "tnum";
	font-variant-numeric: tabular-nums;
}

/* Score */

#score {
	display: contents;
}

#accuracy {
	font-size: 2.4rem;
	font-weight: 700;
}

#accuracy::after {
	display: inline-block;
	content: "%";
	font-size: 1.8rem;
}

#accuracy.failed {
	text-decoration: line-through red;
}

#mistakes {
	display: inline;
	font-size: 1.8rem;
}

#mistakes::after {
	content: "⤫";
}

#mistakes:empty::after {
	content: "FC";
}

/* Settings */

body:not(.cover) #coverImg,
body:not(.mapInfo) #mapInfo,
body:not(.time) #time,
body:not(.score) #score {
	display: none;
}

body.right > .row {
	flex-direction: row-reverse;
}

body.right #mapInfo .row {
	justify-content: flex-end;
}

body.bottom {
	flex-direction: column-reverse;
}

body.bottom #time {
	flex-direction: column-reverse;
}

#settings {
	display: none;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	flex-direction: column;
	gap: 2px;
	font-family: system-ui;
	font-size: 16px;
}

.preview #settings {
	display: flex;
}

#settings label * {
	float: right;
	margin-left: 1em;
}
