:root {
	color-scheme: dark;
	--ink: #e5dac2;
	--muted: #938c7c;
	--gold: #c1a567;
	--line: #514b3d;
	--panel: #211f1b;
	--bg: #100f0d;
	font-family: "Malgun Gothic", "맑은 고딕", sans-serif;
	font-size: 13px;
}
* {
	box-sizing: border-box;
}
body {
	margin: 0;
	background: radial-gradient(
		ellipse at 50% 20%,
		#302c22 0,
		#171611 45%,
		#100f0d 100%
	);
	color: var(--ink);
	min-width: 320px;
}
button,
input {
	font: inherit;
}
button,
a,
input {
	outline-offset: 3px;
}
button {
	color: inherit;
	border: 1px solid var(--line);
	background: linear-gradient(#39362e, #25231e);
	border-radius: 2px;
	cursor: pointer;
}
button:hover {
	border-color: var(--gold);
	color: #fff0cb;
}
button:disabled {
	cursor: wait;
	opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
canvas:focus-visible {
	outline: 2px solid #d4bd7e;
}
a {
	color: inherit;
	text-decoration: none;
}
button[aria-pressed="true"] {
	background: #53482f;
	border-color: #b29b60;
	color: #f2ddb0;
}
[hidden] {
	display: none !important;
}
.topbar {
	height: 68px;
	max-width: 1320px;
	padding: 0 26px;
	margin: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid #5b513440;
}
.portal-link {
	font-size: 12px;
	letter-spacing: 0.03em;
	color: var(--muted);
}
.brand {
	display: flex;
	gap: 10px;
	align-items: center;
}
.sigil {
	font-size: 26px;
	color: var(--gold);
}
h1 {
	font:
		700 24px Georgia,
		"Malgun Gothic",
		serif;
	letter-spacing: 0.08em;
	margin: 0;
}
.edition {
	font:
		8px ui-monospace,
		monospace;
	letter-spacing: 0.16em;
	color: #8c8063;
	margin-left: 8px;
}
.connection {
	display: flex;
	gap: 7px;
	align-items: center;
	font-size: 11px;
	color: var(--muted);
}
.connection i {
	height: 6px;
	width: 6px;
	border-radius: 50%;
	background: #857a61;
}
.connection i.connected {
	background: #83a867;
	box-shadow: 0 0 8px #8eba6155;
}
.connection button {
	height: 25px;
	width: 25px;
	margin-left: 10px;
}
.game-shell {
	max-width: 1220px;
	margin: 22px auto 0;
	border: 1px solid #74654b;
	box-shadow:
		0 16px 65px #0008,
		0 0 0 4px #1b1914,
		0 0 0 5px #3b3529;
}
.viewport {
	position: relative;
	background: #141c17;
	aspect-ratio: 960 / 540;
	overflow: hidden;
	border-bottom: 2px solid #62533b;
}
#world {
	display: block;
	width: 100%;
	height: 100%;
	touch-action: none;
	image-rendering: pixelated;
}
.location {
	position: absolute;
	left: 20px;
	top: 18px;
	display: flex;
	gap: 11px;
	align-items: center;
	text-shadow: 0 2px 3px #000;
	background: linear-gradient(90deg, #11150edb, transparent);
	padding: 8px 32px 8px 10px;
	pointer-events: none;
}
.location-marker {
	color: #cfb478;
	font-size: 13px;
}
.location strong {
	font-size: 15px;
	letter-spacing: 0.08em;
}
.location small {
	display: block;
	color: #c0b89e;
	font-size: 10px;
	margin-top: 5px;
}
.world-meta {
	position: absolute;
	top: 18px;
	right: 18px;
	display: flex;
	gap: 6px;
	align-items: center;
	font-size: 10px;
	text-shadow: 0 1px 2px #000;
}
.world-meta > span {
	padding: 5px 7px;
	background: #12180cbb;
	color: #c3d5ac;
}
.world-meta button {
	font-size: 10px;
	padding: 5px 7px;
	background: #1a1d13d9;
}
#minimap {
	position: absolute;
	right: 18px;
	top: 52px;
	width: 140px;
	height: 100px;
	background: #131810d9;
	border: 1px solid #a18b5659;
	opacity: 0.92;
	image-rendering: pixelated;
	pointer-events: none;
}
.toast {
	position: absolute;
	left: 50%;
	top: 26%;
	transform: translateX(-50%);
	max-width: 85%;
	padding: 13px 22px;
	border: 1px solid #9b8551;
	background: #1b1b12ee;
	color: #edd9a5;
	text-align: center;
	box-shadow: 0 4px 20px #0007;
	pointer-events: none;
	z-index: 6;
}
.entry-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(#080d08a6, #0b0d0bcf);
	backdrop-filter: blur(2px);
	z-index: 10;
	overflow: auto;
	padding: 20px;
}
.entry-card {
	width: 380px;
	padding: 25px 34px;
	background: linear-gradient(145deg, #2d2a22f7, #171711fa);
	border: 1px solid #9e8752;
	box-shadow:
		0 0 0 4px #1f1c14bb,
		0 18px 80px #000b;
	text-align: center;
}
.entry-crest {
	font-size: 38px;
	color: #c8ac70;
	line-height: 1;
}
.eyebrow {
	font:
		9px ui-monospace,
		monospace;
	color: #bba472;
	letter-spacing: 0.23em;
	margin: 12px 0;
}
.entry-card h2 {
	font:
		700 28px Georgia,
		"Malgun Gothic",
		serif;
	letter-spacing: 0.04em;
	margin: 10px 0;
}
.entry-description {
	font-size: 11px;
	color: #a69d87;
	margin: 12px 0 22px;
}
.entry-tabs {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	margin-bottom: 17px;
	gap: 3px;
}
.entry-tabs button {
	padding: 8px 0;
	font-size: 10px;
}
.entry-card label {
	text-align: left;
	display: block;
	font-size: 11px;
	color: #bfb398;
	margin-top: 11px;
}
.entry-card input {
	width: 100%;
	padding: 11px;
	background: #12130e;
	border: 1px solid #5b543f;
	border-radius: 1px;
	color: #eadbb7;
	margin-top: 7px;
}
.primary-button {
	display: flex;
	justify-content: space-between;
	width: 100%;
	margin-top: 19px;
	background: linear-gradient(#9b824a, #756039);
	border-color: #c0a269;
	padding: 12px;
	color: #f9eac9;
	font-weight: 700;
}
.entry-note {
	font-size: 10px;
	line-height: 1.6;
	color: #8e8775;
	margin: 14px 0 0;
}
.entry-error {
	color: #f0a38e;
	line-height: 1.5;
	font-size: 11px;
}
.development-note {
	text-align: left;
	font-size: 10px;
	color: #9f9682;
	margin-top: 13px;
	line-height: 1.7;
}
.development-note summary {
	cursor: pointer;
}
.development-note p {
	margin-bottom: 0;
}
.hud {
	padding: 12px 17px;
	display: flex;
	align-items: center;
	gap: 18px;
	background: linear-gradient(#343027, #24221c);
	border-top: 1px solid #88704d;
	border-bottom: 1px solid #564d38;
	min-height: 83px;
}
.character {
	display: flex;
	gap: 11px;
	align-items: center;
	min-width: 160px;
}
.portrait {
	width: 47px;
	height: 51px;
	display: grid;
	place-items: center;
	border: 1px solid #928061;
	background: radial-gradient(#665f47, #25271e);
	font-size: 32px;
	color: #c2bc95;
	overflow: hidden;
}
.character strong {
	font-size: 13px;
	max-width: 130px;
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.character small {
	display: flex;
	gap: 9px;
	margin-top: 7px;
	font-size: 10px;
	color: #a39b84;
}
.character b {
	color: #d7be7d;
}
.vitals {
	width: 240px;
}
.vital {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 5px 0;
}
.vital label {
	width: 20px;
	font: 9px ui-monospace;
	color: #afa38a;
}
.meter {
	height: 14px;
	background: #11130e;
	width: 100%;
	border: 1px solid #62523b;
	position: relative;
}
.meter > span {
	display: block;
	height: 100%;
	width: 0;
	transition: width 0.2s;
	background: linear-gradient(#b9483c, #772822);
}
.mp .meter > span {
	background: linear-gradient(#4c83a2, #2c516d);
}
.meter output {
	position: absolute;
	inset: 0;
	text-align: center;
	font: 9px / 12px ui-monospace;
	color: #f4e8d4;
	text-shadow: 0 1px #000;
}
.xp {
	height: 3px;
	background: #13150e;
	margin-left: 27px;
}
.xp span {
	display: block;
	background: #afa361;
	height: 100%;
	width: 0;
}
.quickbar {
	display: flex;
	gap: 5px;
	margin-left: auto;
}
.quickbar button {
	width: 64px;
	height: 54px;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	font-size: 10px;
	gap: 2px;
}
.quickbar button > span {
	font-size: 22px;
	line-height: 24px;
	color: #d0bc8c;
}
.quickbar kbd {
	position: absolute;
	left: 4px;
	top: 3px;
	font: 7px ui-monospace;
	color: #9c9584;
}
.gold {
	border-left: 1px solid #5a503c;
	min-width: 93px;
	padding-left: 18px;
	text-align: right;
}
.gold small {
	font-size: 9px;
	color: #a49c86;
}
.gold strong {
	display: block;
	margin-top: 6px;
	color: #dcc384;
	font:
		16px Georgia,
		serif;
}
.gold strong span {
	font-size: 11px;
}
.bottom-panel {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 338px;
	background: #1d1c17;
	height: 218px;
}
.chat-panel {
	min-width: 0;
	border-right: 1px solid #514733;
	display: flex;
	flex-direction: column;
}
.chat-header {
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 10px 14px;
	border-bottom: 1px solid #3c382b;
	font-size: 10px;
}
.chat-header strong {
	color: #c8b78b;
}
.chat-header span {
	color: #7d7c69;
	font-size: 9px;
}
.chat-header button {
	margin-left: auto;
	border: 0;
	background: none;
	color: #8d8674;
	font-size: 9px;
}
.chat-log {
	flex: 1;
	overflow: auto;
	list-style: none;
	padding: 8px 14px;
	margin: 0;
	scrollbar-width: thin;
	scrollbar-color: #61573f #1d1c17;
}
.chat-log li {
	font-size: 11px;
	line-height: 1.85;
	overflow-wrap: anywhere;
	color: #c1bea9;
}
.chat-log .chat-name {
	color: #bbbd9a;
	margin-right: 9px;
}
.chat-log .system {
	color: #a8976e;
}
.chat-log .own .chat-name {
	color: #d7bc75;
}
.chat-log time {
	font-size: 9px;
	color: #747362;
	margin-right: 8px;
}
.chat-input {
	display: flex;
	gap: 8px;
	align-items: center;
	border-top: 1px solid #3e3a2c;
	padding: 7px 10px;
}
.chat-input label {
	font-size: 9px;
	background: #423c2d;
	padding: 4px 7px;
	color: #baa57b;
}
.chat-input input {
	min-width: 0;
	flex: 1;
	background: none;
	border: 0;
	color: #ddd0ae;
	outline-offset: 1px;
	font-size: 11px;
}
.chat-input button {
	font-size: 9px;
	padding: 5px 8px;
}
.sidebar {
	display: flex;
	flex-direction: column;
	min-height: 0;
}
.panel-tabs {
	display: flex;
	border-bottom: 1px solid #4b4331;
}
.panel-tabs button {
	flex: 1;
	font-size: 10px;
	padding: 9px 2px;
	border-radius: 0;
	border-width: 0 1px 0 0;
	background: #2a271f;
}
.panel-tabs button[aria-pressed="true"] {
	color: #d9be80;
	background: #3d3626;
	border-bottom: 1px solid #b79b60;
}
.panel-body {
	flex: 1;
	min-height: 0;
	overflow: auto;
	padding: 11px;
	font-size: 10px;
	scrollbar-width: thin;
}
.inventory-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 4px;
}
.item-slot {
	aspect-ratio: 1;
	background: #151711;
	border: 1px solid #4b4431;
	position: relative;
	display: grid;
	place-items: center;
	font-size: 21px;
}
.item-slot span {
	font-size: 9px;
	position: absolute;
	right: 4px;
	bottom: 2px;
	color: #d8c68e;
}
.item-slot img {
	max-width: 80%;
	max-height: 80%;
	image-rendering: pixelated;
}
.item-caption {
	margin: 8px 0 0;
	color: #8d8875;
	font-size: 9px;
}
.stats-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px 20px;
}
.stat-row {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	color: #aaa28b;
}
.stat-row strong {
	color: #decda2;
}
.region-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 3px 0;
	padding: 6px;
	background: #27271d;
}
.region-row button {
	padding: 4px 7px;
	font-size: 9px;
}
.journal-row {
	margin: 0 0 8px;
	line-height: 1.6;
	color: #b8ae93;
}
.leave-button {
	padding: 9px 12px;
	text-align: left;
	font-size: 9px;
	color: #9e9680;
	background: #24231b;
	border: 0;
	border-top: 1px solid #4e4532;
}
.leave-button span {
	float: right;
}
footer {
	max-width: 1220px;
	margin: 14px auto 22px;
	display: flex;
	justify-content: space-between;
	font-size: 9px;
	letter-spacing: 0.03em;
	color: #7b7665;
}
.touch-pad,
.touch-attack {
	display: none;
}
dialog {
	background: #26241c;
	color: var(--ink);
	border: 1px solid #b39c64;
	max-width: 420px;
	padding: 28px;
	font-size: 12px;
	box-shadow: 0 0 80px #000;
}
dialog::backdrop {
	background: #050704b8;
}
dialog h2 {
	font-size: 20px;
}
dialog dl {
	display: grid;
	grid-template-columns: 90px 1fr;
	gap: 14px 6px;
	font-size: 11px;
	line-height: 1.6;
}
dialog dt {
	color: #ccb273;
}
dialog dd {
	margin: 0;
	color: #b8af98;
}
dialog > p:last-child {
	font-size: 10px;
	line-height: 1.8;
	color: #958e7b;
}
.dialog-close {
	position: absolute;
	right: 10px;
	top: 8px;
	background: none;
	border: 0;
	font-size: 20px;
}
@media (min-width: 1500px) {
	.game-shell {
		margin-top: 35px;
	}
	.viewport {
		aspect-ratio: 960 / 550;
	}
}
@media (max-width: 1250px) {
	.game-shell {
		margin: 15px 18px 0;
	}
	footer {
		margin: 13px 18px 20px;
	}
	.hud {
		gap: 12px;
	}
	.vitals {
		width: 220px;
	}
	.edition {
		display: none;
	}
}
@media (max-width: 850px) {
	.topbar {
		height: 52px;
		padding: 0 16px;
	}
	h1 {
		font-size: 18px;
	}
	.sigil {
		font-size: 21px;
	}
	.portal-link span {
		font-size: 10px;
	}
	.connection {
		font-size: 10px;
	}
	.game-shell {
		margin: 12px 10px 0;
	}
	.hud {
		gap: 10px;
		padding: 8px;
	}
	.character {
		min-width: 125px;
		gap: 7px;
	}
	.portrait {
		width: 36px;
		height: 43px;
		font-size: 26px;
	}
	.character strong {
		font-size: 11px;
		max-width: 85px;
	}
	.vitals {
		width: 180px;
	}
	.quickbar button {
		width: 44px;
		height: 46px;
		font-size: 9px;
	}
	.quickbar button > span {
		font-size: 19px;
	}
	.gold {
		min-width: 70px;
		padding-left: 8px;
	}
	.bottom-panel {
		grid-template-columns: minmax(0, 1fr) 275px;
		height: 210px;
	}
	.location {
		left: 10px;
		top: 10px;
		padding: 6px;
	}
	.location strong {
		font-size: 12px;
	}
	.location small {
		font-size: 8px;
	}
	.world-meta {
		top: 10px;
		right: 10px;
	}
	#minimap {
		right: 10px;
		top: 44px;
		width: 110px;
		height: 80px;
	}
	footer {
		font-size: 8px;
		margin: 12px 10px;
	}
}
@media (max-width: 600px) {
	.topbar {
		padding: 0 10px;
		height: 49px;
	}
	.brand {
		gap: 6px;
	}
	h1 {
		font-size: 16px;
		letter-spacing: 0;
	}
	.sigil {
		font-size: 20px;
	}
	.portal-link {
		font-size: 15px;
	}
	.portal-link span {
		display: none;
	}
	.connection button {
		margin-left: 1px;
		width: 23px;
		height: 23px;
	}
	.connection {
		gap: 5px;
		font-size: 9px;
	}
	.game-shell {
		margin: 8px 5px 0;
		box-shadow: 0 0 0 2px #292418;
	}
	.viewport {
		aspect-ratio: auto;
		height: 54dvh;
		min-height: 320px;
		max-height: 530px;
	}
	.location small {
		display: none;
	}
	.world-meta {
		gap: 3px;
	}
	.world-meta button {
		font-size: 8px;
		padding: 5px;
	}
	.world-meta #qualityButton {
		display: none;
	}
	#minimap {
		width: 85px;
		height: 64px;
	}
	.hud {
		display: grid;
		grid-template-columns: 115px 1fr;
		gap: 4px 10px;
		padding: 9px;
	}
	.character {
		min-width: 0;
		grid-column: 1;
	}
	.character small {
		font-size: 8px;
		gap: 5px;
		margin-top: 4px;
	}
	.vitals {
		width: auto;
		grid-column: 2;
	}
	.meter {
		height: 13px;
	}
	.quickbar {
		grid-column: 1 / 3;
		justify-content: center;
		width: 100%;
		margin-top: 6px;
		gap: 6px;
	}
	.quickbar button {
		width: 23%;
		height: 43px;
		flex-direction: row;
		gap: 7px;
	}
	.quickbar kbd {
		display: none;
	}
	.gold {
		position: absolute;
		right: 17px;
		margin-top: 94px;
		font-size: 10px;
		display: none;
	}
	.bottom-panel {
		display: flex;
		flex-direction: column;
		height: auto;
	}
	.chat-panel {
		height: 188px;
		border-right: 0;
	}
	.chat-header span {
		font-size: 8px;
	}
	.chat-log li {
		font-size: 10px;
	}
	.chat-input input {
		font-size: 12px;
	}
	.sidebar {
		border-top: 1px solid #514733;
	}
	.panel-body {
		height: 115px;
		flex: none;
	}
	.panel-tabs button {
		font-size: 11px;
		padding: 10px;
	}
	.inventory-grid {
		grid-template-columns: repeat(8, 1fr);
	}
	.item-slot {
		max-height: 43px;
	}
	.leave-button {
		font-size: 10px;
		padding: 11px;
	}
	.entry-overlay {
		padding: 14px;
	}
	.entry-card {
		max-width: 345px;
		width: 100%;
		padding: 19px 24px;
	}
	.entry-crest {
		font-size: 29px;
	}
	.entry-card h2 {
		font-size: 25px;
	}
	.entry-description {
		margin-bottom: 14px;
	}
	.entry-note {
		font-size: 9px;
	}
	.development-note {
		font-size: 9px;
	}
	.entry-tabs button {
		font-size: 10px;
	}
	.touch-pad {
		display: grid;
		position: absolute;
		left: 14px;
		bottom: 16px;
		grid-template-columns: 40px 40px 40px;
		grid-template-rows: 40px 40px;
		gap: 3px;
		touch-action: none;
		opacity: 0.75;
	}
	.touch-pad button {
		background: #22281bd4;
		border-color: #9b956470;
		font-size: 17px;
		touch-action: none;
	}
	.touch-pad .up {
		grid-column: 2;
	}
	.touch-pad .left {
		grid-row: 2;
		grid-column: 1;
	}
	.touch-pad .down {
		grid-row: 2;
		grid-column: 2;
	}
	.touch-pad .right {
		grid-row: 2;
		grid-column: 3;
	}
	.touch-attack {
		display: block;
		position: absolute;
		bottom: 22px;
		right: 20px;
		width: 63px;
		height: 63px;
		border-radius: 50%;
		background: #604b2cba;
		border: 2px solid #c6ae6b7a;
		touch-action: none;
		font-size: 11px;
		color: #e2c98d;
	}
	footer {
		font-size: 8px;
		gap: 15px;
		line-height: 1.6;
	}
	dialog {
		margin: 20px;
		max-width: calc(100% - 40px);
	}
}
@media (max-height: 650px) and (min-width: 601px) {
	.topbar {
		height: 45px;
	}
	.game-shell {
		margin-top: 9px;
		max-width: 1000px;
	}
	.viewport {
		aspect-ratio: 960 / 420;
	}
	.bottom-panel {
		height: 175px;
	}
	.hud {
		min-height: 65px;
		padding: 7px 12px;
	}
	.entry-card {
		padding: 13px 24px;
	}
	.entry-crest {
		display: none;
	}
	.entry-card h2 {
		font-size: 22px;
	}
	.entry-description {
		margin: 8px 0 12px;
	}
	.entry-note {
		margin-top: 8px;
	}
	.development-note {
		margin-top: 7px;
	}
}
.entry-overlay {
	background:
		linear-gradient(#050703a8, #070905e6),
		url("./assets/original/ui/nlogon.png") center / cover no-repeat;
}
.panel-body select {
	max-width: 100%;
	padding: 6px;
	background: #171b12;
	color: #d4c299;
	border: 1px solid #665b3d;
	margin: 7px 4px 7px 0;
}
.panel-body > button {
	padding: 5px;
	margin: 3px;
}
.game-shell:fullscreen {
	width: 100%;
	max-width: 100%;
	overflow: auto;
	background: #15170f;
}
.game-shell:fullscreen .viewport {
	height: 70vh;
	aspect-ratio: auto;
}
.world-meta details {
	background: #12180cdd;
	position: relative;
	color: #c3d5ac;
	z-index: 3;
}
.world-meta summary {
	padding: 5px 7px;
	cursor: pointer;
	list-style: none;
}
.world-meta details ul {
	position: absolute;
	right: 0;
	top: 22px;
	min-width: 180px;
	padding: 9px 12px;
	margin: 0;
	list-style: none;
	background: #171d12f5;
	border: 1px solid #7c704e;
	line-height: 1.9;
	white-space: nowrap;
}
.world-meta details li {
	font-size: 10px;
}
.world-meta details li + li {
	border-top: 1px solid #4b4a3555;
}
.legacy-actions {
	display: none;
}
.game-shell {
	position: relative;
}
@media (min-width: 601px) {
	.classic .bottom-panel {
		height: auto;
		aspect-ratio: 640 / 120;
		position: relative;
		display: block;
		background:
			#27251d url("./assets/original/ui/primary-tfrmbottom-00.png") center /
			100% 100% no-repeat;
		image-rendering: pixelated;
	}
	.classic .chat-panel {
		position: absolute;
		left: 22.4%;
		right: 22%;
		top: 10%;
		bottom: 22%;
		border: 0;
		background: #000;
	}
	.classic .chat-header {
		display: none;
	}
	.classic .chat-log {
		padding: 3px 6px;
	}
	.classic .chat-log li {
		font-size: 11px;
		line-height: 1.55;
	}
	.classic .chat-input {
		padding: 3px;
		gap: 4px;
		background: #080a07;
	}
	.classic .chat-input label {
		padding: 2px;
		font-size: 8px;
	}
	.classic .chat-input button {
		font-size: 8px;
		padding: 3px;
	}
	.classic .chat-input input {
		font-size: 10px;
	}
	.classic .hud {
		position: absolute;
		bottom: 0;
		right: 0;
		width: 22%;
		height: auto;
		aspect-ratio: 140 / 120;
		border: 0;
		background: none;
		padding: 10px 15px;
		display: flex;
		flex-direction: column;
		align-items: stretch;
		justify-content: center;
		z-index: 2;
	}
	.classic .portrait,
	.classic .quickbar,
	.classic .gold {
		display: none;
	}
	.classic .character {
		min-width: 0;
		justify-content: center;
		text-align: center;
	}
	.classic .character strong {
		max-width: none;
		font-size: 11px;
	}
	.classic .character small {
		justify-content: center;
		font-size: 9px;
	}
	.classic .vitals {
		width: 100%;
		margin-top: 9px;
	}
	.classic .vital label {
		font-size: 8px;
	}
	.classic .meter {
		height: 12px;
	}
	.classic .meter output {
		font-size: 8px;
		line-height: 10px;
	}
	.classic .sidebar {
		display: none;
		position: absolute;
		right: 0;
		bottom: calc(100% + 3px);
		width: 280px;
		height: 228px;
		background: #20241bef;
		border: 1px solid #9a8452;
		z-index: 7;
	}
	.classic .sidebar.legacy-open {
		display: flex;
	}
	.classic .legacy-actions {
		position: absolute;
		left: 2.5%;
		width: 18%;
		top: 41%;
		height: 50%;
		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-template-rows: repeat(3, 1fr);
		gap: 0;
	}
	.legacy-actions button {
		background: transparent;
		border: 0;
	}
	.legacy-actions button:hover {
		background: #e0d1a329;
		outline: 1px solid #baa06b;
	}
}
@media (max-width: 600px) {
	#classicButton {
		display: none;
	}
}

/* Source pixels keep integer scale; responsive controls remain readable over original panels. */
.viewport {
	aspect-ratio: 640 / 360;
}
.world-meta {
	flex-wrap: wrap;
	max-width: 72%;
	justify-content: flex-end;
}
.zoom-control {
	display: flex;
	align-items: center;
	gap: 3px;
	font-size: 10px;
	background: #10160ce8;
	padding: 2px 4px;
}
.zoom-control select {
	background: #202619;
	color: #e3d4b3;
	border: 1px solid #60563c;
	max-width: 58px;
}
.entry-card select {
	width: 100%;
	background: #12170e;
	border: 1px solid #625a40;
	color: #ddceab;
	padding: 8px;
}
.panel-tabs {
	display: flex;
	flex-wrap: wrap;
	flex-shrink: 0;
}
.panel-tabs button {
	flex: 1 0 18%;
	font-size: 12px;
	padding: 7px 5px;
	white-space: nowrap;
}
.panel-body h3 {
	margin: 0 0 10px;
	color: #ecd5a3;
}
.panel-body p {
	overflow-wrap: anywhere;
}
.original-icon {
	display: inline-block;
	position: relative;
	overflow: hidden;
	flex-shrink: 0;
	vertical-align: middle;
	image-rendering: pixelated;
}
.original-icon img {
	position: absolute;
	max-width: none !important;
	max-height: none !important;
	width: auto !important;
	height: auto !important;
	transform-origin: top left;
	image-rendering: pixelated;
	pointer-events: none;
}
.item-slot.selected,
.spell-row .selected {
	outline: 2px solid #dbc277;
	outline-offset: -2px;
}
.item-slot > .original-icon {
	margin: auto;
}
.item-detail {
	padding: 10px;
	border: 1px solid #796642;
	margin-top: 10px;
	background: #11160dd9;
}
.item-detail p {
	margin: 7px 0;
	font-size: 12px;
}
.item-detail button {
	margin-right: 6px;
	padding: 6px;
}
.native-inventory-board {
	position: relative;
	width: 280px;
	height: 720px;
	margin: 0 auto;
	background:
		url("./assets/original/ui/primary-tfrmitem-00.png") top left / 280px 720px
		no-repeat;
	image-rendering: pixelated;
}
.native-item-grid {
	position: absolute;
	left: 20px;
	top: 54px;
	display: grid;
	grid-template-columns: repeat(4, 54px);
	grid-auto-rows: 54px;
	gap: 7px 4px;
	width: auto;
	padding: 0;
	border: 0;
	background: none;
}
.native-item-grid .item-slot {
	width: 54px;
	height: 54px;
	min-height: 0;
	padding: 0;
	background: transparent;
	border: 0;
}
.native-item-grid .item-slot span:not(.original-icon) {
	font-size: 12px;
	bottom: 0;
	right: 1px;
}
.native-item-grid .item-slot:disabled {
	opacity: 1;
}
.equipment-slot {
	position: absolute;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	background: #0006;
	display: grid;
	place-items: center;
}
.equipment-slot:hover {
	outline: 1px solid #c8ac73;
}
.spell-list {
	display: grid;
	gap: 7px;
	background: #14140de6;
	padding: 8px;
	border: 1px solid #746341;
}
.spell-row {
	display: flex;
	gap: 4px;
	align-items: center;
}
.spell-row > button:first-child {
	display: flex;
	gap: 8px;
	align-items: center;
	flex: 1;
	text-align: left;
	padding: 5px;
}
.spell-row small,
.shop-stock small {
	display: block;
	color: #a9ab8c;
	font-size: 11px;
	margin-top: 4px;
}
.spell-row > button:last-child {
	padding: 8px;
}
.shop-stock {
	display: grid;
	gap: 4px;
	margin: 9px 0;
}
.shop-stock button {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px;
	text-align: left;
}
.bank-form {
	padding: 8px;
	border: 1px solid #675939;
	margin: 8px 0;
}
.bank-form button {
	margin: 6px 4px 0 0;
}
.dialogue-text,
.source-dialogue p,
.board-text {
	white-space: pre-wrap;
	line-height: 1.7;
}
.source-dialogue {
	border-top: 1px solid #675939;
	padding-top: 8px;
	margin-top: 10px;
	font-size: 13px;
}
.panel-section {
	display: grid;
	gap: 9px;
	padding: 2px;
}
.panel-section input,
.panel-section textarea,
.panel-section select {
	width: 100%;
	min-width: 0;
	background: #12170f;
	border: 1px solid #665a3c;
	color: #e5d8b6;
	padding: 7px;
	margin: 3px 0;
}
.panel-section textarea {
	min-height: 100px;
	resize: vertical;
}
.panel-section button {
	padding: 6px;
}
.panel-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 7px;
}
.panel-list li {
	border-bottom: 1px solid #514c3280;
	padding: 5px 0;
	display: flex;
	gap: 5px;
	flex-wrap: wrap;
	align-items: center;
}
.panel-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}
.trade-offers {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.trade-offers > div {
	border: 1px solid #685b3b;
	padding: 6px;
}
.trade-items {
	display: grid;
	gap: 5px;
	max-height: 240px;
	overflow: auto;
}
.trade-item {
	display: flex;
	gap: 5px;
	align-items: center;
	font-size: 12px;
}
.trade-item input[type="number"] {
	width: 58px;
	flex-shrink: 0;
	margin-left: auto;
}
.trade-item input[type="checkbox"] {
	width: auto;
}
.chat-log li,
.chat-input input {
	font-family: "Last Kingdom Native", "Malgun Gothic", sans-serif;
	font-size: 16px;
	line-height: 1.3;
}
.panel-body[data-panel="magic"] {
	background:
		linear-gradient(#10140ddd, #10140ddd),
		url("./assets/original/ui/nmagic.png") top center / 504px 360px repeat-y;
}
.panel-body[data-panel="trade"] {
	background:
		linear-gradient(#10140de8, #10140de8),
		url("./assets/original/supplement/ui/supplement-exchange.png") center /
		464px 264px no-repeat;
}
.panel-body[data-panel="board"] {
	background:
		linear-gradient(#10140de8, #10140de8),
		url("./assets/original/supplement/ui/supplement-notice.png") center / 320px
		201px no-repeat;
}
@media (min-width: 601px) {
	.classic .sidebar {
		width: 380px;
		height: min(480px, 64vh);
	}
	.classic .chat-log li,
	.classic .chat-input input {
		font-size: 16px;
		line-height: 1.25;
	}
	.classic .chat-log time {
		font-family: system-ui;
		font-size: 10px;
	}
	.classic .chat-input button {
		font-size: 11px;
	}
	.classic .character strong {
		font-size: 14px;
	}
	.classic .character small {
		font-size: 11px;
	}
}
@media (max-width: 600px) {
	.world-meta {
		max-width: 86%;
		gap: 3px;
	}
	.world-meta button,
	.world-meta select {
		font-size: 10px;
		padding: 4px;
	}
	.zoom-control {
		font-size: 0;
	}
	.location {
		max-width: 65%;
		top: 52px;
	}
	.panel-tabs button {
		flex-basis: 18%;
	}
	.panel-body {
		min-height: 240px;
	}
	.trade-offers {
		grid-template-columns: 1fr;
	}
	.entry-card {
		max-height: calc(100dvh - 90px);
		overflow: auto;
	}
	.native-inventory-board {
		margin: 0 auto;
	}
	.viewport {
		min-height: 360px;
	}
}

.nearby-npcs {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin: 10px 0;
}
.nearby-npcs button {
	padding: 6px;
	font-size: 12px;
}

.item-slot .original-icon {
	position: relative;
	inset: auto;
}
.native-item-grid .item-slot {
	max-height: none;
}
@media (max-width: 600px) {
	.viewport {
		width: 100%;
		min-width: 0;
		aspect-ratio: auto;
	}
	.game-shell {
		width: calc(100% - 10px);
		min-width: 0;
	}
	.world-meta {
		max-width: calc(100% - 20px);
	}
	.sidebar,
	.bottom-panel,
	.chat-panel {
		min-width: 0;
		max-width: 100%;
	}
}

.target-button {
	display: block;
	width: 100%;
	padding: 7px !important;
	text-align: left;
}

/* Web close control and viewport bounds keep source menus usable in a fitted 640x480 frame. */
.panel-close {
	display: none;
	position: absolute;
	right: 2px;
	top: 2px;
	z-index: 2;
	width: 28px;
	height: 28px;
	padding: 0;
	font-size: 22px;
}
.touch-pad .up-left {
	grid-column: 1;
	grid-row: 1;
}
.touch-pad .up-right {
	grid-column: 3;
	grid-row: 1;
}
.touch-pad .down-left {
	grid-column: 1;
	grid-row: 3;
}
.touch-pad .down-right {
	grid-column: 3;
	grid-row: 3;
}
@media (min-width: 951px) {
	.classic .sidebar {
		height: calc(var(--classic-fit-width, 640px) * 0.5625 - 6px);
		max-height: calc(100dvh - 150px);
	}
	.classic .panel-close {
		display: block;
	}
	.classic .panel-tabs {
		padding-right: 30px;
	}
}
@media (max-width: 950px) {
	.sidebar .panel-close {
		display: block;
		min-width: 44px;
		min-height: 44px;
	}
	.sidebar .panel-tabs {
		padding-right: 48px;
	}
}
