:root {
	color-scheme: dark;
	font-family: "Segoe UI", sans-serif;
	background: #12151b;
	color: #e8e4d9;
}

html, body {
	margin: 0;
	min-height: 100%;
}

body > header {
	padding: 0.6rem 1rem;
	border-bottom: 1px solid #2c3340;
}

body > aside {
	position: absolute;
	left: 0;
	top: 56px;
	width: 250px;
	bottom: 0;
	overflow: auto;
	padding: 0.75rem;
	box-sizing: border-box;
	background: #1a1e26;
	border-right: 1px solid #2c3340;
}

#changelog-wrap {
	position: absolute;
	right: 0;
	top: 56px;
	width: 280px;
	bottom: 0;
	overflow: auto;
	padding: 0.75rem;
	box-sizing: border-box;
	background: #1a1e26;
	border-left: 1px solid #2c3340;
}

.nav, .palette {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin: 0.75rem 0;
}

button, input {
	font: inherit;
	background: #101216;
	color: inherit;
	border: 1px solid #3a4250;
	padding: 0.3rem 0.5rem;
}

button { cursor: pointer; }
button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}
#apply-status.ok { color: #b8d4a0; }
.error { color: #f0a0a0; }
.hint { color: #9aa3b2; font-size: 0.85rem; }
.open-toggle { display: flex; gap: 0.4rem; align-items: center; }
article { margin-bottom: 0.75rem; }
fieldset { border-color: #3a4250; margin-top: 1rem; }
#selection-border {
	position: fixed;
	pointer-events: none;
	box-sizing: border-box;
	border: 2px solid #e23d3d;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
	z-index: 4;
}

label { display: block; margin: 0.4rem 0; }

#settings-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.62);
	z-index: 19;
}

#settings-modal {
	position: fixed;
	inset: 4vh 4vw;
	z-index: 20;
	display: flex;
	background: #161a22;
	border: 1px solid #3a4250;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#settings-modal[hidden],
#settings-backdrop[hidden] {
	display: none !important;
}

#settings-main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

#settings-main header,
#settings-main footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #2c3340;
}

#settings-main footer {
	border-bottom: 0;
	border-top: 1px solid #2c3340;
}

#settings-form {
	flex: 1;
	overflow: auto;
	padding: 0;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.settings-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	padding: 0.65rem 1rem 0.5rem;
	border-bottom: 1px solid #2c3340;
	background: #12151c;
}

.settings-tab {
	appearance: none;
	border: 1px solid transparent;
	background: transparent;
	color: #a8a295;
	padding: 0.35rem 0.7rem;
	border-radius: 4px;
	cursor: pointer;
	font: inherit;
}

.settings-tab:hover {
	color: #e8e2d4;
	background: #1c222c;
}

.settings-tab.active {
	color: #1a1510;
	background: #d4c48a;
	border-color: #d4c48a;
}

.settings-panels {
	flex: 1;
	overflow: auto;
	padding: 0.75rem 1rem 1.25rem;
}

.settings-category {
	margin-bottom: 0;
}

.settings-category h3 {
	margin: 0 0 0.5rem;
	font-size: 0.95rem;
	color: #d4c48a;
	border-bottom: 1px solid #2c3340;
	padding-bottom: 0.25rem;
}

.setting-row {
	display: grid;
	grid-template-columns: minmax(12rem, 1fr) minmax(8rem, 14rem) 4rem;
	gap: 0.4rem 0.75rem;
	align-items: center;
	padding: 0.45rem 0.5rem;
	margin: 0.2rem 0;
	border-radius: 4px;
}

.setting-row .hint {
	grid-column: 1 / -1;
	margin: 0;
}

.setting-row.dirty {
	background: #4a3d18;
	box-shadow: inset 0 0 0 1px #c4a35a;
}

.setting-value {
	font-variant-numeric: tabular-nums;
	color: #c5c0b4;
}

.seed-price-panel {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	min-height: 0;
}

.seed-price-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem 0.75rem;
	align-items: center;
}

.seed-price-search {
	flex: 1 1 12rem;
	min-width: 10rem;
	padding: 0.4rem 0.55rem;
	background: #10141b;
	border: 1px solid #3a4250;
	color: #e8e4d9;
	font: inherit;
}

.seed-price-meta {
	flex: 0 0 auto;
}

.seed-price-pager {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin-left: auto;
}

.seed-price-pager button {
	appearance: none;
	border: 1px solid #3a4250;
	background: #1c222c;
	color: #e8e4d9;
	padding: 0.3rem 0.55rem;
	cursor: pointer;
	font: inherit;
}

.seed-price-pager button:disabled {
	opacity: 0.4;
	cursor: default;
}

.seed-price-header,
.seed-price-row {
	display: grid;
	grid-template-columns: minmax(10rem, 1.6fr) 6.5rem 5.5rem 5.5rem;
	gap: 0.5rem 0.65rem;
	align-items: center;
}

.seed-price-header {
	padding: 0.25rem 0.4rem;
	color: #a8a295;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border-bottom: 1px solid #2c3340;
}

.seed-price-list {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.seed-price-row {
	padding: 0.4rem;
	border-radius: 4px;
}

.seed-price-row.dirty {
	background: #4a3d18;
	box-shadow: inset 0 0 0 1px #c4a35a;
}

.seed-price-name {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.seed-price-name strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.seed-price-name small {
	color: #8b8790;
	font-size: 0.75rem;
}

.seed-price-seed {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	font-size: 0.75rem;
	color: #a8a295;
}

.seed-price-seed input {
	width: 100%;
	padding: 0.3rem 0.4rem;
	background: #10141b;
	border: 1px solid #3a4250;
	color: #e8e4d9;
	font: inherit;
}

.seed-price-readonly {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	font-size: 0.75rem;
	color: #a8a295;
}

.seed-price-readonly strong {
	font-size: 0.95rem;
	color: #e8e4d9;
	font-variant-numeric: tabular-nums;
}

.seed-price-readonly strong.muted {
	color: #6d6875;
}

#settings-log-wrap {
	width: min(340px, 32vw);
	flex-shrink: 0;
	border-left: 1px solid #2c3340;
	display: flex;
	flex-direction: column;
	background: #1a1e26;
}

#settings-log-wrap h2 {
	margin: 0;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #2c3340;
	font-size: 1rem;
}

#settings-log {
	flex: 1;
	overflow: auto;
	padding: 0.75rem 1rem;
}

#palette-backdrop,
#tile-config-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.62);
	z-index: 19;
}

#palette-modal,
#tile-config-modal {
	position: fixed;
	z-index: 20;
	display: flex;
	flex-direction: column;
	background: #161a22;
	border: 1px solid #3a4250;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#palette-modal {
	inset: 8vh 12vw;
}

#tile-config-modal {
	top: 10vh;
	left: 50%;
	transform: translateX(-50%);
	width: min(440px, 92vw);
	max-height: 80vh;
}

#palette-modal[hidden],
#palette-backdrop[hidden],
#tile-config-modal[hidden],
#tile-config-backdrop[hidden],
#tile-tooltip[hidden] {
	display: none !important;
}

#palette-modal > header,
#tile-config-modal > header,
#tile-config-modal > footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #2c3340;
}

#tile-config-modal > footer {
	border-bottom: 0;
	border-top: 1px solid #2c3340;
}

#palette-panels {
	flex: 1;
	overflow: auto;
	padding: 0.75rem 1rem 1.25rem;
}

.palette-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
	gap: 0.6rem;
}

.palette-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	padding: 0.55rem 0.4rem;
	min-height: 6.5rem;
}

.palette-thumb {
	width: 48px;
	height: 48px;
	display: grid;
	place-items: center;
	background: #0d1016;
	border: 1px solid #2c3340;
	image-rendering: pixelated;
	font-weight: 600;
	color: #9aa3b2;
}

.palette-thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	image-rendering: pixelated;
}

#tile-config-form {
	padding: 0.75rem 1rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	flex: 1;
	min-height: 0;
	overflow: auto;
}

.spawner-sells-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-top: 0.55rem;
}

.spawner-sells-list {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.spawner-sells-row {
	display: grid;
	grid-template-columns: 1fr 4.5rem auto;
	gap: 0.4rem;
	align-items: center;
}

.spawner-sells-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.spawner-equip-list {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.spawner-equip-row {
	display: grid;
	grid-template-columns: 4.5rem 1fr auto auto;
	gap: 0.4rem;
	align-items: center;
}

.spawner-equip-slot {
	text-transform: capitalize;
	color: #9aa3b2;
	font-size: 0.85rem;
}

.spawner-equip-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.spawner-buys-row {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: 0.45rem;
}

#shop-item-search-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 21;
}

#shop-item-search-modal {
	position: fixed;
	z-index: 22;
	top: 18vh;
	left: 50%;
	transform: translateX(-50%);
	width: min(380px, 90vw);
	max-height: 60vh;
	display: flex;
	flex-direction: column;
	background: #161a22;
	border: 1px solid #3a4250;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#shop-item-search-modal[hidden],
#shop-item-search-backdrop[hidden] {
	display: none !important;
}

#shop-item-search-modal > header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #2c3340;
}

#shop-item-search-modal > .shop-item-search-body {
	padding: 0.75rem 1rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	min-height: 0;
	overflow: hidden;
}

#shop-item-search-results {
	overflow: auto;
	max-height: 40vh;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.shop-item-search-row {
	text-align: left;
	padding: 0.4rem 0.5rem;
}

#tile-tooltip {
	position: fixed;
	z-index: 15;
	pointer-events: none;
	max-width: 16rem;
	padding: 0.4rem 0.55rem;
	background: rgba(12, 14, 18, 0.92);
	border: 1px solid #3a4250;
	color: #e8e4d9;
	font-size: 0.8rem;
	white-space: pre-wrap;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

