/* EvrenselKO rankings page (rankings.html). Loaded after styles.css: its tokens, .tabs, .board__filter, .rank, .pill,
   .tug and .board__empty are reused as they are. */

.rk {
	flex: 1;
	padding: 116px 0 80px;
	background: radial-gradient(1100px 520px at 50% -120px, rgba(231, 181, 94, 0.1), transparent 65%), var(--bg);
}
.rk__inner { width: min(1280px, 100% - 32px); margin-inline: auto; }
.rk__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rk__faint { color: var(--faint); }
.rk__num { text-align: right; font-variant-numeric: tabular-nums; }

/* Head: the title, and the two nations' totals with their bar. */
.rk__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 48px; margin-bottom: 28px; }
.rk__head h1 { margin-top: 12px; font: 600 clamp(30px, 5vw, 46px)/1.1 var(--display); letter-spacing: 0.01em; }
.rk__lead { margin-top: 12px; max-width: 60ch; color: var(--muted); }
.rk__lead span { color: var(--faint); white-space: nowrap; }
.rk__nations { flex: 0 1 340px; min-width: 260px; }
/* Hidden until the export's totals come, but its room kept (owner 2026-11-19: review), as the home page's nation bar:
   display: none let the head grow when they came. */
.rk__nations[hidden] { display: block; visibility: hidden; }
.rk__totals { display: flex; justify-content: space-between; gap: 12px; }
.rk__totals .pill { height: auto; padding: 0; border: 0; gap: 6px; font-size: 13px; }
.rk__totals .pill--karus { color: color-mix(in srgb, var(--karus) 75%, #fff); }
.rk__totals .pill--elmorad { flex-direction: row-reverse; color: color-mix(in srgb, var(--elmorad) 75%, #fff); }
.rk__nations .tug { margin: 8px 0 0; }
.rk__cap { margin-top: 8px; color: var(--faint); font-size: 12px; text-align: center; }

/* The list beside the card. */
/* min-height: the filled tables' height (measured 633 px at 1280 px), so the footer is not pushed down when they come (a
   0.22 layout shift on the live page; owner 2026-11-19: "page loading affects"). Only while loading (rankings.js drops
   data-loading after the first answer, data or not: a short list or the "no rankings yet" text keeps its own height)
   and only in the two-column layout it was measured in (one column below 1001 px stacks the card under the list). */
.rk__grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
@media (min-width: 1001px) { .rk__grid[data-loading] { min-height: 633px; } }
.rk__list,
.rk__card { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(11, 15, 24, 0.95); }
.rk__list { min-width: 0; overflow: hidden; }

.rk__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.rk__filter { padding: 0; flex: 0 0 auto; }
.rk__filter button { flex: 0 0 auto; height: 34px; padding: 0 14px; }
.rk__search { position: relative; flex: 1 1 220px; min-width: 0; }
.rk__search svg { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--faint); pointer-events: none; }
.rk__search input {
	width: 100%;
	height: 38px;
	padding: 0 14px 0 38px;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.3);
	color: var(--text);
	font: 500 14.5px/1 var(--body);
}
.rk__search input::placeholder { color: var(--faint); }
.rk__search input:focus { outline: 0; border-color: rgba(231, 181, 94, 0.6); box-shadow: 0 0 0 3px rgba(231, 181, 94, 0.14); }
.rk__count { min-height: 18px; padding: 10px 18px 0; color: var(--faint); font-size: 12.5px; }

.rk__panel.is-empty { display: none; }
.rk__table { width: 100%; border-collapse: collapse; font-size: 15px; }
.rk__table th {
	padding: 12px 14px;
	text-align: left;
	color: var(--faint);
	font: 600 11px/1 var(--body);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	border-bottom: 1px solid var(--line);
}
.rk__table th.rk__num { text-align: right; }
.rk__table th:first-child,
.rk__table td:first-child { width: 58px; padding-left: 16px; }
.rk__table td { padding: 9px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.045); color: var(--muted); }
.rk__table tbody tr { cursor: pointer; transition: background 0.15s ease; }
.rk__table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
.rk__table tbody tr.is-selected { background: linear-gradient(90deg, rgba(231, 181, 94, 0.13), rgba(231, 181, 94, 0.03) 75%); box-shadow: inset 3px 0 0 var(--gold); }
.rk__table tbody tr:last-child td { border-bottom: 0; }
.rk__np { color: var(--text); font-weight: 600; }
.rk__who { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); font-weight: 600; text-decoration: none; }
.rk__who span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.rk__who small { display: block; color: var(--faint); font-weight: 400; font-size: 12.5px; }
.rk__who:hover span { color: var(--gold-hi); }
.rk__who:hover small { color: var(--faint); }
.rk__class { flex: none; object-fit: contain; }
.rk__list .board__empty { padding: 48px 20px 56px; }

/* The card. */
.rk__detail { position: sticky; top: 92px; max-height: calc(100vh - 116px); overflow-y: auto; scrollbar-width: thin; border-radius: var(--radius); }
.rk__detail:focus { outline: 0; }
.rk__card { position: relative; padding: 22px; }
.rk__hint { padding: 28px 8px; color: var(--muted); text-align: center; }
.rk__hint strong { color: var(--text); }
.rk__close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: none;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 1px solid var(--line-strong);
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35);
	color: var(--text);
	cursor: pointer;
}
.rk__close svg { width: 16px; height: 16px; }
.rk__who-head { display: flex; align-items: center; gap: 14px; }
.rk__who-head .rk__class,
.rk__crest { width: 56px; height: 56px; padding: 6px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.35); }
.rk__who-head--karus .eyebrow { color: color-mix(in srgb, var(--karus) 75%, #fff); }
.rk__who-head--elmorad .eyebrow { color: color-mix(in srgb, var(--elmorad) 75%, #fff); }
/* A name exactly as written (owner 2026-11-19: "use names as it is anywhere"): the body face, as Cinzel has capitals only. */
.rk__who-head h2 { margin-top: 8px; font: 700 24px/1.15 var(--body); letter-spacing: 0; overflow-wrap: anywhere; }
.rk__clan { margin-top: 4px; min-height: 20px; color: var(--muted); font-size: 14px; }
.rk__clan a { color: var(--gold); text-decoration: none; }
.rk__clan a:hover { text-decoration: underline; }
.rk__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; }
.rk__stats div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.025); }
.rk__stats dt { color: var(--faint); font: 600 10.5px/1.2 var(--body); letter-spacing: 0.1em; text-transform: uppercase; }
.rk__stats dd { margin: 6px 0 0; font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.rk__sub { margin: 22px 0 12px; font: 600 12px/1 var(--body); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.rk__note { color: var(--muted); font-size: 14px; }
.rk__note--stat { margin-top: 10px; font-size: 13px; }
.rk__bar .tabs button[hidden] { display: none; }

/* What the character wears: the game's inventory window, three slots to a row in the server's slot order; in the last row the
   gloves are under the right ring and the boots under the legs (owner 2026-11-16: "the boots should be under pad not on
   the right"; they stood in the third column). */
.doll {
	display: grid;
	grid-template-columns: repeat(3, 58px);
	justify-content: center;
	gap: 8px 22px;
	padding: 18px 12px;
	border: 1px solid rgba(231, 181, 94, 0.22);
	border-radius: 14px;
	background:
		radial-gradient(160px 220px at 50% 45%, rgba(231, 181, 94, 0.08), transparent 70%),
		linear-gradient(180deg, #121722, #0a0d14);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 18px 40px -24px rgba(0, 0, 0, 0.9);
}
.doll__slot {
	display: grid;
	place-items: center;
	width: 58px;
	height: 58px;
	border: 1px solid #2a3140;
	border-radius: 8px;
	background: linear-gradient(180deg, #0a0c12, #141925);
	box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.doll__slot--13 { grid-column: 2; }
.doll__slot img { width: 45px; height: 45px; border-radius: 4px; image-rendering: auto; }
.doll__unknown { color: var(--faint); font: 700 20px/1 var(--display); }
.doll__slot.is-worn { border-color: #4a5466; }
.doll__slot.is-worn { position: relative; cursor: default; outline: none; }
.doll__slot.is-worn:hover,
.doll__slot.is-worn:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(231, 181, 94, 0.25), inset 0 2px 6px rgba(0, 0, 0, 0.8); z-index: 3; }

/* The item's tooltip over its slot, as the game shows one on hover: the name in its grade's colour, then the grade
   and the slot. */
.doll__tip {
	position: absolute;
	z-index: 5;
	display: none;
	width: max-content;
	max-width: 220px;
	padding: 8px 10px;
	border: 1px solid rgba(231, 181, 94, 0.45);
	border-radius: 6px;
	background: rgba(6, 8, 13, 0.96);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
	text-align: left;
	pointer-events: none;
}
.doll__slot:hover > .doll__tip,
.doll__slot:focus > .doll__tip { display: grid; gap: 2px; }
.doll__tip b { font-size: 13.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.doll__tip small { color: var(--faint); font-size: 12px; }
.doll__tip--down { top: calc(100% + 6px); }
.doll__tip--up { bottom: calc(100% + 6px); }
.doll__tip--c0 { left: 0; }
.doll__tip--c1 { left: 50%; transform: translateX(-50%); }
.doll__tip--c2 { right: 0; }
/* Item grades (ITEM.ItemType), in the colours the game writes the names in. */
.g-1 { color: #7fb2ff; }
.g-2 { color: #ffe27a; }
.g-3 { color: #8be28f; }
.g-4 { color: #f0b45a; }
.g-5 { color: #c9a2ff; }
.g-6 { color: #7fe0d6; }
.doll__slot.g-1 { border-color: #33558f; }
.doll__slot.g-2 { border-color: #8f7a2c; }
.doll__slot.g-3 { border-color: #3d7f43; }
.doll__slot.g-4 { border-color: #9a6a26; }
.doll__slot.g-5 { border-color: #6a4f9a; }
.doll__slot.g-6 { border-color: #2f7f78; }

/* A clan's ranked members. */
.rk__members { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rk__members a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14.5px; }
.rk__members a:hover { border-color: rgba(231, 181, 94, 0.45); background: rgba(231, 181, 94, 0.06); }
.rk__members-rank { flex: 0 0 38px; color: var(--faint); font-variant-numeric: tabular-nums; }
.rk__members-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rk__members .rk__class { width: 20px; height: 20px; padding: 0; border: 0; background: none; }

/* Narrow screens: the list takes the page and the card opens over it. */
@media (max-width: 1000px) {
	.rk__grid { grid-template-columns: minmax(0, 1fr); }
	.rk__detail {
		position: fixed;
		inset: 0;
		z-index: 80;
		display: none;
		max-height: none;
		padding: 16px 12px 24px;
		border-radius: 0;
		background: rgba(4, 6, 10, 0.82);
		overscroll-behavior: contain;
	}
	.rk__detail.is-open { display: block; }
	.rk__card { width: min(440px, 100%); margin: 0 auto; }
	.rk__close { display: grid; }
	.rk__who-head { padding-right: 40px; }
	html.rk-lock { overflow: hidden; }
}
@media (max-width: 640px) {
	.rk { padding-top: 96px; }
	.rk__hide-sm { display: none; }
	.rk__bar { padding: 12px; }
	.rk__filter { flex: 1 1 auto; }
	.rk__filter button { flex: 1; }
	.rk__table th:first-child,
	.rk__table td:first-child { width: 48px; padding-left: 12px; }
	.rk__table td,
	.rk__table th { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
	.doll__slot,
	.rk__table tbody tr { transition: none; }
}
