/* ==========================================================================
   Reborn databaze - prvky z lib/ux.cgi (kompaktni seznamy, stitky, drop,
   vyskyt monster, prazdny vysledek). 2026-10-25.
   Soubor je v db2/html i dbc/html STEJNY. Barvy jen z promennych main.css
   (svetly i tmavy rezim), vlastni barvy elementu maji variantu pro tmavy rezim.
   ========================================================================== */

/* --- kompaktni seznam (vysledky hledani, monstra na mape) --- */
.ux-tab-obal {
	max-width: 1100px;
	margin: 8px auto 16px;
	/* posun do strany resi obal .posun ze skriptu v paticce (main.css) */
}
table.ux-seznam {
	width: 100%;
	border-collapse: collapse;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
.ux-seznam th, .ux-seznam td {
	padding: 4px 8px;
	border-bottom: 1px solid var(--border);
	text-align: left;
	vertical-align: middle;
}
.ux-seznam thead th {
	background: var(--head);
	font-weight: 600;
	white-space: nowrap;
}
.ux-seznam tbody tr:nth-child(even) td { background: var(--stripe); }
.ux-seznam tbody tr:hover td { background: var(--accent-soft); }
.ux-seznam .ux-cislo { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ux-seznam td.ux-ikona, .ux-seznam th.ux-ikona { width: 1%; padding: 2px 4px; text-align: center; }
.ux-seznam .ux-ikona img { display: block; margin: 0 auto; max-width: 48px; max-height: 40px; }
.ux-seznam a { font-weight: 600; }
.ux-seznam tr.ux-offline td { color: var(--muted); }
.ux-vedlejsi { color: var(--muted); font-weight: normal; font-size: .92em; }
.ux-pozn { color: var(--muted); font-size: .92em; text-align: center; margin: 6px auto; max-width: 1100px; }
.ux-nadpis { max-width: 1100px; margin: 20px auto 4px; font-size: 1.15em; }
.ux-pocet { max-width: 1100px; margin: 12px auto 4px; font-size: 1.1em; }

/* --- nadpis detailu monstra s klicovymi udaji --- */
.ux-hlava { max-width: 1100px; margin: 4px auto 10px; }
.ux-hlava h1 { margin: 0 0 4px; font-size: 1.5em; line-height: 1.25; }
.ux-fakta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin: 0; color: var(--muted); }
.ux-fakta b { color: var(--text); }

/* --- nadpis detailu predmetu s velkou ikonou --- */
.ux-hlava-predmet { display: flex; gap: 14px; align-items: center; }
.ux-hlava-predmet .ux-predmet-velky,
.ux-hlava-predmet .ux-predmet-maly {
	flex: none;
	padding: 4px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	image-rendering: auto;
}
.ux-hlava-predmet .ux-predmet-maly { width: 48px; height: 48px; image-rendering: pixelated; }
.ux-hlava-text { min-width: 0; }
.ux-hlava-en { margin: -2px 0 4px; }

/* --- stitky MVP / Boss --- */
.ux-stitek {
	display: inline-block;
	margin-left: 6px;
	padding: 0 6px;
	border-radius: 999px;
	font-size: .78em;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: .03em;
	vertical-align: 1px;
	color: #fff;
	background: #8a5a00;
}
.ux-stitek.ux-mvp { background: #b42323; }
.ux-stitek.ux-boss { background: #6b4fa0; }
.ux-stitek.ux-mimo { background: #556170; font-weight: 600; }

/* --- elementy (barevny stitek) --- */
.ux-el {
	display: inline-block;
	padding: 0 6px;
	border-radius: 4px;
	white-space: nowrap;
	background: var(--head);
}
.ux-el-water { background: #d8e9fb; color: #124a80; }
.ux-el-earth { background: #efe2cc; color: #5b3d0c; }
.ux-el-fire { background: #fbdcd6; color: #8a1e0c; }
.ux-el-wind { background: #dcf3dc; color: #1b5e20; }
.ux-el-poison { background: #ead9f2; color: #5b2072; }
.ux-el-holy { background: #fff3c4; color: #6b5200; }
.ux-el-shadow { background: #d9d9e3; color: #2a2a40; }
.ux-el-ghost { background: #e4e4f7; color: #3c3c7a; }
.ux-el-undead { background: #dfe6dc; color: #33452c; }
@media (prefers-color-scheme: dark) {
	.ux-el-water { background: #183552; color: #a9d2fa; }
	.ux-el-earth { background: #3d3020; color: #e8cfa3; }
	.ux-el-fire { background: #4a2018; color: #ffb4a4; }
	.ux-el-wind { background: #1d3a1f; color: #a7e3aa; }
	.ux-el-poison { background: #36203f; color: #e0b5f2; }
	.ux-el-holy { background: #3d3510; color: #ffe58a; }
	.ux-el-shadow { background: #2a2a38; color: #c8c8dc; }
	.ux-el-ghost { background: #2c2c48; color: #c9c9f5; }
	.ux-el-undead { background: #263022; color: #c4d6bc; }
}

/* --- drop (detail predmetu): seznam monster se sanci --- */
ul.ux-drop {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 2px 16px;
}
ul.ux-drop li { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; padding: 2px 0; border-bottom: 1px dotted var(--border); }
ul.ux-drop .ux-sance { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.ux-drop-nadpis { margin: 8px 0 2px; color: var(--muted); font-size: .92em; }

/* --- obchody (detail predmetu) --- */
ul.ux-obchody { list-style: none; margin: 0; padding: 0; columns: 2 260px; column-gap: 16px; }
ul.ux-obchody li { break-inside: avoid; padding: 1px 0; }
details.ux-vice > summary { cursor: pointer; color: var(--link); margin: 4px 0; }

/* --- vyskyt monstra na mapach (detail monstra) --- */
ul.ux-mapy {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 2px 16px;
}
ul.ux-mapy li { padding: 2px 0; border-bottom: 1px dotted var(--border); }
ul.ux-mapy li.curmap a { font-weight: 700; }
ul.ux-mapy .ux-vedlejsi { white-space: nowrap; }

/* --- mapy: rychle hledani, seznam map, sousedni mapy --- */
.ux-mapa-nav {
	max-width: 1100px;
	margin: 6px auto 12px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 8px;
	align-items: center;
	justify-content: center;
}
.ux-mapa-nav input[type=search] { width: 16em; max-width: 100%; }
.ux-mapa-odkazy { white-space: nowrap; }
.ux-mapy-skupiny { max-width: 1100px; margin: 0 auto; }
details.ux-mapy-skupina { border-bottom: 1px solid var(--border); padding: 2px 0; }
details.ux-mapy-skupina > summary { font-weight: 700; }
ul.ux-seznam-map { max-width: 1100px; margin: 4px auto 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ux-seznam td.ux-souradnice { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* --- prazdny vysledek s navrhy --- */
.ux-prazdno {
	max-width: 700px;
	margin: 16px auto;
	padding: 12px 16px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
.ux-prazdno p { margin: 6px 0; }
ul.ux-navrhy { margin: 4px 0 8px; padding-left: 20px; }
ul.ux-navrhy li { padding: 1px 0; }

/* --- mobil: mene dulezite sloupce schovat --- */
@media (max-width: 600px) {
	.ux-seznam .ux-m-skryt { display: none; }
	.ux-seznam th, .ux-seznam td { padding: 4px 5px; }
}

/* --- naseptavac hledani v hlavicce (html/naseptavac.js) --- */
.naseptavac-obal { position: relative; }
ul.naseptavac {
	position: absolute;
	top: 100%;
	right: 0;
	z-index: 1000;
	min-width: 100%;
	width: 26em;
	max-width: calc(100vw - 20px);
	max-height: 60vh;
	overflow-y: auto;
	margin: 4px 0 0;
	padding: 4px 0;
	list-style: none;
	background: var(--surface);
	color: var(--text);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	box-shadow: 0 6px 18px rgba(16, 24, 40, .22);
	text-align: left;
}
ul.naseptavac[hidden] { display: none; }
ul.naseptavac li a {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	padding: 6px 10px;
	color: var(--text);
	text-decoration: none;
}
ul.naseptavac li[aria-selected="true"] a,
ul.naseptavac li a:hover { background: var(--accent-soft); }
.naseptavac-typ { color: var(--muted); font-size: .85em; white-space: nowrap; }
@media (max-width: 600px) {
	ul.naseptavac { left: 0; right: 0; width: auto; }
}

/* --- filtry nad vysledky hledani (ux_filtry) --- */
.ux-filtry {
	max-width: 1100px;
	margin: 6px auto 10px;
	padding: 8px 12px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	display: grid;
	gap: 4px;
}
.ux-filtr { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.ux-filtr-nazev { font-weight: 600; min-width: 11em; color: var(--muted); }
.ux-filtr a {
	padding: 1px 8px;
	border: 1px solid var(--border);
	border-radius: 999px;
	text-decoration: none;
	white-space: nowrap;
	line-height: 1.6;
}
.ux-filtr a:hover { background: var(--accent-soft); }
.ux-filtr a.aktivni { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
@media (max-width: 600px) {
	/* na mobilu kazdy filtr na jednom radku s posunem do strany (mene mista nad vysledky) */
	.ux-filtr { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; scrollbar-width: thin; }
	.ux-filtr-nazev { min-width: 0; flex: none; }
	.ux-filtry { padding: 6px 8px; }
}

/* --- vyroba / questy: sbalene suroviny (produce.cgi prodhidelister) --- */
ul.ux-vyroby { list-style: none; margin: 2px 0 8px; padding: 0; }
li.ux-vyroba { list-style: none; padding: 2px 0; border-bottom: 1px dotted var(--border); }
li.ux-vyroba > details > summary { cursor: pointer; }
li.ux-vyroba > details > summary img { vertical-align: middle; }
li.ux-vyroba > details > ul { margin: 4px 0 4px 18px; padding-left: 12px; }
li.ux-vyroba > details[open] > summary { font-weight: 600; }
ul.ux-sloupce { max-width: 1100px; margin: 4px auto 12px; columns: 2 420px; column-gap: 24px; }
ul.ux-sloupce > li { break-inside: avoid; }
details.ux-quest-typ { max-width: 1100px; margin: 4px auto; border-bottom: 1px solid var(--border); }
details.ux-quest-typ > summary { font-weight: 700; font-size: 1.05em; padding: 4px 0; }
