/* Entry gate. Sits outside the fixed 1920x1080 game stage. */
:root {
	--gate-font: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}
.entry-gate {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 22px;
	overflow: hidden;
	color: #f7e6bd;
	background-color: #100b07;
	background-image: url("../assets/ui/gate_tavern_door.png");
	background-position: center;
	background-size: cover;
	font-family: Georgia, "Times New Roman", serif;
}

.entry-gate::before {
	position: absolute;
	inset: 0;
	content: "";
	background: rgba(5, 3, 2, 0.46);
	pointer-events: none;
}

.entry-gate__panel {
	position: relative;
	width: min(420px, 92vw);
	max-height: 94vh;
	padding: 24px;
	overflow-y: auto;
	background: #3a2415;
	border: 2px solid #9b7138;
	border-radius: 16px;
	box-shadow:
		0 24px 60px rgba(0, 0, 0, 0.72),
		inset 0 0 0 5px #24140b,
		inset 0 0 0 7px rgba(240, 198, 121, 0.38),
		inset 0 0 24px rgba(0, 0, 0, 0.55);
}

.entry-gate__panel::before {
	position: absolute;
	inset: 10px;
	content: "";
	border: 1px solid rgba(248, 213, 142, 0.28);
	border-radius: 10px;
	pointer-events: none;
}

.entry-gate__bolt {
	position: absolute;
	z-index: 1;
	width: 13px;
	height: 13px;
	background: #c79a56;
	border: 1px solid #1b0f08;
	border-radius: 50%;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.entry-gate__bolt--tl { top: 10px; left: 10px; }
.entry-gate__bolt--tr { top: 10px; right: 10px; }
.entry-gate__bolt--bl { bottom: 10px; left: 10px; }
.entry-gate__bolt--br { bottom: 10px; right: 10px; }

.entry-gate__title {
	margin: 0 0 10px;
	color: #f6d68d;
	font-family: var(--gate-font);
	font-size: clamp(22px, 3.2vh, 28px);
	font-weight: 600;
	letter-spacing: 2.6px;
	text-align: center;
	text-shadow: none;
}

.entry-gate__divider {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: center;
	margin: 0 0 14px;
	color: #d3a35a;
	font-size: 14px;
}

.entry-gate__divider span {
	display: block;
	width: 42%;
	height: 1px;
	background: #c49a58;
}

.entry-gate__slots {
	display: flex;
	justify-content: center;
	gap: 10px;
	padding: 12px 10px;
	margin-bottom: 16px;
	background: #1b120c;
	border: 1px solid #1e120b;
	border-radius: 12px;
	box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.75), 0 1px 0 rgba(255, 224, 160, 0.16);
}

.entry-gate__slot {
	position: relative;
	display: block;
	width: clamp(30px, 4.6vh, 38px);
	height: clamp(30px, 4.6vh, 38px);
	background: #17100b;
	border: 2px solid #a4773c;
	border-radius: 50%;
	box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.entry-gate__slot.is-filled::after {
	position: absolute;
	top: 50%;
	left: 50%;
	content: "•";
	color: #f4d48a;
	font-family: Arial, sans-serif;
	font-size: clamp(26px, 4vh, 34px);
	line-height: 1;
	transform: translate(-50%, -54%);
	text-shadow: 0 0 8px rgba(255, 210, 120, 0.65);
}

.entry-gate__keypad {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 9px;
	width: 100%;
}

.entry-gate__key {
	display: flex;
	min-width: 0;
	width: 100%;
	margin: 0;
	box-sizing: border-box;
	align-items: center;
	justify-content: center;
	height: clamp(48px, 7.2vh, 66px);
	padding: 0;
	color: #f7df9e;
	font-family: var(--gate-font);
	font-size: clamp(24px, 3.8vh, 34px);
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	background: #6b4220;
	border: 1px solid #d0a35d;
	border-radius: 9px;
	box-shadow:
		0 4px 0 #1b0f08,
		0 6px 10px rgba(0, 0, 0, 0.35),
		inset 0 1px 0 rgba(255, 234, 180, 0.35);
	text-shadow: 0 2px 0 #2c170a;
	transition: filter 120ms ease, transform 80ms ease, box-shadow 80ms ease;
}

.entry-gate__key:hover {
	filter: brightness(1.12);
}

.entry-gate__key:active {
	transform: translateY(3px);
	box-shadow:
		0 1px 0 #1b0f08,
		0 3px 6px rgba(0, 0, 0, 0.35),
		inset 0 1px 0 rgba(255, 234, 180, 0.35);
}

.entry-gate__key:disabled {
	cursor: default;
	filter: brightness(0.7);
}

.entry-gate__message {
	position: absolute;
	left: 50%;
	bottom: 26px;
	z-index: 1;
	max-width: 80%;
	padding: 6px 12px;
	margin: 0;
	color: #f2d7a5;
	font-family: var(--gate-font);
	font-size: 12px;
	text-align: center;
	background: rgba(20, 12, 8, 0.82);
	border: 1px solid rgba(155, 113, 56, 0.6);
	border-radius: 4px;
	transform: translateX(-50%);
}

.entry-gate__message:empty {
	display: none;
}

.entry-gate.is-error .entry-gate__panel {
	animation: entry-gate-shake 300ms ease;
}

.entry-gate.is-error .entry-gate__slot {
	border-color: #d46b52;
}

.entry-gate.is-leaving {
	opacity: 0;
	visibility: hidden;
	transition: opacity 650ms ease, visibility 650ms ease;
}


.entry-gate.is-loading {
	background-image: url("../assets/scenes/story_01_board.png");
}

.entry-gate.is-loading::before {
	background: rgba(4, 3, 2, 0.18);
}

.entry-gate.is-loading .entry-gate__panel {
	display: none;
}

.entry-gate__loading {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: none;
	align-items: center;
	justify-content: center;
}

.entry-gate.is-loading .entry-gate__loading {
	display: flex;
}

.entry-gate__loading-track {
	width: min(320px, 52vw);
	height: 3px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.28);
	border-radius: 2px;
}

.entry-gate__loading-fill {
	width: 0%;
	height: 100%;
	background: #fff;
	border-radius: 2px;
	transition: width 0.25s ease;
}

/* One universal warning for login, loading and the game itself. */
.screen-warning {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 22px;
	background: rgba(4, 3, 2, 0.86);
}

.screen-warning.is-visible {
	display: flex;
}

.screen-warning__panel {
	width: min(420px, 90vw);
	padding: 26px 24px;
	text-align: center;
	background: #24170e;
	border: 2px solid #9b7138;
	border-radius: 12px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7);
}

.screen-warning__mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin: 0 auto 12px;
	color: #24170e;
	font-family: Arial, sans-serif;
	font-size: 28px;
	font-weight: 700;
	background: #e1b477;
	border-radius: 50%;
}

.screen-warning__panel h2 {
	margin: 0 0 10px;
	color: #f6d68d;
	font-family: var(--gate-font);
	font-size: 22px;
	font-weight: 600;
	letter-spacing: 1.5px;
}

.screen-warning__panel p {
	margin: 0;
	color: #e8d6b5;
	font-family: var(--gate-font);
	font-size: 14px;
	line-height: 1.5;
}

/* Game loading screen: first scene photo, one white bar, no text. */
loading-screen {
	background: #070a0d url("../assets/scenes/story_01_board.png") center/cover no-repeat !important;
}

loading-screen [data-content="title"],
loading-screen [data-content="message"] {
	display: none !important;
}

loading-screen [data-content="wrapper"] {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: min(320px, 52vw);
}

loading-screen [data-content="progress"] {
	appearance: none;
	-webkit-appearance: none;
	display: block;
	width: 100%;
	height: 3px;
	margin: 0;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.28);
	border: 0;
	border-radius: 2px;
}

loading-screen [data-content="progress"]::-webkit-progress-bar {
	background: rgba(255, 255, 255, 0.28);
	border-radius: 2px;
}

loading-screen [data-content="progress"]::-webkit-progress-value {
	background: #fff;
	border-radius: 2px;
}

loading-screen [data-content="progress"]::-moz-progress-bar {
	background: #fff;
	border-radius: 2px;
}

@keyframes entry-gate-shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-7px); }
	50% { transform: translateX(6px); }
	75% { transform: translateX(-4px); }
}

@media (max-height: 620px) {
	.entry-gate__panel {
		padding-top: 12px;
		padding-bottom: 10px;
	}
	.entry-gate__title {
		margin-top: 0;
		font-size: 20px;
	}
	.entry-gate__divider {
		margin-bottom: 8px;
	}
	.entry-gate__slots {
		margin-bottom: 10px;
		padding-top: 8px;
		padding-bottom: 8px;
	}
	.entry-gate__keypad {
		gap: 7px;
	}
	.entry-gate__key {
		height: 44px;
		font-size: 23px;
	}
}
