/* Inventář 2.0: an alternative look of the character inventory (PersonWear.getInventory), after the DemoUnit
   inventory preview approved on 2026-10-11. Only applies inside .inv2, which js/inventory2.js builds around the
   page's own inventory markup when the player switches it on; the classic inventory is untouched otherwise. */

.inv2 {
	--i2-panel: #191612; --i2-panel2: #211d18; --i2-well: #120f0c; --i2-line: #3b342a; --i2-line2: #574b3a;
	--i2-brass: #c9a35c; --i2-brass-hi: #e8c987; --i2-brass-lo: #7d6236; --i2-text: #ece3d1; --i2-muted: #a99f8b; --i2-dim: #71685a;
	--i2-ok: #93c06c; --i2-warn: #e3a64a; --i2-bad: #db6550; --i2-sel: #f0cf86;
	--i2-parch: linear-gradient(160deg, #e9dcbd, #cbb68b);
	--i2-slot: 52px; --i2-gap: 6px; --i2-stage: 230px;
	--i2-head: Georgia, "Cambria", "Times New Roman", serif;
	--i2-ui: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
	position: relative;
	width: max-content;
	max-width: 100%;
	margin: 6px 0 14px;
	color: var(--i2-text);
	font: 14px/1.35 var(--i2-ui);
	background: linear-gradient(180deg, #1d1a15, #15120f);
	border: 1px solid var(--i2-line2);
	border-radius: 10px;
	box-shadow: 0 14px 34px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 236, 190, .06);
}
.inv2::before {
	content: "";
	position: absolute;
	inset: 5px;
	border: 1px solid rgba(201, 163, 92, .16);
	border-radius: 7px;
	pointer-events: none;
}
.inv2 .items-container { display: none; }

/* header: title, what the classic one calls "Nasazené předměty", the load, the switch back */
.inv2-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px 8px 14px;
	border-bottom: 1px solid var(--i2-line2);
	flex-wrap: wrap;
}
.inv2-title { font: 700 20px var(--i2-head); color: var(--i2-brass-hi); letter-spacing: .03em; }
.inv2-sub { color: var(--i2-muted); font-size: 13px; }
.inv2-load { padding: 1px 9px; border: 1px solid var(--i2-line2); border-radius: 11px; background: var(--i2-well); color: var(--i2-text); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.inv2-switch {
	margin-left: auto;
	padding: 3px 10px;
	border: 1px solid var(--i2-line2);
	border-radius: 6px;
	background: #1b1713;
	color: var(--i2-muted);
	font: 12.5px var(--i2-ui);
	cursor: pointer;
}
.inv2-switch:hover { color: var(--i2-text); border-color: var(--i2-brass-lo); }

.inv2-body { display: block; background: var(--i2-panel2); border-radius: 0 0 9px 9px; }
.inv2.inv2-wide { width: 100%; max-width: 980px; }
.inv2.inv2-wide .inv2-body { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.inv2-paper { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: var(--i2-gap); width: calc(var(--i2-slot) * 2 + var(--i2-stage) + var(--i2-gap) * 2 + 24px); max-width: 100%; }
.inv2.inv2-wide .inv2-paper { border-right: 1px solid var(--i2-line); }
.inv2:not(.inv2-wide) .inv2-paper { margin: 0 auto; }
.inv2:not(.inv2-wide) .inv2-pack { border-top: 1px solid var(--i2-line); }
.inv2-row6 { display: flex; justify-content: space-between; }
.inv2-doll { display: grid; grid-template-columns: var(--i2-slot) minmax(0, 1fr) var(--i2-slot); gap: var(--i2-gap); }
.inv2-col { display: grid; grid-auto-rows: var(--i2-slot); gap: var(--i2-gap); align-content: start; }
.inv2-stage {
	position: relative;
	height: calc(var(--i2-slot) * 6 + var(--i2-gap) * 5);
	border-radius: 8px;
	border: 1px solid var(--i2-line);
	background: radial-gradient(ellipse at 50% 38%, #3a3226 0%, #221d17 55%, #15120e 100%);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.inv2-stage img { max-width: 100% !important; max-height: 100%; object-fit: contain; border-radius: 6px; }
.inv2-stage::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 28px rgba(0, 0, 0, .55); border-radius: 8px; pointer-events: none; }
.inv2-custom { display: flex; align-items: center; gap: var(--i2-gap); flex-wrap: wrap; margin-top: 2px; }
.inv2-custom .inv2-lbl { flex-basis: 100%; color: var(--i2-muted); font: 700 12.5px var(--i2-head); letter-spacing: .04em; margin: 0 0 -2px 1px; }
.inv2-custom .inv2-name { display: none; }

/* slots and cells: the page's own .item-container / .item-icon, re-dressed */
.inv2 .item-container {
	display: block;
	position: relative;
	width: var(--i2-slot);
	height: var(--i2-slot);
	margin: 0;
	border: 1px solid #3c342a;
	border-radius: 6px;
	background: linear-gradient(160deg, #262019, #17130f);
	cursor: pointer;
	isolation: isolate;
	transition: box-shadow .15s, border-color .15s;
}
/* a thing: the page's pictures are painted on white, so they lie on parchment and multiply into it */
.inv2 .item-container:not(.inv2-empty) { background: var(--i2-parch); }
.inv2 .item-container:not(.inv2-empty) > .item-icon { mix-blend-mode: multiply; }
.inv2 .item-container > .item-icon {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	border-radius: 5px;
	object-fit: cover;
}
.inv2 .item-container:hover { border-color: var(--i2-brass); }
.inv2 .item-container > .item-text { display: none; }
/* empty slot: sits back, dashed, the slot's picture faint, its name small */
.inv2 .inv2-empty { border: 1px dashed #4a4033; background: linear-gradient(160deg, #1d1914, #120f0c); box-shadow: inset 0 -8px 14px rgba(0, 0, 0, .4); }
.inv2 .inv2-empty > .item-icon { opacity: .26; filter: invert(1) grayscale(1); mix-blend-mode: screen; }
.inv2 .inv2-empty:hover > .item-icon { opacity: .45; }
.inv2-name {
	position: absolute;
	left: 1px;
	right: 1px;
	bottom: 2px;
	color: #8a7f6c;
	font-size: 9.5px;
	line-height: 1.05;
	text-align: center;
	pointer-events: none;
	overflow: hidden;
	max-height: 2.2em;
}
/* worn: brass frame, warm glow */
.inv2 .inv2-full { border: 2px solid var(--i2-brass); box-shadow: 0 0 0 1px rgba(0, 0, 0, .7), 0 0 12px rgba(232, 201, 135, .42); }
.inv2 .inv2-full > .item-icon { border-radius: 4px; }
.inv2 .inv2-full:hover { box-shadow: 0 0 0 2px var(--i2-sel), 0 0 18px rgba(240, 207, 134, .6); }
/* the left hand under a two-handed weapon */
.inv2 .inv2-ghost { border: 1px dashed var(--i2-brass); background: linear-gradient(160deg, #6b5d45, #4a3f2e) !important; }
.inv2 .inv2-ghost > .item-icon { opacity: .55; filter: grayscale(.6); }
/* an open container (the bag on the back, a pouch in it) */
.inv2 .inv2-cont::before { content: ""; position: absolute; right: 4px; top: 4px; width: 7px; height: 7px; border-right: 2px solid var(--i2-brass-hi); border-top: 2px solid var(--i2-brass-hi); transform: rotate(45deg); z-index: 1; pointer-events: none; filter: drop-shadow(0 0 2px #000); }
.inv2 .item-count, .inv2 .item-count-full {
	right: 3px;
	bottom: 1px;
	color: #fff;
	font: 700 12.5px var(--i2-ui);
	text-shadow: 0 1px 2px #000, 0 0 3px #000;
	z-index: 1;
}
.inv2 .item-count-full { left: 3px; text-align: left; }
.inv2 .inv2-ghost .item-count { color: var(--i2-brass-hi); font-family: var(--i2-head); }

/* drag and drop (the page's own jQuery UI handlers): the dragged copy keeps the slot's size; where a thing can go */
.inv2 .item-container > .item-icon.ui-draggable-dragging {
	width: var(--i2-slot) !important;
	height: var(--i2-slot) !important;
	z-index: 1003;
	border: 2px solid var(--i2-brass-hi);
	border-radius: 6px;
	background: #e9dcbd;
	mix-blend-mode: normal;
	box-shadow: 0 10px 24px rgba(0, 0, 0, .55);
	cursor: grabbing;
}
.inv2 .item-icon.item-icon-accept { border: none; outline: 2px dashed var(--i2-ok); outline-offset: -2px; opacity: 1 !important; }
.inv2 .item-icon.item-icon-accept.item-icon-accept-hover { outline: 3px solid var(--i2-ok); box-shadow: inset 0 0 22px rgba(147, 192, 108, .45); }

/* the click popup (the item's text, its edit / use / delete buttons) */
.inv2 .item-hidden {
	width: 300px;
	padding: 10px 12px 11px;
	color: var(--i2-text);
	font-style: normal;
	font-size: 13px;
	background: linear-gradient(180deg, #221d16, #16130f);
	border: 1px solid var(--i2-brass-lo);
	border-radius: 8px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, .6);
	cursor: default;
}
.inv2 .item-hidden .item-text { background: transparent; font-style: normal; font-size: 13px; padding: 0; }
.inv2 .item-hidden .text-danger:first-child { font: 700 16px/1.2 var(--i2-head); color: var(--i2-brass-hi) !important; margin-bottom: 3px; }
.inv2 .item-hidden .text-info { color: #9cc3d6 !important; margin-top: 6px; }
.inv2 .item-hidden a { color: var(--i2-brass-hi); }
.inv2 .item-hidden .form-control, .inv2 .item-hidden .form-select, .inv2 .item-hidden input, .inv2 .item-hidden select { background: #120f0c; color: var(--i2-text); border-color: var(--i2-line2); }
/* every cell is its own stacking context (isolation above), so the cell with the open popup is lifted over its neighbours */
.inv2 .item-container:has(.item-hidden[style*="block"]) { z-index: 1001; }
/* the dragged copy (jQuery UI helper "clone") stays inside its cell, so that cell is lifted over the stage and the other cells while dragging */
.inv2 .item-container:has(> .ui-draggable-dragging) { z-index: 1003; }

/* the right side (below when narrow): filters, money, the open containers, cart / for the GM / not approved */
.inv2-pack { padding: 10px 12px 12px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.inv2-pack h6 { margin: 0; color: var(--i2-warn) !important; font-size: 12.5px; }
.inv2-filters { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 !important; }
.inv2-filters .btn {
	margin: 0 !important;
	padding: 2px 9px;
	border: 1px solid var(--i2-line);
	border-radius: 12px;
	background: #17140f;
	color: var(--i2-muted);
	font-size: 13px;
	line-height: 1.45;
	box-shadow: none;
}
.inv2-filters .btn:hover { border-color: var(--i2-brass-lo); color: var(--i2-text); }
.inv2-filters .btn.btn-primary { background: #3a2f1f; border-color: var(--i2-brass); color: var(--i2-brass-hi); }
.inv2-coins { margin: 0 !important; padding: 5px 9px; border: 1px solid var(--i2-line); border-radius: 7px; background: var(--i2-well); color: var(--i2-muted); font: 12.5px/1.5 var(--i2-ui); font-variant-numeric: tabular-nums; }
.inv2-pocket { border: 1px solid var(--i2-line); border-radius: 8px; background: var(--i2-well); }
.inv2-pocket .inv2-pocket { margin-top: 2px; grid-column: 1 / -1; }
.inv2-ph {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 8px;
	border-bottom: 1px solid var(--i2-line);
	font: 700 14px var(--i2-head);
	color: var(--i2-brass-hi);
	letter-spacing: .02em;
}
.inv2-ph .inv2-n { font: 400 12px var(--i2-ui); color: var(--i2-dim); letter-spacing: 0; }
.inv2-ph .item-container { width: 34px; height: 34px; flex: none; }
.inv2-ph .item-container .item-count, .inv2-ph .item-container .item-count-full { display: none; }
.inv2-ph .inv2-hint { margin-left: auto; font: 400 11.5px var(--i2-ui); color: var(--i2-dim); }
.inv2-grid { display: grid; grid-template-columns: repeat(auto-fill, var(--i2-slot)); grid-auto-rows: auto; gap: 5px; padding: 6px; min-height: calc(var(--i2-slot) + 12px); align-items: start; }
.inv2-grid > .item-container { height: var(--i2-slot); border-color: #6d5d43; }
.inv2-grid:empty::after { content: attr(data-empty); grid-column: 1 / -1; align-self: center; color: var(--i2-dim); font-size: 13px; padding: 10px 4px; }
.inv2-pocket.inv2-closed { background: transparent; }
.inv2-pocket.inv2-closed .inv2-ph { border-bottom: none; }
.inv2-toggle { cursor: pointer; flex: 1; display: flex; align-items: center; gap: 8px; margin: 0 !important; color: var(--i2-brass-hi) !important; }
.inv2-closed .inv2-toggle { color: var(--i2-muted) !important; }
.inv2-toggle:hover { color: var(--i2-sel) !important; }
.inv2-toggle .fa { width: 14px; text-align: center; color: var(--i2-brass); }
.inv2-links { font-size: 13px; color: var(--i2-dim); }
.inv2-links a, .inv2-links .clickable { color: var(--i2-brass-hi) !important; text-decoration: none; }
.inv2-links a:hover { color: var(--i2-sel) !important; }

/* the card under the mouse */
.inv2-card {
	position: fixed;
	z-index: 1002;
	width: 260px;
	max-width: calc(100vw - 24px);
	padding: 9px 11px 10px;
	color: #ece3d1;
	font: 13px/1.35 "Segoe UI", system-ui, sans-serif;
	background: linear-gradient(180deg, #221d16, #16130f);
	border: 1px solid #7d6236;
	border-radius: 8px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, .6);
	pointer-events: none;
	display: none;
}
.inv2-card.show { display: block; }
.inv2-card .hd { display: grid; grid-template-columns: 46px 1fr; gap: 10px; align-items: center; }
.inv2-card .hd img { width: 46px; height: 46px; object-fit: cover; border: 1px solid #3b342a; border-radius: 6px; }
.inv2-card .t { font: 700 15.5px/1.15 Georgia, serif; color: #e8c987; }
.inv2-card .sub { color: #a99f8b; font-size: 12.5px; margin-top: 2px; }
.inv2-card .act { margin-top: 6px; font-size: 12px; color: #71685a; }

/* the drop targets shown while dragging (a strip at the top of the page) */
html.inv2-on .item-targets { background: #191612; border: 1px solid #574b3a; border-radius: 0 0 8px 0; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
html.inv2-on .item-targets .item-container { border: 1px solid #3c342a; border-radius: 6px; background: #17130f; margin: 2px; }
html.inv2-on .item-targets .item-container .item-text { background: transparent; color: #a99f8b; font-style: normal; }
html.inv2-on .item-targets .item-container .item-icon { background: transparent; }

/* the way back in the classic inventory */
.inv2-try {
	display: inline-block;
	margin: 4px 0 6px;
	padding: 3px 10px;
	border: 1px solid #7d6236;
	border-radius: 6px;
	background: linear-gradient(#3a2f20, #241d14);
	color: #e8c987;
	font: 700 13px Georgia, serif;
	cursor: pointer;
}
.inv2-try:hover { background: linear-gradient(#4a3b26, #2c2318); }

/* a very narrow column (the side menu open on a small screen) */
.inv2.inv2-tight { --i2-slot: 40px; --i2-gap: 5px; --i2-stage: 150px; }
.inv2.inv2-tight .inv2-sub, .inv2.inv2-tight .inv2-name { display: none; }

@media (max-width: 420px) {
	.inv2 { --i2-slot: 46px; --i2-stage: calc(100vw - 2 * 46px - 2 * 6px - 24px - 34px); }
	.inv2-sub { display: none; }
}
