
.settings-modal {
	position: fixed;
	inset: 0;
	z-index: 40;
	display: grid;
	place-items: center;
	padding: 24px;
	background: rgb(0 0 0 / 0.56);
}

.settings-modal.hidden {
	display: none;
}

.settings-dialog {
	width: min(820px, 100%);
	max-height: min(520px, calc(100vh - 48px));
	display: flex;
	flex-direction: column;
	border: 3px solid #5f4a32;
	border-bottom-color: #211914;
	border-right-color: #211914;
	background: rgb(10 10 14 / 0.97);
	box-shadow:
		0 0 0 2px #080808,
		8px 8px 0 rgb(0 0 0 / 0.62);
}

.settings-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border-bottom: 3px solid #211914;
}

.settings-header h2 {
	flex: 1;
	min-width: 0;
	margin: 0;
	color: #e9bd59;
	font-size: var(--ui-text-xl);
	text-shadow: 2px 2px 0 #0b0908;
}

.settings-body {
	display: grid;
	gap: 10px;
	padding: 12px;
	overflow: auto;
}
.settings-body label, .settings-body button {
	height: 60px;
}

.settings-range-option {
	width: 100%;
	min-height: 56px;
	display: grid;
	grid-template-columns: minmax(88px, 1fr) minmax(120px, 1.4fr) auto;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border: 3px solid #5f4a32;
	border-bottom-color: #211914;
	border-right-color: #211914;
	background: rgb(10 10 14 / 0.94);
	color: #cfc7b7;
	font-size: var(--ui-text-md);
}

.settings-range-option input {
	width: 100%;
	height: 24px;
	padding: 0;
	border: none;
	background:
		linear-gradient(#e9bd59 0 0) 0 50% / var(--range-progress, 28.571%) 8px no-repeat,
		linear-gradient(#211914 0 0) 0 50% / 100% 8px no-repeat;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	image-rendering: pixelated;
}

.settings-range-option input::-webkit-slider-runnable-track {
	height: 18px;
	background: transparent;
}

.settings-range-option input::-webkit-slider-thumb {
	width: 14px;
	height: 24px;
	margin-top: -3px;
	border: 3px solid #5f4a32;
	border-bottom-color: #211914;
	border-right-color: #211914;
	background: #e9bd59;
	box-shadow:
		0 0 0 2px #080808,
		2px 2px 0 rgb(0 0 0 / 0.62);
	appearance: none;
	-webkit-appearance: none;
}

.settings-range-option input::-moz-range-track {
	height: 8px;
	background: #211914;
}

.settings-range-option input::-moz-range-progress {
	height: 8px;
	background: #e9bd59;
}

.settings-range-option input::-moz-range-thumb {
	width: 14px;
	height: 24px;
	border: 3px solid #5f4a32;
	border-bottom-color: #211914;
	border-right-color: #211914;
	border-radius: 0;
	background: #e9bd59;
	box-shadow:
		0 0 0 2px #080808,
		2px 2px 0 rgb(0 0 0 / 0.62);
}

.settings-range-option input:focus-visible {
	outline: 2px solid #e9bd59;
	outline-offset: 4px;
}

.settings-range-option strong {
	min-width: 42px;
	color: #e9bd59;
	text-align: right;
}

.settings-toggle-option {
	width: 100%;
	min-height: 42px;
	display: grid;
	grid-template-columns: minmax(88px, 1fr) auto;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border: 3px solid #5f4a32;
	border-bottom-color: #211914;
	border-right-color: #211914;
	background: rgb(10 10 14 / 0.94);
	color: #cfc7b7;
	font-size: var(--ui-text-md);
	cursor: pointer;
}

.settings-toggle-option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.settings-toggle-track {
	position: relative;
	width: 44px;
	height: 22px;
	border: 3px solid #5f4a32;
	border-bottom-color: #211914;
	border-right-color: #211914;
	background: #211914;
	image-rendering: pixelated;
}

.settings-toggle-track::after {
	content: "";
	position: absolute;
	left: 2px;
	top: 2px;
	width: 12px;
	height: 12px;
	background: #cfc7b7;
	box-shadow: 2px 2px 0 rgb(0 0 0 / 0.62);
}

.settings-toggle-option input:checked + .settings-toggle-track {
	background: #4f3d18;
}

.settings-toggle-option input:checked + .settings-toggle-track::after {
	left: 24px;
	background: #e9bd59;
}

.settings-toggle-option:has(input:focus-visible) {
	outline: 2px solid #e9bd59;
	outline-offset: 4px;
}

.settings-action-option {
	width: 100%;
	min-height: 56px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 4px;
	padding: 8px 10px;
	border: 3px solid #5f4a32;
	border-right-color: #211914;
	border-bottom-color: #211914;
	background: rgb(10 10 14 / 0.94);
	color: #cfc7b7;
	cursor: pointer;
	font: inherit;
	text-align: left;
}

.settings-action-option strong {
	color: #e9bd59;
	font-size: var(--ui-text-md);
}

.settings-action-option span {
	font-size: var(--ui-text-sm);
}

.settings-action-option:hover,
.settings-action-option:focus-visible {
	background: rgb(79 61 24 / 0.65);
	outline: 2px solid #e9bd59;
	outline-offset: 2px;
}

.settings-help,
.action-hotkey-status {
	margin: 0;
	color: #cfc7b7;
	font-size: var(--ui-text-sm);
}

.action-hotkey-grid {
	display: grid;
	grid-template-columns: repeat(4, 52px);
	gap: 8px;
}

.settings-body .action-hotkey-grid button {
	display: grid;
	place-items: center;
	padding: 4px 4px 8px;
	border: 3px solid #5f4a32;
	border-right-color: #211914;
	border-bottom-color: #211914;
	background: rgb(10 10 14 / 0.94);
	color: #e9bd59;
	cursor: pointer;
	font: inherit;
}

.action-hotkey-grid button:focus-visible,
.action-hotkey-grid button.active {
	background: rgb(79 61 24 / 0.65);
	outline: 2px solid #e9bd59;
	outline-offset: 2px;
}

.action-hotkey-grid button span {
	color: #827665;
	font-size: var(--ui-text-xs);
}

.action-hotkey-status {
	min-height: 2em;
	margin-bottom: 8px;
	line-height: normal;
	overflow-wrap: anywhere;
	white-space: normal;
	color: #8fcf82;
}

.action-hotkey-status + .settings-action-option {
	margin-top: 0;
}

.action-hotkey-status.error {
	color: #e7826f;
}
