/* Lineage II interface (js/ui): xdat controls drawn with the exported client textures.
   Fidelity to the native client wins: Tahoma 11px, native colors, textures for every chrome piece. */

.ui-root {
	position: absolute;
	inset: 0;
	z-index: 5;
	overflow: hidden;
	pointer-events: none;
	font: 11px/14px Tahoma, Verdana, 'Segoe UI', Arial, sans-serif;
	color: #dcdcdc;
	user-select: none;
	-webkit-user-select: none;
	-webkit-font-smoothing: none;
	font-smooth: never;
	text-rendering: optimizeSpeed;
}

.ui-root [hidden] { display: none !important; }

.ui-ctrl {
	position: absolute;
	box-sizing: border-box;
	background-repeat: no-repeat;
}

.ui-window { pointer-events: auto; }
/* ShortcutWnd is a viewport-sized grouping window, not a world-input shield. */
.ui-window[data-name='ShortcutWnd'] { pointer-events: none; }
.ui-window[data-name='ShortcutWnd'] > .ui-Window { pointer-events: auto; }
.ui-ScrollArea { overflow: auto; }
.ui-ctrl:focus-visible, .ui-slot:focus-visible, .ui-tab:focus-visible { outline: 1px solid #b09b79; outline-offset: -1px; }
.ui-root .ui-line::selection, .ui-root input::selection { color: #fff; background: #645537; }
.ui-noinput { pointer-events: none !important; }
.ui-noinput > .ui-ctrl:not(.ui-noinput, .ui-Texture) { pointer-events: auto; }
.ui-ctrl.is-disabled { filter: grayscale(0.6) brightness(0.7); }

.ui-back,
.ui-slice,
.ui-fill {
	position: absolute;
	inset: 0;
	background-repeat: no-repeat;
	pointer-events: none;
}

/* ---------------------------------------------------------------- frame (framed windows: title bar) */
.ui-frame-head {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 36px;
	cursor: default;
}
.ui-frame-head .ui-slice { background-size: 32px 64px; }
.ui-frame-title {
	position: absolute;
	left: 40px;
	right: 40px;
	top: 0;
	height: 34px;
	line-height: 34px;
	text-align: center;
	font-size: 12px;
	color: #d8cfbd;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ui-frame-close {
	position: absolute;
	top: 0;
	right: 2px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background-color: transparent;
	background-repeat: no-repeat;
	cursor: pointer;
}
.ui-frame-close:focus-visible { outline: 1px solid #b09b79; }

/* ---------------------------------------------------------------- text */
.ui-TextBox,
.ui-NameCtrl { white-space: pre; overflow: visible; }
.ui-TextBox.is-wrap { white-space: pre-wrap; overflow: hidden; word-break: break-word; }
/* Native label controls are passive, including their wrapper above button artwork. */
.ui-TextBox, .ui-text { pointer-events: none; }

/* ---------------------------------------------------------------- buttons, tabs, checkboxes */
.ui-Button {
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	overflow: hidden;
	background-size: 100% 100%;
}
.ui-button-label {
	pointer-events: none;
	min-width: 0;
	color: #e8e3d6;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding: 0 4px;
}
.ui-Button.is-disabled { cursor: default; }

.ui-tab {
	position: absolute;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	overflow: hidden;
	color: #a8a39a;
	background-size: 100% 100%;
}
.ui-tab.is-active { color: #f0e8d0; }
.ui-tab.is-disabled { color: #5d5a55; cursor: default; }
.ui-tab-label { min-width: 0; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ui-CheckBox,
.ui-RadioButton {
	display: flex;
	align-items: center;
	gap: 4px;
	cursor: pointer;
	white-space: nowrap;
}
.ui-check-box { flex: none; width: 13px; height: 13px; background-size: 100% 100%; }
.ui-CheckBox.is-left { flex-direction: row-reverse; justify-content: flex-end; }

/* ---------------------------------------------------------------- gauges */
.ui-gauge-fore { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background-repeat: no-repeat; background-size: 100% 100%; }
.ui-StatusBar .ui-fill,
.ui-BarCtrl .ui-fill,
.ui-Progress .ui-fill { background-size: 100% 100%; }
.ui-gauge-text { position: absolute; inset: 0; text-align: center; line-height: inherit; color: #fff; pointer-events: none; }
.ui-InvenWeight { background: #1b1915; border: 1px solid #3a352d; }
.ui-weight-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#4c8b32, #2e5a1c); }
.ui-InvenWeight[data-level='2'] .ui-weight-fill { background: linear-gradient(#b8a23a, #7a6a1a); }
.ui-InvenWeight[data-level='3'] .ui-weight-fill { background: linear-gradient(#b8403a, #7a1f1a); }

/* ---------------------------------------------------------------- edit boxes */
.ui-edit-input,
.ui-combo-select {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 0 4px;
	border: 1px solid #4a443a;
	background: rgba(0, 0, 0, 0.55);
	color: #e8e3d6;
	font: inherit;
	outline: none;
	user-select: text;
	-webkit-user-select: text;
}
.ui-edit-input:focus { border-color: #8a7a5a; }
.ui-multiedit { resize: none; padding: 2px 4px; }
.ui-combo-select { cursor: pointer; }

/* Native slider bounds must contain the input, including its hit area. The browser's default
   range width otherwise spills out of the 32px radar slider and across the zoom controls. */
.ui-slider {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	border: 0;
	appearance: none;
	background-color: transparent;
	background-repeat: no-repeat;
	cursor: pointer;
}
.ui-slider:focus-visible { outline: 1px solid #b09b79; outline-offset: -1px; }
.ui-slider::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.ui-slider::-webkit-slider-thumb {
	appearance: none;
	width: var(--ui-slider-thumb-w);
	height: var(--ui-slider-thumb-h);
	border: 0;
	border-radius: 0;
	background: var(--ui-slider-thumb) no-repeat;
}
.ui-slider:active::-webkit-slider-thumb { background-image: var(--ui-slider-thumb-down); }
.ui-slider::-moz-range-track { height: 100%; background: transparent; }
.ui-slider::-moz-range-thumb {
	width: var(--ui-slider-thumb-w);
	height: var(--ui-slider-thumb-h);
	border: 0;
	border-radius: 0;
	background: var(--ui-slider-thumb) no-repeat;
}
.ui-slider:active::-moz-range-thumb { background-image: var(--ui-slider-thumb-down); }

/* ---------------------------------------------------------------- scrolling content (native scroll bar textures) */
.ui-scroll {
	position: absolute;
	inset: 0;
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-gutter: auto;
}
.ui-scroll.is-noscroll { overflow-y: hidden; }
.ui-root ::-webkit-scrollbar { width: 12px; }
.ui-root ::-webkit-scrollbar-track { background: url('../assets/ui/tex/l2ui_ch3/scrollbar/scrollbarback.png') repeat-y center / 12px 8px; }
.ui-root ::-webkit-scrollbar-thumb {
	background:
		url('../assets/ui/tex/l2ui_ch3/scrollbar/sliderbartop.png') no-repeat top / 12px 6px,
		url('../assets/ui/tex/l2ui_ch3/scrollbar/sliderbarbottom.png') no-repeat bottom / 12px 6px,
		url('../assets/ui/tex/l2ui_ch3/scrollbar/sliderbarcenter.png') repeat-y center / 12px 8px;
	min-height: 20px;
}
.ui-root ::-webkit-scrollbar-button:single-button { display: block; width: 12px; height: 12px; background-size: 12px 12px; }
.ui-root ::-webkit-scrollbar-button:single-button:vertical:decrement { background-image: url('../assets/ui/tex/l2ui_ch3/scrollbar/scrollbarupbtn.png'); }
.ui-root ::-webkit-scrollbar-button:single-button:vertical:increment { background-image: url('../assets/ui/tex/l2ui_ch3/scrollbar/scrollbardownbtn.png'); }
.ui-root ::-webkit-scrollbar-button:single-button:vertical:decrement:hover { background-image: url('../assets/ui/tex/l2ui_ch3/scrollbar/scrollbarupbtn_over.png'); }
.ui-root ::-webkit-scrollbar-button:single-button:vertical:increment:hover { background-image: url('../assets/ui/tex/l2ui_ch3/scrollbar/scrollbardownbtn_over.png'); }

/* ---------------------------------------------------------------- lists, trees, logs */
.ui-textlist { padding: 0 2px; }
.ui-line { white-space: pre-wrap; word-break: break-word; padding-left: 10px; text-indent: -10px; user-select: text; -webkit-user-select: text; }
.ui-list-head { position: absolute; left: 0; right: 0; top: 0; height: 20px; display: flex; color: #b09b79; background: rgba(255, 255, 255, 0.04); }
.ui-list-col { flex: none; padding: 3px 4px 0; white-space: nowrap; overflow: hidden; }
.ui-list-body { top: 20px; }
.ui-list-head[hidden] + .ui-list-body { top: 0; }
.ui-list-row { display: flex; min-height: 18px; align-items: center; cursor: pointer; }
.ui-list-row:hover { background: rgba(255, 255, 255, 0.05); }
.ui-list-row.is-selected { background: rgba(176, 155, 121, 0.25); }
.ui-list-cell { flex: none; display: flex; align-items: center; gap: 3px; padding: 0 4px; white-space: nowrap; overflow: hidden; }
.ui-list-tex, .ui-tree-tex { display: inline-block; flex: none; background-size: 100% 100%; vertical-align: middle; }
.ui-tree-row { cursor: pointer; padding: 1px 2px; }
.ui-tree-kids { padding-left: 12px; }

/* ---------------------------------------------------------------- item slots */
.ui-itemgrid {
	display: grid;
	align-content: start;
	padding: 0;
	box-sizing: border-box;
}
.ui-itemgrid.is-noscroll { overflow: hidden; }
.ui-slot { position: relative; }
.ui-slot-bg, .ui-slot-icon, .ui-slot-outline { position: absolute; background-repeat: no-repeat; background-size: 100% 100%; pointer-events: none; }
.ui-slot-icon, .ui-slot-outline { inset: 0; }
.ui-slot-outline { inset: -1px; opacity: 0; }
.ui-slot:hover .ui-slot-outline { opacity: 1; }
.ui-slot.is-selected .ui-slot-outline { opacity: 1; filter: brightness(1.4); }
.ui-slot.is-drop .ui-slot-outline { opacity: 1; filter: hue-rotate(60deg) brightness(1.5); }
.ui-slot.is-disabled .ui-slot-icon { filter: grayscale(1) brightness(0.5); }
.ui-slot[draggable='true'] { cursor: pointer; }
.ui-slot-count {
	position: absolute;
	right: 1px;
	bottom: 0;
	font-size: 10px;
	line-height: 11px;
	color: #fff;
	text-shadow: 1px 0 #000, -1px 0 #000, 0 1px #000, 0 -1px #000;
	pointer-events: none;
}
.ui-slot-enchant { display: none; }
.ui-shortcut .ui-slot-outline { inset: 0; }

/* ---------------------------------------------------------------- buff icons */
.ui-status-icons { position: absolute; inset: 0; }
.ui-status-row { display: flex; gap: 1px; margin-bottom: 1px; }
.ui-status-icon { position: relative; flex: none; background-size: 100% 100%; pointer-events: auto; }

/* ---------------------------------------------------------------- tooltip */
.ui-tooltip {
	position: fixed;
	left: 0;
	top: 0;
	z-index: 1000;
	max-width: 280px;
	padding: 6px 8px;
	background: rgba(12, 11, 9, 0.92);
	border: 1px solid #5c5243;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8);
	color: #dcdcdc;
	pointer-events: none;
	white-space: pre-wrap;
}
.ui-tip-title { color: #f0e6cc; margin-bottom: 2px; }
.ui-tip-desc { color: #a9a49a; margin-top: 4px; }

/* ---------------------------------------------------------------- on-screen messages */
.ui-passive-overlay, .ui-passive-overlay * { pointer-events: none !important; }
.ui-screen-message .ui-TextBox { font-size: 20px; line-height: 30px; }
.ui-screen-message .ui-TextBox[data-name^='TextBoxsm'] { font-size: 12px; line-height: 18px; }

/* ---------------------------------------------------------------- L2 html (NPC dialogs) */
.ui-html {
	padding: 2px 4px 6px 2px;
	text-align: justify;
	line-height: 19px;
	color: #dcdcdc;
	user-select: text;
	-webkit-user-select: text;
	background-repeat: no-repeat;
}
.ui-html br.is-tight { line-height: 4px; }
.ui-html .h-center { text-align: center; }
.ui-html .h-p { margin: 0 0 6px; }
.ui-html .h-link { color: #b0c4de; text-decoration: none; cursor: pointer; }
.ui-html .h-link:hover { color: #e4d8b4; text-decoration: underline; }
.ui-html .h-link:focus-visible, .ui-html .h-button:focus-visible { outline: 1px solid #b09b79; }
.ui-html .h-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 60px;
	height: 22px;
	margin: 1px 0;
	padding: 0 6px;
	border: 1px solid #5c5243;
	background: linear-gradient(#3a342b, #1f1b16);
	background-repeat: no-repeat;
	background-size: 100% 100%;
	color: #e8e3d6;
	font: inherit;
	vertical-align: middle;
	cursor: pointer;
}
.ui-html .h-button.has-tex { border: 0; background-color: transparent; }
.ui-html .h-img { display: inline-block; vertical-align: middle; background-size: 100% 100%; }
.ui-html .h-table { border-collapse: separate; text-align: left; }
.ui-html .h-table.has-border td { border: 1px solid #444; }
.ui-html .h-table td { padding: 0; vertical-align: middle; }
.ui-html .h-edit, .ui-html .h-combo {
	height: 17px;
	box-sizing: border-box;
	border: 1px solid #4a443a;
	background: rgba(0, 0, 0, 0.55);
	color: #e8e3d6;
	font: inherit;
	vertical-align: middle;
	user-select: text;
}
.ui-html .h-multiedit { height: auto; resize: none; }
