@font-face {
	font-family: "Changa One";
	src: url("fonts/ChangaOne-Regular.ttf") format("truetype");
	font-style: normal;
	font-weight: 400;
	font-display: swap;
}

html, body {
	padding: 0;
	margin: 0;
	overflow: hidden;
	height: 100%;
}

body {
	background: #000000;
	color: white;
}

.game-gate,
.score-overlay {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: grid;
	place-items: center;
	padding: 1rem;
	background: #14477d url("images/code-entry-background.webp") center / cover no-repeat;
	color: #353638;
	font-family: "Changa One", Arial, sans-serif;
	touch-action: manipulation;
}

.game-gate[hidden],
.score-overlay[hidden] {
	display: none;
}

.game-gate__panel,
.score-overlay__panel {
	width: min(52rem, 100%);
	padding: clamp(1.4rem, 3vw, 2.25rem);
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 1rem 3rem rgb(20 71 125 / 16%);
	text-align: center;
}

.game-gate__branding {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: clamp(1rem, 3vw, 2rem);
	margin: 0 auto 1rem;
}

.game-gate__logo,
.game-gate__title-image {
	display: block;
	width: auto;
	height: auto;
	object-fit: contain;
}

.game-gate__logo {
	max-width: 10rem;
}

.game-gate__title-image {
	max-width: 14rem;
	max-height: 6rem;
}

.game-gate h1 {
	margin: 0 0 .35rem;
	color: #14477d;
	font-size: clamp(1.7rem, 3.5vw, 2.35rem);
	line-height: 1.15;
}

.game-gate__code {
	display: block;
	min-height: 3.75rem;
	margin: 1.15rem 0;
	padding: .45rem;
	border: 2px solid #14477d;
	border-radius: 8px;
	color: #14477d;
	font-size: clamp(1.7rem, 5vw, 2.5rem);
	font-weight: 800;
	letter-spacing: .13em;
}

.game-gate__keys {
	display: flex;
	flex-direction: column;
	gap: .7rem;
}

.game-gate__key-row {
	display: flex;
	justify-content: center;
	gap: .55rem;
}

.game-gate__key-row--numbers .game-gate__key {
	flex: 1 1 0;
	min-width: 0;
}

.game-gate__key-row--letters .game-gate__key {
	flex: 0 1 5.4rem;
	width: 5.4rem;
	min-width: 0;
}

.game-gate__key,
.game-gate__delete {
	min-height: 3.15rem;
	border: 0;
	border-radius: 999px;
	color: #fff;
	background: #14477d;
	font: 400 1.15rem/1 "Changa One", Arial, sans-serif;
	cursor: pointer;
}

.game-gate__key:active,
.game-gate__delete:active {
	background: #1b75bc;
}

.game-gate__delete {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 4.5rem;
	height: 3.15rem;
	padding: 0 0 .08em;
	margin-top: .75rem;
	margin-right: auto;
	margin-left: auto;
	background: #58595b;
	font-family: Arial, sans-serif;
	font-size: 1.65rem;
	font-weight: 900;
	line-height: 1;
}

.game-gate button:focus-visible {
	outline: 4px solid #6dcff6;
	outline-offset: 2px;
}

.game-gate button:disabled {
	opacity: .55;
	cursor: wait;
}

.game-gate__status {
	min-height: 1.5rem;
	margin: .65rem 0 0;
	color: #b20d17;
	font-weight: 700;
}

.score-overlay {
	background: rgb(20 71 125 / 94%);
}

@media (max-width: 700px) {
	.game-gate__key-row { gap: .3rem; }
	.game-gate__key-row--letters .game-gate__key { flex: 1 1 0; width: auto; }
	.game-gate__panel { width: min(34rem, 100%); }
}

.score-overlay__panel p {
	margin: 0;
	color: #1b75bc;
	font-size: 1.5rem;
	font-weight: 700;
}

.score-overlay__panel strong {
	display: block;
	margin-top: .5rem;
	color: #14477d;
	font-size: clamp(4rem, 20vw, 8rem);
	line-height: 1;
}

input[type="file"] {
	color: black;
}

html, body, canvas {
	touch-action-delay: none;
	touch-action: none;
}

canvas, .c3htmlwrap {
	position: absolute;
}

.c3htmlwrap {
	contain: strict;
}

.c3overlay {
	pointer-events: none;
}

.c3htmlwrap[interactive] > * {
	pointer-events: auto;
}

/* HACK - work around elements being selectable only in iOS WKWebView for some reason */
html[ioswebview] .c3htmlwrap,
html[ioswebview] canvas {
	-webkit-user-select: none;
	user-select: none;
}

html[ioswebview] .c3htmlwrap > * {
	-webkit-user-select: auto;
	user-select: auto;
}

#notSupportedWrap {
	margin: 2em auto 1em auto;
	width: 75%;
	max-width: 45em;
	border: 2px solid #aaa;
	border-radius: 1em;
	padding: 2em;
	background-color: #f0f0f0;
	font-family: "Segoe UI", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
	color: black;
}

#notSupportedTitle {
	font-size: 1.8em;
}

.notSupportedMessage {
	font-size: 1.2em;
}

.notSupportedMessage em {
	color: #888;
}

/* bbcode styles */
.bbCodeH1 {
	font-size: 2em;
	font-weight: bold;
}

.bbCodeH2 {
	font-size: 1.5em;
	font-weight: bold;
}

.bbCodeH3 {
	font-size: 1.25em;
	font-weight: bold;
}

.bbCodeH4 {
	font-size: 1.1em;
	font-weight: bold;
}

.bbCodeItem::before {
	content: " • ";
}

/* For text icons converted to HTML: size the height to the line height
   preserving the aspect ratio. Also add position: relative as that allows
   just adding a 'top' style for the iconoffsety style. */
.c3-text-icon {
	height: 1em;
	width: auto;
	position: relative;
}

/* screen reader text */
.c3-screen-reader-text {
	position: absolute;
	width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
}

.score-overlay { overflow-y: auto; touch-action: pan-y; }
.score-overlay__panel { box-sizing: border-box; max-height: 100%; overflow-y: auto; }
.leaderboard { width: min(28rem, 100%); margin: 1.5rem auto 0; border-top: 2px solid #d7dee4; padding-top: 1rem; }
.leaderboard h2 { margin: 0 0 .25rem; color: #14477d; font-size: 2rem; font-weight: 400; }
.leaderboard p { font-size: 1rem; font-weight: 400; }
.leaderboard ol { list-style: none; margin: .75rem 0 0; padding: 0; }
.leaderboard__row { display: grid; grid-template-columns: 1.5em minmax(0, 1fr) auto; gap: .5rem; align-items: center; padding: .5rem .75rem; border-radius: 6px; text-align: left; font-size: clamp(1rem, 3vw, 1.75rem); }
.leaderboard__name { overflow-wrap: anywhere; }
.leaderboard__row--current { background: #14477d; color: #fff; }
