@keyframes flash {
	from { background-color: var(--texts); z-index: 502; }
	to { background-color: #ffffff00; z-index: 502; }
}

@keyframes hideInit {
	0% { opacity: 100%; }
	50% { opacity: 0; }
	100% { opacity: 0; }
}

@keyframes showInit {
	0% { opacity: 0; }
	50% { opacity: 0; }
	100% { opacity: 100%; }
}

* {
	color: var(--texts);
	font-family: 'SourceCodePro';
	border-color: var(--hl-comment);
}

html { scrollbar-width: none; }

body {
	display: flex;
	flex-wrap: wrap;
	width: 100vw; height: 100vh;
	margin: 0;
	background-color: var(--background);
	justify-content: center;
	align-items: center;
}

canvas {
	cursor: url(res/cur.png) 4 4, auto;
}

legend {
	font-weight: bold;
}

a {
	text-decoration: none;
	cursor: pointer;
}

/*#ko-fi {
	position: absolute;
	color: #000 !important;
	font-size: 14px;
	display: inline-flex;
	margin-left: 8px;
	padding-inline: 3px;
	background-color: #c19bff;
	border: 2px solid #9777ab;
	border-radius: 5px;
	align-items: center;
}
#ko-fi:hover {
	text-decoration: none !important;
	border: 2px solid #fff;
}
#ko-fi:active { border: 2px solid #c19bff; }
#ko-fi img {
	height: 16px;
	margin-right: 3px;
}*/

#nkp-cover {
	position: fixed;
	left: 0; top: 0;
	width: 100vw; height: 100vh;
	/*background-color: #00000044*/
	backdrop-filter: brightness(0.5);
	z-index: 900;
}

.fira {
	font-family: 'Fira Code';
}

#options {
	display: flex;
	gap: 3px;
	width: 100%;
	background-color: var(--dark-color);
	align-self: start;
	align-items: center;
	padding-left: 1rem;
	z-index: 501;
}
#options * { z-index: 501; }
#options > span { color: #ffffff44; font-size: 0.8rem; }
#options a span { color: var(--texts); }
#options a:hover span { text-decoration: underline; }

.op-menu {
	position: absolute;
	top: 1.5rem;
	display: none;
	min-width: 144px;
	min-height: 64px;
	padding: 3px;
	background-color: var(--dark-color);
	border: 1px solid var(--background);
	z-index: 500 !important;
}
.op-menu a {
	user-select: none;
}
#op-file {
	position-anchor: --file;
	left: calc(anchor(left) - 8px);
}
#op-sett {
	position-anchor: --sett;
	left: calc(anchor(left) - 8px);
}
#op-more {
	position-anchor: --more;
	left: calc(anchor(left) - 8px);
}

#op-them {
	grid-template-columns: 1fr 1fr 1fr;
	gap: 3px;
	left: 1rem;
	width: calc(100vw - 2rem);
	max-width: 400px;
}

#op-them > div > span {
	font-weight: bold;
	text-align: center;
	display: block;
	border-bottom: 1px solid var(--texts);
}

#op-them > div > a {
	text-align: center;
	display: block;
	padding-block: 1px;
	margin-top: 2px;
	border: 1px dotted transparent;
}
#op-them > div > a:hover { border: 1px dashed #ffffff44; }

.op-menu hr {
	margin: 3px;
	border-color: var(--texts);
}

.op-menu > a {
	display: block;
	padding-inline: 5px;
}
.op-menu > a:hover {
	background-color: var(--background);
}

#current-display {
	display: inline-block;
	max-width: 50%;
	overflow: auto;
	text-wrap-mode: nowrap;
	scrollbar-width: none;
}

#editor-soft-switch {
	display: none;
	aspect-ratio: 1/1;
	cursor: pointer;
}

.editor-dropdown a {
	user-select: none;
}
.editor-dropdown > div { width: calc(100% - 6px); margin-bottom: 1px; }
.editor-dropdown {
	position: absolute;
	/*display: none;*/
	height: 0;
	margin-top: 3px;
	overflow: auto;
	background-color: var(--background);
	border-radius: 5px;
	transition: height 0.3s ease;
	scrollbar-width: thin;
	scrollbar-color: var(--dark-color) var(--background);
	z-index: 600 !important;
}
.drop-new {
	color: var(--active);
	font-size: 20px;
	font-weight: bold;
	text-align: center;
	width: 50%;
}
.drop-new:hover { background-color: var(--dark-color); }

.drop-item { display: flex; }
.drop-item > a { display: inline-block; padding-inline: 5px; border-top: 1px solid var(--dark-color); }
.drop-item > a:hover { background-color: var(--dark-color); }
.drop-item > a:first-child { width: 100%; }
.drop-item > a:nth-child(2) {
	box-shadow: 4px 0 var(--background) inset,
	-4px 0 var(--background) inset,
	0 -1px var(--texts) inset;
}
.drop-item > a:nth-child(2):hover {
	box-shadow: 4px 0 #222222 inset,
	-4px 0 #222222 inset,
	0 -1px var(--texts) inset;
}
.drop-item > a:nth-child(3) { transform: scale(-1, 1); }
.drop-item > a:nth-child(4) { color: #f22; }

@media (min-aspect-ratio: 4/3) { .editor-dropdown { width: 100%; } }
@media (max-aspect-ratio: 3/4) { .editor-dropdown { width: 96%; } }
@media (min-aspect-ratio: 3/4) and (max-aspect-ratio: 4/3) {
	.editor-dropdown { width: 96%; }
}


#game-display, #editor-display {
	position: fixed;
	z-index: 400;
}

#game-display {
	display: flex;
	flex-wrap: wrap;
}

#game-name-legend {
	text-shadow: -1px -1px var(--background),
		-1px 1px var(--background),
		1px -1px var(--background),
		1px 1px var(--background);
	transition: all 0.2s ease;
}

#nkp_window {
	position: fixed;
	z-index: 500;
}

#nkp_window input {
	padding: 0;
	background-color: transparent;
	outline: none;
	border: none;
	overflow-x: hidden;
}

#editor-scene {
	display: flex;
	padding-inline: 1rem;
	justify-content: space-between;
	user-select: none;
}

#editor-scene-btns a {
	color: var(--background);
	font-size: 14px;
	padding-inline: 3px;
	background-color: var(--texts);
	border-width: 2px;
	border-style: outset;
	border-radius: 5px;
	user-select: none;
}
#editor-scene-btns a:active {
	border-width: 2px;
	border-style: inset;
}

.hide {
	display: none;
}

.debug-switch {
	width: 16px !important;
	height: 16px !important;
	border: 4px solid var(--texts);
	line-height: 14px;
}

#game-buttons {
	position: fixed;
	display: flex;
	gap: 5px;
	justify-content: end;
	z-index: 503;
}

#game-buttons.fs {
	top: 5px !important;
}

#game-buttons a {
	color: var(--background);
	text-align: center;
	width: 24px;
	height: 24px;
	background-color: var(--texts);
	border-radius: 5px;
	user-select: none;
	transition: all 0.2s ease;
}

#game-display > fieldset {
	position: fixed;
	display: flex;
	justify-content: center;
	border: 3px solid var(--texts);
	border-radius: 5px;
	z-index: 501;
}

#game-display > fieldset > legend {
	color: var(--texts);
	font-size: 14px;
	text-shadow: -1px -1px var(--background),
		-1px 1px var(--background),
		1px -1px var(--background),
		1px 1px var(--background);
	z-index: 501;
}

@media (min-aspect-ratio: 3/4) and (max-aspect-ratio: 4/3) {
	#game-display, #editor-display {
		width: 100%;
		left: 0;
		right: auto;
	}

	#game-display {
		top: 1.5rem;
		height: 45%;
		bottom: auto;
	}

	#editor-display {
		top: auto;
		bottom: 0;
		height: 50%;
	}
}

@media (min-aspect-ratio: 4/3) {
	#game-display, #editor-display { top: 1.5rem; height: 96%; }

	#game-display {
		right: 0;
		width: 60%;
	}

	#editor-display {
		left: 0;
		width: 39%;
	}
}

@media (max-aspect-ratio: 3/4) {
	#game-display, #editor-display { width: 100%; }

	#game-display {
		top: 1.5rem;
		height: 30%;
	}

	#editor-display {
		bottom: 0;
		height: 64%;
	}
}

#fullscreen-cover {
	position: fixed;
	left: 0;
	top: 0;
	width: 100vw;
	height: 100vh;
	background-color: #00000088;
	z-index: 550;
}

.fullscreen-cont {
	left: 20px !important;
	top: 20px !important;
	width: 95vw !important;
	height: 90vh !important;
	background-color: var(--background);
	z-index: 600;
}
.fullscreen-div {
	width: calc(95vw - 50px) !important;
	height: calc(90vh - 16px) !important;
}

@media (max-width: 960px) {
	.fullscreen-cont {
		left: 5px !important;
		top: 2rem !important;
		width: 90vw !important;
		height: 50vh !important;
		background-color: var(--background);
		z-index: 600;
	}
	.fullscreen-div {
		width: calc(90vw - 50px) !important;
		height: calc(50vh - 16px) !important;
	}
}

.text-editor-cont {
	position: fixed;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	border: 3px solid var(--texts);
	border-radius: 5px;
	transition: all 0.2s ease;
}

.text-editor-cont legend { color: var(--texts); font-size: 14px; }

.idea {
	border: 2px solid #ff0;
	transform: translateY(-2px);
}

.editor-buttons {
	display: flex;
	gap: 5px;
	width: 100%;
	justify-content: end;
}

.editor-buttons a {
	color: var(--background);
	text-align: center;
	width: 24px;
	height: 24px;
	background-color: var(--texts);
	border-radius: 5px;
	user-select: none;
	transition: all 0.2s ease;
}

.text-editor {
	padding-left: 20px;
	overflow: hidden;
}

.text-editor > pre:first-child {
	color: var(--hl-comment);
	direction: rtl;
	width: 16px;
	padding-right: 2px;
	border-right: 1px solid #88888888;
	transform: translateX(-20px);
	overflow: hidden;
	user-select: none;
}

.text-editor > pre, .text-editor > textarea {
	font-size: 14px;
	white-space: pre;
	position: absolute;
	caret-color: var(--active);
	width: inherit;
	height: inherit;
	margin: 0;
	padding: 0;
	overflow: auto;
	scrollbar-width: none;
}

.text-editor > textarea {
	outline: none;
	border: none;
	resize: none;
	background: none;
}

.window {
	position: fixed;
	min-width: 144px;
	background-color: var(--background);
	border: 2px solid var(--texts);
	border-radius: 5px;
	z-index: 901;
}

.window-head {
	display: flex;
	width: inherit;
	padding-inline: 2px;
	background-color: var(--dark-color);
	border: 1px solid var(--texts);
	justify-content: space-between;
}
.window-head > a {
	color: var(--dark-color);
	font-size: 14px;
	display: flex;
	width: 15px;
	height: 15px;
	margin: 2px;
	margin-left: 1rem;
	background-color: var(--texts);
	border-width: 2px;
	border-style: outset;
	align-items: center;
	justify-content: center;
}
.window-head > a:active { border-style: inset; }

.window-content {
	display: flex;
	flex-wrap: wrap;
	width: inherit;
	padding-inline: 2px;
}

.window-content input {
	background-color: transparent;
	border: 1px solid var(--dark-color);
	outline: none;
}

.window-buttons {
	display: flex;
	gap: 3px;
	width: inherit;
	padding: 5px;
	margin-top: 5px;
	justify-content: end;
}
.window-buttons a:first-child {
	background-color: var(--cancel);
}
.window-buttons a {
	color: #000;
	font-size: 12px;
	padding-block: 3px;
	padding-inline: 5px;
	background-color: var(--continue);
	border: 1px solid #000;
	border-radius: 5px;
	user-select: none;
}

#sideButtons {
	position: fixed;
	display: flex;
	flex-direction: column;
	gap: 3px;
	top: 2rem;
	right: 0;
	display: flex;
	z-index: 650;
}

#sideButtons > a {
	font-size: 12px;
	writing-mode: vertical-lr;
	color: black;
	padding-block: 1px;
	padding-inline: 3px;
	background-color: #05f;
	border-top-left-radius: 5px;
	border-bottom-left-radius: 5px;
}