/* TibiaCOMv3 Library: creatures, bosses, loot. Sprites stay transparent, no slot boxes. */

.tc3-library { color: var(--foreground); }

.tc3-library-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
}
.tc3-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.tc3-library-bar .tc3-tabs { margin-bottom: 0; }
.tibiacomv3-core-page a.tc3-tab,
.tc3-tab {
	display: inline-block;
	padding: 6px 14px;
	font-size: 12px;
	font-weight: 700;
	text-decoration: none;
	color: var(--foreground);
	background: var(--box-inner-bg);
	border: 1px solid var(--box-inner-border);
}
.tibiacomv3-core-page a.tc3-tab.is-active,
.tc3-tab.is-active {
	color: var(--btn-primary-text);
	background: linear-gradient(to bottom, var(--btn-primary-from), var(--btn-primary-to));
	border-color: var(--btn-primary-border);
}
.tc3-search { min-width: 200px; }
.tc3-species { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 10px; }
.tibiacomv3-core-page .tc3-species .tc3-chip,
.tc3-chip {
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	color: var(--foreground);
	background: var(--box-inner-bg);
	border: 1px solid var(--box-inner-border);
}
.tc3-chip small { font-weight: 400; opacity: .7; }
.tibiacomv3-core-page .tc3-species .tc3-chip:hover,
.tc3-chip:hover { border-color: #b8860b; }
.tibiacomv3-core-page .tc3-species .tc3-chip.is-active,
.tc3-chip.is-active {
	color: var(--btn-primary-text);
	background: linear-gradient(to bottom, var(--btn-primary-from), var(--btn-primary-to));
	border-color: var(--btn-primary-border);
}
.tc3-count { margin: 0 0 8px; font-size: 12px; color: var(--text-muted); }
.tc3-empty { text-align: center; color: var(--text-muted); }

/* Creature gallery */
.tc3-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
	gap: 8px;
}
.tibiacomv3-core-page a.tc3-card,
.tc3-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 8px 6px;
	text-align: center;
	text-decoration: none;
	background: var(--box-inner-bg);
	border: 1px solid var(--box-inner-border);
	transition: background .15s, border-color .15s;
}
.tc3-card[hidden],
.tibiacomv3-core-page a.tc3-card[hidden] { display: none; }
.tc3-card:hover { background: var(--hover-bg); border-color: #b8860b; }
.tc3-card.is-boss { border-color: rgba(184, 134, 11, .65); }
.tc3-card-sprite {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	width: 100%;
	height: 72px;
}
.tc3-card-sprite img { max-width: 96px; max-height: 70px; image-rendering: pixelated; }
.tc3-card-name { font-size: 12px; font-weight: 700; line-height: 1.2; color: var(--text-link); }
.tc3-card-meta { font-size: 10px; color: var(--text-muted); }

/* Bosses: golden glow, never a box behind the sprite. */
.monsterBoss {
	filter: drop-shadow(0 0 2px #ffd700) drop-shadow(0 0 5px #ffb700);
	background: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

/* Single creature */
.tc3-monster-head { display: flex; align-items: center; gap: 16px; margin: 4px 0 14px; }
.tc3-monster-sprite {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 128px;
	height: 128px;
	flex: 0 0 128px;
}
.tc3-monster-sprite img { max-width: 128px; max-height: 128px; image-rendering: pixelated; }
.tibiacomv3-core-page .tc3-monster-title h1 { margin: 0 0 6px; font-size: 22px; font-family: var(--font-medieval); }
.tc3-badge {
	display: inline-block;
	margin-right: 4px;
	padding: 2px 8px;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--text-muted);
	background: var(--box-inner-bg);
	border: 1px solid var(--box-inner-border);
}
.tc3-badge-boss { color: #fff; background: linear-gradient(#b8860b, #8b6508); border-color: #6f5005; }

.tc3-section { margin-bottom: 14px; }
.tibiacomv3-core-page .tc3-section h2 {
	margin: 0 0 8px;
	padding: 6px 10px;
	font-size: 13px;
	color: #f0e6d2;
	background: linear-gradient(180deg, var(--box-header-from), var(--box-header-to));
	border: 1px solid var(--box-header-border, #3b2a17);
}
.tc3-section h2 small { font-weight: 400; opacity: .75; }
.tc3-section p { margin: 0 0 4px; }
.tc3-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

.tc3-stats, .tc3-elements {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 6px;
}
.tc3-stats div, .tc3-elements div {
	display: flex;
	flex-direction: column;
	padding: 6px 8px;
	background: var(--box-inner-bg);
	border: 1px solid var(--box-inner-border);
}
.tc3-stats span, .tc3-elements span { font-size: 10px; text-transform: uppercase; color: var(--text-muted); }
.tc3-elements .is-weak b { color: #b83232; }
.tc3-elements .is-strong b { color: #087d58; }
.tc3-immunities { margin-top: 8px !important; font-size: 12px; }

.monster_voice {
	font-weight: bold;
	font-size: 8pt;
	color: #fe6500;
	text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

/* Loot: transparent items, max amount in white with a black outline, chance below. */
.tc3-loot { display: flex; flex-wrap: wrap; gap: 4px 2px; }
.loot_entry {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	width: 54px;
	text-align: center;
}
.loot_bg {
	position: relative;
	display: block;
	width: 32px;
	height: 32px;
	margin: 2px;
	background: none !important;
	border: 0 !important;
	opacity: 1 !important;
}
.loot_image { display: block; width: 32px; height: 32px; border: 0; image-rendering: pixelated; }
.loot_amount {
	position: absolute;
	right: -2px;
	bottom: -3px;
	font: bold 11px/1 Verdana, Arial, sans-serif;
	color: #fff;
	pointer-events: none;
	text-shadow:
		-1px -1px 0 #000, 0 -1px 0 #000, 1px -1px 0 #000,
		-1px 0 0 #000, 1px 0 0 #000,
		-1px 1px 0 #000, 0 1px 0 #000, 1px 1px 0 #000;
}
.loot_chance { display: block; font-size: 10px; font-weight: 700; color: var(--foreground); }

.tc3-monster-links { margin-top: 10px; }

@media (max-width: 720px) {
	.tc3-monster-head { flex-direction: column; text-align: center; }
	.tc3-search { min-width: 0; width: 100%; }
}

/* ---------- Live editor (GM only) ---------- */
.tc3-section h2 { display: flex; align-items: center; gap: 8px; }
.tc3-section h2 small { margin-right: auto; }
.tc3-edit-btn {
	margin-left: auto;
	padding: 3px 10px;
	font: 700 11px/1.4 inherit;
	color: #1d1300 !important;
	background: linear-gradient(#ffd66b, #c9932a) !important;
	border: 1px solid #7a5512 !important;
	cursor: pointer;
}
.tc3-edit-btn:hover { filter: brightness(1.1); }
.loot_entry.is-edited .loot_chance, .tc3-stats b.is-edited { color: #b16b00; }
body.tc3-editor-open { overflow: hidden; }

.tc3-editor { position: fixed; inset: 0; z-index: 2147483000; isolation: isolate; font-family: inherit; text-align: left; display: flex; align-items: center; justify-content: center; padding: 16px; }
.tc3-editor[hidden] { display: none; }
.tc3-editor-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .65); }
.tc3-editor-panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1040px, 100%);
	max-height: calc(100vh - 32px);
	color: #3a2a14;
	background: linear-gradient(#f5e6c8, #ead8b1);
	border: 2px solid #b8860b;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
}
.tc3-editor.is-stats .tc3-editor-panel { width: min(560px, 100%); }
.tc3-editor-head {
	display: flex; align-items: center; gap: 12px;
	padding: 8px 12px;
	color: #f0e6d2;
	background: linear-gradient(180deg, var(--box-header-from), var(--box-header-to));
}
.tc3-editor-head h3 { margin: 0; font-family: var(--font-medieval); font-size: 16px; }
.tc3-editor-status { margin-left: auto; font-size: 12px; font-weight: 700; }
.tc3-editor-status.is-ok { color: #8ef0a8; }
.tc3-editor-status.is-wait { color: #ffd66b; }
.tc3-editor-x { background: none; border: 0; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.tc3-editor-body { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; padding: 12px; min-height: 0; overflow: hidden; flex: 1; }
.tc3-editor-body[hidden] { display: none; }
.tc3-editor-col { display: flex; flex-direction: column; min-height: 0; }
.tc3-editor-col h4 { margin: 0 0 6px; font-size: 13px; }
.tc3-editor-table-wrap, .tc3-editor-results { flex: 1; min-height: 240px; max-height: 60vh; overflow-y: auto; background: rgba(255, 255, 255, .35); border: 1px solid #c9b48a; }
.tc3-editor-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tc3-editor-table th { position: sticky; top: 0; z-index: 1; padding: 5px; text-align: left; background: #dcc79c; }
.tc3-editor-table td { padding: 3px 5px; border-bottom: 1px solid #d8c6a0; vertical-align: middle; }
.tc3-editor-table td:first-child { width: 42px; min-width: 42px; }
.tc3-editor img { max-width: none !important; max-height: none !important; flex: none; object-fit: contain; }
.tc3-editor-table img { display: block; width: 32px; height: 32px; image-rendering: pixelated; }
.tc3-editor-table .n { min-width: 120px; font-weight: 700; }
.tc3-editor-table .n small { display: block; font-weight: 400; color: #7a6646; }
.tc3-editor-table input { width: 68px; padding: 3px 4px; font-size: 12px; border: 1px solid #b9a37a; background: #fffaf0; }
.tc3-editor-table input[data-f="min"], .tc3-editor-table input[data-f="count"] { width: 54px; }
.tc3-editor-table tr.is-added td { background: rgba(60, 160, 80, .14); }
.tc3-editor-table tr.is-edited td { background: rgba(230, 160, 30, .12); }
.tc3-editor-table tr.flash td { background: rgba(255, 210, 60, .55); }
.tc3-editor-empty { padding: 16px !important; text-align: center; color: #7a6646; }
.tc3-editor-del { width: 24px; height: 24px; font-size: 16px; line-height: 1; color: #fff; background: #9b2f3a; border: 1px solid #5f1b23; cursor: pointer; }
.tc3-editor-search { display: flex; gap: 6px; margin-bottom: 4px; }
.tc3-editor-search input { flex: 1; min-width: 0; padding: 6px; border: 1px solid #b9a37a; background: #fffaf0; }
.tc3-editor-search select { max-width: 48%; padding: 5px; border: 1px solid #b9a37a; background: #fffaf0; }
.tc3-editor-hint { margin: 0 0 6px; font-size: 11px; color: #7a6646; }
.tc3-editor-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; gap: 4px; padding: 4px; }
.tc3-editor-item {
	display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 6px;
	align-items: center; padding: 4px; text-align: left; cursor: pointer;
	background: rgba(255, 255, 255, .55); border: 1px solid #d0bb8f;
}
.tc3-editor-item:hover { background: #fff3d2; border-color: #b8860b; }
.tc3-editor-item img { grid-row: span 2; width: 32px; height: 32px; image-rendering: pixelated; }
.tc3-editor-item span { font-size: 12px; font-weight: 700; color: #3a2a14; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc3-editor-item small { font-size: 10px; color: #7a6646; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc3-editor-stats { display: block; }
.tc3-editor-name { display: flex; flex-direction: column; gap: 3px; margin: 0 0 12px; font-size: 12px; font-weight: 700; }
.tc3-editor-name input { padding: 6px; border: 1px solid #b9a37a; background: #fffaf0; }
.tc3-editor-name small { font-weight: 400; color: #7a6646; }
.tc3-editor-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tc3-editor-stat-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 700; }
.tc3-editor-stat-grid input, .tc3-editor-stat-grid select { padding: 6px; border: 1px solid #b9a37a; background: #fffaf0; }
.tc3-editor-stat-grid small { font-weight: 400; color: #7a6646; }
.tc3-editor-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid #c9b48a; }
.tc3-editor-error { flex: 1; font-size: 12px; font-weight: 700; color: #a3202c; }
.tc3-editor-reset, .tc3-editor-cancel { padding: 6px 12px; font-size: 12px; cursor: pointer; border: 1px solid #b9a37a; background: #efe2c4; color: #3a2a14; }
.tc3-editor-reset { color: #9b2f3a; }
.tc3-editor-foot .tibiacomv3-button[disabled] { opacity: .6; cursor: wait; }
@media (max-width: 760px) {
	.tc3-editor { padding: 0; }
	.tc3-editor-panel { max-height: 100vh; height: 100vh; }
	.tc3-editor-body { grid-template-columns: 1fr; overflow-y: auto; }
	.tc3-editor-table-wrap, .tc3-editor-results { max-height: 40vh; min-height: 160px; }
	.tc3-editor-foot { flex-wrap: wrap; }
}

/* GM "Añadir criaturas" */
.tibiacomv3-core-page .tc3-tabs button.tc3-tab-gm,
.tc3-tab-gm { cursor: pointer; color: #fff; background: linear-gradient(#3c8a4a, #2a6535); border: 1px solid #1d4a26; }
.tc3-picker .tc3-editor-body { grid-template-columns: 1fr 1fr; }
.tc3-picker-list { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.tc3-picker-item.is-added { border-color: #3c8a4a; background: rgba(60, 160, 80, .14); }
.tc3-picker-item.is-selected { border-color: #b8860b; background: #fff3d2; box-shadow: inset 0 0 0 1px #b8860b; }
.tc3-picker-item img { width: 32px; height: 32px; object-fit: contain; }
.tc3-picker-detail { overflow-y: auto; }
.tc3-picker-empty { padding: 30px 0; text-align: center; }
.tc3-picker-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tc3-picker-head img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; }
.tc3-picker-head strong { display: block; font-size: 15px; }
.tc3-picker-head small { color: #7a6646; }
.tc3-picker-row, .tc3-picker-grid label { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; font-size: 12px; font-weight: 700; }
.tc3-picker-row select, .tc3-picker-row input, .tc3-picker-grid select, .tc3-picker-grid input { padding: 5px; border: 1px solid #b9a37a; background: #fffaf0; font-weight: 400; }
.tc3-picker-check { display: flex; align-items: center; gap: 6px; margin: 4px 0; font-size: 12px; font-weight: 700; cursor: pointer; }
.tc3-picker-bestiary { margin: 4px 0 0; padding: 8px; border: 1px solid #c9b48a; }
.tc3-picker-bestiary.is-off { opacity: .45; }
.tc3-picker-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; }
@media (max-width: 760px) { .tc3-picker .tc3-editor-body { grid-template-columns: 1fr; } }
