.MistMonsterScene {
	--scene-ink: #342717;
	--scene-line: #8d7544;
	--scene-gold: #e1b94f;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	overflow: hidden;
	border: 1px solid var(--scene-line);
	background: #e7e1c9;
	color: var(--scene-ink);
}

.MistMonsterScene *,
.MistMonsterScene *::before,
.MistMonsterScene *::after { box-sizing: border-box; }

.MistMonsterSceneToolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 9px;
	border-bottom: 1px solid #b7aa83;
}

.MistMonsterSceneIdentity {
	display: flex;
	align-items: center;
	min-width: 0;
	gap: 8px;
}

.MistMonsterSceneIdentity > img {
	width: 42px;
	height: 42px;
	object-fit: contain;
	image-rendering: pixelated;
}

.MistMonsterSceneIdentity span { display: grid; min-width: 0; }
.MistMonsterSceneIdentity strong { font-size: 12px; }
.MistMonsterSceneIdentity small { color: #655b46; font-size: 9px; }

.MistMonsterSceneActions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 5px;
}

.MistMonsterScene button {
	min-height: 29px;
	padding: 5px 8px;
	border: 1px solid #8b6b2c;
	border-radius: 2px;
	background: linear-gradient(#f4dfa0, #d0ae61);
	color: #37270e;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.MistMonsterScene button:hover:not(:disabled),
.MistMonsterScene button:focus-visible { background: #ffe9a9; outline: 2px solid #785914; outline-offset: 1px; }
.MistMonsterScene button:disabled { cursor: not-allowed; opacity: .45; }

.MistMonsterScene .MistMonsterSpawnRoute {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin: 0;
	padding: 8px 10px;
	border: 0;
	background: #f1e5c3;
	line-height: 1.4;
}

.MistMonsterScene .MistMonsterSpawnRoute strong { flex: 0 0 150px; color: #4b3520; font-size: 11px; }
.MistMonsterScene .MistMonsterSpawnRoute span { color: #4c3b2b; font-size: 10px; }

.MistMonsterSceneFloor {
	padding: 7px 10px;
	border-top: 1px solid #c7ba91;
	border-bottom: 1px solid #15130f;
	background: #49331f;
	color: #fff2c4;
	font-weight: 700;
}

.MistMonsterSceneViewport {
	position: relative;
	width: 100%;
	height: clamp(360px, 58vw, 560px);
	max-width: 100%;
	overflow: hidden;
	background: #10120f;
	touch-action: none;
}

.MistMonsterSceneViewport canvas {
	display: block;
	width: 100%;
	height: 100%;
	image-rendering: pixelated;
	cursor: grab;
}

.MistMonsterSceneViewport canvas:active { cursor: grabbing; }
.MistMonsterSceneViewport canvas:focus-visible { outline: 2px solid #ffe278; outline-offset: -3px; }

.MistMonsterSceneLoading {
	position: absolute;
	inset: 50% auto auto 50%;
	padding: 7px 10px;
	transform: translate(-50%, -50%);
	border: 1px solid #80672f;
	background: rgba(25, 21, 14, .94);
	color: #ffe7a0;
	font-weight: 700;
	pointer-events: none;
}

.MistMonsterSceneLoading[hidden] { display: none; }

.MistMonsterSceneNav {
	display: grid;
	grid-template-columns: repeat(4, minmax(42px, 58px));
	justify-content: center;
	gap: 5px;
	padding: 8px;
	border-top: 1px solid #9e906b;
}

.MistMonsterSceneHelp {
	max-width: 72ch;
	margin: 0 auto;
	padding: 0 10px 10px;
	color: #5b523e;
	font-size: 9px;
	line-height: 1.45;
	text-align: center;
}

.MistMonsterScene .MistMonsterSpawnPreview {
	position: absolute;
	display: flex;
	align-items: center;
	gap: 7px;
	z-index: 3;
	padding: 6px 7px;
	overflow: hidden;
	border: 1px solid #d7b866;
	border-radius: 3px;
	background: rgba(28, 18, 10, .95);
	color: #fff3ce;
	max-width: min(340px, calc(100% - 16px));
}

.MistMonsterScene .MistMonsterSpawnPreview[hidden] { display: none; }
.MistMonsterScene .MistMonsterSpawnPreview img { flex: 0 0 64px; width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; }
.MistMonsterScene .MistMonsterSpawnPreview span { display: flex; min-width: 0; flex: 1 1 auto; flex-direction: column; }
.MistMonsterScene .MistMonsterSpawnPreview strong,
.MistMonsterScene .MistMonsterSpawnPreview small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.MistMonsterScene .MistMonsterSpawnPreview small { color: #dbc99d; font-size: 9px; }
.MistMonsterScene .MistMonsterSpawnPreview a { display: inline-flex; min-height: 38px; flex: 0 0 auto; align-items: center; justify-content: center; padding: 7px 9px; border: 1px solid #fff0c3; border-radius: 2px; background: #f1d58f; color: #35220e; font-weight: 700; text-decoration: none; }
.MistMonsterScene .MistMonsterSpawnPreview a:hover { background: #fff0bd; }

@media (max-width: 620px) {
	.MistMonsterSceneToolbar { align-items: flex-start; flex-direction: column; }
	.MistMonsterSceneActions { justify-content: flex-start; width: 100%; }
	.MistMonsterSceneViewport { height: 390px; }
	.MistMonsterSceneActions button { flex: 1 1 auto; }
	.MistMonsterScene .MistMonsterSpawnRoute { align-items: stretch; flex-direction: column; gap: 3px; }
	.MistMonsterScene .MistMonsterSpawnRoute strong { flex-basis: auto; }
	.MistMonsterScene .MistMonsterSpawnPreview { align-items: stretch; flex-wrap: wrap; }
	.MistMonsterScene .MistMonsterSpawnPreview img { flex-basis: 56px; width: 56px; height: 56px; }
	.MistMonsterScene .MistMonsterSpawnPreview a { flex-basis: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
	.MistMonsterScene * { scroll-behavior: auto !important; transition: none !important; }
}
