/* ==========================================================================
   Rankings hub (/ranking/) — prefix rh-. Dark "arena" hero, sticky filter bar, leaderboard cards with podium.
   ========================================================================== */

.rh { background: var(--color-bg); }

/* ---------- Hero ---------- */
.rh-hero { position: relative; overflow: hidden; background: var(--color-dark); color: var(--color-on-dark); }
.rh-hero__glow {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		radial-gradient(760px 380px at 85% 10%, rgba(122, 91, 255, .28), transparent 62%),
		radial-gradient(560px 300px at 5% 100%, rgba(83, 74, 183, .3), transparent 60%);
}
.rh-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
	background-size: 44px 44px;
	-webkit-mask-image: radial-gradient(ellipse 70% 90% at 70% 20%, #000, transparent 75%);
	mask-image: radial-gradient(ellipse 70% 90% at 70% 20%, #000, transparent 75%);
}
.rh-hero__in { position: relative; z-index: 1; padding-top: 26px; padding-bottom: 38px; }
.rh-crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 44px; font-size: .8125rem; color: var(--color-on-dark-muted); }
.rh-crumbs a { color: var(--color-on-dark-muted); }
.rh-crumbs a:hover { color: #fff; }
.rh-crumbs [aria-current] { color: #fff; }
.rh-hero .eyebrow { color: var(--color-accent-soft); }
.rh-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: end; }
.rh-h1 {
	max-width: 17ch;
	margin: 0 0 20px;
	font-family: var(--font-heading);
	font-size: clamp(2.5rem, 5.6vw, 4.25rem);
	font-weight: 700;
	line-height: 1.02;
	letter-spacing: var(--tracking-tight);
	color: #fff;
}
.rh-accent { background: linear-gradient(100deg, #c3b8ff, var(--color-accent-soft) 40%, #7a5bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rh-lead { max-width: 56ch; margin: 0 0 28px; font-size: var(--fs-lead); line-height: 1.6; color: var(--color-on-dark-muted); }

.rh-search {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 620px;
	padding: 0 16px;
	border: 1.5px solid var(--color-border-dark);
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, .07);
	color: var(--color-on-dark-muted);
	transition: border-color .2s, background .2s, box-shadow .2s;
}
.rh-search[hidden] { display: none; }
.rh-search:focus-within { border-color: var(--color-accent-soft); background: rgba(255, 255, 255, .1); box-shadow: 0 0 0 4px rgba(122, 91, 255, .22); }
.rh-search .icon { flex-shrink: 0; }
.rh-search__input {
	flex: 1;
	min-width: 0;
	height: 58px;
	border: 0;
	background: transparent;
	font: inherit;
	font-size: 1rem;
	color: #fff;
	outline: 0;
}
.rh-search__input::placeholder { color: var(--color-on-dark-subtle); }
.rh-search__input::-webkit-search-cancel-button { filter: invert(1); }
.rh-search__kbd { padding: 2px 8px; border: 1px solid var(--color-border-dark); border-radius: var(--radius-xs); font-size: .75rem; color: var(--color-on-dark-subtle); }
.rh-search:focus-within .rh-search__kbd { display: none; }

.rh-stats { display: grid; gap: 14px; margin: 0; }
.rh-stat { display: flex; flex-direction: column-reverse; gap: 6px; padding-left: 18px; border-left: 2px solid rgba(169, 153, 255, .45); }
.rh-stat:first-child { border-left-color: var(--color-accent); }
.rh-stat__v { margin: 0; font-family: var(--font-heading); font-size: var(--fs-stat); font-weight: 700; line-height: 1; letter-spacing: -.02em; color: #fff; }
.rh-stat__l { margin: 0; font-size: .75rem; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-on-dark-subtle); }

.rh-hero__note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 34px 0 0; font-size: .8125rem; color: var(--color-on-dark-subtle); }
.rh-hero__note .icon { color: var(--color-accent-soft); }
.rh-hero__more { color: var(--color-accent-soft); text-decoration: underline; text-underline-offset: 3px; }
.rh-hero__more:hover { color: #fff; }

/* ---------- Sticky filter bar ---------- */
.rh-bar {
	position: sticky;
	top: var(--header-height);
	z-index: 30;
	border-bottom: 1px solid var(--color-border);
	background: rgba(247, 246, 251, .9);
	-webkit-backdrop-filter: saturate(140%) blur(14px);
	backdrop-filter: saturate(140%) blur(14px);
}
.rh-bar[hidden] { display: none; }
.admin-bar .rh-bar { top: calc(var(--header-height) + 32px); }
@media (max-width: 782px) { .admin-bar .rh-bar { top: calc(var(--header-height) + 46px); } }
@media (max-width: 600px) { .admin-bar .rh-bar { top: var(--header-height); } }
.rh-bar__in { display: flex; align-items: center; gap: 18px; padding-top: 12px; padding-bottom: 12px; }
.rh-chips { display: flex; flex: 1; gap: 8px; min-width: 0; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.rh-chips::-webkit-scrollbar { display: none; }
.rh-chips-wrap { position: relative; display: flex; flex: 1; min-width: 0; }
.rh-chips-wrap .rh-chips { flex: 1; cursor: grab; scroll-behavior: auto; -webkit-overflow-scrolling: touch; }
.rh-chips.is-drag { cursor: grabbing; user-select: none; }
.rh-chips.is-drag .rh-chip { pointer-events: none; }
.rh-chips-wrap.has-prev .rh-chips { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 44px); mask-image: linear-gradient(90deg, transparent 0, #000 44px); }
.rh-chips-wrap.has-next .rh-chips { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent 100%); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent 100%); }
.rh-chips-wrap.has-prev.has-next .rh-chips { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 44px, #000 calc(100% - 44px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 44px, #000 calc(100% - 44px), transparent 100%); }
.rh-chips-nav { position: absolute; top: 50%; z-index: 2; display: none; place-items: center; width: 30px; height: 30px; transform: translateY(-50%); border: 1px solid var(--color-border); border-radius: 50%; background: var(--color-surface, #fff); color: var(--color-text); box-shadow: 0 2px 8px rgba(38, 33, 92, .12); cursor: pointer; }
.rh-chips-nav:hover { border-color: var(--color-accent); }
.rh-chips-nav--prev { left: 0; }
.rh-chips-nav--next { right: 0; }
.rh-chips-wrap.has-prev .rh-chips-nav--prev, .rh-chips-wrap.has-next .rh-chips-nav--next { display: grid; }
.rh-chip {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
	border: 1.5px solid var(--color-border);
	border-radius: var(--radius-pill);
	background: var(--color-surface);
	font: inherit;
	font-size: .875rem;
	font-weight: 500;
	color: var(--color-text-soft);
	cursor: pointer;
	transition: border-color .2s, background .2s, color .2s;
}
.rh-chip:hover { border-color: var(--color-accent); color: var(--color-text); }
.rh-chip[aria-pressed="true"] { border-color: var(--color-deep); background: var(--color-deep); color: #fff; }
.rh-chip__n { padding: 1px 7px; border-radius: var(--radius-pill); background: var(--color-lavender); font-size: .6875rem; color: var(--color-indigo); }
.rh-chip[aria-pressed="true"] .rh-chip__n { background: rgba(255, 255, 255, .16); color: #fff; }
.rh-sort { display: flex; flex-shrink: 0; align-items: center; gap: 8px; }
.rh-sort__l { font-size: .75rem; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-text-subtle); }
.rh-sort__s {
	padding: 9px 34px 9px 14px;
	border: 1.5px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: var(--color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23534AB7' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") right 10px center / 16px no-repeat;
	font: inherit;
	font-size: .875rem;
	color: var(--color-text);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.rh-sort__s:hover { border-color: var(--color-accent); }

/* ---------- List ---------- */
.rh-list { padding-top: 34px; padding-bottom: 20px; }
.rh-count { margin: 0 0 4px; font-size: .8125rem; color: var(--color-text-subtle); }
.rh-count[hidden] { display: none; }
.rh .rh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--space-md); margin: 0; padding: 0; list-style: none; }

.rh-group { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 14px; row-gap: 2px; margin-top: 30px; padding-bottom: 14px; border-bottom: 1px solid var(--color-border); }
.rh-group:first-child { margin-top: 0; }
.rh-group__ico { grid-row: 1 / 3; display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius-sm); background: var(--color-lavender); color: var(--color-indigo); }
.rh-group__t { margin: 0; font-family: var(--font-heading); font-size: 1.375rem; font-weight: 600; letter-spacing: -.01em; color: var(--color-text); }
.rh-group__d { margin: 0; font-size: .875rem; color: var(--color-text-muted); }
.rh-group[hidden], .rh-card[hidden] { display: none; }

/* ---------- Card ---------- */
.rh-card {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 22px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	background: var(--color-surface);
	transition: transform var(--transition), border-color .2s, box-shadow var(--transition);
}
.rh-card:hover, .rh-card:focus-within { transform: translateY(-3px); border-color: var(--color-border-accent); box-shadow: var(--shadow-card-hover); }
.rh-card__top { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.rh-card__n { padding: 4px 9px; border: 1px solid var(--color-border); border-radius: var(--radius-xs); font-size: .6875rem; letter-spacing: .04em; color: var(--color-text-muted); }
.rh-card__badge { padding: 4px 9px; border-radius: var(--radius-xs); background: var(--color-accent-tint); font-size: .6875rem; letter-spacing: .04em; color: var(--color-indigo); }
.rh-card__t { margin: 0 0 6px; font-family: var(--font-heading); font-size: 1.3125rem; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.rh-card__a { color: var(--color-text); }
.rh-card__a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.rh-card__a:focus-visible { outline: 0; }
.rh-card:has(.rh-card__a:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.rh-card__tally { margin: -4px 0 16px; font-size: .75rem; line-height: 1.5; color: var(--color-text-subtle); }
.rh-card__q { margin: 0 0 18px; font-size: .9375rem; line-height: 1.5; color: var(--color-text-muted); }

.rh .rh-podium { display: grid; gap: 10px; margin: 0 0 16px; padding: 14px; border-radius: var(--radius-md); background: var(--color-bg); list-style: none; }
.rh-pod { display: grid; grid-template-columns: 24px 30px minmax(0, 1fr) auto; grid-template-areas: "pos logo name idx" ". . bar bar"; align-items: center; gap: 2px 10px; }
.rh-pod__pos { grid-area: pos; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--color-lavender); font-size: .75rem; font-weight: 600; color: var(--color-indigo); }
.rh-pod--1 .rh-pod__pos { background: var(--color-accent); color: #fff; }
.rh-pod .tool-logo, .rh-pod .rk-logo { grid-area: logo; width: 30px; height: 30px; border-radius: 8px; }
.rh-pod .rk-logo { display: grid; place-items: center; background: var(--color-lavender); font-weight: 600; letter-spacing: -.02em; color: var(--color-indigo); font-size: .6875rem !important; }
.rh-pod__name { grid-area: name; overflow: hidden; font-size: .9375rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text); }
.rh-pod--1 .rh-pod__name { font-weight: 600; }
.rh-pod__idx { grid-area: idx; font-size: .875rem; font-weight: 500; color: var(--color-deep); }
.rh-pod__bar { grid-area: bar; height: 4px; overflow: hidden; border-radius: 4px; background: var(--color-border-soft); }
.rh-pod__bar i { display: block; height: 100%; border-radius: 4px; background: var(--color-primary); }
.rh-pod--1 .rh-pod__bar i { background: var(--color-accent); }

.rh-card__match { margin: 0 0 14px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--color-accent-tint); font-size: .8125rem; line-height: 1.45; color: var(--color-indigo); }
.rh-card__match[hidden] { display: none; }
.rh-card__match mark { background: none; font-weight: 600; color: var(--color-deep); }
.rh-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 4px; }
.rh-card__date { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--color-text-subtle); }
.rh-card__go { display: inline-flex; align-items: center; gap: 6px; font-size: .9375rem; font-weight: 500; color: var(--color-accent); transition: gap .2s; }
.rh-card:hover .rh-card__go { gap: 10px; }

/* ---------- Empty state ---------- */
.rh-empty { max-width: 520px; margin: 40px auto 20px; padding: 36px 28px; border: 1px dashed var(--color-border-strong); border-radius: var(--radius-xl); background: var(--color-surface); text-align: center; }
.rh-empty[hidden] { display: none; }
.rh-empty__t { margin: 0 0 8px; font-family: var(--font-heading); font-size: 1.25rem; font-weight: 600; color: var(--color-text); }
.rh-empty__d { margin: 0 0 20px; color: var(--color-text-muted); }
.rh-empty__a { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------- Method band ---------- */
.rh-how { margin-top: 64px; }
.rh-how__head { max-width: 680px; margin-bottom: 36px; }
.rh-how__head .eyebrow { color: var(--color-accent-soft); }
.rh-how__t { margin: 0 0 14px; font-family: var(--font-heading); font-size: var(--fs-h2-sm); font-weight: 600; letter-spacing: var(--tracking-tight); line-height: 1.1; color: #fff; }
.rh-how__d { margin: 0; line-height: 1.65; color: var(--color-on-dark-muted); }
.rh-pillars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin: 0 0 36px; padding: 0; list-style: none; }
.rh-pillar { position: relative; padding: 20px 18px; border: 1px solid var(--color-border-dark); border-radius: var(--radius-lg); background: var(--color-dark-surface); }
.rh-pillar__l { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 16px; border-radius: var(--radius-xs); background: rgba(122, 91, 255, .2); font-size: .9375rem; font-weight: 600; color: var(--color-accent-soft); }
.rh-pillar__w { position: absolute; top: 20px; right: 18px; font-size: .8125rem; color: var(--color-on-dark-subtle); }
.rh-pillar__n { margin: 0 0 6px; font-family: var(--font-heading); font-size: 1rem; font-weight: 600; color: #fff; }
.rh-pillar__d { margin: 0; font-size: .8125rem; line-height: 1.5; color: var(--color-on-dark-muted); }
.rh-how__cta { display: flex; flex-wrap: wrap; gap: 14px; }
.rh-btn-ghost { border-color: var(--color-border-dark); background: transparent; color: #fff; }
.rh-btn-ghost:hover { border-color: var(--color-accent-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
	.rh-hero__grid { grid-template-columns: 1fr; gap: 32px; }
	.rh-stats { grid-template-columns: repeat(3, 1fr); gap: 18px; }
	.rh-pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
	.rh-crumbs { margin-bottom: 28px; }
	.rh-bar__in { flex-wrap: wrap; gap: 10px; }
	.rh-chips { flex-basis: 100%; }
	.rh-sort { margin-left: auto; }
	.rh-stat__v { font-size: 1.875rem; }
	.rh-stat { padding-left: 12px; }
	.rh-pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
	.rh-stats { grid-template-columns: 1fr 1fr 1fr; }
	.rh-stat__l { font-size: .625rem; }
	.rh-search__kbd { display: none; }
	.rh-pillars { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	.rh-card, .rh-card__go { transition: none; }
	.rh-card:hover, .rh-card:focus-within { transform: none; }
}
