@font-face {
	font-family: '7seg';
	src: url('../font/DSEG7Modern-Bold.woff2');
	font-weight: normal;
    font-style: normal;
}

@font-face {
	font-family: '7seg';
	src: url('../font/DSEG7Modern-BoldItalic.woff2');
	font-weight: normal;
	font-style: italic;
}

@font-face {
	font-family: 'BIZUDGothic';
	src: url('../font/BIZUDGothic-Regular.ttf');
	font-weight: normal;
	font-style: normal;
}

@font-face {
	font-family: 'BIZUDGothic';
	src: url('../font/BIZUDGothic-Bold.ttf');
	font-weight: bold;
	font-style: normal;
}

body {
	font-family: 'BIZUDGothic';
	font-size: 10px;
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	height: 100vh;
	background-color: #000;
	filter: drop-shadow(8px 16px 4px black);
	background-image: url(https://www.transparenttextures.com/patterns/smooth-wall-dark.png);
}

body::before {
	content: '';
	position: absolute;
	width: 100%;
	height: 100%;
	background-image: url(../img/background.png);
	/* background-size: 920px; */
	background-size: 840px;
	background-position: center;
	background-repeat: no-repeat;
}

ul {
	list-style: none;
}

input,button {
	font-family: 'BIZUDGothic';
	border-radius: 4px;
}

#main {
	display: grid;
	/* grid-template-columns: 188px 640px 188px; */
	grid-template-columns: 176px 560px 176px;
	grid-template-rows: 1fr min-content 1fr;
	grid-gap: 8px;
	position: relative;
	padding: 12px 0;
	font-size: 10px;
	perspective: 1024px;
}

/* section::before {
	content: '';
	position: absolute;
	display: block;
	width: 100%;
	height: 100%;
	z-index: -1;
	backdrop-filter: brightness(0.5);
	-webkit-mask-box-image: radial-gradient(black 50%, black 65%, transparent 70%);
} */

.dropShadow {
	filter: drop-shadow(2px 2px 4px #000A);
}

h1 {
	grid-column: 2;
	grid-row: 3;
	display: flex;
	justify-content: center;
	align-items: end;
	min-height: 80px;
	font-size: 1.8em;
	font-family: 'impact';
	text-align: center;
	-webkit-text-stroke: 3px #FFF;
	user-select: none;
	background: url(../img/logo.png);
	background-size: contain;
	background-position: top;
	background-repeat: no-repeat;
}

h1::before {
	content: 'THE LAST DOOR SIMULATOR 54';
	display: block;
	position: absolute;
	-webkit-text-stroke: 7px #F00;
	text-shadow: none;
	z-index: -1;
}

h1::after {
	content: 'THE LAST DOOR SIMULATOR 54';
	display: block;
	position: absolute;
	color: #003;
	text-shadow: none;
	z-index: 3;
	-webkit-text-stroke: 0;
}

h1[name=_0] {
	height: 100px;
}

#dataInfo {
	display: grid;
	grid-template-columns: 100%;
	grid-gap: 4px;
	grid-column: 2;
	grid-row: 1;
	padding: 4px;
	font-family: '7seg', 'BIZUDGothic';
	font-size: 2.4em;
	background-color: #000;
	user-select: none;
	border: 2px ridge #888;
}

	#dataInfo #scfWrapper {
		display: flex;
		grid-gap: 4px;
	}

	#dataInfo ul {
		display: flex;
		height: 1em;
		justify-content: flex-end;
		width: 100%;
		margin: 0 auto;
		overflow: hidden;
		background-color: #111;
	}

	#dataInfo ul li {
		height: inherit;
		box-sizing: border-box;
		margin-right: 1.4px;
	}

	#dataInfo ul li:last-child {
		border-right: 0 none;
	}

	#dataInfo ul li > div {
		position: relative;
		height: 1px;
		width: 3px;
		background-color: #0C0;
	}

	#dataInfo #scf {
		font-size: 1em;
		display: flex;
		justify-content: right;
		background-color: #111;
	}

	.front {
		color: #0C0;
		position: absolute;
	}

	.back {
		color: #030;
		user-select: none;
	}

	#scf .front {
		color: #D80;
	}

	#scf .back {
		color: #420;
	}

.entryList {
	display: flex;
	flex-wrap: wrap;
	align-content: center;
	grid-gap: 4px;
	grid-row: 2;
}

.entryList.left {
	grid-column: 1;
	/* transform: rotateY(20deg); */
	transform: rotateY(36deg);
	transform-origin: right;
}

.entryList.right {
	grid-column: 3;
	/* transform: rotateY(-20deg); */
	transform: rotateY(-36deg);
	transform-origin: left;
}



#game {
	display: none;
	width: 100%;
	border-radius: 6px;
	aspect-ratio: 4/3;
	grid-column: 2;
	grid-row: 2;
	grid-template-rows: 1fr 66.66667% 1fr;
	grid-template-columns: 100%;
	box-sizing: border-box;
	position: relative;
	z-index: 1;
	overflow: hidden;
	background-color: #ace6ff;
	background-image: url(../img/samuraishodown-stage-gairyu-isle.gif);
	background-position: center bottom;
	background-size: cover;
	image-rendering: pixelated;
}

#openDoorButton {
	--width: 200px;
	--height: 80px;

	position: absolute;
	user-select: none;
	width: var(--width);
	height: var(--height);
	font-size: 3.2em;
	font-weight: bold;
	text-shadow: 1px 1px #DDD;
	top: calc(50% - var(--height) / 2);
	left: calc(50% - var(--width) / 2);
	cursor: pointer;
	background-color: orange;
	color: #333;
	border: 10px outset #333;
	border-radius: 100%;
}

#openDoorButton:disabled {
	opacity: 1;
	cursor: not-allowed;
	filter: grayscale(1);
}

#nameEntryWrapper {
	width: 100%;
	position: relative;
	display: flex;
	justify-content: center;
	align-items: end;
	grid-row: 3;
}

#nameEntryWrapper > div {
	width: inherit;
	height: 100%;
}

#frontCharaWrapper {
	position: absolute;
	height: 100%;
	width: 100%;
}

#frontCharaWrapper img {
	user-select: none;
	position: absolute;
	bottom: 0;
	right: 10px;
	height: 210%;
	display: none;
}

#inputWrapper {
	position: relative;
	display: flex;
	grid-gap: 4px;
	width: 100%;
	height: 100%;
	padding: 8px;
	box-sizing: border-box;
	font-size: 1em;
}

input[name=entryName] {
	width: 100%;
	padding: 4px;
	border: 1px solid #555;
	font-size: 2.4em;
	text-align: center;
	color: #333;
	background-image: url(https://www.transparenttextures.com/patterns/cream-pixels.png);
	box-shadow: inset 2px 2px 4px -2px #000C;
}

button[name=entry],
button[name=iconEnter] {
	cursor: pointer;
	width: 5em;
	height: 100%;
	padding: 4px;
	border: 1px solid #555;
	align-self: end;
	font-size: 2.4em;
	font-weight: bold;
	color: #333;
	text-shadow: 1px 1px #EEE;
	background-color: #CCC;
	background-image: url(https://www.transparenttextures.com/patterns/asfalt-light.png);
	user-select: none;
}

input[name=entryName]:disabled {
	border: 1px solid #FFF0;
	font-size: 3em;
	font-weight: bold;
	color: #FFF;
	text-shadow: 1px 1px #000, -1px -1px #000, 1px -1px #000, -1px 1px #000;
	background-color: transparent;
	background-image: none;
	box-shadow: none;
	opacity: 1;
}

button[name=entry]:disabled,
button[name=iconEnter]:disabled {
	display: none;
}

#topInfo {
	display: grid;
	grid-template-columns: 1fr min-content;
	grid-template-rows: 1fr 1fr;
	grid-gap: 4px;
	color: #030;
}

#systemMessage {
	grid-column: 1;
	grid-row: 1 / 3;
	color: #FE0;
	display: flex;
	font-size: 0.75em;
	align-items: center;
	justify-content: center;
	background-color: #111;
}

#timer div.label,
#score div.label {
	color: #0C0;
	font-family: 'impact';
	border: 1px solid #0C0;
	padding: 2px;
	font-size: 0.5em;
	height: 1em;
	width: calc(100% - 8em);
	text-align: center;
}

#timer,
#score {
	display: flex;
	align-items: center;
	background-color: #111;
}

#timer div.string,
#score div.string {
	width: 5.25em;
	font-size: 0.75em;
	display: flex;
	justify-content: right;
}

.gameBackground {
	width: 100%;
	grid-row: 2;
	z-index: -1;
	position: relative;
}

.gameBackground img {
	width: 50%;
	image-rendering: pixelated;
	user-select: none;
	position: relative;
}

#character {
	position: absolute;
	width: 100%;
	height: 100%;
	text-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: -2;
}

#character img {
	width: auto;
	height: 66.66667%;
	/* display: none; */
}

.slideLeft {
	animation-name				: slideLeft;
	animation-duration			: 4000ms;
	animation-direction 		: normal;
	animation-fill-mode			: forwards;
	animation-iteration-count	: initial;
}

.slideRight {
	animation-name				: slideRight;
	animation-duration			: 4000ms;
	animation-direction 		: normal;
	animation-fill-mode			: forwards;
	animation-iteration-count	: initial;
}

.slideToBottom {
	animation-name				: slideToBottom;
	animation-duration			: 1000ms;
	animation-direction 		: normal;
	animation-fill-mode			: forwards;
	animation-iteration-count	: initial;
}

@keyframes slideLeft {
	0% { transform: translateX(0) }
	100% { transform: translateX(-90%) }
}

@keyframes slideRight {
	0% { transform: translateX(0) }
	100% { transform: translateX(90%) }
}

@keyframes slideToBottom {
	0% { transform: translateY(-1000%) }
	100% { transform: translateX(0) }
}

@keyframes slideLeftName {
	0% { transform: translateX(100%) }
	100% { transform: translateX(0) }
}

@keyframes startup {
	0% {
		opacity: 0;
		transform: rotateY(990deg);
	}
	100% {
		opacity: 1;
		transform: rotateY(0);
	}
}

@keyframes fadeIn {
	0% {
		opacity: 0;
	}
	100% {
		opacity: 1;
	}
}

@keyframes scaleIn {
	0% { 
		transform: scale(0);
		opacity: 0;
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

.entryList li {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	overflow: hidden;
	background-color: #ace6ff;
	height: min-content;
	user-select: none;
	border-radius: 2px;
	/* width: 60px; */
	width: 56px;
	aspect-ratio: 4/3;
	animation-name				: scaleIn;
	animation-duration			: 1000ms;
	animation-timing-function	: ease;
	animation-direction 		: normal;
	animation-fill-mode			: forwards;
	animation-iteration-count	: initial;
}

.entryList li .doorWrapper {
	display: flex;
	width: 100%;
	height: 100%;
}

.entryList li .doorWrapper img {
	width: 50%;
}

.disabledDoor {
	filter: brightness(0.5);
}

.clientNameWrapper {
	position: absolute;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	box-sizing: border-box;
	font-weight: bold;
	color: #FFF;
	animation-name				: slideLeftName;
	animation-duration			: 500ms;
	animation-timing-function	: ease;
	animation-direction 		: normal;
	animation-fill-mode			: forwards;
	animation-iteration-count	: initial;
}

.clientNameWrapper > div {
	position: relative;
	z-index: 0;
	text-align: justify;
	background-color: rgba(0, 0, 0, 0.7);
	word-break: break-all;
	text-wrap: wrap;
	padding: 1px;
}

.clientNameWrapper > div::before {
	content: attr(data-name);
	position: absolute;
	display: block;
	-webkit-text-stroke: 2px #000;
	z-index: -1;
}

#startUpCount {
	position: absolute;
	width: 100%;
	top: calc(50% - 1em / 2);
	left: 0;
	z-index: 20;
	font-family: 'impact';
	font-weight: bold;
	font-size: 320px;
	text-align: center;
	color: crimson;
	-webkit-text-stroke: white 5px;
	user-select: none;
	filter: drop-shadow(4px 4px 4px black);
}

dialog::backdrop {
	background-color: rgba(0, 0, 0, 0.5);
}

dialog {
	border: none;
	border-radius: 5px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	padding: 20px;
	width: 300px;
	text-align: center;
	font-size: 14px;
}

dialog h2 {
	color: #F00;
	border-bottom: 1px solid #888;
	padding-bottom: 0.5em;
	margin-bottom: 0.5em;
}

#iconUploaderWrapper {
	background-color: #000A;
	position: absolute;
	height: 100%;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

#myIcon {
	position: absolute;
	top: 4px;
	left: 4px;
	border-radius: 4px;
	border: 1px solid #888;
	width: 60px;
	image-rendering: auto;
}

#inputImage {
	width: 300px;
	background-color: #FFF;
}

#trimEnter,
#resetEnter {
	z-index: 1;
	width: 150px;
	box-sizing: border-box;
	border: 1px solid #CCC;
	border-radius: 0;
	height: 30px;
}

.blinking{
	/* animation:blink 3s ease-in-out infinite alternate; */
}

@keyframes blink{
	0% {opacity:0;}
	100% {opacity:1;}
}

@media screen and (min-width: 481px) {
	h1 {
		animation-name				: startup;
		animation-duration			: 5000ms;
		animation-timing-function	: ease;
		animation-direction 		: normal;
		animation-fill-mode			: forwards;
		animation-iteration-count	: initial;
	}	
}

@media screen and (max-height: 620px) {
	body.seq1,
	body.seq2,
	body.seq3 {
		height: 100%;
	}
}

@media screen and (max-width: 480px) {
	body {
		height: 100svh!important;
		filter: drop-shadow(0 0 0 #0000);
	}

	body::before {
		background-size: 100vh;
	}

	#main {
		grid-template-columns:100%;
		grid-template-rows: auto;
		perspective: 0;
		padding: 8px;
		grid-gap: 4px;
	}

	.dropShadow {
		filter: drop-shadow(0 0 0 #0000);
	}

	h1,
	#game,
	#dataInfo,
	.entryList.left,
	.entryList.right {
		grid-column: 1;
	}

	h1 {
		grid-row: 3;
		width: calc(100vw - 16px);
		animation-name				: fadeIn;
		animation-duration			: 5000ms;
		animation-timing-function	: ease;
		animation-direction 		: normal;
		animation-fill-mode			: forwards;
		animation-iteration-count	: initial;
	}

	#dataInfo {
		grid-row: 1;
		box-sizing: border-box;
		width: calc(100vw - 16px);
	}

	#game {
		grid-row: 2;
	}

	.entryList {
		justify-content: center;
		grid-gap: 2px;
		display: none;
	}

	.entryList.left {
		grid-row: 4;
		transform: rotateY(0);
		margin-bottom: -2px;
	}

	.entryList.right {
		grid-row: 5;
		transform: rotateY(0);
	}

	.entryList li .doorWrapper {
		width: 60px;
	}

	#systemMessage {
		font-size: 0.6em;
	}

	input[name=entryName]:disabled {
		font-size: 2.4em;
	}

	button#openDoorButton,
	button#openDoowButton:disabled {
		touch-action: none;
	}
}
