html {
	--text-color: #aebad0;
}

body, html {
	margin: 0;
	padding: 0;
	height: 100%;
	overflow: hidden; /* Убираем прокрутку */
}

:where(button, input, select):enabled {
	cursor: pointer;
}

* {font-family: 'Roboto', sans-serif;}

.container {
	display: flex;
	flex-direction: column;
	height: 100vh; /* Полная высота экрана */
	background-color: #1b1d21;

	.top {
		display: grid;
		grid-template-columns: 300px 1fr;
		grid-template-rows: min-content auto;

		flex: 1; /* Занимает всё доступное пространство */
		background-color: #1b1d21;
		padding: 0;
		height: calc(100vh - 208px);
		container-type: size;
		color: var(--text-color);

		align-items: stretch;
		align-content: stretch;
		justify-content: stretch;

		div:first-child {
			grid-row: 1 / 3;
		}
	}

	.bottom {
		height: 204px;
		background-color: #161b22;
		padding: 0 1em 1em 0;
		border-top: 4px solid #0c0f17;

		menu {
			margin: 0;
			padding: 0;
			display: flex;
			flex-direction: row;

			button {
				border-radius: 0;
				border: none;
				cursor: pointer;
				background-color: #0b101c;
				font-size: 16px;
				font-weight: bold;
				color: #4f5a6a;
				min-height: 2em;
				min-width: 5em;
				padding: 2px 0.5em;

				&:hover {
					background-color: #08183d;
					color: #caddf9;
				}
			}
		}
	}
}

#editorLeft:not([hidden]) + #EActors {
			height: calc((9/16) * (100cqw - 300px));
		width: 100%;
		grid-column: 2/3;
}

#EActors {
	width: calc((16/9) * 100cqh);
	height: 100cqh;
	background-image: url("../img/background.jpg");
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;

	display: grid;
	grid-template-columns: repeat(5, minmax(20%, 1fr));
	grid-template-rows: repeat(10, 10%);
	justify-items: stretch;
	justify-content: stretch;
	overflow-x: hidden;
	grid-column: 1/3;

	&:has(~ #editorLeft) {
		height: calc((9/16) * (100cqw - 300px));
		width: 100%;
		grid-column: 2/3;
	}

	div.text-block {
		margin: 0.5em;
		border-radius: 0 0.5em 0.5em 0;;
		background-color: #a2444400;
		cursor: pointer;
		font-size: 14pt;
		
		z-index: 2;
		overflow: auto;
		border-left: 4px solid #ba4d0c;

		&:hover {
			border-left-color: green;
		}

		img {
			display: none;
		}

		div.txt {
			opacity: 0.25;
			text-align: justify;
			user-select: none;
			padding: 0.5em;
			min-height: calc(100% - 1em);
			width: calc(100% - 1em);

			&:hover {
				opacity: 0.85;
			}
		}
	}

	div.text-block.showAll {
		border: none;
	}

	div.text-block.showAll > div {
		opacity: 1;
		cursor: default;
		border-radius: 0.5em;
	}

	img {
		max-height: 100%;
		min-height: 10px;
		z-index: 5;
	}

	img.active {
		cursor: pointer;
	}
}

* {
  scrollbar-width: thin;
}

#EActors > img:where(.active:hover, .tmp-selected) {
	filter: brightness(175%);
}

.menu-wraper {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1000;
	backdrop-filter: blur(1.5px);
	display: flex;
	justify-content: center;
	align-items: center;
}

.menu-wraper > menu {
	padding: 1em;
	background-color: #343d60;
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	gap: 0.5em;
	border-radius: 10px;

	button {
		min-width: 8em;
		min-height: 2em;
		border-radius: 0;
		border: none;
		background-color: #bbc9ec;
		font-size: 16px;
		font-weight: bold;
		color: #232a39;
    	box-shadow: -3px -3px 5px 0px #4e5975 inset;

		&:hover {
			background-color: #8ed5ff;
		}

		&:focus {
			box-shadow: 0px 0px 1px 2px #6e92ec;
		}

		&:active {
			background-color: white;
		}
	}
}

.phraseList {
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	gap: 0.5em;
	color: #a5afbd;
	margin: 0.5em;
	align-items: start;

	button {
		border: none;
		background: transparent;
		font-size: 16px;
		color: #a5afbd;

		&:hover {
			color: #3f71b7;
		}
	}
}

#dwin {
	position: fixed;
	z-index: 999;
	margin: 0;
	border: none;
	background: transparent;
	border-radius: 5px;
	padding: 0.5em;
	
	div {
		display: flex;
		flex-direction: column;
		gap: 0.5em;
	}
}

:where(.npc-speech, #dwin) button {
	border: none;
	background: transparent;
	font-size: 16px;
	color: #a5afbd;

	&:hover {
		color: #3f71b7;
	}
}

aside {
	border-right: 4px solid #070d1a;
	box-shadow: 0 0 10px 0px #111928, -10px 0px 10px -5px #181b2f inset;
	container-type: size;
	z-index: 1;

	flex-grow: 1;
	height: max(calc(100cqh - ((9/16) * 100cqw)), 100cqh);
}

.comic-speech {
	position: relative;
	background: white;
	border: 3px solid black;
	border-radius: 10px;
	padding: 20px;
	max-width: 250px;
	font-size: 18px;
	margin-top: 30px;
	box-shadow: 0px 0px 10px 0px #ffffff6b;
	padding: 0.5em;
	cursor: pointer;
	z-index: 10;
}

.npc-speech.comic-speech {
	position: fixed;
	margin: 0;
	font-size: 16px;
	color: #a5afbd;
}

.comic-speech:before {
content: '';
	position: absolute;
	top: -21px;
	left: 12px;
	border-width: 0 25px 22px;
	border-left-width: 25px;
	border-style: solid;
	border-left-style: solid;
	border-color: transparent transparent white;
	border-left-color: transparent;
	display: block;
	width: 1px;
	border-left: 0px solid black;
}

summary {
	cursor: pointer;
}

#editorBotton > details[__key] {
	display: inline-flex;
	border: 1px solid var(--text-color);
	margin: 0 0.25em 0.25em 0;
}

#editorLeft textarea {
	width: 100%;
	box-sizing: border-box;
}

#EActors video {
	grid-column: 1 / 7;
	grid-row: 1 / 11;
}