/* The mod's own two screens, drawn at the size they are laid out in and scaled to the page.
   Every number here is a number from the Kotlin: the panel is 560 x 480 design units, the rows
   26 tall with a 3 gap, the switch 30 x 14, the Manage Auctions panel 178 x 132 of 18 unit slots.
   Scaling the whole thing rather than writing a second, larger copy is what keeps the page and
   the game the same screen. */

.mui-stage {
	position: relative;
	display: flex;
	justify-content: center;
}

/* The box the 560 wide panel is scaled into: its size is set by ui.js once it knows the room. */
.mui-fit {
	position: relative;
	flex: none;
}

.mui {
	--panel: #131315;
	--headline: #2a2a2e;
	--sidebar: #1a1a1d;
	--row: #1e1e22;
	--row-hover: #26262b;
	--row-off: #18181b;
	--border: #303036;
	--text: #ededef;
	--icon: #d6d6dc;
	--muted: #9a9aa3;
	--dimmed: #6e6e77;
	--plus: #e8c15a;
	--green: #3fcf6b;
	--green-dark: #14351f;
	--red: #d93a5a;
	--track: #0d0d0f;
	position: absolute;
	left: 0;
	top: 0;
	width: 560px;
	height: 480px;
	transform-origin: top left;
	background: var(--panel);
	border-radius: 8px;
	/* The border is drawn inside the 560 x 480 box, as the mod draws its own outline: a real
	   border would push every measurement below out by a pixel on each side. */
	box-shadow: inset 0 0 0 1px var(--border), 0 26px 50px rgba(0, 0, 0, .55);
	color: var(--text);
	font: 500 9px/9px "Chivo", system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
	user-select: none;
	overflow: hidden;
}

.mui button,
.mui input {
	font: inherit;
	color: inherit;
}

/* ---------- header: wordmark, version, tier, close ---------- */

.mui-head {
	position: absolute;
	left: 14px;
	right: 14px;
	top: 0;
	height: 37px;
	display: flex;
	align-items: center;
	gap: 6px;
	border-bottom: 1px solid var(--headline);
}

/* The wordmark in the tier's gold, with the + the account's name carries when it is Meow+. */
.mui-mark {
	font-weight: 700;
	font-size: 14px;
	line-height: 16px;
	letter-spacing: -.01em;
	color: var(--plus);
}

.mui-ver {
	font-size: 8px;
	color: var(--dimmed);
	align-self: flex-end;
	margin-bottom: 6px;
}

.mui-close {
	position: absolute;
	right: 0;
	top: 11px;
	width: 16px;
	height: 16px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 3px;
	background: var(--row);
	color: var(--text);
	cursor: pointer;
	font-size: 10px;
	line-height: 1;
	padding: 0;
}
.mui-close:hover { background: var(--red); color: #fff; }

/* ---------- the search field across the panel ---------- */

.mui-search {
	position: absolute;
	left: 8px;
	right: 8px;
	top: 42px;
	height: 18px;
	display: flex;
	align-items: center;
	background: var(--track);
	border: 1px solid var(--border);
	border-radius: 3px;
}
.mui-search:focus-within { border-color: var(--green); }

.mui-search input {
	flex: 1;
	min-width: 0;
	height: 16px;
	padding: 0 6px;
	background: none;
	border: 0;
	outline: none;
	color: var(--text);
	font-size: 9px;
}
.mui-search input::placeholder { color: var(--dimmed); }

.mui-count {
	flex: none;
	padding-right: 6px;
	font-size: 8px;
	color: var(--muted);
}

/* ---------- the sidebar ---------- */

.mui-side {
	position: absolute;
	left: 8px;
	top: 64px;
	width: 132px;
	height: 408px;
	padding-top: 6px;
	background: var(--sidebar);
	border-radius: 5px;
	overflow: hidden;
}

.mui-tab {
	position: relative;
	display: flex;
	align-items: center;
	width: 124px;
	height: 22px;
	margin: 0 0 1px 4px;
	padding: 0 10px;
	border: 0;
	border-radius: 4px;
	background: none;
	color: var(--muted);
	text-align: left;
	cursor: pointer;
}
.mui-tab:hover { background: var(--row-hover); color: var(--text); }
.mui-tab[aria-current="true"] { background: var(--row); color: var(--text); }
.mui-tab[aria-current="true"]::before {
	content: "";
	position: absolute;
	left: 0;
	top: 4px;
	width: 2px;
	height: 14px;
	background: var(--green);
	border-radius: 1px;
}

/* ---------- the page ---------- */

.mui-body {
	position: absolute;
	left: 148px;
	top: 64px;
	width: 404px;
	height: 408px;
}

.mui-crumb {
	position: absolute;
	left: 0;
	top: 3px;
	margin: 0;
	font-size: 8px;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 320px;
}

.mui-back {
	position: absolute;
	right: 0;
	top: 1px;
	height: 14px;
	padding: 0 8px;
	background: var(--row);
	border: 1px solid var(--border);
	border-radius: 3px;
	color: var(--muted);
	font-size: 8px;
	letter-spacing: .05em;
	cursor: pointer;
}
.mui-back:hover { background: var(--row-hover); border-color: var(--green); color: var(--text); }

.mui-list {
	position: absolute;
	left: 0;
	top: 20px;
	width: 404px;
	height: 388px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: #4a4a52 transparent;
}
.mui-list::-webkit-scrollbar { width: 4px; }
.mui-list::-webkit-scrollbar-thumb { background: #4a4a52; border-radius: 2px; }

/* ---------- a page's boxes: one module each ---------- */

/* Three to a row, each as wide as its column and as tall as it is wide, so the boxes stay
   square however wide the page ends up. */
.mui-tiles {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 6px;
	padding-bottom: 2px;
}

.mui-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1;
	padding: 8px;
	background: var(--row);
	border: 1px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	text-align: center;
}
.mui-tile:hover { background: var(--row-hover); border-color: var(--green); }
.mui-tile.is-off { background: var(--row-off); }

.mui-tile img {
	width: 32px;
	height: 32px;
	display: block;
	flex: none;
}
/* The dot a module with no picture of its own carries, drawn the same way the game draws it. */
.mui-dot {
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	flex: none;
}
.mui-dot span {
	width: 22px;
	height: 22px;
	background: var(--muted);
}
.mui-dot span::after {
	content: "";
	display: block;
	width: 14px;
	height: 14px;
	margin: 4px;
	background: var(--row);
}

.mui-tile-name {
	display: block;
	width: 100%;
	margin-top: 6px;
	font-size: 9px;
	line-height: 10px;
	color: var(--text);
	overflow-wrap: break-word;
}

.mui-tile-state {
	display: block;
	margin-top: 3px;
	font-size: 8px;
	letter-spacing: .06em;
	color: var(--green);
}
.mui-tile-state.is-off { color: var(--dimmed); }
.mui-tile-state.is-plus { color: var(--plus); }

/* ---------- a module's settings ---------- */

.mui-rows { display: flex; flex-direction: column; gap: 3px; }

.mui-hd {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 6px 0 0;
	font-size: 8px;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--muted);
}
.mui-hd::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--border);
}
.mui-hd-plus { color: var(--plus); letter-spacing: .06em; }
.mui-hd:first-child { margin-top: 0; }

.mui-row {
	display: flex;
	align-items: center;
	gap: 6px;
	width: 100%;
	height: 26px;
	padding: 0 8px 0 10px;
	background: var(--row);
	border: 1px solid transparent;
	border-radius: 4px;
	color: var(--text);
	text-align: left;
	cursor: pointer;
}
.mui-row:hover { background: var(--row-hover); border-color: var(--border); }
.mui-row.is-off { background: var(--row-off); color: var(--dimmed); }
.mui-row.is-static { cursor: default; }
.mui-row.is-static:hover { background: var(--row); border-color: transparent; }

.mui-name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.mui-lock { flex: none; font-size: 8px; color: var(--plus); }

.mui-pill {
	position: relative;
	flex: none;
	width: 30px;
	height: 14px;
	border-radius: 7px;
	background: #3a3a41;
	transition: background .12s ease;
}
.mui-pill::after {
	content: "";
	position: absolute;
	top: 1px;
	left: 1px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #f4f4f6;
	transition: transform .12s ease;
}
.mui-row[aria-checked="true"] .mui-pill { background: var(--green); }
.mui-row[aria-checked="true"] .mui-pill::after { transform: translateX(16px); }

/* The slider is the game's own: a near-black track, the filled part green, a white handle. */
.mui-slider {
	flex: none;
	display: flex;
	align-items: center;
	width: 132px;
}

.mui-slider input {
	-webkit-appearance: none;
	appearance: none;
	flex: 1;
	min-width: 0;
	height: 18px;
	margin: 0;
	background: none;
	cursor: pointer;
}
.mui-slider input::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 3px;
	background: linear-gradient(to right, var(--green) 0 var(--fill, 0%), var(--track) var(--fill, 0%) 100%);
}
.mui-slider input::-moz-range-track {
	height: 6px;
	border-radius: 3px;
	background: var(--track);
}
.mui-slider input::-moz-range-progress {
	height: 6px;
	border-radius: 3px;
	background: var(--green);
}
.mui-slider input::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 4px;
	height: 18px;
	margin-top: -6px;
	border: 0;
	border-radius: 2px;
	background: #f4f4f6;
}
.mui-slider input::-moz-range-thumb {
	width: 4px;
	height: 18px;
	border: 0;
	border-radius: 2px;
	background: #f4f4f6;
}
.mui-slider input:focus-visible { outline: none; }
.mui-slider input:focus-visible::-webkit-slider-thumb { outline: 1px solid var(--green); }

.mui-val {
	flex: none;
	min-width: 14px;
	margin-left: 8px;
	text-align: right;
	color: var(--text);
	font-variant-numeric: tabular-nums;
}

/* A choice row, drawn as the game draws one: the value in a dark box with the list behind it. */
.mui-select {
	flex: none;
	width: 110px;
	height: 18px;
	padding: 0 4px;
	background: var(--track);
	border: 1px solid var(--border);
	border-radius: 3px;
	color: var(--text);
	font: inherit;
	outline: none;
	cursor: pointer;
}
.mui-select:hover { border-color: var(--muted); }
.mui-select:focus { border-color: var(--green); }
.mui-select option { background: #141417; color: var(--text); }

.mui-field {
	flex: none;
	width: 132px;
	height: 18px;
	padding: 0 5px;
	background: var(--track);
	border: 1px solid var(--border);
	border-radius: 3px;
	color: var(--muted);
	outline: none;
}
.mui-field:focus { border-color: var(--green); color: var(--text); }

.mui-color { display: flex; align-items: center; gap: 4px; width: 132px; }
.mui-swatch {
	flex: none;
	width: 18px;
	height: 18px;
	border: 1px solid var(--border);
	border-radius: 3px;
}
.mui-color .mui-field { flex: 1; width: auto; min-width: 0; }

.mui-btn {
	flex: none;
	height: 18px;
	min-width: 62px;
	padding: 0 8px;
	background: var(--green-dark);
	border: 0;
	border-radius: 3px;
	color: var(--green);
	cursor: pointer;
}
.mui-btn:hover { background: var(--green); color: #07130a; }

/* The hover, drawn as the menu draws it: a dark box under the cursor with the row's name and
   the line that says what the setting does. */
.mui-tip {
	position: absolute;
	z-index: 6;
	max-width: 210px;
	padding: 5px 7px;
	background: #0f0f12;
	border: 1px solid #4b2f77;
	border-radius: 3px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, .55);
	color: var(--text);
	font-size: 8px;
	line-height: 11px;
	pointer-events: none;
}
.mui-tip p { margin: 0; }
.mui-tip p + p { margin-top: 3px; color: var(--muted); }

.mui-search-hint {
	margin: 0 0 4px;
	font-size: 8px;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--muted);
}

.mui-empty {
	margin: 8px 2px;
	font-size: 9px;
	color: var(--muted);
}

.mui-hit-path {
	flex: none;
	max-width: 40%;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: 8px;
	color: var(--muted);
}
