/* Project Heroes Wiki */
@font-face {
	font-family: 'Stylo';
	src: url('/assets/stylo.ttf') format('truetype');
	font-display: swap;
}

:root {
	--bg: #0b0a10;
	--panel: rgba(20, 17, 26, 0.92);
	--panel-2: rgba(36, 30, 44, 0.95);
	--line: rgba(224, 178, 90, 0.28);
	--text: #e6e0d6;
	--muted: #a59e94;
	--gold: #e8b860;
	--gold-2: #ffd98a;
	--link: #f0c36a;
	--link-hover: #fff0c4;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	color: var(--text);
	background: var(--bg) url('bg.webp') center top / cover fixed no-repeat;
	font: 15px/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	-webkit-tap-highlight-color: transparent;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
a:focus:not(:focus-visible), button:focus:not(:focus-visible), summary:focus:not(:focus-visible) { outline: none; }

/* ---------- top bar */
.wk-top {
	position: sticky;
	top: 0;
	z-index: 20;
	background: linear-gradient(#17121c, #100d14);
	border-bottom: 1px solid var(--line);
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
}
.wk-top__in {
	max-width: 1240px;
	margin: 0 auto;
	padding: 6px 16px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 18px;
}
.wk-logo { flex: none; display: block; line-height: 0; padding: 4px 0; }
.wk-logo img { width: 200px; height: auto; }
.wk-burger { display: none; }

.wk-nav { order: 5; flex-basis: 100%; border-top: 1px solid rgba(224, 178, 90, 0.16); }
.wk-nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; }
.wk-nav__item { position: relative; }
.wk-nav__top {
	display: block;
	padding: 8px 16px;
	color: var(--gold);
	font-family: 'Stylo', Georgia, serif;
	font-size: 17px;
	letter-spacing: 0.02em;
	white-space: nowrap;
}
.wk-nav__top:hover { color: var(--gold-2); text-decoration: none; }
.wk-nav__sub {
	list-style: none;
	margin: 0;
	padding: 6px 0;
	position: absolute;
	left: 0;
	top: 100%;
	min-width: 230px;
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 0 0 8px 8px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
	visibility: hidden;
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity .15s, transform .15s, visibility .15s;
}
.wk-nav__item:hover > .wk-nav__sub,
.wk-nav__item:focus-within > .wk-nav__sub { visibility: visible; opacity: 1; transform: none; }
.wk-nav__sub a { display: block; padding: 6px 16px; color: var(--text); }
.wk-nav__sub a:hover { background: rgba(232, 184, 96, 0.12); color: var(--gold-2); text-decoration: none; }

.wk-tools { flex: none; margin-left: auto; display: flex; align-items: center; gap: 10px; }

.wk-search { position: relative; margin: 0; }
.wk-search input {
	width: 190px;
	padding: 7px 12px;
	border-radius: 18px;
	border: 1px solid var(--line);
	background: rgba(0, 0, 0, 0.45);
	color: var(--text);
	font: inherit;
	font-size: 14px;
}
.wk-search input:focus { outline: none; border-color: var(--gold); }
.wk-search__list {
	list-style: none;
	margin: 6px 0 0;
	padding: 4px 0;
	position: absolute;
	right: 0;
	top: 100%;
	width: 280px;
	max-height: 60vh;
	overflow: auto;
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 8px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}
.wk-search__list a, .wk-search__list span { display: block; padding: 6px 14px; color: var(--text); }
.wk-search__list span { color: var(--muted); }
.wk-search__list a:hover, .wk-search__list a.is-active { background: rgba(232, 184, 96, 0.14); color: var(--gold-2); text-decoration: none; }

/* language: a pill with a menu below, like the fandom one */
.wk-lang { position: relative; }
.wk-lang summary {
	list-style: none;
	cursor: pointer;
	padding: 6px 14px;
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.08);
	font-weight: 600;
	font-size: 14px;
	user-select: none;
}
.wk-lang summary::-webkit-details-marker { display: none; }
.wk-lang summary::after { content: ''; display: inline-block; margin-left: 8px; border: 5px solid transparent; border-top-color: currentColor; vertical-align: -2px; }
.wk-lang[open] summary::after { border-top-color: transparent; border-bottom-color: currentColor; vertical-align: 3px; }
.wk-lang a {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	padding: 10px 20px;
	white-space: nowrap;
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 8px;
	color: var(--text);
	font-weight: 600;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}
.wk-lang a:hover { color: var(--gold-2); text-decoration: none; }

.wk-play {
	display: inline-block;
	padding: 6px 18px 8px;
	border-radius: 16px;
	background: linear-gradient(#f2b14a, #b7651c);
	color: #2b1406;
	font-family: 'Stylo', Georgia, serif;
	font-size: 17px;
	line-height: 1.1;
	box-shadow: 0 0 12px rgba(255, 150, 50, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.wk-play:hover { color: #2b1406; text-decoration: none; filter: brightness(1.12); }

/* ---------- page */
.wk-page {
	flex: 1;
	width: 100%;
	max-width: 1240px;
	margin: 24px auto;
	padding: 22px 32px 30px;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 10px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.wk-title {
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--line);
	color: var(--gold-2);
	font: 400 34px/1.15 'Stylo', Georgia, serif;
	text-shadow: 0 0 14px rgba(255, 140, 40, 0.35);
	overflow-wrap: anywhere;
}
.wk-content { overflow-wrap: break-word; }
.wk-content::after { content: ''; display: table; clear: both; }
.wk-content h2, .wk-content h3, .wk-content h4 { color: var(--gold); font-family: 'Stylo', Georgia, serif; font-weight: 400; line-height: 1.25; clear: none; }
.wk-content h2 { font-size: 26px; margin: 28px 0 10px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.wk-content h3 { font-size: 21px; margin: 22px 0 8px; }
.wk-content h4 { font-size: 18px; margin: 18px 0 6px; }
.wk-content p { margin: 0 0 12px; }
.wk-content ul, .wk-content ol { padding-left: 24px; }
.wk-content hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.wk-content img { max-width: 100%; height: auto; vertical-align: middle; }
.wk-content b, .wk-content strong { color: #fff3dc; }
.wk-content .mw-selflink { color: var(--gold-2); }

.wk-scroll { max-width: 100%; overflow-x: auto; margin: 0 0 14px; }
.wk-content table { border-collapse: collapse; }
.wk-content .article-table { margin: 0 0 14px; border: 1px solid var(--line); }
.wk-content .article-table th, .wk-content .article-table td { padding: 6px 10px; border: 1px solid rgba(224, 178, 90, 0.18); vertical-align: top; }
.wk-content .article-table th { background: rgba(232, 184, 96, 0.12); color: var(--gold-2); text-align: left; }
.wk-content td[style*="background"] a { color: #fff; font-weight: 600; }
.wk-content td[style*="background"] { padding: 4px 10px; }

/* thumbnails */
.wk-content figure { margin: 0 0 12px; max-width: 100%; }
.wk-content .thumb { display: table; }
.wk-content .mw-halign-center { display: table; margin-left: auto; margin-right: auto; }
.wk-content .mw-halign-right, .wk-content .tright { float: right; clear: right; margin: 0 0 12px 18px; }
.wk-content .mw-halign-left.thumb { margin: 0 auto 8px; }
.wk-content figcaption { padding: 4px 2px 0; color: var(--muted); font-size: 13px; text-align: center; }

/* contents box */
.wk-content .toc {
	display: inline-block;
	margin: 6px 0 16px;
	padding: 10px 18px 10px 14px;
	background: rgba(0, 0, 0, 0.3);
	border: 1px solid var(--line);
	border-radius: 8px;
}
.wk-content .toctitle { display: flex; align-items: baseline; gap: 10px; }
.wk-content .toctitle h2 { margin: 0; padding: 0; border: 0; font-size: 20px; }
.wk-content .toc ul { list-style: none; margin: 6px 0 0; padding-left: 0; }
.wk-content .toc ul ul { padding-left: 18px; margin-top: 0; }
.wk-content .tocnumber { color: var(--muted); margin-right: 4px; }
.wk-content .toctogglelabel { cursor: pointer; color: var(--muted); font-size: 13px; }
.wk-content .toctogglelabel::before { content: '[hide]'; }
:lang(ru) .wk-content .toctogglelabel::before { content: '[скрыть]'; }
.wk-content .toctogglecheckbox:checked ~ ul { display: none; }
.wk-content .toctogglecheckbox:checked + .toctitle .toctogglelabel::before { content: '[show]'; }
:lang(ru) .wk-content .toctogglecheckbox:checked + .toctitle .toctogglelabel::before { content: '[показать]'; }

/* card infobox */
.portable-infobox {
	float: right;
	clear: right;
	width: 270px;
	margin: 0 0 16px 22px;
	background: rgba(0, 0, 0, 0.38);
	border: 1px solid var(--line);
	border-radius: 8px;
	overflow: hidden;
	font-size: 14px;
}
.portable-infobox .pi-title { margin: 0; padding: 8px 12px; background: rgba(232, 184, 96, 0.16); color: var(--gold-2); font: 400 22px/1.2 'Stylo', Georgia, serif; text-align: center; border: 0; }
.portable-infobox .pi-image { margin: 0; padding: 10px; text-align: center; }
.portable-infobox .pi-image img { display: inline-block; }
.portable-infobox .pi-data { display: flex; gap: 10px; padding: 5px 12px; border-top: 1px solid rgba(224, 178, 90, 0.14); }
.portable-infobox .pi-data-label { flex: 0 0 44%; margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.5; }
.portable-infobox .pi-data-value { flex: 1; }
.portable-infobox .pi-group { margin: 0; }
.portable-infobox .pi-header { margin: 0; padding: 5px 12px; background: rgba(232, 184, 96, 0.1); color: var(--gold); font: 400 17px/1.3 'Stylo', Georgia, serif; text-align: center; border: 0; }

/* collapsible questions of the FAQ */
.mw-collapsible > tbody > tr:first-child > th { cursor: pointer; position: relative; padding-right: 34px; }
.mw-collapsible > tbody > tr:first-child > th::after { content: '−'; position: absolute; right: 12px; top: 6px; color: var(--gold); font-size: 18px; }
.mw-collapsible.mw-collapsed > tbody > tr:first-child > th::after { content: '+'; }
.mw-collapsible.mw-collapsed > tbody > tr:not(:first-child) { display: none; }
.wk-content table.mw-collapsible { width: 100%; }

/* category grid and lists */
.wk-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.wk-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; height: 100%; border-radius: 8px; background: rgba(0, 0, 0, 0.3); border: 1px solid transparent; text-align: center; }
.wk-grid a:hover { border-color: var(--line); background: rgba(232, 184, 96, 0.08); text-decoration: none; }
.wk-grid img { width: 80px; height: 100px; object-fit: contain; }
.wk-grid__noimg { width: 80px; height: 100px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); }
.wk-columns { columns: 3 200px; column-gap: 24px; padding-left: 18px; }
.wk-columns li { break-inside: avoid; }
.wk-columns small { color: var(--muted); }

.wk-cats { margin-top: 22px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, 0.3); font-size: 14px; }
.wk-cats span { color: var(--muted); margin-right: 4px; }
.wk-cats a { display: inline-block; margin: 2px 6px 2px 0; padding: 1px 10px; border-radius: 12px; background: rgba(232, 184, 96, 0.1); }

.wk-foot { padding: 18px 16px 26px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- narrow screens */
@media (max-width: 1100px) {
	.wk-top__in { gap: 8px 14px; }
	.wk-nav { border-top: 0; }
	.wk-nav__list { justify-content: flex-start; }
	.wk-burger {
		display: block;
		order: 2;
		margin-left: auto;
		padding: 7px 14px;
		border: 1px solid var(--line);
		border-radius: 16px;
		background: rgba(255, 255, 255, 0.06);
		color: var(--gold);
		font: 400 16px 'Stylo', Georgia, serif;
		cursor: pointer;
	}
	.wk-tools { order: 3; margin-left: 0; }
	.wk-nav { order: 4; flex-basis: 100%; display: none; }
	.wk-top.is-open .wk-nav { display: block; max-height: calc(100vh - 120px); overflow: auto; }
	.wk-nav__list { display: block; padding-bottom: 10px; }
	.wk-nav__top { padding: 8px 4px; }
	.wk-nav__sub { position: static; visibility: visible; opacity: 1; transform: none; box-shadow: none; border: 0; background: none; padding: 0 0 4px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
	.wk-nav__sub a { padding: 4px 8px; }
}
@media (max-width: 760px) {
	body { font-size: 15px; background-attachment: scroll; }
	.wk-top { position: static; }
	.wk-logo img { width: 140px; }
	.wk-tools { order: 5; flex-basis: 100%; }
	.wk-nav { order: 6; }
	.wk-search { flex: 1; }
	.wk-search input { width: 100%; }
	.wk-search__list { left: 0; right: auto; width: 100%; }
	.wk-page { margin: 0; padding: 16px 16px 24px; border-radius: 0; border-left: 0; border-right: 0; }
	.wk-title { font-size: 28px; }
	.portable-infobox { float: none; width: auto; max-width: 360px; margin: 0 auto 16px; }
	.wk-content .mw-halign-right, .wk-content .tright { float: none; margin: 0 auto 12px; }
	.wk-content .toc { display: block; }
}
